parse-tmx 2.15.0 → 2.15.1
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/index.js +182 -1476
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -211,15 +211,13 @@ const unpackTileBytes = (buffer, expectedCount) => {
|
|
|
211
211
|
|
|
212
212
|
//#endregion
|
|
213
213
|
//#region ../shared/dist/index.js
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
return BinaryOperator$1;
|
|
222
|
-
}({});
|
|
214
|
+
var InvalidOperationError = class extends Error {
|
|
215
|
+
constructor(operation, name, message) {
|
|
216
|
+
super(`Invalid operation: ${operation}, name: ${name}, ${message}`);
|
|
217
|
+
this.name = "InvalidOperationError";
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
const getPropertyNames = () => new Proxy({}, { get: (_target, property) => property });
|
|
223
221
|
Object.freeze({ status: "aborted" });
|
|
224
222
|
function $constructor(name, initializer$2, params) {
|
|
225
223
|
function init(inst, def$1) {
|
|
@@ -296,17 +294,6 @@ function cleanRegex(source) {
|
|
|
296
294
|
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
297
295
|
return source.slice(start, end);
|
|
298
296
|
}
|
|
299
|
-
function floatSafeRemainder(val, step) {
|
|
300
|
-
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
301
|
-
const stepString = step.toString();
|
|
302
|
-
let stepDecCount = (stepString.split(".")[1] || "").length;
|
|
303
|
-
if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
|
|
304
|
-
const match = stepString.match(/\d?e-(\d?)/);
|
|
305
|
-
if (match?.[1]) stepDecCount = Number.parseInt(match[1]);
|
|
306
|
-
}
|
|
307
|
-
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
308
|
-
return Number.parseInt(val.toFixed(decCount).replace(".", "")) % Number.parseInt(step.toFixed(decCount).replace(".", "")) / 10 ** decCount;
|
|
309
|
-
}
|
|
310
297
|
const EVALUATING = Symbol("evaluating");
|
|
311
298
|
function defineLazy(object$1, key, getter) {
|
|
312
299
|
let value = void 0;
|
|
@@ -404,13 +391,7 @@ function optionalKeys(shape) {
|
|
|
404
391
|
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
405
392
|
});
|
|
406
393
|
}
|
|
407
|
-
|
|
408
|
-
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
409
|
-
int32: [-2147483648, 2147483647],
|
|
410
|
-
uint32: [0, 4294967295],
|
|
411
|
-
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
412
|
-
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
413
|
-
};
|
|
394
|
+
Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, -Number.MAX_VALUE, Number.MAX_VALUE;
|
|
414
395
|
function pick(schema, mask) {
|
|
415
396
|
const currDef = schema._zod.def;
|
|
416
397
|
return clone(schema, mergeDefs(schema._zod.def, {
|
|
@@ -724,64 +705,6 @@ const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
724
705
|
const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
725
706
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
726
707
|
};
|
|
727
|
-
const cuid = /^[cC][^\s-]{8,}$/;
|
|
728
|
-
const cuid2 = /^[0-9a-z]+$/;
|
|
729
|
-
const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
|
|
730
|
-
const xid = /^[0-9a-vA-V]{20}$/;
|
|
731
|
-
const ksuid = /^[A-Za-z0-9]{27}$/;
|
|
732
|
-
const nanoid = /^[a-zA-Z0-9_-]{21}$/;
|
|
733
|
-
/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
|
|
734
|
-
const duration$1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
735
|
-
/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
|
|
736
|
-
const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
737
|
-
/** Returns a regex for validating an RFC 9562/4122 UUID.
|
|
738
|
-
*
|
|
739
|
-
* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
|
|
740
|
-
const uuid$1 = (version$1) => {
|
|
741
|
-
if (!version$1) 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)$/;
|
|
742
|
-
return /* @__PURE__ */ new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version$1}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
743
|
-
};
|
|
744
|
-
/** Practical email validation */
|
|
745
|
-
const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
746
|
-
const _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
747
|
-
function emoji() {
|
|
748
|
-
return new RegExp(_emoji$1, "u");
|
|
749
|
-
}
|
|
750
|
-
const ipv4 = /^(?:(?: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])$/;
|
|
751
|
-
const ipv6 = /^(([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}|:))$/;
|
|
752
|
-
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])$/;
|
|
753
|
-
const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
754
|
-
const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
755
|
-
const base64url = /^[A-Za-z0-9_-]*$/;
|
|
756
|
-
const hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
|
|
757
|
-
const e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
|
|
758
|
-
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])))`;
|
|
759
|
-
const date$2 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
|
|
760
|
-
function timeSource(args) {
|
|
761
|
-
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
762
|
-
return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
763
|
-
}
|
|
764
|
-
function time$1(args) {
|
|
765
|
-
return /* @__PURE__ */ new RegExp(`^${timeSource(args)}$`);
|
|
766
|
-
}
|
|
767
|
-
function datetime$1(args) {
|
|
768
|
-
const time$2 = timeSource({ precision: args.precision });
|
|
769
|
-
const opts = ["Z"];
|
|
770
|
-
if (args.local) opts.push("");
|
|
771
|
-
if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
|
|
772
|
-
const timeRegex = `${time$2}(?:${opts.join("|")})`;
|
|
773
|
-
return /* @__PURE__ */ new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
774
|
-
}
|
|
775
|
-
const string$1 = (params) => {
|
|
776
|
-
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
777
|
-
return /* @__PURE__ */ new RegExp(`^${regex}$`);
|
|
778
|
-
};
|
|
779
|
-
const integer = /^-?\d+$/;
|
|
780
|
-
const number$1 = /^-?\d+(?:\.\d+)?/;
|
|
781
|
-
const boolean$1 = /^(?:true|false)$/i;
|
|
782
|
-
const _null$2 = /^null$/i;
|
|
783
|
-
const lowercase = /^[^A-Z]*$/;
|
|
784
|
-
const uppercase = /^[^a-z]*$/;
|
|
785
708
|
const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def$1) => {
|
|
786
709
|
var _a;
|
|
787
710
|
inst._zod ?? (inst._zod = {});
|
|
@@ -837,92 +760,6 @@ const $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan"
|
|
|
837
760
|
});
|
|
838
761
|
};
|
|
839
762
|
});
|
|
840
|
-
const $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def$1) => {
|
|
841
|
-
$ZodCheck.init(inst, def$1);
|
|
842
|
-
inst._zod.onattach.push((inst$1) => {
|
|
843
|
-
var _a;
|
|
844
|
-
(_a = inst$1._zod.bag).multipleOf ?? (_a.multipleOf = def$1.value);
|
|
845
|
-
});
|
|
846
|
-
inst._zod.check = (payload) => {
|
|
847
|
-
if (typeof payload.value !== typeof def$1.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
848
|
-
if (typeof payload.value === "bigint" ? payload.value % def$1.value === BigInt(0) : floatSafeRemainder(payload.value, def$1.value) === 0) return;
|
|
849
|
-
payload.issues.push({
|
|
850
|
-
origin: typeof payload.value,
|
|
851
|
-
code: "not_multiple_of",
|
|
852
|
-
divisor: def$1.value,
|
|
853
|
-
input: payload.value,
|
|
854
|
-
inst,
|
|
855
|
-
continue: !def$1.abort
|
|
856
|
-
});
|
|
857
|
-
};
|
|
858
|
-
});
|
|
859
|
-
const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def$1) => {
|
|
860
|
-
$ZodCheck.init(inst, def$1);
|
|
861
|
-
def$1.format = def$1.format || "float64";
|
|
862
|
-
const isInt = def$1.format?.includes("int");
|
|
863
|
-
const origin = isInt ? "int" : "number";
|
|
864
|
-
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def$1.format];
|
|
865
|
-
inst._zod.onattach.push((inst$1) => {
|
|
866
|
-
const bag = inst$1._zod.bag;
|
|
867
|
-
bag.format = def$1.format;
|
|
868
|
-
bag.minimum = minimum;
|
|
869
|
-
bag.maximum = maximum;
|
|
870
|
-
if (isInt) bag.pattern = integer;
|
|
871
|
-
});
|
|
872
|
-
inst._zod.check = (payload) => {
|
|
873
|
-
const input = payload.value;
|
|
874
|
-
if (isInt) {
|
|
875
|
-
if (!Number.isInteger(input)) {
|
|
876
|
-
payload.issues.push({
|
|
877
|
-
expected: origin,
|
|
878
|
-
format: def$1.format,
|
|
879
|
-
code: "invalid_type",
|
|
880
|
-
continue: false,
|
|
881
|
-
input,
|
|
882
|
-
inst
|
|
883
|
-
});
|
|
884
|
-
return;
|
|
885
|
-
}
|
|
886
|
-
if (!Number.isSafeInteger(input)) {
|
|
887
|
-
if (input > 0) payload.issues.push({
|
|
888
|
-
input,
|
|
889
|
-
code: "too_big",
|
|
890
|
-
maximum: Number.MAX_SAFE_INTEGER,
|
|
891
|
-
note: "Integers must be within the safe integer range.",
|
|
892
|
-
inst,
|
|
893
|
-
origin,
|
|
894
|
-
continue: !def$1.abort
|
|
895
|
-
});
|
|
896
|
-
else payload.issues.push({
|
|
897
|
-
input,
|
|
898
|
-
code: "too_small",
|
|
899
|
-
minimum: Number.MIN_SAFE_INTEGER,
|
|
900
|
-
note: "Integers must be within the safe integer range.",
|
|
901
|
-
inst,
|
|
902
|
-
origin,
|
|
903
|
-
continue: !def$1.abort
|
|
904
|
-
});
|
|
905
|
-
return;
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
if (input < minimum) payload.issues.push({
|
|
909
|
-
origin: "number",
|
|
910
|
-
input,
|
|
911
|
-
code: "too_small",
|
|
912
|
-
minimum,
|
|
913
|
-
inclusive: true,
|
|
914
|
-
inst,
|
|
915
|
-
continue: !def$1.abort
|
|
916
|
-
});
|
|
917
|
-
if (input > maximum) payload.issues.push({
|
|
918
|
-
origin: "number",
|
|
919
|
-
input,
|
|
920
|
-
code: "too_big",
|
|
921
|
-
maximum,
|
|
922
|
-
inst
|
|
923
|
-
});
|
|
924
|
-
};
|
|
925
|
-
});
|
|
926
763
|
const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def$1) => {
|
|
927
764
|
var _a;
|
|
928
765
|
$ZodCheck.init(inst, def$1);
|
|
@@ -1011,123 +848,6 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
|
|
|
1011
848
|
});
|
|
1012
849
|
};
|
|
1013
850
|
});
|
|
1014
|
-
const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def$1) => {
|
|
1015
|
-
var _a, _b;
|
|
1016
|
-
$ZodCheck.init(inst, def$1);
|
|
1017
|
-
inst._zod.onattach.push((inst$1) => {
|
|
1018
|
-
const bag = inst$1._zod.bag;
|
|
1019
|
-
bag.format = def$1.format;
|
|
1020
|
-
if (def$1.pattern) {
|
|
1021
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1022
|
-
bag.patterns.add(def$1.pattern);
|
|
1023
|
-
}
|
|
1024
|
-
});
|
|
1025
|
-
if (def$1.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
|
|
1026
|
-
def$1.pattern.lastIndex = 0;
|
|
1027
|
-
if (def$1.pattern.test(payload.value)) return;
|
|
1028
|
-
payload.issues.push({
|
|
1029
|
-
origin: "string",
|
|
1030
|
-
code: "invalid_format",
|
|
1031
|
-
format: def$1.format,
|
|
1032
|
-
input: payload.value,
|
|
1033
|
-
...def$1.pattern ? { pattern: def$1.pattern.toString() } : {},
|
|
1034
|
-
inst,
|
|
1035
|
-
continue: !def$1.abort
|
|
1036
|
-
});
|
|
1037
|
-
});
|
|
1038
|
-
else (_b = inst._zod).check ?? (_b.check = () => {});
|
|
1039
|
-
});
|
|
1040
|
-
const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def$1) => {
|
|
1041
|
-
$ZodCheckStringFormat.init(inst, def$1);
|
|
1042
|
-
inst._zod.check = (payload) => {
|
|
1043
|
-
def$1.pattern.lastIndex = 0;
|
|
1044
|
-
if (def$1.pattern.test(payload.value)) return;
|
|
1045
|
-
payload.issues.push({
|
|
1046
|
-
origin: "string",
|
|
1047
|
-
code: "invalid_format",
|
|
1048
|
-
format: "regex",
|
|
1049
|
-
input: payload.value,
|
|
1050
|
-
pattern: def$1.pattern.toString(),
|
|
1051
|
-
inst,
|
|
1052
|
-
continue: !def$1.abort
|
|
1053
|
-
});
|
|
1054
|
-
};
|
|
1055
|
-
});
|
|
1056
|
-
const $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def$1) => {
|
|
1057
|
-
def$1.pattern ?? (def$1.pattern = lowercase);
|
|
1058
|
-
$ZodCheckStringFormat.init(inst, def$1);
|
|
1059
|
-
});
|
|
1060
|
-
const $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def$1) => {
|
|
1061
|
-
def$1.pattern ?? (def$1.pattern = uppercase);
|
|
1062
|
-
$ZodCheckStringFormat.init(inst, def$1);
|
|
1063
|
-
});
|
|
1064
|
-
const $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def$1) => {
|
|
1065
|
-
$ZodCheck.init(inst, def$1);
|
|
1066
|
-
const escapedRegex = escapeRegex(def$1.includes);
|
|
1067
|
-
const pattern = new RegExp(typeof def$1.position === "number" ? `^.{${def$1.position}}${escapedRegex}` : escapedRegex);
|
|
1068
|
-
def$1.pattern = pattern;
|
|
1069
|
-
inst._zod.onattach.push((inst$1) => {
|
|
1070
|
-
const bag = inst$1._zod.bag;
|
|
1071
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1072
|
-
bag.patterns.add(pattern);
|
|
1073
|
-
});
|
|
1074
|
-
inst._zod.check = (payload) => {
|
|
1075
|
-
if (payload.value.includes(def$1.includes, def$1.position)) return;
|
|
1076
|
-
payload.issues.push({
|
|
1077
|
-
origin: "string",
|
|
1078
|
-
code: "invalid_format",
|
|
1079
|
-
format: "includes",
|
|
1080
|
-
includes: def$1.includes,
|
|
1081
|
-
input: payload.value,
|
|
1082
|
-
inst,
|
|
1083
|
-
continue: !def$1.abort
|
|
1084
|
-
});
|
|
1085
|
-
};
|
|
1086
|
-
});
|
|
1087
|
-
const $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def$1) => {
|
|
1088
|
-
$ZodCheck.init(inst, def$1);
|
|
1089
|
-
const pattern = /* @__PURE__ */ new RegExp(`^${escapeRegex(def$1.prefix)}.*`);
|
|
1090
|
-
def$1.pattern ?? (def$1.pattern = pattern);
|
|
1091
|
-
inst._zod.onattach.push((inst$1) => {
|
|
1092
|
-
const bag = inst$1._zod.bag;
|
|
1093
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1094
|
-
bag.patterns.add(pattern);
|
|
1095
|
-
});
|
|
1096
|
-
inst._zod.check = (payload) => {
|
|
1097
|
-
if (payload.value.startsWith(def$1.prefix)) return;
|
|
1098
|
-
payload.issues.push({
|
|
1099
|
-
origin: "string",
|
|
1100
|
-
code: "invalid_format",
|
|
1101
|
-
format: "starts_with",
|
|
1102
|
-
prefix: def$1.prefix,
|
|
1103
|
-
input: payload.value,
|
|
1104
|
-
inst,
|
|
1105
|
-
continue: !def$1.abort
|
|
1106
|
-
});
|
|
1107
|
-
};
|
|
1108
|
-
});
|
|
1109
|
-
const $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def$1) => {
|
|
1110
|
-
$ZodCheck.init(inst, def$1);
|
|
1111
|
-
const pattern = /* @__PURE__ */ new RegExp(`.*${escapeRegex(def$1.suffix)}$`);
|
|
1112
|
-
def$1.pattern ?? (def$1.pattern = pattern);
|
|
1113
|
-
inst._zod.onattach.push((inst$1) => {
|
|
1114
|
-
const bag = inst$1._zod.bag;
|
|
1115
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1116
|
-
bag.patterns.add(pattern);
|
|
1117
|
-
});
|
|
1118
|
-
inst._zod.check = (payload) => {
|
|
1119
|
-
if (payload.value.endsWith(def$1.suffix)) return;
|
|
1120
|
-
payload.issues.push({
|
|
1121
|
-
origin: "string",
|
|
1122
|
-
code: "invalid_format",
|
|
1123
|
-
format: "ends_with",
|
|
1124
|
-
suffix: def$1.suffix,
|
|
1125
|
-
input: payload.value,
|
|
1126
|
-
inst,
|
|
1127
|
-
continue: !def$1.abort
|
|
1128
|
-
});
|
|
1129
|
-
};
|
|
1130
|
-
});
|
|
1131
851
|
const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def$1) => {
|
|
1132
852
|
$ZodCheck.init(inst, def$1);
|
|
1133
853
|
inst._zod.check = (payload) => {
|
|
@@ -1256,336 +976,6 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def$1) => {
|
|
|
1256
976
|
version: 1
|
|
1257
977
|
};
|
|
1258
978
|
});
|
|
1259
|
-
const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def$1) => {
|
|
1260
|
-
$ZodType.init(inst, def$1);
|
|
1261
|
-
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag);
|
|
1262
|
-
inst._zod.parse = (payload, _) => {
|
|
1263
|
-
if (def$1.coerce) try {
|
|
1264
|
-
payload.value = String(payload.value);
|
|
1265
|
-
} catch (_$1) {}
|
|
1266
|
-
if (typeof payload.value === "string") return payload;
|
|
1267
|
-
payload.issues.push({
|
|
1268
|
-
expected: "string",
|
|
1269
|
-
code: "invalid_type",
|
|
1270
|
-
input: payload.value,
|
|
1271
|
-
inst
|
|
1272
|
-
});
|
|
1273
|
-
return payload;
|
|
1274
|
-
};
|
|
1275
|
-
});
|
|
1276
|
-
const $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def$1) => {
|
|
1277
|
-
$ZodCheckStringFormat.init(inst, def$1);
|
|
1278
|
-
$ZodString.init(inst, def$1);
|
|
1279
|
-
});
|
|
1280
|
-
const $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def$1) => {
|
|
1281
|
-
def$1.pattern ?? (def$1.pattern = guid);
|
|
1282
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1283
|
-
});
|
|
1284
|
-
const $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def$1) => {
|
|
1285
|
-
if (def$1.version) {
|
|
1286
|
-
const v = {
|
|
1287
|
-
v1: 1,
|
|
1288
|
-
v2: 2,
|
|
1289
|
-
v3: 3,
|
|
1290
|
-
v4: 4,
|
|
1291
|
-
v5: 5,
|
|
1292
|
-
v6: 6,
|
|
1293
|
-
v7: 7,
|
|
1294
|
-
v8: 8
|
|
1295
|
-
}[def$1.version];
|
|
1296
|
-
if (v === void 0) throw new Error(`Invalid UUID version: "${def$1.version}"`);
|
|
1297
|
-
def$1.pattern ?? (def$1.pattern = uuid$1(v));
|
|
1298
|
-
} else def$1.pattern ?? (def$1.pattern = uuid$1());
|
|
1299
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1300
|
-
});
|
|
1301
|
-
const $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def$1) => {
|
|
1302
|
-
def$1.pattern ?? (def$1.pattern = email);
|
|
1303
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1304
|
-
});
|
|
1305
|
-
const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def$1) => {
|
|
1306
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1307
|
-
inst._zod.check = (payload) => {
|
|
1308
|
-
try {
|
|
1309
|
-
const trimmed = payload.value.trim();
|
|
1310
|
-
const url$1 = new URL(trimmed);
|
|
1311
|
-
if (def$1.hostname) {
|
|
1312
|
-
def$1.hostname.lastIndex = 0;
|
|
1313
|
-
if (!def$1.hostname.test(url$1.hostname)) payload.issues.push({
|
|
1314
|
-
code: "invalid_format",
|
|
1315
|
-
format: "url",
|
|
1316
|
-
note: "Invalid hostname",
|
|
1317
|
-
pattern: hostname.source,
|
|
1318
|
-
input: payload.value,
|
|
1319
|
-
inst,
|
|
1320
|
-
continue: !def$1.abort
|
|
1321
|
-
});
|
|
1322
|
-
}
|
|
1323
|
-
if (def$1.protocol) {
|
|
1324
|
-
def$1.protocol.lastIndex = 0;
|
|
1325
|
-
if (!def$1.protocol.test(url$1.protocol.endsWith(":") ? url$1.protocol.slice(0, -1) : url$1.protocol)) payload.issues.push({
|
|
1326
|
-
code: "invalid_format",
|
|
1327
|
-
format: "url",
|
|
1328
|
-
note: "Invalid protocol",
|
|
1329
|
-
pattern: def$1.protocol.source,
|
|
1330
|
-
input: payload.value,
|
|
1331
|
-
inst,
|
|
1332
|
-
continue: !def$1.abort
|
|
1333
|
-
});
|
|
1334
|
-
}
|
|
1335
|
-
if (def$1.normalize) payload.value = url$1.href;
|
|
1336
|
-
else payload.value = trimmed;
|
|
1337
|
-
return;
|
|
1338
|
-
} catch (_) {
|
|
1339
|
-
payload.issues.push({
|
|
1340
|
-
code: "invalid_format",
|
|
1341
|
-
format: "url",
|
|
1342
|
-
input: payload.value,
|
|
1343
|
-
inst,
|
|
1344
|
-
continue: !def$1.abort
|
|
1345
|
-
});
|
|
1346
|
-
}
|
|
1347
|
-
};
|
|
1348
|
-
});
|
|
1349
|
-
const $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def$1) => {
|
|
1350
|
-
def$1.pattern ?? (def$1.pattern = emoji());
|
|
1351
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1352
|
-
});
|
|
1353
|
-
const $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def$1) => {
|
|
1354
|
-
def$1.pattern ?? (def$1.pattern = nanoid);
|
|
1355
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1356
|
-
});
|
|
1357
|
-
const $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def$1) => {
|
|
1358
|
-
def$1.pattern ?? (def$1.pattern = cuid);
|
|
1359
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1360
|
-
});
|
|
1361
|
-
const $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def$1) => {
|
|
1362
|
-
def$1.pattern ?? (def$1.pattern = cuid2);
|
|
1363
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1364
|
-
});
|
|
1365
|
-
const $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def$1) => {
|
|
1366
|
-
def$1.pattern ?? (def$1.pattern = ulid);
|
|
1367
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1368
|
-
});
|
|
1369
|
-
const $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def$1) => {
|
|
1370
|
-
def$1.pattern ?? (def$1.pattern = xid);
|
|
1371
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1372
|
-
});
|
|
1373
|
-
const $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def$1) => {
|
|
1374
|
-
def$1.pattern ?? (def$1.pattern = ksuid);
|
|
1375
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1376
|
-
});
|
|
1377
|
-
const $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def$1) => {
|
|
1378
|
-
def$1.pattern ?? (def$1.pattern = datetime$1(def$1));
|
|
1379
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1380
|
-
});
|
|
1381
|
-
const $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def$1) => {
|
|
1382
|
-
def$1.pattern ?? (def$1.pattern = date$2);
|
|
1383
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1384
|
-
});
|
|
1385
|
-
const $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def$1) => {
|
|
1386
|
-
def$1.pattern ?? (def$1.pattern = time$1(def$1));
|
|
1387
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1388
|
-
});
|
|
1389
|
-
const $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def$1) => {
|
|
1390
|
-
def$1.pattern ?? (def$1.pattern = duration$1);
|
|
1391
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1392
|
-
});
|
|
1393
|
-
const $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def$1) => {
|
|
1394
|
-
def$1.pattern ?? (def$1.pattern = ipv4);
|
|
1395
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1396
|
-
inst._zod.onattach.push((inst$1) => {
|
|
1397
|
-
const bag = inst$1._zod.bag;
|
|
1398
|
-
bag.format = `ipv4`;
|
|
1399
|
-
});
|
|
1400
|
-
});
|
|
1401
|
-
const $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def$1) => {
|
|
1402
|
-
def$1.pattern ?? (def$1.pattern = ipv6);
|
|
1403
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1404
|
-
inst._zod.onattach.push((inst$1) => {
|
|
1405
|
-
const bag = inst$1._zod.bag;
|
|
1406
|
-
bag.format = `ipv6`;
|
|
1407
|
-
});
|
|
1408
|
-
inst._zod.check = (payload) => {
|
|
1409
|
-
try {
|
|
1410
|
-
new URL(`http://[${payload.value}]`);
|
|
1411
|
-
} catch {
|
|
1412
|
-
payload.issues.push({
|
|
1413
|
-
code: "invalid_format",
|
|
1414
|
-
format: "ipv6",
|
|
1415
|
-
input: payload.value,
|
|
1416
|
-
inst,
|
|
1417
|
-
continue: !def$1.abort
|
|
1418
|
-
});
|
|
1419
|
-
}
|
|
1420
|
-
};
|
|
1421
|
-
});
|
|
1422
|
-
const $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def$1) => {
|
|
1423
|
-
def$1.pattern ?? (def$1.pattern = cidrv4);
|
|
1424
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1425
|
-
});
|
|
1426
|
-
const $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def$1) => {
|
|
1427
|
-
def$1.pattern ?? (def$1.pattern = cidrv6);
|
|
1428
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1429
|
-
inst._zod.check = (payload) => {
|
|
1430
|
-
const parts = payload.value.split("/");
|
|
1431
|
-
try {
|
|
1432
|
-
if (parts.length !== 2) throw new Error();
|
|
1433
|
-
const [address, prefix] = parts;
|
|
1434
|
-
if (!prefix) throw new Error();
|
|
1435
|
-
const prefixNum = Number(prefix);
|
|
1436
|
-
if (`${prefixNum}` !== prefix) throw new Error();
|
|
1437
|
-
if (prefixNum < 0 || prefixNum > 128) throw new Error();
|
|
1438
|
-
new URL(`http://[${address}]`);
|
|
1439
|
-
} catch {
|
|
1440
|
-
payload.issues.push({
|
|
1441
|
-
code: "invalid_format",
|
|
1442
|
-
format: "cidrv6",
|
|
1443
|
-
input: payload.value,
|
|
1444
|
-
inst,
|
|
1445
|
-
continue: !def$1.abort
|
|
1446
|
-
});
|
|
1447
|
-
}
|
|
1448
|
-
};
|
|
1449
|
-
});
|
|
1450
|
-
function isValidBase64(data) {
|
|
1451
|
-
if (data === "") return true;
|
|
1452
|
-
if (data.length % 4 !== 0) return false;
|
|
1453
|
-
try {
|
|
1454
|
-
atob(data);
|
|
1455
|
-
return true;
|
|
1456
|
-
} catch {
|
|
1457
|
-
return false;
|
|
1458
|
-
}
|
|
1459
|
-
}
|
|
1460
|
-
const $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def$1) => {
|
|
1461
|
-
def$1.pattern ?? (def$1.pattern = base64);
|
|
1462
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1463
|
-
inst._zod.onattach.push((inst$1) => {
|
|
1464
|
-
inst$1._zod.bag.contentEncoding = "base64";
|
|
1465
|
-
});
|
|
1466
|
-
inst._zod.check = (payload) => {
|
|
1467
|
-
if (isValidBase64(payload.value)) return;
|
|
1468
|
-
payload.issues.push({
|
|
1469
|
-
code: "invalid_format",
|
|
1470
|
-
format: "base64",
|
|
1471
|
-
input: payload.value,
|
|
1472
|
-
inst,
|
|
1473
|
-
continue: !def$1.abort
|
|
1474
|
-
});
|
|
1475
|
-
};
|
|
1476
|
-
});
|
|
1477
|
-
function isValidBase64URL(data) {
|
|
1478
|
-
if (!base64url.test(data)) return false;
|
|
1479
|
-
const base64$1 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
1480
|
-
return isValidBase64(base64$1.padEnd(Math.ceil(base64$1.length / 4) * 4, "="));
|
|
1481
|
-
}
|
|
1482
|
-
const $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def$1) => {
|
|
1483
|
-
def$1.pattern ?? (def$1.pattern = base64url);
|
|
1484
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1485
|
-
inst._zod.onattach.push((inst$1) => {
|
|
1486
|
-
inst$1._zod.bag.contentEncoding = "base64url";
|
|
1487
|
-
});
|
|
1488
|
-
inst._zod.check = (payload) => {
|
|
1489
|
-
if (isValidBase64URL(payload.value)) return;
|
|
1490
|
-
payload.issues.push({
|
|
1491
|
-
code: "invalid_format",
|
|
1492
|
-
format: "base64url",
|
|
1493
|
-
input: payload.value,
|
|
1494
|
-
inst,
|
|
1495
|
-
continue: !def$1.abort
|
|
1496
|
-
});
|
|
1497
|
-
};
|
|
1498
|
-
});
|
|
1499
|
-
const $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def$1) => {
|
|
1500
|
-
def$1.pattern ?? (def$1.pattern = e164);
|
|
1501
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1502
|
-
});
|
|
1503
|
-
function isValidJWT(token, algorithm = null) {
|
|
1504
|
-
try {
|
|
1505
|
-
const tokensParts = token.split(".");
|
|
1506
|
-
if (tokensParts.length !== 3) return false;
|
|
1507
|
-
const [header] = tokensParts;
|
|
1508
|
-
if (!header) return false;
|
|
1509
|
-
const parsedHeader = JSON.parse(atob(header));
|
|
1510
|
-
if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false;
|
|
1511
|
-
if (!parsedHeader.alg) return false;
|
|
1512
|
-
if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return false;
|
|
1513
|
-
return true;
|
|
1514
|
-
} catch {
|
|
1515
|
-
return false;
|
|
1516
|
-
}
|
|
1517
|
-
}
|
|
1518
|
-
const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def$1) => {
|
|
1519
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1520
|
-
inst._zod.check = (payload) => {
|
|
1521
|
-
if (isValidJWT(payload.value, def$1.alg)) return;
|
|
1522
|
-
payload.issues.push({
|
|
1523
|
-
code: "invalid_format",
|
|
1524
|
-
format: "jwt",
|
|
1525
|
-
input: payload.value,
|
|
1526
|
-
inst,
|
|
1527
|
-
continue: !def$1.abort
|
|
1528
|
-
});
|
|
1529
|
-
};
|
|
1530
|
-
});
|
|
1531
|
-
const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def$1) => {
|
|
1532
|
-
$ZodType.init(inst, def$1);
|
|
1533
|
-
inst._zod.pattern = inst._zod.bag.pattern ?? number$1;
|
|
1534
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
1535
|
-
if (def$1.coerce) try {
|
|
1536
|
-
payload.value = Number(payload.value);
|
|
1537
|
-
} catch (_) {}
|
|
1538
|
-
const input = payload.value;
|
|
1539
|
-
if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload;
|
|
1540
|
-
const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
|
|
1541
|
-
payload.issues.push({
|
|
1542
|
-
expected: "number",
|
|
1543
|
-
code: "invalid_type",
|
|
1544
|
-
input,
|
|
1545
|
-
inst,
|
|
1546
|
-
...received ? { received } : {}
|
|
1547
|
-
});
|
|
1548
|
-
return payload;
|
|
1549
|
-
};
|
|
1550
|
-
});
|
|
1551
|
-
const $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def$1) => {
|
|
1552
|
-
$ZodCheckNumberFormat.init(inst, def$1);
|
|
1553
|
-
$ZodNumber.init(inst, def$1);
|
|
1554
|
-
});
|
|
1555
|
-
const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def$1) => {
|
|
1556
|
-
$ZodType.init(inst, def$1);
|
|
1557
|
-
inst._zod.pattern = boolean$1;
|
|
1558
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
1559
|
-
if (def$1.coerce) try {
|
|
1560
|
-
payload.value = Boolean(payload.value);
|
|
1561
|
-
} catch (_) {}
|
|
1562
|
-
const input = payload.value;
|
|
1563
|
-
if (typeof input === "boolean") return payload;
|
|
1564
|
-
payload.issues.push({
|
|
1565
|
-
expected: "boolean",
|
|
1566
|
-
code: "invalid_type",
|
|
1567
|
-
input,
|
|
1568
|
-
inst
|
|
1569
|
-
});
|
|
1570
|
-
return payload;
|
|
1571
|
-
};
|
|
1572
|
-
});
|
|
1573
|
-
const $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def$1) => {
|
|
1574
|
-
$ZodType.init(inst, def$1);
|
|
1575
|
-
inst._zod.pattern = _null$2;
|
|
1576
|
-
inst._zod.values = new Set([null]);
|
|
1577
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
1578
|
-
const input = payload.value;
|
|
1579
|
-
if (input === null) return payload;
|
|
1580
|
-
payload.issues.push({
|
|
1581
|
-
expected: "null",
|
|
1582
|
-
code: "invalid_type",
|
|
1583
|
-
input,
|
|
1584
|
-
inst
|
|
1585
|
-
});
|
|
1586
|
-
return payload;
|
|
1587
|
-
};
|
|
1588
|
-
});
|
|
1589
979
|
const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def$1) => {
|
|
1590
980
|
$ZodType.init(inst, def$1);
|
|
1591
981
|
inst._zod.parse = (payload) => payload;
|
|
@@ -1723,13 +1113,13 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def$1) => {
|
|
|
1723
1113
|
}
|
|
1724
1114
|
return propValues;
|
|
1725
1115
|
});
|
|
1726
|
-
const isObject$3
|
|
1116
|
+
const isObject$3 = isObject$2;
|
|
1727
1117
|
const catchall = def$1.catchall;
|
|
1728
1118
|
let value;
|
|
1729
1119
|
inst._zod.parse = (payload, ctx) => {
|
|
1730
1120
|
value ?? (value = _normalized.value);
|
|
1731
1121
|
const input = payload.value;
|
|
1732
|
-
if (!isObject$3
|
|
1122
|
+
if (!isObject$3(input)) {
|
|
1733
1123
|
payload.issues.push({
|
|
1734
1124
|
expected: "object",
|
|
1735
1125
|
code: "invalid_type",
|
|
@@ -1802,7 +1192,7 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def$1
|
|
|
1802
1192
|
return (payload, ctx) => fn(shape, payload, ctx);
|
|
1803
1193
|
};
|
|
1804
1194
|
let fastpass;
|
|
1805
|
-
const isObject$3
|
|
1195
|
+
const isObject$3 = isObject$2;
|
|
1806
1196
|
const jit = !globalConfig.jitless;
|
|
1807
1197
|
const fastEnabled = jit && allowsEval.value;
|
|
1808
1198
|
const catchall = def$1.catchall;
|
|
@@ -1810,7 +1200,7 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def$1
|
|
|
1810
1200
|
inst._zod.parse = (payload, ctx) => {
|
|
1811
1201
|
value ?? (value = _normalized.value);
|
|
1812
1202
|
const input = payload.value;
|
|
1813
|
-
if (!isObject$3
|
|
1203
|
+
if (!isObject$3(input)) {
|
|
1814
1204
|
payload.issues.push({
|
|
1815
1205
|
expected: "object",
|
|
1816
1206
|
code: "invalid_type",
|
|
@@ -2243,277 +1633,6 @@ function registry() {
|
|
|
2243
1633
|
return new $ZodRegistry();
|
|
2244
1634
|
}
|
|
2245
1635
|
const globalRegistry = /* @__PURE__ */ registry();
|
|
2246
|
-
function _string(Class, params) {
|
|
2247
|
-
return new Class({
|
|
2248
|
-
type: "string",
|
|
2249
|
-
...normalizeParams(params)
|
|
2250
|
-
});
|
|
2251
|
-
}
|
|
2252
|
-
function _email(Class, params) {
|
|
2253
|
-
return new Class({
|
|
2254
|
-
type: "string",
|
|
2255
|
-
format: "email",
|
|
2256
|
-
check: "string_format",
|
|
2257
|
-
abort: false,
|
|
2258
|
-
...normalizeParams(params)
|
|
2259
|
-
});
|
|
2260
|
-
}
|
|
2261
|
-
function _guid(Class, params) {
|
|
2262
|
-
return new Class({
|
|
2263
|
-
type: "string",
|
|
2264
|
-
format: "guid",
|
|
2265
|
-
check: "string_format",
|
|
2266
|
-
abort: false,
|
|
2267
|
-
...normalizeParams(params)
|
|
2268
|
-
});
|
|
2269
|
-
}
|
|
2270
|
-
function _uuid(Class, params) {
|
|
2271
|
-
return new Class({
|
|
2272
|
-
type: "string",
|
|
2273
|
-
format: "uuid",
|
|
2274
|
-
check: "string_format",
|
|
2275
|
-
abort: false,
|
|
2276
|
-
...normalizeParams(params)
|
|
2277
|
-
});
|
|
2278
|
-
}
|
|
2279
|
-
function _uuidv4(Class, params) {
|
|
2280
|
-
return new Class({
|
|
2281
|
-
type: "string",
|
|
2282
|
-
format: "uuid",
|
|
2283
|
-
check: "string_format",
|
|
2284
|
-
abort: false,
|
|
2285
|
-
version: "v4",
|
|
2286
|
-
...normalizeParams(params)
|
|
2287
|
-
});
|
|
2288
|
-
}
|
|
2289
|
-
function _uuidv6(Class, params) {
|
|
2290
|
-
return new Class({
|
|
2291
|
-
type: "string",
|
|
2292
|
-
format: "uuid",
|
|
2293
|
-
check: "string_format",
|
|
2294
|
-
abort: false,
|
|
2295
|
-
version: "v6",
|
|
2296
|
-
...normalizeParams(params)
|
|
2297
|
-
});
|
|
2298
|
-
}
|
|
2299
|
-
function _uuidv7(Class, params) {
|
|
2300
|
-
return new Class({
|
|
2301
|
-
type: "string",
|
|
2302
|
-
format: "uuid",
|
|
2303
|
-
check: "string_format",
|
|
2304
|
-
abort: false,
|
|
2305
|
-
version: "v7",
|
|
2306
|
-
...normalizeParams(params)
|
|
2307
|
-
});
|
|
2308
|
-
}
|
|
2309
|
-
function _url(Class, params) {
|
|
2310
|
-
return new Class({
|
|
2311
|
-
type: "string",
|
|
2312
|
-
format: "url",
|
|
2313
|
-
check: "string_format",
|
|
2314
|
-
abort: false,
|
|
2315
|
-
...normalizeParams(params)
|
|
2316
|
-
});
|
|
2317
|
-
}
|
|
2318
|
-
function _emoji(Class, params) {
|
|
2319
|
-
return new Class({
|
|
2320
|
-
type: "string",
|
|
2321
|
-
format: "emoji",
|
|
2322
|
-
check: "string_format",
|
|
2323
|
-
abort: false,
|
|
2324
|
-
...normalizeParams(params)
|
|
2325
|
-
});
|
|
2326
|
-
}
|
|
2327
|
-
function _nanoid(Class, params) {
|
|
2328
|
-
return new Class({
|
|
2329
|
-
type: "string",
|
|
2330
|
-
format: "nanoid",
|
|
2331
|
-
check: "string_format",
|
|
2332
|
-
abort: false,
|
|
2333
|
-
...normalizeParams(params)
|
|
2334
|
-
});
|
|
2335
|
-
}
|
|
2336
|
-
function _cuid(Class, params) {
|
|
2337
|
-
return new Class({
|
|
2338
|
-
type: "string",
|
|
2339
|
-
format: "cuid",
|
|
2340
|
-
check: "string_format",
|
|
2341
|
-
abort: false,
|
|
2342
|
-
...normalizeParams(params)
|
|
2343
|
-
});
|
|
2344
|
-
}
|
|
2345
|
-
function _cuid2(Class, params) {
|
|
2346
|
-
return new Class({
|
|
2347
|
-
type: "string",
|
|
2348
|
-
format: "cuid2",
|
|
2349
|
-
check: "string_format",
|
|
2350
|
-
abort: false,
|
|
2351
|
-
...normalizeParams(params)
|
|
2352
|
-
});
|
|
2353
|
-
}
|
|
2354
|
-
function _ulid(Class, params) {
|
|
2355
|
-
return new Class({
|
|
2356
|
-
type: "string",
|
|
2357
|
-
format: "ulid",
|
|
2358
|
-
check: "string_format",
|
|
2359
|
-
abort: false,
|
|
2360
|
-
...normalizeParams(params)
|
|
2361
|
-
});
|
|
2362
|
-
}
|
|
2363
|
-
function _xid(Class, params) {
|
|
2364
|
-
return new Class({
|
|
2365
|
-
type: "string",
|
|
2366
|
-
format: "xid",
|
|
2367
|
-
check: "string_format",
|
|
2368
|
-
abort: false,
|
|
2369
|
-
...normalizeParams(params)
|
|
2370
|
-
});
|
|
2371
|
-
}
|
|
2372
|
-
function _ksuid(Class, params) {
|
|
2373
|
-
return new Class({
|
|
2374
|
-
type: "string",
|
|
2375
|
-
format: "ksuid",
|
|
2376
|
-
check: "string_format",
|
|
2377
|
-
abort: false,
|
|
2378
|
-
...normalizeParams(params)
|
|
2379
|
-
});
|
|
2380
|
-
}
|
|
2381
|
-
function _ipv4(Class, params) {
|
|
2382
|
-
return new Class({
|
|
2383
|
-
type: "string",
|
|
2384
|
-
format: "ipv4",
|
|
2385
|
-
check: "string_format",
|
|
2386
|
-
abort: false,
|
|
2387
|
-
...normalizeParams(params)
|
|
2388
|
-
});
|
|
2389
|
-
}
|
|
2390
|
-
function _ipv6(Class, params) {
|
|
2391
|
-
return new Class({
|
|
2392
|
-
type: "string",
|
|
2393
|
-
format: "ipv6",
|
|
2394
|
-
check: "string_format",
|
|
2395
|
-
abort: false,
|
|
2396
|
-
...normalizeParams(params)
|
|
2397
|
-
});
|
|
2398
|
-
}
|
|
2399
|
-
function _cidrv4(Class, params) {
|
|
2400
|
-
return new Class({
|
|
2401
|
-
type: "string",
|
|
2402
|
-
format: "cidrv4",
|
|
2403
|
-
check: "string_format",
|
|
2404
|
-
abort: false,
|
|
2405
|
-
...normalizeParams(params)
|
|
2406
|
-
});
|
|
2407
|
-
}
|
|
2408
|
-
function _cidrv6(Class, params) {
|
|
2409
|
-
return new Class({
|
|
2410
|
-
type: "string",
|
|
2411
|
-
format: "cidrv6",
|
|
2412
|
-
check: "string_format",
|
|
2413
|
-
abort: false,
|
|
2414
|
-
...normalizeParams(params)
|
|
2415
|
-
});
|
|
2416
|
-
}
|
|
2417
|
-
function _base64(Class, params) {
|
|
2418
|
-
return new Class({
|
|
2419
|
-
type: "string",
|
|
2420
|
-
format: "base64",
|
|
2421
|
-
check: "string_format",
|
|
2422
|
-
abort: false,
|
|
2423
|
-
...normalizeParams(params)
|
|
2424
|
-
});
|
|
2425
|
-
}
|
|
2426
|
-
function _base64url(Class, params) {
|
|
2427
|
-
return new Class({
|
|
2428
|
-
type: "string",
|
|
2429
|
-
format: "base64url",
|
|
2430
|
-
check: "string_format",
|
|
2431
|
-
abort: false,
|
|
2432
|
-
...normalizeParams(params)
|
|
2433
|
-
});
|
|
2434
|
-
}
|
|
2435
|
-
function _e164(Class, params) {
|
|
2436
|
-
return new Class({
|
|
2437
|
-
type: "string",
|
|
2438
|
-
format: "e164",
|
|
2439
|
-
check: "string_format",
|
|
2440
|
-
abort: false,
|
|
2441
|
-
...normalizeParams(params)
|
|
2442
|
-
});
|
|
2443
|
-
}
|
|
2444
|
-
function _jwt(Class, params) {
|
|
2445
|
-
return new Class({
|
|
2446
|
-
type: "string",
|
|
2447
|
-
format: "jwt",
|
|
2448
|
-
check: "string_format",
|
|
2449
|
-
abort: false,
|
|
2450
|
-
...normalizeParams(params)
|
|
2451
|
-
});
|
|
2452
|
-
}
|
|
2453
|
-
function _isoDateTime(Class, params) {
|
|
2454
|
-
return new Class({
|
|
2455
|
-
type: "string",
|
|
2456
|
-
format: "datetime",
|
|
2457
|
-
check: "string_format",
|
|
2458
|
-
offset: false,
|
|
2459
|
-
local: false,
|
|
2460
|
-
precision: null,
|
|
2461
|
-
...normalizeParams(params)
|
|
2462
|
-
});
|
|
2463
|
-
}
|
|
2464
|
-
function _isoDate(Class, params) {
|
|
2465
|
-
return new Class({
|
|
2466
|
-
type: "string",
|
|
2467
|
-
format: "date",
|
|
2468
|
-
check: "string_format",
|
|
2469
|
-
...normalizeParams(params)
|
|
2470
|
-
});
|
|
2471
|
-
}
|
|
2472
|
-
function _isoTime(Class, params) {
|
|
2473
|
-
return new Class({
|
|
2474
|
-
type: "string",
|
|
2475
|
-
format: "time",
|
|
2476
|
-
check: "string_format",
|
|
2477
|
-
precision: null,
|
|
2478
|
-
...normalizeParams(params)
|
|
2479
|
-
});
|
|
2480
|
-
}
|
|
2481
|
-
function _isoDuration(Class, params) {
|
|
2482
|
-
return new Class({
|
|
2483
|
-
type: "string",
|
|
2484
|
-
format: "duration",
|
|
2485
|
-
check: "string_format",
|
|
2486
|
-
...normalizeParams(params)
|
|
2487
|
-
});
|
|
2488
|
-
}
|
|
2489
|
-
function _number(Class, params) {
|
|
2490
|
-
return new Class({
|
|
2491
|
-
type: "number",
|
|
2492
|
-
checks: [],
|
|
2493
|
-
...normalizeParams(params)
|
|
2494
|
-
});
|
|
2495
|
-
}
|
|
2496
|
-
function _int(Class, params) {
|
|
2497
|
-
return new Class({
|
|
2498
|
-
type: "number",
|
|
2499
|
-
check: "number_format",
|
|
2500
|
-
abort: false,
|
|
2501
|
-
format: "safeint",
|
|
2502
|
-
...normalizeParams(params)
|
|
2503
|
-
});
|
|
2504
|
-
}
|
|
2505
|
-
function _boolean(Class, params) {
|
|
2506
|
-
return new Class({
|
|
2507
|
-
type: "boolean",
|
|
2508
|
-
...normalizeParams(params)
|
|
2509
|
-
});
|
|
2510
|
-
}
|
|
2511
|
-
function _null$1(Class, params) {
|
|
2512
|
-
return new Class({
|
|
2513
|
-
type: "null",
|
|
2514
|
-
...normalizeParams(params)
|
|
2515
|
-
});
|
|
2516
|
-
}
|
|
2517
1636
|
function _unknown(Class) {
|
|
2518
1637
|
return new Class({ type: "unknown" });
|
|
2519
1638
|
}
|
|
@@ -2529,14 +1648,6 @@ function _date(Class, params) {
|
|
|
2529
1648
|
...normalizeParams(params)
|
|
2530
1649
|
});
|
|
2531
1650
|
}
|
|
2532
|
-
function _lt(value, params) {
|
|
2533
|
-
return new $ZodCheckLessThan({
|
|
2534
|
-
check: "less_than",
|
|
2535
|
-
...normalizeParams(params),
|
|
2536
|
-
value,
|
|
2537
|
-
inclusive: false
|
|
2538
|
-
});
|
|
2539
|
-
}
|
|
2540
1651
|
function _lte(value, params) {
|
|
2541
1652
|
return new $ZodCheckLessThan({
|
|
2542
1653
|
check: "less_than",
|
|
@@ -2545,14 +1656,6 @@ function _lte(value, params) {
|
|
|
2545
1656
|
inclusive: true
|
|
2546
1657
|
});
|
|
2547
1658
|
}
|
|
2548
|
-
function _gt(value, params) {
|
|
2549
|
-
return new $ZodCheckGreaterThan({
|
|
2550
|
-
check: "greater_than",
|
|
2551
|
-
...normalizeParams(params),
|
|
2552
|
-
value,
|
|
2553
|
-
inclusive: false
|
|
2554
|
-
});
|
|
2555
|
-
}
|
|
2556
1659
|
function _gte(value, params) {
|
|
2557
1660
|
return new $ZodCheckGreaterThan({
|
|
2558
1661
|
check: "greater_than",
|
|
@@ -2561,13 +1664,6 @@ function _gte(value, params) {
|
|
|
2561
1664
|
inclusive: true
|
|
2562
1665
|
});
|
|
2563
1666
|
}
|
|
2564
|
-
function _multipleOf(value, params) {
|
|
2565
|
-
return new $ZodCheckMultipleOf({
|
|
2566
|
-
check: "multiple_of",
|
|
2567
|
-
...normalizeParams(params),
|
|
2568
|
-
value
|
|
2569
|
-
});
|
|
2570
|
-
}
|
|
2571
1667
|
function _maxLength(maximum, params) {
|
|
2572
1668
|
return new $ZodCheckMaxLength({
|
|
2573
1669
|
check: "max_length",
|
|
@@ -2589,70 +1685,12 @@ function _length(length, params) {
|
|
|
2589
1685
|
length
|
|
2590
1686
|
});
|
|
2591
1687
|
}
|
|
2592
|
-
function _regex(pattern, params) {
|
|
2593
|
-
return new $ZodCheckRegex({
|
|
2594
|
-
check: "string_format",
|
|
2595
|
-
format: "regex",
|
|
2596
|
-
...normalizeParams(params),
|
|
2597
|
-
pattern
|
|
2598
|
-
});
|
|
2599
|
-
}
|
|
2600
|
-
function _lowercase(params) {
|
|
2601
|
-
return new $ZodCheckLowerCase({
|
|
2602
|
-
check: "string_format",
|
|
2603
|
-
format: "lowercase",
|
|
2604
|
-
...normalizeParams(params)
|
|
2605
|
-
});
|
|
2606
|
-
}
|
|
2607
|
-
function _uppercase(params) {
|
|
2608
|
-
return new $ZodCheckUpperCase({
|
|
2609
|
-
check: "string_format",
|
|
2610
|
-
format: "uppercase",
|
|
2611
|
-
...normalizeParams(params)
|
|
2612
|
-
});
|
|
2613
|
-
}
|
|
2614
|
-
function _includes(includes, params) {
|
|
2615
|
-
return new $ZodCheckIncludes({
|
|
2616
|
-
check: "string_format",
|
|
2617
|
-
format: "includes",
|
|
2618
|
-
...normalizeParams(params),
|
|
2619
|
-
includes
|
|
2620
|
-
});
|
|
2621
|
-
}
|
|
2622
|
-
function _startsWith(prefix, params) {
|
|
2623
|
-
return new $ZodCheckStartsWith({
|
|
2624
|
-
check: "string_format",
|
|
2625
|
-
format: "starts_with",
|
|
2626
|
-
...normalizeParams(params),
|
|
2627
|
-
prefix
|
|
2628
|
-
});
|
|
2629
|
-
}
|
|
2630
|
-
function _endsWith(suffix, params) {
|
|
2631
|
-
return new $ZodCheckEndsWith({
|
|
2632
|
-
check: "string_format",
|
|
2633
|
-
format: "ends_with",
|
|
2634
|
-
...normalizeParams(params),
|
|
2635
|
-
suffix
|
|
2636
|
-
});
|
|
2637
|
-
}
|
|
2638
1688
|
function _overwrite(tx) {
|
|
2639
1689
|
return new $ZodCheckOverwrite({
|
|
2640
1690
|
check: "overwrite",
|
|
2641
1691
|
tx
|
|
2642
1692
|
});
|
|
2643
1693
|
}
|
|
2644
|
-
function _normalize(form) {
|
|
2645
|
-
return _overwrite((input) => input.normalize(form));
|
|
2646
|
-
}
|
|
2647
|
-
function _trim() {
|
|
2648
|
-
return _overwrite((input) => input.trim());
|
|
2649
|
-
}
|
|
2650
|
-
function _toLowerCase() {
|
|
2651
|
-
return _overwrite((input) => input.toLowerCase());
|
|
2652
|
-
}
|
|
2653
|
-
function _toUpperCase() {
|
|
2654
|
-
return _overwrite((input) => input.toUpperCase());
|
|
2655
|
-
}
|
|
2656
1694
|
function _array(Class, element, params) {
|
|
2657
1695
|
return new Class({
|
|
2658
1696
|
type: "array",
|
|
@@ -2694,34 +1732,6 @@ function _check(fn, params) {
|
|
|
2694
1732
|
ch._zod.check = fn;
|
|
2695
1733
|
return ch;
|
|
2696
1734
|
}
|
|
2697
|
-
const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def$1) => {
|
|
2698
|
-
$ZodISODateTime.init(inst, def$1);
|
|
2699
|
-
ZodStringFormat.init(inst, def$1);
|
|
2700
|
-
});
|
|
2701
|
-
function datetime(params) {
|
|
2702
|
-
return _isoDateTime(ZodISODateTime, params);
|
|
2703
|
-
}
|
|
2704
|
-
const ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def$1) => {
|
|
2705
|
-
$ZodISODate.init(inst, def$1);
|
|
2706
|
-
ZodStringFormat.init(inst, def$1);
|
|
2707
|
-
});
|
|
2708
|
-
function date$1(params) {
|
|
2709
|
-
return _isoDate(ZodISODate, params);
|
|
2710
|
-
}
|
|
2711
|
-
const ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def$1) => {
|
|
2712
|
-
$ZodISOTime.init(inst, def$1);
|
|
2713
|
-
ZodStringFormat.init(inst, def$1);
|
|
2714
|
-
});
|
|
2715
|
-
function time(params) {
|
|
2716
|
-
return _isoTime(ZodISOTime, params);
|
|
2717
|
-
}
|
|
2718
|
-
const ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def$1) => {
|
|
2719
|
-
$ZodISODuration.init(inst, def$1);
|
|
2720
|
-
ZodStringFormat.init(inst, def$1);
|
|
2721
|
-
});
|
|
2722
|
-
function duration(params) {
|
|
2723
|
-
return _isoDuration(ZodISODuration, params);
|
|
2724
|
-
}
|
|
2725
1735
|
const initializer = (inst, issues) => {
|
|
2726
1736
|
$ZodError.init(inst, issues);
|
|
2727
1737
|
inst.name = "ZodError";
|
|
@@ -2823,198 +1833,6 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def$1) => {
|
|
|
2823
1833
|
inst.isNullable = () => inst.safeParse(null).success;
|
|
2824
1834
|
return inst;
|
|
2825
1835
|
});
|
|
2826
|
-
/** @internal */
|
|
2827
|
-
const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def$1) => {
|
|
2828
|
-
$ZodString.init(inst, def$1);
|
|
2829
|
-
ZodType.init(inst, def$1);
|
|
2830
|
-
const bag = inst._zod.bag;
|
|
2831
|
-
inst.format = bag.format ?? null;
|
|
2832
|
-
inst.minLength = bag.minimum ?? null;
|
|
2833
|
-
inst.maxLength = bag.maximum ?? null;
|
|
2834
|
-
inst.regex = (...args) => inst.check(_regex(...args));
|
|
2835
|
-
inst.includes = (...args) => inst.check(_includes(...args));
|
|
2836
|
-
inst.startsWith = (...args) => inst.check(_startsWith(...args));
|
|
2837
|
-
inst.endsWith = (...args) => inst.check(_endsWith(...args));
|
|
2838
|
-
inst.min = (...args) => inst.check(_minLength(...args));
|
|
2839
|
-
inst.max = (...args) => inst.check(_maxLength(...args));
|
|
2840
|
-
inst.length = (...args) => inst.check(_length(...args));
|
|
2841
|
-
inst.nonempty = (...args) => inst.check(_minLength(1, ...args));
|
|
2842
|
-
inst.lowercase = (params) => inst.check(_lowercase(params));
|
|
2843
|
-
inst.uppercase = (params) => inst.check(_uppercase(params));
|
|
2844
|
-
inst.trim = () => inst.check(_trim());
|
|
2845
|
-
inst.normalize = (...args) => inst.check(_normalize(...args));
|
|
2846
|
-
inst.toLowerCase = () => inst.check(_toLowerCase());
|
|
2847
|
-
inst.toUpperCase = () => inst.check(_toUpperCase());
|
|
2848
|
-
});
|
|
2849
|
-
const ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def$1) => {
|
|
2850
|
-
$ZodString.init(inst, def$1);
|
|
2851
|
-
_ZodString.init(inst, def$1);
|
|
2852
|
-
inst.email = (params) => inst.check(_email(ZodEmail, params));
|
|
2853
|
-
inst.url = (params) => inst.check(_url(ZodURL, params));
|
|
2854
|
-
inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
|
|
2855
|
-
inst.emoji = (params) => inst.check(_emoji(ZodEmoji, params));
|
|
2856
|
-
inst.guid = (params) => inst.check(_guid(ZodGUID, params));
|
|
2857
|
-
inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
|
|
2858
|
-
inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
|
|
2859
|
-
inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
|
|
2860
|
-
inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
|
|
2861
|
-
inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
|
|
2862
|
-
inst.guid = (params) => inst.check(_guid(ZodGUID, params));
|
|
2863
|
-
inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
|
|
2864
|
-
inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
|
|
2865
|
-
inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
|
|
2866
|
-
inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
|
|
2867
|
-
inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
|
|
2868
|
-
inst.xid = (params) => inst.check(_xid(ZodXID, params));
|
|
2869
|
-
inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
|
|
2870
|
-
inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
|
|
2871
|
-
inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
|
|
2872
|
-
inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
|
|
2873
|
-
inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
|
|
2874
|
-
inst.e164 = (params) => inst.check(_e164(ZodE164, params));
|
|
2875
|
-
inst.datetime = (params) => inst.check(datetime(params));
|
|
2876
|
-
inst.date = (params) => inst.check(date$1(params));
|
|
2877
|
-
inst.time = (params) => inst.check(time(params));
|
|
2878
|
-
inst.duration = (params) => inst.check(duration(params));
|
|
2879
|
-
});
|
|
2880
|
-
function string(params) {
|
|
2881
|
-
return _string(ZodString, params);
|
|
2882
|
-
}
|
|
2883
|
-
const ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def$1) => {
|
|
2884
|
-
$ZodStringFormat.init(inst, def$1);
|
|
2885
|
-
_ZodString.init(inst, def$1);
|
|
2886
|
-
});
|
|
2887
|
-
const ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def$1) => {
|
|
2888
|
-
$ZodEmail.init(inst, def$1);
|
|
2889
|
-
ZodStringFormat.init(inst, def$1);
|
|
2890
|
-
});
|
|
2891
|
-
const ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def$1) => {
|
|
2892
|
-
$ZodGUID.init(inst, def$1);
|
|
2893
|
-
ZodStringFormat.init(inst, def$1);
|
|
2894
|
-
});
|
|
2895
|
-
const ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def$1) => {
|
|
2896
|
-
$ZodUUID.init(inst, def$1);
|
|
2897
|
-
ZodStringFormat.init(inst, def$1);
|
|
2898
|
-
});
|
|
2899
|
-
function uuid(params) {
|
|
2900
|
-
return _uuid(ZodUUID, params);
|
|
2901
|
-
}
|
|
2902
|
-
const ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def$1) => {
|
|
2903
|
-
$ZodURL.init(inst, def$1);
|
|
2904
|
-
ZodStringFormat.init(inst, def$1);
|
|
2905
|
-
});
|
|
2906
|
-
function url(params) {
|
|
2907
|
-
return _url(ZodURL, params);
|
|
2908
|
-
}
|
|
2909
|
-
const ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def$1) => {
|
|
2910
|
-
$ZodEmoji.init(inst, def$1);
|
|
2911
|
-
ZodStringFormat.init(inst, def$1);
|
|
2912
|
-
});
|
|
2913
|
-
const ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def$1) => {
|
|
2914
|
-
$ZodNanoID.init(inst, def$1);
|
|
2915
|
-
ZodStringFormat.init(inst, def$1);
|
|
2916
|
-
});
|
|
2917
|
-
const ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def$1) => {
|
|
2918
|
-
$ZodCUID.init(inst, def$1);
|
|
2919
|
-
ZodStringFormat.init(inst, def$1);
|
|
2920
|
-
});
|
|
2921
|
-
const ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def$1) => {
|
|
2922
|
-
$ZodCUID2.init(inst, def$1);
|
|
2923
|
-
ZodStringFormat.init(inst, def$1);
|
|
2924
|
-
});
|
|
2925
|
-
const ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def$1) => {
|
|
2926
|
-
$ZodULID.init(inst, def$1);
|
|
2927
|
-
ZodStringFormat.init(inst, def$1);
|
|
2928
|
-
});
|
|
2929
|
-
const ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def$1) => {
|
|
2930
|
-
$ZodXID.init(inst, def$1);
|
|
2931
|
-
ZodStringFormat.init(inst, def$1);
|
|
2932
|
-
});
|
|
2933
|
-
const ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def$1) => {
|
|
2934
|
-
$ZodKSUID.init(inst, def$1);
|
|
2935
|
-
ZodStringFormat.init(inst, def$1);
|
|
2936
|
-
});
|
|
2937
|
-
const ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def$1) => {
|
|
2938
|
-
$ZodIPv4.init(inst, def$1);
|
|
2939
|
-
ZodStringFormat.init(inst, def$1);
|
|
2940
|
-
});
|
|
2941
|
-
const ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def$1) => {
|
|
2942
|
-
$ZodIPv6.init(inst, def$1);
|
|
2943
|
-
ZodStringFormat.init(inst, def$1);
|
|
2944
|
-
});
|
|
2945
|
-
const ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def$1) => {
|
|
2946
|
-
$ZodCIDRv4.init(inst, def$1);
|
|
2947
|
-
ZodStringFormat.init(inst, def$1);
|
|
2948
|
-
});
|
|
2949
|
-
const ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def$1) => {
|
|
2950
|
-
$ZodCIDRv6.init(inst, def$1);
|
|
2951
|
-
ZodStringFormat.init(inst, def$1);
|
|
2952
|
-
});
|
|
2953
|
-
const ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def$1) => {
|
|
2954
|
-
$ZodBase64.init(inst, def$1);
|
|
2955
|
-
ZodStringFormat.init(inst, def$1);
|
|
2956
|
-
});
|
|
2957
|
-
const ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def$1) => {
|
|
2958
|
-
$ZodBase64URL.init(inst, def$1);
|
|
2959
|
-
ZodStringFormat.init(inst, def$1);
|
|
2960
|
-
});
|
|
2961
|
-
const ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def$1) => {
|
|
2962
|
-
$ZodE164.init(inst, def$1);
|
|
2963
|
-
ZodStringFormat.init(inst, def$1);
|
|
2964
|
-
});
|
|
2965
|
-
const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def$1) => {
|
|
2966
|
-
$ZodJWT.init(inst, def$1);
|
|
2967
|
-
ZodStringFormat.init(inst, def$1);
|
|
2968
|
-
});
|
|
2969
|
-
const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def$1) => {
|
|
2970
|
-
$ZodNumber.init(inst, def$1);
|
|
2971
|
-
ZodType.init(inst, def$1);
|
|
2972
|
-
inst.gt = (value, params) => inst.check(_gt(value, params));
|
|
2973
|
-
inst.gte = (value, params) => inst.check(_gte(value, params));
|
|
2974
|
-
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
2975
|
-
inst.lt = (value, params) => inst.check(_lt(value, params));
|
|
2976
|
-
inst.lte = (value, params) => inst.check(_lte(value, params));
|
|
2977
|
-
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
2978
|
-
inst.int = (params) => inst.check(int(params));
|
|
2979
|
-
inst.safe = (params) => inst.check(int(params));
|
|
2980
|
-
inst.positive = (params) => inst.check(_gt(0, params));
|
|
2981
|
-
inst.nonnegative = (params) => inst.check(_gte(0, params));
|
|
2982
|
-
inst.negative = (params) => inst.check(_lt(0, params));
|
|
2983
|
-
inst.nonpositive = (params) => inst.check(_lte(0, params));
|
|
2984
|
-
inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
|
|
2985
|
-
inst.step = (value, params) => inst.check(_multipleOf(value, params));
|
|
2986
|
-
inst.finite = () => inst;
|
|
2987
|
-
const bag = inst._zod.bag;
|
|
2988
|
-
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
2989
|
-
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
2990
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
|
|
2991
|
-
inst.isFinite = true;
|
|
2992
|
-
inst.format = bag.format ?? null;
|
|
2993
|
-
});
|
|
2994
|
-
function number(params) {
|
|
2995
|
-
return _number(ZodNumber, params);
|
|
2996
|
-
}
|
|
2997
|
-
const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def$1) => {
|
|
2998
|
-
$ZodNumberFormat.init(inst, def$1);
|
|
2999
|
-
ZodNumber.init(inst, def$1);
|
|
3000
|
-
});
|
|
3001
|
-
function int(params) {
|
|
3002
|
-
return _int(ZodNumberFormat, params);
|
|
3003
|
-
}
|
|
3004
|
-
const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def$1) => {
|
|
3005
|
-
$ZodBoolean.init(inst, def$1);
|
|
3006
|
-
ZodType.init(inst, def$1);
|
|
3007
|
-
});
|
|
3008
|
-
function boolean(params) {
|
|
3009
|
-
return _boolean(ZodBoolean, params);
|
|
3010
|
-
}
|
|
3011
|
-
const ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def$1) => {
|
|
3012
|
-
$ZodNull.init(inst, def$1);
|
|
3013
|
-
ZodType.init(inst, def$1);
|
|
3014
|
-
});
|
|
3015
|
-
function _null(params) {
|
|
3016
|
-
return _null$1(ZodNull, params);
|
|
3017
|
-
}
|
|
3018
1836
|
const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def$1) => {
|
|
3019
1837
|
$ZodUnknown.init(inst, def$1);
|
|
3020
1838
|
ZodType.init(inst, def$1);
|
|
@@ -3300,21 +2118,7 @@ function refine(fn, _params = {}) {
|
|
|
3300
2118
|
function superRefine(fn) {
|
|
3301
2119
|
return _superRefine(fn);
|
|
3302
2120
|
}
|
|
3303
|
-
const
|
|
3304
|
-
const serializableValueSchema = union([
|
|
3305
|
-
boolean(),
|
|
3306
|
-
date(),
|
|
3307
|
-
_null(),
|
|
3308
|
-
number(),
|
|
3309
|
-
string().min(1).max(SERIALIZABLE_VALUE_MAX_LENGTH)
|
|
3310
|
-
]);
|
|
3311
|
-
var InvalidOperationError = class extends Error {
|
|
3312
|
-
constructor(operation, name, message) {
|
|
3313
|
-
super(`Invalid operation: ${operation}, name: ${name}, ${message}`);
|
|
3314
|
-
this.name = "InvalidOperationError";
|
|
3315
|
-
}
|
|
3316
|
-
};
|
|
3317
|
-
const getPropertyNames = () => new Proxy({}, { get: (_target, property) => property });
|
|
2121
|
+
const ItemEntityTypePropertyNames = getPropertyNames();
|
|
3318
2122
|
const ItemMetadataPropertyNames = getPropertyNames();
|
|
3319
2123
|
const itemMetadataSchema = object({
|
|
3320
2124
|
createdAt: date(),
|
|
@@ -5432,10 +4236,7 @@ function initDev() {
|
|
|
5432
4236
|
initCustomFormatter();
|
|
5433
4237
|
}
|
|
5434
4238
|
initDev();
|
|
5435
|
-
const getRawData = (data) => isReactive(data) ? toRaw(data) : data;
|
|
5436
4239
|
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
5437
|
-
const toString = Object.prototype.toString;
|
|
5438
|
-
const isObject$3 = (val) => toString.call(val) === "[object Object]";
|
|
5439
4240
|
function cacheStringFunction(fn) {
|
|
5440
4241
|
const cache = /* @__PURE__ */ Object.create(null);
|
|
5441
4242
|
return (str) => {
|
|
@@ -5448,50 +4249,16 @@ const camelizeRE = /-(\w)/g;
|
|
|
5448
4249
|
cacheStringFunction((str) => {
|
|
5449
4250
|
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
|
|
5450
4251
|
});
|
|
5451
|
-
const toRawDeep = (data) => {
|
|
5452
|
-
const rawData = getRawData(data);
|
|
5453
|
-
for (const key in rawData) if (Object.hasOwn(rawData, key)) {
|
|
5454
|
-
const value = rawData[key];
|
|
5455
|
-
if (!isObject$3(value) && !Array.isArray(value)) continue;
|
|
5456
|
-
rawData[key] = toRawDeep(value);
|
|
5457
|
-
}
|
|
5458
|
-
return rawData;
|
|
5459
|
-
};
|
|
5460
|
-
var Serializable = class {
|
|
5461
|
-
toJSON() {
|
|
5462
|
-
return JSON.stringify(structuredClone(toRawDeep(this)));
|
|
5463
|
-
}
|
|
5464
|
-
};
|
|
5465
|
-
const RangeOperators = [
|
|
5466
|
-
BinaryOperator.ge,
|
|
5467
|
-
BinaryOperator.gt,
|
|
5468
|
-
BinaryOperator.le,
|
|
5469
|
-
BinaryOperator.lt
|
|
5470
|
-
];
|
|
5471
|
-
const VALUE_REGEX = [
|
|
5472
|
-
true,
|
|
5473
|
-
false,
|
|
5474
|
-
String.raw`\d{4}-\d{2}-\d{2}T[^\s]+`,
|
|
5475
|
-
String(null),
|
|
5476
|
-
String.raw`-?\d+(?:\.\d+)?`,
|
|
5477
|
-
String(NaN),
|
|
5478
|
-
"'[^']*'"
|
|
5479
|
-
].join("|");
|
|
5480
|
-
const CLAUSE_REGEX = new RegExp(`^(?<not>not\\s+)?(?<key>[A-Za-z0-9_]+)\\s+(?<operator>${Object.values(BinaryOperator).join("|")})\\s+(?<value>${VALUE_REGEX})$`, "i");
|
|
5481
|
-
const CompositeKeyPropertyNames = getPropertyNames();
|
|
5482
|
-
const capitalize = (string$2) => `${string$2.charAt(0).toUpperCase()}${string$2.slice(1)}`;
|
|
5483
|
-
const AZURE_SELF_DESTRUCT_TIMER = "9".repeat(30);
|
|
5484
|
-
const AZURE_SELF_DESTRUCT_TIMER_SMALL = "9".repeat(15);
|
|
5485
|
-
const KeysToCapitalize = new Set([CompositeKeyPropertyNames.partitionKey, CompositeKeyPropertyNames.rowKey]);
|
|
5486
|
-
const KeysToUncapitalize = new Set([capitalize(CompositeKeyPropertyNames.partitionKey), capitalize(CompositeKeyPropertyNames.rowKey)]);
|
|
5487
4252
|
const css = String.raw;
|
|
5488
4253
|
const html = String.raw;
|
|
5489
|
-
const
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
4254
|
+
const Environment$1 = {
|
|
4255
|
+
development: "development",
|
|
4256
|
+
production: "production",
|
|
4257
|
+
test: "test"
|
|
5493
4258
|
};
|
|
5494
|
-
const
|
|
4259
|
+
const IS_PRODUCTION$1 = "development" === Environment$1.production;
|
|
4260
|
+
const IS_TEST$1 = "development" === Environment$1.test;
|
|
4261
|
+
const IS_DEVELOPMENT$1 = "development" === Environment$1.development;
|
|
5495
4262
|
const getIsServer = () => typeof window === "undefined";
|
|
5496
4263
|
const hrtime = (previousHrTime) => {
|
|
5497
4264
|
if (getIsServer()) return process.hrtime(previousHrTime);
|
|
@@ -5513,67 +4280,6 @@ const loadMilliseconds = Date.now();
|
|
|
5513
4280
|
const exhaustiveGuard = (value) => {
|
|
5514
4281
|
throw new InvalidOperationError(Operation.Read, exhaustiveGuard.name, JSON.stringify(value));
|
|
5515
4282
|
};
|
|
5516
|
-
var CompositeKeyEntity = class extends Serializable {
|
|
5517
|
-
partitionKey;
|
|
5518
|
-
rowKey;
|
|
5519
|
-
};
|
|
5520
|
-
const AzureEntity = applyItemMetadataMixin(CompositeKeyEntity);
|
|
5521
|
-
const FILENAME_MAX_LENGTH = 1e3;
|
|
5522
|
-
const FILE_MAX_LENGTH = 10;
|
|
5523
|
-
const FileEntityPropertyNames = getPropertyNames();
|
|
5524
|
-
const fileEntitySchema = object({
|
|
5525
|
-
filename: string().min(1).max(FILENAME_MAX_LENGTH),
|
|
5526
|
-
id: uuid(),
|
|
5527
|
-
mimetype: string(),
|
|
5528
|
-
size: int().positive()
|
|
5529
|
-
});
|
|
5530
|
-
let FilterType = /* @__PURE__ */ function(FilterType$1) {
|
|
5531
|
-
FilterType$1["From"] = "From";
|
|
5532
|
-
FilterType$1["Mentions"] = "Mentions";
|
|
5533
|
-
FilterType$1["Has"] = "Has";
|
|
5534
|
-
FilterType$1["Before"] = "Before";
|
|
5535
|
-
FilterType$1["During"] = "During";
|
|
5536
|
-
FilterType$1["After"] = "After";
|
|
5537
|
-
FilterType$1["Pinned"] = "Pinned";
|
|
5538
|
-
return FilterType$1;
|
|
5539
|
-
}({});
|
|
5540
|
-
const filterTypeSchema = _enum(FilterType);
|
|
5541
|
-
const filterSchema = object({
|
|
5542
|
-
type: filterTypeSchema,
|
|
5543
|
-
value: serializableValueSchema
|
|
5544
|
-
});
|
|
5545
|
-
const embedAuthorSchema = object({
|
|
5546
|
-
icon_url: url().optional(),
|
|
5547
|
-
name: string().max(256),
|
|
5548
|
-
url: url().optional()
|
|
5549
|
-
});
|
|
5550
|
-
const embedFieldSchema = object({
|
|
5551
|
-
inline: boolean().optional(),
|
|
5552
|
-
name: string().min(1).max(256),
|
|
5553
|
-
value: string().min(1).max(1024)
|
|
5554
|
-
});
|
|
5555
|
-
const embedFooterSchema = object({
|
|
5556
|
-
icon_url: url().optional(),
|
|
5557
|
-
text: string().max(2048)
|
|
5558
|
-
});
|
|
5559
|
-
const embedSchema = object({
|
|
5560
|
-
author: embedAuthorSchema.optional(),
|
|
5561
|
-
color: number().int().min(0).max(256 ** 3 - 1).optional(),
|
|
5562
|
-
description: string().max(4096).optional(),
|
|
5563
|
-
fields: embedFieldSchema.array().max(25).optional(),
|
|
5564
|
-
footer: embedFooterSchema.optional(),
|
|
5565
|
-
image: object({ url: url() }).optional(),
|
|
5566
|
-
thumbnail: object({ url: url() }).optional(),
|
|
5567
|
-
timestamp: datetime().optional(),
|
|
5568
|
-
title: string().max(256).optional(),
|
|
5569
|
-
url: url().optional()
|
|
5570
|
-
});
|
|
5571
|
-
const webhookPayloadSchema = object({
|
|
5572
|
-
avatarUrl: url().optional(),
|
|
5573
|
-
content: string().max(2e3).optional(),
|
|
5574
|
-
embeds: embedSchema.array().max(FILE_MAX_LENGTH).optional(),
|
|
5575
|
-
username: string().max(USER_NAME_MAX_LENGTH).optional()
|
|
5576
|
-
}).refine((data) => data.content || data.embeds && data.embeds.length > 0, { message: "Webhook must have either \"content\" or \"embeds\"." });
|
|
5577
4283
|
|
|
5578
4284
|
//#endregion
|
|
5579
4285
|
//#region src/util/parseTileLayer.ts
|
|
@@ -24122,7 +22828,7 @@ const DefaultParserOptions = {
|
|
|
24122
22828
|
trim: false,
|
|
24123
22829
|
xmlns: false
|
|
24124
22830
|
};
|
|
24125
|
-
const normalize = (string
|
|
22831
|
+
const normalize = (string) => string.toLowerCase();
|
|
24126
22832
|
const stripBOM = (str) => str.startsWith("") ? str.slice(1) : str;
|
|
24127
22833
|
var require_base64_js = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js": ((exports$1) => {
|
|
24128
22834
|
exports$1.byteLength = byteLength$1;
|
|
@@ -24282,7 +22988,7 @@ var require_ieee754 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/iee
|
|
|
24282
22988
|
};
|
|
24283
22989
|
}) });
|
|
24284
22990
|
var require_buffer = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.js": ((exports$1) => {
|
|
24285
|
-
var base64
|
|
22991
|
+
var base64 = require_base64_js();
|
|
24286
22992
|
var ieee754 = require_ieee754();
|
|
24287
22993
|
var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null;
|
|
24288
22994
|
exports$1.Buffer = Buffer$3;
|
|
@@ -24416,12 +23122,12 @@ var require_buffer = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/buff
|
|
|
24416
23122
|
Buffer$3.allocUnsafeSlow = function(size) {
|
|
24417
23123
|
return allocUnsafe(size);
|
|
24418
23124
|
};
|
|
24419
|
-
function fromString(string
|
|
23125
|
+
function fromString(string, encoding) {
|
|
24420
23126
|
if (typeof encoding !== "string" || encoding === "") encoding = "utf8";
|
|
24421
23127
|
if (!Buffer$3.isEncoding(encoding)) throw new TypeError("Unknown encoding: " + encoding);
|
|
24422
|
-
var length = byteLength(string
|
|
23128
|
+
var length = byteLength(string, encoding) | 0;
|
|
24423
23129
|
var buf = createBuffer(length);
|
|
24424
|
-
var actual = buf.write(string
|
|
23130
|
+
var actual = buf.write(string, encoding);
|
|
24425
23131
|
if (actual !== length) buf = buf.slice(0, actual);
|
|
24426
23132
|
return buf;
|
|
24427
23133
|
}
|
|
@@ -24525,11 +23231,11 @@ var require_buffer = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/buff
|
|
|
24525
23231
|
}
|
|
24526
23232
|
return buffer$1;
|
|
24527
23233
|
};
|
|
24528
|
-
function byteLength(string
|
|
24529
|
-
if (Buffer$3.isBuffer(string
|
|
24530
|
-
if (ArrayBuffer.isView(string
|
|
24531
|
-
if (typeof string
|
|
24532
|
-
var len$1 = string
|
|
23234
|
+
function byteLength(string, encoding) {
|
|
23235
|
+
if (Buffer$3.isBuffer(string)) return string.length;
|
|
23236
|
+
if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) return string.byteLength;
|
|
23237
|
+
if (typeof string !== "string") throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type " + typeof string);
|
|
23238
|
+
var len$1 = string.length;
|
|
24533
23239
|
var mustMatch = arguments.length > 2 && arguments[2] === true;
|
|
24534
23240
|
if (!mustMatch && len$1 === 0) return 0;
|
|
24535
23241
|
var loweredCase = false;
|
|
@@ -24538,15 +23244,15 @@ var require_buffer = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/buff
|
|
|
24538
23244
|
case "latin1":
|
|
24539
23245
|
case "binary": return len$1;
|
|
24540
23246
|
case "utf8":
|
|
24541
|
-
case "utf-8": return utf8ToBytes(string
|
|
23247
|
+
case "utf-8": return utf8ToBytes(string).length;
|
|
24542
23248
|
case "ucs2":
|
|
24543
23249
|
case "ucs-2":
|
|
24544
23250
|
case "utf16le":
|
|
24545
23251
|
case "utf-16le": return len$1 * 2;
|
|
24546
23252
|
case "hex": return len$1 >>> 1;
|
|
24547
|
-
case "base64": return base64ToBytes(string
|
|
23253
|
+
case "base64": return base64ToBytes(string).length;
|
|
24548
23254
|
default:
|
|
24549
|
-
if (loweredCase) return mustMatch ? -1 : utf8ToBytes(string
|
|
23255
|
+
if (loweredCase) return mustMatch ? -1 : utf8ToBytes(string).length;
|
|
24550
23256
|
encoding = ("" + encoding).toLowerCase();
|
|
24551
23257
|
loweredCase = true;
|
|
24552
23258
|
}
|
|
@@ -24612,7 +23318,7 @@ var require_buffer = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/buff
|
|
|
24612
23318
|
}
|
|
24613
23319
|
return this;
|
|
24614
23320
|
};
|
|
24615
|
-
Buffer$3.prototype.toString = function toString
|
|
23321
|
+
Buffer$3.prototype.toString = function toString() {
|
|
24616
23322
|
var length = this.length;
|
|
24617
23323
|
if (length === 0) return "";
|
|
24618
23324
|
if (arguments.length === 0) return utf8Slice(this, 0, length);
|
|
@@ -24738,7 +23444,7 @@ var require_buffer = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/buff
|
|
|
24738
23444
|
Buffer$3.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
|
|
24739
23445
|
return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
|
|
24740
23446
|
};
|
|
24741
|
-
function hexWrite(buf, string
|
|
23447
|
+
function hexWrite(buf, string, offset, length) {
|
|
24742
23448
|
offset = Number(offset) || 0;
|
|
24743
23449
|
var remaining = buf.length - offset;
|
|
24744
23450
|
if (!length) length = remaining;
|
|
@@ -24746,28 +23452,28 @@ var require_buffer = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/buff
|
|
|
24746
23452
|
length = Number(length);
|
|
24747
23453
|
if (length > remaining) length = remaining;
|
|
24748
23454
|
}
|
|
24749
|
-
var strLen = string
|
|
23455
|
+
var strLen = string.length;
|
|
24750
23456
|
if (length > strLen / 2) length = strLen / 2;
|
|
24751
23457
|
for (var i$1 = 0; i$1 < length; ++i$1) {
|
|
24752
|
-
var parsed = parseInt(string
|
|
23458
|
+
var parsed = parseInt(string.substr(i$1 * 2, 2), 16);
|
|
24753
23459
|
if (numberIsNaN(parsed)) return i$1;
|
|
24754
23460
|
buf[offset + i$1] = parsed;
|
|
24755
23461
|
}
|
|
24756
23462
|
return i$1;
|
|
24757
23463
|
}
|
|
24758
|
-
function utf8Write(buf, string
|
|
24759
|
-
return blitBuffer(utf8ToBytes(string
|
|
23464
|
+
function utf8Write(buf, string, offset, length) {
|
|
23465
|
+
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
|
|
24760
23466
|
}
|
|
24761
|
-
function asciiWrite(buf, string
|
|
24762
|
-
return blitBuffer(asciiToBytes(string
|
|
23467
|
+
function asciiWrite(buf, string, offset, length) {
|
|
23468
|
+
return blitBuffer(asciiToBytes(string), buf, offset, length);
|
|
24763
23469
|
}
|
|
24764
|
-
function base64Write(buf, string
|
|
24765
|
-
return blitBuffer(base64ToBytes(string
|
|
23470
|
+
function base64Write(buf, string, offset, length) {
|
|
23471
|
+
return blitBuffer(base64ToBytes(string), buf, offset, length);
|
|
24766
23472
|
}
|
|
24767
|
-
function ucs2Write(buf, string
|
|
24768
|
-
return blitBuffer(utf16leToBytes(string
|
|
23473
|
+
function ucs2Write(buf, string, offset, length) {
|
|
23474
|
+
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
|
|
24769
23475
|
}
|
|
24770
|
-
Buffer$3.prototype.write = function write(string
|
|
23476
|
+
Buffer$3.prototype.write = function write(string, offset, length, encoding) {
|
|
24771
23477
|
if (offset === void 0) {
|
|
24772
23478
|
encoding = "utf8";
|
|
24773
23479
|
length = this.length;
|
|
@@ -24788,21 +23494,21 @@ var require_buffer = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/buff
|
|
|
24788
23494
|
} else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
|
|
24789
23495
|
var remaining = this.length - offset;
|
|
24790
23496
|
if (length === void 0 || length > remaining) length = remaining;
|
|
24791
|
-
if (string
|
|
23497
|
+
if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) throw new RangeError("Attempt to write outside buffer bounds");
|
|
24792
23498
|
if (!encoding) encoding = "utf8";
|
|
24793
23499
|
var loweredCase = false;
|
|
24794
23500
|
for (;;) switch (encoding) {
|
|
24795
|
-
case "hex": return hexWrite(this, string
|
|
23501
|
+
case "hex": return hexWrite(this, string, offset, length);
|
|
24796
23502
|
case "utf8":
|
|
24797
|
-
case "utf-8": return utf8Write(this, string
|
|
23503
|
+
case "utf-8": return utf8Write(this, string, offset, length);
|
|
24798
23504
|
case "ascii":
|
|
24799
23505
|
case "latin1":
|
|
24800
|
-
case "binary": return asciiWrite(this, string
|
|
24801
|
-
case "base64": return base64Write(this, string
|
|
23506
|
+
case "binary": return asciiWrite(this, string, offset, length);
|
|
23507
|
+
case "base64": return base64Write(this, string, offset, length);
|
|
24802
23508
|
case "ucs2":
|
|
24803
23509
|
case "ucs-2":
|
|
24804
23510
|
case "utf16le":
|
|
24805
|
-
case "utf-16le": return ucs2Write(this, string
|
|
23511
|
+
case "utf-16le": return ucs2Write(this, string, offset, length);
|
|
24806
23512
|
default:
|
|
24807
23513
|
if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
|
|
24808
23514
|
encoding = ("" + encoding).toLowerCase();
|
|
@@ -24816,8 +23522,8 @@ var require_buffer = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/buff
|
|
|
24816
23522
|
};
|
|
24817
23523
|
};
|
|
24818
23524
|
function base64Slice(buf, start, end) {
|
|
24819
|
-
if (start === 0 && end === buf.length) return base64
|
|
24820
|
-
else return base64
|
|
23525
|
+
if (start === 0 && end === buf.length) return base64.fromByteArray(buf);
|
|
23526
|
+
else return base64.fromByteArray(buf.slice(start, end));
|
|
24821
23527
|
}
|
|
24822
23528
|
function utf8Slice(buf, start, end) {
|
|
24823
23529
|
end = Math.min(buf.length, end);
|
|
@@ -25288,14 +23994,14 @@ var require_buffer = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/buff
|
|
|
25288
23994
|
while (str.length % 4 !== 0) str = str + "=";
|
|
25289
23995
|
return str;
|
|
25290
23996
|
}
|
|
25291
|
-
function utf8ToBytes(string
|
|
23997
|
+
function utf8ToBytes(string, units) {
|
|
25292
23998
|
units = units || Infinity;
|
|
25293
23999
|
var codePoint;
|
|
25294
|
-
var length = string
|
|
24000
|
+
var length = string.length;
|
|
25295
24001
|
var leadSurrogate = null;
|
|
25296
24002
|
var bytes = [];
|
|
25297
24003
|
for (var i$1 = 0; i$1 < length; ++i$1) {
|
|
25298
|
-
codePoint = string
|
|
24004
|
+
codePoint = string.charCodeAt(i$1);
|
|
25299
24005
|
if (codePoint > 55295 && codePoint < 57344) {
|
|
25300
24006
|
if (!leadSurrogate) {
|
|
25301
24007
|
if (codePoint > 56319) {
|
|
@@ -25353,7 +24059,7 @@ var require_buffer = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/buff
|
|
|
25353
24059
|
return byteArray;
|
|
25354
24060
|
}
|
|
25355
24061
|
function base64ToBytes(str) {
|
|
25356
|
-
return base64
|
|
24062
|
+
return base64.toByteArray(base64clean(str));
|
|
25357
24063
|
}
|
|
25358
24064
|
function blitBuffer(src, dst, offset, length) {
|
|
25359
24065
|
for (var i$1 = 0; i$1 < length; ++i$1) {
|
|
@@ -26988,12 +25694,12 @@ var Parser = class {
|
|
|
26988
25694
|
else defineProperty(object$1, key, newValue);
|
|
26989
25695
|
}
|
|
26990
25696
|
parseString(convertableToString, callback) {
|
|
26991
|
-
const string
|
|
25697
|
+
const string = stripBOM(convertableToString.toString());
|
|
26992
25698
|
this.saxParser.onend = () => {
|
|
26993
25699
|
callback(this.resultObject);
|
|
26994
25700
|
this.resultObject = {};
|
|
26995
25701
|
};
|
|
26996
|
-
return this.saxParser.write(string
|
|
25702
|
+
return this.saxParser.write(string).close();
|
|
26997
25703
|
}
|
|
26998
25704
|
};
|
|
26999
25705
|
const parseStringPromise = (convertableToString, options) => {
|
|
@@ -27017,23 +25723,23 @@ const defineProperty = (object$1, key, value) => {
|
|
|
27017
25723
|
//#endregion
|
|
27018
25724
|
//#region ../../node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/utils.js
|
|
27019
25725
|
var require_utils$2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/utils.js": ((exports) => {
|
|
27020
|
-
exports.removeLeadingAndTrailingHTTPWhitespace = (string
|
|
27021
|
-
return string
|
|
25726
|
+
exports.removeLeadingAndTrailingHTTPWhitespace = (string) => {
|
|
25727
|
+
return string.replace(/^[ \t\n\r]+/u, "").replace(/[ \t\n\r]+$/u, "");
|
|
27022
25728
|
};
|
|
27023
|
-
exports.removeTrailingHTTPWhitespace = (string
|
|
27024
|
-
return string
|
|
25729
|
+
exports.removeTrailingHTTPWhitespace = (string) => {
|
|
25730
|
+
return string.replace(/[ \t\n\r]+$/u, "");
|
|
27025
25731
|
};
|
|
27026
25732
|
exports.isHTTPWhitespaceChar = (char) => {
|
|
27027
25733
|
return char === " " || char === " " || char === "\n" || char === "\r";
|
|
27028
25734
|
};
|
|
27029
|
-
exports.solelyContainsHTTPTokenCodePoints = (string
|
|
27030
|
-
return /^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(string
|
|
25735
|
+
exports.solelyContainsHTTPTokenCodePoints = (string) => {
|
|
25736
|
+
return /^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(string);
|
|
27031
25737
|
};
|
|
27032
|
-
exports.soleyContainsHTTPQuotedStringTokenCodePoints = (string
|
|
27033
|
-
return /^[\t\u0020-\u007E\u0080-\u00FF]*$/u.test(string
|
|
25738
|
+
exports.soleyContainsHTTPQuotedStringTokenCodePoints = (string) => {
|
|
25739
|
+
return /^[\t\u0020-\u007E\u0080-\u00FF]*$/u.test(string);
|
|
27034
25740
|
};
|
|
27035
|
-
exports.asciiLowercase = (string
|
|
27036
|
-
return string
|
|
25741
|
+
exports.asciiLowercase = (string) => {
|
|
25742
|
+
return string.replace(/[A-Z]/gu, (l) => l.toLowerCase());
|
|
27037
25743
|
};
|
|
27038
25744
|
exports.collectAnHTTPQuotedString = (input, position) => {
|
|
27039
25745
|
let value = "";
|
|
@@ -27198,17 +25904,17 @@ var require_mime_type = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
27198
25904
|
const serialize = require_serializer();
|
|
27199
25905
|
const { asciiLowercase, solelyContainsHTTPTokenCodePoints } = require_utils$2();
|
|
27200
25906
|
module.exports = class MIMEType$1 {
|
|
27201
|
-
constructor(string
|
|
27202
|
-
string
|
|
27203
|
-
const result = parse(string
|
|
27204
|
-
if (result === null) throw new Error(`Could not parse MIME type string "${string
|
|
25907
|
+
constructor(string) {
|
|
25908
|
+
string = String(string);
|
|
25909
|
+
const result = parse(string);
|
|
25910
|
+
if (result === null) throw new Error(`Could not parse MIME type string "${string}"`);
|
|
27205
25911
|
this._type = result.type;
|
|
27206
25912
|
this._subtype = result.subtype;
|
|
27207
25913
|
this._parameters = new MIMETypeParameters(result.parameters);
|
|
27208
25914
|
}
|
|
27209
|
-
static parse(string
|
|
25915
|
+
static parse(string) {
|
|
27210
25916
|
try {
|
|
27211
|
-
return new this(string
|
|
25917
|
+
return new this(string);
|
|
27212
25918
|
} catch (e) {
|
|
27213
25919
|
return null;
|
|
27214
25920
|
}
|
|
@@ -27802,14 +26508,14 @@ var require_punycode = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
27802
26508
|
* @param {String} string The Unicode input string (UCS-2).
|
|
27803
26509
|
* @returns {Array} The new array of code points.
|
|
27804
26510
|
*/
|
|
27805
|
-
function ucs2decode(string
|
|
26511
|
+
function ucs2decode(string) {
|
|
27806
26512
|
const output = [];
|
|
27807
26513
|
let counter = 0;
|
|
27808
|
-
const length = string
|
|
26514
|
+
const length = string.length;
|
|
27809
26515
|
while (counter < length) {
|
|
27810
|
-
const value = string
|
|
26516
|
+
const value = string.charCodeAt(counter++);
|
|
27811
26517
|
if (value >= 55296 && value <= 56319 && counter < length) {
|
|
27812
|
-
const extra = string
|
|
26518
|
+
const extra = string.charCodeAt(counter++);
|
|
27813
26519
|
if ((extra & 64512) == 56320) output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
|
|
27814
26520
|
else {
|
|
27815
26521
|
output.push(value);
|
|
@@ -27971,8 +26677,8 @@ var require_punycode = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
27971
26677
|
* string.
|
|
27972
26678
|
*/
|
|
27973
26679
|
const toUnicode$1 = function(input) {
|
|
27974
|
-
return mapDomain(input, function(string
|
|
27975
|
-
return regexPunycode.test(string
|
|
26680
|
+
return mapDomain(input, function(string) {
|
|
26681
|
+
return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
|
|
27976
26682
|
});
|
|
27977
26683
|
};
|
|
27978
26684
|
/**
|
|
@@ -27987,8 +26693,8 @@ var require_punycode = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
27987
26693
|
* email address.
|
|
27988
26694
|
*/
|
|
27989
26695
|
const toASCII$1 = function(input) {
|
|
27990
|
-
return mapDomain(input, function(string
|
|
27991
|
-
return regexNonASCII.test(string
|
|
26696
|
+
return mapDomain(input, function(string) {
|
|
26697
|
+
return regexNonASCII.test(string) ? "xn--" + encode(string) : string;
|
|
27992
26698
|
});
|
|
27993
26699
|
};
|
|
27994
26700
|
/** Define the public API */
|
|
@@ -61936,9 +60642,9 @@ var require_tr46 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/tr46
|
|
|
61936
60642
|
return regexes.bidiDomain.test(domain);
|
|
61937
60643
|
}
|
|
61938
60644
|
function processing(domainName, options) {
|
|
61939
|
-
let string
|
|
61940
|
-
string
|
|
61941
|
-
const labels = string
|
|
60645
|
+
let string = mapChars(domainName, options);
|
|
60646
|
+
string = string.normalize("NFC");
|
|
60647
|
+
const labels = string.split(".");
|
|
61942
60648
|
const isBidi = isBidiDomain(labels);
|
|
61943
60649
|
let error$1 = false;
|
|
61944
60650
|
for (const [i, origLabel] of labels.entries()) {
|
|
@@ -62050,8 +60756,8 @@ var require_infra = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/wha
|
|
|
62050
60756
|
var require_encoding = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/whatwg-url@15.1.0/node_modules/whatwg-url/lib/encoding.js": ((exports, module) => {
|
|
62051
60757
|
const utf8Encoder = new TextEncoder();
|
|
62052
60758
|
const utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true });
|
|
62053
|
-
function utf8Encode$2(string
|
|
62054
|
-
return utf8Encoder.encode(string
|
|
60759
|
+
function utf8Encode$2(string) {
|
|
60760
|
+
return utf8Encoder.encode(string);
|
|
62055
60761
|
}
|
|
62056
60762
|
function utf8DecodeWithoutBOM$2(bytes) {
|
|
62057
60763
|
return utf8Decoder.decode(bytes);
|
|
@@ -62230,26 +60936,26 @@ var require_url_state_machine = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
62230
60936
|
function isWindowsDriveLetterCodePoints(cp1, cp2) {
|
|
62231
60937
|
return infra.isASCIIAlpha(cp1) && (cp2 === p$1(":") || cp2 === p$1("|"));
|
|
62232
60938
|
}
|
|
62233
|
-
function isWindowsDriveLetterString(string
|
|
62234
|
-
return string
|
|
60939
|
+
function isWindowsDriveLetterString(string) {
|
|
60940
|
+
return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|");
|
|
62235
60941
|
}
|
|
62236
|
-
function isNormalizedWindowsDriveLetterString(string
|
|
62237
|
-
return string
|
|
60942
|
+
function isNormalizedWindowsDriveLetterString(string) {
|
|
60943
|
+
return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && string[1] === ":";
|
|
62238
60944
|
}
|
|
62239
|
-
function containsForbiddenHostCodePoint(string
|
|
62240
|
-
return string
|
|
60945
|
+
function containsForbiddenHostCodePoint(string) {
|
|
60946
|
+
return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u) !== -1;
|
|
62241
60947
|
}
|
|
62242
|
-
function containsForbiddenDomainCodePoint(string
|
|
62243
|
-
return containsForbiddenHostCodePoint(string
|
|
60948
|
+
function containsForbiddenDomainCodePoint(string) {
|
|
60949
|
+
return containsForbiddenHostCodePoint(string) || string.search(/[\u0000-\u001F]|%|\u007F/u) !== -1;
|
|
62244
60950
|
}
|
|
62245
60951
|
function isSpecialScheme(scheme) {
|
|
62246
60952
|
return specialSchemes[scheme] !== void 0;
|
|
62247
60953
|
}
|
|
62248
|
-
function isSpecial(url
|
|
62249
|
-
return isSpecialScheme(url
|
|
60954
|
+
function isSpecial(url) {
|
|
60955
|
+
return isSpecialScheme(url.scheme);
|
|
62250
60956
|
}
|
|
62251
|
-
function isNotSpecial(url
|
|
62252
|
-
return !isSpecialScheme(url
|
|
60957
|
+
function isNotSpecial(url) {
|
|
60958
|
+
return !isSpecialScheme(url.scheme);
|
|
62253
60959
|
}
|
|
62254
60960
|
function defaultPort(scheme) {
|
|
62255
60961
|
return specialSchemes[scheme];
|
|
@@ -62285,13 +60991,13 @@ var require_url_state_machine = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
62285
60991
|
}
|
|
62286
60992
|
for (let i = 0; i < numbers.length - 1; ++i) if (numbers[i] > 255) return failure;
|
|
62287
60993
|
if (numbers[numbers.length - 1] >= 256 ** (5 - numbers.length)) return failure;
|
|
62288
|
-
let ipv4
|
|
60994
|
+
let ipv4 = numbers.pop();
|
|
62289
60995
|
let counter = 0;
|
|
62290
60996
|
for (const n of numbers) {
|
|
62291
|
-
ipv4
|
|
60997
|
+
ipv4 += n * 256 ** (3 - counter);
|
|
62292
60998
|
++counter;
|
|
62293
60999
|
}
|
|
62294
|
-
return ipv4
|
|
61000
|
+
return ipv4;
|
|
62295
61001
|
}
|
|
62296
61002
|
function serializeIPv4(address) {
|
|
62297
61003
|
let output = "";
|
|
@@ -62351,10 +61057,10 @@ var require_url_state_machine = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
62351
61057
|
else return failure;
|
|
62352
61058
|
if (!infra.isASCIIDigit(input[pointer])) return failure;
|
|
62353
61059
|
while (infra.isASCIIDigit(input[pointer])) {
|
|
62354
|
-
const number
|
|
62355
|
-
if (ipv4Piece === null) ipv4Piece = number
|
|
61060
|
+
const number = parseInt(at(input, pointer));
|
|
61061
|
+
if (ipv4Piece === null) ipv4Piece = number;
|
|
62356
61062
|
else if (ipv4Piece === 0) return failure;
|
|
62357
|
-
else ipv4Piece = ipv4Piece * 10 + number
|
|
61063
|
+
else ipv4Piece = ipv4Piece * 10 + number;
|
|
62358
61064
|
if (ipv4Piece > 255) return failure;
|
|
62359
61065
|
++pointer;
|
|
62360
61066
|
}
|
|
@@ -62468,41 +61174,41 @@ var require_url_state_machine = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
62468
61174
|
}
|
|
62469
61175
|
return result;
|
|
62470
61176
|
}
|
|
62471
|
-
function trimControlChars(string
|
|
61177
|
+
function trimControlChars(string) {
|
|
62472
61178
|
let start = 0;
|
|
62473
|
-
let end = string
|
|
62474
|
-
for (; start < end; ++start) if (string
|
|
62475
|
-
for (; end > start; --end) if (string
|
|
62476
|
-
return string
|
|
61179
|
+
let end = string.length;
|
|
61180
|
+
for (; start < end; ++start) if (string.charCodeAt(start) > 32) break;
|
|
61181
|
+
for (; end > start; --end) if (string.charCodeAt(end - 1) > 32) break;
|
|
61182
|
+
return string.substring(start, end);
|
|
62477
61183
|
}
|
|
62478
|
-
function trimTabAndNewline(url
|
|
62479
|
-
return url
|
|
61184
|
+
function trimTabAndNewline(url) {
|
|
61185
|
+
return url.replace(/\u0009|\u000A|\u000D/gu, "");
|
|
62480
61186
|
}
|
|
62481
|
-
function shortenPath(url
|
|
62482
|
-
const { path } = url
|
|
61187
|
+
function shortenPath(url) {
|
|
61188
|
+
const { path } = url;
|
|
62483
61189
|
if (path.length === 0) return;
|
|
62484
|
-
if (url
|
|
61190
|
+
if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) return;
|
|
62485
61191
|
path.pop();
|
|
62486
61192
|
}
|
|
62487
|
-
function includesCredentials(url
|
|
62488
|
-
return url
|
|
61193
|
+
function includesCredentials(url) {
|
|
61194
|
+
return url.username !== "" || url.password !== "";
|
|
62489
61195
|
}
|
|
62490
|
-
function cannotHaveAUsernamePasswordPort(url
|
|
62491
|
-
return url
|
|
61196
|
+
function cannotHaveAUsernamePasswordPort(url) {
|
|
61197
|
+
return url.host === null || url.host === "" || url.scheme === "file";
|
|
62492
61198
|
}
|
|
62493
|
-
function hasAnOpaquePath(url
|
|
62494
|
-
return typeof url
|
|
61199
|
+
function hasAnOpaquePath(url) {
|
|
61200
|
+
return typeof url.path === "string";
|
|
62495
61201
|
}
|
|
62496
|
-
function isNormalizedWindowsDriveLetter(string
|
|
62497
|
-
return /^[A-Za-z]:$/u.test(string
|
|
61202
|
+
function isNormalizedWindowsDriveLetter(string) {
|
|
61203
|
+
return /^[A-Za-z]:$/u.test(string);
|
|
62498
61204
|
}
|
|
62499
|
-
function URLStateMachine(input, base$1, encodingOverride, url
|
|
61205
|
+
function URLStateMachine(input, base$1, encodingOverride, url, stateOverride) {
|
|
62500
61206
|
this.pointer = 0;
|
|
62501
61207
|
this.input = input;
|
|
62502
61208
|
this.base = base$1 || null;
|
|
62503
61209
|
this.encodingOverride = encodingOverride || "utf-8";
|
|
62504
61210
|
this.stateOverride = stateOverride;
|
|
62505
|
-
this.url = url
|
|
61211
|
+
this.url = url;
|
|
62506
61212
|
this.failure = false;
|
|
62507
61213
|
this.parseError = false;
|
|
62508
61214
|
if (!this.url) {
|
|
@@ -62936,22 +61642,22 @@ var require_url_state_machine = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
62936
61642
|
}
|
|
62937
61643
|
return true;
|
|
62938
61644
|
};
|
|
62939
|
-
function serializeURL$1(url
|
|
62940
|
-
let output = `${url
|
|
62941
|
-
if (url
|
|
61645
|
+
function serializeURL$1(url, excludeFragment) {
|
|
61646
|
+
let output = `${url.scheme}:`;
|
|
61647
|
+
if (url.host !== null) {
|
|
62942
61648
|
output += "//";
|
|
62943
|
-
if (url
|
|
62944
|
-
output += url
|
|
62945
|
-
if (url
|
|
61649
|
+
if (url.username !== "" || url.password !== "") {
|
|
61650
|
+
output += url.username;
|
|
61651
|
+
if (url.password !== "") output += `:${url.password}`;
|
|
62946
61652
|
output += "@";
|
|
62947
61653
|
}
|
|
62948
|
-
output += serializeHost(url
|
|
62949
|
-
if (url
|
|
61654
|
+
output += serializeHost(url.host);
|
|
61655
|
+
if (url.port !== null) output += `:${url.port}`;
|
|
62950
61656
|
}
|
|
62951
|
-
if (url
|
|
62952
|
-
output += serializePath(url
|
|
62953
|
-
if (url
|
|
62954
|
-
if (!excludeFragment && url
|
|
61657
|
+
if (url.host === null && !hasAnOpaquePath(url) && url.path.length > 1 && url.path[0] === "") output += "/.";
|
|
61658
|
+
output += serializePath(url);
|
|
61659
|
+
if (url.query !== null) output += `?${url.query}`;
|
|
61660
|
+
if (!excludeFragment && url.fragment !== null) output += `#${url.fragment}`;
|
|
62955
61661
|
return output;
|
|
62956
61662
|
}
|
|
62957
61663
|
function serializeOrigin(tuple) {
|
|
@@ -62960,18 +61666,18 @@ var require_url_state_machine = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
62960
61666
|
if (tuple.port !== null) result += `:${tuple.port}`;
|
|
62961
61667
|
return result;
|
|
62962
61668
|
}
|
|
62963
|
-
function serializePath(url
|
|
62964
|
-
if (hasAnOpaquePath(url
|
|
61669
|
+
function serializePath(url) {
|
|
61670
|
+
if (hasAnOpaquePath(url)) return url.path;
|
|
62965
61671
|
let output = "";
|
|
62966
|
-
for (const segment of url
|
|
61672
|
+
for (const segment of url.path) output += `/${segment}`;
|
|
62967
61673
|
return output;
|
|
62968
61674
|
}
|
|
62969
61675
|
module.exports.serializeURL = serializeURL$1;
|
|
62970
61676
|
module.exports.serializePath = serializePath;
|
|
62971
|
-
module.exports.serializeURLOrigin = function(url
|
|
62972
|
-
switch (url
|
|
61677
|
+
module.exports.serializeURLOrigin = function(url) {
|
|
61678
|
+
switch (url.scheme) {
|
|
62973
61679
|
case "blob": {
|
|
62974
|
-
const pathURL = module.exports.parseURL(serializePath(url
|
|
61680
|
+
const pathURL = module.exports.parseURL(serializePath(url));
|
|
62975
61681
|
if (pathURL === null) return "null";
|
|
62976
61682
|
if (pathURL.scheme !== "http" && pathURL.scheme !== "https") return "null";
|
|
62977
61683
|
return module.exports.serializeURLOrigin(pathURL);
|
|
@@ -62981,9 +61687,9 @@ var require_url_state_machine = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
62981
61687
|
case "https":
|
|
62982
61688
|
case "ws":
|
|
62983
61689
|
case "wss": return serializeOrigin({
|
|
62984
|
-
scheme: url
|
|
62985
|
-
host: url
|
|
62986
|
-
port: url
|
|
61690
|
+
scheme: url.scheme,
|
|
61691
|
+
host: url.host,
|
|
61692
|
+
port: url.port
|
|
62987
61693
|
});
|
|
62988
61694
|
case "file": return "null";
|
|
62989
61695
|
default: return "null";
|
|
@@ -62995,17 +61701,17 @@ var require_url_state_machine = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
62995
61701
|
if (usm$1.failure) return null;
|
|
62996
61702
|
return usm$1.url;
|
|
62997
61703
|
};
|
|
62998
|
-
module.exports.setTheUsername = function(url
|
|
62999
|
-
url
|
|
61704
|
+
module.exports.setTheUsername = function(url, username) {
|
|
61705
|
+
url.username = utf8PercentEncodeString$1(username, isUserinfoPercentEncode);
|
|
63000
61706
|
};
|
|
63001
|
-
module.exports.setThePassword = function(url
|
|
63002
|
-
url
|
|
61707
|
+
module.exports.setThePassword = function(url, password) {
|
|
61708
|
+
url.password = utf8PercentEncodeString$1(password, isUserinfoPercentEncode);
|
|
63003
61709
|
};
|
|
63004
61710
|
module.exports.serializeHost = serializeHost;
|
|
63005
61711
|
module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;
|
|
63006
61712
|
module.exports.hasAnOpaquePath = hasAnOpaquePath;
|
|
63007
|
-
module.exports.serializeInteger = function(integer
|
|
63008
|
-
return String(integer
|
|
61713
|
+
module.exports.serializeInteger = function(integer) {
|
|
61714
|
+
return String(integer);
|
|
63009
61715
|
};
|
|
63010
61716
|
module.exports.parseURL = function(input, options) {
|
|
63011
61717
|
if (options === void 0) options = {};
|
|
@@ -63554,14 +62260,14 @@ var require_URL_impl = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
63554
62260
|
const urlencoded = require_urlencoded();
|
|
63555
62261
|
const URLSearchParams$2 = require_URLSearchParams();
|
|
63556
62262
|
exports.implementation = class URLImpl {
|
|
63557
|
-
constructor(globalObject, [url
|
|
62263
|
+
constructor(globalObject, [url, base$1]) {
|
|
63558
62264
|
let parsedBase = null;
|
|
63559
62265
|
if (base$1 !== void 0) {
|
|
63560
62266
|
parsedBase = usm.basicURLParse(base$1);
|
|
63561
62267
|
if (parsedBase === null) throw new TypeError(`Invalid base URL: ${base$1}`);
|
|
63562
62268
|
}
|
|
63563
|
-
const parsedURL = usm.basicURLParse(url
|
|
63564
|
-
if (parsedURL === null) throw new TypeError(`Invalid URL: ${url
|
|
62269
|
+
const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });
|
|
62270
|
+
if (parsedURL === null) throw new TypeError(`Invalid URL: ${url}`);
|
|
63565
62271
|
const query = parsedURL.query !== null ? parsedURL.query : "";
|
|
63566
62272
|
this._url = parsedURL;
|
|
63567
62273
|
this._query = URLSearchParams$2.createImpl(globalObject, [query], { doNotStripQMark: true });
|
|
@@ -63574,13 +62280,13 @@ var require_URL_impl = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
63574
62280
|
return null;
|
|
63575
62281
|
}
|
|
63576
62282
|
}
|
|
63577
|
-
static canParse(url
|
|
62283
|
+
static canParse(url, base$1) {
|
|
63578
62284
|
let parsedBase = null;
|
|
63579
62285
|
if (base$1 !== void 0) {
|
|
63580
62286
|
parsedBase = usm.basicURLParse(base$1);
|
|
63581
62287
|
if (parsedBase === null) return false;
|
|
63582
62288
|
}
|
|
63583
|
-
if (usm.basicURLParse(url
|
|
62289
|
+
if (usm.basicURLParse(url, { baseURL: parsedBase }) === null) return false;
|
|
63584
62290
|
return true;
|
|
63585
62291
|
}
|
|
63586
62292
|
get href() {
|
|
@@ -63621,10 +62327,10 @@ var require_URL_impl = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
63621
62327
|
usm.setThePassword(this._url, v);
|
|
63622
62328
|
}
|
|
63623
62329
|
get host() {
|
|
63624
|
-
const url
|
|
63625
|
-
if (url
|
|
63626
|
-
if (url
|
|
63627
|
-
return `${usm.serializeHost(url
|
|
62330
|
+
const url = this._url;
|
|
62331
|
+
if (url.host === null) return "";
|
|
62332
|
+
if (url.port === null) return usm.serializeHost(url.host);
|
|
62333
|
+
return `${usm.serializeHost(url.host)}:${usm.serializeInteger(url.port)}`;
|
|
63628
62334
|
}
|
|
63629
62335
|
set host(v) {
|
|
63630
62336
|
if (usm.hasAnOpaquePath(this._url)) return;
|
|
@@ -63672,16 +62378,16 @@ var require_URL_impl = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
63672
62378
|
return `?${this._url.query}`;
|
|
63673
62379
|
}
|
|
63674
62380
|
set search(v) {
|
|
63675
|
-
const url
|
|
62381
|
+
const url = this._url;
|
|
63676
62382
|
if (v === "") {
|
|
63677
|
-
url
|
|
62383
|
+
url.query = null;
|
|
63678
62384
|
this._query._list = [];
|
|
63679
62385
|
return;
|
|
63680
62386
|
}
|
|
63681
62387
|
const input = v[0] === "?" ? v.substring(1) : v;
|
|
63682
|
-
url
|
|
62388
|
+
url.query = "";
|
|
63683
62389
|
usm.basicURLParse(input, {
|
|
63684
|
-
url
|
|
62390
|
+
url,
|
|
63685
62391
|
stateOverride: "query"
|
|
63686
62392
|
});
|
|
63687
62393
|
this._query._list = urlencoded.parseUrlencodedString(input);
|
|
@@ -63770,8 +62476,8 @@ var require_URL = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/whatw
|
|
|
63770
62476
|
exports.install = (globalObject, globalNames) => {
|
|
63771
62477
|
if (!globalNames.some((globalName) => exposed.has(globalName))) return;
|
|
63772
62478
|
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
|
63773
|
-
class URL$
|
|
63774
|
-
constructor(url
|
|
62479
|
+
class URL$2 {
|
|
62480
|
+
constructor(url) {
|
|
63775
62481
|
if (arguments.length < 1) throw new globalObject.TypeError(`Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.`);
|
|
63776
62482
|
const args = [];
|
|
63777
62483
|
{
|
|
@@ -63954,7 +62660,7 @@ var require_URL = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/whatw
|
|
|
63954
62660
|
});
|
|
63955
62661
|
esValue[implSymbol]["hash"] = V;
|
|
63956
62662
|
}
|
|
63957
|
-
static parse(url
|
|
62663
|
+
static parse(url) {
|
|
63958
62664
|
if (arguments.length < 1) throw new globalObject.TypeError(`Failed to execute 'parse' on 'URL': 1 argument required, but only ${arguments.length} present.`);
|
|
63959
62665
|
const args = [];
|
|
63960
62666
|
{
|
|
@@ -63975,7 +62681,7 @@ var require_URL = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/whatw
|
|
|
63975
62681
|
}
|
|
63976
62682
|
return utils.tryWrapperForImpl(Impl.implementation.parse(globalObject, ...args));
|
|
63977
62683
|
}
|
|
63978
|
-
static canParse(url
|
|
62684
|
+
static canParse(url) {
|
|
63979
62685
|
if (arguments.length < 1) throw new globalObject.TypeError(`Failed to execute 'canParse' on 'URL': 1 argument required, but only ${arguments.length} present.`);
|
|
63980
62686
|
const args = [];
|
|
63981
62687
|
{
|
|
@@ -63997,7 +62703,7 @@ var require_URL = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/whatw
|
|
|
63997
62703
|
return Impl.implementation.canParse(...args);
|
|
63998
62704
|
}
|
|
63999
62705
|
}
|
|
64000
|
-
Object.defineProperties(URL$
|
|
62706
|
+
Object.defineProperties(URL$2.prototype, {
|
|
64001
62707
|
toJSON: { enumerable: true },
|
|
64002
62708
|
href: { enumerable: true },
|
|
64003
62709
|
toString: { enumerable: true },
|
|
@@ -64017,20 +62723,20 @@ var require_URL = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/whatw
|
|
|
64017
62723
|
configurable: true
|
|
64018
62724
|
}
|
|
64019
62725
|
});
|
|
64020
|
-
Object.defineProperties(URL$
|
|
62726
|
+
Object.defineProperties(URL$2, {
|
|
64021
62727
|
parse: { enumerable: true },
|
|
64022
62728
|
canParse: { enumerable: true }
|
|
64023
62729
|
});
|
|
64024
|
-
ctorRegistry[interfaceName] = URL$
|
|
62730
|
+
ctorRegistry[interfaceName] = URL$2;
|
|
64025
62731
|
Object.defineProperty(globalObject, interfaceName, {
|
|
64026
62732
|
configurable: true,
|
|
64027
62733
|
writable: true,
|
|
64028
|
-
value: URL$
|
|
62734
|
+
value: URL$2
|
|
64029
62735
|
});
|
|
64030
62736
|
if (globalNames.includes("Window")) Object.defineProperty(globalObject, "webkitURL", {
|
|
64031
62737
|
configurable: true,
|
|
64032
62738
|
writable: true,
|
|
64033
|
-
value: URL$
|
|
62739
|
+
value: URL$2
|
|
64034
62740
|
});
|
|
64035
62741
|
};
|
|
64036
62742
|
const Impl = require_URL_impl();
|
|
@@ -64039,16 +62745,16 @@ var require_URL = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/whatw
|
|
|
64039
62745
|
//#endregion
|
|
64040
62746
|
//#region ../../node_modules/.pnpm/whatwg-url@15.1.0/node_modules/whatwg-url/webidl2js-wrapper.js
|
|
64041
62747
|
var require_webidl2js_wrapper = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/whatwg-url@15.1.0/node_modules/whatwg-url/webidl2js-wrapper.js": ((exports) => {
|
|
64042
|
-
const URL$
|
|
62748
|
+
const URL$1 = require_URL();
|
|
64043
62749
|
const URLSearchParams$1 = require_URLSearchParams();
|
|
64044
|
-
exports.URL = URL$
|
|
62750
|
+
exports.URL = URL$1;
|
|
64045
62751
|
exports.URLSearchParams = URLSearchParams$1;
|
|
64046
62752
|
}) });
|
|
64047
62753
|
|
|
64048
62754
|
//#endregion
|
|
64049
62755
|
//#region ../../node_modules/.pnpm/whatwg-url@15.1.0/node_modules/whatwg-url/index.js
|
|
64050
62756
|
var require_whatwg_url = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/whatwg-url@15.1.0/node_modules/whatwg-url/index.js": ((exports) => {
|
|
64051
|
-
const { URL
|
|
62757
|
+
const { URL, URLSearchParams } = require_webidl2js_wrapper();
|
|
64052
62758
|
const urlStateMachine = require_url_state_machine();
|
|
64053
62759
|
const percentEncoding = require_percent_encoding();
|
|
64054
62760
|
const sharedGlobalObject = {
|
|
@@ -64058,7 +62764,7 @@ var require_whatwg_url = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
64058
62764
|
String,
|
|
64059
62765
|
TypeError
|
|
64060
62766
|
};
|
|
64061
|
-
URL
|
|
62767
|
+
URL.install(sharedGlobalObject, ["Window"]);
|
|
64062
62768
|
URLSearchParams.install(sharedGlobalObject, ["Window"]);
|
|
64063
62769
|
exports.URL = sharedGlobalObject.URL;
|
|
64064
62770
|
exports.URLSearchParams = sharedGlobalObject.URLSearchParams;
|
|
@@ -64080,8 +62786,8 @@ var require_whatwg_url = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
64080
62786
|
//#endregion
|
|
64081
62787
|
//#region ../../node_modules/.pnpm/data-urls@6.0.0/node_modules/data-urls/lib/utils.js
|
|
64082
62788
|
var require_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/data-urls@6.0.0/node_modules/data-urls/lib/utils.js": ((exports) => {
|
|
64083
|
-
exports.stripLeadingAndTrailingASCIIWhitespace = (string
|
|
64084
|
-
return string
|
|
62789
|
+
exports.stripLeadingAndTrailingASCIIWhitespace = (string) => {
|
|
62790
|
+
return string.replace(/^[ \t\n\f\r]+/u, "").replace(/[ \t\n\f\r]+$/u, "");
|
|
64085
62791
|
};
|
|
64086
62792
|
exports.isomorphicDecode = (input) => {
|
|
64087
62793
|
return Array.from(input, (byte) => String.fromCodePoint(byte)).join("");
|