storybook 9.1.0 → 9.1.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/bin/index.cjs +43 -43
- package/dist/bin/index.js +43 -43
- package/dist/cli/bin/index.cjs +1188 -1262
- package/dist/cli/bin/index.js +1154 -1228
- package/dist/cli/index.cjs +13411 -13484
- package/dist/cli/index.js +13434 -13507
- package/dist/common/index.cjs +2927 -2911
- package/dist/common/index.d.ts +11 -3
- package/dist/common/index.js +3129 -3114
- package/dist/core-server/index.cjs +20539 -14418
- package/dist/core-server/index.js +20882 -14724
- package/dist/core-server/presets/common-preset.cjs +9137 -9141
- package/dist/core-server/presets/common-preset.js +8358 -8362
- package/dist/manager/globals-runtime.js +1 -1
- package/dist/manager-api/index.cjs +76 -76
- package/dist/manager-api/index.js +133 -133
- package/dist/node-logger/index.cjs +1218 -1212
- package/dist/node-logger/index.js +1235 -1228
- package/dist/server-errors.cjs +45 -60
- package/dist/server-errors.d.ts +1 -11
- package/dist/server-errors.js +27 -42
- package/dist/telemetry/index.cjs +1713 -1786
- package/dist/telemetry/index.js +1768 -1839
- package/package.json +1 -1
package/dist/cli/bin/index.cjs
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var d = (s, e) =>
|
|
8
|
-
var
|
|
9
|
-
var
|
|
2
|
+
var Rr = Object.create;
|
|
3
|
+
var st = Object.defineProperty;
|
|
4
|
+
var Mr = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var Lr = Object.getOwnPropertyNames;
|
|
6
|
+
var qr = Object.getPrototypeOf, Ur = Object.prototype.hasOwnProperty;
|
|
7
|
+
var d = (s, e) => st(s, "name", { value: e, configurable: !0 });
|
|
8
|
+
var T = (s, e) => () => (e || s((e = { exports: {} }).exports, e), e.exports);
|
|
9
|
+
var Fr = (s, e, t, r) => {
|
|
10
10
|
if (e && typeof e == "object" || typeof e == "function")
|
|
11
|
-
for (let i of
|
|
12
|
-
!
|
|
11
|
+
for (let i of Lr(e))
|
|
12
|
+
!Ur.call(s, i) && i !== t && st(s, i, { get: () => e[i], enumerable: !(r = Mr(e, i)) || r.enumerable });
|
|
13
13
|
return s;
|
|
14
14
|
};
|
|
15
|
-
var
|
|
15
|
+
var ee = (s, e, t) => (t = s != null ? Rr(qr(s)) : {}, Fr(
|
|
16
16
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
17
|
// file that has been converted to a CommonJS file using a Babel-
|
|
18
18
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
19
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
e || !s || !s.__esModule ?
|
|
20
|
+
e || !s || !s.__esModule ? st(t, "default", { value: s, enumerable: !0 }) : t,
|
|
21
21
|
s
|
|
22
22
|
));
|
|
23
23
|
|
|
24
24
|
// ../node_modules/commander/lib/error.js
|
|
25
|
-
var
|
|
26
|
-
var
|
|
25
|
+
var Oe = T((nt) => {
|
|
26
|
+
var De = class extends Error {
|
|
27
27
|
static {
|
|
28
28
|
d(this, "CommanderError");
|
|
29
29
|
}
|
|
@@ -37,7 +37,7 @@ var Te = O((at) => {
|
|
|
37
37
|
super(r), Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name, this.code = t, this.exitCode = e, this.nestedError =
|
|
38
38
|
void 0;
|
|
39
39
|
}
|
|
40
|
-
},
|
|
40
|
+
}, it = class extends De {
|
|
41
41
|
static {
|
|
42
42
|
d(this, "InvalidArgumentError");
|
|
43
43
|
}
|
|
@@ -49,13 +49,13 @@ var Te = O((at) => {
|
|
|
49
49
|
super(1, "commander.invalidArgument", e), Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name;
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
nt.CommanderError = De;
|
|
53
|
+
nt.InvalidArgumentError = it;
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
// ../node_modules/commander/lib/argument.js
|
|
57
|
-
var
|
|
58
|
-
var { InvalidArgumentError:
|
|
57
|
+
var $e = T((ot) => {
|
|
58
|
+
var { InvalidArgumentError: Hr } = Oe(), at = class {
|
|
59
59
|
static {
|
|
60
60
|
d(this, "Argument");
|
|
61
61
|
}
|
|
@@ -124,7 +124,7 @@ var De = O((ct) => {
|
|
|
124
124
|
choices(e) {
|
|
125
125
|
return this.argChoices = e.slice(), this.parseArg = (t, r) => {
|
|
126
126
|
if (!this.argChoices.includes(t))
|
|
127
|
-
throw new
|
|
127
|
+
throw new Hr(
|
|
128
128
|
`Allowed choices are ${this.argChoices.join(", ")}.`
|
|
129
129
|
);
|
|
130
130
|
return this.variadic ? this._concatValue(t, r) : t;
|
|
@@ -147,18 +147,18 @@ var De = O((ct) => {
|
|
|
147
147
|
return this.required = !1, this;
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
|
-
function
|
|
150
|
+
function Br(s) {
|
|
151
151
|
let e = s.name() + (s.variadic === !0 ? "..." : "");
|
|
152
152
|
return s.required ? "<" + e + ">" : "[" + e + "]";
|
|
153
153
|
}
|
|
154
|
-
d(
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
d(Br, "humanReadableArgName");
|
|
155
|
+
ot.Argument = at;
|
|
156
|
+
ot.humanReadableArgName = Br;
|
|
157
157
|
});
|
|
158
158
|
|
|
159
159
|
// ../node_modules/commander/lib/help.js
|
|
160
|
-
var
|
|
161
|
-
var { humanReadableArgName:
|
|
160
|
+
var ut = T((Vt) => {
|
|
161
|
+
var { humanReadableArgName: Wr } = $e(), dt = class {
|
|
162
162
|
static {
|
|
163
163
|
d(this, "Help");
|
|
164
164
|
}
|
|
@@ -239,7 +239,7 @@ var lt = O((Dt) => {
|
|
|
239
239
|
* @returns {string}
|
|
240
240
|
*/
|
|
241
241
|
subcommandTerm(e) {
|
|
242
|
-
let t = e.registeredArguments.map((r) =>
|
|
242
|
+
let t = e.registeredArguments.map((r) => Wr(r)).join(" ");
|
|
243
243
|
return e._name + (e._aliases[0] ? "|" + e._aliases[0] : "") + (e.options.length ? " [options]" : "") + // simplistic check for non-help option
|
|
244
244
|
(t ? " " + t : "");
|
|
245
245
|
}
|
|
@@ -377,54 +377,54 @@ var lt = O((Dt) => {
|
|
|
377
377
|
* @returns {string}
|
|
378
378
|
*/
|
|
379
379
|
formatHelp(e, t) {
|
|
380
|
-
let r = t.padWidth(e, t), i = t.helpWidth || 80, n = 2,
|
|
381
|
-
function
|
|
382
|
-
if (
|
|
383
|
-
let
|
|
380
|
+
let r = t.padWidth(e, t), i = t.helpWidth || 80, n = 2, a = 2;
|
|
381
|
+
function o(I, z) {
|
|
382
|
+
if (z) {
|
|
383
|
+
let rt = `${I.padEnd(r + a)}${z}`;
|
|
384
384
|
return t.wrap(
|
|
385
|
-
|
|
385
|
+
rt,
|
|
386
386
|
i - n,
|
|
387
|
-
r +
|
|
387
|
+
r + a
|
|
388
388
|
);
|
|
389
389
|
}
|
|
390
390
|
return I;
|
|
391
391
|
}
|
|
392
|
-
d(
|
|
393
|
-
function
|
|
392
|
+
d(o, "formatItem");
|
|
393
|
+
function c(I) {
|
|
394
394
|
return I.join(`
|
|
395
395
|
`).replace(/^/gm, " ".repeat(n));
|
|
396
396
|
}
|
|
397
|
-
d(
|
|
397
|
+
d(c, "formatList");
|
|
398
398
|
let h = [`Usage: ${t.commandUsage(e)}`, ""], p = t.commandDescription(e);
|
|
399
399
|
p.length > 0 && (h = h.concat([
|
|
400
400
|
t.wrap(p, i, 0),
|
|
401
401
|
""
|
|
402
402
|
]));
|
|
403
|
-
let y = t.visibleArguments(e).map((I) =>
|
|
403
|
+
let y = t.visibleArguments(e).map((I) => o(
|
|
404
404
|
t.argumentTerm(I),
|
|
405
405
|
t.argumentDescription(I)
|
|
406
406
|
));
|
|
407
|
-
y.length > 0 && (h = h.concat(["Arguments:",
|
|
408
|
-
let
|
|
407
|
+
y.length > 0 && (h = h.concat(["Arguments:", c(y), ""]));
|
|
408
|
+
let C = t.visibleOptions(e).map((I) => o(
|
|
409
409
|
t.optionTerm(I),
|
|
410
410
|
t.optionDescription(I)
|
|
411
411
|
));
|
|
412
|
-
if (
|
|
413
|
-
let I = t.visibleGlobalOptions(e).map((
|
|
414
|
-
t.optionTerm(
|
|
415
|
-
t.optionDescription(
|
|
412
|
+
if (C.length > 0 && (h = h.concat(["Options:", c(C), ""])), this.showGlobalOptions) {
|
|
413
|
+
let I = t.visibleGlobalOptions(e).map((z) => o(
|
|
414
|
+
t.optionTerm(z),
|
|
415
|
+
t.optionDescription(z)
|
|
416
416
|
));
|
|
417
417
|
I.length > 0 && (h = h.concat([
|
|
418
418
|
"Global Options:",
|
|
419
|
-
|
|
419
|
+
c(I),
|
|
420
420
|
""
|
|
421
421
|
]));
|
|
422
422
|
}
|
|
423
|
-
let
|
|
423
|
+
let j = t.visibleCommands(e).map((I) => o(
|
|
424
424
|
t.subcommandTerm(I),
|
|
425
425
|
t.subcommandDescription(I)
|
|
426
426
|
));
|
|
427
|
-
return
|
|
427
|
+
return j.length > 0 && (h = h.concat(["Commands:", c(j), ""])), h.join(`
|
|
428
428
|
`);
|
|
429
429
|
}
|
|
430
430
|
/**
|
|
@@ -454,28 +454,28 @@ var lt = O((Dt) => {
|
|
|
454
454
|
*
|
|
455
455
|
*/
|
|
456
456
|
wrap(e, t, r, i = 40) {
|
|
457
|
-
let n = " \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",
|
|
458
|
-
if (e.match(
|
|
459
|
-
let
|
|
460
|
-
if (
|
|
461
|
-
let
|
|
457
|
+
let n = " \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF", a = new RegExp(`[\\n][${n}]+`);
|
|
458
|
+
if (e.match(a)) return e;
|
|
459
|
+
let o = t - r;
|
|
460
|
+
if (o < i) return e;
|
|
461
|
+
let c = e.slice(0, r), h = e.slice(r).replace(`\r
|
|
462
462
|
`, `
|
|
463
|
-
`), p = " ".repeat(r),
|
|
463
|
+
`), p = " ".repeat(r), C = "\\s\u200B", j = new RegExp(
|
|
464
464
|
`
|
|
465
|
-
|.{1,${
|
|
465
|
+
|.{1,${o - 1}}([${C}]|$)|[^${C}]+?([${C}]|$)`,
|
|
466
466
|
"g"
|
|
467
|
-
), I = h.match(
|
|
468
|
-
return
|
|
469
|
-
` ? "" : (
|
|
467
|
+
), I = h.match(j) || [];
|
|
468
|
+
return c + I.map((z, rt) => z === `
|
|
469
|
+
` ? "" : (rt > 0 ? p : "") + z.trimEnd()).join(`
|
|
470
470
|
`);
|
|
471
471
|
}
|
|
472
472
|
};
|
|
473
|
-
|
|
473
|
+
Vt.Help = dt;
|
|
474
474
|
});
|
|
475
475
|
|
|
476
476
|
// ../node_modules/commander/lib/option.js
|
|
477
|
-
var
|
|
478
|
-
var { InvalidArgumentError:
|
|
477
|
+
var pt = T((ht) => {
|
|
478
|
+
var { InvalidArgumentError: zr } = Oe(), lt = class {
|
|
479
479
|
static {
|
|
480
480
|
d(this, "Option");
|
|
481
481
|
}
|
|
@@ -488,7 +488,7 @@ var mt = O((ft) => {
|
|
|
488
488
|
constructor(e, t) {
|
|
489
489
|
this.flags = e, this.description = t || "", this.required = e.includes("<"), this.optional = e.includes("["), this.variadic = /\w\.\.\.[>\]]$/.
|
|
490
490
|
test(e), this.mandatory = !1;
|
|
491
|
-
let r =
|
|
491
|
+
let r = Jr(e);
|
|
492
492
|
this.short = r.shortFlag, this.long = r.longFlag, this.negate = !1, this.long && (this.negate = this.long.startsWith("--no-")), this.defaultValue =
|
|
493
493
|
void 0, this.defaultValueDescription = void 0, this.presetArg = void 0, this.envVar = void 0, this.parseArg = void 0, this.hidden = !1,
|
|
494
494
|
this.argChoices = void 0, this.conflictsWith = [], this.implied = void 0;
|
|
@@ -602,7 +602,7 @@ var mt = O((ft) => {
|
|
|
602
602
|
choices(e) {
|
|
603
603
|
return this.argChoices = e.slice(), this.parseArg = (t, r) => {
|
|
604
604
|
if (!this.argChoices.includes(t))
|
|
605
|
-
throw new
|
|
605
|
+
throw new zr(
|
|
606
606
|
`Allowed choices are ${this.argChoices.join(", ")}.`
|
|
607
607
|
);
|
|
608
608
|
return this.variadic ? this._concatValue(t, r) : t;
|
|
@@ -623,7 +623,7 @@ var mt = O((ft) => {
|
|
|
623
623
|
* @return {string}
|
|
624
624
|
*/
|
|
625
625
|
attributeName() {
|
|
626
|
-
return
|
|
626
|
+
return Gr(this.name().replace(/^no-/, ""));
|
|
627
627
|
}
|
|
628
628
|
/**
|
|
629
629
|
* Check if `arg` matches the short or long flag.
|
|
@@ -646,7 +646,7 @@ var mt = O((ft) => {
|
|
|
646
646
|
isBoolean() {
|
|
647
647
|
return !this.required && !this.optional && !this.negate;
|
|
648
648
|
}
|
|
649
|
-
},
|
|
649
|
+
}, ct = class {
|
|
650
650
|
static {
|
|
651
651
|
d(this, "DualOptions");
|
|
652
652
|
}
|
|
@@ -675,23 +675,23 @@ var mt = O((ft) => {
|
|
|
675
675
|
return t.negate === (n === e);
|
|
676
676
|
}
|
|
677
677
|
};
|
|
678
|
-
function
|
|
678
|
+
function Gr(s) {
|
|
679
679
|
return s.split("-").reduce((e, t) => e + t[0].toUpperCase() + t.slice(1));
|
|
680
680
|
}
|
|
681
|
-
d(
|
|
682
|
-
function
|
|
681
|
+
d(Gr, "camelcase");
|
|
682
|
+
function Jr(s) {
|
|
683
683
|
let e, t, r = s.split(/[ |,]+/);
|
|
684
684
|
return r.length > 1 && !/^[[<]/.test(r[1]) && (e = r.shift()), t = r.shift(), !e && /^-[^-]$/.test(t) && (e = t, t = void 0), { shortFlag: e,
|
|
685
685
|
longFlag: t };
|
|
686
686
|
}
|
|
687
|
-
d(
|
|
688
|
-
|
|
689
|
-
|
|
687
|
+
d(Jr, "splitOptionFlags");
|
|
688
|
+
ht.Option = lt;
|
|
689
|
+
ht.DualOptions = ct;
|
|
690
690
|
});
|
|
691
691
|
|
|
692
692
|
// ../node_modules/commander/lib/suggestSimilar.js
|
|
693
|
-
var
|
|
694
|
-
function
|
|
693
|
+
var $t = T((Dt) => {
|
|
694
|
+
function Yr(s, e) {
|
|
695
695
|
if (Math.abs(s.length - e.length) > 3)
|
|
696
696
|
return Math.max(s.length, e.length);
|
|
697
697
|
let t = [];
|
|
@@ -713,30 +713,30 @@ var Mt = O(($t) => {
|
|
|
713
713
|
}
|
|
714
714
|
return t[s.length][e.length];
|
|
715
715
|
}
|
|
716
|
-
d(
|
|
717
|
-
function
|
|
716
|
+
d(Yr, "editDistance");
|
|
717
|
+
function Kr(s, e) {
|
|
718
718
|
if (!e || e.length === 0) return "";
|
|
719
719
|
e = Array.from(new Set(e));
|
|
720
720
|
let t = s.startsWith("--");
|
|
721
|
-
t && (s = s.slice(2), e = e.map((
|
|
721
|
+
t && (s = s.slice(2), e = e.map((a) => a.slice(2)));
|
|
722
722
|
let r = [], i = 3, n = 0.4;
|
|
723
|
-
return e.forEach((
|
|
724
|
-
if (
|
|
725
|
-
let
|
|
726
|
-
(
|
|
727
|
-
}), r.sort((
|
|
723
|
+
return e.forEach((a) => {
|
|
724
|
+
if (a.length <= 1) return;
|
|
725
|
+
let o = Yr(s, a), c = Math.max(s.length, a.length);
|
|
726
|
+
(c - o) / c > n && (o < i ? (i = o, r = [a]) : o === i && r.push(a));
|
|
727
|
+
}), r.sort((a, o) => a.localeCompare(o)), t && (r = r.map((a) => `--${a}`)), r.length > 1 ? `
|
|
728
728
|
(Did you mean one of ${r.join(", ")}?)` : r.length === 1 ? `
|
|
729
729
|
(Did you mean ${r[0]}?)` : "";
|
|
730
730
|
}
|
|
731
|
-
d(
|
|
732
|
-
|
|
731
|
+
d(Kr, "suggestSimilar");
|
|
732
|
+
Dt.suggestSimilar = Kr;
|
|
733
733
|
});
|
|
734
734
|
|
|
735
735
|
// ../node_modules/commander/lib/command.js
|
|
736
|
-
var
|
|
737
|
-
var
|
|
738
|
-
{ Argument:
|
|
739
|
-
{ suggestSimilar:
|
|
736
|
+
var Ut = T((qt) => {
|
|
737
|
+
var Xr = require("node:events").EventEmitter, ft = require("node:child_process"), U = require("node:path"), mt = require("node:fs"), k = require("node:process"),
|
|
738
|
+
{ Argument: Qr, humanReadableArgName: es } = $e(), { CommanderError: gt } = Oe(), { Help: ts } = ut(), { Option: Rt, DualOptions: rs } = pt(),
|
|
739
|
+
{ suggestSimilar: Mt } = $t(), yt = class s extends Xr {
|
|
740
740
|
static {
|
|
741
741
|
d(this, "Command");
|
|
742
742
|
}
|
|
@@ -753,10 +753,10 @@ var Wt = O((qt) => {
|
|
|
753
753
|
null, this._aliases = [], this._combineFlagAndOptionalValue = !0, this._description = "", this._summary = "", this._argsDescription = void 0,
|
|
754
754
|
this._enablePositionalOptions = !1, this._passThroughOptions = !1, this._lifeCycleHooks = {}, this._showHelpAfterError = !1, this._showSuggestionAfterError =
|
|
755
755
|
!0, this._outputConfiguration = {
|
|
756
|
-
writeOut: /* @__PURE__ */ d((t) =>
|
|
757
|
-
writeErr: /* @__PURE__ */ d((t) =>
|
|
758
|
-
getOutHelpWidth: /* @__PURE__ */ d(() =>
|
|
759
|
-
getErrHelpWidth: /* @__PURE__ */ d(() =>
|
|
756
|
+
writeOut: /* @__PURE__ */ d((t) => k.stdout.write(t), "writeOut"),
|
|
757
|
+
writeErr: /* @__PURE__ */ d((t) => k.stderr.write(t), "writeErr"),
|
|
758
|
+
getOutHelpWidth: /* @__PURE__ */ d(() => k.stdout.isTTY ? k.stdout.columns : void 0, "getOutHelpWidth"),
|
|
759
|
+
getErrHelpWidth: /* @__PURE__ */ d(() => k.stderr.isTTY ? k.stderr.columns : void 0, "getErrHelpWidth"),
|
|
760
760
|
outputError: /* @__PURE__ */ d((t, r) => r(t), "outputError")
|
|
761
761
|
}, this._hidden = !1, this._helpOption = void 0, this._addImplicitHelpCommand = void 0, this._helpCommand = void 0, this._helpConfiguration =
|
|
762
762
|
{};
|
|
@@ -813,10 +813,10 @@ var Wt = O((qt) => {
|
|
|
813
813
|
command(e, t, r) {
|
|
814
814
|
let i = t, n = r;
|
|
815
815
|
typeof i == "object" && i !== null && (n = i, i = null), n = n || {};
|
|
816
|
-
let [,
|
|
817
|
-
return i && (
|
|
818
|
-
n.hidden),
|
|
819
|
-
this), i ? this :
|
|
816
|
+
let [, a, o] = e.match(/([^ ]+) *(.*)/), c = this.createCommand(a);
|
|
817
|
+
return i && (c.description(i), c._executableHandler = !0), n.isDefault && (this._defaultCommandName = c._name), c._hidden = !!(n.noHelp ||
|
|
818
|
+
n.hidden), c._executableFile = n.executableFile || null, o && c.arguments(o), this._registerCommand(c), c.parent = this, c.copyInheritedSettings(
|
|
819
|
+
this), i ? this : c;
|
|
820
820
|
}
|
|
821
821
|
/**
|
|
822
822
|
* Factory routine to create a new unattached command.
|
|
@@ -837,7 +837,7 @@ var Wt = O((qt) => {
|
|
|
837
837
|
* @return {Help}
|
|
838
838
|
*/
|
|
839
839
|
createHelp() {
|
|
840
|
-
return Object.assign(new
|
|
840
|
+
return Object.assign(new ts(), this.configureHelp());
|
|
841
841
|
}
|
|
842
842
|
/**
|
|
843
843
|
* You can customise the help by overriding Help properties using configureHelp(),
|
|
@@ -915,7 +915,7 @@ var Wt = O((qt) => {
|
|
|
915
915
|
* @return {Argument} new argument
|
|
916
916
|
*/
|
|
917
917
|
createArgument(e, t) {
|
|
918
|
-
return new
|
|
918
|
+
return new Qr(e, t);
|
|
919
919
|
}
|
|
920
920
|
/**
|
|
921
921
|
* Define argument syntax for command.
|
|
@@ -988,8 +988,8 @@ var Wt = O((qt) => {
|
|
|
988
988
|
if (typeof e == "boolean")
|
|
989
989
|
return this._addImplicitHelpCommand = e, this;
|
|
990
990
|
e = e ?? "help [command]";
|
|
991
|
-
let [, r, i] = e.match(/([^ ]+) *(.*)/), n = t ?? "display help for command",
|
|
992
|
-
return
|
|
991
|
+
let [, r, i] = e.match(/([^ ]+) *(.*)/), n = t ?? "display help for command", a = this.createCommand(r);
|
|
992
|
+
return a.helpOption(!1), i && a.arguments(i), n && a.description(n), this._addImplicitHelpCommand = !0, this._helpCommand = a, this;
|
|
993
993
|
}
|
|
994
994
|
/**
|
|
995
995
|
* Add prepared custom help command.
|
|
@@ -1047,7 +1047,7 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1047
1047
|
* @private
|
|
1048
1048
|
*/
|
|
1049
1049
|
_exit(e, t, r) {
|
|
1050
|
-
this._exitCallback && this._exitCallback(new
|
|
1050
|
+
this._exitCallback && this._exitCallback(new gt(e, t, r)), k.exit(e);
|
|
1051
1051
|
}
|
|
1052
1052
|
/**
|
|
1053
1053
|
* Register callback `fn` for the command.
|
|
@@ -1081,7 +1081,7 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1081
1081
|
* @return {Option} new option
|
|
1082
1082
|
*/
|
|
1083
1083
|
createOption(e, t) {
|
|
1084
|
-
return new
|
|
1084
|
+
return new Rt(e, t);
|
|
1085
1085
|
}
|
|
1086
1086
|
/**
|
|
1087
1087
|
* Wrap parseArgs to catch 'commander.invalidArgument'.
|
|
@@ -1097,8 +1097,8 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1097
1097
|
return e.parseArg(t, r);
|
|
1098
1098
|
} catch (n) {
|
|
1099
1099
|
if (n.code === "commander.invalidArgument") {
|
|
1100
|
-
let
|
|
1101
|
-
this.error(
|
|
1100
|
+
let a = `${i} ${n.message}`;
|
|
1101
|
+
this.error(a, { exitCode: n.exitCode, code: n.code });
|
|
1102
1102
|
}
|
|
1103
1103
|
throw n;
|
|
1104
1104
|
}
|
|
@@ -1155,18 +1155,18 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1155
1155
|
"default"
|
|
1156
1156
|
);
|
|
1157
1157
|
} else e.defaultValue !== void 0 && this.setOptionValueWithSource(r, e.defaultValue, "default");
|
|
1158
|
-
let i = /* @__PURE__ */ d((n,
|
|
1158
|
+
let i = /* @__PURE__ */ d((n, a, o) => {
|
|
1159
1159
|
n == null && e.presetArg !== void 0 && (n = e.presetArg);
|
|
1160
|
-
let
|
|
1161
|
-
n !== null && e.parseArg ? n = this._callParseArg(e, n,
|
|
1162
|
-
(e.negate ? n = !1 : e.isBoolean() || e.optional ? n = !0 : n = ""), this.setOptionValueWithSource(r, n,
|
|
1160
|
+
let c = this.getOptionValue(r);
|
|
1161
|
+
n !== null && e.parseArg ? n = this._callParseArg(e, n, c, a) : n !== null && e.variadic && (n = e._concatValue(n, c)), n == null &&
|
|
1162
|
+
(e.negate ? n = !1 : e.isBoolean() || e.optional ? n = !0 : n = ""), this.setOptionValueWithSource(r, n, o);
|
|
1163
1163
|
}, "handleOptionValue");
|
|
1164
1164
|
return this.on("option:" + t, (n) => {
|
|
1165
|
-
let
|
|
1166
|
-
i(n,
|
|
1165
|
+
let a = `error: option '${e.flags}' argument '${n}' is invalid.`;
|
|
1166
|
+
i(n, a, "cli");
|
|
1167
1167
|
}), e.envVar && this.on("optionEnv:" + t, (n) => {
|
|
1168
|
-
let
|
|
1169
|
-
i(n,
|
|
1168
|
+
let a = `error: option '${e.flags}' value '${n}' from env '${e.envVar}' is invalid.`;
|
|
1169
|
+
i(n, a, "env");
|
|
1170
1170
|
}), this;
|
|
1171
1171
|
}
|
|
1172
1172
|
/**
|
|
@@ -1176,22 +1176,22 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1176
1176
|
* @private
|
|
1177
1177
|
*/
|
|
1178
1178
|
_optionEx(e, t, r, i, n) {
|
|
1179
|
-
if (typeof t == "object" && t instanceof
|
|
1179
|
+
if (typeof t == "object" && t instanceof Rt)
|
|
1180
1180
|
throw new Error(
|
|
1181
1181
|
"To add an Option object use addOption() instead of option() or requiredOption()"
|
|
1182
1182
|
);
|
|
1183
|
-
let
|
|
1184
|
-
if (
|
|
1185
|
-
|
|
1183
|
+
let a = this.createOption(t, r);
|
|
1184
|
+
if (a.makeOptionMandatory(!!e.mandatory), typeof i == "function")
|
|
1185
|
+
a.default(n).argParser(i);
|
|
1186
1186
|
else if (i instanceof RegExp) {
|
|
1187
|
-
let
|
|
1188
|
-
i = /* @__PURE__ */ d((
|
|
1189
|
-
let p =
|
|
1187
|
+
let o = i;
|
|
1188
|
+
i = /* @__PURE__ */ d((c, h) => {
|
|
1189
|
+
let p = o.exec(c);
|
|
1190
1190
|
return p ? p[0] : h;
|
|
1191
|
-
}, "fn"),
|
|
1191
|
+
}, "fn"), a.default(n).argParser(i);
|
|
1192
1192
|
} else
|
|
1193
|
-
|
|
1194
|
-
return this.addOption(
|
|
1193
|
+
a.default(i);
|
|
1194
|
+
return this.addOption(a);
|
|
1195
1195
|
}
|
|
1196
1196
|
/**
|
|
1197
1197
|
* Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.
|
|
@@ -1381,11 +1381,11 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1381
1381
|
if (e !== void 0 && !Array.isArray(e))
|
|
1382
1382
|
throw new Error("first parameter to parse must be array or undefined");
|
|
1383
1383
|
if (t = t || {}, e === void 0 && t.from === void 0) {
|
|
1384
|
-
|
|
1385
|
-
let i =
|
|
1384
|
+
k.versions?.electron && (t.from = "electron");
|
|
1385
|
+
let i = k.execArgv ?? [];
|
|
1386
1386
|
(i.includes("-e") || i.includes("--eval") || i.includes("-p") || i.includes("--print")) && (t.from = "eval");
|
|
1387
1387
|
}
|
|
1388
|
-
e === void 0 && (e =
|
|
1388
|
+
e === void 0 && (e = k.argv), this.rawArgs = e.slice();
|
|
1389
1389
|
let r;
|
|
1390
1390
|
switch (t.from) {
|
|
1391
1391
|
case void 0:
|
|
@@ -1393,7 +1393,7 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1393
1393
|
this._scriptPath = e[1], r = e.slice(2);
|
|
1394
1394
|
break;
|
|
1395
1395
|
case "electron":
|
|
1396
|
-
|
|
1396
|
+
k.defaultApp ? (this._scriptPath = e[1], r = e.slice(2)) : r = e.slice(1);
|
|
1397
1397
|
break;
|
|
1398
1398
|
case "user":
|
|
1399
1399
|
r = e.slice(0);
|
|
@@ -1467,82 +1467,82 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1467
1467
|
t = t.slice();
|
|
1468
1468
|
let r = !1, i = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
1469
1469
|
function n(p, y) {
|
|
1470
|
-
let
|
|
1471
|
-
if (
|
|
1472
|
-
if (i.includes(
|
|
1473
|
-
let
|
|
1474
|
-
(I) =>
|
|
1470
|
+
let C = U.resolve(p, y);
|
|
1471
|
+
if (mt.existsSync(C)) return C;
|
|
1472
|
+
if (i.includes(U.extname(y))) return;
|
|
1473
|
+
let j = i.find(
|
|
1474
|
+
(I) => mt.existsSync(`${C}${I}`)
|
|
1475
1475
|
);
|
|
1476
|
-
if (
|
|
1476
|
+
if (j) return `${C}${j}`;
|
|
1477
1477
|
}
|
|
1478
1478
|
d(n, "findFile"), this._checkForMissingMandatoryOptions(), this._checkForConflictingOptions();
|
|
1479
|
-
let
|
|
1479
|
+
let a = e._executableFile || `${this._name}-${e._name}`, o = this._executableDir || "";
|
|
1480
1480
|
if (this._scriptPath) {
|
|
1481
1481
|
let p;
|
|
1482
1482
|
try {
|
|
1483
|
-
p =
|
|
1483
|
+
p = mt.realpathSync(this._scriptPath);
|
|
1484
1484
|
} catch {
|
|
1485
1485
|
p = this._scriptPath;
|
|
1486
1486
|
}
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1487
|
+
o = U.resolve(
|
|
1488
|
+
U.dirname(p),
|
|
1489
|
+
o
|
|
1490
1490
|
);
|
|
1491
1491
|
}
|
|
1492
|
-
if (
|
|
1493
|
-
let p = n(
|
|
1492
|
+
if (o) {
|
|
1493
|
+
let p = n(o, a);
|
|
1494
1494
|
if (!p && !e._executableFile && this._scriptPath) {
|
|
1495
|
-
let y =
|
|
1495
|
+
let y = U.basename(
|
|
1496
1496
|
this._scriptPath,
|
|
1497
|
-
|
|
1497
|
+
U.extname(this._scriptPath)
|
|
1498
1498
|
);
|
|
1499
1499
|
y !== this._name && (p = n(
|
|
1500
|
-
|
|
1500
|
+
o,
|
|
1501
1501
|
`${y}-${e._name}`
|
|
1502
1502
|
));
|
|
1503
1503
|
}
|
|
1504
|
-
|
|
1504
|
+
a = p || a;
|
|
1505
1505
|
}
|
|
1506
|
-
r = i.includes(
|
|
1507
|
-
let
|
|
1508
|
-
|
|
1509
|
-
|
|
1506
|
+
r = i.includes(U.extname(a));
|
|
1507
|
+
let c;
|
|
1508
|
+
k.platform !== "win32" ? r ? (t.unshift(a), t = Lt(k.execArgv).concat(t), c = ft.spawn(k.argv[0], t, { stdio: "inherit" })) : c = ft.spawn(
|
|
1509
|
+
a, t, { stdio: "inherit" }) : (t.unshift(a), t = Lt(k.execArgv).concat(t), c = ft.spawn(k.execPath, t, { stdio: "inherit" })), c.killed ||
|
|
1510
1510
|
["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"].forEach((y) => {
|
|
1511
|
-
|
|
1512
|
-
|
|
1511
|
+
k.on(y, () => {
|
|
1512
|
+
c.killed === !1 && c.exitCode === null && c.kill(y);
|
|
1513
1513
|
});
|
|
1514
1514
|
});
|
|
1515
1515
|
let h = this._exitCallback;
|
|
1516
|
-
|
|
1516
|
+
c.on("close", (p) => {
|
|
1517
1517
|
p = p ?? 1, h ? h(
|
|
1518
|
-
new
|
|
1518
|
+
new gt(
|
|
1519
1519
|
p,
|
|
1520
1520
|
"commander.executeSubCommandAsync",
|
|
1521
1521
|
"(close)"
|
|
1522
1522
|
)
|
|
1523
|
-
) :
|
|
1524
|
-
}),
|
|
1523
|
+
) : k.exit(p);
|
|
1524
|
+
}), c.on("error", (p) => {
|
|
1525
1525
|
if (p.code === "ENOENT") {
|
|
1526
|
-
let y =
|
|
1527
|
-
cutableDir() to supply a custom directory",
|
|
1526
|
+
let y = o ? `searched for local subcommand relative to directory '${o}'` : "no directory for search for local subcommand, use .exe\
|
|
1527
|
+
cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
1528
1528
|
- if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\
|
|
1529
1529
|
|
|
1530
1530
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
1531
1531
|
- ${y}`;
|
|
1532
|
-
throw new Error(
|
|
1532
|
+
throw new Error(C);
|
|
1533
1533
|
} else if (p.code === "EACCES")
|
|
1534
|
-
throw new Error(`'${
|
|
1534
|
+
throw new Error(`'${a}' not executable`);
|
|
1535
1535
|
if (!h)
|
|
1536
|
-
|
|
1536
|
+
k.exit(1);
|
|
1537
1537
|
else {
|
|
1538
|
-
let y = new
|
|
1538
|
+
let y = new gt(
|
|
1539
1539
|
1,
|
|
1540
1540
|
"commander.executeSubCommandAsync",
|
|
1541
1541
|
"(error)"
|
|
1542
1542
|
);
|
|
1543
1543
|
y.nestedError = p, h(y);
|
|
1544
1544
|
}
|
|
1545
|
-
}), this.runningCommand =
|
|
1545
|
+
}), this.runningCommand = c;
|
|
1546
1546
|
}
|
|
1547
1547
|
/**
|
|
1548
1548
|
* @private
|
|
@@ -1595,23 +1595,23 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
1595
1595
|
*/
|
|
1596
1596
|
_processArguments() {
|
|
1597
1597
|
let e = /* @__PURE__ */ d((r, i, n) => {
|
|
1598
|
-
let
|
|
1598
|
+
let a = i;
|
|
1599
1599
|
if (i !== null && r.parseArg) {
|
|
1600
|
-
let
|
|
1601
|
-
|
|
1600
|
+
let o = `error: command-argument value '${i}' is invalid for argument '${r.name()}'.`;
|
|
1601
|
+
a = this._callParseArg(
|
|
1602
1602
|
r,
|
|
1603
1603
|
i,
|
|
1604
1604
|
n,
|
|
1605
|
-
|
|
1605
|
+
o
|
|
1606
1606
|
);
|
|
1607
1607
|
}
|
|
1608
|
-
return
|
|
1608
|
+
return a;
|
|
1609
1609
|
}, "myParseArg");
|
|
1610
1610
|
this._checkNumberOfArguments();
|
|
1611
1611
|
let t = [];
|
|
1612
1612
|
this.registeredArguments.forEach((r, i) => {
|
|
1613
1613
|
let n = r.defaultValue;
|
|
1614
|
-
r.variadic ? i < this.args.length ? (n = this.args.slice(i), r.parseArg && (n = n.reduce((
|
|
1614
|
+
r.variadic ? i < this.args.length ? (n = this.args.slice(i), r.parseArg && (n = n.reduce((a, o) => e(r, o, a), r.defaultValue))) : n ===
|
|
1615
1615
|
void 0 && (n = []) : i < this.args.length && (n = this.args[i], r.parseArg && (n = e(r, n, r.defaultValue))), t[i] = n;
|
|
1616
1616
|
}), this.processedArgs = t;
|
|
1617
1617
|
}
|
|
@@ -1636,8 +1636,8 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
1636
1636
|
_chainOrCallHooks(e, t) {
|
|
1637
1637
|
let r = e, i = [];
|
|
1638
1638
|
return this._getCommandAndAncestors().reverse().filter((n) => n._lifeCycleHooks[t] !== void 0).forEach((n) => {
|
|
1639
|
-
n._lifeCycleHooks[t].forEach((
|
|
1640
|
-
i.push({ hookedCommand: n, callback:
|
|
1639
|
+
n._lifeCycleHooks[t].forEach((a) => {
|
|
1640
|
+
i.push({ hookedCommand: n, callback: a });
|
|
1641
1641
|
});
|
|
1642
1642
|
}), t === "postAction" && i.reverse(), i.forEach((n) => {
|
|
1643
1643
|
r = this._chainOrCall(r, () => n.callback(n.hookedCommand, this));
|
|
@@ -1683,13 +1683,13 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
1683
1683
|
}, "checkForUnknownOptions"), n = `command:${this.name()}`;
|
|
1684
1684
|
if (this._actionHandler) {
|
|
1685
1685
|
i(), this._processArguments();
|
|
1686
|
-
let
|
|
1687
|
-
return
|
|
1688
|
-
|
|
1686
|
+
let a;
|
|
1687
|
+
return a = this._chainOrCallHooks(a, "preAction"), a = this._chainOrCall(
|
|
1688
|
+
a,
|
|
1689
1689
|
() => this._actionHandler(this.processedArgs)
|
|
1690
|
-
), this.parent && (
|
|
1690
|
+
), this.parent && (a = this._chainOrCall(a, () => {
|
|
1691
1691
|
this.parent.emit(n, e, t);
|
|
1692
|
-
})),
|
|
1692
|
+
})), a = this._chainOrCallHooks(a, "postAction"), a;
|
|
1693
1693
|
}
|
|
1694
1694
|
if (this.parent && this.parent.listenerCount(n))
|
|
1695
1695
|
i(), this._processArguments(), this.parent.emit(n, e, t);
|
|
@@ -1781,68 +1781,68 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
1781
1781
|
*/
|
|
1782
1782
|
parseOptions(e) {
|
|
1783
1783
|
let t = [], r = [], i = t, n = e.slice();
|
|
1784
|
-
function
|
|
1785
|
-
return
|
|
1784
|
+
function a(c) {
|
|
1785
|
+
return c.length > 1 && c[0] === "-";
|
|
1786
1786
|
}
|
|
1787
|
-
d(
|
|
1788
|
-
let
|
|
1787
|
+
d(a, "maybeOption");
|
|
1788
|
+
let o = null;
|
|
1789
1789
|
for (; n.length; ) {
|
|
1790
|
-
let
|
|
1791
|
-
if (
|
|
1792
|
-
i === r && i.push(
|
|
1790
|
+
let c = n.shift();
|
|
1791
|
+
if (c === "--") {
|
|
1792
|
+
i === r && i.push(c), i.push(...n);
|
|
1793
1793
|
break;
|
|
1794
1794
|
}
|
|
1795
|
-
if (
|
|
1796
|
-
this.emit(`option:${
|
|
1795
|
+
if (o && !a(c)) {
|
|
1796
|
+
this.emit(`option:${o.name()}`, c);
|
|
1797
1797
|
continue;
|
|
1798
1798
|
}
|
|
1799
|
-
if (
|
|
1800
|
-
let h = this._findOption(
|
|
1799
|
+
if (o = null, a(c)) {
|
|
1800
|
+
let h = this._findOption(c);
|
|
1801
1801
|
if (h) {
|
|
1802
1802
|
if (h.required) {
|
|
1803
1803
|
let p = n.shift();
|
|
1804
1804
|
p === void 0 && this.optionMissingArgument(h), this.emit(`option:${h.name()}`, p);
|
|
1805
1805
|
} else if (h.optional) {
|
|
1806
1806
|
let p = null;
|
|
1807
|
-
n.length > 0 && !
|
|
1807
|
+
n.length > 0 && !a(n[0]) && (p = n.shift()), this.emit(`option:${h.name()}`, p);
|
|
1808
1808
|
} else
|
|
1809
1809
|
this.emit(`option:${h.name()}`);
|
|
1810
|
-
|
|
1810
|
+
o = h.variadic ? h : null;
|
|
1811
1811
|
continue;
|
|
1812
1812
|
}
|
|
1813
1813
|
}
|
|
1814
|
-
if (
|
|
1815
|
-
let h = this._findOption(`-${
|
|
1814
|
+
if (c.length > 2 && c[0] === "-" && c[1] !== "-") {
|
|
1815
|
+
let h = this._findOption(`-${c[1]}`);
|
|
1816
1816
|
if (h) {
|
|
1817
|
-
h.required || h.optional && this._combineFlagAndOptionalValue ? this.emit(`option:${h.name()}`,
|
|
1818
|
-
:${h.name()}`), n.unshift(`-${
|
|
1817
|
+
h.required || h.optional && this._combineFlagAndOptionalValue ? this.emit(`option:${h.name()}`, c.slice(2)) : (this.emit(`option\
|
|
1818
|
+
:${h.name()}`), n.unshift(`-${c.slice(2)}`));
|
|
1819
1819
|
continue;
|
|
1820
1820
|
}
|
|
1821
1821
|
}
|
|
1822
|
-
if (/^--[^=]+=/.test(
|
|
1823
|
-
let h =
|
|
1822
|
+
if (/^--[^=]+=/.test(c)) {
|
|
1823
|
+
let h = c.indexOf("="), p = this._findOption(c.slice(0, h));
|
|
1824
1824
|
if (p && (p.required || p.optional)) {
|
|
1825
|
-
this.emit(`option:${p.name()}`,
|
|
1825
|
+
this.emit(`option:${p.name()}`, c.slice(h + 1));
|
|
1826
1826
|
continue;
|
|
1827
1827
|
}
|
|
1828
1828
|
}
|
|
1829
|
-
if (
|
|
1830
|
-
if (this._findCommand(
|
|
1831
|
-
t.push(
|
|
1829
|
+
if (a(c) && (i = r), (this._enablePositionalOptions || this._passThroughOptions) && t.length === 0 && r.length === 0) {
|
|
1830
|
+
if (this._findCommand(c)) {
|
|
1831
|
+
t.push(c), n.length > 0 && r.push(...n);
|
|
1832
1832
|
break;
|
|
1833
|
-
} else if (this._getHelpCommand() &&
|
|
1834
|
-
t.push(
|
|
1833
|
+
} else if (this._getHelpCommand() && c === this._getHelpCommand().name()) {
|
|
1834
|
+
t.push(c), n.length > 0 && t.push(...n);
|
|
1835
1835
|
break;
|
|
1836
1836
|
} else if (this._defaultCommandName) {
|
|
1837
|
-
r.push(
|
|
1837
|
+
r.push(c), n.length > 0 && r.push(...n);
|
|
1838
1838
|
break;
|
|
1839
1839
|
}
|
|
1840
1840
|
}
|
|
1841
1841
|
if (this._passThroughOptions) {
|
|
1842
|
-
i.push(
|
|
1842
|
+
i.push(c), n.length > 0 && i.push(...n);
|
|
1843
1843
|
break;
|
|
1844
1844
|
}
|
|
1845
|
-
i.push(
|
|
1845
|
+
i.push(c);
|
|
1846
1846
|
}
|
|
1847
1847
|
return { operands: t, unknown: r };
|
|
1848
1848
|
}
|
|
@@ -1900,11 +1900,11 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
1900
1900
|
*/
|
|
1901
1901
|
_parseOptionsEnv() {
|
|
1902
1902
|
this.options.forEach((e) => {
|
|
1903
|
-
if (e.envVar && e.envVar in
|
|
1903
|
+
if (e.envVar && e.envVar in k.env) {
|
|
1904
1904
|
let t = e.attributeName();
|
|
1905
1905
|
(this.getOptionValue(t) === void 0 || ["default", "config", "env"].includes(
|
|
1906
1906
|
this.getOptionValueSource(t)
|
|
1907
|
-
)) && (e.required || e.optional ? this.emit(`optionEnv:${e.name()}`,
|
|
1907
|
+
)) && (e.required || e.optional ? this.emit(`optionEnv:${e.name()}`, k.env[e.envVar]) : this.emit(`optionEnv:${e.name()}`));
|
|
1908
1908
|
}
|
|
1909
1909
|
});
|
|
1910
1910
|
}
|
|
@@ -1914,7 +1914,7 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
1914
1914
|
* @private
|
|
1915
1915
|
*/
|
|
1916
1916
|
_parseOptionsImplied() {
|
|
1917
|
-
let e = new
|
|
1917
|
+
let e = new rs(this.options), t = /* @__PURE__ */ d((r) => this.getOptionValue(r) !== void 0 && !["default", "implied"].includes(this.
|
|
1918
1918
|
getOptionValueSource(r)), "hasCustomOptionValue");
|
|
1919
1919
|
this.options.filter(
|
|
1920
1920
|
(r) => r.implied !== void 0 && t(r.attributeName()) && e.valueFromOption(
|
|
@@ -1969,16 +1969,16 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
1969
1969
|
* @private
|
|
1970
1970
|
*/
|
|
1971
1971
|
_conflictingOption(e, t) {
|
|
1972
|
-
let r = /* @__PURE__ */ d((
|
|
1973
|
-
let
|
|
1974
|
-
(y) => y.negate &&
|
|
1972
|
+
let r = /* @__PURE__ */ d((a) => {
|
|
1973
|
+
let o = a.attributeName(), c = this.getOptionValue(o), h = this.options.find(
|
|
1974
|
+
(y) => y.negate && o === y.attributeName()
|
|
1975
1975
|
), p = this.options.find(
|
|
1976
|
-
(y) => !y.negate &&
|
|
1976
|
+
(y) => !y.negate && o === y.attributeName()
|
|
1977
1977
|
);
|
|
1978
|
-
return h && (h.presetArg === void 0 &&
|
|
1979
|
-
}, "findBestOptionFromValue"), i = /* @__PURE__ */ d((
|
|
1980
|
-
let
|
|
1981
|
-
return this.getOptionValueSource(
|
|
1978
|
+
return h && (h.presetArg === void 0 && c === !1 || h.presetArg !== void 0 && c === h.presetArg) ? h : p || a;
|
|
1979
|
+
}, "findBestOptionFromValue"), i = /* @__PURE__ */ d((a) => {
|
|
1980
|
+
let o = r(a), c = o.attributeName();
|
|
1981
|
+
return this.getOptionValueSource(c) === "env" ? `environment variable '${o.envVar}'` : `option '${o.flags}'`;
|
|
1982
1982
|
}, "getErrorMessage"), n = `error: ${i(e)} cannot be used with ${i(t)}`;
|
|
1983
1983
|
this.error(n, { code: "commander.conflictingOption" });
|
|
1984
1984
|
}
|
|
@@ -1994,10 +1994,10 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
1994
1994
|
if (e.startsWith("--") && this._showSuggestionAfterError) {
|
|
1995
1995
|
let i = [], n = this;
|
|
1996
1996
|
do {
|
|
1997
|
-
let
|
|
1998
|
-
i = i.concat(
|
|
1997
|
+
let a = n.createHelp().visibleOptions(n).filter((o) => o.long).map((o) => o.long);
|
|
1998
|
+
i = i.concat(a), n = n.parent;
|
|
1999
1999
|
} while (n && !n._enablePositionalOptions);
|
|
2000
|
-
t =
|
|
2000
|
+
t = Mt(e, i);
|
|
2001
2001
|
}
|
|
2002
2002
|
let r = `error: unknown option '${e}'${t}`;
|
|
2003
2003
|
this.error(r, { code: "commander.unknownOption" });
|
|
@@ -2025,7 +2025,7 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
2025
2025
|
let i = [];
|
|
2026
2026
|
this.createHelp().visibleCommands(this).forEach((n) => {
|
|
2027
2027
|
i.push(n.name()), n.alias() && i.push(n.alias());
|
|
2028
|
-
}), t =
|
|
2028
|
+
}), t = Mt(e, i);
|
|
2029
2029
|
}
|
|
2030
2030
|
let r = `error: unknown command '${e}'${t}`;
|
|
2031
2031
|
this.error(r, { code: "commander.unknownCommand" });
|
|
@@ -2113,7 +2113,7 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
2113
2113
|
usage(e) {
|
|
2114
2114
|
if (e === void 0) {
|
|
2115
2115
|
if (this._usage) return this._usage;
|
|
2116
|
-
let t = this.registeredArguments.map((r) =>
|
|
2116
|
+
let t = this.registeredArguments.map((r) => es(r));
|
|
2117
2117
|
return [].concat(
|
|
2118
2118
|
this.options.length || this._helpOption !== null ? "[options]" : [],
|
|
2119
2119
|
this.commands.length ? "[command]" : [],
|
|
@@ -2144,7 +2144,7 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
2144
2144
|
* @return {Command}
|
|
2145
2145
|
*/
|
|
2146
2146
|
nameFromFilename(e) {
|
|
2147
|
-
return this._name =
|
|
2147
|
+
return this._name = U.basename(e, U.extname(e)), this;
|
|
2148
2148
|
}
|
|
2149
2149
|
/**
|
|
2150
2150
|
* Get or set the directory for searching for executable subcommands of this command.
|
|
@@ -2245,7 +2245,7 @@ help", t = t ?? "display help for command", this._helpOption = this.createOption
|
|
|
2245
2245
|
*/
|
|
2246
2246
|
help(e) {
|
|
2247
2247
|
this.outputHelp(e);
|
|
2248
|
-
let t =
|
|
2248
|
+
let t = k.exitCode || 0;
|
|
2249
2249
|
t === 0 && e && typeof e != "function" && e.error && (t = 1), this._exit(t, "commander.help", "(outputHelp)");
|
|
2250
2250
|
}
|
|
2251
2251
|
/**
|
|
@@ -2265,8 +2265,8 @@ help", t = t ?? "display help for command", this._helpOption = this.createOption
|
|
|
2265
2265
|
Expecting one of '${r.join("', '")}'`);
|
|
2266
2266
|
let i = `${e}Help`;
|
|
2267
2267
|
return this.on(i, (n) => {
|
|
2268
|
-
let
|
|
2269
|
-
typeof t == "function" ?
|
|
2268
|
+
let a;
|
|
2269
|
+
typeof t == "function" ? a = t({ error: n.error, command: n.command }) : a = t, a && n.write(`${a}
|
|
2270
2270
|
`);
|
|
2271
2271
|
}), this;
|
|
2272
2272
|
}
|
|
@@ -2281,7 +2281,7 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
2281
2281
|
t && e.find((i) => t.is(i)) && (this.outputHelp(), this._exit(0, "commander.helpDisplayed", "(outputHelp)"));
|
|
2282
2282
|
}
|
|
2283
2283
|
};
|
|
2284
|
-
function
|
|
2284
|
+
function Lt(s) {
|
|
2285
2285
|
return s.map((e) => {
|
|
2286
2286
|
if (!e.startsWith("--inspect"))
|
|
2287
2287
|
return e;
|
|
@@ -2291,57 +2291,57 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
2291
2291
|
n[3], i = n[4]), t && i !== "0" ? `${t}=${r}:${parseInt(i) + 1}` : e;
|
|
2292
2292
|
});
|
|
2293
2293
|
}
|
|
2294
|
-
d(
|
|
2295
|
-
qt.Command =
|
|
2294
|
+
d(Lt, "incrementNodeInspectorPort");
|
|
2295
|
+
qt.Command = yt;
|
|
2296
2296
|
});
|
|
2297
2297
|
|
|
2298
2298
|
// ../node_modules/commander/index.js
|
|
2299
|
-
var
|
|
2300
|
-
var { Argument:
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2299
|
+
var Wt = T((E) => {
|
|
2300
|
+
var { Argument: Ft } = $e(), { Command: _t } = Ut(), { CommanderError: ss, InvalidArgumentError: Ht } = Oe(), { Help: is } = ut(), { Option: Bt } = pt();
|
|
2301
|
+
E.program = new _t();
|
|
2302
|
+
E.createCommand = (s) => new _t(s);
|
|
2303
|
+
E.createOption = (s, e) => new Bt(s, e);
|
|
2304
|
+
E.createArgument = (s, e) => new Ft(s, e);
|
|
2305
|
+
E.Command = _t;
|
|
2306
|
+
E.Option = Bt;
|
|
2307
|
+
E.Argument = Ft;
|
|
2308
|
+
E.Help = is;
|
|
2309
|
+
E.CommanderError = ss;
|
|
2310
|
+
E.InvalidArgumentError = Ht;
|
|
2311
|
+
E.InvalidOptionArgumentError = Ht;
|
|
2312
2312
|
});
|
|
2313
2313
|
|
|
2314
2314
|
// ../node_modules/walk-up-path/dist/cjs/index.js
|
|
2315
|
-
var
|
|
2315
|
+
var Gt = T((Re) => {
|
|
2316
2316
|
"use strict";
|
|
2317
|
-
Object.defineProperty(
|
|
2318
|
-
|
|
2319
|
-
var
|
|
2320
|
-
for (s = (0,
|
|
2317
|
+
Object.defineProperty(Re, "__esModule", { value: !0 });
|
|
2318
|
+
Re.walkUp = void 0;
|
|
2319
|
+
var zt = require("path"), ns = /* @__PURE__ */ d(function* (s) {
|
|
2320
|
+
for (s = (0, zt.resolve)(s); s; ) {
|
|
2321
2321
|
yield s;
|
|
2322
|
-
let e = (0,
|
|
2322
|
+
let e = (0, zt.dirname)(s);
|
|
2323
2323
|
if (e === s)
|
|
2324
2324
|
break;
|
|
2325
2325
|
s = e;
|
|
2326
2326
|
}
|
|
2327
2327
|
}, "walkUp");
|
|
2328
|
-
|
|
2328
|
+
Re.walkUp = ns;
|
|
2329
2329
|
});
|
|
2330
2330
|
|
|
2331
2331
|
// ../node_modules/picocolors/picocolors.js
|
|
2332
|
-
var
|
|
2333
|
-
var
|
|
2334
|
-
includes("--color") ||
|
|
2332
|
+
var tr = T((nn, xt) => {
|
|
2333
|
+
var qe = process || {}, Qt = qe.argv || [], Le = qe.env || {}, ds = !(Le.NO_COLOR || Qt.includes("--no-color")) && (!!Le.FORCE_COLOR || Qt.
|
|
2334
|
+
includes("--color") || qe.platform === "win32" || (qe.stdout || {}).isTTY && Le.TERM !== "dumb" || !!Le.CI), us = /* @__PURE__ */ d((s, e, t = s) => (r) => {
|
|
2335
2335
|
let i = "" + r, n = i.indexOf(e, s.length);
|
|
2336
|
-
return ~n ? s +
|
|
2337
|
-
}, "formatter"),
|
|
2336
|
+
return ~n ? s + ls(i, e, t, n) + e : s + i + e;
|
|
2337
|
+
}, "formatter"), ls = /* @__PURE__ */ d((s, e, t, r) => {
|
|
2338
2338
|
let i = "", n = 0;
|
|
2339
2339
|
do
|
|
2340
2340
|
i += s.substring(n, r) + t, n = r + e.length, r = s.indexOf(e, n);
|
|
2341
2341
|
while (~r);
|
|
2342
2342
|
return i + s.substring(n);
|
|
2343
|
-
}, "replaceClose"),
|
|
2344
|
-
let e = s ?
|
|
2343
|
+
}, "replaceClose"), er = /* @__PURE__ */ d((s = ds) => {
|
|
2344
|
+
let e = s ? us : () => String;
|
|
2345
2345
|
return {
|
|
2346
2346
|
isColorSupported: s,
|
|
2347
2347
|
reset: e("\x1B[0m", "\x1B[0m"),
|
|
@@ -2387,58 +2387,58 @@ var sr = O((dn, wt) => {
|
|
|
2387
2387
|
bgWhiteBright: e("\x1B[107m", "\x1B[49m")
|
|
2388
2388
|
};
|
|
2389
2389
|
}, "createColors");
|
|
2390
|
-
|
|
2391
|
-
|
|
2390
|
+
xt.exports = er();
|
|
2391
|
+
xt.exports.createColors = er;
|
|
2392
2392
|
});
|
|
2393
2393
|
|
|
2394
2394
|
// ../node_modules/ts-dedent/dist/index.js
|
|
2395
|
-
var
|
|
2395
|
+
var kt = T((Ae) => {
|
|
2396
2396
|
"use strict";
|
|
2397
|
-
Object.defineProperty(
|
|
2398
|
-
|
|
2399
|
-
function
|
|
2397
|
+
Object.defineProperty(Ae, "__esModule", { value: !0 });
|
|
2398
|
+
Ae.dedent = void 0;
|
|
2399
|
+
function ar(s) {
|
|
2400
2400
|
for (var e = [], t = 1; t < arguments.length; t++)
|
|
2401
2401
|
e[t - 1] = arguments[t];
|
|
2402
2402
|
var r = Array.from(typeof s == "string" ? [s] : s);
|
|
2403
2403
|
r[r.length - 1] = r[r.length - 1].replace(/\r?\n([\t ]*)$/, "");
|
|
2404
|
-
var i = r.reduce(function(
|
|
2405
|
-
var h =
|
|
2406
|
-
return h ?
|
|
2407
|
-
var y,
|
|
2408
|
-
return (
|
|
2409
|
-
})) :
|
|
2404
|
+
var i = r.reduce(function(o, c) {
|
|
2405
|
+
var h = c.match(/\n([\t ]+|(?!\s).)/g);
|
|
2406
|
+
return h ? o.concat(h.map(function(p) {
|
|
2407
|
+
var y, C;
|
|
2408
|
+
return (C = (y = p.match(/[\t ]/g)) === null || y === void 0 ? void 0 : y.length) !== null && C !== void 0 ? C : 0;
|
|
2409
|
+
})) : o;
|
|
2410
2410
|
}, []);
|
|
2411
2411
|
if (i.length) {
|
|
2412
2412
|
var n = new RegExp(`
|
|
2413
2413
|
[ ]{` + Math.min.apply(Math, i) + "}", "g");
|
|
2414
|
-
r = r.map(function(
|
|
2415
|
-
return
|
|
2414
|
+
r = r.map(function(o) {
|
|
2415
|
+
return o.replace(n, `
|
|
2416
2416
|
`);
|
|
2417
2417
|
});
|
|
2418
2418
|
}
|
|
2419
2419
|
r[0] = r[0].replace(/^\r?\n/, "");
|
|
2420
|
-
var
|
|
2421
|
-
return e.forEach(function(
|
|
2422
|
-
var h =
|
|
2423
|
-
typeof
|
|
2424
|
-
`) && (y = String(
|
|
2425
|
-
`).map(function(
|
|
2426
|
-
return
|
|
2420
|
+
var a = r[0];
|
|
2421
|
+
return e.forEach(function(o, c) {
|
|
2422
|
+
var h = a.match(/(?:^|\n)( *)$/), p = h ? h[1] : "", y = o;
|
|
2423
|
+
typeof o == "string" && o.includes(`
|
|
2424
|
+
`) && (y = String(o).split(`
|
|
2425
|
+
`).map(function(C, j) {
|
|
2426
|
+
return j === 0 ? C : "" + p + C;
|
|
2427
2427
|
}).join(`
|
|
2428
|
-
`)),
|
|
2429
|
-
}),
|
|
2428
|
+
`)), a += y + r[c + 1];
|
|
2429
|
+
}), a;
|
|
2430
2430
|
}
|
|
2431
|
-
d(
|
|
2432
|
-
|
|
2433
|
-
|
|
2431
|
+
d(ar, "dedent");
|
|
2432
|
+
Ae.dedent = ar;
|
|
2433
|
+
Ae.default = ar;
|
|
2434
2434
|
});
|
|
2435
2435
|
|
|
2436
2436
|
// ../node_modules/zod/lib/helpers/util.js
|
|
2437
|
-
var
|
|
2437
|
+
var Ze = T((w) => {
|
|
2438
2438
|
"use strict";
|
|
2439
|
-
Object.defineProperty(
|
|
2440
|
-
|
|
2441
|
-
var
|
|
2439
|
+
Object.defineProperty(w, "__esModule", { value: !0 });
|
|
2440
|
+
w.getParsedType = w.ZodParsedType = w.objectUtil = w.util = void 0;
|
|
2441
|
+
var Tt;
|
|
2442
2442
|
(function(s) {
|
|
2443
2443
|
s.assertEqual = (i) => i;
|
|
2444
2444
|
function e(i) {
|
|
@@ -2449,41 +2449,41 @@ var Ae = O((k) => {
|
|
|
2449
2449
|
}
|
|
2450
2450
|
d(t, "assertNever"), s.assertNever = t, s.arrayToEnum = (i) => {
|
|
2451
2451
|
let n = {};
|
|
2452
|
-
for (let
|
|
2453
|
-
n[
|
|
2452
|
+
for (let a of i)
|
|
2453
|
+
n[a] = a;
|
|
2454
2454
|
return n;
|
|
2455
2455
|
}, s.getValidEnumValues = (i) => {
|
|
2456
|
-
let n = s.objectKeys(i).filter((
|
|
2457
|
-
for (let
|
|
2458
|
-
o
|
|
2459
|
-
return s.objectValues(
|
|
2456
|
+
let n = s.objectKeys(i).filter((o) => typeof i[i[o]] != "number"), a = {};
|
|
2457
|
+
for (let o of n)
|
|
2458
|
+
a[o] = i[o];
|
|
2459
|
+
return s.objectValues(a);
|
|
2460
2460
|
}, s.objectValues = (i) => s.objectKeys(i).map(function(n) {
|
|
2461
2461
|
return i[n];
|
|
2462
2462
|
}), s.objectKeys = typeof Object.keys == "function" ? (i) => Object.keys(i) : (i) => {
|
|
2463
2463
|
let n = [];
|
|
2464
|
-
for (let
|
|
2465
|
-
Object.prototype.hasOwnProperty.call(i,
|
|
2464
|
+
for (let a in i)
|
|
2465
|
+
Object.prototype.hasOwnProperty.call(i, a) && n.push(a);
|
|
2466
2466
|
return n;
|
|
2467
2467
|
}, s.find = (i, n) => {
|
|
2468
|
-
for (let
|
|
2469
|
-
if (n(
|
|
2470
|
-
return
|
|
2468
|
+
for (let a of i)
|
|
2469
|
+
if (n(a))
|
|
2470
|
+
return a;
|
|
2471
2471
|
}, s.isInteger = typeof Number.isInteger == "function" ? (i) => Number.isInteger(i) : (i) => typeof i == "number" && isFinite(i) && Math.
|
|
2472
2472
|
floor(i) === i;
|
|
2473
2473
|
function r(i, n = " | ") {
|
|
2474
|
-
return i.map((
|
|
2474
|
+
return i.map((a) => typeof a == "string" ? `'${a}'` : a).join(n);
|
|
2475
2475
|
}
|
|
2476
2476
|
d(r, "joinValues"), s.joinValues = r, s.jsonStringifyReplacer = (i, n) => typeof n == "bigint" ? n.toString() : n;
|
|
2477
|
-
})(
|
|
2478
|
-
var
|
|
2477
|
+
})(Tt || (w.util = Tt = {}));
|
|
2478
|
+
var ur;
|
|
2479
2479
|
(function(s) {
|
|
2480
2480
|
s.mergeShapes = (e, t) => ({
|
|
2481
2481
|
...e,
|
|
2482
2482
|
...t
|
|
2483
2483
|
// second overwrites first
|
|
2484
2484
|
});
|
|
2485
|
-
})(
|
|
2486
|
-
|
|
2485
|
+
})(ur || (w.objectUtil = ur = {}));
|
|
2486
|
+
w.ZodParsedType = Tt.arrayToEnum([
|
|
2487
2487
|
"string",
|
|
2488
2488
|
"nan",
|
|
2489
2489
|
"number",
|
|
@@ -2505,40 +2505,40 @@ var Ae = O((k) => {
|
|
|
2505
2505
|
"map",
|
|
2506
2506
|
"set"
|
|
2507
2507
|
]);
|
|
2508
|
-
var
|
|
2508
|
+
var fs = /* @__PURE__ */ d((s) => {
|
|
2509
2509
|
switch (typeof s) {
|
|
2510
2510
|
case "undefined":
|
|
2511
|
-
return
|
|
2511
|
+
return w.ZodParsedType.undefined;
|
|
2512
2512
|
case "string":
|
|
2513
|
-
return
|
|
2513
|
+
return w.ZodParsedType.string;
|
|
2514
2514
|
case "number":
|
|
2515
|
-
return isNaN(s) ?
|
|
2515
|
+
return isNaN(s) ? w.ZodParsedType.nan : w.ZodParsedType.number;
|
|
2516
2516
|
case "boolean":
|
|
2517
|
-
return
|
|
2517
|
+
return w.ZodParsedType.boolean;
|
|
2518
2518
|
case "function":
|
|
2519
|
-
return
|
|
2519
|
+
return w.ZodParsedType.function;
|
|
2520
2520
|
case "bigint":
|
|
2521
|
-
return
|
|
2521
|
+
return w.ZodParsedType.bigint;
|
|
2522
2522
|
case "symbol":
|
|
2523
|
-
return
|
|
2523
|
+
return w.ZodParsedType.symbol;
|
|
2524
2524
|
case "object":
|
|
2525
|
-
return Array.isArray(s) ?
|
|
2526
|
-
typeof s.catch == "function" ?
|
|
2527
|
-
u" && s instanceof Set ?
|
|
2525
|
+
return Array.isArray(s) ? w.ZodParsedType.array : s === null ? w.ZodParsedType.null : s.then && typeof s.then == "function" && s.catch &&
|
|
2526
|
+
typeof s.catch == "function" ? w.ZodParsedType.promise : typeof Map < "u" && s instanceof Map ? w.ZodParsedType.map : typeof Set < "\
|
|
2527
|
+
u" && s instanceof Set ? w.ZodParsedType.set : typeof Date < "u" && s instanceof Date ? w.ZodParsedType.date : w.ZodParsedType.object;
|
|
2528
2528
|
default:
|
|
2529
|
-
return
|
|
2529
|
+
return w.ZodParsedType.unknown;
|
|
2530
2530
|
}
|
|
2531
2531
|
}, "getParsedType");
|
|
2532
|
-
|
|
2532
|
+
w.getParsedType = fs;
|
|
2533
2533
|
});
|
|
2534
2534
|
|
|
2535
2535
|
// ../node_modules/zod/lib/ZodError.js
|
|
2536
|
-
var Be =
|
|
2536
|
+
var Be = T((Y) => {
|
|
2537
2537
|
"use strict";
|
|
2538
|
-
Object.defineProperty(
|
|
2539
|
-
|
|
2540
|
-
var
|
|
2541
|
-
|
|
2538
|
+
Object.defineProperty(Y, "__esModule", { value: !0 });
|
|
2539
|
+
Y.ZodError = Y.quotelessJson = Y.ZodIssueCode = void 0;
|
|
2540
|
+
var lr = Ze();
|
|
2541
|
+
Y.ZodIssueCode = lr.util.arrayToEnum([
|
|
2542
2542
|
"invalid_type",
|
|
2543
2543
|
"invalid_literal",
|
|
2544
2544
|
"custom",
|
|
@@ -2556,9 +2556,9 @@ var Be = O((G) => {
|
|
|
2556
2556
|
"not_multiple_of",
|
|
2557
2557
|
"not_finite"
|
|
2558
2558
|
]);
|
|
2559
|
-
var
|
|
2560
|
-
|
|
2561
|
-
var
|
|
2559
|
+
var ms = /* @__PURE__ */ d((s) => JSON.stringify(s, null, 2).replace(/"([^"]+)":/g, "$1:"), "quotelessJson");
|
|
2560
|
+
Y.quotelessJson = ms;
|
|
2561
|
+
var je = class s extends Error {
|
|
2562
2562
|
static {
|
|
2563
2563
|
d(this, "ZodError");
|
|
2564
2564
|
}
|
|
@@ -2578,21 +2578,21 @@ var Be = O((G) => {
|
|
|
2578
2578
|
let t = e || function(n) {
|
|
2579
2579
|
return n.message;
|
|
2580
2580
|
}, r = { _errors: [] }, i = /* @__PURE__ */ d((n) => {
|
|
2581
|
-
for (let
|
|
2582
|
-
if (
|
|
2583
|
-
|
|
2584
|
-
else if (
|
|
2585
|
-
i(
|
|
2586
|
-
else if (
|
|
2587
|
-
i(
|
|
2588
|
-
else if (
|
|
2589
|
-
r._errors.push(t(
|
|
2581
|
+
for (let a of n.issues)
|
|
2582
|
+
if (a.code === "invalid_union")
|
|
2583
|
+
a.unionErrors.map(i);
|
|
2584
|
+
else if (a.code === "invalid_return_type")
|
|
2585
|
+
i(a.returnTypeError);
|
|
2586
|
+
else if (a.code === "invalid_arguments")
|
|
2587
|
+
i(a.argumentsError);
|
|
2588
|
+
else if (a.path.length === 0)
|
|
2589
|
+
r._errors.push(t(a));
|
|
2590
2590
|
else {
|
|
2591
|
-
let
|
|
2592
|
-
for (;
|
|
2593
|
-
let h =
|
|
2594
|
-
|
|
2595
|
-
|
|
2591
|
+
let o = r, c = 0;
|
|
2592
|
+
for (; c < a.path.length; ) {
|
|
2593
|
+
let h = a.path[c];
|
|
2594
|
+
c === a.path.length - 1 ? (o[h] = o[h] || { _errors: [] }, o[h]._errors.push(t(a))) : o[h] = o[h] || { _errors: [] }, o = o[h],
|
|
2595
|
+
c++;
|
|
2596
2596
|
}
|
|
2597
2597
|
}
|
|
2598
2598
|
}, "processError");
|
|
@@ -2606,7 +2606,7 @@ var Be = O((G) => {
|
|
|
2606
2606
|
return this.message;
|
|
2607
2607
|
}
|
|
2608
2608
|
get message() {
|
|
2609
|
-
return JSON.stringify(this.issues,
|
|
2609
|
+
return JSON.stringify(this.issues, lr.util.jsonStringifyReplacer, 2);
|
|
2610
2610
|
}
|
|
2611
2611
|
get isEmpty() {
|
|
2612
2612
|
return this.issues.length === 0;
|
|
@@ -2621,59 +2621,59 @@ var Be = O((G) => {
|
|
|
2621
2621
|
return this.flatten();
|
|
2622
2622
|
}
|
|
2623
2623
|
};
|
|
2624
|
-
|
|
2625
|
-
|
|
2624
|
+
Y.ZodError = je;
|
|
2625
|
+
je.create = (s) => new je(s);
|
|
2626
2626
|
});
|
|
2627
2627
|
|
|
2628
2628
|
// ../node_modules/zod/lib/locales/en.js
|
|
2629
|
-
var
|
|
2629
|
+
var At = T((Ot) => {
|
|
2630
2630
|
"use strict";
|
|
2631
|
-
Object.defineProperty(
|
|
2632
|
-
var
|
|
2631
|
+
Object.defineProperty(Ot, "__esModule", { value: !0 });
|
|
2632
|
+
var te = Ze(), O = Be(), gs = /* @__PURE__ */ d((s, e) => {
|
|
2633
2633
|
let t;
|
|
2634
2634
|
switch (s.code) {
|
|
2635
|
-
case
|
|
2636
|
-
s.received ===
|
|
2635
|
+
case O.ZodIssueCode.invalid_type:
|
|
2636
|
+
s.received === te.ZodParsedType.undefined ? t = "Required" : t = `Expected ${s.expected}, received ${s.received}`;
|
|
2637
2637
|
break;
|
|
2638
|
-
case
|
|
2639
|
-
t = `Invalid literal value, expected ${JSON.stringify(s.expected,
|
|
2638
|
+
case O.ZodIssueCode.invalid_literal:
|
|
2639
|
+
t = `Invalid literal value, expected ${JSON.stringify(s.expected, te.util.jsonStringifyReplacer)}`;
|
|
2640
2640
|
break;
|
|
2641
|
-
case
|
|
2642
|
-
t = `Unrecognized key(s) in object: ${
|
|
2641
|
+
case O.ZodIssueCode.unrecognized_keys:
|
|
2642
|
+
t = `Unrecognized key(s) in object: ${te.util.joinValues(s.keys, ", ")}`;
|
|
2643
2643
|
break;
|
|
2644
|
-
case
|
|
2644
|
+
case O.ZodIssueCode.invalid_union:
|
|
2645
2645
|
t = "Invalid input";
|
|
2646
2646
|
break;
|
|
2647
|
-
case
|
|
2648
|
-
t = `Invalid discriminator value. Expected ${
|
|
2647
|
+
case O.ZodIssueCode.invalid_union_discriminator:
|
|
2648
|
+
t = `Invalid discriminator value. Expected ${te.util.joinValues(s.options)}`;
|
|
2649
2649
|
break;
|
|
2650
|
-
case
|
|
2651
|
-
t = `Invalid enum value. Expected ${
|
|
2650
|
+
case O.ZodIssueCode.invalid_enum_value:
|
|
2651
|
+
t = `Invalid enum value. Expected ${te.util.joinValues(s.options)}, received '${s.received}'`;
|
|
2652
2652
|
break;
|
|
2653
|
-
case
|
|
2653
|
+
case O.ZodIssueCode.invalid_arguments:
|
|
2654
2654
|
t = "Invalid function arguments";
|
|
2655
2655
|
break;
|
|
2656
|
-
case
|
|
2656
|
+
case O.ZodIssueCode.invalid_return_type:
|
|
2657
2657
|
t = "Invalid function return type";
|
|
2658
2658
|
break;
|
|
2659
|
-
case
|
|
2659
|
+
case O.ZodIssueCode.invalid_date:
|
|
2660
2660
|
t = "Invalid date";
|
|
2661
2661
|
break;
|
|
2662
|
-
case
|
|
2662
|
+
case O.ZodIssueCode.invalid_string:
|
|
2663
2663
|
typeof s.validation == "object" ? "includes" in s.validation ? (t = `Invalid input: must include "${s.validation.includes}"`, typeof s.
|
|
2664
2664
|
validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${s.validation.position}`)) : "start\
|
|
2665
2665
|
sWith" in s.validation ? t = `Invalid input: must start with "${s.validation.startsWith}"` : "endsWith" in s.validation ? t = `Invalid input\
|
|
2666
|
-
: must end with "${s.validation.endsWith}"` :
|
|
2666
|
+
: must end with "${s.validation.endsWith}"` : te.util.assertNever(s.validation) : s.validation !== "regex" ? t = `Invalid ${s.validation}` :
|
|
2667
2667
|
t = "Invalid";
|
|
2668
2668
|
break;
|
|
2669
|
-
case
|
|
2669
|
+
case O.ZodIssueCode.too_small:
|
|
2670
2670
|
s.type === "array" ? t = `Array must contain ${s.exact ? "exactly" : s.inclusive ? "at least" : "more than"} ${s.minimum} element(s)` :
|
|
2671
2671
|
s.type === "string" ? t = `String must contain ${s.exact ? "exactly" : s.inclusive ? "at least" : "over"} ${s.minimum} character(s)` :
|
|
2672
2672
|
s.type === "number" ? t = `Number must be ${s.exact ? "exactly equal to " : s.inclusive ? "greater than or equal to " : "greater tha\
|
|
2673
2673
|
n "}${s.minimum}` : s.type === "date" ? t = `Date must be ${s.exact ? "exactly equal to " : s.inclusive ? "greater than or equal to " : "gre\
|
|
2674
2674
|
ater than "}${new Date(Number(s.minimum))}` : t = "Invalid input";
|
|
2675
2675
|
break;
|
|
2676
|
-
case
|
|
2676
|
+
case O.ZodIssueCode.too_big:
|
|
2677
2677
|
s.type === "array" ? t = `Array must contain ${s.exact ? "exactly" : s.inclusive ? "at most" : "less than"} ${s.maximum} element(s)` :
|
|
2678
2678
|
s.type === "string" ? t = `String must contain ${s.exact ? "exactly" : s.inclusive ? "at most" : "under"} ${s.maximum} character(s)` :
|
|
2679
2679
|
s.type === "number" ? t = `Number must be ${s.exact ? "exactly" : s.inclusive ? "less than or equal to" : "less than"} ${s.maximum}` :
|
|
@@ -2681,60 +2681,60 @@ ater than "}${new Date(Number(s.minimum))}` : t = "Invalid input";
|
|
|
2681
2681
|
s.type === "date" ? t = `Date must be ${s.exact ? "exactly" : s.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(
|
|
2682
2682
|
Number(s.maximum))}` : t = "Invalid input";
|
|
2683
2683
|
break;
|
|
2684
|
-
case
|
|
2684
|
+
case O.ZodIssueCode.custom:
|
|
2685
2685
|
t = "Invalid input";
|
|
2686
2686
|
break;
|
|
2687
|
-
case
|
|
2687
|
+
case O.ZodIssueCode.invalid_intersection_types:
|
|
2688
2688
|
t = "Intersection results could not be merged";
|
|
2689
2689
|
break;
|
|
2690
|
-
case
|
|
2690
|
+
case O.ZodIssueCode.not_multiple_of:
|
|
2691
2691
|
t = `Number must be a multiple of ${s.multipleOf}`;
|
|
2692
2692
|
break;
|
|
2693
|
-
case
|
|
2693
|
+
case O.ZodIssueCode.not_finite:
|
|
2694
2694
|
t = "Number must be finite";
|
|
2695
2695
|
break;
|
|
2696
2696
|
default:
|
|
2697
|
-
t = e.defaultError,
|
|
2697
|
+
t = e.defaultError, te.util.assertNever(s);
|
|
2698
2698
|
}
|
|
2699
2699
|
return { message: t };
|
|
2700
2700
|
}, "errorMap");
|
|
2701
|
-
|
|
2701
|
+
Ot.default = gs;
|
|
2702
2702
|
});
|
|
2703
2703
|
|
|
2704
2704
|
// ../node_modules/zod/lib/errors.js
|
|
2705
|
-
var
|
|
2705
|
+
var We = T((M) => {
|
|
2706
2706
|
"use strict";
|
|
2707
|
-
var
|
|
2707
|
+
var ys = M && M.__importDefault || function(s) {
|
|
2708
2708
|
return s && s.__esModule ? s : { default: s };
|
|
2709
2709
|
};
|
|
2710
2710
|
Object.defineProperty(M, "__esModule", { value: !0 });
|
|
2711
2711
|
M.getErrorMap = M.setErrorMap = M.defaultErrorMap = void 0;
|
|
2712
|
-
var
|
|
2713
|
-
M.defaultErrorMap =
|
|
2714
|
-
var
|
|
2715
|
-
function
|
|
2716
|
-
|
|
2712
|
+
var cr = ys(At());
|
|
2713
|
+
M.defaultErrorMap = cr.default;
|
|
2714
|
+
var hr = cr.default;
|
|
2715
|
+
function _s(s) {
|
|
2716
|
+
hr = s;
|
|
2717
2717
|
}
|
|
2718
|
-
d(
|
|
2719
|
-
M.setErrorMap =
|
|
2720
|
-
function
|
|
2721
|
-
return
|
|
2718
|
+
d(_s, "setErrorMap");
|
|
2719
|
+
M.setErrorMap = _s;
|
|
2720
|
+
function vs() {
|
|
2721
|
+
return hr;
|
|
2722
2722
|
}
|
|
2723
|
-
d(
|
|
2724
|
-
M.getErrorMap =
|
|
2723
|
+
d(vs, "getErrorMap");
|
|
2724
|
+
M.getErrorMap = vs;
|
|
2725
2725
|
});
|
|
2726
2726
|
|
|
2727
2727
|
// ../node_modules/zod/lib/helpers/parseUtil.js
|
|
2728
|
-
var
|
|
2728
|
+
var jt = T((x) => {
|
|
2729
2729
|
"use strict";
|
|
2730
|
-
var
|
|
2730
|
+
var bs = x && x.__importDefault || function(s) {
|
|
2731
2731
|
return s && s.__esModule ? s : { default: s };
|
|
2732
2732
|
};
|
|
2733
2733
|
Object.defineProperty(x, "__esModule", { value: !0 });
|
|
2734
2734
|
x.isAsync = x.isValid = x.isDirty = x.isAborted = x.OK = x.DIRTY = x.INVALID = x.ParseStatus = x.addIssueToContext = x.EMPTY_PATH = x.makeIssue =
|
|
2735
2735
|
void 0;
|
|
2736
|
-
var
|
|
2737
|
-
let { data: e, path: t, errorMaps: r, issueData: i } = s, n = [...t, ...i.path || []],
|
|
2736
|
+
var xs = We(), pr = bs(At()), ws = /* @__PURE__ */ d((s) => {
|
|
2737
|
+
let { data: e, path: t, errorMaps: r, issueData: i } = s, n = [...t, ...i.path || []], a = {
|
|
2738
2738
|
...i,
|
|
2739
2739
|
path: n
|
|
2740
2740
|
};
|
|
@@ -2744,19 +2744,19 @@ var Rt = O((x) => {
|
|
|
2744
2744
|
path: n,
|
|
2745
2745
|
message: i.message
|
|
2746
2746
|
};
|
|
2747
|
-
let
|
|
2748
|
-
for (let h of
|
|
2749
|
-
|
|
2747
|
+
let o = "", c = r.filter((h) => !!h).slice().reverse();
|
|
2748
|
+
for (let h of c)
|
|
2749
|
+
o = h(a, { data: e, defaultError: o }).message;
|
|
2750
2750
|
return {
|
|
2751
2751
|
...i,
|
|
2752
2752
|
path: n,
|
|
2753
|
-
message:
|
|
2753
|
+
message: o
|
|
2754
2754
|
};
|
|
2755
2755
|
}, "makeIssue");
|
|
2756
|
-
x.makeIssue =
|
|
2756
|
+
x.makeIssue = ws;
|
|
2757
2757
|
x.EMPTY_PATH = [];
|
|
2758
|
-
function
|
|
2759
|
-
let t = (0,
|
|
2758
|
+
function Cs(s, e) {
|
|
2759
|
+
let t = (0, xs.getErrorMap)(), r = (0, x.makeIssue)({
|
|
2760
2760
|
issueData: e,
|
|
2761
2761
|
data: s.data,
|
|
2762
2762
|
path: s.path,
|
|
@@ -2767,15 +2767,15 @@ var Rt = O((x) => {
|
|
|
2767
2767
|
// then schema-bound map if available
|
|
2768
2768
|
t,
|
|
2769
2769
|
// then global override map
|
|
2770
|
-
t ===
|
|
2770
|
+
t === pr.default ? void 0 : pr.default
|
|
2771
2771
|
// then global default map
|
|
2772
2772
|
].filter((i) => !!i)
|
|
2773
2773
|
});
|
|
2774
2774
|
s.common.issues.push(r);
|
|
2775
2775
|
}
|
|
2776
|
-
d(
|
|
2777
|
-
x.addIssueToContext =
|
|
2778
|
-
var
|
|
2776
|
+
d(Cs, "addIssueToContext");
|
|
2777
|
+
x.addIssueToContext = Cs;
|
|
2778
|
+
var Zt = class s {
|
|
2779
2779
|
static {
|
|
2780
2780
|
d(this, "ParseStatus");
|
|
2781
2781
|
}
|
|
@@ -2800,10 +2800,10 @@ var Rt = O((x) => {
|
|
|
2800
2800
|
static async mergeObjectAsync(e, t) {
|
|
2801
2801
|
let r = [];
|
|
2802
2802
|
for (let i of t) {
|
|
2803
|
-
let n = await i.key,
|
|
2803
|
+
let n = await i.key, a = await i.value;
|
|
2804
2804
|
r.push({
|
|
2805
2805
|
key: n,
|
|
2806
|
-
value:
|
|
2806
|
+
value: a
|
|
2807
2807
|
});
|
|
2808
2808
|
}
|
|
2809
2809
|
return s.mergeObjectSync(e, r);
|
|
@@ -2811,76 +2811,76 @@ var Rt = O((x) => {
|
|
|
2811
2811
|
static mergeObjectSync(e, t) {
|
|
2812
2812
|
let r = {};
|
|
2813
2813
|
for (let i of t) {
|
|
2814
|
-
let { key: n, value:
|
|
2815
|
-
if (n.status === "aborted" ||
|
|
2814
|
+
let { key: n, value: a } = i;
|
|
2815
|
+
if (n.status === "aborted" || a.status === "aborted")
|
|
2816
2816
|
return x.INVALID;
|
|
2817
|
-
n.status === "dirty" && e.dirty(),
|
|
2818
|
-
(r[n.value] =
|
|
2817
|
+
n.status === "dirty" && e.dirty(), a.status === "dirty" && e.dirty(), n.value !== "__proto__" && (typeof a.value < "u" || i.alwaysSet) &&
|
|
2818
|
+
(r[n.value] = a.value);
|
|
2819
2819
|
}
|
|
2820
2820
|
return { status: e.value, value: r };
|
|
2821
2821
|
}
|
|
2822
2822
|
};
|
|
2823
|
-
x.ParseStatus =
|
|
2823
|
+
x.ParseStatus = Zt;
|
|
2824
2824
|
x.INVALID = Object.freeze({
|
|
2825
2825
|
status: "aborted"
|
|
2826
2826
|
});
|
|
2827
|
-
var
|
|
2828
|
-
x.DIRTY =
|
|
2829
|
-
var
|
|
2830
|
-
x.OK =
|
|
2831
|
-
var
|
|
2832
|
-
x.isAborted =
|
|
2833
|
-
var
|
|
2834
|
-
x.isDirty =
|
|
2835
|
-
var
|
|
2836
|
-
x.isValid =
|
|
2837
|
-
var
|
|
2838
|
-
x.isAsync =
|
|
2827
|
+
var ks = /* @__PURE__ */ d((s) => ({ status: "dirty", value: s }), "DIRTY");
|
|
2828
|
+
x.DIRTY = ks;
|
|
2829
|
+
var Is = /* @__PURE__ */ d((s) => ({ status: "valid", value: s }), "OK");
|
|
2830
|
+
x.OK = Is;
|
|
2831
|
+
var Ts = /* @__PURE__ */ d((s) => s.status === "aborted", "isAborted");
|
|
2832
|
+
x.isAborted = Ts;
|
|
2833
|
+
var Os = /* @__PURE__ */ d((s) => s.status === "dirty", "isDirty");
|
|
2834
|
+
x.isDirty = Os;
|
|
2835
|
+
var As = /* @__PURE__ */ d((s) => s.status === "valid", "isValid");
|
|
2836
|
+
x.isValid = As;
|
|
2837
|
+
var Zs = /* @__PURE__ */ d((s) => typeof Promise < "u" && s instanceof Promise, "isAsync");
|
|
2838
|
+
x.isAsync = Zs;
|
|
2839
2839
|
});
|
|
2840
2840
|
|
|
2841
2841
|
// ../node_modules/zod/lib/helpers/typeAliases.js
|
|
2842
|
-
var
|
|
2842
|
+
var mr = T((fr) => {
|
|
2843
2843
|
"use strict";
|
|
2844
|
-
Object.defineProperty(
|
|
2844
|
+
Object.defineProperty(fr, "__esModule", { value: !0 });
|
|
2845
2845
|
});
|
|
2846
2846
|
|
|
2847
2847
|
// ../node_modules/zod/lib/helpers/errorUtil.js
|
|
2848
|
-
var
|
|
2848
|
+
var yr = T((ze) => {
|
|
2849
2849
|
"use strict";
|
|
2850
|
-
Object.defineProperty(
|
|
2851
|
-
|
|
2852
|
-
var
|
|
2850
|
+
Object.defineProperty(ze, "__esModule", { value: !0 });
|
|
2851
|
+
ze.errorUtil = void 0;
|
|
2852
|
+
var gr;
|
|
2853
2853
|
(function(s) {
|
|
2854
2854
|
s.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, s.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
2855
|
-
})(
|
|
2855
|
+
})(gr || (ze.errorUtil = gr = {}));
|
|
2856
2856
|
});
|
|
2857
2857
|
|
|
2858
2858
|
// ../node_modules/zod/lib/types.js
|
|
2859
|
-
var
|
|
2859
|
+
var jr = T((u) => {
|
|
2860
2860
|
"use strict";
|
|
2861
|
-
var
|
|
2861
|
+
var Je = u && u.__classPrivateFieldGet || function(s, e, t, r) {
|
|
2862
2862
|
if (t === "a" && !r) throw new TypeError("Private accessor was defined without a getter");
|
|
2863
2863
|
if (typeof e == "function" ? s !== e || !r : !e.has(s)) throw new TypeError("Cannot read private member from an object whose class did n\
|
|
2864
2864
|
ot declare it");
|
|
2865
2865
|
return t === "m" ? r : t === "a" ? r.call(s) : r ? r.value : e.get(s);
|
|
2866
|
-
},
|
|
2866
|
+
}, br = u && u.__classPrivateFieldSet || function(s, e, t, r, i) {
|
|
2867
2867
|
if (r === "m") throw new TypeError("Private method is not writable");
|
|
2868
2868
|
if (r === "a" && !i) throw new TypeError("Private accessor was defined without a setter");
|
|
2869
2869
|
if (typeof e == "function" ? s !== e || !i : !e.has(s)) throw new TypeError("Cannot write private member to an object whose class did no\
|
|
2870
2870
|
t declare it");
|
|
2871
2871
|
return r === "a" ? i.call(s, t) : i ? i.value = t : e.set(s, t), t;
|
|
2872
|
-
},
|
|
2873
|
-
Object.defineProperty(
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
ZodIntersection =
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
var
|
|
2872
|
+
}, Se, Ee;
|
|
2873
|
+
Object.defineProperty(u, "__esModule", { value: !0 });
|
|
2874
|
+
u.boolean = u.bigint = u.array = u.any = u.coerce = u.ZodFirstPartyTypeKind = u.late = u.ZodSchema = u.Schema = u.custom = u.ZodReadonly =
|
|
2875
|
+
u.ZodPipeline = u.ZodBranded = u.BRAND = u.ZodNaN = u.ZodCatch = u.ZodDefault = u.ZodNullable = u.ZodOptional = u.ZodTransformer = u.ZodEffects =
|
|
2876
|
+
u.ZodPromise = u.ZodNativeEnum = u.ZodEnum = u.ZodLiteral = u.ZodLazy = u.ZodFunction = u.ZodSet = u.ZodMap = u.ZodRecord = u.ZodTuple = u.
|
|
2877
|
+
ZodIntersection = u.ZodDiscriminatedUnion = u.ZodUnion = u.ZodObject = u.ZodArray = u.ZodVoid = u.ZodNever = u.ZodUnknown = u.ZodAny = u.ZodNull =
|
|
2878
|
+
u.ZodUndefined = u.ZodSymbol = u.ZodDate = u.ZodBoolean = u.ZodBigInt = u.ZodNumber = u.ZodString = u.datetimeRegex = u.ZodType = void 0;
|
|
2879
|
+
u.NEVER = u.void = u.unknown = u.union = u.undefined = u.tuple = u.transformer = u.symbol = u.string = u.strictObject = u.set = u.record =
|
|
2880
|
+
u.promise = u.preprocess = u.pipeline = u.ostring = u.optional = u.onumber = u.oboolean = u.object = u.number = u.nullable = u.null = u.never =
|
|
2881
|
+
u.nativeEnum = u.nan = u.map = u.literal = u.lazy = u.intersection = u.instanceof = u.function = u.enum = u.effect = u.discriminatedUnion =
|
|
2882
|
+
u.date = void 0;
|
|
2883
|
+
var Ge = We(), g = yr(), l = jt(), m = Ze(), f = Be(), N = class {
|
|
2884
2884
|
static {
|
|
2885
2885
|
d(this, "ParseInputLazyPath");
|
|
2886
2886
|
}
|
|
@@ -2891,8 +2891,8 @@ t declare it");
|
|
|
2891
2891
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.
|
|
2892
2892
|
push(...this._path, this._key)), this._cachedPath;
|
|
2893
2893
|
}
|
|
2894
|
-
},
|
|
2895
|
-
if ((0,
|
|
2894
|
+
}, _r = /* @__PURE__ */ d((s, e) => {
|
|
2895
|
+
if ((0, l.isValid)(e))
|
|
2896
2896
|
return { success: !0, data: e.value };
|
|
2897
2897
|
if (!s.common.issues.length)
|
|
2898
2898
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -2906,22 +2906,22 @@ t declare it");
|
|
|
2906
2906
|
}
|
|
2907
2907
|
};
|
|
2908
2908
|
}, "handleResult");
|
|
2909
|
-
function
|
|
2909
|
+
function v(s) {
|
|
2910
2910
|
if (!s)
|
|
2911
2911
|
return {};
|
|
2912
2912
|
let { errorMap: e, invalid_type_error: t, required_error: r, description: i } = s;
|
|
2913
2913
|
if (e && (t || r))
|
|
2914
2914
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
2915
|
-
return e ? { errorMap: e, description: i } : { errorMap: /* @__PURE__ */ d((
|
|
2916
|
-
var
|
|
2915
|
+
return e ? { errorMap: e, description: i } : { errorMap: /* @__PURE__ */ d((a, o) => {
|
|
2916
|
+
var c, h;
|
|
2917
2917
|
let { message: p } = s;
|
|
2918
|
-
return
|
|
2919
|
-
void 0 ?
|
|
2920
|
-
h :
|
|
2918
|
+
return a.code === "invalid_enum_value" ? { message: p ?? o.defaultError } : typeof o.data > "u" ? { message: (c = p ?? r) !== null && c !==
|
|
2919
|
+
void 0 ? c : o.defaultError } : a.code !== "invalid_type" ? { message: o.defaultError } : { message: (h = p ?? t) !== null && h !== void 0 ?
|
|
2920
|
+
h : o.defaultError };
|
|
2921
2921
|
}, "customMap"), description: i };
|
|
2922
2922
|
}
|
|
2923
|
-
d(
|
|
2924
|
-
var
|
|
2923
|
+
d(v, "processCreateParams");
|
|
2924
|
+
var b = class {
|
|
2925
2925
|
static {
|
|
2926
2926
|
d(this, "ZodType");
|
|
2927
2927
|
}
|
|
@@ -2943,7 +2943,7 @@ t declare it");
|
|
|
2943
2943
|
}
|
|
2944
2944
|
_processInputParams(e) {
|
|
2945
2945
|
return {
|
|
2946
|
-
status: new
|
|
2946
|
+
status: new l.ParseStatus(),
|
|
2947
2947
|
ctx: {
|
|
2948
2948
|
common: e.parent.common,
|
|
2949
2949
|
data: e.data,
|
|
@@ -2956,7 +2956,7 @@ t declare it");
|
|
|
2956
2956
|
}
|
|
2957
2957
|
_parseSync(e) {
|
|
2958
2958
|
let t = this._parse(e);
|
|
2959
|
-
if ((0,
|
|
2959
|
+
if ((0, l.isAsync)(t))
|
|
2960
2960
|
throw new Error("Synchronous parse encountered promise.");
|
|
2961
2961
|
return t;
|
|
2962
2962
|
}
|
|
@@ -2984,7 +2984,7 @@ t declare it");
|
|
|
2984
2984
|
data: e,
|
|
2985
2985
|
parsedType: (0, m.getParsedType)(e)
|
|
2986
2986
|
}, n = this._parseSync({ data: e, path: i.path, parent: i });
|
|
2987
|
-
return
|
|
2987
|
+
return _r(i, n);
|
|
2988
2988
|
}
|
|
2989
2989
|
"~validate"(e) {
|
|
2990
2990
|
var t, r;
|
|
@@ -3002,7 +3002,7 @@ t declare it");
|
|
|
3002
3002
|
if (!this["~standard"].async)
|
|
3003
3003
|
try {
|
|
3004
3004
|
let n = this._parseSync({ data: e, path: [], parent: i });
|
|
3005
|
-
return (0,
|
|
3005
|
+
return (0, l.isValid)(n) ? {
|
|
3006
3006
|
value: n.value
|
|
3007
3007
|
} : {
|
|
3008
3008
|
issues: i.common.issues
|
|
@@ -3014,7 +3014,7 @@ t declare it");
|
|
|
3014
3014
|
async: !0
|
|
3015
3015
|
};
|
|
3016
3016
|
}
|
|
3017
|
-
return this._parseAsync({ data: e, path: [], parent: i }).then((n) => (0,
|
|
3017
|
+
return this._parseAsync({ data: e, path: [], parent: i }).then((n) => (0, l.isValid)(n) ? {
|
|
3018
3018
|
value: n.value
|
|
3019
3019
|
} : {
|
|
3020
3020
|
issues: i.common.issues
|
|
@@ -3038,25 +3038,25 @@ t declare it");
|
|
|
3038
3038
|
parent: null,
|
|
3039
3039
|
data: e,
|
|
3040
3040
|
parsedType: (0, m.getParsedType)(e)
|
|
3041
|
-
}, i = this._parse({ data: e, path: r.path, parent: r }), n = await ((0,
|
|
3042
|
-
return
|
|
3041
|
+
}, i = this._parse({ data: e, path: r.path, parent: r }), n = await ((0, l.isAsync)(i) ? i : Promise.resolve(i));
|
|
3042
|
+
return _r(r, n);
|
|
3043
3043
|
}
|
|
3044
3044
|
refine(e, t) {
|
|
3045
3045
|
let r = /* @__PURE__ */ d((i) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(i) : t, "getIssu\
|
|
3046
3046
|
eProperties");
|
|
3047
3047
|
return this._refinement((i, n) => {
|
|
3048
|
-
let
|
|
3048
|
+
let a = e(i), o = /* @__PURE__ */ d(() => n.addIssue({
|
|
3049
3049
|
code: f.ZodIssueCode.custom,
|
|
3050
3050
|
...r(i)
|
|
3051
3051
|
}), "setError");
|
|
3052
|
-
return typeof Promise < "u" &&
|
|
3052
|
+
return typeof Promise < "u" && a instanceof Promise ? a.then((c) => c ? !0 : (o(), !1)) : a ? !0 : (o(), !1);
|
|
3053
3053
|
});
|
|
3054
3054
|
}
|
|
3055
3055
|
refinement(e, t) {
|
|
3056
3056
|
return this._refinement((r, i) => e(r) ? !0 : (i.addIssue(typeof t == "function" ? t(r, i) : t), !1));
|
|
3057
3057
|
}
|
|
3058
3058
|
_refinement(e) {
|
|
3059
|
-
return new
|
|
3059
|
+
return new S({
|
|
3060
3060
|
schema: this,
|
|
3061
3061
|
typeName: _.ZodEffects,
|
|
3062
3062
|
effect: { type: "refinement", refinement: e }
|
|
@@ -3080,10 +3080,10 @@ eProperties");
|
|
|
3080
3080
|
};
|
|
3081
3081
|
}
|
|
3082
3082
|
optional() {
|
|
3083
|
-
return
|
|
3083
|
+
return P.create(this, this._def);
|
|
3084
3084
|
}
|
|
3085
3085
|
nullable() {
|
|
3086
|
-
return
|
|
3086
|
+
return q.create(this, this._def);
|
|
3087
3087
|
}
|
|
3088
3088
|
nullish() {
|
|
3089
3089
|
return this.nullable().optional();
|
|
@@ -3092,17 +3092,17 @@ eProperties");
|
|
|
3092
3092
|
return B.create(this);
|
|
3093
3093
|
}
|
|
3094
3094
|
promise() {
|
|
3095
|
-
return
|
|
3095
|
+
return Q.create(this, this._def);
|
|
3096
3096
|
}
|
|
3097
3097
|
or(e) {
|
|
3098
|
-
return
|
|
3098
|
+
return de.create([this, e], this._def);
|
|
3099
3099
|
}
|
|
3100
3100
|
and(e) {
|
|
3101
|
-
return
|
|
3101
|
+
return ue.create(this, e, this._def);
|
|
3102
3102
|
}
|
|
3103
3103
|
transform(e) {
|
|
3104
|
-
return new
|
|
3105
|
-
...
|
|
3104
|
+
return new S({
|
|
3105
|
+
...v(this._def),
|
|
3106
3106
|
schema: this,
|
|
3107
3107
|
typeName: _.ZodEffects,
|
|
3108
3108
|
effect: { type: "transform", transform: e }
|
|
@@ -3110,24 +3110,24 @@ eProperties");
|
|
|
3110
3110
|
}
|
|
3111
3111
|
default(e) {
|
|
3112
3112
|
let t = typeof e == "function" ? e : () => e;
|
|
3113
|
-
return new
|
|
3114
|
-
...
|
|
3113
|
+
return new fe({
|
|
3114
|
+
...v(this._def),
|
|
3115
3115
|
innerType: this,
|
|
3116
3116
|
defaultValue: t,
|
|
3117
3117
|
typeName: _.ZodDefault
|
|
3118
3118
|
});
|
|
3119
3119
|
}
|
|
3120
3120
|
brand() {
|
|
3121
|
-
return new
|
|
3121
|
+
return new Pe({
|
|
3122
3122
|
typeName: _.ZodBranded,
|
|
3123
3123
|
type: this,
|
|
3124
|
-
...
|
|
3124
|
+
...v(this._def)
|
|
3125
3125
|
});
|
|
3126
3126
|
}
|
|
3127
3127
|
catch(e) {
|
|
3128
3128
|
let t = typeof e == "function" ? e : () => e;
|
|
3129
|
-
return new
|
|
3130
|
-
...
|
|
3129
|
+
return new me({
|
|
3130
|
+
...v(this._def),
|
|
3131
3131
|
innerType: this,
|
|
3132
3132
|
catchValue: t,
|
|
3133
3133
|
typeName: _.ZodCatch
|
|
@@ -3141,10 +3141,10 @@ eProperties");
|
|
|
3141
3141
|
});
|
|
3142
3142
|
}
|
|
3143
3143
|
pipe(e) {
|
|
3144
|
-
return
|
|
3144
|
+
return Ne.create(this, e);
|
|
3145
3145
|
}
|
|
3146
3146
|
readonly() {
|
|
3147
|
-
return
|
|
3147
|
+
return ge.create(this);
|
|
3148
3148
|
}
|
|
3149
3149
|
isOptional() {
|
|
3150
3150
|
return this.safeParse(void 0).success;
|
|
@@ -3153,39 +3153,39 @@ eProperties");
|
|
|
3153
3153
|
return this.safeParse(null).success;
|
|
3154
3154
|
}
|
|
3155
3155
|
};
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
var
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
onent})+$",
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",
|
|
3168
|
-
function
|
|
3156
|
+
u.ZodType = b;
|
|
3157
|
+
u.Schema = b;
|
|
3158
|
+
u.ZodSchema = b;
|
|
3159
|
+
var js = /^c[^\s-]{8,}$/i, Ss = /^[0-9a-z]+$/, Es = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ps = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,
|
|
3160
|
+
Ns = /^[a-z0-9_-]{21}$/i, Vs = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ds = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,
|
|
3161
|
+
$s = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Rs = "^(\\p{Extended_Pictographic}|\\p{Emoji_Comp\
|
|
3162
|
+
onent})+$", St, Ms = /^(?:(?: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])$/, Ls = /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,
|
|
3163
|
+
qs = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,
|
|
3164
|
+
Us = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
|
|
3165
|
+
Fs = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Hs = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
|
|
3166
|
+
xr = "((\\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\
|
|
3167
|
+
]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Bs = new RegExp(`^${xr}$`);
|
|
3168
|
+
function wr(s) {
|
|
3169
3169
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
3170
3170
|
return s.precision ? e = `${e}\\.\\d{${s.precision}}` : s.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
3171
3171
|
}
|
|
3172
|
-
d(
|
|
3173
|
-
function
|
|
3174
|
-
return new RegExp(`^${
|
|
3172
|
+
d(wr, "timeRegexSource");
|
|
3173
|
+
function Ws(s) {
|
|
3174
|
+
return new RegExp(`^${wr(s)}$`);
|
|
3175
3175
|
}
|
|
3176
|
-
d(
|
|
3177
|
-
function
|
|
3178
|
-
let e = `${
|
|
3176
|
+
d(Ws, "timeRegex");
|
|
3177
|
+
function Cr(s) {
|
|
3178
|
+
let e = `${xr}T${wr(s)}`, t = [];
|
|
3179
3179
|
return t.push(s.local ? "Z?" : "Z"), s.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
3180
3180
|
}
|
|
3181
|
-
d(
|
|
3182
|
-
|
|
3183
|
-
function
|
|
3184
|
-
return !!((e === "v4" || !e) &&
|
|
3181
|
+
d(Cr, "datetimeRegex");
|
|
3182
|
+
u.datetimeRegex = Cr;
|
|
3183
|
+
function zs(s, e) {
|
|
3184
|
+
return !!((e === "v4" || !e) && Ms.test(s) || (e === "v6" || !e) && qs.test(s));
|
|
3185
3185
|
}
|
|
3186
|
-
d(
|
|
3187
|
-
function
|
|
3188
|
-
if (
|
|
3186
|
+
d(zs, "isValidIP");
|
|
3187
|
+
function Gs(s, e) {
|
|
3188
|
+
if (!Vs.test(s))
|
|
3189
3189
|
return !1;
|
|
3190
3190
|
try {
|
|
3191
3191
|
let [t] = s.split("."), r = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), i = JSON.parse(atob(
|
|
@@ -3195,28 +3195,28 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3195
3195
|
return !1;
|
|
3196
3196
|
}
|
|
3197
3197
|
}
|
|
3198
|
-
d(
|
|
3199
|
-
function
|
|
3200
|
-
return !!((e === "v4" || !e) &&
|
|
3198
|
+
d(Gs, "isValidJWT");
|
|
3199
|
+
function Js(s, e) {
|
|
3200
|
+
return !!((e === "v4" || !e) && Ls.test(s) || (e === "v6" || !e) && Us.test(s));
|
|
3201
3201
|
}
|
|
3202
|
-
d(
|
|
3203
|
-
var
|
|
3202
|
+
d(Js, "isValidCidr");
|
|
3203
|
+
var K = class s extends b {
|
|
3204
3204
|
static {
|
|
3205
3205
|
d(this, "ZodString");
|
|
3206
3206
|
}
|
|
3207
3207
|
_parse(e) {
|
|
3208
3208
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== m.ZodParsedType.string) {
|
|
3209
3209
|
let n = this._getOrReturnCtx(e);
|
|
3210
|
-
return (0,
|
|
3210
|
+
return (0, l.addIssueToContext)(n, {
|
|
3211
3211
|
code: f.ZodIssueCode.invalid_type,
|
|
3212
3212
|
expected: m.ZodParsedType.string,
|
|
3213
3213
|
received: n.parsedType
|
|
3214
|
-
}),
|
|
3214
|
+
}), l.INVALID;
|
|
3215
3215
|
}
|
|
3216
|
-
let r = new
|
|
3216
|
+
let r = new l.ParseStatus(), i;
|
|
3217
3217
|
for (let n of this._def.checks)
|
|
3218
3218
|
if (n.kind === "min")
|
|
3219
|
-
e.data.length < n.value && (i = this._getOrReturnCtx(e, i), (0,
|
|
3219
|
+
e.data.length < n.value && (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3220
3220
|
code: f.ZodIssueCode.too_small,
|
|
3221
3221
|
minimum: n.value,
|
|
3222
3222
|
type: "string",
|
|
@@ -3225,7 +3225,7 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3225
3225
|
message: n.message
|
|
3226
3226
|
}), r.dirty());
|
|
3227
3227
|
else if (n.kind === "max")
|
|
3228
|
-
e.data.length > n.value && (i = this._getOrReturnCtx(e, i), (0,
|
|
3228
|
+
e.data.length > n.value && (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3229
3229
|
code: f.ZodIssueCode.too_big,
|
|
3230
3230
|
maximum: n.value,
|
|
3231
3231
|
type: "string",
|
|
@@ -3234,15 +3234,15 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3234
3234
|
message: n.message
|
|
3235
3235
|
}), r.dirty());
|
|
3236
3236
|
else if (n.kind === "length") {
|
|
3237
|
-
let
|
|
3238
|
-
(
|
|
3237
|
+
let a = e.data.length > n.value, o = e.data.length < n.value;
|
|
3238
|
+
(a || o) && (i = this._getOrReturnCtx(e, i), a ? (0, l.addIssueToContext)(i, {
|
|
3239
3239
|
code: f.ZodIssueCode.too_big,
|
|
3240
3240
|
maximum: n.value,
|
|
3241
3241
|
type: "string",
|
|
3242
3242
|
inclusive: !0,
|
|
3243
3243
|
exact: !0,
|
|
3244
3244
|
message: n.message
|
|
3245
|
-
}) :
|
|
3245
|
+
}) : o && (0, l.addIssueToContext)(i, {
|
|
3246
3246
|
code: f.ZodIssueCode.too_small,
|
|
3247
3247
|
minimum: n.value,
|
|
3248
3248
|
type: "string",
|
|
@@ -3251,43 +3251,43 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3251
3251
|
message: n.message
|
|
3252
3252
|
}), r.dirty());
|
|
3253
3253
|
} else if (n.kind === "email")
|
|
3254
|
-
|
|
3254
|
+
$s.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3255
3255
|
validation: "email",
|
|
3256
3256
|
code: f.ZodIssueCode.invalid_string,
|
|
3257
3257
|
message: n.message
|
|
3258
3258
|
}), r.dirty());
|
|
3259
3259
|
else if (n.kind === "emoji")
|
|
3260
|
-
|
|
3260
|
+
St || (St = new RegExp(Rs, "u")), St.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3261
3261
|
validation: "emoji",
|
|
3262
3262
|
code: f.ZodIssueCode.invalid_string,
|
|
3263
3263
|
message: n.message
|
|
3264
3264
|
}), r.dirty());
|
|
3265
3265
|
else if (n.kind === "uuid")
|
|
3266
|
-
|
|
3266
|
+
Ps.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3267
3267
|
validation: "uuid",
|
|
3268
3268
|
code: f.ZodIssueCode.invalid_string,
|
|
3269
3269
|
message: n.message
|
|
3270
3270
|
}), r.dirty());
|
|
3271
3271
|
else if (n.kind === "nanoid")
|
|
3272
|
-
|
|
3272
|
+
Ns.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3273
3273
|
validation: "nanoid",
|
|
3274
3274
|
code: f.ZodIssueCode.invalid_string,
|
|
3275
3275
|
message: n.message
|
|
3276
3276
|
}), r.dirty());
|
|
3277
3277
|
else if (n.kind === "cuid")
|
|
3278
|
-
|
|
3278
|
+
js.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3279
3279
|
validation: "cuid",
|
|
3280
3280
|
code: f.ZodIssueCode.invalid_string,
|
|
3281
3281
|
message: n.message
|
|
3282
3282
|
}), r.dirty());
|
|
3283
3283
|
else if (n.kind === "cuid2")
|
|
3284
|
-
|
|
3284
|
+
Ss.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3285
3285
|
validation: "cuid2",
|
|
3286
3286
|
code: f.ZodIssueCode.invalid_string,
|
|
3287
3287
|
message: n.message
|
|
3288
3288
|
}), r.dirty());
|
|
3289
3289
|
else if (n.kind === "ulid")
|
|
3290
|
-
|
|
3290
|
+
Es.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3291
3291
|
validation: "ulid",
|
|
3292
3292
|
code: f.ZodIssueCode.invalid_string,
|
|
3293
3293
|
message: n.message
|
|
@@ -3296,64 +3296,64 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3296
3296
|
try {
|
|
3297
3297
|
new URL(e.data);
|
|
3298
3298
|
} catch {
|
|
3299
|
-
i = this._getOrReturnCtx(e, i), (0,
|
|
3299
|
+
i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3300
3300
|
validation: "url",
|
|
3301
3301
|
code: f.ZodIssueCode.invalid_string,
|
|
3302
3302
|
message: n.message
|
|
3303
3303
|
}), r.dirty();
|
|
3304
3304
|
}
|
|
3305
|
-
else n.kind === "regex" ? (n.regex.lastIndex = 0, n.regex.test(e.data) || (i = this._getOrReturnCtx(e, i), (0,
|
|
3305
|
+
else n.kind === "regex" ? (n.regex.lastIndex = 0, n.regex.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(
|
|
3306
3306
|
i, {
|
|
3307
3307
|
validation: "regex",
|
|
3308
3308
|
code: f.ZodIssueCode.invalid_string,
|
|
3309
3309
|
message: n.message
|
|
3310
3310
|
}), r.dirty())) : n.kind === "trim" ? e.data = e.data.trim() : n.kind === "includes" ? e.data.includes(n.value, n.position) || (i = this.
|
|
3311
|
-
_getOrReturnCtx(e, i), (0,
|
|
3311
|
+
_getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3312
3312
|
code: f.ZodIssueCode.invalid_string,
|
|
3313
3313
|
validation: { includes: n.value, position: n.position },
|
|
3314
3314
|
message: n.message
|
|
3315
3315
|
}), r.dirty()) : n.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : n.kind === "toUpperCase" ? e.data = e.data.toUpperCase() :
|
|
3316
|
-
n.kind === "startsWith" ? e.data.startsWith(n.value) || (i = this._getOrReturnCtx(e, i), (0,
|
|
3316
|
+
n.kind === "startsWith" ? e.data.startsWith(n.value) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3317
3317
|
code: f.ZodIssueCode.invalid_string,
|
|
3318
3318
|
validation: { startsWith: n.value },
|
|
3319
3319
|
message: n.message
|
|
3320
|
-
}), r.dirty()) : n.kind === "endsWith" ? e.data.endsWith(n.value) || (i = this._getOrReturnCtx(e, i), (0,
|
|
3320
|
+
}), r.dirty()) : n.kind === "endsWith" ? e.data.endsWith(n.value) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3321
3321
|
code: f.ZodIssueCode.invalid_string,
|
|
3322
3322
|
validation: { endsWith: n.value },
|
|
3323
3323
|
message: n.message
|
|
3324
|
-
}), r.dirty()) : n.kind === "datetime" ?
|
|
3324
|
+
}), r.dirty()) : n.kind === "datetime" ? Cr(n).test(e.data) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3325
3325
|
code: f.ZodIssueCode.invalid_string,
|
|
3326
3326
|
validation: "datetime",
|
|
3327
3327
|
message: n.message
|
|
3328
|
-
}), r.dirty()) : n.kind === "date" ?
|
|
3328
|
+
}), r.dirty()) : n.kind === "date" ? Bs.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3329
3329
|
code: f.ZodIssueCode.invalid_string,
|
|
3330
3330
|
validation: "date",
|
|
3331
3331
|
message: n.message
|
|
3332
|
-
}), r.dirty()) : n.kind === "time" ?
|
|
3332
|
+
}), r.dirty()) : n.kind === "time" ? Ws(n).test(e.data) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3333
3333
|
code: f.ZodIssueCode.invalid_string,
|
|
3334
3334
|
validation: "time",
|
|
3335
3335
|
message: n.message
|
|
3336
|
-
}), r.dirty()) : n.kind === "duration" ?
|
|
3336
|
+
}), r.dirty()) : n.kind === "duration" ? Ds.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3337
3337
|
validation: "duration",
|
|
3338
3338
|
code: f.ZodIssueCode.invalid_string,
|
|
3339
3339
|
message: n.message
|
|
3340
|
-
}), r.dirty()) : n.kind === "ip" ?
|
|
3340
|
+
}), r.dirty()) : n.kind === "ip" ? zs(e.data, n.version) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3341
3341
|
validation: "ip",
|
|
3342
3342
|
code: f.ZodIssueCode.invalid_string,
|
|
3343
3343
|
message: n.message
|
|
3344
|
-
}), r.dirty()) : n.kind === "jwt" ?
|
|
3344
|
+
}), r.dirty()) : n.kind === "jwt" ? Gs(e.data, n.alg) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3345
3345
|
validation: "jwt",
|
|
3346
3346
|
code: f.ZodIssueCode.invalid_string,
|
|
3347
3347
|
message: n.message
|
|
3348
|
-
}), r.dirty()) : n.kind === "cidr" ?
|
|
3348
|
+
}), r.dirty()) : n.kind === "cidr" ? Js(e.data, n.version) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3349
3349
|
validation: "cidr",
|
|
3350
3350
|
code: f.ZodIssueCode.invalid_string,
|
|
3351
3351
|
message: n.message
|
|
3352
|
-
}), r.dirty()) : n.kind === "base64" ?
|
|
3352
|
+
}), r.dirty()) : n.kind === "base64" ? Fs.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3353
3353
|
validation: "base64",
|
|
3354
3354
|
code: f.ZodIssueCode.invalid_string,
|
|
3355
3355
|
message: n.message
|
|
3356
|
-
}), r.dirty()) : n.kind === "base64url" ?
|
|
3356
|
+
}), r.dirty()) : n.kind === "base64url" ? Hs.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3357
3357
|
validation: "base64url",
|
|
3358
3358
|
code: f.ZodIssueCode.invalid_string,
|
|
3359
3359
|
message: n.message
|
|
@@ -3583,23 +3583,23 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3583
3583
|
return e;
|
|
3584
3584
|
}
|
|
3585
3585
|
};
|
|
3586
|
-
|
|
3587
|
-
|
|
3586
|
+
u.ZodString = K;
|
|
3587
|
+
K.create = (s) => {
|
|
3588
3588
|
var e;
|
|
3589
|
-
return new
|
|
3589
|
+
return new K({
|
|
3590
3590
|
checks: [],
|
|
3591
3591
|
typeName: _.ZodString,
|
|
3592
3592
|
coerce: (e = s?.coerce) !== null && e !== void 0 ? e : !1,
|
|
3593
|
-
...
|
|
3593
|
+
...v(s)
|
|
3594
3594
|
});
|
|
3595
3595
|
};
|
|
3596
|
-
function
|
|
3596
|
+
function Ys(s, e) {
|
|
3597
3597
|
let t = (s.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, i = t > r ? t : r, n = parseInt(s.toFixed(
|
|
3598
|
-
i).replace(".", "")),
|
|
3599
|
-
return n %
|
|
3598
|
+
i).replace(".", "")), a = parseInt(e.toFixed(i).replace(".", ""));
|
|
3599
|
+
return n % a / Math.pow(10, i);
|
|
3600
3600
|
}
|
|
3601
|
-
d(
|
|
3602
|
-
var
|
|
3601
|
+
d(Ys, "floatSafeRemainder");
|
|
3602
|
+
var re = class s extends b {
|
|
3603
3603
|
static {
|
|
3604
3604
|
d(this, "ZodNumber");
|
|
3605
3605
|
}
|
|
@@ -3609,20 +3609,20 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3609
3609
|
_parse(e) {
|
|
3610
3610
|
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== m.ZodParsedType.number) {
|
|
3611
3611
|
let n = this._getOrReturnCtx(e);
|
|
3612
|
-
return (0,
|
|
3612
|
+
return (0, l.addIssueToContext)(n, {
|
|
3613
3613
|
code: f.ZodIssueCode.invalid_type,
|
|
3614
3614
|
expected: m.ZodParsedType.number,
|
|
3615
3615
|
received: n.parsedType
|
|
3616
|
-
}),
|
|
3616
|
+
}), l.INVALID;
|
|
3617
3617
|
}
|
|
3618
|
-
let r, i = new
|
|
3618
|
+
let r, i = new l.ParseStatus();
|
|
3619
3619
|
for (let n of this._def.checks)
|
|
3620
|
-
n.kind === "int" ? m.util.isInteger(e.data) || (r = this._getOrReturnCtx(e, r), (0,
|
|
3620
|
+
n.kind === "int" ? m.util.isInteger(e.data) || (r = this._getOrReturnCtx(e, r), (0, l.addIssueToContext)(r, {
|
|
3621
3621
|
code: f.ZodIssueCode.invalid_type,
|
|
3622
3622
|
expected: "integer",
|
|
3623
3623
|
received: "float",
|
|
3624
3624
|
message: n.message
|
|
3625
|
-
}), i.dirty()) : n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (r = this._getOrReturnCtx(e, r), (0,
|
|
3625
|
+
}), i.dirty()) : n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (r = this._getOrReturnCtx(e, r), (0, l.addIssueToContext)(
|
|
3626
3626
|
r, {
|
|
3627
3627
|
code: f.ZodIssueCode.too_small,
|
|
3628
3628
|
minimum: n.value,
|
|
@@ -3630,7 +3630,7 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3630
3630
|
inclusive: n.inclusive,
|
|
3631
3631
|
exact: !1,
|
|
3632
3632
|
message: n.message
|
|
3633
|
-
}), i.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (r = this._getOrReturnCtx(e, r), (0,
|
|
3633
|
+
}), i.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (r = this._getOrReturnCtx(e, r), (0, l.addIssueToContext)(
|
|
3634
3634
|
r, {
|
|
3635
3635
|
code: f.ZodIssueCode.too_big,
|
|
3636
3636
|
maximum: n.value,
|
|
@@ -3638,12 +3638,12 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3638
3638
|
inclusive: n.inclusive,
|
|
3639
3639
|
exact: !1,
|
|
3640
3640
|
message: n.message
|
|
3641
|
-
}), i.dirty()) : n.kind === "multipleOf" ?
|
|
3641
|
+
}), i.dirty()) : n.kind === "multipleOf" ? Ys(e.data, n.value) !== 0 && (r = this._getOrReturnCtx(e, r), (0, l.addIssueToContext)(r,
|
|
3642
3642
|
{
|
|
3643
3643
|
code: f.ZodIssueCode.not_multiple_of,
|
|
3644
3644
|
multipleOf: n.value,
|
|
3645
3645
|
message: n.message
|
|
3646
|
-
}), i.dirty()) : n.kind === "finite" ? Number.isFinite(e.data) || (r = this._getOrReturnCtx(e, r), (0,
|
|
3646
|
+
}), i.dirty()) : n.kind === "finite" ? Number.isFinite(e.data) || (r = this._getOrReturnCtx(e, r), (0, l.addIssueToContext)(r, {
|
|
3647
3647
|
code: f.ZodIssueCode.not_finite,
|
|
3648
3648
|
message: n.message
|
|
3649
3649
|
}), i.dirty()) : m.util.assertNever(n);
|
|
@@ -3770,14 +3770,14 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3770
3770
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
3771
3771
|
}
|
|
3772
3772
|
};
|
|
3773
|
-
|
|
3774
|
-
|
|
3773
|
+
u.ZodNumber = re;
|
|
3774
|
+
re.create = (s) => new re({
|
|
3775
3775
|
checks: [],
|
|
3776
3776
|
typeName: _.ZodNumber,
|
|
3777
3777
|
coerce: s?.coerce || !1,
|
|
3778
|
-
...
|
|
3778
|
+
...v(s)
|
|
3779
3779
|
});
|
|
3780
|
-
var
|
|
3780
|
+
var se = class s extends b {
|
|
3781
3781
|
static {
|
|
3782
3782
|
d(this, "ZodBigInt");
|
|
3783
3783
|
}
|
|
@@ -3793,23 +3793,23 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3793
3793
|
}
|
|
3794
3794
|
if (this._getType(e) !== m.ZodParsedType.bigint)
|
|
3795
3795
|
return this._getInvalidInput(e);
|
|
3796
|
-
let r, i = new
|
|
3796
|
+
let r, i = new l.ParseStatus();
|
|
3797
3797
|
for (let n of this._def.checks)
|
|
3798
|
-
n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (r = this._getOrReturnCtx(e, r), (0,
|
|
3798
|
+
n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (r = this._getOrReturnCtx(e, r), (0, l.addIssueToContext)(
|
|
3799
3799
|
r, {
|
|
3800
3800
|
code: f.ZodIssueCode.too_small,
|
|
3801
3801
|
type: "bigint",
|
|
3802
3802
|
minimum: n.value,
|
|
3803
3803
|
inclusive: n.inclusive,
|
|
3804
3804
|
message: n.message
|
|
3805
|
-
}), i.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (r = this._getOrReturnCtx(e, r), (0,
|
|
3805
|
+
}), i.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (r = this._getOrReturnCtx(e, r), (0, l.addIssueToContext)(
|
|
3806
3806
|
r, {
|
|
3807
3807
|
code: f.ZodIssueCode.too_big,
|
|
3808
3808
|
type: "bigint",
|
|
3809
3809
|
maximum: n.value,
|
|
3810
3810
|
inclusive: n.inclusive,
|
|
3811
3811
|
message: n.message
|
|
3812
|
-
}), i.dirty()) : n.kind === "multipleOf" ? e.data % n.value !== BigInt(0) && (r = this._getOrReturnCtx(e, r), (0,
|
|
3812
|
+
}), i.dirty()) : n.kind === "multipleOf" ? e.data % n.value !== BigInt(0) && (r = this._getOrReturnCtx(e, r), (0, l.addIssueToContext)(
|
|
3813
3813
|
r, {
|
|
3814
3814
|
code: f.ZodIssueCode.not_multiple_of,
|
|
3815
3815
|
multipleOf: n.value,
|
|
@@ -3819,11 +3819,11 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3819
3819
|
}
|
|
3820
3820
|
_getInvalidInput(e) {
|
|
3821
3821
|
let t = this._getOrReturnCtx(e);
|
|
3822
|
-
return (0,
|
|
3822
|
+
return (0, l.addIssueToContext)(t, {
|
|
3823
3823
|
code: f.ZodIssueCode.invalid_type,
|
|
3824
3824
|
expected: m.ZodParsedType.bigint,
|
|
3825
3825
|
received: t.parsedType
|
|
3826
|
-
}),
|
|
3826
|
+
}), l.INVALID;
|
|
3827
3827
|
}
|
|
3828
3828
|
gte(e, t) {
|
|
3829
3829
|
return this.setLimit("min", e, !0, g.errorUtil.toString(t));
|
|
@@ -3909,67 +3909,67 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3909
3909
|
return e;
|
|
3910
3910
|
}
|
|
3911
3911
|
};
|
|
3912
|
-
|
|
3913
|
-
|
|
3912
|
+
u.ZodBigInt = se;
|
|
3913
|
+
se.create = (s) => {
|
|
3914
3914
|
var e;
|
|
3915
|
-
return new
|
|
3915
|
+
return new se({
|
|
3916
3916
|
checks: [],
|
|
3917
3917
|
typeName: _.ZodBigInt,
|
|
3918
3918
|
coerce: (e = s?.coerce) !== null && e !== void 0 ? e : !1,
|
|
3919
|
-
...
|
|
3919
|
+
...v(s)
|
|
3920
3920
|
});
|
|
3921
3921
|
};
|
|
3922
|
-
var
|
|
3922
|
+
var ie = class extends b {
|
|
3923
3923
|
static {
|
|
3924
3924
|
d(this, "ZodBoolean");
|
|
3925
3925
|
}
|
|
3926
3926
|
_parse(e) {
|
|
3927
3927
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== m.ZodParsedType.boolean) {
|
|
3928
3928
|
let r = this._getOrReturnCtx(e);
|
|
3929
|
-
return (0,
|
|
3929
|
+
return (0, l.addIssueToContext)(r, {
|
|
3930
3930
|
code: f.ZodIssueCode.invalid_type,
|
|
3931
3931
|
expected: m.ZodParsedType.boolean,
|
|
3932
3932
|
received: r.parsedType
|
|
3933
|
-
}),
|
|
3933
|
+
}), l.INVALID;
|
|
3934
3934
|
}
|
|
3935
|
-
return (0,
|
|
3935
|
+
return (0, l.OK)(e.data);
|
|
3936
3936
|
}
|
|
3937
3937
|
};
|
|
3938
|
-
|
|
3939
|
-
|
|
3938
|
+
u.ZodBoolean = ie;
|
|
3939
|
+
ie.create = (s) => new ie({
|
|
3940
3940
|
typeName: _.ZodBoolean,
|
|
3941
3941
|
coerce: s?.coerce || !1,
|
|
3942
|
-
...
|
|
3942
|
+
...v(s)
|
|
3943
3943
|
});
|
|
3944
|
-
var
|
|
3944
|
+
var ne = class s extends b {
|
|
3945
3945
|
static {
|
|
3946
3946
|
d(this, "ZodDate");
|
|
3947
3947
|
}
|
|
3948
3948
|
_parse(e) {
|
|
3949
3949
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== m.ZodParsedType.date) {
|
|
3950
3950
|
let n = this._getOrReturnCtx(e);
|
|
3951
|
-
return (0,
|
|
3951
|
+
return (0, l.addIssueToContext)(n, {
|
|
3952
3952
|
code: f.ZodIssueCode.invalid_type,
|
|
3953
3953
|
expected: m.ZodParsedType.date,
|
|
3954
3954
|
received: n.parsedType
|
|
3955
|
-
}),
|
|
3955
|
+
}), l.INVALID;
|
|
3956
3956
|
}
|
|
3957
3957
|
if (isNaN(e.data.getTime())) {
|
|
3958
3958
|
let n = this._getOrReturnCtx(e);
|
|
3959
|
-
return (0,
|
|
3959
|
+
return (0, l.addIssueToContext)(n, {
|
|
3960
3960
|
code: f.ZodIssueCode.invalid_date
|
|
3961
|
-
}),
|
|
3961
|
+
}), l.INVALID;
|
|
3962
3962
|
}
|
|
3963
|
-
let r = new
|
|
3963
|
+
let r = new l.ParseStatus(), i;
|
|
3964
3964
|
for (let n of this._def.checks)
|
|
3965
|
-
n.kind === "min" ? e.data.getTime() < n.value && (i = this._getOrReturnCtx(e, i), (0,
|
|
3965
|
+
n.kind === "min" ? e.data.getTime() < n.value && (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3966
3966
|
code: f.ZodIssueCode.too_small,
|
|
3967
3967
|
message: n.message,
|
|
3968
3968
|
inclusive: !0,
|
|
3969
3969
|
exact: !1,
|
|
3970
3970
|
minimum: n.value,
|
|
3971
3971
|
type: "date"
|
|
3972
|
-
}), r.dirty()) : n.kind === "max" ? e.data.getTime() > n.value && (i = this._getOrReturnCtx(e, i), (0,
|
|
3972
|
+
}), r.dirty()) : n.kind === "max" ? e.data.getTime() > n.value && (i = this._getOrReturnCtx(e, i), (0, l.addIssueToContext)(i, {
|
|
3973
3973
|
code: f.ZodIssueCode.too_big,
|
|
3974
3974
|
message: n.message,
|
|
3975
3975
|
inclusive: !0,
|
|
@@ -4015,77 +4015,77 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4015
4015
|
return e != null ? new Date(e) : null;
|
|
4016
4016
|
}
|
|
4017
4017
|
};
|
|
4018
|
-
|
|
4019
|
-
|
|
4018
|
+
u.ZodDate = ne;
|
|
4019
|
+
ne.create = (s) => new ne({
|
|
4020
4020
|
checks: [],
|
|
4021
4021
|
coerce: s?.coerce || !1,
|
|
4022
4022
|
typeName: _.ZodDate,
|
|
4023
|
-
...
|
|
4023
|
+
...v(s)
|
|
4024
4024
|
});
|
|
4025
|
-
var
|
|
4025
|
+
var ve = class extends b {
|
|
4026
4026
|
static {
|
|
4027
4027
|
d(this, "ZodSymbol");
|
|
4028
4028
|
}
|
|
4029
4029
|
_parse(e) {
|
|
4030
4030
|
if (this._getType(e) !== m.ZodParsedType.symbol) {
|
|
4031
4031
|
let r = this._getOrReturnCtx(e);
|
|
4032
|
-
return (0,
|
|
4032
|
+
return (0, l.addIssueToContext)(r, {
|
|
4033
4033
|
code: f.ZodIssueCode.invalid_type,
|
|
4034
4034
|
expected: m.ZodParsedType.symbol,
|
|
4035
4035
|
received: r.parsedType
|
|
4036
|
-
}),
|
|
4036
|
+
}), l.INVALID;
|
|
4037
4037
|
}
|
|
4038
|
-
return (0,
|
|
4038
|
+
return (0, l.OK)(e.data);
|
|
4039
4039
|
}
|
|
4040
4040
|
};
|
|
4041
|
-
|
|
4042
|
-
|
|
4041
|
+
u.ZodSymbol = ve;
|
|
4042
|
+
ve.create = (s) => new ve({
|
|
4043
4043
|
typeName: _.ZodSymbol,
|
|
4044
|
-
...
|
|
4044
|
+
...v(s)
|
|
4045
4045
|
});
|
|
4046
|
-
var
|
|
4046
|
+
var ae = class extends b {
|
|
4047
4047
|
static {
|
|
4048
4048
|
d(this, "ZodUndefined");
|
|
4049
4049
|
}
|
|
4050
4050
|
_parse(e) {
|
|
4051
4051
|
if (this._getType(e) !== m.ZodParsedType.undefined) {
|
|
4052
4052
|
let r = this._getOrReturnCtx(e);
|
|
4053
|
-
return (0,
|
|
4053
|
+
return (0, l.addIssueToContext)(r, {
|
|
4054
4054
|
code: f.ZodIssueCode.invalid_type,
|
|
4055
4055
|
expected: m.ZodParsedType.undefined,
|
|
4056
4056
|
received: r.parsedType
|
|
4057
|
-
}),
|
|
4057
|
+
}), l.INVALID;
|
|
4058
4058
|
}
|
|
4059
|
-
return (0,
|
|
4059
|
+
return (0, l.OK)(e.data);
|
|
4060
4060
|
}
|
|
4061
4061
|
};
|
|
4062
|
-
|
|
4063
|
-
|
|
4062
|
+
u.ZodUndefined = ae;
|
|
4063
|
+
ae.create = (s) => new ae({
|
|
4064
4064
|
typeName: _.ZodUndefined,
|
|
4065
|
-
...
|
|
4065
|
+
...v(s)
|
|
4066
4066
|
});
|
|
4067
|
-
var oe = class extends
|
|
4067
|
+
var oe = class extends b {
|
|
4068
4068
|
static {
|
|
4069
4069
|
d(this, "ZodNull");
|
|
4070
4070
|
}
|
|
4071
4071
|
_parse(e) {
|
|
4072
4072
|
if (this._getType(e) !== m.ZodParsedType.null) {
|
|
4073
4073
|
let r = this._getOrReturnCtx(e);
|
|
4074
|
-
return (0,
|
|
4074
|
+
return (0, l.addIssueToContext)(r, {
|
|
4075
4075
|
code: f.ZodIssueCode.invalid_type,
|
|
4076
4076
|
expected: m.ZodParsedType.null,
|
|
4077
4077
|
received: r.parsedType
|
|
4078
|
-
}),
|
|
4078
|
+
}), l.INVALID;
|
|
4079
4079
|
}
|
|
4080
|
-
return (0,
|
|
4080
|
+
return (0, l.OK)(e.data);
|
|
4081
4081
|
}
|
|
4082
4082
|
};
|
|
4083
|
-
|
|
4083
|
+
u.ZodNull = oe;
|
|
4084
4084
|
oe.create = (s) => new oe({
|
|
4085
4085
|
typeName: _.ZodNull,
|
|
4086
|
-
...
|
|
4086
|
+
...v(s)
|
|
4087
4087
|
});
|
|
4088
|
-
var
|
|
4088
|
+
var X = class extends b {
|
|
4089
4089
|
static {
|
|
4090
4090
|
d(this, "ZodAny");
|
|
4091
4091
|
}
|
|
@@ -4093,15 +4093,15 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4093
4093
|
super(...arguments), this._any = !0;
|
|
4094
4094
|
}
|
|
4095
4095
|
_parse(e) {
|
|
4096
|
-
return (0,
|
|
4096
|
+
return (0, l.OK)(e.data);
|
|
4097
4097
|
}
|
|
4098
4098
|
};
|
|
4099
|
-
|
|
4100
|
-
|
|
4099
|
+
u.ZodAny = X;
|
|
4100
|
+
X.create = (s) => new X({
|
|
4101
4101
|
typeName: _.ZodAny,
|
|
4102
|
-
...
|
|
4102
|
+
...v(s)
|
|
4103
4103
|
});
|
|
4104
|
-
var
|
|
4104
|
+
var H = class extends b {
|
|
4105
4105
|
static {
|
|
4106
4106
|
d(this, "ZodUnknown");
|
|
4107
4107
|
}
|
|
@@ -4109,85 +4109,85 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4109
4109
|
super(...arguments), this._unknown = !0;
|
|
4110
4110
|
}
|
|
4111
4111
|
_parse(e) {
|
|
4112
|
-
return (0,
|
|
4112
|
+
return (0, l.OK)(e.data);
|
|
4113
4113
|
}
|
|
4114
4114
|
};
|
|
4115
|
-
|
|
4116
|
-
|
|
4115
|
+
u.ZodUnknown = H;
|
|
4116
|
+
H.create = (s) => new H({
|
|
4117
4117
|
typeName: _.ZodUnknown,
|
|
4118
|
-
...
|
|
4118
|
+
...v(s)
|
|
4119
4119
|
});
|
|
4120
|
-
var
|
|
4120
|
+
var $ = class extends b {
|
|
4121
4121
|
static {
|
|
4122
4122
|
d(this, "ZodNever");
|
|
4123
4123
|
}
|
|
4124
4124
|
_parse(e) {
|
|
4125
4125
|
let t = this._getOrReturnCtx(e);
|
|
4126
|
-
return (0,
|
|
4126
|
+
return (0, l.addIssueToContext)(t, {
|
|
4127
4127
|
code: f.ZodIssueCode.invalid_type,
|
|
4128
4128
|
expected: m.ZodParsedType.never,
|
|
4129
4129
|
received: t.parsedType
|
|
4130
|
-
}),
|
|
4130
|
+
}), l.INVALID;
|
|
4131
4131
|
}
|
|
4132
4132
|
};
|
|
4133
|
-
|
|
4134
|
-
|
|
4133
|
+
u.ZodNever = $;
|
|
4134
|
+
$.create = (s) => new $({
|
|
4135
4135
|
typeName: _.ZodNever,
|
|
4136
|
-
...
|
|
4136
|
+
...v(s)
|
|
4137
4137
|
});
|
|
4138
|
-
var be = class extends
|
|
4138
|
+
var be = class extends b {
|
|
4139
4139
|
static {
|
|
4140
4140
|
d(this, "ZodVoid");
|
|
4141
4141
|
}
|
|
4142
4142
|
_parse(e) {
|
|
4143
4143
|
if (this._getType(e) !== m.ZodParsedType.undefined) {
|
|
4144
4144
|
let r = this._getOrReturnCtx(e);
|
|
4145
|
-
return (0,
|
|
4145
|
+
return (0, l.addIssueToContext)(r, {
|
|
4146
4146
|
code: f.ZodIssueCode.invalid_type,
|
|
4147
4147
|
expected: m.ZodParsedType.void,
|
|
4148
4148
|
received: r.parsedType
|
|
4149
|
-
}),
|
|
4149
|
+
}), l.INVALID;
|
|
4150
4150
|
}
|
|
4151
|
-
return (0,
|
|
4151
|
+
return (0, l.OK)(e.data);
|
|
4152
4152
|
}
|
|
4153
4153
|
};
|
|
4154
|
-
|
|
4154
|
+
u.ZodVoid = be;
|
|
4155
4155
|
be.create = (s) => new be({
|
|
4156
4156
|
typeName: _.ZodVoid,
|
|
4157
|
-
...
|
|
4157
|
+
...v(s)
|
|
4158
4158
|
});
|
|
4159
|
-
var B = class s extends
|
|
4159
|
+
var B = class s extends b {
|
|
4160
4160
|
static {
|
|
4161
4161
|
d(this, "ZodArray");
|
|
4162
4162
|
}
|
|
4163
4163
|
_parse(e) {
|
|
4164
4164
|
let { ctx: t, status: r } = this._processInputParams(e), i = this._def;
|
|
4165
4165
|
if (t.parsedType !== m.ZodParsedType.array)
|
|
4166
|
-
return (0,
|
|
4166
|
+
return (0, l.addIssueToContext)(t, {
|
|
4167
4167
|
code: f.ZodIssueCode.invalid_type,
|
|
4168
4168
|
expected: m.ZodParsedType.array,
|
|
4169
4169
|
received: t.parsedType
|
|
4170
|
-
}),
|
|
4170
|
+
}), l.INVALID;
|
|
4171
4171
|
if (i.exactLength !== null) {
|
|
4172
|
-
let
|
|
4173
|
-
(
|
|
4174
|
-
code:
|
|
4175
|
-
minimum:
|
|
4176
|
-
maximum:
|
|
4172
|
+
let a = t.data.length > i.exactLength.value, o = t.data.length < i.exactLength.value;
|
|
4173
|
+
(a || o) && ((0, l.addIssueToContext)(t, {
|
|
4174
|
+
code: a ? f.ZodIssueCode.too_big : f.ZodIssueCode.too_small,
|
|
4175
|
+
minimum: o ? i.exactLength.value : void 0,
|
|
4176
|
+
maximum: a ? i.exactLength.value : void 0,
|
|
4177
4177
|
type: "array",
|
|
4178
4178
|
inclusive: !0,
|
|
4179
4179
|
exact: !0,
|
|
4180
4180
|
message: i.exactLength.message
|
|
4181
4181
|
}), r.dirty());
|
|
4182
4182
|
}
|
|
4183
|
-
if (i.minLength !== null && t.data.length < i.minLength.value && ((0,
|
|
4183
|
+
if (i.minLength !== null && t.data.length < i.minLength.value && ((0, l.addIssueToContext)(t, {
|
|
4184
4184
|
code: f.ZodIssueCode.too_small,
|
|
4185
4185
|
minimum: i.minLength.value,
|
|
4186
4186
|
type: "array",
|
|
4187
4187
|
inclusive: !0,
|
|
4188
4188
|
exact: !1,
|
|
4189
4189
|
message: i.minLength.message
|
|
4190
|
-
}), r.dirty()), i.maxLength !== null && t.data.length > i.maxLength.value && ((0,
|
|
4190
|
+
}), r.dirty()), i.maxLength !== null && t.data.length > i.maxLength.value && ((0, l.addIssueToContext)(t, {
|
|
4191
4191
|
code: f.ZodIssueCode.too_big,
|
|
4192
4192
|
maximum: i.maxLength.value,
|
|
4193
4193
|
type: "array",
|
|
@@ -4195,9 +4195,9 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4195
4195
|
exact: !1,
|
|
4196
4196
|
message: i.maxLength.message
|
|
4197
4197
|
}), r.dirty()), t.common.async)
|
|
4198
|
-
return Promise.all([...t.data].map((
|
|
4199
|
-
let n = [...t.data].map((
|
|
4200
|
-
return
|
|
4198
|
+
return Promise.all([...t.data].map((a, o) => i.type._parseAsync(new N(t, a, t.path, o)))).then((a) => l.ParseStatus.mergeArray(r, a));
|
|
4199
|
+
let n = [...t.data].map((a, o) => i.type._parseSync(new N(t, a, t.path, o)));
|
|
4200
|
+
return l.ParseStatus.mergeArray(r, n);
|
|
4201
4201
|
}
|
|
4202
4202
|
get element() {
|
|
4203
4203
|
return this._def.type;
|
|
@@ -4224,34 +4224,34 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4224
4224
|
return this.min(1, e);
|
|
4225
4225
|
}
|
|
4226
4226
|
};
|
|
4227
|
-
|
|
4227
|
+
u.ZodArray = B;
|
|
4228
4228
|
B.create = (s, e) => new B({
|
|
4229
4229
|
type: s,
|
|
4230
4230
|
minLength: null,
|
|
4231
4231
|
maxLength: null,
|
|
4232
4232
|
exactLength: null,
|
|
4233
4233
|
typeName: _.ZodArray,
|
|
4234
|
-
...
|
|
4234
|
+
...v(e)
|
|
4235
4235
|
});
|
|
4236
|
-
function
|
|
4237
|
-
if (s instanceof
|
|
4236
|
+
function _e(s) {
|
|
4237
|
+
if (s instanceof A) {
|
|
4238
4238
|
let e = {};
|
|
4239
4239
|
for (let t in s.shape) {
|
|
4240
4240
|
let r = s.shape[t];
|
|
4241
|
-
e[t] =
|
|
4241
|
+
e[t] = P.create(_e(r));
|
|
4242
4242
|
}
|
|
4243
|
-
return new
|
|
4243
|
+
return new A({
|
|
4244
4244
|
...s._def,
|
|
4245
4245
|
shape: /* @__PURE__ */ d(() => e, "shape")
|
|
4246
4246
|
});
|
|
4247
4247
|
} else return s instanceof B ? new B({
|
|
4248
4248
|
...s._def,
|
|
4249
|
-
type:
|
|
4250
|
-
}) : s instanceof
|
|
4249
|
+
type: _e(s.element)
|
|
4250
|
+
}) : s instanceof P ? P.create(_e(s.unwrap())) : s instanceof q ? q.create(_e(s.unwrap())) : s instanceof L ? L.create(s.items.map((e) => _e(
|
|
4251
4251
|
e))) : s;
|
|
4252
4252
|
}
|
|
4253
|
-
d(
|
|
4254
|
-
var
|
|
4253
|
+
d(_e, "deepPartialify");
|
|
4254
|
+
var A = class s extends b {
|
|
4255
4255
|
static {
|
|
4256
4256
|
d(this, "ZodObject");
|
|
4257
4257
|
}
|
|
@@ -4267,48 +4267,48 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4267
4267
|
_parse(e) {
|
|
4268
4268
|
if (this._getType(e) !== m.ZodParsedType.object) {
|
|
4269
4269
|
let h = this._getOrReturnCtx(e);
|
|
4270
|
-
return (0,
|
|
4270
|
+
return (0, l.addIssueToContext)(h, {
|
|
4271
4271
|
code: f.ZodIssueCode.invalid_type,
|
|
4272
4272
|
expected: m.ZodParsedType.object,
|
|
4273
4273
|
received: h.parsedType
|
|
4274
|
-
}),
|
|
4274
|
+
}), l.INVALID;
|
|
4275
4275
|
}
|
|
4276
|
-
let { status: r, ctx: i } = this._processInputParams(e), { shape: n, keys:
|
|
4277
|
-
if (!(this._def.catchall instanceof
|
|
4276
|
+
let { status: r, ctx: i } = this._processInputParams(e), { shape: n, keys: a } = this._getCached(), o = [];
|
|
4277
|
+
if (!(this._def.catchall instanceof $ && this._def.unknownKeys === "strip"))
|
|
4278
4278
|
for (let h in i.data)
|
|
4279
|
-
|
|
4280
|
-
let
|
|
4281
|
-
for (let h of
|
|
4279
|
+
a.includes(h) || o.push(h);
|
|
4280
|
+
let c = [];
|
|
4281
|
+
for (let h of a) {
|
|
4282
4282
|
let p = n[h], y = i.data[h];
|
|
4283
|
-
|
|
4283
|
+
c.push({
|
|
4284
4284
|
key: { status: "valid", value: h },
|
|
4285
|
-
value: p._parse(new
|
|
4285
|
+
value: p._parse(new N(i, y, i.path, h)),
|
|
4286
4286
|
alwaysSet: h in i.data
|
|
4287
4287
|
});
|
|
4288
4288
|
}
|
|
4289
|
-
if (this._def.catchall instanceof
|
|
4289
|
+
if (this._def.catchall instanceof $) {
|
|
4290
4290
|
let h = this._def.unknownKeys;
|
|
4291
4291
|
if (h === "passthrough")
|
|
4292
|
-
for (let p of
|
|
4293
|
-
|
|
4292
|
+
for (let p of o)
|
|
4293
|
+
c.push({
|
|
4294
4294
|
key: { status: "valid", value: p },
|
|
4295
4295
|
value: { status: "valid", value: i.data[p] }
|
|
4296
4296
|
});
|
|
4297
4297
|
else if (h === "strict")
|
|
4298
|
-
|
|
4298
|
+
o.length > 0 && ((0, l.addIssueToContext)(i, {
|
|
4299
4299
|
code: f.ZodIssueCode.unrecognized_keys,
|
|
4300
|
-
keys:
|
|
4300
|
+
keys: o
|
|
4301
4301
|
}), r.dirty());
|
|
4302
4302
|
else if (h !== "strip")
|
|
4303
4303
|
throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
4304
4304
|
} else {
|
|
4305
4305
|
let h = this._def.catchall;
|
|
4306
|
-
for (let p of
|
|
4306
|
+
for (let p of o) {
|
|
4307
4307
|
let y = i.data[p];
|
|
4308
|
-
|
|
4308
|
+
c.push({
|
|
4309
4309
|
key: { status: "valid", value: p },
|
|
4310
4310
|
value: h._parse(
|
|
4311
|
-
new
|
|
4311
|
+
new N(i, y, i.path, p)
|
|
4312
4312
|
//, ctx.child(key), value, getParsedType(value)
|
|
4313
4313
|
),
|
|
4314
4314
|
alwaysSet: p in i.data
|
|
@@ -4317,16 +4317,16 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4317
4317
|
}
|
|
4318
4318
|
return i.common.async ? Promise.resolve().then(async () => {
|
|
4319
4319
|
let h = [];
|
|
4320
|
-
for (let p of
|
|
4321
|
-
let y = await p.key,
|
|
4320
|
+
for (let p of c) {
|
|
4321
|
+
let y = await p.key, C = await p.value;
|
|
4322
4322
|
h.push({
|
|
4323
4323
|
key: y,
|
|
4324
|
-
value:
|
|
4324
|
+
value: C,
|
|
4325
4325
|
alwaysSet: p.alwaysSet
|
|
4326
4326
|
});
|
|
4327
4327
|
}
|
|
4328
4328
|
return h;
|
|
4329
|
-
}).then((h) =>
|
|
4329
|
+
}).then((h) => l.ParseStatus.mergeObjectSync(r, h)) : l.ParseStatus.mergeObjectSync(r, c);
|
|
4330
4330
|
}
|
|
4331
4331
|
get shape() {
|
|
4332
4332
|
return this._def.shape();
|
|
@@ -4337,13 +4337,13 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4337
4337
|
unknownKeys: "strict",
|
|
4338
4338
|
...e !== void 0 ? {
|
|
4339
4339
|
errorMap: /* @__PURE__ */ d((t, r) => {
|
|
4340
|
-
var i, n,
|
|
4341
|
-
let
|
|
4342
|
-
|
|
4340
|
+
var i, n, a, o;
|
|
4341
|
+
let c = (a = (n = (i = this._def).errorMap) === null || n === void 0 ? void 0 : n.call(i, t, r).message) !== null && a !== void 0 ?
|
|
4342
|
+
a : r.defaultError;
|
|
4343
4343
|
return t.code === "unrecognized_keys" ? {
|
|
4344
|
-
message: (
|
|
4344
|
+
message: (o = g.errorUtil.errToObj(e).message) !== null && o !== void 0 ? o : c
|
|
4345
4345
|
} : {
|
|
4346
|
-
message:
|
|
4346
|
+
message: c
|
|
4347
4347
|
};
|
|
4348
4348
|
}, "errorMap")
|
|
4349
4349
|
} : {}
|
|
@@ -4490,7 +4490,7 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4490
4490
|
* @deprecated
|
|
4491
4491
|
*/
|
|
4492
4492
|
deepPartial() {
|
|
4493
|
-
return
|
|
4493
|
+
return _e(this);
|
|
4494
4494
|
}
|
|
4495
4495
|
partial(e) {
|
|
4496
4496
|
let t = {};
|
|
@@ -4509,7 +4509,7 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4509
4509
|
t[r] = this.shape[r];
|
|
4510
4510
|
else {
|
|
4511
4511
|
let n = this.shape[r];
|
|
4512
|
-
for (; n instanceof
|
|
4512
|
+
for (; n instanceof P; )
|
|
4513
4513
|
n = n._def.innerType;
|
|
4514
4514
|
t[r] = n;
|
|
4515
4515
|
}
|
|
@@ -4519,53 +4519,53 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4519
4519
|
});
|
|
4520
4520
|
}
|
|
4521
4521
|
keyof() {
|
|
4522
|
-
return
|
|
4522
|
+
return kr(m.util.objectKeys(this.shape));
|
|
4523
4523
|
}
|
|
4524
4524
|
};
|
|
4525
|
-
|
|
4526
|
-
|
|
4525
|
+
u.ZodObject = A;
|
|
4526
|
+
A.create = (s, e) => new A({
|
|
4527
4527
|
shape: /* @__PURE__ */ d(() => s, "shape"),
|
|
4528
4528
|
unknownKeys: "strip",
|
|
4529
|
-
catchall:
|
|
4529
|
+
catchall: $.create(),
|
|
4530
4530
|
typeName: _.ZodObject,
|
|
4531
|
-
...
|
|
4531
|
+
...v(e)
|
|
4532
4532
|
});
|
|
4533
|
-
|
|
4533
|
+
A.strictCreate = (s, e) => new A({
|
|
4534
4534
|
shape: /* @__PURE__ */ d(() => s, "shape"),
|
|
4535
4535
|
unknownKeys: "strict",
|
|
4536
|
-
catchall:
|
|
4536
|
+
catchall: $.create(),
|
|
4537
4537
|
typeName: _.ZodObject,
|
|
4538
|
-
...
|
|
4538
|
+
...v(e)
|
|
4539
4539
|
});
|
|
4540
|
-
|
|
4540
|
+
A.lazycreate = (s, e) => new A({
|
|
4541
4541
|
shape: s,
|
|
4542
4542
|
unknownKeys: "strip",
|
|
4543
|
-
catchall:
|
|
4543
|
+
catchall: $.create(),
|
|
4544
4544
|
typeName: _.ZodObject,
|
|
4545
|
-
...
|
|
4545
|
+
...v(e)
|
|
4546
4546
|
});
|
|
4547
|
-
var
|
|
4547
|
+
var de = class extends b {
|
|
4548
4548
|
static {
|
|
4549
4549
|
d(this, "ZodUnion");
|
|
4550
4550
|
}
|
|
4551
4551
|
_parse(e) {
|
|
4552
4552
|
let { ctx: t } = this._processInputParams(e), r = this._def.options;
|
|
4553
4553
|
function i(n) {
|
|
4554
|
-
for (let
|
|
4555
|
-
if (
|
|
4556
|
-
return
|
|
4557
|
-
for (let
|
|
4558
|
-
if (
|
|
4559
|
-
return t.common.issues.push(...
|
|
4560
|
-
let
|
|
4561
|
-
return (0,
|
|
4554
|
+
for (let o of n)
|
|
4555
|
+
if (o.result.status === "valid")
|
|
4556
|
+
return o.result;
|
|
4557
|
+
for (let o of n)
|
|
4558
|
+
if (o.result.status === "dirty")
|
|
4559
|
+
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
4560
|
+
let a = n.map((o) => new f.ZodError(o.ctx.common.issues));
|
|
4561
|
+
return (0, l.addIssueToContext)(t, {
|
|
4562
4562
|
code: f.ZodIssueCode.invalid_union,
|
|
4563
|
-
unionErrors:
|
|
4564
|
-
}),
|
|
4563
|
+
unionErrors: a
|
|
4564
|
+
}), l.INVALID;
|
|
4565
4565
|
}
|
|
4566
4566
|
if (d(i, "handleResults"), t.common.async)
|
|
4567
4567
|
return Promise.all(r.map(async (n) => {
|
|
4568
|
-
let
|
|
4568
|
+
let a = {
|
|
4569
4569
|
...t,
|
|
4570
4570
|
common: {
|
|
4571
4571
|
...t.common,
|
|
@@ -4577,14 +4577,14 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4577
4577
|
result: await n._parseAsync({
|
|
4578
4578
|
data: t.data,
|
|
4579
4579
|
path: t.path,
|
|
4580
|
-
parent:
|
|
4580
|
+
parent: a
|
|
4581
4581
|
}),
|
|
4582
|
-
ctx:
|
|
4582
|
+
ctx: a
|
|
4583
4583
|
};
|
|
4584
4584
|
})).then(i);
|
|
4585
4585
|
{
|
|
4586
|
-
let n,
|
|
4587
|
-
for (let
|
|
4586
|
+
let n, a = [];
|
|
4587
|
+
for (let c of r) {
|
|
4588
4588
|
let h = {
|
|
4589
4589
|
...t,
|
|
4590
4590
|
common: {
|
|
@@ -4592,49 +4592,49 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4592
4592
|
issues: []
|
|
4593
4593
|
},
|
|
4594
4594
|
parent: null
|
|
4595
|
-
}, p =
|
|
4595
|
+
}, p = c._parseSync({
|
|
4596
4596
|
data: t.data,
|
|
4597
4597
|
path: t.path,
|
|
4598
4598
|
parent: h
|
|
4599
4599
|
});
|
|
4600
4600
|
if (p.status === "valid")
|
|
4601
4601
|
return p;
|
|
4602
|
-
p.status === "dirty" && !n && (n = { result: p, ctx: h }), h.common.issues.length &&
|
|
4602
|
+
p.status === "dirty" && !n && (n = { result: p, ctx: h }), h.common.issues.length && a.push(h.common.issues);
|
|
4603
4603
|
}
|
|
4604
4604
|
if (n)
|
|
4605
4605
|
return t.common.issues.push(...n.ctx.common.issues), n.result;
|
|
4606
|
-
let
|
|
4607
|
-
return (0,
|
|
4606
|
+
let o = a.map((c) => new f.ZodError(c));
|
|
4607
|
+
return (0, l.addIssueToContext)(t, {
|
|
4608
4608
|
code: f.ZodIssueCode.invalid_union,
|
|
4609
|
-
unionErrors:
|
|
4610
|
-
}),
|
|
4609
|
+
unionErrors: o
|
|
4610
|
+
}), l.INVALID;
|
|
4611
4611
|
}
|
|
4612
4612
|
}
|
|
4613
4613
|
get options() {
|
|
4614
4614
|
return this._def.options;
|
|
4615
4615
|
}
|
|
4616
4616
|
};
|
|
4617
|
-
|
|
4618
|
-
|
|
4617
|
+
u.ZodUnion = de;
|
|
4618
|
+
de.create = (s, e) => new de({
|
|
4619
4619
|
options: s,
|
|
4620
4620
|
typeName: _.ZodUnion,
|
|
4621
|
-
...
|
|
4621
|
+
...v(e)
|
|
4622
4622
|
});
|
|
4623
|
-
var
|
|
4624
|
-
|
|
4625
|
-
oe ? [null] : s instanceof
|
|
4626
|
-
|
|
4623
|
+
var F = /* @__PURE__ */ d((s) => s instanceof le ? F(s.schema) : s instanceof S ? F(s.innerType()) : s instanceof ce ? [s.value] : s instanceof
|
|
4624
|
+
he ? s.options : s instanceof pe ? m.util.objectValues(s.enum) : s instanceof fe ? F(s._def.innerType) : s instanceof ae ? [void 0] : s instanceof
|
|
4625
|
+
oe ? [null] : s instanceof P ? [void 0, ...F(s.unwrap())] : s instanceof q ? [null, ...F(s.unwrap())] : s instanceof Pe || s instanceof ge ?
|
|
4626
|
+
F(s.unwrap()) : s instanceof me ? F(s._def.innerType) : [], "getDiscriminator"), Ye = class s extends b {
|
|
4627
4627
|
static {
|
|
4628
4628
|
d(this, "ZodDiscriminatedUnion");
|
|
4629
4629
|
}
|
|
4630
4630
|
_parse(e) {
|
|
4631
4631
|
let { ctx: t } = this._processInputParams(e);
|
|
4632
4632
|
if (t.parsedType !== m.ZodParsedType.object)
|
|
4633
|
-
return (0,
|
|
4633
|
+
return (0, l.addIssueToContext)(t, {
|
|
4634
4634
|
code: f.ZodIssueCode.invalid_type,
|
|
4635
4635
|
expected: m.ZodParsedType.object,
|
|
4636
4636
|
received: t.parsedType
|
|
4637
|
-
}),
|
|
4637
|
+
}), l.INVALID;
|
|
4638
4638
|
let r = this.discriminator, i = t.data[r], n = this.optionsMap.get(i);
|
|
4639
4639
|
return n ? t.common.async ? n._parseAsync({
|
|
4640
4640
|
data: t.data,
|
|
@@ -4644,11 +4644,11 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4644
4644
|
data: t.data,
|
|
4645
4645
|
path: t.path,
|
|
4646
4646
|
parent: t
|
|
4647
|
-
}) : ((0,
|
|
4647
|
+
}) : ((0, l.addIssueToContext)(t, {
|
|
4648
4648
|
code: f.ZodIssueCode.invalid_union_discriminator,
|
|
4649
4649
|
options: Array.from(this.optionsMap.keys()),
|
|
4650
4650
|
path: [r]
|
|
4651
|
-
}),
|
|
4651
|
+
}), l.INVALID);
|
|
4652
4652
|
}
|
|
4653
4653
|
get discriminator() {
|
|
4654
4654
|
return this._def.discriminator;
|
|
@@ -4670,13 +4670,13 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4670
4670
|
static create(e, t, r) {
|
|
4671
4671
|
let i = /* @__PURE__ */ new Map();
|
|
4672
4672
|
for (let n of t) {
|
|
4673
|
-
let
|
|
4674
|
-
if (!
|
|
4673
|
+
let a = F(n.shape[e]);
|
|
4674
|
+
if (!a.length)
|
|
4675
4675
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
4676
|
-
for (let
|
|
4677
|
-
if (i.has(
|
|
4678
|
-
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(
|
|
4679
|
-
i.set(
|
|
4676
|
+
for (let o of a) {
|
|
4677
|
+
if (i.has(o))
|
|
4678
|
+
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
|
|
4679
|
+
i.set(o, n);
|
|
4680
4680
|
}
|
|
4681
4681
|
}
|
|
4682
4682
|
return new s({
|
|
@@ -4684,51 +4684,51 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4684
4684
|
discriminator: e,
|
|
4685
4685
|
options: t,
|
|
4686
4686
|
optionsMap: i,
|
|
4687
|
-
...
|
|
4687
|
+
...v(r)
|
|
4688
4688
|
});
|
|
4689
4689
|
}
|
|
4690
4690
|
};
|
|
4691
|
-
|
|
4692
|
-
function
|
|
4691
|
+
u.ZodDiscriminatedUnion = Ye;
|
|
4692
|
+
function Et(s, e) {
|
|
4693
4693
|
let t = (0, m.getParsedType)(s), r = (0, m.getParsedType)(e);
|
|
4694
4694
|
if (s === e)
|
|
4695
4695
|
return { valid: !0, data: s };
|
|
4696
4696
|
if (t === m.ZodParsedType.object && r === m.ZodParsedType.object) {
|
|
4697
|
-
let i = m.util.objectKeys(e), n = m.util.objectKeys(s).filter((
|
|
4698
|
-
for (let
|
|
4699
|
-
let
|
|
4700
|
-
if (!
|
|
4697
|
+
let i = m.util.objectKeys(e), n = m.util.objectKeys(s).filter((o) => i.indexOf(o) !== -1), a = { ...s, ...e };
|
|
4698
|
+
for (let o of n) {
|
|
4699
|
+
let c = Et(s[o], e[o]);
|
|
4700
|
+
if (!c.valid)
|
|
4701
4701
|
return { valid: !1 };
|
|
4702
|
-
o
|
|
4702
|
+
a[o] = c.data;
|
|
4703
4703
|
}
|
|
4704
|
-
return { valid: !0, data:
|
|
4704
|
+
return { valid: !0, data: a };
|
|
4705
4705
|
} else if (t === m.ZodParsedType.array && r === m.ZodParsedType.array) {
|
|
4706
4706
|
if (s.length !== e.length)
|
|
4707
4707
|
return { valid: !1 };
|
|
4708
4708
|
let i = [];
|
|
4709
4709
|
for (let n = 0; n < s.length; n++) {
|
|
4710
|
-
let
|
|
4711
|
-
if (!
|
|
4710
|
+
let a = s[n], o = e[n], c = Et(a, o);
|
|
4711
|
+
if (!c.valid)
|
|
4712
4712
|
return { valid: !1 };
|
|
4713
|
-
i.push(
|
|
4713
|
+
i.push(c.data);
|
|
4714
4714
|
}
|
|
4715
4715
|
return { valid: !0, data: i };
|
|
4716
4716
|
} else return t === m.ZodParsedType.date && r === m.ZodParsedType.date && +s == +e ? { valid: !0, data: s } : { valid: !1 };
|
|
4717
4717
|
}
|
|
4718
|
-
d(
|
|
4719
|
-
var
|
|
4718
|
+
d(Et, "mergeValues");
|
|
4719
|
+
var ue = class extends b {
|
|
4720
4720
|
static {
|
|
4721
4721
|
d(this, "ZodIntersection");
|
|
4722
4722
|
}
|
|
4723
4723
|
_parse(e) {
|
|
4724
|
-
let { status: t, ctx: r } = this._processInputParams(e), i = /* @__PURE__ */ d((n,
|
|
4725
|
-
if ((0,
|
|
4726
|
-
return
|
|
4727
|
-
let
|
|
4728
|
-
return
|
|
4724
|
+
let { status: t, ctx: r } = this._processInputParams(e), i = /* @__PURE__ */ d((n, a) => {
|
|
4725
|
+
if ((0, l.isAborted)(n) || (0, l.isAborted)(a))
|
|
4726
|
+
return l.INVALID;
|
|
4727
|
+
let o = Et(n.value, a.value);
|
|
4728
|
+
return o.valid ? (((0, l.isDirty)(n) || (0, l.isDirty)(a)) && t.dirty(), { status: t.value, value: o.data }) : ((0, l.addIssueToContext)(
|
|
4729
4729
|
r, {
|
|
4730
4730
|
code: f.ZodIssueCode.invalid_intersection_types
|
|
4731
|
-
}),
|
|
4731
|
+
}), l.INVALID);
|
|
4732
4732
|
}, "handleParsed");
|
|
4733
4733
|
return r.common.async ? Promise.all([
|
|
4734
4734
|
this._def.left._parseAsync({
|
|
@@ -4741,7 +4741,7 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4741
4741
|
path: r.path,
|
|
4742
4742
|
parent: r
|
|
4743
4743
|
})
|
|
4744
|
-
]).then(([n,
|
|
4744
|
+
]).then(([n, a]) => i(n, a)) : i(this._def.left._parseSync({
|
|
4745
4745
|
data: r.data,
|
|
4746
4746
|
path: r.path,
|
|
4747
4747
|
parent: r
|
|
@@ -4752,45 +4752,45 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4752
4752
|
}));
|
|
4753
4753
|
}
|
|
4754
4754
|
};
|
|
4755
|
-
|
|
4756
|
-
|
|
4755
|
+
u.ZodIntersection = ue;
|
|
4756
|
+
ue.create = (s, e, t) => new ue({
|
|
4757
4757
|
left: s,
|
|
4758
4758
|
right: e,
|
|
4759
4759
|
typeName: _.ZodIntersection,
|
|
4760
|
-
...
|
|
4760
|
+
...v(t)
|
|
4761
4761
|
});
|
|
4762
|
-
var L = class s extends
|
|
4762
|
+
var L = class s extends b {
|
|
4763
4763
|
static {
|
|
4764
4764
|
d(this, "ZodTuple");
|
|
4765
4765
|
}
|
|
4766
4766
|
_parse(e) {
|
|
4767
4767
|
let { status: t, ctx: r } = this._processInputParams(e);
|
|
4768
4768
|
if (r.parsedType !== m.ZodParsedType.array)
|
|
4769
|
-
return (0,
|
|
4769
|
+
return (0, l.addIssueToContext)(r, {
|
|
4770
4770
|
code: f.ZodIssueCode.invalid_type,
|
|
4771
4771
|
expected: m.ZodParsedType.array,
|
|
4772
4772
|
received: r.parsedType
|
|
4773
|
-
}),
|
|
4773
|
+
}), l.INVALID;
|
|
4774
4774
|
if (r.data.length < this._def.items.length)
|
|
4775
|
-
return (0,
|
|
4775
|
+
return (0, l.addIssueToContext)(r, {
|
|
4776
4776
|
code: f.ZodIssueCode.too_small,
|
|
4777
4777
|
minimum: this._def.items.length,
|
|
4778
4778
|
inclusive: !0,
|
|
4779
4779
|
exact: !1,
|
|
4780
4780
|
type: "array"
|
|
4781
|
-
}),
|
|
4782
|
-
!this._def.rest && r.data.length > this._def.items.length && ((0,
|
|
4781
|
+
}), l.INVALID;
|
|
4782
|
+
!this._def.rest && r.data.length > this._def.items.length && ((0, l.addIssueToContext)(r, {
|
|
4783
4783
|
code: f.ZodIssueCode.too_big,
|
|
4784
4784
|
maximum: this._def.items.length,
|
|
4785
4785
|
inclusive: !0,
|
|
4786
4786
|
exact: !1,
|
|
4787
4787
|
type: "array"
|
|
4788
4788
|
}), t.dirty());
|
|
4789
|
-
let n = [...r.data].map((
|
|
4790
|
-
let
|
|
4791
|
-
return
|
|
4792
|
-
}).filter((
|
|
4793
|
-
return r.common.async ? Promise.all(n).then((
|
|
4789
|
+
let n = [...r.data].map((a, o) => {
|
|
4790
|
+
let c = this._def.items[o] || this._def.rest;
|
|
4791
|
+
return c ? c._parse(new N(r, a, r.path, o)) : null;
|
|
4792
|
+
}).filter((a) => !!a);
|
|
4793
|
+
return r.common.async ? Promise.all(n).then((a) => l.ParseStatus.mergeArray(t, a)) : l.ParseStatus.mergeArray(t, n);
|
|
4794
4794
|
}
|
|
4795
4795
|
get items() {
|
|
4796
4796
|
return this._def.items;
|
|
@@ -4802,7 +4802,7 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4802
4802
|
});
|
|
4803
4803
|
}
|
|
4804
4804
|
};
|
|
4805
|
-
|
|
4805
|
+
u.ZodTuple = L;
|
|
4806
4806
|
L.create = (s, e) => {
|
|
4807
4807
|
if (!Array.isArray(s))
|
|
4808
4808
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
@@ -4810,10 +4810,10 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4810
4810
|
items: s,
|
|
4811
4811
|
typeName: _.ZodTuple,
|
|
4812
4812
|
rest: null,
|
|
4813
|
-
...
|
|
4813
|
+
...v(e)
|
|
4814
4814
|
});
|
|
4815
4815
|
};
|
|
4816
|
-
var
|
|
4816
|
+
var Ke = class s extends b {
|
|
4817
4817
|
static {
|
|
4818
4818
|
d(this, "ZodRecord");
|
|
4819
4819
|
}
|
|
@@ -4826,39 +4826,39 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4826
4826
|
_parse(e) {
|
|
4827
4827
|
let { status: t, ctx: r } = this._processInputParams(e);
|
|
4828
4828
|
if (r.parsedType !== m.ZodParsedType.object)
|
|
4829
|
-
return (0,
|
|
4829
|
+
return (0, l.addIssueToContext)(r, {
|
|
4830
4830
|
code: f.ZodIssueCode.invalid_type,
|
|
4831
4831
|
expected: m.ZodParsedType.object,
|
|
4832
4832
|
received: r.parsedType
|
|
4833
|
-
}),
|
|
4834
|
-
let i = [], n = this._def.keyType,
|
|
4835
|
-
for (let
|
|
4833
|
+
}), l.INVALID;
|
|
4834
|
+
let i = [], n = this._def.keyType, a = this._def.valueType;
|
|
4835
|
+
for (let o in r.data)
|
|
4836
4836
|
i.push({
|
|
4837
|
-
key: n._parse(new
|
|
4838
|
-
value:
|
|
4839
|
-
alwaysSet:
|
|
4837
|
+
key: n._parse(new N(r, o, r.path, o)),
|
|
4838
|
+
value: a._parse(new N(r, r.data[o], r.path, o)),
|
|
4839
|
+
alwaysSet: o in r.data
|
|
4840
4840
|
});
|
|
4841
|
-
return r.common.async ?
|
|
4841
|
+
return r.common.async ? l.ParseStatus.mergeObjectAsync(t, i) : l.ParseStatus.mergeObjectSync(t, i);
|
|
4842
4842
|
}
|
|
4843
4843
|
get element() {
|
|
4844
4844
|
return this._def.valueType;
|
|
4845
4845
|
}
|
|
4846
4846
|
static create(e, t, r) {
|
|
4847
|
-
return t instanceof
|
|
4847
|
+
return t instanceof b ? new s({
|
|
4848
4848
|
keyType: e,
|
|
4849
4849
|
valueType: t,
|
|
4850
4850
|
typeName: _.ZodRecord,
|
|
4851
|
-
...
|
|
4851
|
+
...v(r)
|
|
4852
4852
|
}) : new s({
|
|
4853
|
-
keyType:
|
|
4853
|
+
keyType: K.create(),
|
|
4854
4854
|
valueType: e,
|
|
4855
4855
|
typeName: _.ZodRecord,
|
|
4856
|
-
...
|
|
4856
|
+
...v(t)
|
|
4857
4857
|
});
|
|
4858
4858
|
}
|
|
4859
4859
|
};
|
|
4860
|
-
|
|
4861
|
-
var
|
|
4860
|
+
u.ZodRecord = Ke;
|
|
4861
|
+
var xe = class extends b {
|
|
4862
4862
|
static {
|
|
4863
4863
|
d(this, "ZodMap");
|
|
4864
4864
|
}
|
|
@@ -4871,66 +4871,66 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4871
4871
|
_parse(e) {
|
|
4872
4872
|
let { status: t, ctx: r } = this._processInputParams(e);
|
|
4873
4873
|
if (r.parsedType !== m.ZodParsedType.map)
|
|
4874
|
-
return (0,
|
|
4874
|
+
return (0, l.addIssueToContext)(r, {
|
|
4875
4875
|
code: f.ZodIssueCode.invalid_type,
|
|
4876
4876
|
expected: m.ZodParsedType.map,
|
|
4877
4877
|
received: r.parsedType
|
|
4878
|
-
}),
|
|
4879
|
-
let i = this._def.keyType, n = this._def.valueType,
|
|
4880
|
-
key: i._parse(new
|
|
4881
|
-
value: n._parse(new
|
|
4878
|
+
}), l.INVALID;
|
|
4879
|
+
let i = this._def.keyType, n = this._def.valueType, a = [...r.data.entries()].map(([o, c], h) => ({
|
|
4880
|
+
key: i._parse(new N(r, o, r.path, [h, "key"])),
|
|
4881
|
+
value: n._parse(new N(r, c, r.path, [h, "value"]))
|
|
4882
4882
|
}));
|
|
4883
4883
|
if (r.common.async) {
|
|
4884
|
-
let
|
|
4884
|
+
let o = /* @__PURE__ */ new Map();
|
|
4885
4885
|
return Promise.resolve().then(async () => {
|
|
4886
|
-
for (let
|
|
4887
|
-
let h = await
|
|
4886
|
+
for (let c of a) {
|
|
4887
|
+
let h = await c.key, p = await c.value;
|
|
4888
4888
|
if (h.status === "aborted" || p.status === "aborted")
|
|
4889
|
-
return
|
|
4890
|
-
(h.status === "dirty" || p.status === "dirty") && t.dirty(),
|
|
4889
|
+
return l.INVALID;
|
|
4890
|
+
(h.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(h.value, p.value);
|
|
4891
4891
|
}
|
|
4892
|
-
return { status: t.value, value:
|
|
4892
|
+
return { status: t.value, value: o };
|
|
4893
4893
|
});
|
|
4894
4894
|
} else {
|
|
4895
|
-
let
|
|
4896
|
-
for (let
|
|
4897
|
-
let h =
|
|
4895
|
+
let o = /* @__PURE__ */ new Map();
|
|
4896
|
+
for (let c of a) {
|
|
4897
|
+
let h = c.key, p = c.value;
|
|
4898
4898
|
if (h.status === "aborted" || p.status === "aborted")
|
|
4899
|
-
return
|
|
4900
|
-
(h.status === "dirty" || p.status === "dirty") && t.dirty(),
|
|
4899
|
+
return l.INVALID;
|
|
4900
|
+
(h.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(h.value, p.value);
|
|
4901
4901
|
}
|
|
4902
|
-
return { status: t.value, value:
|
|
4902
|
+
return { status: t.value, value: o };
|
|
4903
4903
|
}
|
|
4904
4904
|
}
|
|
4905
4905
|
};
|
|
4906
|
-
|
|
4907
|
-
|
|
4906
|
+
u.ZodMap = xe;
|
|
4907
|
+
xe.create = (s, e, t) => new xe({
|
|
4908
4908
|
valueType: e,
|
|
4909
4909
|
keyType: s,
|
|
4910
4910
|
typeName: _.ZodMap,
|
|
4911
|
-
...
|
|
4911
|
+
...v(t)
|
|
4912
4912
|
});
|
|
4913
|
-
var
|
|
4913
|
+
var we = class s extends b {
|
|
4914
4914
|
static {
|
|
4915
4915
|
d(this, "ZodSet");
|
|
4916
4916
|
}
|
|
4917
4917
|
_parse(e) {
|
|
4918
4918
|
let { status: t, ctx: r } = this._processInputParams(e);
|
|
4919
4919
|
if (r.parsedType !== m.ZodParsedType.set)
|
|
4920
|
-
return (0,
|
|
4920
|
+
return (0, l.addIssueToContext)(r, {
|
|
4921
4921
|
code: f.ZodIssueCode.invalid_type,
|
|
4922
4922
|
expected: m.ZodParsedType.set,
|
|
4923
4923
|
received: r.parsedType
|
|
4924
|
-
}),
|
|
4924
|
+
}), l.INVALID;
|
|
4925
4925
|
let i = this._def;
|
|
4926
|
-
i.minSize !== null && r.data.size < i.minSize.value && ((0,
|
|
4926
|
+
i.minSize !== null && r.data.size < i.minSize.value && ((0, l.addIssueToContext)(r, {
|
|
4927
4927
|
code: f.ZodIssueCode.too_small,
|
|
4928
4928
|
minimum: i.minSize.value,
|
|
4929
4929
|
type: "set",
|
|
4930
4930
|
inclusive: !0,
|
|
4931
4931
|
exact: !1,
|
|
4932
4932
|
message: i.minSize.message
|
|
4933
|
-
}), t.dirty()), i.maxSize !== null && r.data.size > i.maxSize.value && ((0,
|
|
4933
|
+
}), t.dirty()), i.maxSize !== null && r.data.size > i.maxSize.value && ((0, l.addIssueToContext)(r, {
|
|
4934
4934
|
code: f.ZodIssueCode.too_big,
|
|
4935
4935
|
maximum: i.maxSize.value,
|
|
4936
4936
|
type: "set",
|
|
@@ -4939,18 +4939,18 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4939
4939
|
message: i.maxSize.message
|
|
4940
4940
|
}), t.dirty());
|
|
4941
4941
|
let n = this._def.valueType;
|
|
4942
|
-
function
|
|
4942
|
+
function a(c) {
|
|
4943
4943
|
let h = /* @__PURE__ */ new Set();
|
|
4944
|
-
for (let p of
|
|
4944
|
+
for (let p of c) {
|
|
4945
4945
|
if (p.status === "aborted")
|
|
4946
|
-
return
|
|
4946
|
+
return l.INVALID;
|
|
4947
4947
|
p.status === "dirty" && t.dirty(), h.add(p.value);
|
|
4948
4948
|
}
|
|
4949
4949
|
return { status: t.value, value: h };
|
|
4950
4950
|
}
|
|
4951
|
-
d(
|
|
4952
|
-
let
|
|
4953
|
-
return r.common.async ? Promise.all(
|
|
4951
|
+
d(a, "finalizeSet");
|
|
4952
|
+
let o = [...r.data.values()].map((c, h) => n._parse(new N(r, c, r.path, h)));
|
|
4953
|
+
return r.common.async ? Promise.all(o).then((c) => a(c)) : a(o);
|
|
4954
4954
|
}
|
|
4955
4955
|
min(e, t) {
|
|
4956
4956
|
return new s({
|
|
@@ -4971,15 +4971,15 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4971
4971
|
return this.min(1, e);
|
|
4972
4972
|
}
|
|
4973
4973
|
};
|
|
4974
|
-
|
|
4975
|
-
|
|
4974
|
+
u.ZodSet = we;
|
|
4975
|
+
we.create = (s, e) => new we({
|
|
4976
4976
|
valueType: s,
|
|
4977
4977
|
minSize: null,
|
|
4978
4978
|
maxSize: null,
|
|
4979
4979
|
typeName: _.ZodSet,
|
|
4980
|
-
...
|
|
4980
|
+
...v(e)
|
|
4981
4981
|
});
|
|
4982
|
-
var Xe = class s extends
|
|
4982
|
+
var Xe = class s extends b {
|
|
4983
4983
|
static {
|
|
4984
4984
|
d(this, "ZodFunction");
|
|
4985
4985
|
}
|
|
@@ -4989,63 +4989,63 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4989
4989
|
_parse(e) {
|
|
4990
4990
|
let { ctx: t } = this._processInputParams(e);
|
|
4991
4991
|
if (t.parsedType !== m.ZodParsedType.function)
|
|
4992
|
-
return (0,
|
|
4992
|
+
return (0, l.addIssueToContext)(t, {
|
|
4993
4993
|
code: f.ZodIssueCode.invalid_type,
|
|
4994
4994
|
expected: m.ZodParsedType.function,
|
|
4995
4995
|
received: t.parsedType
|
|
4996
|
-
}),
|
|
4997
|
-
function r(
|
|
4998
|
-
return (0,
|
|
4999
|
-
data:
|
|
4996
|
+
}), l.INVALID;
|
|
4997
|
+
function r(o, c) {
|
|
4998
|
+
return (0, l.makeIssue)({
|
|
4999
|
+
data: o,
|
|
5000
5000
|
path: t.path,
|
|
5001
5001
|
errorMaps: [
|
|
5002
5002
|
t.common.contextualErrorMap,
|
|
5003
5003
|
t.schemaErrorMap,
|
|
5004
|
-
(0,
|
|
5005
|
-
|
|
5004
|
+
(0, Ge.getErrorMap)(),
|
|
5005
|
+
Ge.defaultErrorMap
|
|
5006
5006
|
].filter((h) => !!h),
|
|
5007
5007
|
issueData: {
|
|
5008
5008
|
code: f.ZodIssueCode.invalid_arguments,
|
|
5009
|
-
argumentsError:
|
|
5009
|
+
argumentsError: c
|
|
5010
5010
|
}
|
|
5011
5011
|
});
|
|
5012
5012
|
}
|
|
5013
5013
|
d(r, "makeArgsIssue");
|
|
5014
|
-
function i(
|
|
5015
|
-
return (0,
|
|
5016
|
-
data:
|
|
5014
|
+
function i(o, c) {
|
|
5015
|
+
return (0, l.makeIssue)({
|
|
5016
|
+
data: o,
|
|
5017
5017
|
path: t.path,
|
|
5018
5018
|
errorMaps: [
|
|
5019
5019
|
t.common.contextualErrorMap,
|
|
5020
5020
|
t.schemaErrorMap,
|
|
5021
|
-
(0,
|
|
5022
|
-
|
|
5021
|
+
(0, Ge.getErrorMap)(),
|
|
5022
|
+
Ge.defaultErrorMap
|
|
5023
5023
|
].filter((h) => !!h),
|
|
5024
5024
|
issueData: {
|
|
5025
5025
|
code: f.ZodIssueCode.invalid_return_type,
|
|
5026
|
-
returnTypeError:
|
|
5026
|
+
returnTypeError: c
|
|
5027
5027
|
}
|
|
5028
5028
|
});
|
|
5029
5029
|
}
|
|
5030
5030
|
d(i, "makeReturnsIssue");
|
|
5031
|
-
let n = { errorMap: t.common.contextualErrorMap },
|
|
5032
|
-
if (this._def.returns instanceof
|
|
5033
|
-
let
|
|
5034
|
-
return (0,
|
|
5035
|
-
let h = new f.ZodError([]), p = await
|
|
5036
|
-
throw h.addIssue(r(
|
|
5037
|
-
}), y = await Reflect.apply(
|
|
5038
|
-
return await
|
|
5039
|
-
throw h.addIssue(i(y,
|
|
5031
|
+
let n = { errorMap: t.common.contextualErrorMap }, a = t.data;
|
|
5032
|
+
if (this._def.returns instanceof Q) {
|
|
5033
|
+
let o = this;
|
|
5034
|
+
return (0, l.OK)(async function(...c) {
|
|
5035
|
+
let h = new f.ZodError([]), p = await o._def.args.parseAsync(c, n).catch((j) => {
|
|
5036
|
+
throw h.addIssue(r(c, j)), h;
|
|
5037
|
+
}), y = await Reflect.apply(a, this, p);
|
|
5038
|
+
return await o._def.returns._def.type.parseAsync(y, n).catch((j) => {
|
|
5039
|
+
throw h.addIssue(i(y, j)), h;
|
|
5040
5040
|
});
|
|
5041
5041
|
});
|
|
5042
5042
|
} else {
|
|
5043
|
-
let
|
|
5044
|
-
return (0,
|
|
5045
|
-
let h =
|
|
5043
|
+
let o = this;
|
|
5044
|
+
return (0, l.OK)(function(...c) {
|
|
5045
|
+
let h = o._def.args.safeParse(c, n);
|
|
5046
5046
|
if (!h.success)
|
|
5047
|
-
throw new f.ZodError([r(
|
|
5048
|
-
let p = Reflect.apply(
|
|
5047
|
+
throw new f.ZodError([r(c, h.error)]);
|
|
5048
|
+
let p = Reflect.apply(a, this, h.data), y = o._def.returns.safeParse(p, n);
|
|
5049
5049
|
if (!y.success)
|
|
5050
5050
|
throw new f.ZodError([i(p, y.error)]);
|
|
5051
5051
|
return y.data;
|
|
@@ -5061,7 +5061,7 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5061
5061
|
args(...e) {
|
|
5062
5062
|
return new s({
|
|
5063
5063
|
...this._def,
|
|
5064
|
-
args: L.create(e).rest(
|
|
5064
|
+
args: L.create(e).rest(H.create())
|
|
5065
5065
|
});
|
|
5066
5066
|
}
|
|
5067
5067
|
returns(e) {
|
|
@@ -5078,15 +5078,15 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5078
5078
|
}
|
|
5079
5079
|
static create(e, t, r) {
|
|
5080
5080
|
return new s({
|
|
5081
|
-
args: e || L.create([]).rest(
|
|
5082
|
-
returns: t ||
|
|
5081
|
+
args: e || L.create([]).rest(H.create()),
|
|
5082
|
+
returns: t || H.create(),
|
|
5083
5083
|
typeName: _.ZodFunction,
|
|
5084
|
-
...
|
|
5084
|
+
...v(r)
|
|
5085
5085
|
});
|
|
5086
5086
|
}
|
|
5087
5087
|
};
|
|
5088
|
-
|
|
5089
|
-
var
|
|
5088
|
+
u.ZodFunction = Xe;
|
|
5089
|
+
var le = class extends b {
|
|
5090
5090
|
static {
|
|
5091
5091
|
d(this, "ZodLazy");
|
|
5092
5092
|
}
|
|
@@ -5098,24 +5098,24 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5098
5098
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
5099
5099
|
}
|
|
5100
5100
|
};
|
|
5101
|
-
|
|
5102
|
-
|
|
5101
|
+
u.ZodLazy = le;
|
|
5102
|
+
le.create = (s, e) => new le({
|
|
5103
5103
|
getter: s,
|
|
5104
5104
|
typeName: _.ZodLazy,
|
|
5105
|
-
...
|
|
5105
|
+
...v(e)
|
|
5106
5106
|
});
|
|
5107
|
-
var
|
|
5107
|
+
var ce = class extends b {
|
|
5108
5108
|
static {
|
|
5109
5109
|
d(this, "ZodLiteral");
|
|
5110
5110
|
}
|
|
5111
5111
|
_parse(e) {
|
|
5112
5112
|
if (e.data !== this._def.value) {
|
|
5113
5113
|
let t = this._getOrReturnCtx(e);
|
|
5114
|
-
return (0,
|
|
5114
|
+
return (0, l.addIssueToContext)(t, {
|
|
5115
5115
|
received: t.data,
|
|
5116
5116
|
code: f.ZodIssueCode.invalid_literal,
|
|
5117
5117
|
expected: this._def.value
|
|
5118
|
-
}),
|
|
5118
|
+
}), l.INVALID;
|
|
5119
5119
|
}
|
|
5120
5120
|
return { status: "valid", value: e.data };
|
|
5121
5121
|
}
|
|
@@ -5123,45 +5123,45 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5123
5123
|
return this._def.value;
|
|
5124
5124
|
}
|
|
5125
5125
|
};
|
|
5126
|
-
|
|
5127
|
-
|
|
5126
|
+
u.ZodLiteral = ce;
|
|
5127
|
+
ce.create = (s, e) => new ce({
|
|
5128
5128
|
value: s,
|
|
5129
5129
|
typeName: _.ZodLiteral,
|
|
5130
|
-
...
|
|
5130
|
+
...v(e)
|
|
5131
5131
|
});
|
|
5132
|
-
function
|
|
5133
|
-
return new
|
|
5132
|
+
function kr(s, e) {
|
|
5133
|
+
return new he({
|
|
5134
5134
|
values: s,
|
|
5135
5135
|
typeName: _.ZodEnum,
|
|
5136
|
-
...
|
|
5136
|
+
...v(e)
|
|
5137
5137
|
});
|
|
5138
5138
|
}
|
|
5139
|
-
d(
|
|
5140
|
-
var
|
|
5139
|
+
d(kr, "createZodEnum");
|
|
5140
|
+
var he = class s extends b {
|
|
5141
5141
|
static {
|
|
5142
5142
|
d(this, "ZodEnum");
|
|
5143
5143
|
}
|
|
5144
5144
|
constructor() {
|
|
5145
|
-
super(...arguments),
|
|
5145
|
+
super(...arguments), Se.set(this, void 0);
|
|
5146
5146
|
}
|
|
5147
5147
|
_parse(e) {
|
|
5148
5148
|
if (typeof e.data != "string") {
|
|
5149
5149
|
let t = this._getOrReturnCtx(e), r = this._def.values;
|
|
5150
|
-
return (0,
|
|
5150
|
+
return (0, l.addIssueToContext)(t, {
|
|
5151
5151
|
expected: m.util.joinValues(r),
|
|
5152
5152
|
received: t.parsedType,
|
|
5153
5153
|
code: f.ZodIssueCode.invalid_type
|
|
5154
|
-
}),
|
|
5154
|
+
}), l.INVALID;
|
|
5155
5155
|
}
|
|
5156
|
-
if (
|
|
5156
|
+
if (Je(this, Se, "f") || br(this, Se, new Set(this._def.values), "f"), !Je(this, Se, "f").has(e.data)) {
|
|
5157
5157
|
let t = this._getOrReturnCtx(e), r = this._def.values;
|
|
5158
|
-
return (0,
|
|
5158
|
+
return (0, l.addIssueToContext)(t, {
|
|
5159
5159
|
received: t.data,
|
|
5160
5160
|
code: f.ZodIssueCode.invalid_enum_value,
|
|
5161
5161
|
options: r
|
|
5162
|
-
}),
|
|
5162
|
+
}), l.INVALID;
|
|
5163
5163
|
}
|
|
5164
|
-
return (0,
|
|
5164
|
+
return (0, l.OK)(e.data);
|
|
5165
5165
|
}
|
|
5166
5166
|
get options() {
|
|
5167
5167
|
return this._def.values;
|
|
@@ -5197,48 +5197,48 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5197
5197
|
});
|
|
5198
5198
|
}
|
|
5199
5199
|
};
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
var
|
|
5200
|
+
u.ZodEnum = he;
|
|
5201
|
+
Se = /* @__PURE__ */ new WeakMap();
|
|
5202
|
+
he.create = kr;
|
|
5203
|
+
var pe = class extends b {
|
|
5204
5204
|
static {
|
|
5205
5205
|
d(this, "ZodNativeEnum");
|
|
5206
5206
|
}
|
|
5207
5207
|
constructor() {
|
|
5208
|
-
super(...arguments),
|
|
5208
|
+
super(...arguments), Ee.set(this, void 0);
|
|
5209
5209
|
}
|
|
5210
5210
|
_parse(e) {
|
|
5211
5211
|
let t = m.util.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(e);
|
|
5212
5212
|
if (r.parsedType !== m.ZodParsedType.string && r.parsedType !== m.ZodParsedType.number) {
|
|
5213
5213
|
let i = m.util.objectValues(t);
|
|
5214
|
-
return (0,
|
|
5214
|
+
return (0, l.addIssueToContext)(r, {
|
|
5215
5215
|
expected: m.util.joinValues(i),
|
|
5216
5216
|
received: r.parsedType,
|
|
5217
5217
|
code: f.ZodIssueCode.invalid_type
|
|
5218
|
-
}),
|
|
5218
|
+
}), l.INVALID;
|
|
5219
5219
|
}
|
|
5220
|
-
if (
|
|
5220
|
+
if (Je(this, Ee, "f") || br(this, Ee, new Set(m.util.getValidEnumValues(this._def.values)), "f"), !Je(this, Ee, "f").has(e.data)) {
|
|
5221
5221
|
let i = m.util.objectValues(t);
|
|
5222
|
-
return (0,
|
|
5222
|
+
return (0, l.addIssueToContext)(r, {
|
|
5223
5223
|
received: r.data,
|
|
5224
5224
|
code: f.ZodIssueCode.invalid_enum_value,
|
|
5225
5225
|
options: i
|
|
5226
|
-
}),
|
|
5226
|
+
}), l.INVALID;
|
|
5227
5227
|
}
|
|
5228
|
-
return (0,
|
|
5228
|
+
return (0, l.OK)(e.data);
|
|
5229
5229
|
}
|
|
5230
5230
|
get enum() {
|
|
5231
5231
|
return this._def.values;
|
|
5232
5232
|
}
|
|
5233
5233
|
};
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5234
|
+
u.ZodNativeEnum = pe;
|
|
5235
|
+
Ee = /* @__PURE__ */ new WeakMap();
|
|
5236
|
+
pe.create = (s, e) => new pe({
|
|
5237
5237
|
values: s,
|
|
5238
5238
|
typeName: _.ZodNativeEnum,
|
|
5239
|
-
...
|
|
5239
|
+
...v(e)
|
|
5240
5240
|
});
|
|
5241
|
-
var
|
|
5241
|
+
var Q = class extends b {
|
|
5242
5242
|
static {
|
|
5243
5243
|
d(this, "ZodPromise");
|
|
5244
5244
|
}
|
|
@@ -5248,25 +5248,25 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5248
5248
|
_parse(e) {
|
|
5249
5249
|
let { ctx: t } = this._processInputParams(e);
|
|
5250
5250
|
if (t.parsedType !== m.ZodParsedType.promise && t.common.async === !1)
|
|
5251
|
-
return (0,
|
|
5251
|
+
return (0, l.addIssueToContext)(t, {
|
|
5252
5252
|
code: f.ZodIssueCode.invalid_type,
|
|
5253
5253
|
expected: m.ZodParsedType.promise,
|
|
5254
5254
|
received: t.parsedType
|
|
5255
|
-
}),
|
|
5255
|
+
}), l.INVALID;
|
|
5256
5256
|
let r = t.parsedType === m.ZodParsedType.promise ? t.data : Promise.resolve(t.data);
|
|
5257
|
-
return (0,
|
|
5257
|
+
return (0, l.OK)(r.then((i) => this._def.type.parseAsync(i, {
|
|
5258
5258
|
path: t.path,
|
|
5259
5259
|
errorMap: t.common.contextualErrorMap
|
|
5260
5260
|
})));
|
|
5261
5261
|
}
|
|
5262
5262
|
};
|
|
5263
|
-
|
|
5264
|
-
|
|
5263
|
+
u.ZodPromise = Q;
|
|
5264
|
+
Q.create = (s, e) => new Q({
|
|
5265
5265
|
type: s,
|
|
5266
5266
|
typeName: _.ZodPromise,
|
|
5267
|
-
...
|
|
5267
|
+
...v(e)
|
|
5268
5268
|
});
|
|
5269
|
-
var
|
|
5269
|
+
var S = class extends b {
|
|
5270
5270
|
static {
|
|
5271
5271
|
d(this, "ZodEffects");
|
|
5272
5272
|
}
|
|
@@ -5278,125 +5278,125 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5278
5278
|
}
|
|
5279
5279
|
_parse(e) {
|
|
5280
5280
|
let { status: t, ctx: r } = this._processInputParams(e), i = this._def.effect || null, n = {
|
|
5281
|
-
addIssue: /* @__PURE__ */ d((
|
|
5282
|
-
(0,
|
|
5281
|
+
addIssue: /* @__PURE__ */ d((a) => {
|
|
5282
|
+
(0, l.addIssueToContext)(r, a), a.fatal ? t.abort() : t.dirty();
|
|
5283
5283
|
}, "addIssue"),
|
|
5284
5284
|
get path() {
|
|
5285
5285
|
return r.path;
|
|
5286
5286
|
}
|
|
5287
5287
|
};
|
|
5288
5288
|
if (n.addIssue = n.addIssue.bind(n), i.type === "preprocess") {
|
|
5289
|
-
let
|
|
5289
|
+
let a = i.transform(r.data, n);
|
|
5290
5290
|
if (r.common.async)
|
|
5291
|
-
return Promise.resolve(
|
|
5291
|
+
return Promise.resolve(a).then(async (o) => {
|
|
5292
5292
|
if (t.value === "aborted")
|
|
5293
|
-
return
|
|
5294
|
-
let
|
|
5295
|
-
data:
|
|
5293
|
+
return l.INVALID;
|
|
5294
|
+
let c = await this._def.schema._parseAsync({
|
|
5295
|
+
data: o,
|
|
5296
5296
|
path: r.path,
|
|
5297
5297
|
parent: r
|
|
5298
5298
|
});
|
|
5299
|
-
return
|
|
5299
|
+
return c.status === "aborted" ? l.INVALID : c.status === "dirty" || t.value === "dirty" ? (0, l.DIRTY)(c.value) : c;
|
|
5300
5300
|
});
|
|
5301
5301
|
{
|
|
5302
5302
|
if (t.value === "aborted")
|
|
5303
|
-
return
|
|
5304
|
-
let
|
|
5305
|
-
data:
|
|
5303
|
+
return l.INVALID;
|
|
5304
|
+
let o = this._def.schema._parseSync({
|
|
5305
|
+
data: a,
|
|
5306
5306
|
path: r.path,
|
|
5307
5307
|
parent: r
|
|
5308
5308
|
});
|
|
5309
|
-
return
|
|
5309
|
+
return o.status === "aborted" ? l.INVALID : o.status === "dirty" || t.value === "dirty" ? (0, l.DIRTY)(o.value) : o;
|
|
5310
5310
|
}
|
|
5311
5311
|
}
|
|
5312
5312
|
if (i.type === "refinement") {
|
|
5313
|
-
let
|
|
5314
|
-
let
|
|
5313
|
+
let a = /* @__PURE__ */ d((o) => {
|
|
5314
|
+
let c = i.refinement(o, n);
|
|
5315
5315
|
if (r.common.async)
|
|
5316
|
-
return Promise.resolve(
|
|
5317
|
-
if (
|
|
5316
|
+
return Promise.resolve(c);
|
|
5317
|
+
if (c instanceof Promise)
|
|
5318
5318
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
5319
|
-
return
|
|
5319
|
+
return o;
|
|
5320
5320
|
}, "executeRefinement");
|
|
5321
5321
|
if (r.common.async === !1) {
|
|
5322
|
-
let
|
|
5322
|
+
let o = this._def.schema._parseSync({
|
|
5323
5323
|
data: r.data,
|
|
5324
5324
|
path: r.path,
|
|
5325
5325
|
parent: r
|
|
5326
5326
|
});
|
|
5327
|
-
return
|
|
5327
|
+
return o.status === "aborted" ? l.INVALID : (o.status === "dirty" && t.dirty(), a(o.value), { status: t.value, value: o.value });
|
|
5328
5328
|
} else
|
|
5329
|
-
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((
|
|
5330
|
-
status === "dirty" && t.dirty(), o
|
|
5329
|
+
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((o) => o.status === "aborted" ? l.INVALID : (o.
|
|
5330
|
+
status === "dirty" && t.dirty(), a(o.value).then(() => ({ status: t.value, value: o.value }))));
|
|
5331
5331
|
}
|
|
5332
5332
|
if (i.type === "transform")
|
|
5333
5333
|
if (r.common.async === !1) {
|
|
5334
|
-
let
|
|
5334
|
+
let a = this._def.schema._parseSync({
|
|
5335
5335
|
data: r.data,
|
|
5336
5336
|
path: r.path,
|
|
5337
5337
|
parent: r
|
|
5338
5338
|
});
|
|
5339
|
-
if (!(0,
|
|
5340
|
-
return
|
|
5341
|
-
let
|
|
5342
|
-
if (
|
|
5339
|
+
if (!(0, l.isValid)(a))
|
|
5340
|
+
return a;
|
|
5341
|
+
let o = i.transform(a.value, n);
|
|
5342
|
+
if (o instanceof Promise)
|
|
5343
5343
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
5344
|
-
return { status: t.value, value:
|
|
5344
|
+
return { status: t.value, value: o };
|
|
5345
5345
|
} else
|
|
5346
|
-
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((
|
|
5347
|
-
|
|
5346
|
+
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((a) => (0, l.isValid)(a) ? Promise.resolve(i.transform(
|
|
5347
|
+
a.value, n)).then((o) => ({ status: t.value, value: o })) : a);
|
|
5348
5348
|
m.util.assertNever(i);
|
|
5349
5349
|
}
|
|
5350
5350
|
};
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5351
|
+
u.ZodEffects = S;
|
|
5352
|
+
u.ZodTransformer = S;
|
|
5353
|
+
S.create = (s, e, t) => new S({
|
|
5354
5354
|
schema: s,
|
|
5355
5355
|
typeName: _.ZodEffects,
|
|
5356
5356
|
effect: e,
|
|
5357
|
-
...
|
|
5357
|
+
...v(t)
|
|
5358
5358
|
});
|
|
5359
|
-
|
|
5359
|
+
S.createWithPreprocess = (s, e, t) => new S({
|
|
5360
5360
|
schema: e,
|
|
5361
5361
|
effect: { type: "preprocess", transform: s },
|
|
5362
5362
|
typeName: _.ZodEffects,
|
|
5363
|
-
...
|
|
5363
|
+
...v(t)
|
|
5364
5364
|
});
|
|
5365
|
-
var
|
|
5365
|
+
var P = class extends b {
|
|
5366
5366
|
static {
|
|
5367
5367
|
d(this, "ZodOptional");
|
|
5368
5368
|
}
|
|
5369
5369
|
_parse(e) {
|
|
5370
|
-
return this._getType(e) === m.ZodParsedType.undefined ? (0,
|
|
5370
|
+
return this._getType(e) === m.ZodParsedType.undefined ? (0, l.OK)(void 0) : this._def.innerType._parse(e);
|
|
5371
5371
|
}
|
|
5372
5372
|
unwrap() {
|
|
5373
5373
|
return this._def.innerType;
|
|
5374
5374
|
}
|
|
5375
5375
|
};
|
|
5376
|
-
|
|
5377
|
-
|
|
5376
|
+
u.ZodOptional = P;
|
|
5377
|
+
P.create = (s, e) => new P({
|
|
5378
5378
|
innerType: s,
|
|
5379
5379
|
typeName: _.ZodOptional,
|
|
5380
|
-
...
|
|
5380
|
+
...v(e)
|
|
5381
5381
|
});
|
|
5382
|
-
var
|
|
5382
|
+
var q = class extends b {
|
|
5383
5383
|
static {
|
|
5384
5384
|
d(this, "ZodNullable");
|
|
5385
5385
|
}
|
|
5386
5386
|
_parse(e) {
|
|
5387
|
-
return this._getType(e) === m.ZodParsedType.null ? (0,
|
|
5387
|
+
return this._getType(e) === m.ZodParsedType.null ? (0, l.OK)(null) : this._def.innerType._parse(e);
|
|
5388
5388
|
}
|
|
5389
5389
|
unwrap() {
|
|
5390
5390
|
return this._def.innerType;
|
|
5391
5391
|
}
|
|
5392
5392
|
};
|
|
5393
|
-
|
|
5394
|
-
|
|
5393
|
+
u.ZodNullable = q;
|
|
5394
|
+
q.create = (s, e) => new q({
|
|
5395
5395
|
innerType: s,
|
|
5396
5396
|
typeName: _.ZodNullable,
|
|
5397
|
-
...
|
|
5397
|
+
...v(e)
|
|
5398
5398
|
});
|
|
5399
|
-
var
|
|
5399
|
+
var fe = class extends b {
|
|
5400
5400
|
static {
|
|
5401
5401
|
d(this, "ZodDefault");
|
|
5402
5402
|
}
|
|
@@ -5412,14 +5412,14 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5412
5412
|
return this._def.innerType;
|
|
5413
5413
|
}
|
|
5414
5414
|
};
|
|
5415
|
-
|
|
5416
|
-
|
|
5415
|
+
u.ZodDefault = fe;
|
|
5416
|
+
fe.create = (s, e) => new fe({
|
|
5417
5417
|
innerType: s,
|
|
5418
5418
|
typeName: _.ZodDefault,
|
|
5419
5419
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
5420
|
-
...
|
|
5420
|
+
...v(e)
|
|
5421
5421
|
});
|
|
5422
|
-
var
|
|
5422
|
+
var me = class extends b {
|
|
5423
5423
|
static {
|
|
5424
5424
|
d(this, "ZodCatch");
|
|
5425
5425
|
}
|
|
@@ -5437,7 +5437,7 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5437
5437
|
...r
|
|
5438
5438
|
}
|
|
5439
5439
|
});
|
|
5440
|
-
return (0,
|
|
5440
|
+
return (0, l.isAsync)(i) ? i.then((n) => ({
|
|
5441
5441
|
status: "valid",
|
|
5442
5442
|
value: n.status === "valid" ? n.value : this._def.catchValue({
|
|
5443
5443
|
get error() {
|
|
@@ -5459,36 +5459,36 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5459
5459
|
return this._def.innerType;
|
|
5460
5460
|
}
|
|
5461
5461
|
};
|
|
5462
|
-
|
|
5463
|
-
|
|
5462
|
+
u.ZodCatch = me;
|
|
5463
|
+
me.create = (s, e) => new me({
|
|
5464
5464
|
innerType: s,
|
|
5465
5465
|
typeName: _.ZodCatch,
|
|
5466
5466
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
5467
|
-
...
|
|
5467
|
+
...v(e)
|
|
5468
5468
|
});
|
|
5469
|
-
var
|
|
5469
|
+
var Ce = class extends b {
|
|
5470
5470
|
static {
|
|
5471
5471
|
d(this, "ZodNaN");
|
|
5472
5472
|
}
|
|
5473
5473
|
_parse(e) {
|
|
5474
5474
|
if (this._getType(e) !== m.ZodParsedType.nan) {
|
|
5475
5475
|
let r = this._getOrReturnCtx(e);
|
|
5476
|
-
return (0,
|
|
5476
|
+
return (0, l.addIssueToContext)(r, {
|
|
5477
5477
|
code: f.ZodIssueCode.invalid_type,
|
|
5478
5478
|
expected: m.ZodParsedType.nan,
|
|
5479
5479
|
received: r.parsedType
|
|
5480
|
-
}),
|
|
5480
|
+
}), l.INVALID;
|
|
5481
5481
|
}
|
|
5482
5482
|
return { status: "valid", value: e.data };
|
|
5483
5483
|
}
|
|
5484
5484
|
};
|
|
5485
|
-
|
|
5486
|
-
|
|
5485
|
+
u.ZodNaN = Ce;
|
|
5486
|
+
Ce.create = (s) => new Ce({
|
|
5487
5487
|
typeName: _.ZodNaN,
|
|
5488
|
-
...
|
|
5488
|
+
...v(s)
|
|
5489
5489
|
});
|
|
5490
|
-
|
|
5491
|
-
var
|
|
5490
|
+
u.BRAND = Symbol("zod_brand");
|
|
5491
|
+
var Pe = class extends b {
|
|
5492
5492
|
static {
|
|
5493
5493
|
d(this, "ZodBranded");
|
|
5494
5494
|
}
|
|
@@ -5504,8 +5504,8 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5504
5504
|
return this._def.type;
|
|
5505
5505
|
}
|
|
5506
5506
|
};
|
|
5507
|
-
|
|
5508
|
-
var
|
|
5507
|
+
u.ZodBranded = Pe;
|
|
5508
|
+
var Ne = class s extends b {
|
|
5509
5509
|
static {
|
|
5510
5510
|
d(this, "ZodPipeline");
|
|
5511
5511
|
}
|
|
@@ -5518,7 +5518,7 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5518
5518
|
path: r.path,
|
|
5519
5519
|
parent: r
|
|
5520
5520
|
});
|
|
5521
|
-
return n.status === "aborted" ?
|
|
5521
|
+
return n.status === "aborted" ? l.INVALID : n.status === "dirty" ? (t.dirty(), (0, l.DIRTY)(n.value)) : this._def.out._parseAsync(
|
|
5522
5522
|
{
|
|
5523
5523
|
data: n.value,
|
|
5524
5524
|
path: r.path,
|
|
@@ -5531,7 +5531,7 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5531
5531
|
path: r.path,
|
|
5532
5532
|
parent: r
|
|
5533
5533
|
});
|
|
5534
|
-
return i.status === "aborted" ?
|
|
5534
|
+
return i.status === "aborted" ? l.INVALID : i.status === "dirty" ? (t.dirty(), {
|
|
5535
5535
|
status: "dirty",
|
|
5536
5536
|
value: i.value
|
|
5537
5537
|
}) : this._def.out._parseSync({
|
|
@@ -5549,53 +5549,53 @@ onent})+$", Zt, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5549
5549
|
});
|
|
5550
5550
|
}
|
|
5551
5551
|
};
|
|
5552
|
-
|
|
5553
|
-
var
|
|
5552
|
+
u.ZodPipeline = Ne;
|
|
5553
|
+
var ge = class extends b {
|
|
5554
5554
|
static {
|
|
5555
5555
|
d(this, "ZodReadonly");
|
|
5556
5556
|
}
|
|
5557
5557
|
_parse(e) {
|
|
5558
|
-
let t = this._def.innerType._parse(e), r = /* @__PURE__ */ d((i) => ((0,
|
|
5558
|
+
let t = this._def.innerType._parse(e), r = /* @__PURE__ */ d((i) => ((0, l.isValid)(i) && (i.value = Object.freeze(i.value)), i), "fre\
|
|
5559
5559
|
eze");
|
|
5560
|
-
return (0,
|
|
5560
|
+
return (0, l.isAsync)(t) ? t.then((i) => r(i)) : r(t);
|
|
5561
5561
|
}
|
|
5562
5562
|
unwrap() {
|
|
5563
5563
|
return this._def.innerType;
|
|
5564
5564
|
}
|
|
5565
5565
|
};
|
|
5566
|
-
|
|
5567
|
-
|
|
5566
|
+
u.ZodReadonly = ge;
|
|
5567
|
+
ge.create = (s, e) => new ge({
|
|
5568
5568
|
innerType: s,
|
|
5569
5569
|
typeName: _.ZodReadonly,
|
|
5570
|
-
...
|
|
5570
|
+
...v(e)
|
|
5571
5571
|
});
|
|
5572
|
-
function
|
|
5572
|
+
function vr(s, e) {
|
|
5573
5573
|
let t = typeof s == "function" ? s(e) : typeof s == "string" ? { message: s } : s;
|
|
5574
5574
|
return typeof t == "string" ? { message: t } : t;
|
|
5575
5575
|
}
|
|
5576
|
-
d(
|
|
5577
|
-
function
|
|
5578
|
-
return s ?
|
|
5579
|
-
var n,
|
|
5580
|
-
let
|
|
5581
|
-
if (
|
|
5582
|
-
return
|
|
5576
|
+
d(vr, "cleanParams");
|
|
5577
|
+
function Ir(s, e = {}, t) {
|
|
5578
|
+
return s ? X.create().superRefine((r, i) => {
|
|
5579
|
+
var n, a;
|
|
5580
|
+
let o = s(r);
|
|
5581
|
+
if (o instanceof Promise)
|
|
5582
|
+
return o.then((c) => {
|
|
5583
5583
|
var h, p;
|
|
5584
|
-
if (!
|
|
5585
|
-
let y =
|
|
5586
|
-
i.addIssue({ code: "custom", ...y, fatal:
|
|
5584
|
+
if (!c) {
|
|
5585
|
+
let y = vr(e, r), C = (p = (h = y.fatal) !== null && h !== void 0 ? h : t) !== null && p !== void 0 ? p : !0;
|
|
5586
|
+
i.addIssue({ code: "custom", ...y, fatal: C });
|
|
5587
5587
|
}
|
|
5588
5588
|
});
|
|
5589
|
-
if (!
|
|
5590
|
-
let
|
|
5591
|
-
i.addIssue({ code: "custom", ...
|
|
5589
|
+
if (!o) {
|
|
5590
|
+
let c = vr(e, r), h = (a = (n = c.fatal) !== null && n !== void 0 ? n : t) !== null && a !== void 0 ? a : !0;
|
|
5591
|
+
i.addIssue({ code: "custom", ...c, fatal: h });
|
|
5592
5592
|
}
|
|
5593
|
-
}) :
|
|
5593
|
+
}) : X.create();
|
|
5594
5594
|
}
|
|
5595
|
-
d(
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
object:
|
|
5595
|
+
d(Ir, "custom");
|
|
5596
|
+
u.custom = Ir;
|
|
5597
|
+
u.late = {
|
|
5598
|
+
object: A.lazycreate
|
|
5599
5599
|
};
|
|
5600
5600
|
var _;
|
|
5601
5601
|
(function(s) {
|
|
@@ -5607,103 +5607,103 @@ known", s.ZodNever = "ZodNever", s.ZodVoid = "ZodVoid", s.ZodArray = "ZodArray",
|
|
|
5607
5607
|
"ZodEffects", s.ZodNativeEnum = "ZodNativeEnum", s.ZodOptional = "ZodOptional", s.ZodNullable = "ZodNullable", s.ZodDefault = "ZodDefaul\
|
|
5608
5608
|
t", s.ZodCatch = "ZodCatch", s.ZodPromise = "ZodPromise", s.ZodBranded = "ZodBranded", s.ZodPipeline = "ZodPipeline", s.ZodReadonly = "ZodRe\
|
|
5609
5609
|
adonly";
|
|
5610
|
-
})(_ || (
|
|
5611
|
-
var
|
|
5610
|
+
})(_ || (u.ZodFirstPartyTypeKind = _ = {}));
|
|
5611
|
+
var Ks = /* @__PURE__ */ d((s, e = {
|
|
5612
5612
|
message: `Input not instance of ${s.name}`
|
|
5613
|
-
}) =>
|
|
5614
|
-
|
|
5615
|
-
var
|
|
5616
|
-
|
|
5617
|
-
var
|
|
5618
|
-
|
|
5619
|
-
var
|
|
5620
|
-
|
|
5621
|
-
var
|
|
5622
|
-
|
|
5623
|
-
var
|
|
5624
|
-
|
|
5625
|
-
var
|
|
5626
|
-
|
|
5627
|
-
var
|
|
5628
|
-
|
|
5629
|
-
var
|
|
5630
|
-
|
|
5631
|
-
var
|
|
5632
|
-
|
|
5633
|
-
var
|
|
5634
|
-
|
|
5635
|
-
var
|
|
5636
|
-
|
|
5637
|
-
var
|
|
5638
|
-
|
|
5639
|
-
var
|
|
5640
|
-
|
|
5641
|
-
var
|
|
5642
|
-
|
|
5643
|
-
var
|
|
5644
|
-
|
|
5645
|
-
var
|
|
5646
|
-
|
|
5647
|
-
var
|
|
5648
|
-
|
|
5649
|
-
var
|
|
5650
|
-
|
|
5651
|
-
var
|
|
5652
|
-
|
|
5653
|
-
var
|
|
5654
|
-
|
|
5655
|
-
var
|
|
5656
|
-
|
|
5657
|
-
var
|
|
5658
|
-
|
|
5659
|
-
var
|
|
5660
|
-
|
|
5661
|
-
var
|
|
5662
|
-
|
|
5663
|
-
var
|
|
5664
|
-
|
|
5665
|
-
var
|
|
5666
|
-
|
|
5667
|
-
var
|
|
5668
|
-
|
|
5669
|
-
var
|
|
5670
|
-
|
|
5671
|
-
var
|
|
5672
|
-
|
|
5673
|
-
var
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
var
|
|
5677
|
-
|
|
5678
|
-
var
|
|
5679
|
-
|
|
5680
|
-
var
|
|
5681
|
-
|
|
5682
|
-
var
|
|
5683
|
-
|
|
5684
|
-
var
|
|
5685
|
-
|
|
5686
|
-
var
|
|
5687
|
-
|
|
5688
|
-
var
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
string: /* @__PURE__ */ d((s) =>
|
|
5692
|
-
number: /* @__PURE__ */ d((s) =>
|
|
5693
|
-
boolean: /* @__PURE__ */ d((s) =>
|
|
5613
|
+
}) => Ir((t) => t instanceof s, e), "instanceOfType");
|
|
5614
|
+
u.instanceof = Ks;
|
|
5615
|
+
var Tr = K.create;
|
|
5616
|
+
u.string = Tr;
|
|
5617
|
+
var Or = re.create;
|
|
5618
|
+
u.number = Or;
|
|
5619
|
+
var Xs = Ce.create;
|
|
5620
|
+
u.nan = Xs;
|
|
5621
|
+
var Qs = se.create;
|
|
5622
|
+
u.bigint = Qs;
|
|
5623
|
+
var Ar = ie.create;
|
|
5624
|
+
u.boolean = Ar;
|
|
5625
|
+
var ei = ne.create;
|
|
5626
|
+
u.date = ei;
|
|
5627
|
+
var ti = ve.create;
|
|
5628
|
+
u.symbol = ti;
|
|
5629
|
+
var ri = ae.create;
|
|
5630
|
+
u.undefined = ri;
|
|
5631
|
+
var si = oe.create;
|
|
5632
|
+
u.null = si;
|
|
5633
|
+
var ii = X.create;
|
|
5634
|
+
u.any = ii;
|
|
5635
|
+
var ni = H.create;
|
|
5636
|
+
u.unknown = ni;
|
|
5637
|
+
var ai = $.create;
|
|
5638
|
+
u.never = ai;
|
|
5639
|
+
var oi = be.create;
|
|
5640
|
+
u.void = oi;
|
|
5641
|
+
var di = B.create;
|
|
5642
|
+
u.array = di;
|
|
5643
|
+
var ui = A.create;
|
|
5644
|
+
u.object = ui;
|
|
5645
|
+
var li = A.strictCreate;
|
|
5646
|
+
u.strictObject = li;
|
|
5647
|
+
var ci = de.create;
|
|
5648
|
+
u.union = ci;
|
|
5649
|
+
var hi = Ye.create;
|
|
5650
|
+
u.discriminatedUnion = hi;
|
|
5651
|
+
var pi = ue.create;
|
|
5652
|
+
u.intersection = pi;
|
|
5653
|
+
var fi = L.create;
|
|
5654
|
+
u.tuple = fi;
|
|
5655
|
+
var mi = Ke.create;
|
|
5656
|
+
u.record = mi;
|
|
5657
|
+
var gi = xe.create;
|
|
5658
|
+
u.map = gi;
|
|
5659
|
+
var yi = we.create;
|
|
5660
|
+
u.set = yi;
|
|
5661
|
+
var _i = Xe.create;
|
|
5662
|
+
u.function = _i;
|
|
5663
|
+
var vi = le.create;
|
|
5664
|
+
u.lazy = vi;
|
|
5665
|
+
var bi = ce.create;
|
|
5666
|
+
u.literal = bi;
|
|
5667
|
+
var xi = he.create;
|
|
5668
|
+
u.enum = xi;
|
|
5669
|
+
var wi = pe.create;
|
|
5670
|
+
u.nativeEnum = wi;
|
|
5671
|
+
var Ci = Q.create;
|
|
5672
|
+
u.promise = Ci;
|
|
5673
|
+
var Zr = S.create;
|
|
5674
|
+
u.effect = Zr;
|
|
5675
|
+
u.transformer = Zr;
|
|
5676
|
+
var ki = P.create;
|
|
5677
|
+
u.optional = ki;
|
|
5678
|
+
var Ii = q.create;
|
|
5679
|
+
u.nullable = Ii;
|
|
5680
|
+
var Ti = S.createWithPreprocess;
|
|
5681
|
+
u.preprocess = Ti;
|
|
5682
|
+
var Oi = Ne.create;
|
|
5683
|
+
u.pipeline = Oi;
|
|
5684
|
+
var Ai = /* @__PURE__ */ d(() => Tr().optional(), "ostring");
|
|
5685
|
+
u.ostring = Ai;
|
|
5686
|
+
var Zi = /* @__PURE__ */ d(() => Or().optional(), "onumber");
|
|
5687
|
+
u.onumber = Zi;
|
|
5688
|
+
var ji = /* @__PURE__ */ d(() => Ar().optional(), "oboolean");
|
|
5689
|
+
u.oboolean = ji;
|
|
5690
|
+
u.coerce = {
|
|
5691
|
+
string: /* @__PURE__ */ d((s) => K.create({ ...s, coerce: !0 }), "string"),
|
|
5692
|
+
number: /* @__PURE__ */ d((s) => re.create({ ...s, coerce: !0 }), "number"),
|
|
5693
|
+
boolean: /* @__PURE__ */ d((s) => ie.create({
|
|
5694
5694
|
...s,
|
|
5695
5695
|
coerce: !0
|
|
5696
5696
|
}), "boolean"),
|
|
5697
|
-
bigint: /* @__PURE__ */ d((s) =>
|
|
5698
|
-
date: /* @__PURE__ */ d((s) =>
|
|
5697
|
+
bigint: /* @__PURE__ */ d((s) => se.create({ ...s, coerce: !0 }), "bigint"),
|
|
5698
|
+
date: /* @__PURE__ */ d((s) => ne.create({ ...s, coerce: !0 }), "date")
|
|
5699
5699
|
};
|
|
5700
|
-
|
|
5700
|
+
u.NEVER = l.INVALID;
|
|
5701
5701
|
});
|
|
5702
5702
|
|
|
5703
5703
|
// ../node_modules/zod/lib/external.js
|
|
5704
|
-
var
|
|
5704
|
+
var Pt = T((V) => {
|
|
5705
5705
|
"use strict";
|
|
5706
|
-
var
|
|
5706
|
+
var Si = V && V.__createBinding || (Object.create ? function(s, e, t, r) {
|
|
5707
5707
|
r === void 0 && (r = t);
|
|
5708
5708
|
var i = Object.getOwnPropertyDescriptor(e, t);
|
|
5709
5709
|
(!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: /* @__PURE__ */ d(function() {
|
|
@@ -5711,22 +5711,22 @@ var Nt = O((N) => {
|
|
|
5711
5711
|
}, "get") }), Object.defineProperty(s, r, i);
|
|
5712
5712
|
} : function(s, e, t, r) {
|
|
5713
5713
|
r === void 0 && (r = t), s[r] = e[t];
|
|
5714
|
-
}),
|
|
5715
|
-
for (var t in s) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) &&
|
|
5714
|
+
}), ke = V && V.__exportStar || function(s, e) {
|
|
5715
|
+
for (var t in s) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) && Si(e, s, t);
|
|
5716
5716
|
};
|
|
5717
|
-
Object.defineProperty(
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5717
|
+
Object.defineProperty(V, "__esModule", { value: !0 });
|
|
5718
|
+
ke(We(), V);
|
|
5719
|
+
ke(jt(), V);
|
|
5720
|
+
ke(mr(), V);
|
|
5721
|
+
ke(Ze(), V);
|
|
5722
|
+
ke(jr(), V);
|
|
5723
|
+
ke(Be(), V);
|
|
5724
5724
|
});
|
|
5725
5725
|
|
|
5726
5726
|
// ../node_modules/zod/lib/index.js
|
|
5727
|
-
var
|
|
5727
|
+
var Pr = T((Z) => {
|
|
5728
5728
|
"use strict";
|
|
5729
|
-
var
|
|
5729
|
+
var Sr = Z && Z.__createBinding || (Object.create ? function(s, e, t, r) {
|
|
5730
5730
|
r === void 0 && (r = t);
|
|
5731
5731
|
var i = Object.getOwnPropertyDescriptor(e, t);
|
|
5732
5732
|
(!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: /* @__PURE__ */ d(function() {
|
|
@@ -5734,50 +5734,50 @@ var Nr = O((A) => {
|
|
|
5734
5734
|
}, "get") }), Object.defineProperty(s, r, i);
|
|
5735
5735
|
} : function(s, e, t, r) {
|
|
5736
5736
|
r === void 0 && (r = t), s[r] = e[t];
|
|
5737
|
-
}),
|
|
5737
|
+
}), Ei = Z && Z.__setModuleDefault || (Object.create ? function(s, e) {
|
|
5738
5738
|
Object.defineProperty(s, "default", { enumerable: !0, value: e });
|
|
5739
5739
|
} : function(s, e) {
|
|
5740
5740
|
s.default = e;
|
|
5741
|
-
}),
|
|
5741
|
+
}), Pi = Z && Z.__importStar || function(s) {
|
|
5742
5742
|
if (s && s.__esModule) return s;
|
|
5743
5743
|
var e = {};
|
|
5744
|
-
if (s != null) for (var t in s) t !== "default" && Object.prototype.hasOwnProperty.call(s, t) &&
|
|
5745
|
-
return
|
|
5746
|
-
},
|
|
5747
|
-
for (var t in s) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) &&
|
|
5744
|
+
if (s != null) for (var t in s) t !== "default" && Object.prototype.hasOwnProperty.call(s, t) && Sr(e, s, t);
|
|
5745
|
+
return Ei(e, s), e;
|
|
5746
|
+
}, Ni = Z && Z.__exportStar || function(s, e) {
|
|
5747
|
+
for (var t in s) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) && Sr(e, s, t);
|
|
5748
5748
|
};
|
|
5749
|
-
Object.defineProperty(
|
|
5750
|
-
|
|
5751
|
-
var
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5749
|
+
Object.defineProperty(Z, "__esModule", { value: !0 });
|
|
5750
|
+
Z.z = void 0;
|
|
5751
|
+
var Er = Pi(Pt());
|
|
5752
|
+
Z.z = Er;
|
|
5753
|
+
Ni(Pt(), Z);
|
|
5754
|
+
Z.default = Er;
|
|
5755
5755
|
});
|
|
5756
5756
|
|
|
5757
5757
|
// src/cli/bin/index.ts
|
|
5758
|
-
var
|
|
5758
|
+
var W = require("storybook/internal/common"), D = require("storybook/internal/node-logger"), $r = require("storybook/internal/telemetry"), Ve = ee(Wt(), 1);
|
|
5759
5759
|
|
|
5760
5760
|
// ../node_modules/fd-package-json/dist/esm/main.js
|
|
5761
|
-
var
|
|
5762
|
-
async function
|
|
5761
|
+
var Jt = ee(Gt(), 1), Yt = require("node:path"), Me = require("node:fs/promises"), Kt = require("node:fs");
|
|
5762
|
+
async function as(s) {
|
|
5763
5763
|
try {
|
|
5764
5764
|
return (await (0, Me.stat)(s)).isFile();
|
|
5765
5765
|
} catch {
|
|
5766
5766
|
return !1;
|
|
5767
5767
|
}
|
|
5768
5768
|
}
|
|
5769
|
-
d(
|
|
5770
|
-
async function
|
|
5771
|
-
for (let e of (0,
|
|
5772
|
-
let t = (0,
|
|
5773
|
-
if (await
|
|
5769
|
+
d(as, "fileExists");
|
|
5770
|
+
async function os(s) {
|
|
5771
|
+
for (let e of (0, Jt.walkUp)(s)) {
|
|
5772
|
+
let t = (0, Yt.resolve)(e, "package.json");
|
|
5773
|
+
if (await as(t))
|
|
5774
5774
|
return t;
|
|
5775
5775
|
}
|
|
5776
5776
|
return null;
|
|
5777
5777
|
}
|
|
5778
|
-
d(
|
|
5779
|
-
async function
|
|
5780
|
-
let e = await
|
|
5778
|
+
d(os, "findPackagePath");
|
|
5779
|
+
async function G(s) {
|
|
5780
|
+
let e = await os(s);
|
|
5781
5781
|
if (!e)
|
|
5782
5782
|
return null;
|
|
5783
5783
|
try {
|
|
@@ -5787,11 +5787,11 @@ async function K(s) {
|
|
|
5787
5787
|
return null;
|
|
5788
5788
|
}
|
|
5789
5789
|
}
|
|
5790
|
-
d(
|
|
5790
|
+
d(G, "findPackage");
|
|
5791
5791
|
|
|
5792
5792
|
// ../node_modules/leven/index.js
|
|
5793
|
-
var
|
|
5794
|
-
function
|
|
5793
|
+
var vt = [], Xt = [];
|
|
5794
|
+
function bt(s, e) {
|
|
5795
5795
|
if (s === e)
|
|
5796
5796
|
return 0;
|
|
5797
5797
|
let t = s;
|
|
@@ -5804,209 +5804,137 @@ function kt(s, e) {
|
|
|
5804
5804
|
n++;
|
|
5805
5805
|
if (r -= n, i -= n, r === 0)
|
|
5806
5806
|
return i;
|
|
5807
|
-
let
|
|
5807
|
+
let a, o, c, h, p = 0, y = 0;
|
|
5808
5808
|
for (; p < r; )
|
|
5809
|
-
|
|
5809
|
+
Xt[p] = s.charCodeAt(n + p), vt[p] = ++p;
|
|
5810
5810
|
for (; y < i; )
|
|
5811
|
-
for (
|
|
5812
|
-
h =
|
|
5813
|
-
return
|
|
5811
|
+
for (a = e.charCodeAt(n + y), c = y++, o = y, p = 0; p < r; p++)
|
|
5812
|
+
h = a === Xt[p] ? c : c + 1, c = vt[p], o = vt[p] = c > o ? h > o ? o + 1 : h : h > c ? c + 1 : h;
|
|
5813
|
+
return o;
|
|
5814
5814
|
}
|
|
5815
|
-
d(
|
|
5815
|
+
d(bt, "leven");
|
|
5816
5816
|
|
|
5817
5817
|
// src/cli/bin/index.ts
|
|
5818
|
-
var
|
|
5818
|
+
var ye = ee(tr(), 1);
|
|
5819
5819
|
|
|
5820
5820
|
// ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
|
|
5821
|
-
var
|
|
5822
|
-
function
|
|
5821
|
+
var cs = process.env.NODE_ENV === "production", wt = "Invariant failed";
|
|
5822
|
+
function J(s, e) {
|
|
5823
5823
|
if (!s) {
|
|
5824
|
-
if (
|
|
5825
|
-
throw new Error(
|
|
5826
|
-
var t = typeof e == "function" ? e() : e, r = t ? "".concat(
|
|
5824
|
+
if (cs)
|
|
5825
|
+
throw new Error(wt);
|
|
5826
|
+
var t = typeof e == "function" ? e() : e, r = t ? "".concat(wt, ": ").concat(t) : wt;
|
|
5827
5827
|
throw new Error(r);
|
|
5828
5828
|
}
|
|
5829
5829
|
}
|
|
5830
|
-
d(
|
|
5830
|
+
d(J, "invariant");
|
|
5831
5831
|
|
|
5832
5832
|
// package.json
|
|
5833
|
-
var
|
|
5833
|
+
var Ct = "9.1.1";
|
|
5834
5834
|
|
|
5835
5835
|
// src/cli/build.ts
|
|
5836
|
-
var
|
|
5837
|
-
var
|
|
5838
|
-
let e = await
|
|
5839
|
-
|
|
5836
|
+
var rr = require("storybook/internal/common"), Ue = require("storybook/internal/core-server");
|
|
5837
|
+
var sr = /* @__PURE__ */ d(async (s) => {
|
|
5838
|
+
let e = await G(__dirname);
|
|
5839
|
+
J(e, "Failed to find the closest package.json file.");
|
|
5840
5840
|
let t = {
|
|
5841
5841
|
...s,
|
|
5842
5842
|
configDir: s.configDir || "./.storybook",
|
|
5843
5843
|
outputDir: s.outputDir || "./storybook-static",
|
|
5844
5844
|
ignorePreview: !!s.previewUrl && !s.forceBuildPreview,
|
|
5845
5845
|
configType: "PRODUCTION",
|
|
5846
|
-
cache:
|
|
5846
|
+
cache: rr.cache,
|
|
5847
5847
|
packageJson: e
|
|
5848
5848
|
};
|
|
5849
|
-
await (0,
|
|
5849
|
+
await (0, Ue.withTelemetry)(
|
|
5850
5850
|
"build",
|
|
5851
5851
|
{ cliOptions: s, presetOptions: t },
|
|
5852
|
-
() => (0,
|
|
5852
|
+
() => (0, Ue.buildStaticStandalone)(t)
|
|
5853
5853
|
);
|
|
5854
5854
|
}, "build");
|
|
5855
5855
|
|
|
5856
5856
|
// src/cli/buildIndex.ts
|
|
5857
|
-
var
|
|
5858
|
-
var
|
|
5857
|
+
var ir = require("storybook/internal/common"), Fe = require("storybook/internal/core-server");
|
|
5858
|
+
var nr = /* @__PURE__ */ d(async (s) => {
|
|
5859
5859
|
let e = {
|
|
5860
5860
|
...s,
|
|
5861
5861
|
configDir: s.configDir || ".storybook",
|
|
5862
5862
|
outputFile: s.outputFile || "index.json",
|
|
5863
5863
|
ignorePreview: !0,
|
|
5864
5864
|
configType: "PRODUCTION",
|
|
5865
|
-
cache:
|
|
5865
|
+
cache: ir.cache,
|
|
5866
5866
|
packageJson: s.packageJson
|
|
5867
5867
|
}, t = {
|
|
5868
5868
|
...e,
|
|
5869
5869
|
corePresets: [],
|
|
5870
5870
|
overridePresets: []
|
|
5871
5871
|
};
|
|
5872
|
-
await (0,
|
|
5872
|
+
await (0, Fe.withTelemetry)("index", { cliOptions: s, presetOptions: t }, () => (0, Fe.buildIndexStandalone)(e));
|
|
5873
5873
|
}, "buildIndex");
|
|
5874
5874
|
|
|
5875
5875
|
// src/cli/dev.ts
|
|
5876
|
-
var
|
|
5877
|
-
var
|
|
5878
|
-
function
|
|
5879
|
-
|
|
5880
|
-
errors.forEach((e) =>
|
|
5881
|
-
e)),
|
|
5882
|
-
s.close ?
|
|
5876
|
+
var or = require("storybook/internal/common"), He = require("storybook/internal/core-server"), R = require("storybook/internal/node-logger");
|
|
5877
|
+
var It = ee(kt(), 1);
|
|
5878
|
+
function ps(s) {
|
|
5879
|
+
R.instance.heading = "", s instanceof Error ? s.error ? R.logger.error(s.error) : s.stats && s.stats.compilation.errors ? s.stats.compilation.
|
|
5880
|
+
errors.forEach((e) => R.logger.plain(e)) : R.logger.error(s) : s.compilation?.errors && s.compilation.errors.forEach((e) => R.logger.plain(
|
|
5881
|
+
e)), R.logger.line(), R.logger.warn(
|
|
5882
|
+
s.close ? It.dedent`
|
|
5883
5883
|
FATAL broken build!, will close the process,
|
|
5884
5884
|
Fix the error below and restart storybook.
|
|
5885
|
-
` :
|
|
5885
|
+
` : It.dedent`
|
|
5886
5886
|
Broken build, fix the error above.
|
|
5887
5887
|
You may need to refresh the browser.
|
|
5888
5888
|
`
|
|
5889
|
-
),
|
|
5889
|
+
), R.logger.line();
|
|
5890
5890
|
}
|
|
5891
|
-
d(
|
|
5892
|
-
var
|
|
5891
|
+
d(ps, "printError");
|
|
5892
|
+
var dr = /* @__PURE__ */ d(async (s) => {
|
|
5893
5893
|
let { env: e } = process;
|
|
5894
5894
|
e.NODE_ENV = e.NODE_ENV || "development";
|
|
5895
|
-
let t = await
|
|
5896
|
-
|
|
5895
|
+
let t = await G(__dirname);
|
|
5896
|
+
J(t, "Failed to find the closest package.json file.");
|
|
5897
5897
|
let r = {
|
|
5898
5898
|
...s,
|
|
5899
5899
|
configDir: s.configDir || "./.storybook",
|
|
5900
5900
|
configType: "DEVELOPMENT",
|
|
5901
5901
|
ignorePreview: !!s.previewUrl && !s.forceBuildPreview,
|
|
5902
|
-
cache:
|
|
5902
|
+
cache: or.cache,
|
|
5903
5903
|
packageJson: t
|
|
5904
5904
|
};
|
|
5905
|
-
await (0,
|
|
5905
|
+
await (0, He.withTelemetry)(
|
|
5906
5906
|
"dev",
|
|
5907
5907
|
{
|
|
5908
5908
|
cliOptions: s,
|
|
5909
5909
|
presetOptions: r,
|
|
5910
|
-
printError:
|
|
5910
|
+
printError: ps
|
|
5911
5911
|
},
|
|
5912
|
-
() => (0,
|
|
5912
|
+
() => (0, He.buildDevStandalone)(r)
|
|
5913
5913
|
);
|
|
5914
5914
|
}, "dev");
|
|
5915
5915
|
|
|
5916
5916
|
// src/cli/globalSettings.ts
|
|
5917
|
-
var
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
var Dr = Q(Ot(), 1);
|
|
5921
|
-
|
|
5922
|
-
// src/storybook-error.ts
|
|
5923
|
-
function Vr({
|
|
5924
|
-
code: s,
|
|
5925
|
-
category: e
|
|
5926
|
-
}) {
|
|
5927
|
-
let t = String(s).padStart(4, "0");
|
|
5928
|
-
return `SB_${e}_${t}`;
|
|
5929
|
-
}
|
|
5930
|
-
d(Vr, "parseErrorCode");
|
|
5931
|
-
var Qe = class s extends Error {
|
|
5932
|
-
constructor(t) {
|
|
5933
|
-
super(s.getFullMessage(t));
|
|
5934
|
-
/**
|
|
5935
|
-
* Data associated with the error. Used to provide additional information in the error message or
|
|
5936
|
-
* to be passed to telemetry.
|
|
5937
|
-
*/
|
|
5938
|
-
this.data = {};
|
|
5939
|
-
/** Flag used to easily determine if the error originates from Storybook. */
|
|
5940
|
-
this.fromStorybook = !0;
|
|
5941
|
-
this.category = t.category, this.documentation = t.documentation ?? !1, this.code = t.code;
|
|
5942
|
-
}
|
|
5943
|
-
static {
|
|
5944
|
-
d(this, "StorybookError");
|
|
5945
|
-
}
|
|
5946
|
-
get fullErrorCode() {
|
|
5947
|
-
return Vr({ code: this.code, category: this.category });
|
|
5948
|
-
}
|
|
5949
|
-
/** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
|
|
5950
|
-
get name() {
|
|
5951
|
-
let t = this.constructor.name;
|
|
5952
|
-
return `${this.fullErrorCode} (${t})`;
|
|
5953
|
-
}
|
|
5954
|
-
/** Generates the error message along with additional documentation link (if applicable). */
|
|
5955
|
-
static getFullMessage({
|
|
5956
|
-
documentation: t,
|
|
5957
|
-
code: r,
|
|
5958
|
-
category: i,
|
|
5959
|
-
message: n
|
|
5960
|
-
}) {
|
|
5961
|
-
let o;
|
|
5962
|
-
return t === !0 ? o = `https://storybook.js.org/error/${Vr({ code: r, category: i })}` : typeof t == "string" ? o = t : Array.isArray(t) &&
|
|
5963
|
-
(o = `
|
|
5964
|
-
${t.map((a) => ` - ${a}`).join(`
|
|
5965
|
-
`)}`), `${n}${o != null ? `
|
|
5966
|
-
|
|
5967
|
-
More info: ${o}
|
|
5968
|
-
` : ""}`;
|
|
5969
|
-
}
|
|
5970
|
-
};
|
|
5971
|
-
|
|
5972
|
-
// src/server-errors.ts
|
|
5973
|
-
var et = class extends Qe {
|
|
5974
|
-
constructor(t) {
|
|
5975
|
-
super({
|
|
5976
|
-
category: "CORE-SERVER",
|
|
5977
|
-
code: 1,
|
|
5978
|
-
message: Dr.dedent`
|
|
5979
|
-
Unable to save global settings file to ${t.filePath}
|
|
5980
|
-
${t.error && `Reason: ${t.error}`}`
|
|
5981
|
-
});
|
|
5982
|
-
this.data = t;
|
|
5983
|
-
}
|
|
5984
|
-
static {
|
|
5985
|
-
d(this, "SavingGlobalSettingsFileError");
|
|
5986
|
-
}
|
|
5987
|
-
};
|
|
5988
|
-
|
|
5989
|
-
// src/cli/globalSettings.ts
|
|
5990
|
-
var $i = (0, st.join)((0, $r.homedir)(), ".storybook", "settings.json"), Mi = 1, Li = Ie.z.object({
|
|
5991
|
-
version: Ie.z.number(),
|
|
5917
|
+
var Qe = ee(require("node:fs/promises"), 1), Nr = require("node:os"), tt = require("node:path"), Vr = ee(kt(), 1), Te = ee(Pr(), 1);
|
|
5918
|
+
var Vi = (0, tt.join)((0, Nr.homedir)(), ".storybook", "settings.json"), Di = 1, $i = Te.z.object({
|
|
5919
|
+
version: Te.z.number(),
|
|
5992
5920
|
// NOTE: every key (and subkey) below must be optional, for forwards compatibility reasons
|
|
5993
5921
|
// (we can remove keys once they are deprecated)
|
|
5994
|
-
userSince:
|
|
5995
|
-
init:
|
|
5996
|
-
}),
|
|
5997
|
-
async function
|
|
5998
|
-
if (
|
|
5999
|
-
return
|
|
5922
|
+
userSince: Te.z.number().optional(),
|
|
5923
|
+
init: Te.z.object({ skipOnboarding: Te.z.boolean().optional() }).optional()
|
|
5924
|
+
}), Ie;
|
|
5925
|
+
async function Dr(s = Vi) {
|
|
5926
|
+
if (Ie)
|
|
5927
|
+
return Ie;
|
|
6000
5928
|
try {
|
|
6001
|
-
let e = await
|
|
6002
|
-
|
|
5929
|
+
let e = await Qe.default.readFile(s, "utf8"), t = $i.parse(JSON.parse(e));
|
|
5930
|
+
Ie = new et(s, t);
|
|
6003
5931
|
} catch {
|
|
6004
|
-
|
|
5932
|
+
Ie = new et(s, { version: Di, userSince: Date.now() }), await Ie.save();
|
|
6005
5933
|
}
|
|
6006
|
-
return
|
|
5934
|
+
return Ie;
|
|
6007
5935
|
}
|
|
6008
|
-
d(
|
|
6009
|
-
var
|
|
5936
|
+
d(Dr, "globalSettings");
|
|
5937
|
+
var et = class {
|
|
6010
5938
|
static {
|
|
6011
5939
|
d(this, "Settings");
|
|
6012
5940
|
}
|
|
@@ -6022,48 +5950,46 @@ var rt = class {
|
|
|
6022
5950
|
/** Save settings to the file */
|
|
6023
5951
|
async save() {
|
|
6024
5952
|
try {
|
|
6025
|
-
await
|
|
5953
|
+
await Qe.default.mkdir((0, tt.dirname)(this.filePath), { recursive: !0 }), await Qe.default.writeFile(this.filePath, JSON.stringify(this.
|
|
6026
5954
|
value, null, 2));
|
|
6027
5955
|
} catch (e) {
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
});
|
|
5956
|
+
console.warn(Vr.dedent`
|
|
5957
|
+
Unable to save global settings file to ${this.filePath}
|
|
5958
|
+
${e && `Reason: ${e.message ?? e}`}`);
|
|
6032
5959
|
}
|
|
6033
5960
|
}
|
|
6034
5961
|
};
|
|
6035
5962
|
|
|
6036
5963
|
// src/cli/bin/index.ts
|
|
6037
|
-
(0,
|
|
6038
|
-
var
|
|
5964
|
+
(0, $r.addToGlobalContext)("cliVersion", Ct);
|
|
5965
|
+
var Nt = /* @__PURE__ */ d((s) => Ve.program.command(s).option(
|
|
6039
5966
|
"--disable-telemetry",
|
|
6040
5967
|
"Disable sending telemetry data",
|
|
6041
|
-
|
|
6042
|
-
process.env.STORYBOOK_DISABLE_TELEMETRY && process.env.STORYBOOK_DISABLE_TELEMETRY !== "false"
|
|
5968
|
+
(0, W.optionalEnvToBoolean)(process.env.STORYBOOK_DISABLE_TELEMETRY)
|
|
6043
5969
|
).option("--debug", "Get more logs in debug mode", !1).option("--enable-crash-reports", "Enable sending crash reports to telemetry data").option(
|
|
6044
5970
|
"--loglevel <trace | debug | info | warn | error | silent>", "Define log level", "info").option("--write-logs", "Write all debug logs to a f\
|
|
6045
5971
|
ile at the end of the run").hook("preAction", async (e) => {
|
|
6046
5972
|
try {
|
|
6047
5973
|
let t = e.opts();
|
|
6048
|
-
t.loglevel &&
|
|
5974
|
+
t.loglevel && D.logger.setLogLevel(t.loglevel), t.writeLogs && D.logTracker.enableLogWriting(), await Dr();
|
|
6049
5975
|
} catch (t) {
|
|
6050
|
-
|
|
5976
|
+
D.logger.error(`Error loading global settings:
|
|
6051
5977
|
` + String(t));
|
|
6052
5978
|
}
|
|
6053
5979
|
}).hook("postAction", async () => {
|
|
6054
|
-
if (
|
|
6055
|
-
let e = await
|
|
6056
|
-
|
|
5980
|
+
if (D.logTracker.shouldWriteLogsToFile) {
|
|
5981
|
+
let e = await D.logTracker.writeToFile();
|
|
5982
|
+
D.logger.outro(`Storybook debug logs can be found at: ${e}`);
|
|
6057
5983
|
}
|
|
6058
5984
|
}), "command");
|
|
6059
|
-
|
|
5985
|
+
Nt("dev").option("-p, --port <number>", "Port to run Storybook", (s) => parseInt(s, 10)).option("-h, --host <string>", "Host to run Storyboo\
|
|
6060
5986
|
k").option("-c, --config-dir <dir-name>", "Directory where to load Storybook configurations from").option(
|
|
6061
5987
|
"--https",
|
|
6062
5988
|
"Serve Storybook over HTTPS. Note: You must provide your own certificate information."
|
|
6063
5989
|
).option(
|
|
6064
5990
|
"--ssl-ca <ca>",
|
|
6065
5991
|
"Provide an SSL certificate authority. (Optional with --https, required if using a self-signed certificate)",
|
|
6066
|
-
|
|
5992
|
+
W.parseList
|
|
6067
5993
|
).option("--ssl-cert <cert>", "Provide an SSL certificate. (Required with --https)").option("--ssl-key <key>", "Provide an SSL key. (Require\
|
|
6068
5994
|
d with --https)").option("--smoke-test", "Exit after successful start").option("--ci", "CI mode (skip interactive prompts, don't open browse\
|
|
6069
5995
|
r)").option("--no-open", "Do not open Storybook automatically in the browser").option("--quiet", "Suppress verbose build output").option("--\
|
|
@@ -6078,17 +6004,17 @@ ly site using addon-docs").option("--exact-port", "Exit early if the desired por
|
|
|
6078
6004
|
"--initial-path [path]",
|
|
6079
6005
|
"URL path to be appended when visiting Storybook for the first time"
|
|
6080
6006
|
).option("--preview-only", "Use the preview without the manager UI").action(async (s) => {
|
|
6081
|
-
let e = await
|
|
6082
|
-
|
|
6083
|
-
`)), (0,
|
|
6007
|
+
let e = await G(__dirname);
|
|
6008
|
+
J(e, "Failed to find the closest package.json file."), D.logger.log(ye.default.bold(`${e.name} v${e.version}`) + ye.default.reset(`
|
|
6009
|
+
`)), (0, W.getEnvConfig)(s, {
|
|
6084
6010
|
port: "SBCONFIG_PORT",
|
|
6085
6011
|
host: "SBCONFIG_HOSTNAME",
|
|
6086
6012
|
staticDir: "SBCONFIG_STATIC_DIR",
|
|
6087
6013
|
configDir: "SBCONFIG_CONFIG_DIR",
|
|
6088
6014
|
ci: "CI"
|
|
6089
|
-
}), parseInt(`${s.port}`, 10) && (s.port = parseInt(`${s.port}`, 10)), await
|
|
6015
|
+
}), parseInt(`${s.port}`, 10) && (s.port = parseInt(`${s.port}`, 10)), await dr({ ...s, packageJson: e }).catch(() => process.exit(1));
|
|
6090
6016
|
});
|
|
6091
|
-
|
|
6017
|
+
Nt("build").option("-o, --output-dir <dir-name>", "Directory where to store built files").option("-c, --config-dir <dir-name>", "Directory w\
|
|
6092
6018
|
here to load Storybook configurations from").option("--quiet", "Suppress verbose build output").option("--debug-webpack", "Display final web\
|
|
6093
6019
|
pack configurations for debugging purposes").option(
|
|
6094
6020
|
"--webpack-stats-json [directory]",
|
|
@@ -6101,36 +6027,36 @@ ly site using addon-docs").option("--test", "Build stories optimized for testing
|
|
|
6101
6027
|
ut the manager UI").action(async (s) => {
|
|
6102
6028
|
let { env: e } = process;
|
|
6103
6029
|
e.NODE_ENV = e.NODE_ENV || "production";
|
|
6104
|
-
let t = await
|
|
6105
|
-
|
|
6106
|
-
`)), (0,
|
|
6030
|
+
let t = await G(__dirname);
|
|
6031
|
+
J(t, "Failed to find the closest package.json file."), D.logger.log(ye.default.bold(`${t.name} v${t.version}
|
|
6032
|
+
`)), (0, W.getEnvConfig)(s, {
|
|
6107
6033
|
staticDir: "SBCONFIG_STATIC_DIR",
|
|
6108
6034
|
outputDir: "SBCONFIG_OUTPUT_DIR",
|
|
6109
6035
|
configDir: "SBCONFIG_CONFIG_DIR"
|
|
6110
|
-
}), await
|
|
6036
|
+
}), await sr({
|
|
6111
6037
|
...s,
|
|
6112
6038
|
packageJson: t,
|
|
6113
|
-
test: !!s.test || process.env.SB_TESTBUILD
|
|
6039
|
+
test: !!s.test || (0, W.optionalEnvToBoolean)(process.env.SB_TESTBUILD)
|
|
6114
6040
|
}).catch(() => process.exit(1));
|
|
6115
6041
|
});
|
|
6116
|
-
|
|
6042
|
+
Nt("index").option("-o, --output-file <file-name>", "JSON file to output index").option("-c, --config-dir <dir-name>", "Directory where to l\
|
|
6117
6043
|
oad Storybook configurations from").option("--quiet", "Suppress verbose build output").action(async (s) => {
|
|
6118
6044
|
let { env: e } = process;
|
|
6119
6045
|
e.NODE_ENV = e.NODE_ENV || "production";
|
|
6120
|
-
let t = await
|
|
6121
|
-
|
|
6122
|
-
`)), (0,
|
|
6046
|
+
let t = await G(__dirname);
|
|
6047
|
+
J(t, "Failed to find the closest package.json file."), D.logger.log(ye.default.bold(`${t.name} v${t.version}
|
|
6048
|
+
`)), (0, W.getEnvConfig)(s, {
|
|
6123
6049
|
configDir: "SBCONFIG_CONFIG_DIR",
|
|
6124
6050
|
outputFile: "SBCONFIG_OUTPUT_FILE"
|
|
6125
|
-
}), await
|
|
6051
|
+
}), await nr({
|
|
6126
6052
|
...s,
|
|
6127
6053
|
packageJson: t
|
|
6128
6054
|
}).catch(() => process.exit(1));
|
|
6129
6055
|
});
|
|
6130
|
-
|
|
6131
|
-
let e = ` Invalid command: ${
|
|
6132
|
-
See --help for a list of available commands.`, r =
|
|
6056
|
+
Ve.program.on("command:*", ([s]) => {
|
|
6057
|
+
let e = ` Invalid command: ${ye.default.bold(s)}.
|
|
6058
|
+
See --help for a list of available commands.`, r = Ve.program.commands.map((i) => i.name()).find((i) => bt(i, s) < 3);
|
|
6133
6059
|
r && (e += `
|
|
6134
|
-
Did you mean ${
|
|
6060
|
+
Did you mean ${ye.default.yellow(r)}?`), D.logger.error(e), process.exit(1);
|
|
6135
6061
|
});
|
|
6136
|
-
|
|
6062
|
+
Ve.program.usage("<command> [options]").version(String(Ct)).parse(process.argv);
|