@maz-ui/utils 4.0.0-beta.6 → 4.0.0-beta.7
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/chunks/chunk-hooks.DXGlb1Dd.js +2471 -0
- package/dist/chunks/magic-string.es.BQ9KnLz-.js +659 -0
- package/dist/formatters/__tests__/capitalize.spec.js +10 -0
- package/dist/formatters/__tests__/currency.spec.js +24 -0
- package/dist/formatters/__tests__/date.spec.js +20 -0
- package/dist/formatters/__tests__/number.spec.js +16 -0
- package/dist/formatters/__tests__/telephone.spec.js +11 -0
- package/dist/helpers/__tests__/NormalizeString.spec.js +43 -0
- package/dist/helpers/__tests__/ScriptLoader.spec.js +67 -0
- package/dist/helpers/__tests__/SwipeHandler.spec.js +54 -0
- package/dist/helpers/__tests__/checkAvailability.spec.js +46 -0
- package/dist/helpers/__tests__/countryCodeToUnicodeFlag.spec.js +16 -0
- package/dist/helpers/__tests__/debounceId.spec.js +16 -0
- package/dist/helpers/__tests__/debouneCallback.spec.js +12 -0
- package/dist/helpers/__tests__/isEqual.spec.js +46 -0
- package/dist/helpers/__tests__/isStandaloneMode.spec.js +8586 -0
- package/dist/helpers/__tests__/sleep.spec.js +16 -0
- package/dist/helpers/__tests__/throttle.spec.js +43 -0
- package/dist/helpers/__tests__/throttleId.spec.js +22 -0
- package/dist/helpers/__tests__/userVisibility.spec.js +58 -0
- package/dist/{utils → helpers}/getBrowserLocale.js +1 -1
- package/dist/helpers/index.js +44 -0
- package/dist/helpers/isServer.js +6 -0
- package/dist/{utils → helpers}/isStandaloneMode.js +2 -2
- package/dist/{utils → helpers}/scriptLoader.js +9 -9
- package/dist/index.js +40 -44
- package/dist/types/{utils → helpers}/index.d.ts +0 -2
- package/dist/types/{utils → helpers}/scriptLoader.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +16 -14
- package/dist/types/utils/execPromise.d.ts +0 -11
- package/dist/types/utils/logger.d.ts +0 -10
- package/dist/utils/execPromise.js +0 -13
- package/dist/utils/index.js +0 -48
- package/dist/utils/isServer.js +0 -6
- package/dist/utils/logger.js +0 -20
- /package/dist/{utils → helpers}/TextareaAutogrow.js +0 -0
- /package/dist/{utils → helpers}/checkAvailability.js +0 -0
- /package/dist/{utils → helpers}/countryCodeToUnicodeFlag.js +0 -0
- /package/dist/{utils → helpers}/debounce.js +0 -0
- /package/dist/{utils → helpers}/debounceCallback.js +0 -0
- /package/dist/{utils → helpers}/debounceId.js +0 -0
- /package/dist/{utils → helpers}/fetchLocaleIp.js +0 -0
- /package/dist/{utils → helpers}/getCountryFlagUrl.js +0 -0
- /package/dist/{utils → helpers}/getErrorMessage.js +0 -0
- /package/dist/{utils → helpers}/idleTimeout.js +0 -0
- /package/dist/{utils → helpers}/isClient.js +0 -0
- /package/dist/{utils → helpers}/isEqual.js +0 -0
- /package/dist/{utils → helpers}/normalizeString.js +0 -0
- /package/dist/{utils → helpers}/sleep.js +0 -0
- /package/dist/{utils → helpers}/swipeHandler.js +0 -0
- /package/dist/{utils → helpers}/throttle.js +0 -0
- /package/dist/{utils → helpers}/throttleId.js +0 -0
- /package/dist/{utils → helpers}/truthyFilter.js +0 -0
- /package/dist/{utils → helpers}/userVisibility.js +0 -0
- /package/dist/types/{utils → helpers}/TextareaAutogrow.d.ts +0 -0
- /package/dist/types/{utils → helpers}/checkAvailability.d.ts +0 -0
- /package/dist/types/{utils → helpers}/countryCodeToUnicodeFlag.d.ts +0 -0
- /package/dist/types/{utils → helpers}/debounce.d.ts +0 -0
- /package/dist/types/{utils → helpers}/debounceCallback.d.ts +0 -0
- /package/dist/types/{utils → helpers}/debounceId.d.ts +0 -0
- /package/dist/types/{utils → helpers}/fetchLocaleIp.d.ts +0 -0
- /package/dist/types/{utils → helpers}/getBrowserLocale.d.ts +0 -0
- /package/dist/types/{utils → helpers}/getCountryFlagUrl.d.ts +0 -0
- /package/dist/types/{utils → helpers}/getErrorMessage.d.ts +0 -0
- /package/dist/types/{utils → helpers}/idleTimeout.d.ts +0 -0
- /package/dist/types/{utils → helpers}/isClient.d.ts +0 -0
- /package/dist/types/{utils → helpers}/isEqual.d.ts +0 -0
- /package/dist/types/{utils → helpers}/isServer.d.ts +0 -0
- /package/dist/types/{utils → helpers}/isStandaloneMode.d.ts +0 -0
- /package/dist/types/{utils → helpers}/normalizeString.d.ts +0 -0
- /package/dist/types/{utils → helpers}/sleep.d.ts +0 -0
- /package/dist/types/{utils → helpers}/swipeHandler.d.ts +0 -0
- /package/dist/types/{utils → helpers}/throttle.d.ts +0 -0
- /package/dist/types/{utils → helpers}/throttleId.d.ts +0 -0
- /package/dist/types/{utils → helpers}/truthyFilter.d.ts +0 -0
- /package/dist/types/{utils → helpers}/userVisibility.d.ts +0 -0
|
@@ -0,0 +1,2471 @@
|
|
|
1
|
+
import { isatty as un } from "tty";
|
|
2
|
+
var an = {
|
|
3
|
+
reset: [0, 0],
|
|
4
|
+
bold: [1, 22, "\x1B[22m\x1B[1m"],
|
|
5
|
+
dim: [2, 22, "\x1B[22m\x1B[2m"],
|
|
6
|
+
italic: [3, 23],
|
|
7
|
+
underline: [4, 24],
|
|
8
|
+
inverse: [7, 27],
|
|
9
|
+
hidden: [8, 28],
|
|
10
|
+
strikethrough: [9, 29],
|
|
11
|
+
black: [30, 39],
|
|
12
|
+
red: [31, 39],
|
|
13
|
+
green: [32, 39],
|
|
14
|
+
yellow: [33, 39],
|
|
15
|
+
blue: [34, 39],
|
|
16
|
+
magenta: [35, 39],
|
|
17
|
+
cyan: [36, 39],
|
|
18
|
+
white: [37, 39],
|
|
19
|
+
gray: [90, 39],
|
|
20
|
+
bgBlack: [40, 49],
|
|
21
|
+
bgRed: [41, 49],
|
|
22
|
+
bgGreen: [42, 49],
|
|
23
|
+
bgYellow: [43, 49],
|
|
24
|
+
bgBlue: [44, 49],
|
|
25
|
+
bgMagenta: [45, 49],
|
|
26
|
+
bgCyan: [46, 49],
|
|
27
|
+
bgWhite: [47, 49],
|
|
28
|
+
blackBright: [90, 39],
|
|
29
|
+
redBright: [91, 39],
|
|
30
|
+
greenBright: [92, 39],
|
|
31
|
+
yellowBright: [93, 39],
|
|
32
|
+
blueBright: [94, 39],
|
|
33
|
+
magentaBright: [95, 39],
|
|
34
|
+
cyanBright: [96, 39],
|
|
35
|
+
whiteBright: [97, 39],
|
|
36
|
+
bgBlackBright: [100, 49],
|
|
37
|
+
bgRedBright: [101, 49],
|
|
38
|
+
bgGreenBright: [102, 49],
|
|
39
|
+
bgYellowBright: [103, 49],
|
|
40
|
+
bgBlueBright: [104, 49],
|
|
41
|
+
bgMagentaBright: [105, 49],
|
|
42
|
+
bgCyanBright: [106, 49],
|
|
43
|
+
bgWhiteBright: [107, 49]
|
|
44
|
+
}, ln = Object.entries(an);
|
|
45
|
+
function Ae(e) {
|
|
46
|
+
return String(e);
|
|
47
|
+
}
|
|
48
|
+
Ae.open = "";
|
|
49
|
+
Ae.close = "";
|
|
50
|
+
function fn(e = !1) {
|
|
51
|
+
let t = typeof process < "u" ? process : void 0, n = t?.env || {}, o = t?.argv || [];
|
|
52
|
+
return !("NO_COLOR" in n || o.includes("--no-color")) && ("FORCE_COLOR" in n || o.includes("--color") || t?.platform === "win32" || e && n.TERM !== "dumb" || "CI" in n) || typeof window < "u" && !!window.chrome;
|
|
53
|
+
}
|
|
54
|
+
function pn(e = !1) {
|
|
55
|
+
let t = fn(e), n = (i, c, u, a) => {
|
|
56
|
+
let l = "", d = 0;
|
|
57
|
+
do
|
|
58
|
+
l += i.substring(d, a) + u, d = a + c.length, a = i.indexOf(c, d);
|
|
59
|
+
while (~a);
|
|
60
|
+
return l + i.substring(d);
|
|
61
|
+
}, o = (i, c, u = i) => {
|
|
62
|
+
let a = (l) => {
|
|
63
|
+
let d = String(l), h = d.indexOf(c, i.length);
|
|
64
|
+
return ~h ? i + n(d, c, u, h) + c : i + d + c;
|
|
65
|
+
};
|
|
66
|
+
return a.open = i, a.close = c, a;
|
|
67
|
+
}, r = {
|
|
68
|
+
isColorSupported: t
|
|
69
|
+
}, s = (i) => `\x1B[${i}m`;
|
|
70
|
+
for (let [i, c] of ln)
|
|
71
|
+
r[i] = t ? o(
|
|
72
|
+
s(c[0]),
|
|
73
|
+
s(c[1]),
|
|
74
|
+
c[2]
|
|
75
|
+
) : Ae;
|
|
76
|
+
return r;
|
|
77
|
+
}
|
|
78
|
+
var dn = process.env.FORCE_TTY !== void 0 || un(1), mn = pn(dn);
|
|
79
|
+
function Tt(e, t) {
|
|
80
|
+
return t.forEach(function(n) {
|
|
81
|
+
n && typeof n != "string" && !Array.isArray(n) && Object.keys(n).forEach(function(o) {
|
|
82
|
+
if (o !== "default" && !(o in e)) {
|
|
83
|
+
var r = Object.getOwnPropertyDescriptor(n, o);
|
|
84
|
+
Object.defineProperty(e, o, r.get ? r : {
|
|
85
|
+
enumerable: !0,
|
|
86
|
+
get: function() {
|
|
87
|
+
return n[o];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}), Object.freeze(e);
|
|
93
|
+
}
|
|
94
|
+
function hn(e, t) {
|
|
95
|
+
const n = Object.keys(e), o = t === null ? n : n.sort(t);
|
|
96
|
+
if (Object.getOwnPropertySymbols)
|
|
97
|
+
for (const r of Object.getOwnPropertySymbols(e))
|
|
98
|
+
Object.getOwnPropertyDescriptor(e, r).enumerable && o.push(r);
|
|
99
|
+
return o;
|
|
100
|
+
}
|
|
101
|
+
function te(e, t, n, o, r, s, i = ": ") {
|
|
102
|
+
let c = "", u = 0, a = e.next();
|
|
103
|
+
if (!a.done) {
|
|
104
|
+
c += t.spacingOuter;
|
|
105
|
+
const l = n + t.indent;
|
|
106
|
+
for (; !a.done; ) {
|
|
107
|
+
if (c += l, u++ === t.maxWidth) {
|
|
108
|
+
c += "…";
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
const d = s(a.value[0], t, l, o, r), h = s(a.value[1], t, l, o, r);
|
|
112
|
+
c += d + i + h, a = e.next(), a.done ? t.min || (c += ",") : c += `,${t.spacingInner}`;
|
|
113
|
+
}
|
|
114
|
+
c += t.spacingOuter + n;
|
|
115
|
+
}
|
|
116
|
+
return c;
|
|
117
|
+
}
|
|
118
|
+
function Ce(e, t, n, o, r, s) {
|
|
119
|
+
let i = "", c = 0, u = e.next();
|
|
120
|
+
if (!u.done) {
|
|
121
|
+
i += t.spacingOuter;
|
|
122
|
+
const a = n + t.indent;
|
|
123
|
+
for (; !u.done; ) {
|
|
124
|
+
if (i += a, c++ === t.maxWidth) {
|
|
125
|
+
i += "…";
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
i += s(u.value, t, a, o, r), u = e.next(), u.done ? t.min || (i += ",") : i += `,${t.spacingInner}`;
|
|
129
|
+
}
|
|
130
|
+
i += t.spacingOuter + n;
|
|
131
|
+
}
|
|
132
|
+
return i;
|
|
133
|
+
}
|
|
134
|
+
function ce(e, t, n, o, r, s) {
|
|
135
|
+
let i = "";
|
|
136
|
+
e = e instanceof ArrayBuffer ? new DataView(e) : e;
|
|
137
|
+
const c = (a) => a instanceof DataView, u = c(e) ? e.byteLength : e.length;
|
|
138
|
+
if (u > 0) {
|
|
139
|
+
i += t.spacingOuter;
|
|
140
|
+
const a = n + t.indent;
|
|
141
|
+
for (let l = 0; l < u; l++) {
|
|
142
|
+
if (i += a, l === t.maxWidth) {
|
|
143
|
+
i += "…";
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
(c(e) || l in e) && (i += s(c(e) ? e.getInt8(l) : e[l], t, a, o, r)), l < u - 1 ? i += `,${t.spacingInner}` : t.min || (i += ",");
|
|
147
|
+
}
|
|
148
|
+
i += t.spacingOuter + n;
|
|
149
|
+
}
|
|
150
|
+
return i;
|
|
151
|
+
}
|
|
152
|
+
function xe(e, t, n, o, r, s) {
|
|
153
|
+
let i = "";
|
|
154
|
+
const c = hn(e, t.compareKeys);
|
|
155
|
+
if (c.length > 0) {
|
|
156
|
+
i += t.spacingOuter;
|
|
157
|
+
const u = n + t.indent;
|
|
158
|
+
for (let a = 0; a < c.length; a++) {
|
|
159
|
+
const l = c[a], d = s(l, t, u, o, r), h = s(e[l], t, u, o, r);
|
|
160
|
+
i += `${u + d}: ${h}`, a < c.length - 1 ? i += `,${t.spacingInner}` : t.min || (i += ",");
|
|
161
|
+
}
|
|
162
|
+
i += t.spacingOuter + n;
|
|
163
|
+
}
|
|
164
|
+
return i;
|
|
165
|
+
}
|
|
166
|
+
const yn = typeof Symbol == "function" && Symbol.for ? Symbol.for("jest.asymmetricMatcher") : 1267621, ne = " ", gn = (e, t, n, o, r, s) => {
|
|
167
|
+
const i = e.toString();
|
|
168
|
+
if (i === "ArrayContaining" || i === "ArrayNotContaining")
|
|
169
|
+
return ++o > t.maxDepth ? `[${i}]` : `${i + ne}[${ce(e.sample, t, n, o, r, s)}]`;
|
|
170
|
+
if (i === "ObjectContaining" || i === "ObjectNotContaining")
|
|
171
|
+
return ++o > t.maxDepth ? `[${i}]` : `${i + ne}{${xe(e.sample, t, n, o, r, s)}}`;
|
|
172
|
+
if (i === "StringMatching" || i === "StringNotMatching" || i === "StringContaining" || i === "StringNotContaining")
|
|
173
|
+
return i + ne + s(e.sample, t, n, o, r);
|
|
174
|
+
if (typeof e.toAsymmetricMatcher != "function")
|
|
175
|
+
throw new TypeError(`Asymmetric matcher ${e.constructor.name} does not implement toAsymmetricMatcher()`);
|
|
176
|
+
return e.toAsymmetricMatcher();
|
|
177
|
+
}, bn = (e) => e && e.$$typeof === yn, Sn = {
|
|
178
|
+
serialize: gn,
|
|
179
|
+
test: bn
|
|
180
|
+
}, En = " ", $t = /* @__PURE__ */ new Set(["DOMStringMap", "NamedNodeMap"]), Tn = /^(?:HTML\w*Collection|NodeList)$/;
|
|
181
|
+
function $n(e) {
|
|
182
|
+
return $t.has(e) || Tn.test(e);
|
|
183
|
+
}
|
|
184
|
+
const _n = (e) => e && e.constructor && !!e.constructor.name && $n(e.constructor.name);
|
|
185
|
+
function In(e) {
|
|
186
|
+
return e.constructor.name === "NamedNodeMap";
|
|
187
|
+
}
|
|
188
|
+
const wn = (e, t, n, o, r, s) => {
|
|
189
|
+
const i = e.constructor.name;
|
|
190
|
+
return ++o > t.maxDepth ? `[${i}]` : (t.min ? "" : i + En) + ($t.has(i) ? `{${xe(In(e) ? [...e].reduce((c, u) => (c[u.name] = u.value, c), {}) : { ...e }, t, n, o, r, s)}}` : `[${ce([...e], t, n, o, r, s)}]`);
|
|
191
|
+
}, An = {
|
|
192
|
+
serialize: wn,
|
|
193
|
+
test: _n
|
|
194
|
+
};
|
|
195
|
+
function _t(e) {
|
|
196
|
+
return e.replaceAll("<", "<").replaceAll(">", ">");
|
|
197
|
+
}
|
|
198
|
+
function Ne(e, t, n, o, r, s, i) {
|
|
199
|
+
const c = o + n.indent, u = n.colors;
|
|
200
|
+
return e.map((a) => {
|
|
201
|
+
const l = t[a];
|
|
202
|
+
let d = i(l, n, c, r, s);
|
|
203
|
+
return typeof l != "string" && (d.includes(`
|
|
204
|
+
`) && (d = n.spacingOuter + c + d + n.spacingOuter + o), d = `{${d}}`), `${n.spacingInner + o + u.prop.open + a + u.prop.close}=${u.value.open}${d}${u.value.close}`;
|
|
205
|
+
}).join("");
|
|
206
|
+
}
|
|
207
|
+
function Oe(e, t, n, o, r, s) {
|
|
208
|
+
return e.map((i) => t.spacingOuter + n + (typeof i == "string" ? It(i, t) : s(i, t, n, o, r))).join("");
|
|
209
|
+
}
|
|
210
|
+
function It(e, t) {
|
|
211
|
+
const n = t.colors.content;
|
|
212
|
+
return n.open + _t(e) + n.close;
|
|
213
|
+
}
|
|
214
|
+
function Cn(e, t) {
|
|
215
|
+
const n = t.colors.comment;
|
|
216
|
+
return `${n.open}<!--${_t(e)}-->${n.close}`;
|
|
217
|
+
}
|
|
218
|
+
function ke(e, t, n, o, r) {
|
|
219
|
+
const s = o.colors.tag;
|
|
220
|
+
return `${s.open}<${e}${t && s.close + t + o.spacingOuter + r + s.open}${n ? `>${s.close}${n}${o.spacingOuter}${r}${s.open}</${e}` : `${t && !o.min ? "" : " "}/`}>${s.close}`;
|
|
221
|
+
}
|
|
222
|
+
function Pe(e, t) {
|
|
223
|
+
const n = t.colors.tag;
|
|
224
|
+
return `${n.open}<${e}${n.close} …${n.open} />${n.close}`;
|
|
225
|
+
}
|
|
226
|
+
const xn = 1, wt = 3, At = 8, Ct = 11, Nn = /^(?:(?:HTML|SVG)\w*)?Element$/;
|
|
227
|
+
function On(e) {
|
|
228
|
+
try {
|
|
229
|
+
return typeof e.hasAttribute == "function" && e.hasAttribute("is");
|
|
230
|
+
} catch {
|
|
231
|
+
return !1;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
function kn(e) {
|
|
235
|
+
const t = e.constructor.name, { nodeType: n, tagName: o } = e, r = typeof o == "string" && o.includes("-") || On(e);
|
|
236
|
+
return n === xn && (Nn.test(t) || r) || n === wt && t === "Text" || n === At && t === "Comment" || n === Ct && t === "DocumentFragment";
|
|
237
|
+
}
|
|
238
|
+
const Pn = (e) => {
|
|
239
|
+
var t;
|
|
240
|
+
return (e == null || (t = e.constructor) === null || t === void 0 ? void 0 : t.name) && kn(e);
|
|
241
|
+
};
|
|
242
|
+
function vn(e) {
|
|
243
|
+
return e.nodeType === wt;
|
|
244
|
+
}
|
|
245
|
+
function Rn(e) {
|
|
246
|
+
return e.nodeType === At;
|
|
247
|
+
}
|
|
248
|
+
function pe(e) {
|
|
249
|
+
return e.nodeType === Ct;
|
|
250
|
+
}
|
|
251
|
+
const Mn = (e, t, n, o, r, s) => {
|
|
252
|
+
if (vn(e))
|
|
253
|
+
return It(e.data, t);
|
|
254
|
+
if (Rn(e))
|
|
255
|
+
return Cn(e.data, t);
|
|
256
|
+
const i = pe(e) ? "DocumentFragment" : e.tagName.toLowerCase();
|
|
257
|
+
return ++o > t.maxDepth ? Pe(i, t) : ke(i, Ne(pe(e) ? [] : Array.from(e.attributes, (c) => c.name).sort(), pe(e) ? {} : [...e.attributes].reduce((c, u) => (c[u.name] = u.value, c), {}), t, n + t.indent, o, r, s), Oe(Array.prototype.slice.call(e.childNodes || e.children), t, n + t.indent, o, r, s), t, n);
|
|
258
|
+
}, Ln = {
|
|
259
|
+
serialize: Mn,
|
|
260
|
+
test: Pn
|
|
261
|
+
}, jn = "@@__IMMUTABLE_ITERABLE__@@", Fn = "@@__IMMUTABLE_LIST__@@", Dn = "@@__IMMUTABLE_KEYED__@@", Bn = "@@__IMMUTABLE_MAP__@@", Fe = "@@__IMMUTABLE_ORDERED__@@", zn = "@@__IMMUTABLE_RECORD__@@", Wn = "@@__IMMUTABLE_SEQ__@@", Jn = "@@__IMMUTABLE_SET__@@", Xn = "@@__IMMUTABLE_STACK__@@", K = (e) => `Immutable.${e}`, fe = (e) => `[${e}]`, Q = " ", De = "…";
|
|
262
|
+
function Un(e, t, n, o, r, s, i) {
|
|
263
|
+
return ++o > t.maxDepth ? fe(K(i)) : `${K(i) + Q}{${te(e.entries(), t, n, o, r, s)}}`;
|
|
264
|
+
}
|
|
265
|
+
function qn(e) {
|
|
266
|
+
let t = 0;
|
|
267
|
+
return { next() {
|
|
268
|
+
if (t < e._keys.length) {
|
|
269
|
+
const n = e._keys[t++];
|
|
270
|
+
return {
|
|
271
|
+
done: !1,
|
|
272
|
+
value: [n, e.get(n)]
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
return {
|
|
276
|
+
done: !0,
|
|
277
|
+
value: void 0
|
|
278
|
+
};
|
|
279
|
+
} };
|
|
280
|
+
}
|
|
281
|
+
function Vn(e, t, n, o, r, s) {
|
|
282
|
+
const i = K(e._name || "Record");
|
|
283
|
+
return ++o > t.maxDepth ? fe(i) : `${i + Q}{${te(qn(e), t, n, o, r, s)}}`;
|
|
284
|
+
}
|
|
285
|
+
function Kn(e, t, n, o, r, s) {
|
|
286
|
+
const i = K("Seq");
|
|
287
|
+
return ++o > t.maxDepth ? fe(i) : e[Dn] ? `${i + Q}{${e._iter || e._object ? te(e.entries(), t, n, o, r, s) : De}}` : `${i + Q}[${e._iter || e._array || e._collection || e._iterable ? Ce(e.values(), t, n, o, r, s) : De}]`;
|
|
288
|
+
}
|
|
289
|
+
function de(e, t, n, o, r, s, i) {
|
|
290
|
+
return ++o > t.maxDepth ? fe(K(i)) : `${K(i) + Q}[${Ce(e.values(), t, n, o, r, s)}]`;
|
|
291
|
+
}
|
|
292
|
+
const Hn = (e, t, n, o, r, s) => e[Bn] ? Un(e, t, n, o, r, s, e[Fe] ? "OrderedMap" : "Map") : e[Fn] ? de(e, t, n, o, r, s, "List") : e[Jn] ? de(e, t, n, o, r, s, e[Fe] ? "OrderedSet" : "Set") : e[Xn] ? de(e, t, n, o, r, s, "Stack") : e[Wn] ? Kn(e, t, n, o, r, s) : Vn(e, t, n, o, r, s), Yn = (e) => e && (e[jn] === !0 || e[zn] === !0), Gn = {
|
|
293
|
+
serialize: Hn,
|
|
294
|
+
test: Yn
|
|
295
|
+
};
|
|
296
|
+
function xt(e) {
|
|
297
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
298
|
+
}
|
|
299
|
+
var me = { exports: {} }, I = {};
|
|
300
|
+
var Be;
|
|
301
|
+
function Zn() {
|
|
302
|
+
if (Be) return I;
|
|
303
|
+
Be = 1;
|
|
304
|
+
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), s = Symbol.for("react.consumer"), i = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), a = Symbol.for("react.suspense_list"), l = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), h = Symbol.for("react.view_transition"), g = Symbol.for("react.client.reference");
|
|
305
|
+
function y(f) {
|
|
306
|
+
if (typeof f == "object" && f !== null) {
|
|
307
|
+
var p = f.$$typeof;
|
|
308
|
+
switch (p) {
|
|
309
|
+
case e:
|
|
310
|
+
switch (f = f.type, f) {
|
|
311
|
+
case n:
|
|
312
|
+
case r:
|
|
313
|
+
case o:
|
|
314
|
+
case u:
|
|
315
|
+
case a:
|
|
316
|
+
case h:
|
|
317
|
+
return f;
|
|
318
|
+
default:
|
|
319
|
+
switch (f = f && f.$$typeof, f) {
|
|
320
|
+
case i:
|
|
321
|
+
case c:
|
|
322
|
+
case d:
|
|
323
|
+
case l:
|
|
324
|
+
return f;
|
|
325
|
+
case s:
|
|
326
|
+
return f;
|
|
327
|
+
default:
|
|
328
|
+
return p;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
case t:
|
|
332
|
+
return p;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return I.ContextConsumer = s, I.ContextProvider = i, I.Element = e, I.ForwardRef = c, I.Fragment = n, I.Lazy = d, I.Memo = l, I.Portal = t, I.Profiler = r, I.StrictMode = o, I.Suspense = u, I.SuspenseList = a, I.isContextConsumer = function(f) {
|
|
337
|
+
return y(f) === s;
|
|
338
|
+
}, I.isContextProvider = function(f) {
|
|
339
|
+
return y(f) === i;
|
|
340
|
+
}, I.isElement = function(f) {
|
|
341
|
+
return typeof f == "object" && f !== null && f.$$typeof === e;
|
|
342
|
+
}, I.isForwardRef = function(f) {
|
|
343
|
+
return y(f) === c;
|
|
344
|
+
}, I.isFragment = function(f) {
|
|
345
|
+
return y(f) === n;
|
|
346
|
+
}, I.isLazy = function(f) {
|
|
347
|
+
return y(f) === d;
|
|
348
|
+
}, I.isMemo = function(f) {
|
|
349
|
+
return y(f) === l;
|
|
350
|
+
}, I.isPortal = function(f) {
|
|
351
|
+
return y(f) === t;
|
|
352
|
+
}, I.isProfiler = function(f) {
|
|
353
|
+
return y(f) === r;
|
|
354
|
+
}, I.isStrictMode = function(f) {
|
|
355
|
+
return y(f) === o;
|
|
356
|
+
}, I.isSuspense = function(f) {
|
|
357
|
+
return y(f) === u;
|
|
358
|
+
}, I.isSuspenseList = function(f) {
|
|
359
|
+
return y(f) === a;
|
|
360
|
+
}, I.isValidElementType = function(f) {
|
|
361
|
+
return typeof f == "string" || typeof f == "function" || f === n || f === r || f === o || f === u || f === a || typeof f == "object" && f !== null && (f.$$typeof === d || f.$$typeof === l || f.$$typeof === i || f.$$typeof === s || f.$$typeof === c || f.$$typeof === g || f.getModuleId !== void 0);
|
|
362
|
+
}, I.typeOf = y, I;
|
|
363
|
+
}
|
|
364
|
+
var ze;
|
|
365
|
+
function Qn() {
|
|
366
|
+
return ze || (ze = 1, me.exports = Zn()), me.exports;
|
|
367
|
+
}
|
|
368
|
+
var Nt = Qn(), er = /* @__PURE__ */ xt(Nt), tr = /* @__PURE__ */ Tt({
|
|
369
|
+
__proto__: null,
|
|
370
|
+
default: er
|
|
371
|
+
}, [Nt]), he = { exports: {} }, _ = {};
|
|
372
|
+
var We;
|
|
373
|
+
function nr() {
|
|
374
|
+
if (We) return _;
|
|
375
|
+
We = 1;
|
|
376
|
+
var e = Symbol.for("react.element"), t = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), i = Symbol.for("react.context"), c = Symbol.for("react.server_context"), u = Symbol.for("react.forward_ref"), a = Symbol.for("react.suspense"), l = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), g = Symbol.for("react.offscreen"), y;
|
|
377
|
+
y = Symbol.for("react.module.reference");
|
|
378
|
+
function f(p) {
|
|
379
|
+
if (typeof p == "object" && p !== null) {
|
|
380
|
+
var b = p.$$typeof;
|
|
381
|
+
switch (b) {
|
|
382
|
+
case e:
|
|
383
|
+
switch (p = p.type, p) {
|
|
384
|
+
case n:
|
|
385
|
+
case r:
|
|
386
|
+
case o:
|
|
387
|
+
case a:
|
|
388
|
+
case l:
|
|
389
|
+
return p;
|
|
390
|
+
default:
|
|
391
|
+
switch (p = p && p.$$typeof, p) {
|
|
392
|
+
case c:
|
|
393
|
+
case i:
|
|
394
|
+
case u:
|
|
395
|
+
case h:
|
|
396
|
+
case d:
|
|
397
|
+
case s:
|
|
398
|
+
return p;
|
|
399
|
+
default:
|
|
400
|
+
return b;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
case t:
|
|
404
|
+
return b;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
return _.ContextConsumer = i, _.ContextProvider = s, _.Element = e, _.ForwardRef = u, _.Fragment = n, _.Lazy = h, _.Memo = d, _.Portal = t, _.Profiler = r, _.StrictMode = o, _.Suspense = a, _.SuspenseList = l, _.isAsyncMode = function() {
|
|
409
|
+
return !1;
|
|
410
|
+
}, _.isConcurrentMode = function() {
|
|
411
|
+
return !1;
|
|
412
|
+
}, _.isContextConsumer = function(p) {
|
|
413
|
+
return f(p) === i;
|
|
414
|
+
}, _.isContextProvider = function(p) {
|
|
415
|
+
return f(p) === s;
|
|
416
|
+
}, _.isElement = function(p) {
|
|
417
|
+
return typeof p == "object" && p !== null && p.$$typeof === e;
|
|
418
|
+
}, _.isForwardRef = function(p) {
|
|
419
|
+
return f(p) === u;
|
|
420
|
+
}, _.isFragment = function(p) {
|
|
421
|
+
return f(p) === n;
|
|
422
|
+
}, _.isLazy = function(p) {
|
|
423
|
+
return f(p) === h;
|
|
424
|
+
}, _.isMemo = function(p) {
|
|
425
|
+
return f(p) === d;
|
|
426
|
+
}, _.isPortal = function(p) {
|
|
427
|
+
return f(p) === t;
|
|
428
|
+
}, _.isProfiler = function(p) {
|
|
429
|
+
return f(p) === r;
|
|
430
|
+
}, _.isStrictMode = function(p) {
|
|
431
|
+
return f(p) === o;
|
|
432
|
+
}, _.isSuspense = function(p) {
|
|
433
|
+
return f(p) === a;
|
|
434
|
+
}, _.isSuspenseList = function(p) {
|
|
435
|
+
return f(p) === l;
|
|
436
|
+
}, _.isValidElementType = function(p) {
|
|
437
|
+
return typeof p == "string" || typeof p == "function" || p === n || p === r || p === o || p === a || p === l || p === g || typeof p == "object" && p !== null && (p.$$typeof === h || p.$$typeof === d || p.$$typeof === s || p.$$typeof === i || p.$$typeof === u || p.$$typeof === y || p.getModuleId !== void 0);
|
|
438
|
+
}, _.typeOf = f, _;
|
|
439
|
+
}
|
|
440
|
+
var Je;
|
|
441
|
+
function rr() {
|
|
442
|
+
return Je || (Je = 1, he.exports = nr()), he.exports;
|
|
443
|
+
}
|
|
444
|
+
var Ot = rr(), or = /* @__PURE__ */ xt(Ot), ir = /* @__PURE__ */ Tt({
|
|
445
|
+
__proto__: null,
|
|
446
|
+
default: or
|
|
447
|
+
}, [Ot]);
|
|
448
|
+
const sr = [
|
|
449
|
+
"isAsyncMode",
|
|
450
|
+
"isConcurrentMode",
|
|
451
|
+
"isContextConsumer",
|
|
452
|
+
"isContextProvider",
|
|
453
|
+
"isElement",
|
|
454
|
+
"isForwardRef",
|
|
455
|
+
"isFragment",
|
|
456
|
+
"isLazy",
|
|
457
|
+
"isMemo",
|
|
458
|
+
"isPortal",
|
|
459
|
+
"isProfiler",
|
|
460
|
+
"isStrictMode",
|
|
461
|
+
"isSuspense",
|
|
462
|
+
"isSuspenseList",
|
|
463
|
+
"isValidElementType"
|
|
464
|
+
], z = Object.fromEntries(sr.map((e) => [e, (t) => ir[e](t) || tr[e](t)]));
|
|
465
|
+
function kt(e, t = []) {
|
|
466
|
+
if (Array.isArray(e))
|
|
467
|
+
for (const n of e)
|
|
468
|
+
kt(n, t);
|
|
469
|
+
else e != null && e !== !1 && e !== "" && t.push(e);
|
|
470
|
+
return t;
|
|
471
|
+
}
|
|
472
|
+
function Xe(e) {
|
|
473
|
+
const t = e.type;
|
|
474
|
+
if (typeof t == "string")
|
|
475
|
+
return t;
|
|
476
|
+
if (typeof t == "function")
|
|
477
|
+
return t.displayName || t.name || "Unknown";
|
|
478
|
+
if (z.isFragment(e))
|
|
479
|
+
return "React.Fragment";
|
|
480
|
+
if (z.isSuspense(e))
|
|
481
|
+
return "React.Suspense";
|
|
482
|
+
if (typeof t == "object" && t !== null) {
|
|
483
|
+
if (z.isContextProvider(e))
|
|
484
|
+
return "Context.Provider";
|
|
485
|
+
if (z.isContextConsumer(e))
|
|
486
|
+
return "Context.Consumer";
|
|
487
|
+
if (z.isForwardRef(e)) {
|
|
488
|
+
if (t.displayName)
|
|
489
|
+
return t.displayName;
|
|
490
|
+
const n = t.render.displayName || t.render.name || "";
|
|
491
|
+
return n === "" ? "ForwardRef" : `ForwardRef(${n})`;
|
|
492
|
+
}
|
|
493
|
+
if (z.isMemo(e)) {
|
|
494
|
+
const n = t.displayName || t.type.displayName || t.type.name || "";
|
|
495
|
+
return n === "" ? "Memo" : `Memo(${n})`;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
return "UNDEFINED";
|
|
499
|
+
}
|
|
500
|
+
function cr(e) {
|
|
501
|
+
const { props: t } = e;
|
|
502
|
+
return Object.keys(t).filter((n) => n !== "children" && t[n] !== void 0).sort();
|
|
503
|
+
}
|
|
504
|
+
const ur = (e, t, n, o, r, s) => ++o > t.maxDepth ? Pe(Xe(e), t) : ke(Xe(e), Ne(cr(e), e.props, t, n + t.indent, o, r, s), Oe(kt(e.props.children), t, n + t.indent, o, r, s), t, n), ar = (e) => e != null && z.isElement(e), lr = {
|
|
505
|
+
serialize: ur,
|
|
506
|
+
test: ar
|
|
507
|
+
}, fr = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.test.json") : 245830487;
|
|
508
|
+
function pr(e) {
|
|
509
|
+
const { props: t } = e;
|
|
510
|
+
return t ? Object.keys(t).filter((n) => t[n] !== void 0).sort() : [];
|
|
511
|
+
}
|
|
512
|
+
const dr = (e, t, n, o, r, s) => ++o > t.maxDepth ? Pe(e.type, t) : ke(e.type, e.props ? Ne(pr(e), e.props, t, n + t.indent, o, r, s) : "", e.children ? Oe(e.children, t, n + t.indent, o, r, s) : "", t, n), mr = (e) => e && e.$$typeof === fr, hr = {
|
|
513
|
+
serialize: dr,
|
|
514
|
+
test: mr
|
|
515
|
+
}, Pt = Object.prototype.toString, yr = Date.prototype.toISOString, gr = Error.prototype.toString, Ue = RegExp.prototype.toString;
|
|
516
|
+
function oe(e) {
|
|
517
|
+
return typeof e.constructor == "function" && e.constructor.name || "Object";
|
|
518
|
+
}
|
|
519
|
+
function br(e) {
|
|
520
|
+
return typeof window < "u" && e === window;
|
|
521
|
+
}
|
|
522
|
+
const Sr = /^Symbol\((.*)\)(.*)$/, Er = /\n/g;
|
|
523
|
+
class vt extends Error {
|
|
524
|
+
constructor(t, n) {
|
|
525
|
+
super(t), this.stack = n, this.name = this.constructor.name;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
function Tr(e) {
|
|
529
|
+
return e === "[object Array]" || e === "[object ArrayBuffer]" || e === "[object DataView]" || e === "[object Float32Array]" || e === "[object Float64Array]" || e === "[object Int8Array]" || e === "[object Int16Array]" || e === "[object Int32Array]" || e === "[object Uint8Array]" || e === "[object Uint8ClampedArray]" || e === "[object Uint16Array]" || e === "[object Uint32Array]";
|
|
530
|
+
}
|
|
531
|
+
function $r(e) {
|
|
532
|
+
return Object.is(e, -0) ? "-0" : String(e);
|
|
533
|
+
}
|
|
534
|
+
function _r(e) {
|
|
535
|
+
return `${e}n`;
|
|
536
|
+
}
|
|
537
|
+
function qe(e, t) {
|
|
538
|
+
return t ? `[Function ${e.name || "anonymous"}]` : "[Function]";
|
|
539
|
+
}
|
|
540
|
+
function Ve(e) {
|
|
541
|
+
return String(e).replace(Sr, "Symbol($1)");
|
|
542
|
+
}
|
|
543
|
+
function Ke(e) {
|
|
544
|
+
return `[${gr.call(e)}]`;
|
|
545
|
+
}
|
|
546
|
+
function Rt(e, t, n, o) {
|
|
547
|
+
if (e === !0 || e === !1)
|
|
548
|
+
return `${e}`;
|
|
549
|
+
if (e === void 0)
|
|
550
|
+
return "undefined";
|
|
551
|
+
if (e === null)
|
|
552
|
+
return "null";
|
|
553
|
+
const r = typeof e;
|
|
554
|
+
if (r === "number")
|
|
555
|
+
return $r(e);
|
|
556
|
+
if (r === "bigint")
|
|
557
|
+
return _r(e);
|
|
558
|
+
if (r === "string")
|
|
559
|
+
return o ? `"${e.replaceAll(/"|\\/g, "\\$&")}"` : `"${e}"`;
|
|
560
|
+
if (r === "function")
|
|
561
|
+
return qe(e, t);
|
|
562
|
+
if (r === "symbol")
|
|
563
|
+
return Ve(e);
|
|
564
|
+
const s = Pt.call(e);
|
|
565
|
+
return s === "[object WeakMap]" ? "WeakMap {}" : s === "[object WeakSet]" ? "WeakSet {}" : s === "[object Function]" || s === "[object GeneratorFunction]" ? qe(e, t) : s === "[object Symbol]" ? Ve(e) : s === "[object Date]" ? Number.isNaN(+e) ? "Date { NaN }" : yr.call(e) : s === "[object Error]" ? Ke(e) : s === "[object RegExp]" ? n ? Ue.call(e).replaceAll(/[$()*+.?[\\\]^{|}]/g, "\\$&") : Ue.call(e) : e instanceof Error ? Ke(e) : null;
|
|
566
|
+
}
|
|
567
|
+
function Mt(e, t, n, o, r, s) {
|
|
568
|
+
if (r.includes(e))
|
|
569
|
+
return "[Circular]";
|
|
570
|
+
r = [...r], r.push(e);
|
|
571
|
+
const i = ++o > t.maxDepth, c = t.min;
|
|
572
|
+
if (t.callToJSON && !i && e.toJSON && typeof e.toJSON == "function" && !s)
|
|
573
|
+
return j(e.toJSON(), t, n, o, r, !0);
|
|
574
|
+
const u = Pt.call(e);
|
|
575
|
+
return u === "[object Arguments]" ? i ? "[Arguments]" : `${c ? "" : "Arguments "}[${ce(e, t, n, o, r, j)}]` : Tr(u) ? i ? `[${e.constructor.name}]` : `${c || !t.printBasicPrototype && e.constructor.name === "Array" ? "" : `${e.constructor.name} `}[${ce(e, t, n, o, r, j)}]` : u === "[object Map]" ? i ? "[Map]" : `Map {${te(e.entries(), t, n, o, r, j, " => ")}}` : u === "[object Set]" ? i ? "[Set]" : `Set {${Ce(e.values(), t, n, o, r, j)}}` : i || br(e) ? `[${oe(e)}]` : `${c || !t.printBasicPrototype && oe(e) === "Object" ? "" : `${oe(e)} `}{${xe(e, t, n, o, r, j)}}`;
|
|
576
|
+
}
|
|
577
|
+
const Ir = {
|
|
578
|
+
test: (e) => e && e instanceof Error,
|
|
579
|
+
serialize(e, t, n, o, r, s) {
|
|
580
|
+
if (r.includes(e))
|
|
581
|
+
return "[Circular]";
|
|
582
|
+
r = [...r, e];
|
|
583
|
+
const i = ++o > t.maxDepth, { message: c, cause: u, ...a } = e, l = {
|
|
584
|
+
message: c,
|
|
585
|
+
...typeof u < "u" ? { cause: u } : {},
|
|
586
|
+
...e instanceof AggregateError ? { errors: e.errors } : {},
|
|
587
|
+
...a
|
|
588
|
+
}, d = e.name !== "Error" ? e.name : oe(e);
|
|
589
|
+
return i ? `[${d}]` : `${d} {${te(Object.entries(l).values(), t, n, o, r, s)}}`;
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
function wr(e) {
|
|
593
|
+
return e.serialize != null;
|
|
594
|
+
}
|
|
595
|
+
function Lt(e, t, n, o, r, s) {
|
|
596
|
+
let i;
|
|
597
|
+
try {
|
|
598
|
+
i = wr(e) ? e.serialize(t, n, o, r, s, j) : e.print(t, (c) => j(c, n, o, r, s), (c) => {
|
|
599
|
+
const u = o + n.indent;
|
|
600
|
+
return u + c.replaceAll(Er, `
|
|
601
|
+
${u}`);
|
|
602
|
+
}, {
|
|
603
|
+
edgeSpacing: n.spacingOuter,
|
|
604
|
+
min: n.min,
|
|
605
|
+
spacing: n.spacingInner
|
|
606
|
+
}, n.colors);
|
|
607
|
+
} catch (c) {
|
|
608
|
+
throw new vt(c.message, c.stack);
|
|
609
|
+
}
|
|
610
|
+
if (typeof i != "string")
|
|
611
|
+
throw new TypeError(`pretty-format: Plugin must return type "string" but instead returned "${typeof i}".`);
|
|
612
|
+
return i;
|
|
613
|
+
}
|
|
614
|
+
function jt(e, t) {
|
|
615
|
+
for (const n of e)
|
|
616
|
+
try {
|
|
617
|
+
if (n.test(t))
|
|
618
|
+
return n;
|
|
619
|
+
} catch (o) {
|
|
620
|
+
throw new vt(o.message, o.stack);
|
|
621
|
+
}
|
|
622
|
+
return null;
|
|
623
|
+
}
|
|
624
|
+
function j(e, t, n, o, r, s) {
|
|
625
|
+
const i = jt(t.plugins, e);
|
|
626
|
+
if (i !== null)
|
|
627
|
+
return Lt(i, e, t, n, o, r);
|
|
628
|
+
const c = Rt(e, t.printFunctionName, t.escapeRegex, t.escapeString);
|
|
629
|
+
return c !== null ? c : Mt(e, t, n, o, r, s);
|
|
630
|
+
}
|
|
631
|
+
const ve = {
|
|
632
|
+
comment: "gray",
|
|
633
|
+
content: "reset",
|
|
634
|
+
prop: "yellow",
|
|
635
|
+
tag: "cyan",
|
|
636
|
+
value: "green"
|
|
637
|
+
}, Ft = Object.keys(ve), k = {
|
|
638
|
+
callToJSON: !0,
|
|
639
|
+
compareKeys: void 0,
|
|
640
|
+
escapeRegex: !1,
|
|
641
|
+
escapeString: !0,
|
|
642
|
+
highlight: !1,
|
|
643
|
+
indent: 2,
|
|
644
|
+
maxDepth: Number.POSITIVE_INFINITY,
|
|
645
|
+
maxWidth: Number.POSITIVE_INFINITY,
|
|
646
|
+
min: !1,
|
|
647
|
+
plugins: [],
|
|
648
|
+
printBasicPrototype: !0,
|
|
649
|
+
printFunctionName: !0,
|
|
650
|
+
theme: ve
|
|
651
|
+
};
|
|
652
|
+
function Ar(e) {
|
|
653
|
+
for (const t of Object.keys(e))
|
|
654
|
+
if (!Object.prototype.hasOwnProperty.call(k, t))
|
|
655
|
+
throw new Error(`pretty-format: Unknown option "${t}".`);
|
|
656
|
+
if (e.min && e.indent !== void 0 && e.indent !== 0)
|
|
657
|
+
throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');
|
|
658
|
+
}
|
|
659
|
+
function Cr() {
|
|
660
|
+
return Ft.reduce((e, t) => {
|
|
661
|
+
const n = ve[t], o = n && mn[n];
|
|
662
|
+
if (o && typeof o.close == "string" && typeof o.open == "string")
|
|
663
|
+
e[t] = o;
|
|
664
|
+
else
|
|
665
|
+
throw new Error(`pretty-format: Option "theme" has a key "${t}" whose value "${n}" is undefined in ansi-styles.`);
|
|
666
|
+
return e;
|
|
667
|
+
}, /* @__PURE__ */ Object.create(null));
|
|
668
|
+
}
|
|
669
|
+
function xr() {
|
|
670
|
+
return Ft.reduce((e, t) => (e[t] = {
|
|
671
|
+
close: "",
|
|
672
|
+
open: ""
|
|
673
|
+
}, e), /* @__PURE__ */ Object.create(null));
|
|
674
|
+
}
|
|
675
|
+
function Dt(e) {
|
|
676
|
+
return e?.printFunctionName ?? k.printFunctionName;
|
|
677
|
+
}
|
|
678
|
+
function Bt(e) {
|
|
679
|
+
return e?.escapeRegex ?? k.escapeRegex;
|
|
680
|
+
}
|
|
681
|
+
function zt(e) {
|
|
682
|
+
return e?.escapeString ?? k.escapeString;
|
|
683
|
+
}
|
|
684
|
+
function He(e) {
|
|
685
|
+
return {
|
|
686
|
+
callToJSON: e?.callToJSON ?? k.callToJSON,
|
|
687
|
+
colors: e?.highlight ? Cr() : xr(),
|
|
688
|
+
compareKeys: typeof e?.compareKeys == "function" || e?.compareKeys === null ? e.compareKeys : k.compareKeys,
|
|
689
|
+
escapeRegex: Bt(e),
|
|
690
|
+
escapeString: zt(e),
|
|
691
|
+
indent: e?.min ? "" : Nr(e?.indent ?? k.indent),
|
|
692
|
+
maxDepth: e?.maxDepth ?? k.maxDepth,
|
|
693
|
+
maxWidth: e?.maxWidth ?? k.maxWidth,
|
|
694
|
+
min: e?.min ?? k.min,
|
|
695
|
+
plugins: e?.plugins ?? k.plugins,
|
|
696
|
+
printBasicPrototype: e?.printBasicPrototype ?? !0,
|
|
697
|
+
printFunctionName: Dt(e),
|
|
698
|
+
spacingInner: e?.min ? " " : `
|
|
699
|
+
`,
|
|
700
|
+
spacingOuter: e?.min ? "" : `
|
|
701
|
+
`
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
function Nr(e) {
|
|
705
|
+
return Array.from({ length: e + 1 }).join(" ");
|
|
706
|
+
}
|
|
707
|
+
function Ye(e, t) {
|
|
708
|
+
if (t && (Ar(t), t.plugins)) {
|
|
709
|
+
const o = jt(t.plugins, e);
|
|
710
|
+
if (o !== null)
|
|
711
|
+
return Lt(o, e, He(t), "", 0, []);
|
|
712
|
+
}
|
|
713
|
+
const n = Rt(e, Dt(t), Bt(t), zt(t));
|
|
714
|
+
return n !== null ? n : Mt(e, He(t), "", 0, []);
|
|
715
|
+
}
|
|
716
|
+
const Or = {
|
|
717
|
+
AsymmetricMatcher: Sn,
|
|
718
|
+
DOMCollection: An,
|
|
719
|
+
DOMElement: Ln,
|
|
720
|
+
Immutable: Gn,
|
|
721
|
+
ReactElement: lr,
|
|
722
|
+
ReactTestComponent: hr,
|
|
723
|
+
Error: Ir
|
|
724
|
+
}, Ge = {
|
|
725
|
+
bold: ["1", "22"],
|
|
726
|
+
dim: ["2", "22"],
|
|
727
|
+
italic: ["3", "23"],
|
|
728
|
+
underline: ["4", "24"],
|
|
729
|
+
// 5 & 6 are blinking
|
|
730
|
+
inverse: ["7", "27"],
|
|
731
|
+
hidden: ["8", "28"],
|
|
732
|
+
strike: ["9", "29"],
|
|
733
|
+
// 10-20 are fonts
|
|
734
|
+
// 21-29 are resets for 1-9
|
|
735
|
+
black: ["30", "39"],
|
|
736
|
+
red: ["31", "39"],
|
|
737
|
+
green: ["32", "39"],
|
|
738
|
+
yellow: ["33", "39"],
|
|
739
|
+
blue: ["34", "39"],
|
|
740
|
+
magenta: ["35", "39"],
|
|
741
|
+
cyan: ["36", "39"],
|
|
742
|
+
white: ["37", "39"],
|
|
743
|
+
brightblack: ["30;1", "39"],
|
|
744
|
+
brightred: ["31;1", "39"],
|
|
745
|
+
brightgreen: ["32;1", "39"],
|
|
746
|
+
brightyellow: ["33;1", "39"],
|
|
747
|
+
brightblue: ["34;1", "39"],
|
|
748
|
+
brightmagenta: ["35;1", "39"],
|
|
749
|
+
brightcyan: ["36;1", "39"],
|
|
750
|
+
brightwhite: ["37;1", "39"],
|
|
751
|
+
grey: ["90", "39"]
|
|
752
|
+
}, kr = {
|
|
753
|
+
special: "cyan",
|
|
754
|
+
number: "yellow",
|
|
755
|
+
bigint: "yellow",
|
|
756
|
+
boolean: "yellow",
|
|
757
|
+
undefined: "grey",
|
|
758
|
+
null: "bold",
|
|
759
|
+
string: "green",
|
|
760
|
+
symbol: "green",
|
|
761
|
+
date: "magenta",
|
|
762
|
+
regexp: "red"
|
|
763
|
+
}, H = "…";
|
|
764
|
+
function Pr(e, t) {
|
|
765
|
+
const n = Ge[kr[t]] || Ge[t] || "";
|
|
766
|
+
return n ? `\x1B[${n[0]}m${String(e)}\x1B[${n[1]}m` : String(e);
|
|
767
|
+
}
|
|
768
|
+
function vr({
|
|
769
|
+
showHidden: e = !1,
|
|
770
|
+
depth: t = 2,
|
|
771
|
+
colors: n = !1,
|
|
772
|
+
customInspect: o = !0,
|
|
773
|
+
showProxy: r = !1,
|
|
774
|
+
maxArrayLength: s = 1 / 0,
|
|
775
|
+
breakLength: i = 1 / 0,
|
|
776
|
+
seen: c = [],
|
|
777
|
+
// eslint-disable-next-line no-shadow
|
|
778
|
+
truncate: u = 1 / 0,
|
|
779
|
+
stylize: a = String
|
|
780
|
+
} = {}, l) {
|
|
781
|
+
const d = {
|
|
782
|
+
showHidden: !!e,
|
|
783
|
+
depth: Number(t),
|
|
784
|
+
colors: !!n,
|
|
785
|
+
customInspect: !!o,
|
|
786
|
+
showProxy: !!r,
|
|
787
|
+
maxArrayLength: Number(s),
|
|
788
|
+
breakLength: Number(i),
|
|
789
|
+
truncate: Number(u),
|
|
790
|
+
seen: c,
|
|
791
|
+
inspect: l,
|
|
792
|
+
stylize: a
|
|
793
|
+
};
|
|
794
|
+
return d.colors && (d.stylize = Pr), d;
|
|
795
|
+
}
|
|
796
|
+
function Rr(e) {
|
|
797
|
+
return e >= "\uD800" && e <= "\uDBFF";
|
|
798
|
+
}
|
|
799
|
+
function B(e, t, n = H) {
|
|
800
|
+
e = String(e);
|
|
801
|
+
const o = n.length, r = e.length;
|
|
802
|
+
if (o > t && r > o)
|
|
803
|
+
return n;
|
|
804
|
+
if (r > t && r > o) {
|
|
805
|
+
let s = t - o;
|
|
806
|
+
return s > 0 && Rr(e[s - 1]) && (s = s - 1), `${e.slice(0, s)}${n}`;
|
|
807
|
+
}
|
|
808
|
+
return e;
|
|
809
|
+
}
|
|
810
|
+
function P(e, t, n, o = ", ") {
|
|
811
|
+
n = n || t.inspect;
|
|
812
|
+
const r = e.length;
|
|
813
|
+
if (r === 0)
|
|
814
|
+
return "";
|
|
815
|
+
const s = t.truncate;
|
|
816
|
+
let i = "", c = "", u = "";
|
|
817
|
+
for (let a = 0; a < r; a += 1) {
|
|
818
|
+
const l = a + 1 === e.length, d = a + 2 === e.length;
|
|
819
|
+
u = `${H}(${e.length - a})`;
|
|
820
|
+
const h = e[a];
|
|
821
|
+
t.truncate = s - i.length - (l ? 0 : o.length);
|
|
822
|
+
const g = c || n(h, t) + (l ? "" : o), y = i.length + g.length, f = y + u.length;
|
|
823
|
+
if (l && y > s && i.length + u.length <= s || !l && !d && f > s || (c = l ? "" : n(e[a + 1], t) + (d ? "" : o), !l && d && f > s && y + c.length > s))
|
|
824
|
+
break;
|
|
825
|
+
if (i += g, !l && !d && y + c.length >= s) {
|
|
826
|
+
u = `${H}(${e.length - a - 1})`;
|
|
827
|
+
break;
|
|
828
|
+
}
|
|
829
|
+
u = "";
|
|
830
|
+
}
|
|
831
|
+
return `${i}${u}`;
|
|
832
|
+
}
|
|
833
|
+
function Mr(e) {
|
|
834
|
+
return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/) ? e : JSON.stringify(e).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
|
|
835
|
+
}
|
|
836
|
+
function ee([e, t], n) {
|
|
837
|
+
return n.truncate -= 2, typeof e == "string" ? e = Mr(e) : typeof e != "number" && (e = `[${n.inspect(e, n)}]`), n.truncate -= e.length, t = n.inspect(t, n), `${e}: ${t}`;
|
|
838
|
+
}
|
|
839
|
+
function Lr(e, t) {
|
|
840
|
+
const n = Object.keys(e).slice(e.length);
|
|
841
|
+
if (!e.length && !n.length)
|
|
842
|
+
return "[]";
|
|
843
|
+
t.truncate -= 4;
|
|
844
|
+
const o = P(e, t);
|
|
845
|
+
t.truncate -= o.length;
|
|
846
|
+
let r = "";
|
|
847
|
+
return n.length && (r = P(n.map((s) => [s, e[s]]), t, ee)), `[ ${o}${r ? `, ${r}` : ""} ]`;
|
|
848
|
+
}
|
|
849
|
+
const jr = (e) => typeof Buffer == "function" && e instanceof Buffer ? "Buffer" : e[Symbol.toStringTag] ? e[Symbol.toStringTag] : e.constructor.name;
|
|
850
|
+
function L(e, t) {
|
|
851
|
+
const n = jr(e);
|
|
852
|
+
t.truncate -= n.length + 4;
|
|
853
|
+
const o = Object.keys(e).slice(e.length);
|
|
854
|
+
if (!e.length && !o.length)
|
|
855
|
+
return `${n}[]`;
|
|
856
|
+
let r = "";
|
|
857
|
+
for (let i = 0; i < e.length; i++) {
|
|
858
|
+
const c = `${t.stylize(B(e[i], t.truncate), "number")}${i === e.length - 1 ? "" : ", "}`;
|
|
859
|
+
if (t.truncate -= c.length, e[i] !== e.length && t.truncate <= 3) {
|
|
860
|
+
r += `${H}(${e.length - e[i] + 1})`;
|
|
861
|
+
break;
|
|
862
|
+
}
|
|
863
|
+
r += c;
|
|
864
|
+
}
|
|
865
|
+
let s = "";
|
|
866
|
+
return o.length && (s = P(o.map((i) => [i, e[i]]), t, ee)), `${n}[ ${r}${s ? `, ${s}` : ""} ]`;
|
|
867
|
+
}
|
|
868
|
+
function Fr(e, t) {
|
|
869
|
+
const n = e.toJSON();
|
|
870
|
+
if (n === null)
|
|
871
|
+
return "Invalid Date";
|
|
872
|
+
const o = n.split("T"), r = o[0];
|
|
873
|
+
return t.stylize(`${r}T${B(o[1], t.truncate - r.length - 1)}`, "date");
|
|
874
|
+
}
|
|
875
|
+
function Ze(e, t) {
|
|
876
|
+
const n = e[Symbol.toStringTag] || "Function", o = e.name;
|
|
877
|
+
return o ? t.stylize(`[${n} ${B(o, t.truncate - 11)}]`, "special") : t.stylize(`[${n}]`, "special");
|
|
878
|
+
}
|
|
879
|
+
function Dr([e, t], n) {
|
|
880
|
+
return n.truncate -= 4, e = n.inspect(e, n), n.truncate -= e.length, t = n.inspect(t, n), `${e} => ${t}`;
|
|
881
|
+
}
|
|
882
|
+
function Br(e) {
|
|
883
|
+
const t = [];
|
|
884
|
+
return e.forEach((n, o) => {
|
|
885
|
+
t.push([o, n]);
|
|
886
|
+
}), t;
|
|
887
|
+
}
|
|
888
|
+
function zr(e, t) {
|
|
889
|
+
return e.size === 0 ? "Map{}" : (t.truncate -= 7, `Map{ ${P(Br(e), t, Dr)} }`);
|
|
890
|
+
}
|
|
891
|
+
const Wr = Number.isNaN || ((e) => e !== e);
|
|
892
|
+
function Qe(e, t) {
|
|
893
|
+
return Wr(e) ? t.stylize("NaN", "number") : e === 1 / 0 ? t.stylize("Infinity", "number") : e === -1 / 0 ? t.stylize("-Infinity", "number") : e === 0 ? t.stylize(1 / e === 1 / 0 ? "+0" : "-0", "number") : t.stylize(B(String(e), t.truncate), "number");
|
|
894
|
+
}
|
|
895
|
+
function et(e, t) {
|
|
896
|
+
let n = B(e.toString(), t.truncate - 1);
|
|
897
|
+
return n !== H && (n += "n"), t.stylize(n, "bigint");
|
|
898
|
+
}
|
|
899
|
+
function Jr(e, t) {
|
|
900
|
+
const n = e.toString().split("/")[2], o = t.truncate - (2 + n.length), r = e.source;
|
|
901
|
+
return t.stylize(`/${B(r, o)}/${n}`, "regexp");
|
|
902
|
+
}
|
|
903
|
+
function Xr(e) {
|
|
904
|
+
const t = [];
|
|
905
|
+
return e.forEach((n) => {
|
|
906
|
+
t.push(n);
|
|
907
|
+
}), t;
|
|
908
|
+
}
|
|
909
|
+
function Ur(e, t) {
|
|
910
|
+
return e.size === 0 ? "Set{}" : (t.truncate -= 7, `Set{ ${P(Xr(e), t)} }`);
|
|
911
|
+
}
|
|
912
|
+
const tt = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", "g"), qr = {
|
|
913
|
+
"\b": "\\b",
|
|
914
|
+
" ": "\\t",
|
|
915
|
+
"\n": "\\n",
|
|
916
|
+
"\f": "\\f",
|
|
917
|
+
"\r": "\\r",
|
|
918
|
+
"'": "\\'",
|
|
919
|
+
"\\": "\\\\"
|
|
920
|
+
}, Vr = 16;
|
|
921
|
+
function Kr(e) {
|
|
922
|
+
return qr[e] || `\\u${`0000${e.charCodeAt(0).toString(Vr)}`.slice(-4)}`;
|
|
923
|
+
}
|
|
924
|
+
function nt(e, t) {
|
|
925
|
+
return tt.test(e) && (e = e.replace(tt, Kr)), t.stylize(`'${B(e, t.truncate - 2)}'`, "string");
|
|
926
|
+
}
|
|
927
|
+
function rt(e) {
|
|
928
|
+
return "description" in Symbol.prototype ? e.description ? `Symbol(${e.description})` : "Symbol()" : e.toString();
|
|
929
|
+
}
|
|
930
|
+
let Wt = () => "Promise{…}";
|
|
931
|
+
try {
|
|
932
|
+
const { getPromiseDetails: e, kPending: t, kRejected: n } = process.binding("util");
|
|
933
|
+
Array.isArray(e(Promise.resolve())) && (Wt = (o, r) => {
|
|
934
|
+
const [s, i] = e(o);
|
|
935
|
+
return s === t ? "Promise{<pending>}" : `Promise${s === n ? "!" : ""}{${r.inspect(i, r)}}`;
|
|
936
|
+
});
|
|
937
|
+
} catch {
|
|
938
|
+
}
|
|
939
|
+
function ie(e, t) {
|
|
940
|
+
const n = Object.getOwnPropertyNames(e), o = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e) : [];
|
|
941
|
+
if (n.length === 0 && o.length === 0)
|
|
942
|
+
return "{}";
|
|
943
|
+
if (t.truncate -= 4, t.seen = t.seen || [], t.seen.includes(e))
|
|
944
|
+
return "[Circular]";
|
|
945
|
+
t.seen.push(e);
|
|
946
|
+
const r = P(n.map((c) => [c, e[c]]), t, ee), s = P(o.map((c) => [c, e[c]]), t, ee);
|
|
947
|
+
t.seen.pop();
|
|
948
|
+
let i = "";
|
|
949
|
+
return r && s && (i = ", "), `{ ${r}${i}${s} }`;
|
|
950
|
+
}
|
|
951
|
+
const ye = typeof Symbol < "u" && Symbol.toStringTag ? Symbol.toStringTag : !1;
|
|
952
|
+
function Hr(e, t) {
|
|
953
|
+
let n = "";
|
|
954
|
+
return ye && ye in e && (n = e[ye]), n = n || e.constructor.name, (!n || n === "_class") && (n = "<Anonymous Class>"), t.truncate -= n.length, `${n}${ie(e, t)}`;
|
|
955
|
+
}
|
|
956
|
+
function Yr(e, t) {
|
|
957
|
+
return e.length === 0 ? "Arguments[]" : (t.truncate -= 13, `Arguments[ ${P(e, t)} ]`);
|
|
958
|
+
}
|
|
959
|
+
const Gr = [
|
|
960
|
+
"stack",
|
|
961
|
+
"line",
|
|
962
|
+
"column",
|
|
963
|
+
"name",
|
|
964
|
+
"message",
|
|
965
|
+
"fileName",
|
|
966
|
+
"lineNumber",
|
|
967
|
+
"columnNumber",
|
|
968
|
+
"number",
|
|
969
|
+
"description",
|
|
970
|
+
"cause"
|
|
971
|
+
];
|
|
972
|
+
function Zr(e, t) {
|
|
973
|
+
const n = Object.getOwnPropertyNames(e).filter((i) => Gr.indexOf(i) === -1), o = e.name;
|
|
974
|
+
t.truncate -= o.length;
|
|
975
|
+
let r = "";
|
|
976
|
+
if (typeof e.message == "string" ? r = B(e.message, t.truncate) : n.unshift("message"), r = r ? `: ${r}` : "", t.truncate -= r.length + 5, t.seen = t.seen || [], t.seen.includes(e))
|
|
977
|
+
return "[Circular]";
|
|
978
|
+
t.seen.push(e);
|
|
979
|
+
const s = P(n.map((i) => [i, e[i]]), t, ee);
|
|
980
|
+
return `${o}${r}${s ? ` { ${s} }` : ""}`;
|
|
981
|
+
}
|
|
982
|
+
function Qr([e, t], n) {
|
|
983
|
+
return n.truncate -= 3, t ? `${n.stylize(String(e), "yellow")}=${n.stylize(`"${t}"`, "string")}` : `${n.stylize(String(e), "yellow")}`;
|
|
984
|
+
}
|
|
985
|
+
function $e(e, t) {
|
|
986
|
+
return P(e, t, eo, `
|
|
987
|
+
`);
|
|
988
|
+
}
|
|
989
|
+
function eo(e, t) {
|
|
990
|
+
switch (e.nodeType) {
|
|
991
|
+
case 1:
|
|
992
|
+
return Jt(e, t);
|
|
993
|
+
case 3:
|
|
994
|
+
return t.inspect(e.data, t);
|
|
995
|
+
default:
|
|
996
|
+
return t.inspect(e, t);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
function Jt(e, t) {
|
|
1000
|
+
const n = e.getAttributeNames(), o = e.tagName.toLowerCase(), r = t.stylize(`<${o}`, "special"), s = t.stylize(">", "special"), i = t.stylize(`</${o}>`, "special");
|
|
1001
|
+
t.truncate -= o.length * 2 + 5;
|
|
1002
|
+
let c = "";
|
|
1003
|
+
n.length > 0 && (c += " ", c += P(n.map((l) => [l, e.getAttribute(l)]), t, Qr, " ")), t.truncate -= c.length;
|
|
1004
|
+
const u = t.truncate;
|
|
1005
|
+
let a = $e(e.children, t);
|
|
1006
|
+
return a && a.length > u && (a = `${H}(${e.children.length})`), `${r}${c}${s}${a}${i}`;
|
|
1007
|
+
}
|
|
1008
|
+
const to = typeof Symbol == "function" && typeof Symbol.for == "function", ge = to ? Symbol.for("chai/inspect") : "@@chai/inspect", be = Symbol.for("nodejs.util.inspect.custom"), ot = /* @__PURE__ */ new WeakMap(), it = {}, st = {
|
|
1009
|
+
undefined: (e, t) => t.stylize("undefined", "undefined"),
|
|
1010
|
+
null: (e, t) => t.stylize("null", "null"),
|
|
1011
|
+
boolean: (e, t) => t.stylize(String(e), "boolean"),
|
|
1012
|
+
Boolean: (e, t) => t.stylize(String(e), "boolean"),
|
|
1013
|
+
number: Qe,
|
|
1014
|
+
Number: Qe,
|
|
1015
|
+
bigint: et,
|
|
1016
|
+
BigInt: et,
|
|
1017
|
+
string: nt,
|
|
1018
|
+
String: nt,
|
|
1019
|
+
function: Ze,
|
|
1020
|
+
Function: Ze,
|
|
1021
|
+
symbol: rt,
|
|
1022
|
+
// A Symbol polyfill will return `Symbol` not `symbol` from typedetect
|
|
1023
|
+
Symbol: rt,
|
|
1024
|
+
Array: Lr,
|
|
1025
|
+
Date: Fr,
|
|
1026
|
+
Map: zr,
|
|
1027
|
+
Set: Ur,
|
|
1028
|
+
RegExp: Jr,
|
|
1029
|
+
Promise: Wt,
|
|
1030
|
+
// WeakSet, WeakMap are totally opaque to us
|
|
1031
|
+
WeakSet: (e, t) => t.stylize("WeakSet{…}", "special"),
|
|
1032
|
+
WeakMap: (e, t) => t.stylize("WeakMap{…}", "special"),
|
|
1033
|
+
Arguments: Yr,
|
|
1034
|
+
Int8Array: L,
|
|
1035
|
+
Uint8Array: L,
|
|
1036
|
+
Uint8ClampedArray: L,
|
|
1037
|
+
Int16Array: L,
|
|
1038
|
+
Uint16Array: L,
|
|
1039
|
+
Int32Array: L,
|
|
1040
|
+
Uint32Array: L,
|
|
1041
|
+
Float32Array: L,
|
|
1042
|
+
Float64Array: L,
|
|
1043
|
+
Generator: () => "",
|
|
1044
|
+
DataView: () => "",
|
|
1045
|
+
ArrayBuffer: () => "",
|
|
1046
|
+
Error: Zr,
|
|
1047
|
+
HTMLCollection: $e,
|
|
1048
|
+
NodeList: $e
|
|
1049
|
+
}, no = (e, t, n) => ge in e && typeof e[ge] == "function" ? e[ge](t) : be in e && typeof e[be] == "function" ? e[be](t.depth, t) : "inspect" in e && typeof e.inspect == "function" ? e.inspect(t.depth, t) : "constructor" in e && ot.has(e.constructor) ? ot.get(e.constructor)(e, t) : it[n] ? it[n](e, t) : "", ro = Object.prototype.toString;
|
|
1050
|
+
function _e(e, t = {}) {
|
|
1051
|
+
const n = vr(t, _e), { customInspect: o } = n;
|
|
1052
|
+
let r = e === null ? "null" : typeof e;
|
|
1053
|
+
if (r === "object" && (r = ro.call(e).slice(8, -1)), r in st)
|
|
1054
|
+
return st[r](e, n);
|
|
1055
|
+
if (o && e) {
|
|
1056
|
+
const i = no(e, n, r);
|
|
1057
|
+
if (i)
|
|
1058
|
+
return typeof i == "string" ? i : _e(i, n);
|
|
1059
|
+
}
|
|
1060
|
+
const s = e ? Object.getPrototypeOf(e) : !1;
|
|
1061
|
+
return s === Object.prototype || s === null ? ie(e, n) : e && typeof HTMLElement == "function" && e instanceof HTMLElement ? Jt(e, n) : "constructor" in e ? e.constructor !== Object ? Hr(e, n) : ie(e, n) : e === Object(e) ? ie(e, n) : n.stylize(String(e), r);
|
|
1062
|
+
}
|
|
1063
|
+
const { AsymmetricMatcher: oo, DOMCollection: io, DOMElement: so, Immutable: co, ReactElement: uo, ReactTestComponent: ao } = Or, ct = [
|
|
1064
|
+
ao,
|
|
1065
|
+
uo,
|
|
1066
|
+
so,
|
|
1067
|
+
io,
|
|
1068
|
+
co,
|
|
1069
|
+
oo
|
|
1070
|
+
];
|
|
1071
|
+
function lo(e, t = 10, { maxLength: n, ...o } = {}) {
|
|
1072
|
+
const r = n ?? 1e4;
|
|
1073
|
+
let s;
|
|
1074
|
+
try {
|
|
1075
|
+
s = Ye(e, {
|
|
1076
|
+
maxDepth: t,
|
|
1077
|
+
escapeString: !1,
|
|
1078
|
+
plugins: ct,
|
|
1079
|
+
...o
|
|
1080
|
+
});
|
|
1081
|
+
} catch {
|
|
1082
|
+
s = Ye(e, {
|
|
1083
|
+
callToJSON: !1,
|
|
1084
|
+
maxDepth: t,
|
|
1085
|
+
escapeString: !1,
|
|
1086
|
+
plugins: ct,
|
|
1087
|
+
...o
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
return s.length >= r && t > 1 ? lo(e, Math.floor(Math.min(t, Number.MAX_SAFE_INTEGER) / 2), {
|
|
1091
|
+
maxLength: n,
|
|
1092
|
+
...o
|
|
1093
|
+
}) : s;
|
|
1094
|
+
}
|
|
1095
|
+
const fo = /%[sdjifoOc%]/g;
|
|
1096
|
+
function po(...e) {
|
|
1097
|
+
if (typeof e[0] != "string") {
|
|
1098
|
+
const s = [];
|
|
1099
|
+
for (let i = 0; i < e.length; i++)
|
|
1100
|
+
s.push(U(e[i], {
|
|
1101
|
+
depth: 0,
|
|
1102
|
+
colors: !1
|
|
1103
|
+
}));
|
|
1104
|
+
return s.join(" ");
|
|
1105
|
+
}
|
|
1106
|
+
const t = e.length;
|
|
1107
|
+
let n = 1;
|
|
1108
|
+
const o = e[0];
|
|
1109
|
+
let r = String(o).replace(fo, (s) => {
|
|
1110
|
+
if (s === "%%")
|
|
1111
|
+
return "%";
|
|
1112
|
+
if (n >= t)
|
|
1113
|
+
return s;
|
|
1114
|
+
switch (s) {
|
|
1115
|
+
case "%s": {
|
|
1116
|
+
const i = e[n++];
|
|
1117
|
+
return typeof i == "bigint" ? `${i.toString()}n` : typeof i == "number" && i === 0 && 1 / i < 0 ? "-0" : typeof i == "object" && i !== null ? typeof i.toString == "function" && i.toString !== Object.prototype.toString ? i.toString() : U(i, {
|
|
1118
|
+
depth: 0,
|
|
1119
|
+
colors: !1
|
|
1120
|
+
}) : String(i);
|
|
1121
|
+
}
|
|
1122
|
+
case "%d": {
|
|
1123
|
+
const i = e[n++];
|
|
1124
|
+
return typeof i == "bigint" ? `${i.toString()}n` : Number(i).toString();
|
|
1125
|
+
}
|
|
1126
|
+
case "%i": {
|
|
1127
|
+
const i = e[n++];
|
|
1128
|
+
return typeof i == "bigint" ? `${i.toString()}n` : Number.parseInt(String(i)).toString();
|
|
1129
|
+
}
|
|
1130
|
+
case "%f":
|
|
1131
|
+
return Number.parseFloat(String(e[n++])).toString();
|
|
1132
|
+
case "%o":
|
|
1133
|
+
return U(e[n++], {
|
|
1134
|
+
showHidden: !0,
|
|
1135
|
+
showProxy: !0
|
|
1136
|
+
});
|
|
1137
|
+
case "%O":
|
|
1138
|
+
return U(e[n++]);
|
|
1139
|
+
case "%c":
|
|
1140
|
+
return n++, "";
|
|
1141
|
+
case "%j":
|
|
1142
|
+
try {
|
|
1143
|
+
return JSON.stringify(e[n++]);
|
|
1144
|
+
} catch (i) {
|
|
1145
|
+
const c = i.message;
|
|
1146
|
+
if (c.includes("circular structure") || c.includes("cyclic structures") || c.includes("cyclic object"))
|
|
1147
|
+
return "[Circular]";
|
|
1148
|
+
throw i;
|
|
1149
|
+
}
|
|
1150
|
+
default:
|
|
1151
|
+
return s;
|
|
1152
|
+
}
|
|
1153
|
+
});
|
|
1154
|
+
for (let s = e[n]; n < t; s = e[++n])
|
|
1155
|
+
s === null || typeof s != "object" ? r += ` ${s}` : r += ` ${U(s)}`;
|
|
1156
|
+
return r;
|
|
1157
|
+
}
|
|
1158
|
+
function U(e, t = {}) {
|
|
1159
|
+
return t.truncate === 0 && (t.truncate = Number.POSITIVE_INFINITY), _e(e, t);
|
|
1160
|
+
}
|
|
1161
|
+
function mo(e, t = {}) {
|
|
1162
|
+
typeof t.truncate > "u" && (t.truncate = 40);
|
|
1163
|
+
const n = U(e, t), o = Object.prototype.toString.call(e);
|
|
1164
|
+
if (t.truncate && n.length >= t.truncate)
|
|
1165
|
+
if (o === "[object Function]") {
|
|
1166
|
+
const r = e;
|
|
1167
|
+
return r.name ? `[Function: ${r.name}]` : "[Function]";
|
|
1168
|
+
} else {
|
|
1169
|
+
if (o === "[object Array]")
|
|
1170
|
+
return `[ Array(${e.length}) ]`;
|
|
1171
|
+
if (o === "[object Object]") {
|
|
1172
|
+
const r = Object.keys(e);
|
|
1173
|
+
return `{ Object (${r.length > 2 ? `${r.splice(0, 2).join(", ")}, ...` : r.join(", ")}) }`;
|
|
1174
|
+
} else
|
|
1175
|
+
return n;
|
|
1176
|
+
}
|
|
1177
|
+
return n;
|
|
1178
|
+
}
|
|
1179
|
+
function yi(e) {
|
|
1180
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1181
|
+
}
|
|
1182
|
+
function gi(e) {
|
|
1183
|
+
const { message: t = "$$stack trace error", stackTraceLimit: n = 1 } = e || {}, o = Error.stackTraceLimit, r = Error.prepareStackTrace;
|
|
1184
|
+
Error.stackTraceLimit = n, Error.prepareStackTrace = (c) => c.stack;
|
|
1185
|
+
const i = new Error(t).stack || "";
|
|
1186
|
+
return Error.prepareStackTrace = r, Error.stackTraceLimit = o, i;
|
|
1187
|
+
}
|
|
1188
|
+
function ho(e, t, n) {
|
|
1189
|
+
const o = typeof e;
|
|
1190
|
+
if (!n.includes(o))
|
|
1191
|
+
throw new TypeError(`${t} value must be ${n.join(" or ")}, received "${o}"`);
|
|
1192
|
+
}
|
|
1193
|
+
function Xt(e) {
|
|
1194
|
+
return e == null && (e = []), Array.isArray(e) ? e : [e];
|
|
1195
|
+
}
|
|
1196
|
+
function Ut(e) {
|
|
1197
|
+
return e != null && typeof e == "object" && !Array.isArray(e);
|
|
1198
|
+
}
|
|
1199
|
+
function yo(e) {
|
|
1200
|
+
return e === Object.prototype || e === Function.prototype || e === RegExp.prototype;
|
|
1201
|
+
}
|
|
1202
|
+
function bi(e) {
|
|
1203
|
+
return Object.prototype.toString.apply(e).slice(8, -1);
|
|
1204
|
+
}
|
|
1205
|
+
function go(e, t) {
|
|
1206
|
+
const n = typeof t == "function" ? t : (o) => t.add(o);
|
|
1207
|
+
Object.getOwnPropertyNames(e).forEach(n), Object.getOwnPropertySymbols(e).forEach(n);
|
|
1208
|
+
}
|
|
1209
|
+
function bo(e) {
|
|
1210
|
+
const t = /* @__PURE__ */ new Set();
|
|
1211
|
+
return yo(e) ? [] : (go(e, t), Array.from(t));
|
|
1212
|
+
}
|
|
1213
|
+
const qt = { forceWritable: !1 };
|
|
1214
|
+
function Si(e, t = qt) {
|
|
1215
|
+
return Ie(e, /* @__PURE__ */ new WeakMap(), t);
|
|
1216
|
+
}
|
|
1217
|
+
function Ie(e, t, n = qt) {
|
|
1218
|
+
let o, r;
|
|
1219
|
+
if (t.has(e))
|
|
1220
|
+
return t.get(e);
|
|
1221
|
+
if (Array.isArray(e)) {
|
|
1222
|
+
for (r = Array.from({ length: o = e.length }), t.set(e, r); o--; )
|
|
1223
|
+
r[o] = Ie(e[o], t, n);
|
|
1224
|
+
return r;
|
|
1225
|
+
}
|
|
1226
|
+
if (Object.prototype.toString.call(e) === "[object Object]") {
|
|
1227
|
+
r = Object.create(Object.getPrototypeOf(e)), t.set(e, r);
|
|
1228
|
+
const s = bo(e);
|
|
1229
|
+
for (const i of s) {
|
|
1230
|
+
const c = Object.getOwnPropertyDescriptor(e, i);
|
|
1231
|
+
if (!c)
|
|
1232
|
+
continue;
|
|
1233
|
+
const u = Ie(e[i], t, n);
|
|
1234
|
+
n.forceWritable ? Object.defineProperty(r, i, {
|
|
1235
|
+
enumerable: c.enumerable,
|
|
1236
|
+
configurable: !0,
|
|
1237
|
+
writable: !0,
|
|
1238
|
+
value: u
|
|
1239
|
+
}) : "get" in c ? Object.defineProperty(r, i, {
|
|
1240
|
+
...c,
|
|
1241
|
+
get() {
|
|
1242
|
+
return u;
|
|
1243
|
+
}
|
|
1244
|
+
}) : Object.defineProperty(r, i, {
|
|
1245
|
+
...c,
|
|
1246
|
+
value: u
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1249
|
+
return r;
|
|
1250
|
+
}
|
|
1251
|
+
return e;
|
|
1252
|
+
}
|
|
1253
|
+
function Ei() {
|
|
1254
|
+
}
|
|
1255
|
+
function ut(e, t, n = void 0) {
|
|
1256
|
+
const o = t.replace(/\[(\d+)\]/g, ".$1").split(".");
|
|
1257
|
+
let r = e;
|
|
1258
|
+
for (const s of o)
|
|
1259
|
+
if (r = new Object(r)[s], r === void 0)
|
|
1260
|
+
return n;
|
|
1261
|
+
return r;
|
|
1262
|
+
}
|
|
1263
|
+
function at() {
|
|
1264
|
+
let e = null, t = null;
|
|
1265
|
+
const n = new Promise((o, r) => {
|
|
1266
|
+
e = o, t = r;
|
|
1267
|
+
});
|
|
1268
|
+
return n.resolve = e, n.reject = t, n;
|
|
1269
|
+
}
|
|
1270
|
+
function So(e) {
|
|
1271
|
+
if (!Number.isNaN(e))
|
|
1272
|
+
return !1;
|
|
1273
|
+
const t = new Float64Array(1);
|
|
1274
|
+
return t[0] = e, new Uint32Array(t.buffer)[1] >>> 31 === 1;
|
|
1275
|
+
}
|
|
1276
|
+
var Vt = {
|
|
1277
|
+
keyword: [
|
|
1278
|
+
"break",
|
|
1279
|
+
"case",
|
|
1280
|
+
"catch",
|
|
1281
|
+
"continue",
|
|
1282
|
+
"debugger",
|
|
1283
|
+
"default",
|
|
1284
|
+
"do",
|
|
1285
|
+
"else",
|
|
1286
|
+
"finally",
|
|
1287
|
+
"for",
|
|
1288
|
+
"function",
|
|
1289
|
+
"if",
|
|
1290
|
+
"return",
|
|
1291
|
+
"switch",
|
|
1292
|
+
"throw",
|
|
1293
|
+
"try",
|
|
1294
|
+
"var",
|
|
1295
|
+
"const",
|
|
1296
|
+
"while",
|
|
1297
|
+
"with",
|
|
1298
|
+
"new",
|
|
1299
|
+
"this",
|
|
1300
|
+
"super",
|
|
1301
|
+
"class",
|
|
1302
|
+
"extends",
|
|
1303
|
+
"export",
|
|
1304
|
+
"import",
|
|
1305
|
+
"null",
|
|
1306
|
+
"true",
|
|
1307
|
+
"false",
|
|
1308
|
+
"in",
|
|
1309
|
+
"instanceof",
|
|
1310
|
+
"typeof",
|
|
1311
|
+
"void",
|
|
1312
|
+
"delete"
|
|
1313
|
+
],
|
|
1314
|
+
strict: [
|
|
1315
|
+
"implements",
|
|
1316
|
+
"interface",
|
|
1317
|
+
"let",
|
|
1318
|
+
"package",
|
|
1319
|
+
"private",
|
|
1320
|
+
"protected",
|
|
1321
|
+
"public",
|
|
1322
|
+
"static",
|
|
1323
|
+
"yield"
|
|
1324
|
+
]
|
|
1325
|
+
};
|
|
1326
|
+
new Set(Vt.keyword);
|
|
1327
|
+
new Set(Vt.strict);
|
|
1328
|
+
const lt = Symbol("vitest:SAFE_TIMERS");
|
|
1329
|
+
function Eo() {
|
|
1330
|
+
const { setTimeout: e, setInterval: t, clearInterval: n, clearTimeout: o, setImmediate: r, clearImmediate: s, queueMicrotask: i } = globalThis[lt] || globalThis, { nextTick: c } = globalThis[lt] || globalThis.process || { nextTick: (u) => u() };
|
|
1331
|
+
return {
|
|
1332
|
+
nextTick: c,
|
|
1333
|
+
setTimeout: e,
|
|
1334
|
+
setInterval: t,
|
|
1335
|
+
clearInterval: n,
|
|
1336
|
+
clearTimeout: o,
|
|
1337
|
+
setImmediate: r,
|
|
1338
|
+
clearImmediate: s,
|
|
1339
|
+
queueMicrotask: i
|
|
1340
|
+
};
|
|
1341
|
+
}
|
|
1342
|
+
const ft = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", To = new Uint8Array(64), $o = new Uint8Array(128);
|
|
1343
|
+
for (let e = 0; e < ft.length; e++) {
|
|
1344
|
+
const t = ft.charCodeAt(e);
|
|
1345
|
+
To[e] = t, $o[t] = e;
|
|
1346
|
+
}
|
|
1347
|
+
var pt;
|
|
1348
|
+
(function(e) {
|
|
1349
|
+
e[e.Empty = 1] = "Empty", e[e.Hash = 2] = "Hash", e[e.Query = 3] = "Query", e[e.RelativePath = 4] = "RelativePath", e[e.AbsolutePath = 5] = "AbsolutePath", e[e.SchemeRelative = 6] = "SchemeRelative", e[e.Absolute = 7] = "Absolute";
|
|
1350
|
+
})(pt || (pt = {}));
|
|
1351
|
+
const _o = /^[A-Za-z]:\//;
|
|
1352
|
+
function Io(e = "") {
|
|
1353
|
+
return e && e.replace(/\\/g, "/").replace(_o, (t) => t.toUpperCase());
|
|
1354
|
+
}
|
|
1355
|
+
const wo = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
1356
|
+
function Ao() {
|
|
1357
|
+
return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
|
|
1358
|
+
}
|
|
1359
|
+
const Co = function(...e) {
|
|
1360
|
+
e = e.map((o) => Io(o));
|
|
1361
|
+
let t = "", n = !1;
|
|
1362
|
+
for (let o = e.length - 1; o >= -1 && !n; o--) {
|
|
1363
|
+
const r = o >= 0 ? e[o] : Ao();
|
|
1364
|
+
!r || r.length === 0 || (t = `${r}/${t}`, n = dt(r));
|
|
1365
|
+
}
|
|
1366
|
+
return t = xo(t, !n), n && !dt(t) ? `/${t}` : t.length > 0 ? t : ".";
|
|
1367
|
+
};
|
|
1368
|
+
function xo(e, t) {
|
|
1369
|
+
let n = "", o = 0, r = -1, s = 0, i = null;
|
|
1370
|
+
for (let c = 0; c <= e.length; ++c) {
|
|
1371
|
+
if (c < e.length)
|
|
1372
|
+
i = e[c];
|
|
1373
|
+
else {
|
|
1374
|
+
if (i === "/")
|
|
1375
|
+
break;
|
|
1376
|
+
i = "/";
|
|
1377
|
+
}
|
|
1378
|
+
if (i === "/") {
|
|
1379
|
+
if (!(r === c - 1 || s === 1)) if (s === 2) {
|
|
1380
|
+
if (n.length < 2 || o !== 2 || n[n.length - 1] !== "." || n[n.length - 2] !== ".") {
|
|
1381
|
+
if (n.length > 2) {
|
|
1382
|
+
const u = n.lastIndexOf("/");
|
|
1383
|
+
u === -1 ? (n = "", o = 0) : (n = n.slice(0, u), o = n.length - 1 - n.lastIndexOf("/")), r = c, s = 0;
|
|
1384
|
+
continue;
|
|
1385
|
+
} else if (n.length > 0) {
|
|
1386
|
+
n = "", o = 0, r = c, s = 0;
|
|
1387
|
+
continue;
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
t && (n += n.length > 0 ? "/.." : "..", o = 2);
|
|
1391
|
+
} else
|
|
1392
|
+
n.length > 0 ? n += `/${e.slice(r + 1, c)}` : n = e.slice(r + 1, c), o = c - r - 1;
|
|
1393
|
+
r = c, s = 0;
|
|
1394
|
+
} else i === "." && s !== -1 ? ++s : s = -1;
|
|
1395
|
+
}
|
|
1396
|
+
return n;
|
|
1397
|
+
}
|
|
1398
|
+
const dt = function(e) {
|
|
1399
|
+
return wo.test(e);
|
|
1400
|
+
}, Kt = /^\s*at .*(?:\S:\d+|\(native\))/m, No = /^(?:eval@)?(?:\[native code\])?$/;
|
|
1401
|
+
function Ht(e) {
|
|
1402
|
+
if (!e.includes(":"))
|
|
1403
|
+
return [e];
|
|
1404
|
+
const n = /(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/^\(|\)$/g, ""));
|
|
1405
|
+
if (!n)
|
|
1406
|
+
return [e];
|
|
1407
|
+
let o = n[1];
|
|
1408
|
+
if (o.startsWith("async ") && (o = o.slice(6)), o.startsWith("http:") || o.startsWith("https:")) {
|
|
1409
|
+
const r = new URL(o);
|
|
1410
|
+
r.searchParams.delete("import"), r.searchParams.delete("browserv"), o = r.pathname + r.hash + r.search;
|
|
1411
|
+
}
|
|
1412
|
+
if (o.startsWith("/@fs/")) {
|
|
1413
|
+
const r = /^\/@fs\/[a-zA-Z]:\//.test(o);
|
|
1414
|
+
o = o.slice(r ? 5 : 4);
|
|
1415
|
+
}
|
|
1416
|
+
return [
|
|
1417
|
+
o,
|
|
1418
|
+
n[2] || void 0,
|
|
1419
|
+
n[3] || void 0
|
|
1420
|
+
];
|
|
1421
|
+
}
|
|
1422
|
+
function Oo(e) {
|
|
1423
|
+
let t = e.trim();
|
|
1424
|
+
if (No.test(t) || (t.includes(" > eval") && (t = t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), !t.includes("@") && !t.includes(":")))
|
|
1425
|
+
return null;
|
|
1426
|
+
const n = /((.*".+"[^@]*)?[^@]*)(@)/, o = t.match(n), r = o && o[1] ? o[1] : void 0, [s, i, c] = Ht(t.replace(n, ""));
|
|
1427
|
+
return !s || !i || !c ? null : {
|
|
1428
|
+
file: s,
|
|
1429
|
+
method: r || "",
|
|
1430
|
+
line: Number.parseInt(i),
|
|
1431
|
+
column: Number.parseInt(c)
|
|
1432
|
+
};
|
|
1433
|
+
}
|
|
1434
|
+
function Yt(e) {
|
|
1435
|
+
const t = e.trim();
|
|
1436
|
+
return Kt.test(t) ? ko(t) : Oo(t);
|
|
1437
|
+
}
|
|
1438
|
+
function ko(e) {
|
|
1439
|
+
let t = e.trim();
|
|
1440
|
+
if (!Kt.test(t))
|
|
1441
|
+
return null;
|
|
1442
|
+
t.includes("(eval ") && (t = t.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, ""));
|
|
1443
|
+
let n = t.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, "");
|
|
1444
|
+
const o = n.match(/ (\(.+\)$)/);
|
|
1445
|
+
n = o ? n.replace(o[0], "") : n;
|
|
1446
|
+
const [r, s, i] = Ht(o ? o[1] : n);
|
|
1447
|
+
let c = o && n || "", u = r && ["eval", "<anonymous>"].includes(r) ? void 0 : r;
|
|
1448
|
+
return !u || !s || !i ? null : (c.startsWith("async ") && (c = c.slice(6)), u.startsWith("file://") && (u = u.slice(7)), u = u.startsWith("node:") || u.startsWith("internal:") ? u : Co(u), c && (c = c.replace(/__vite_ssr_import_\d+__\./g, "")), {
|
|
1449
|
+
method: c,
|
|
1450
|
+
file: u,
|
|
1451
|
+
line: Number.parseInt(s),
|
|
1452
|
+
column: Number.parseInt(i)
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1455
|
+
function Po(e) {
|
|
1456
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1457
|
+
}
|
|
1458
|
+
var Se, mt;
|
|
1459
|
+
function vo() {
|
|
1460
|
+
if (mt) return Se;
|
|
1461
|
+
mt = 1;
|
|
1462
|
+
var e, t, n, o, r, s, i, c, u, a, l, d, h, g, y, f, p, b, $, C;
|
|
1463
|
+
return g = /\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]?|[^\/[\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu, h = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y, t = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu, f = /(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y, d = /(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y, p = /[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y, C = /[\t\v\f\ufeff\p{Zs}]+/yu, u = /\r?\n|[\r\u2028\u2029]/y, a = /\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y, y = /\/\/.*/y, e = /^#!.*/, o = /[<>.:={}]|\/(?![\/*])/y, n = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu, r = /(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y, s = /[^<>{}]+/y, $ = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/, b = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/, i = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/, c = /^(?:return|throw|yield)$/, l = RegExp(u.source), Se = function* (T, { jsx: J = !1 } = {}) {
|
|
1464
|
+
var x, X, Y, S, E, Le, m, M, je, N, G, w, Z, A;
|
|
1465
|
+
for ({ length: Le } = T, S = 0, E = "", A = [
|
|
1466
|
+
{ tag: "JS" }
|
|
1467
|
+
], x = [], G = 0, w = !1, (m = e.exec(T)) && (yield {
|
|
1468
|
+
type: "HashbangComment",
|
|
1469
|
+
value: m[0]
|
|
1470
|
+
}, S = m[0].length); S < Le; ) {
|
|
1471
|
+
switch (M = A[A.length - 1], M.tag) {
|
|
1472
|
+
case "JS":
|
|
1473
|
+
case "JSNonExpressionParen":
|
|
1474
|
+
case "InterpolationInTemplate":
|
|
1475
|
+
case "InterpolationInJSX":
|
|
1476
|
+
if (T[S] === "/" && ($.test(E) || i.test(E)) && (g.lastIndex = S, m = g.exec(T))) {
|
|
1477
|
+
S = g.lastIndex, E = m[0], w = !0, yield {
|
|
1478
|
+
type: "RegularExpressionLiteral",
|
|
1479
|
+
value: m[0],
|
|
1480
|
+
closed: m[1] !== void 0 && m[1] !== "\\"
|
|
1481
|
+
};
|
|
1482
|
+
continue;
|
|
1483
|
+
}
|
|
1484
|
+
if (h.lastIndex = S, m = h.exec(T)) {
|
|
1485
|
+
switch (Z = m[0], je = h.lastIndex, N = Z, Z) {
|
|
1486
|
+
case "(":
|
|
1487
|
+
E === "?NonExpressionParenKeyword" && A.push({
|
|
1488
|
+
tag: "JSNonExpressionParen",
|
|
1489
|
+
nesting: G
|
|
1490
|
+
}), G++, w = !1;
|
|
1491
|
+
break;
|
|
1492
|
+
case ")":
|
|
1493
|
+
G--, w = !0, M.tag === "JSNonExpressionParen" && G === M.nesting && (A.pop(), N = "?NonExpressionParenEnd", w = !1);
|
|
1494
|
+
break;
|
|
1495
|
+
case "{":
|
|
1496
|
+
h.lastIndex = 0, Y = !b.test(E) && ($.test(E) || i.test(E)), x.push(Y), w = !1;
|
|
1497
|
+
break;
|
|
1498
|
+
case "}":
|
|
1499
|
+
switch (M.tag) {
|
|
1500
|
+
case "InterpolationInTemplate":
|
|
1501
|
+
if (x.length === M.nesting) {
|
|
1502
|
+
p.lastIndex = S, m = p.exec(T), S = p.lastIndex, E = m[0], m[1] === "${" ? (E = "?InterpolationInTemplate", w = !1, yield {
|
|
1503
|
+
type: "TemplateMiddle",
|
|
1504
|
+
value: m[0]
|
|
1505
|
+
}) : (A.pop(), w = !0, yield {
|
|
1506
|
+
type: "TemplateTail",
|
|
1507
|
+
value: m[0],
|
|
1508
|
+
closed: m[1] === "`"
|
|
1509
|
+
});
|
|
1510
|
+
continue;
|
|
1511
|
+
}
|
|
1512
|
+
break;
|
|
1513
|
+
case "InterpolationInJSX":
|
|
1514
|
+
if (x.length === M.nesting) {
|
|
1515
|
+
A.pop(), S += 1, E = "}", yield {
|
|
1516
|
+
type: "JSXPunctuator",
|
|
1517
|
+
value: "}"
|
|
1518
|
+
};
|
|
1519
|
+
continue;
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
w = x.pop(), N = w ? "?ExpressionBraceEnd" : "}";
|
|
1523
|
+
break;
|
|
1524
|
+
case "]":
|
|
1525
|
+
w = !0;
|
|
1526
|
+
break;
|
|
1527
|
+
case "++":
|
|
1528
|
+
case "--":
|
|
1529
|
+
N = w ? "?PostfixIncDec" : "?UnaryIncDec";
|
|
1530
|
+
break;
|
|
1531
|
+
case "<":
|
|
1532
|
+
if (J && ($.test(E) || i.test(E))) {
|
|
1533
|
+
A.push({ tag: "JSXTag" }), S += 1, E = "<", yield {
|
|
1534
|
+
type: "JSXPunctuator",
|
|
1535
|
+
value: Z
|
|
1536
|
+
};
|
|
1537
|
+
continue;
|
|
1538
|
+
}
|
|
1539
|
+
w = !1;
|
|
1540
|
+
break;
|
|
1541
|
+
default:
|
|
1542
|
+
w = !1;
|
|
1543
|
+
}
|
|
1544
|
+
S = je, E = N, yield {
|
|
1545
|
+
type: "Punctuator",
|
|
1546
|
+
value: Z
|
|
1547
|
+
};
|
|
1548
|
+
continue;
|
|
1549
|
+
}
|
|
1550
|
+
if (t.lastIndex = S, m = t.exec(T)) {
|
|
1551
|
+
switch (S = t.lastIndex, N = m[0], m[0]) {
|
|
1552
|
+
case "for":
|
|
1553
|
+
case "if":
|
|
1554
|
+
case "while":
|
|
1555
|
+
case "with":
|
|
1556
|
+
E !== "." && E !== "?." && (N = "?NonExpressionParenKeyword");
|
|
1557
|
+
}
|
|
1558
|
+
E = N, w = !i.test(m[0]), yield {
|
|
1559
|
+
type: m[1] === "#" ? "PrivateIdentifier" : "IdentifierName",
|
|
1560
|
+
value: m[0]
|
|
1561
|
+
};
|
|
1562
|
+
continue;
|
|
1563
|
+
}
|
|
1564
|
+
if (f.lastIndex = S, m = f.exec(T)) {
|
|
1565
|
+
S = f.lastIndex, E = m[0], w = !0, yield {
|
|
1566
|
+
type: "StringLiteral",
|
|
1567
|
+
value: m[0],
|
|
1568
|
+
closed: m[2] !== void 0
|
|
1569
|
+
};
|
|
1570
|
+
continue;
|
|
1571
|
+
}
|
|
1572
|
+
if (d.lastIndex = S, m = d.exec(T)) {
|
|
1573
|
+
S = d.lastIndex, E = m[0], w = !0, yield {
|
|
1574
|
+
type: "NumericLiteral",
|
|
1575
|
+
value: m[0]
|
|
1576
|
+
};
|
|
1577
|
+
continue;
|
|
1578
|
+
}
|
|
1579
|
+
if (p.lastIndex = S, m = p.exec(T)) {
|
|
1580
|
+
S = p.lastIndex, E = m[0], m[1] === "${" ? (E = "?InterpolationInTemplate", A.push({
|
|
1581
|
+
tag: "InterpolationInTemplate",
|
|
1582
|
+
nesting: x.length
|
|
1583
|
+
}), w = !1, yield {
|
|
1584
|
+
type: "TemplateHead",
|
|
1585
|
+
value: m[0]
|
|
1586
|
+
}) : (w = !0, yield {
|
|
1587
|
+
type: "NoSubstitutionTemplate",
|
|
1588
|
+
value: m[0],
|
|
1589
|
+
closed: m[1] === "`"
|
|
1590
|
+
});
|
|
1591
|
+
continue;
|
|
1592
|
+
}
|
|
1593
|
+
break;
|
|
1594
|
+
case "JSXTag":
|
|
1595
|
+
case "JSXTagEnd":
|
|
1596
|
+
if (o.lastIndex = S, m = o.exec(T)) {
|
|
1597
|
+
switch (S = o.lastIndex, N = m[0], m[0]) {
|
|
1598
|
+
case "<":
|
|
1599
|
+
A.push({ tag: "JSXTag" });
|
|
1600
|
+
break;
|
|
1601
|
+
case ">":
|
|
1602
|
+
A.pop(), E === "/" || M.tag === "JSXTagEnd" ? (N = "?JSX", w = !0) : A.push({ tag: "JSXChildren" });
|
|
1603
|
+
break;
|
|
1604
|
+
case "{":
|
|
1605
|
+
A.push({
|
|
1606
|
+
tag: "InterpolationInJSX",
|
|
1607
|
+
nesting: x.length
|
|
1608
|
+
}), N = "?InterpolationInJSX", w = !1;
|
|
1609
|
+
break;
|
|
1610
|
+
case "/":
|
|
1611
|
+
E === "<" && (A.pop(), A[A.length - 1].tag === "JSXChildren" && A.pop(), A.push({ tag: "JSXTagEnd" }));
|
|
1612
|
+
}
|
|
1613
|
+
E = N, yield {
|
|
1614
|
+
type: "JSXPunctuator",
|
|
1615
|
+
value: m[0]
|
|
1616
|
+
};
|
|
1617
|
+
continue;
|
|
1618
|
+
}
|
|
1619
|
+
if (n.lastIndex = S, m = n.exec(T)) {
|
|
1620
|
+
S = n.lastIndex, E = m[0], yield {
|
|
1621
|
+
type: "JSXIdentifier",
|
|
1622
|
+
value: m[0]
|
|
1623
|
+
};
|
|
1624
|
+
continue;
|
|
1625
|
+
}
|
|
1626
|
+
if (r.lastIndex = S, m = r.exec(T)) {
|
|
1627
|
+
S = r.lastIndex, E = m[0], yield {
|
|
1628
|
+
type: "JSXString",
|
|
1629
|
+
value: m[0],
|
|
1630
|
+
closed: m[2] !== void 0
|
|
1631
|
+
};
|
|
1632
|
+
continue;
|
|
1633
|
+
}
|
|
1634
|
+
break;
|
|
1635
|
+
case "JSXChildren":
|
|
1636
|
+
if (s.lastIndex = S, m = s.exec(T)) {
|
|
1637
|
+
S = s.lastIndex, E = m[0], yield {
|
|
1638
|
+
type: "JSXText",
|
|
1639
|
+
value: m[0]
|
|
1640
|
+
};
|
|
1641
|
+
continue;
|
|
1642
|
+
}
|
|
1643
|
+
switch (T[S]) {
|
|
1644
|
+
case "<":
|
|
1645
|
+
A.push({ tag: "JSXTag" }), S++, E = "<", yield {
|
|
1646
|
+
type: "JSXPunctuator",
|
|
1647
|
+
value: "<"
|
|
1648
|
+
};
|
|
1649
|
+
continue;
|
|
1650
|
+
case "{":
|
|
1651
|
+
A.push({
|
|
1652
|
+
tag: "InterpolationInJSX",
|
|
1653
|
+
nesting: x.length
|
|
1654
|
+
}), S++, E = "?InterpolationInJSX", w = !1, yield {
|
|
1655
|
+
type: "JSXPunctuator",
|
|
1656
|
+
value: "{"
|
|
1657
|
+
};
|
|
1658
|
+
continue;
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
if (C.lastIndex = S, m = C.exec(T)) {
|
|
1662
|
+
S = C.lastIndex, yield {
|
|
1663
|
+
type: "WhiteSpace",
|
|
1664
|
+
value: m[0]
|
|
1665
|
+
};
|
|
1666
|
+
continue;
|
|
1667
|
+
}
|
|
1668
|
+
if (u.lastIndex = S, m = u.exec(T)) {
|
|
1669
|
+
S = u.lastIndex, w = !1, c.test(E) && (E = "?NoLineTerminatorHere"), yield {
|
|
1670
|
+
type: "LineTerminatorSequence",
|
|
1671
|
+
value: m[0]
|
|
1672
|
+
};
|
|
1673
|
+
continue;
|
|
1674
|
+
}
|
|
1675
|
+
if (a.lastIndex = S, m = a.exec(T)) {
|
|
1676
|
+
S = a.lastIndex, l.test(m[0]) && (w = !1, c.test(E) && (E = "?NoLineTerminatorHere")), yield {
|
|
1677
|
+
type: "MultiLineComment",
|
|
1678
|
+
value: m[0],
|
|
1679
|
+
closed: m[1] !== void 0
|
|
1680
|
+
};
|
|
1681
|
+
continue;
|
|
1682
|
+
}
|
|
1683
|
+
if (y.lastIndex = S, m = y.exec(T)) {
|
|
1684
|
+
S = y.lastIndex, w = !1, yield {
|
|
1685
|
+
type: "SingleLineComment",
|
|
1686
|
+
value: m[0]
|
|
1687
|
+
};
|
|
1688
|
+
continue;
|
|
1689
|
+
}
|
|
1690
|
+
X = String.fromCodePoint(T.codePointAt(S)), S += X.length, E = X, w = !1, yield {
|
|
1691
|
+
type: M.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid",
|
|
1692
|
+
value: X
|
|
1693
|
+
};
|
|
1694
|
+
}
|
|
1695
|
+
}, Se;
|
|
1696
|
+
}
|
|
1697
|
+
var Ro = /* @__PURE__ */ vo();
|
|
1698
|
+
const Mo = /* @__PURE__ */ Po(Ro);
|
|
1699
|
+
function Lo(e, t) {
|
|
1700
|
+
const n = " ", o = " ";
|
|
1701
|
+
let r = "";
|
|
1702
|
+
const s = [];
|
|
1703
|
+
for (const i of Mo(e, { jsx: !1 })) {
|
|
1704
|
+
if (s.push(i), i.type === "SingleLineComment") {
|
|
1705
|
+
r += o.repeat(i.value.length);
|
|
1706
|
+
continue;
|
|
1707
|
+
}
|
|
1708
|
+
if (i.type === "MultiLineComment") {
|
|
1709
|
+
r += i.value.replace(/[^\n]/g, o);
|
|
1710
|
+
continue;
|
|
1711
|
+
}
|
|
1712
|
+
if (i.type === "StringLiteral") {
|
|
1713
|
+
if (!i.closed) {
|
|
1714
|
+
r += i.value;
|
|
1715
|
+
continue;
|
|
1716
|
+
}
|
|
1717
|
+
const c = i.value.slice(1, -1);
|
|
1718
|
+
{
|
|
1719
|
+
r += i.value[0] + n.repeat(c.length) + i.value[i.value.length - 1];
|
|
1720
|
+
continue;
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
if (i.type === "NoSubstitutionTemplate") {
|
|
1724
|
+
const c = i.value.slice(1, -1);
|
|
1725
|
+
{
|
|
1726
|
+
r += `\`${c.replace(/[^\n]/g, n)}\``;
|
|
1727
|
+
continue;
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
if (i.type === "RegularExpressionLiteral") {
|
|
1731
|
+
const c = i.value;
|
|
1732
|
+
{
|
|
1733
|
+
r += c.replace(/\/(.*)\/(\w?)$/g, (u, a, l) => `/${n.repeat(a.length)}/${l}`);
|
|
1734
|
+
continue;
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
if (i.type === "TemplateHead") {
|
|
1738
|
+
const c = i.value.slice(1, -2);
|
|
1739
|
+
{
|
|
1740
|
+
r += `\`${c.replace(/[^\n]/g, n)}\${`;
|
|
1741
|
+
continue;
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
if (i.type === "TemplateTail") {
|
|
1745
|
+
const c = i.value.slice(0, -2);
|
|
1746
|
+
{
|
|
1747
|
+
r += `}${c.replace(/[^\n]/g, n)}\``;
|
|
1748
|
+
continue;
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
if (i.type === "TemplateMiddle") {
|
|
1752
|
+
const c = i.value.slice(1, -2);
|
|
1753
|
+
{
|
|
1754
|
+
r += `}${c.replace(/[^\n]/g, n)}\${`;
|
|
1755
|
+
continue;
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
r += i.value;
|
|
1759
|
+
}
|
|
1760
|
+
return {
|
|
1761
|
+
result: r,
|
|
1762
|
+
tokens: s
|
|
1763
|
+
};
|
|
1764
|
+
}
|
|
1765
|
+
function jo(e, t) {
|
|
1766
|
+
return Fo(e).result;
|
|
1767
|
+
}
|
|
1768
|
+
function Fo(e, t) {
|
|
1769
|
+
return Lo(e);
|
|
1770
|
+
}
|
|
1771
|
+
class Do extends Error {
|
|
1772
|
+
code = "VITEST_PENDING";
|
|
1773
|
+
taskId;
|
|
1774
|
+
constructor(t, n, o) {
|
|
1775
|
+
super(t), this.message = t, this.note = o, this.taskId = n.id;
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
const Bo = /* @__PURE__ */ new WeakMap(), Gt = /* @__PURE__ */ new WeakMap(), Zt = /* @__PURE__ */ new WeakMap();
|
|
1779
|
+
function zo(e, t) {
|
|
1780
|
+
Bo.set(e, t);
|
|
1781
|
+
}
|
|
1782
|
+
function Wo(e, t) {
|
|
1783
|
+
Gt.set(e, t);
|
|
1784
|
+
}
|
|
1785
|
+
function Jo(e) {
|
|
1786
|
+
return Gt.get(e);
|
|
1787
|
+
}
|
|
1788
|
+
function Xo(e, t) {
|
|
1789
|
+
Zt.set(e, t);
|
|
1790
|
+
}
|
|
1791
|
+
function Uo(e) {
|
|
1792
|
+
return Zt.get(e);
|
|
1793
|
+
}
|
|
1794
|
+
function qo(e, t) {
|
|
1795
|
+
const n = t.reduce((s, i) => (s[i.prop] = i, s), {}), o = {};
|
|
1796
|
+
e.forEach((s) => {
|
|
1797
|
+
const i = n[s.prop] || { ...s };
|
|
1798
|
+
o[i.prop] = i;
|
|
1799
|
+
});
|
|
1800
|
+
for (const s in o) {
|
|
1801
|
+
var r;
|
|
1802
|
+
const i = o[s];
|
|
1803
|
+
i.deps = (r = i.deps) === null || r === void 0 ? void 0 : r.map((c) => o[c.prop]);
|
|
1804
|
+
}
|
|
1805
|
+
return Object.values(o);
|
|
1806
|
+
}
|
|
1807
|
+
function Qt(e, t, n) {
|
|
1808
|
+
const o = [
|
|
1809
|
+
"auto",
|
|
1810
|
+
"injected",
|
|
1811
|
+
"scope"
|
|
1812
|
+
], r = Object.entries(e).map(([s, i]) => {
|
|
1813
|
+
const c = { value: i };
|
|
1814
|
+
if (Array.isArray(i) && i.length >= 2 && Ut(i[1]) && Object.keys(i[1]).some((a) => o.includes(a))) {
|
|
1815
|
+
var u;
|
|
1816
|
+
Object.assign(c, i[1]);
|
|
1817
|
+
const a = i[0];
|
|
1818
|
+
c.value = c.injected ? ((u = n.injectValue) === null || u === void 0 ? void 0 : u.call(n, s)) ?? a : a;
|
|
1819
|
+
}
|
|
1820
|
+
return c.scope = c.scope || "test", c.scope === "worker" && !n.getWorkerContext && (c.scope = "file"), c.prop = s, c.isFn = typeof c.value == "function", c;
|
|
1821
|
+
});
|
|
1822
|
+
return Array.isArray(t.fixtures) ? t.fixtures = t.fixtures.concat(r) : t.fixtures = r, r.forEach((s) => {
|
|
1823
|
+
if (s.isFn) {
|
|
1824
|
+
const c = nn(s.value);
|
|
1825
|
+
if (c.length && (s.deps = t.fixtures.filter(({ prop: u }) => u !== s.prop && c.includes(u))), s.scope !== "test") {
|
|
1826
|
+
var i;
|
|
1827
|
+
(i = s.deps) === null || i === void 0 || i.forEach((u) => {
|
|
1828
|
+
if (u.isFn && !(s.scope === "worker" && u.scope === "worker") && !(s.scope === "file" && u.scope !== "test"))
|
|
1829
|
+
throw new SyntaxError(`cannot use the ${u.scope} fixture "${u.prop}" inside the ${s.scope} fixture "${s.prop}"`);
|
|
1830
|
+
});
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
}), t;
|
|
1834
|
+
}
|
|
1835
|
+
const Ee = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Map();
|
|
1836
|
+
function en(e, t, n) {
|
|
1837
|
+
return (o) => {
|
|
1838
|
+
const r = o || n;
|
|
1839
|
+
if (!r)
|
|
1840
|
+
return t({});
|
|
1841
|
+
const s = Jo(r);
|
|
1842
|
+
if (!s?.length)
|
|
1843
|
+
return t(r);
|
|
1844
|
+
const i = nn(t), c = s.some(({ auto: g }) => g);
|
|
1845
|
+
if (!i.length && !c)
|
|
1846
|
+
return t(r);
|
|
1847
|
+
Ee.get(r) || Ee.set(r, /* @__PURE__ */ new Map());
|
|
1848
|
+
const u = Ee.get(r);
|
|
1849
|
+
V.has(r) || V.set(r, []);
|
|
1850
|
+
const a = V.get(r), l = s.filter(({ prop: g, auto: y }) => y || i.includes(g)), d = tn(l);
|
|
1851
|
+
if (!d.length)
|
|
1852
|
+
return t(r);
|
|
1853
|
+
async function h() {
|
|
1854
|
+
for (const g of d) {
|
|
1855
|
+
if (u.has(g))
|
|
1856
|
+
continue;
|
|
1857
|
+
const y = await Vo(e, g, r, a);
|
|
1858
|
+
r[g.prop] = y, u.set(g, y), g.scope === "test" && a.unshift(() => {
|
|
1859
|
+
u.delete(g);
|
|
1860
|
+
});
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
return h().then(() => t(r));
|
|
1864
|
+
};
|
|
1865
|
+
}
|
|
1866
|
+
const re = /* @__PURE__ */ new WeakMap();
|
|
1867
|
+
function Vo(e, t, n, o) {
|
|
1868
|
+
var r;
|
|
1869
|
+
const s = fi(n.task.file), i = (r = e.getWorkerContext) === null || r === void 0 ? void 0 : r.call(e);
|
|
1870
|
+
if (!t.isFn) {
|
|
1871
|
+
var c;
|
|
1872
|
+
if (s[c = t.prop] ?? (s[c] = t.value), i) {
|
|
1873
|
+
var u;
|
|
1874
|
+
i[u = t.prop] ?? (i[u] = t.value);
|
|
1875
|
+
}
|
|
1876
|
+
return t.value;
|
|
1877
|
+
}
|
|
1878
|
+
if (t.scope === "test")
|
|
1879
|
+
return ht(t.value, n, o);
|
|
1880
|
+
if (re.has(t))
|
|
1881
|
+
return re.get(t);
|
|
1882
|
+
let a;
|
|
1883
|
+
if (t.scope === "worker") {
|
|
1884
|
+
if (!i)
|
|
1885
|
+
throw new TypeError("[@vitest/runner] The worker context is not available in the current test runner. Please, provide the `getWorkerContext` method when initiating the runner.");
|
|
1886
|
+
a = i;
|
|
1887
|
+
} else
|
|
1888
|
+
a = s;
|
|
1889
|
+
if (t.prop in a)
|
|
1890
|
+
return a[t.prop];
|
|
1891
|
+
V.has(a) || V.set(a, []);
|
|
1892
|
+
const l = V.get(a), d = ht(t.value, a, l).then((h) => (a[t.prop] = h, re.delete(t), h));
|
|
1893
|
+
return re.set(t, d), d;
|
|
1894
|
+
}
|
|
1895
|
+
async function ht(e, t, n) {
|
|
1896
|
+
const o = at();
|
|
1897
|
+
let r = !1;
|
|
1898
|
+
const s = e(t, async (i) => {
|
|
1899
|
+
r = !0, o.resolve(i);
|
|
1900
|
+
const c = at();
|
|
1901
|
+
n.push(async () => {
|
|
1902
|
+
c.resolve(), await s;
|
|
1903
|
+
}), await c;
|
|
1904
|
+
}).catch((i) => {
|
|
1905
|
+
if (!r) {
|
|
1906
|
+
o.reject(i);
|
|
1907
|
+
return;
|
|
1908
|
+
}
|
|
1909
|
+
throw i;
|
|
1910
|
+
});
|
|
1911
|
+
return o;
|
|
1912
|
+
}
|
|
1913
|
+
function tn(e, t = /* @__PURE__ */ new Set(), n = []) {
|
|
1914
|
+
return e.forEach((o) => {
|
|
1915
|
+
if (!n.includes(o)) {
|
|
1916
|
+
if (!o.isFn || !o.deps) {
|
|
1917
|
+
n.push(o);
|
|
1918
|
+
return;
|
|
1919
|
+
}
|
|
1920
|
+
if (t.has(o))
|
|
1921
|
+
throw new Error(`Circular fixture dependency detected: ${o.prop} <- ${[...t].reverse().map((r) => r.prop).join(" <- ")}`);
|
|
1922
|
+
t.add(o), tn(o.deps, t, n), n.push(o), t.clear();
|
|
1923
|
+
}
|
|
1924
|
+
}), n;
|
|
1925
|
+
}
|
|
1926
|
+
function nn(e) {
|
|
1927
|
+
let t = jo(e.toString());
|
|
1928
|
+
/__async\((?:this|null), (?:null|arguments|\[[_0-9, ]*\]), function\*/.test(t) && (t = t.split(/__async\((?:this|null),/)[1]);
|
|
1929
|
+
const n = t.match(/[^(]*\(([^)]*)/);
|
|
1930
|
+
if (!n)
|
|
1931
|
+
return [];
|
|
1932
|
+
const o = yt(n[1]);
|
|
1933
|
+
if (!o.length)
|
|
1934
|
+
return [];
|
|
1935
|
+
let r = o[0];
|
|
1936
|
+
if ("__VITEST_FIXTURE_INDEX__" in e && (r = o[e.__VITEST_FIXTURE_INDEX__], !r))
|
|
1937
|
+
return [];
|
|
1938
|
+
if (!(r.startsWith("{") && r.endsWith("}")))
|
|
1939
|
+
throw new Error(`The first argument inside a fixture must use object destructuring pattern, e.g. ({ test } => {}). Instead, received "${r}".`);
|
|
1940
|
+
const s = r.slice(1, -1).replace(/\s/g, ""), i = yt(s).map((u) => u.replace(/:.*|=.*/g, "")), c = i.at(-1);
|
|
1941
|
+
if (c && c.startsWith("..."))
|
|
1942
|
+
throw new Error(`Rest parameters are not supported in fixtures, received "${c}".`);
|
|
1943
|
+
return i;
|
|
1944
|
+
}
|
|
1945
|
+
function yt(e) {
|
|
1946
|
+
const t = [], n = [];
|
|
1947
|
+
let o = 0;
|
|
1948
|
+
for (let s = 0; s < e.length; s++)
|
|
1949
|
+
if (e[s] === "{" || e[s] === "[")
|
|
1950
|
+
n.push(e[s] === "{" ? "}" : "]");
|
|
1951
|
+
else if (e[s] === n[n.length - 1])
|
|
1952
|
+
n.pop();
|
|
1953
|
+
else if (!n.length && e[s] === ",") {
|
|
1954
|
+
const i = e.substring(o, s).trim();
|
|
1955
|
+
i && t.push(i), o = s + 1;
|
|
1956
|
+
}
|
|
1957
|
+
const r = e.substring(o).trim();
|
|
1958
|
+
return r && t.push(r), t;
|
|
1959
|
+
}
|
|
1960
|
+
function rn(e, t) {
|
|
1961
|
+
function n(r) {
|
|
1962
|
+
const s = function(...i) {
|
|
1963
|
+
return t.apply(r, i);
|
|
1964
|
+
};
|
|
1965
|
+
Object.assign(s, t), s.withContext = () => s.bind(r), s.setContext = (i, c) => {
|
|
1966
|
+
r[i] = c;
|
|
1967
|
+
}, s.mergeContext = (i) => {
|
|
1968
|
+
Object.assign(r, i);
|
|
1969
|
+
};
|
|
1970
|
+
for (const i of e)
|
|
1971
|
+
Object.defineProperty(s, i, { get() {
|
|
1972
|
+
return n({
|
|
1973
|
+
...r,
|
|
1974
|
+
[i]: !0
|
|
1975
|
+
});
|
|
1976
|
+
} });
|
|
1977
|
+
return s;
|
|
1978
|
+
}
|
|
1979
|
+
const o = n({});
|
|
1980
|
+
return o.fn = t, o;
|
|
1981
|
+
}
|
|
1982
|
+
const q = ei(), Ko = Me(function(e, t, n) {
|
|
1983
|
+
ue().test.fn.call(this, F(e), t, n);
|
|
1984
|
+
}), Ti = q, $i = Ko;
|
|
1985
|
+
let v, on, Ho;
|
|
1986
|
+
function sn(e, t) {
|
|
1987
|
+
if (!e)
|
|
1988
|
+
throw new Error(`Vitest failed to find ${t}. This is a bug in Vitest. Please, open an issue with reproduction.`);
|
|
1989
|
+
}
|
|
1990
|
+
function Yo() {
|
|
1991
|
+
return Ho;
|
|
1992
|
+
}
|
|
1993
|
+
function Re() {
|
|
1994
|
+
return sn(v, "the runner"), v;
|
|
1995
|
+
}
|
|
1996
|
+
function ue() {
|
|
1997
|
+
const e = D.currentSuite || on;
|
|
1998
|
+
return sn(e, "the current suite"), e;
|
|
1999
|
+
}
|
|
2000
|
+
function Go() {
|
|
2001
|
+
return {
|
|
2002
|
+
beforeAll: [],
|
|
2003
|
+
afterAll: [],
|
|
2004
|
+
beforeEach: [],
|
|
2005
|
+
afterEach: []
|
|
2006
|
+
};
|
|
2007
|
+
}
|
|
2008
|
+
function W(e, t) {
|
|
2009
|
+
let n = {}, o = () => {
|
|
2010
|
+
};
|
|
2011
|
+
if (typeof t == "object") {
|
|
2012
|
+
if (typeof e == "object")
|
|
2013
|
+
throw new TypeError("Cannot use two objects as arguments. Please provide options and a function callback in that order.");
|
|
2014
|
+
console.warn("Using an object as a third argument is deprecated. Vitest 4 will throw an error if the third argument is not a timeout number. Please use the second argument for options. See more at https://vitest.dev/guide/migration"), n = t;
|
|
2015
|
+
} else typeof t == "number" ? n = { timeout: t } : typeof e == "object" && (n = e);
|
|
2016
|
+
if (typeof e == "function") {
|
|
2017
|
+
if (typeof t == "function")
|
|
2018
|
+
throw new TypeError("Cannot use two functions as arguments. Please use the second argument for options.");
|
|
2019
|
+
o = e;
|
|
2020
|
+
} else typeof t == "function" && (o = t);
|
|
2021
|
+
return {
|
|
2022
|
+
options: n,
|
|
2023
|
+
handler: o
|
|
2024
|
+
};
|
|
2025
|
+
}
|
|
2026
|
+
function Zo(e, t = () => {
|
|
2027
|
+
}, n, o, r, s) {
|
|
2028
|
+
const i = [];
|
|
2029
|
+
let c;
|
|
2030
|
+
g();
|
|
2031
|
+
const u = function(p = "", b = {}) {
|
|
2032
|
+
var $;
|
|
2033
|
+
const C = b?.timeout ?? v.config.testTimeout, T = {
|
|
2034
|
+
id: "",
|
|
2035
|
+
name: p,
|
|
2036
|
+
suite: ($ = D.currentSuite) === null || $ === void 0 ? void 0 : $.suite,
|
|
2037
|
+
each: b.each,
|
|
2038
|
+
fails: b.fails,
|
|
2039
|
+
context: void 0,
|
|
2040
|
+
type: "test",
|
|
2041
|
+
file: void 0,
|
|
2042
|
+
timeout: C,
|
|
2043
|
+
retry: b.retry ?? v.config.retry,
|
|
2044
|
+
repeats: b.repeats,
|
|
2045
|
+
mode: b.only ? "only" : b.skip ? "skip" : b.todo ? "todo" : "run",
|
|
2046
|
+
meta: b.meta ?? /* @__PURE__ */ Object.create(null),
|
|
2047
|
+
annotations: []
|
|
2048
|
+
}, J = b.handler;
|
|
2049
|
+
(b.concurrent || !b.sequential && v.config.sequence.concurrent) && (T.concurrent = !0), T.shuffle = r?.shuffle;
|
|
2050
|
+
const x = ui(T, v);
|
|
2051
|
+
Object.defineProperty(T, "context", {
|
|
2052
|
+
value: x,
|
|
2053
|
+
enumerable: !1
|
|
2054
|
+
}), Wo(x, b.fixtures);
|
|
2055
|
+
const X = Error.stackTraceLimit;
|
|
2056
|
+
Error.stackTraceLimit = 15;
|
|
2057
|
+
const Y = new Error("STACK_TRACE_ERROR");
|
|
2058
|
+
if (Error.stackTraceLimit = X, J && zo(T, le(Qo(en(v, J, x), T), C, !1, Y, (S, E) => cn([x], E))), v.config.includeTaskLocation) {
|
|
2059
|
+
const S = Y.stack, E = ni(S);
|
|
2060
|
+
E && (T.location = E);
|
|
2061
|
+
}
|
|
2062
|
+
return i.push(T), T;
|
|
2063
|
+
}, a = Me(function(p, b, $) {
|
|
2064
|
+
let { options: C, handler: T } = W(b, $);
|
|
2065
|
+
typeof r == "object" && (C = Object.assign({}, r, C)), C.concurrent = this.concurrent || !this.sequential && C?.concurrent, C.sequential = this.sequential || !this.concurrent && C?.sequential;
|
|
2066
|
+
const J = u(F(p), {
|
|
2067
|
+
...this,
|
|
2068
|
+
...C,
|
|
2069
|
+
handler: T
|
|
2070
|
+
});
|
|
2071
|
+
J.type = "test";
|
|
2072
|
+
});
|
|
2073
|
+
let l = s;
|
|
2074
|
+
const d = {
|
|
2075
|
+
type: "collector",
|
|
2076
|
+
name: e,
|
|
2077
|
+
mode: n,
|
|
2078
|
+
suite: c,
|
|
2079
|
+
options: r,
|
|
2080
|
+
test: a,
|
|
2081
|
+
tasks: i,
|
|
2082
|
+
collect: f,
|
|
2083
|
+
task: u,
|
|
2084
|
+
clear: y,
|
|
2085
|
+
on: h,
|
|
2086
|
+
fixtures() {
|
|
2087
|
+
return l;
|
|
2088
|
+
},
|
|
2089
|
+
scoped(p) {
|
|
2090
|
+
const b = Qt(p, { fixtures: l }, v);
|
|
2091
|
+
b.fixtures && (l = b.fixtures);
|
|
2092
|
+
}
|
|
2093
|
+
};
|
|
2094
|
+
function h(p, ...b) {
|
|
2095
|
+
Uo(c)[p].push(...b);
|
|
2096
|
+
}
|
|
2097
|
+
function g(p) {
|
|
2098
|
+
var b;
|
|
2099
|
+
typeof r == "number" && (r = { timeout: r }), c = {
|
|
2100
|
+
id: "",
|
|
2101
|
+
type: "suite",
|
|
2102
|
+
name: e,
|
|
2103
|
+
suite: (b = D.currentSuite) === null || b === void 0 ? void 0 : b.suite,
|
|
2104
|
+
mode: n,
|
|
2105
|
+
each: o,
|
|
2106
|
+
file: void 0,
|
|
2107
|
+
shuffle: r?.shuffle,
|
|
2108
|
+
tasks: [],
|
|
2109
|
+
meta: /* @__PURE__ */ Object.create(null),
|
|
2110
|
+
concurrent: r?.concurrent
|
|
2111
|
+
}, Xo(c, Go());
|
|
2112
|
+
}
|
|
2113
|
+
function y() {
|
|
2114
|
+
i.length = 0, g();
|
|
2115
|
+
}
|
|
2116
|
+
async function f(p) {
|
|
2117
|
+
if (!p)
|
|
2118
|
+
throw new TypeError("File is required to collect tasks.");
|
|
2119
|
+
t && await si(d, () => t(a));
|
|
2120
|
+
const b = [];
|
|
2121
|
+
for (const $ of i)
|
|
2122
|
+
b.push($.type === "collector" ? await $.collect(p) : $);
|
|
2123
|
+
return c.file = p, c.tasks = b, b.forEach(($) => {
|
|
2124
|
+
$.file = p;
|
|
2125
|
+
}), c;
|
|
2126
|
+
}
|
|
2127
|
+
return ii(d), d;
|
|
2128
|
+
}
|
|
2129
|
+
function Qo(e, t) {
|
|
2130
|
+
return async (...n) => {
|
|
2131
|
+
const o = await e(...n);
|
|
2132
|
+
if (t.promises) {
|
|
2133
|
+
const s = (await Promise.allSettled(t.promises)).map((i) => i.status === "rejected" ? i.reason : void 0).filter(Boolean);
|
|
2134
|
+
if (s.length)
|
|
2135
|
+
throw s;
|
|
2136
|
+
}
|
|
2137
|
+
return o;
|
|
2138
|
+
};
|
|
2139
|
+
}
|
|
2140
|
+
function ei() {
|
|
2141
|
+
function e(t, n, o) {
|
|
2142
|
+
var r;
|
|
2143
|
+
const s = this.only ? "only" : this.skip ? "skip" : this.todo ? "todo" : "run", i = D.currentSuite || on;
|
|
2144
|
+
let { options: c, handler: u } = W(n, o);
|
|
2145
|
+
const a = c.concurrent || this.concurrent || c.sequential === !1, l = c.sequential || this.sequential || c.concurrent === !1;
|
|
2146
|
+
c = {
|
|
2147
|
+
...i?.options,
|
|
2148
|
+
...c,
|
|
2149
|
+
shuffle: this.shuffle ?? c.shuffle ?? (i == null || (r = i.options) === null || r === void 0 ? void 0 : r.shuffle) ?? void 0
|
|
2150
|
+
};
|
|
2151
|
+
const d = a || c.concurrent && !l, h = l || c.sequential && !a;
|
|
2152
|
+
return c.concurrent = d && !h, c.sequential = h && !d, Zo(F(t), u, s, this.each, c, i?.fixtures());
|
|
2153
|
+
}
|
|
2154
|
+
return e.each = function(t, ...n) {
|
|
2155
|
+
const o = this.withContext();
|
|
2156
|
+
return this.setContext("each", !0), Array.isArray(t) && n.length && (t = ae(t, n)), (r, s, i) => {
|
|
2157
|
+
const c = F(r), u = t.every(Array.isArray), { options: a, handler: l } = W(s, i), d = typeof s == "function" && typeof i == "object";
|
|
2158
|
+
t.forEach((h, g) => {
|
|
2159
|
+
const y = Array.isArray(h) ? h : [h];
|
|
2160
|
+
d ? u ? o(R(c, y, g), () => l(...y), a) : o(R(c, y, g), () => l(h), a) : u ? o(R(c, y, g), a, () => l(...y)) : o(R(c, y, g), a, () => l(h));
|
|
2161
|
+
}), this.setContext("each", void 0);
|
|
2162
|
+
};
|
|
2163
|
+
}, e.for = function(t, ...n) {
|
|
2164
|
+
return Array.isArray(t) && n.length && (t = ae(t, n)), (o, r, s) => {
|
|
2165
|
+
const i = F(o), { options: c, handler: u } = W(r, s);
|
|
2166
|
+
t.forEach((a, l) => {
|
|
2167
|
+
q(R(i, Xt(a), l), c, () => u(a));
|
|
2168
|
+
});
|
|
2169
|
+
};
|
|
2170
|
+
}, e.skipIf = (t) => t ? q.skip : q, e.runIf = (t) => t ? q : q.skip, rn([
|
|
2171
|
+
"concurrent",
|
|
2172
|
+
"sequential",
|
|
2173
|
+
"shuffle",
|
|
2174
|
+
"skip",
|
|
2175
|
+
"only",
|
|
2176
|
+
"todo"
|
|
2177
|
+
], e);
|
|
2178
|
+
}
|
|
2179
|
+
function ti(e, t) {
|
|
2180
|
+
const n = e;
|
|
2181
|
+
n.each = function(r, ...s) {
|
|
2182
|
+
const i = this.withContext();
|
|
2183
|
+
return this.setContext("each", !0), Array.isArray(r) && s.length && (r = ae(r, s)), (c, u, a) => {
|
|
2184
|
+
const l = F(c), d = r.every(Array.isArray), { options: h, handler: g } = W(u, a), y = typeof u == "function" && typeof a == "object";
|
|
2185
|
+
r.forEach((f, p) => {
|
|
2186
|
+
const b = Array.isArray(f) ? f : [f];
|
|
2187
|
+
y ? d ? i(R(l, b, p), () => g(...b), h) : i(R(l, b, p), () => g(f), h) : d ? i(R(l, b, p), h, () => g(...b)) : i(R(l, b, p), h, () => g(f));
|
|
2188
|
+
}), this.setContext("each", void 0);
|
|
2189
|
+
};
|
|
2190
|
+
}, n.for = function(r, ...s) {
|
|
2191
|
+
const i = this.withContext();
|
|
2192
|
+
return Array.isArray(r) && s.length && (r = ae(r, s)), (c, u, a) => {
|
|
2193
|
+
const l = F(c), { options: d, handler: h } = W(u, a);
|
|
2194
|
+
r.forEach((g, y) => {
|
|
2195
|
+
const f = (p) => h(g, p);
|
|
2196
|
+
f.__VITEST_FIXTURE_INDEX__ = 1, f.toString = () => h.toString(), i(R(l, Xt(g), y), d, f);
|
|
2197
|
+
});
|
|
2198
|
+
};
|
|
2199
|
+
}, n.skipIf = function(r) {
|
|
2200
|
+
return r ? this.skip : this;
|
|
2201
|
+
}, n.runIf = function(r) {
|
|
2202
|
+
return r ? this : this.skip;
|
|
2203
|
+
}, n.scoped = function(r) {
|
|
2204
|
+
ue().scoped(r);
|
|
2205
|
+
}, n.extend = function(r) {
|
|
2206
|
+
const s = Qt(r, t || {}, v), i = e;
|
|
2207
|
+
return Me(function(c, u, a) {
|
|
2208
|
+
const d = ue().fixtures(), h = { ...this };
|
|
2209
|
+
d && (h.fixtures = qo(h.fixtures || [], d));
|
|
2210
|
+
const { handler: g, options: y } = W(u, a), f = y.timeout ?? void 0;
|
|
2211
|
+
i.call(h, F(c), g, f);
|
|
2212
|
+
}, s);
|
|
2213
|
+
};
|
|
2214
|
+
const o = rn([
|
|
2215
|
+
"concurrent",
|
|
2216
|
+
"sequential",
|
|
2217
|
+
"skip",
|
|
2218
|
+
"only",
|
|
2219
|
+
"todo",
|
|
2220
|
+
"fails"
|
|
2221
|
+
], n);
|
|
2222
|
+
return t && o.mergeContext(t), o;
|
|
2223
|
+
}
|
|
2224
|
+
function Me(e, t) {
|
|
2225
|
+
return ti(e, t);
|
|
2226
|
+
}
|
|
2227
|
+
function F(e) {
|
|
2228
|
+
return typeof e == "string" ? e : typeof e == "function" ? e.name || "<anonymous>" : String(e);
|
|
2229
|
+
}
|
|
2230
|
+
function R(e, t, n) {
|
|
2231
|
+
(e.includes("%#") || e.includes("%$")) && (e = e.replace(/%%/g, "__vitest_escaped_%__").replace(/%#/g, `${n}`).replace(/%\$/g, `${n + 1}`).replace(/__vitest_escaped_%__/g, "%%"));
|
|
2232
|
+
const o = e.split("%").length - 1;
|
|
2233
|
+
e.includes("%f") && (e.match(/%f/g) || []).forEach((c, u) => {
|
|
2234
|
+
if (So(t[u]) || Object.is(t[u], -0)) {
|
|
2235
|
+
let a = 0;
|
|
2236
|
+
e = e.replace(/%f/g, (l) => (a++, a === u + 1 ? "-%f" : l));
|
|
2237
|
+
}
|
|
2238
|
+
});
|
|
2239
|
+
let r = po(e, ...t.slice(0, o));
|
|
2240
|
+
const s = Ut(t[0]);
|
|
2241
|
+
return r = r.replace(/\$([$\w.]+)/g, (i, c) => {
|
|
2242
|
+
const u = /^\d+$/.test(c);
|
|
2243
|
+
if (!s && !u)
|
|
2244
|
+
return `$${c}`;
|
|
2245
|
+
const a = u ? ut(t, c) : void 0, l = s ? ut(t[0], c, a) : a;
|
|
2246
|
+
return mo(l, { truncate: void 0 });
|
|
2247
|
+
}), r;
|
|
2248
|
+
}
|
|
2249
|
+
function ae(e, t) {
|
|
2250
|
+
const n = e.join("").trim().replace(/ /g, "").split(`
|
|
2251
|
+
`).map((r) => r.split("|"))[0], o = [];
|
|
2252
|
+
for (let r = 0; r < Math.floor(t.length / n.length); r++) {
|
|
2253
|
+
const s = {};
|
|
2254
|
+
for (let i = 0; i < n.length; i++)
|
|
2255
|
+
s[n[i]] = t[r * n.length + i];
|
|
2256
|
+
o.push(s);
|
|
2257
|
+
}
|
|
2258
|
+
return o;
|
|
2259
|
+
}
|
|
2260
|
+
function ni(e) {
|
|
2261
|
+
const t = Yo(), n = e.split(`
|
|
2262
|
+
`).slice(1);
|
|
2263
|
+
for (const o of n) {
|
|
2264
|
+
const r = Yt(o);
|
|
2265
|
+
if (r && r.file === t)
|
|
2266
|
+
return {
|
|
2267
|
+
line: r.line,
|
|
2268
|
+
column: r.column
|
|
2269
|
+
};
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now;
|
|
2273
|
+
function _i(e) {
|
|
2274
|
+
const t = [e.name];
|
|
2275
|
+
let n = e;
|
|
2276
|
+
for (; n?.suite; )
|
|
2277
|
+
n = n.suite, n?.name && t.unshift(n.name);
|
|
2278
|
+
return n !== e.file && t.unshift(e.file.name), t;
|
|
2279
|
+
}
|
|
2280
|
+
globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now;
|
|
2281
|
+
const Te = /* @__PURE__ */ new Map(), gt = [], se = [];
|
|
2282
|
+
function ri(e) {
|
|
2283
|
+
if (Te.size) {
|
|
2284
|
+
var t;
|
|
2285
|
+
const n = Array.from(Te).map(([r, s]) => [
|
|
2286
|
+
r,
|
|
2287
|
+
s[0],
|
|
2288
|
+
s[1]
|
|
2289
|
+
]), o = (t = e.onTaskUpdate) === null || t === void 0 ? void 0 : t.call(e, n, gt);
|
|
2290
|
+
o && (se.push(o), o.then(() => se.splice(se.indexOf(o), 1), () => {
|
|
2291
|
+
})), gt.length = 0, Te.clear();
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
async function oi(e) {
|
|
2295
|
+
ri(e), await Promise.all(se);
|
|
2296
|
+
}
|
|
2297
|
+
const bt = Date.now, D = {
|
|
2298
|
+
currentSuite: null
|
|
2299
|
+
};
|
|
2300
|
+
function ii(e) {
|
|
2301
|
+
var t;
|
|
2302
|
+
(t = D.currentSuite) === null || t === void 0 || t.tasks.push(e);
|
|
2303
|
+
}
|
|
2304
|
+
async function si(e, t) {
|
|
2305
|
+
const n = D.currentSuite;
|
|
2306
|
+
D.currentSuite = e, await t(), D.currentSuite = n;
|
|
2307
|
+
}
|
|
2308
|
+
function le(e, t, n = !1, o, r) {
|
|
2309
|
+
if (t <= 0 || t === Number.POSITIVE_INFINITY)
|
|
2310
|
+
return e;
|
|
2311
|
+
const { setTimeout: s, clearTimeout: i } = Eo();
|
|
2312
|
+
return function(...u) {
|
|
2313
|
+
const a = bt(), l = Re();
|
|
2314
|
+
return l._currentTaskStartTime = a, l._currentTaskTimeout = t, new Promise((d, h) => {
|
|
2315
|
+
var g;
|
|
2316
|
+
const y = s(() => {
|
|
2317
|
+
i(y), f();
|
|
2318
|
+
}, t);
|
|
2319
|
+
(g = y.unref) === null || g === void 0 || g.call(y);
|
|
2320
|
+
function f() {
|
|
2321
|
+
const $ = ai(n, t, o);
|
|
2322
|
+
r?.(u, $), h($);
|
|
2323
|
+
}
|
|
2324
|
+
function p($) {
|
|
2325
|
+
if (l._currentTaskStartTime = void 0, l._currentTaskTimeout = void 0, i(y), bt() - a >= t) {
|
|
2326
|
+
f();
|
|
2327
|
+
return;
|
|
2328
|
+
}
|
|
2329
|
+
d($);
|
|
2330
|
+
}
|
|
2331
|
+
function b($) {
|
|
2332
|
+
l._currentTaskStartTime = void 0, l._currentTaskTimeout = void 0, i(y), h($);
|
|
2333
|
+
}
|
|
2334
|
+
try {
|
|
2335
|
+
const $ = e(...u);
|
|
2336
|
+
typeof $ == "object" && $ != null && typeof $.then == "function" ? $.then(p, b) : p($);
|
|
2337
|
+
} catch ($) {
|
|
2338
|
+
b($);
|
|
2339
|
+
}
|
|
2340
|
+
});
|
|
2341
|
+
};
|
|
2342
|
+
}
|
|
2343
|
+
const we = /* @__PURE__ */ new WeakMap();
|
|
2344
|
+
function cn([e], t) {
|
|
2345
|
+
e && ci(e, t);
|
|
2346
|
+
}
|
|
2347
|
+
function ci(e, t) {
|
|
2348
|
+
const n = we.get(e);
|
|
2349
|
+
n?.abort(t);
|
|
2350
|
+
}
|
|
2351
|
+
function ui(e, t) {
|
|
2352
|
+
var n;
|
|
2353
|
+
const o = function() {
|
|
2354
|
+
throw new Error("done() callback is deprecated, use promise instead");
|
|
2355
|
+
};
|
|
2356
|
+
let r = we.get(o);
|
|
2357
|
+
r || (r = new AbortController(), we.set(o, r)), o.signal = r.signal, o.task = e, o.skip = (i, c) => {
|
|
2358
|
+
if (i !== !1)
|
|
2359
|
+
throw e.result ?? (e.result = { state: "skip" }), e.result.pending = !0, new Do("test is skipped; abort execution", e, typeof i == "string" ? i : c);
|
|
2360
|
+
};
|
|
2361
|
+
async function s(i, c, u, a) {
|
|
2362
|
+
const l = {
|
|
2363
|
+
message: i,
|
|
2364
|
+
type: u || "notice"
|
|
2365
|
+
};
|
|
2366
|
+
if (a) {
|
|
2367
|
+
if (!a.body && !a.path)
|
|
2368
|
+
throw new TypeError("Test attachment requires body or path to be set. Both are missing.");
|
|
2369
|
+
if (a.body && a.path)
|
|
2370
|
+
throw new TypeError('Test attachment requires only one of "body" or "path" to be set. Both are specified.');
|
|
2371
|
+
l.attachment = a, a.body instanceof Uint8Array && (a.body = pi(a.body));
|
|
2372
|
+
}
|
|
2373
|
+
if (c && (l.location = c), !t.onTestAnnotate)
|
|
2374
|
+
throw new Error("Test runner doesn't support test annotations.");
|
|
2375
|
+
await oi(t);
|
|
2376
|
+
const d = await t.onTestAnnotate(e, l);
|
|
2377
|
+
return e.annotations.push(d), d;
|
|
2378
|
+
}
|
|
2379
|
+
return o.annotate = (i, c, u) => {
|
|
2380
|
+
if (e.result && e.result.state !== "run")
|
|
2381
|
+
throw new Error(`Cannot annotate tests outside of the test run. The test "${e.name}" finished running with the "${e.result.state}" state already.`);
|
|
2382
|
+
let a;
|
|
2383
|
+
const l = new Error("STACK_TRACE").stack, d = l.includes("STACK_TRACE") ? 2 : 1, h = l.split(`
|
|
2384
|
+
`)[d], g = Yt(h);
|
|
2385
|
+
return g && (a = {
|
|
2386
|
+
file: g.file,
|
|
2387
|
+
line: g.line,
|
|
2388
|
+
column: g.column
|
|
2389
|
+
}), typeof c == "object" ? St(e, s(i, a, void 0, c)) : St(e, s(i, a, c, u));
|
|
2390
|
+
}, o.onTestFailed = (i, c) => {
|
|
2391
|
+
e.onFailed || (e.onFailed = []), e.onFailed.push(le(i, c ?? t.config.hookTimeout, !0, new Error("STACK_TRACE_ERROR"), (u, a) => r.abort(a)));
|
|
2392
|
+
}, o.onTestFinished = (i, c) => {
|
|
2393
|
+
e.onFinished || (e.onFinished = []), e.onFinished.push(le(i, c ?? t.config.hookTimeout, !0, new Error("STACK_TRACE_ERROR"), (u, a) => r.abort(a)));
|
|
2394
|
+
}, ((n = t.extendTaskContext) === null || n === void 0 ? void 0 : n.call(t, o)) || o;
|
|
2395
|
+
}
|
|
2396
|
+
function ai(e, t, n) {
|
|
2397
|
+
const o = `${e ? "Hook" : "Test"} timed out in ${t}ms.
|
|
2398
|
+
If this is a long-running ${e ? "hook" : "test"}, pass a timeout value as the last argument or configure it globally with "${e ? "hookTimeout" : "testTimeout"}".`, r = new Error(o);
|
|
2399
|
+
return n?.stack && (r.stack = n.stack.replace(r.message, n.message)), r;
|
|
2400
|
+
}
|
|
2401
|
+
const li = /* @__PURE__ */ new WeakMap();
|
|
2402
|
+
function fi(e) {
|
|
2403
|
+
const t = li.get(e);
|
|
2404
|
+
if (!t)
|
|
2405
|
+
throw new Error(`Cannot find file context for ${e.name}`);
|
|
2406
|
+
return t;
|
|
2407
|
+
}
|
|
2408
|
+
const O = [];
|
|
2409
|
+
for (let e = 65; e < 91; e++)
|
|
2410
|
+
O.push(String.fromCharCode(e));
|
|
2411
|
+
for (let e = 97; e < 123; e++)
|
|
2412
|
+
O.push(String.fromCharCode(e));
|
|
2413
|
+
for (let e = 0; e < 10; e++)
|
|
2414
|
+
O.push(e.toString(10));
|
|
2415
|
+
function pi(e) {
|
|
2416
|
+
let t = "";
|
|
2417
|
+
const n = e.byteLength;
|
|
2418
|
+
for (let o = 0; o < n; o += 3)
|
|
2419
|
+
if (n === o + 1) {
|
|
2420
|
+
const r = (e[o] & 252) >> 2, s = (e[o] & 3) << 4;
|
|
2421
|
+
t += O[r], t += O[s], t += "==";
|
|
2422
|
+
} else if (n === o + 2) {
|
|
2423
|
+
const r = (e[o] & 252) >> 2, s = (e[o] & 3) << 4 | (e[o + 1] & 240) >> 4, i = (e[o + 1] & 15) << 2;
|
|
2424
|
+
t += O[r], t += O[s], t += O[i], t += "=";
|
|
2425
|
+
} else {
|
|
2426
|
+
const r = (e[o] & 252) >> 2, s = (e[o] & 3) << 4 | (e[o + 1] & 240) >> 4, i = (e[o + 1] & 15) << 2 | (e[o + 2] & 192) >> 6, c = e[o + 2] & 63;
|
|
2427
|
+
t += O[r], t += O[s], t += O[i], t += O[c];
|
|
2428
|
+
}
|
|
2429
|
+
return t;
|
|
2430
|
+
}
|
|
2431
|
+
function St(e, t) {
|
|
2432
|
+
return t = t.finally(() => {
|
|
2433
|
+
if (!e.promises)
|
|
2434
|
+
return;
|
|
2435
|
+
const n = e.promises.indexOf(t);
|
|
2436
|
+
n !== -1 && e.promises.splice(n, 1);
|
|
2437
|
+
}), e.promises || (e.promises = []), e.promises.push(t), t;
|
|
2438
|
+
}
|
|
2439
|
+
function Et() {
|
|
2440
|
+
return Re().config.hookTimeout;
|
|
2441
|
+
}
|
|
2442
|
+
const di = Symbol.for("VITEST_CLEANUP_TIMEOUT"), mi = Symbol.for("VITEST_CLEANUP_STACK_TRACE");
|
|
2443
|
+
function Ii(e, t = Et()) {
|
|
2444
|
+
ho(e, '"beforeEach" callback', ["function"]);
|
|
2445
|
+
const n = new Error("STACK_TRACE_ERROR"), o = Re();
|
|
2446
|
+
return ue().on("beforeEach", Object.assign(le(en(o, e), t ?? Et(), !0, n, cn), {
|
|
2447
|
+
[di]: t,
|
|
2448
|
+
[mi]: n
|
|
2449
|
+
}));
|
|
2450
|
+
}
|
|
2451
|
+
export {
|
|
2452
|
+
bo as a,
|
|
2453
|
+
bi as b,
|
|
2454
|
+
po as c,
|
|
2455
|
+
Si as d,
|
|
2456
|
+
Ut as e,
|
|
2457
|
+
Ye as f,
|
|
2458
|
+
yi as g,
|
|
2459
|
+
ho as h,
|
|
2460
|
+
$i as i,
|
|
2461
|
+
Eo as j,
|
|
2462
|
+
gi as k,
|
|
2463
|
+
Yt as l,
|
|
2464
|
+
_i as m,
|
|
2465
|
+
Ei as n,
|
|
2466
|
+
Ti as o,
|
|
2467
|
+
Or as p,
|
|
2468
|
+
Ii as q,
|
|
2469
|
+
lo as s,
|
|
2470
|
+
mn as u
|
|
2471
|
+
};
|