storybook 10.1.0-alpha.10 → 10.1.0-alpha.11
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/_browser-chunks/Color-FTG7SQDA.js +1097 -0
- package/dist/_browser-chunks/WithTooltip-LMROHDUP.js +1651 -0
- package/dist/_browser-chunks/chunk-2FRVAXCZ.js +7 -0
- package/dist/_browser-chunks/chunk-3IAH5M2U.js +171 -0
- package/dist/_browser-chunks/chunk-3OXGAGBE.js +779 -0
- package/dist/_browser-chunks/{chunk-TMDZCWME.js → chunk-3PJE6VLG.js} +1 -3
- package/dist/_browser-chunks/{chunk-VAMFPZY3.js → chunk-45UGUKRX.js} +2 -7
- package/dist/_browser-chunks/chunk-6XWLIJQL.js +11 -0
- package/dist/_browser-chunks/{chunk-FDWKXLBI.js → chunk-74YHFU5B.js} +44 -109
- package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
- package/dist/_browser-chunks/chunk-AIOS4NGK.js +252 -0
- package/dist/_browser-chunks/chunk-AS2HQEYC.js +14 -0
- package/dist/_browser-chunks/chunk-AXG2BOBL.js +836 -0
- package/dist/_browser-chunks/chunk-BE2DAXKJ.js +2966 -0
- package/dist/_browser-chunks/{chunk-MH6AXFXB.js → chunk-CHUV5WSW.js} +0 -5
- package/dist/_browser-chunks/chunk-EBHB6RPS.js +61 -0
- package/dist/_browser-chunks/chunk-EUVGDK4H.js +93 -0
- package/dist/_browser-chunks/chunk-EZSQOHRI.js +18 -0
- package/dist/_browser-chunks/{chunk-CADGRH3P.js → chunk-FNXWN6IK.js} +3 -8
- package/dist/_browser-chunks/chunk-GFLS4VP3.js +64 -0
- package/dist/_browser-chunks/{chunk-L2D73C6Z.js → chunk-H6XK3RSC.js} +13 -21
- package/dist/_browser-chunks/chunk-IPA5A322.js +71 -0
- package/dist/_browser-chunks/chunk-JP7NCOJX.js +37 -0
- package/dist/_browser-chunks/chunk-KJHJLCBK.js +11 -0
- package/dist/_browser-chunks/{chunk-QMY4G4R2.js → chunk-L4RMQ7D7.js} +17 -64
- package/dist/_browser-chunks/{chunk-AB7OOPUX.js → chunk-QKODTO7K.js} +0 -5
- package/dist/_browser-chunks/chunk-RP5RXKFU.js +2491 -0
- package/dist/_browser-chunks/chunk-SL75JR6Y.js +9 -0
- package/dist/_browser-chunks/chunk-UD6FQLAF.js +1481 -0
- package/dist/_browser-chunks/chunk-VYJQ7RU5.js +2853 -0
- package/dist/_browser-chunks/chunk-WJYERY3R.js +136 -0
- package/dist/_browser-chunks/chunk-WXP2XJ3O.js +950 -0
- package/dist/_browser-chunks/chunk-X3DUQ5RA.js +47 -0
- package/dist/_browser-chunks/chunk-XJNX76GA.js +85 -0
- package/dist/_browser-chunks/{chunk-F4Q6SGTB.js → chunk-YKE5S47A.js} +177 -399
- package/dist/_browser-chunks/{chunk-SN4J4IQ3.js → chunk-ZUWEVLDX.js} +1 -7
- package/dist/_browser-chunks/{formatter-OMEEQ6HG.js → formatter-QJ4M4OGQ.js} +4 -9
- package/dist/_browser-chunks/{syntaxhighlighter-RJZASWHL.js → syntaxhighlighter-WKBQ5RC7.js} +704 -1848
- package/dist/_node-chunks/{builder-manager-HA7CYFCK.js → builder-manager-PMPHOSM2.js} +475 -1013
- package/dist/_node-chunks/camelcase-K3IOOFQW.js +18 -0
- package/dist/_node-chunks/{chunk-X4XU27M6.js → chunk-32NE3UE3.js} +15 -24
- package/dist/_node-chunks/chunk-4GZCFQFG.js +58 -0
- package/dist/_node-chunks/chunk-5QK5MSOI.js +943 -0
- package/dist/_node-chunks/{chunk-VPR5IBMG.js → chunk-6ZOLETQK.js} +8 -10
- package/dist/_node-chunks/chunk-7I22Y76Z.js +1047 -0
- package/dist/_node-chunks/chunk-AKTRSR3O.js +72 -0
- package/dist/_node-chunks/chunk-BBOP3XCK.js +119 -0
- package/dist/_node-chunks/chunk-C2GQVDWI.js +34 -0
- package/dist/_node-chunks/{chunk-ZHSCUGNP.js → chunk-GG2WQZSG.js} +3799 -7849
- package/dist/_node-chunks/chunk-GQJOWVVR.js +3214 -0
- package/dist/_node-chunks/chunk-JCRM2YVK.js +3009 -0
- package/dist/_node-chunks/chunk-KK4AT5F3.js +1029 -0
- package/dist/_node-chunks/chunk-L7MYXJUM.js +1114 -0
- package/dist/_node-chunks/{chunk-F3XOPI6H.js → chunk-LCZO45L7.js} +469 -983
- package/dist/_node-chunks/chunk-LR3QITDI.js +209 -0
- package/dist/_node-chunks/chunk-LXG4DK35.js +3171 -0
- package/dist/_node-chunks/chunk-MJ3WOS6F.js +37 -0
- package/dist/_node-chunks/chunk-PHOZWZZO.js +61 -0
- package/dist/_node-chunks/chunk-QECOQWRJ.js +936 -0
- package/dist/_node-chunks/chunk-QH4V5YDB.js +20 -0
- package/dist/_node-chunks/chunk-R6HWGZWD.js +26 -0
- package/dist/_node-chunks/chunk-SPQXMU2Q.js +759 -0
- package/dist/_node-chunks/chunk-TXZY6V6O.js +1564 -0
- package/dist/_node-chunks/chunk-UGDPX5LE.js +756 -0
- package/dist/_node-chunks/chunk-UY26MQLT.js +603 -0
- package/dist/_node-chunks/chunk-WK3EMYK6.js +61 -0
- package/dist/_node-chunks/{chunk-OVXB5GGT.js → chunk-WLHMN7AP.js} +292 -688
- package/dist/_node-chunks/chunk-XGVLB4UJ.js +54 -0
- package/dist/_node-chunks/{chunk-RMHAL25C.js → chunk-YHRFI6BE.js} +87 -227
- package/dist/_node-chunks/chunk-YK4KVMFW.js +18 -0
- package/dist/_node-chunks/chunk-ZZALGOA6.js +4523 -0
- package/dist/_node-chunks/chunk-ZZPBSYA5.js +301 -0
- package/dist/_node-chunks/chunk-ZZSRFAC6.js +45571 -0
- package/dist/_node-chunks/dist-4DWOCZUD.js +121 -0
- package/dist/_node-chunks/globby-AAARUKEU.js +3452 -0
- package/dist/_node-chunks/lib-HEUKGL62.js +366 -0
- package/dist/_node-chunks/mdx-N42X6CFJ-DCVRPS6N.js +14329 -0
- package/dist/_node-chunks/p-limit-F5ZKJ6WZ.js +116 -0
- package/dist/_node-chunks/plugin-7YY7JXCH.js +123 -0
- package/dist/_node-chunks/{plugin-6ZPCS4LI.js → plugin-SZP3CW6W.js} +36 -56
- package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-TGKNDPO6.js +46623 -0
- package/dist/_node-chunks/webpack-mock-plugin-LNTZZFBE.js +92 -0
- package/dist/actions/decorator.js +21 -42
- package/dist/actions/index.js +3 -3
- package/dist/babel/index.d.ts +671 -335
- package/dist/babel/index.js +11 -11
- package/dist/bin/core.js +592 -1546
- package/dist/bin/dispatcher.js +26 -37
- package/dist/bin/loader.js +23 -34
- package/dist/channels/index.js +98 -234
- package/dist/cli/index.js +1951 -5308
- package/dist/client-logger/index.js +31 -61
- package/dist/common/index.js +20 -20
- package/dist/components/index.js +4211 -8586
- package/dist/core-events/index.js +2 -66
- package/dist/core-server/index.js +3054 -7290
- package/dist/core-server/presets/common-manager.css +2 -2
- package/dist/core-server/presets/common-manager.js +1806 -3427
- package/dist/core-server/presets/common-override-preset.js +31 -60
- package/dist/core-server/presets/common-preset.js +434 -924
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +15 -19
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +12 -17
- package/dist/csf/index.js +534 -1179
- package/dist/csf-tools/index.js +9 -9
- package/dist/docs-tools/index.js +6 -6
- package/dist/highlight/index.js +2 -2
- package/dist/instrumenter/index.js +199 -415
- package/dist/manager/globals-runtime.js +24150 -47364
- package/dist/manager/globals.js +2 -3
- package/dist/manager/runtime.js +3961 -8373
- package/dist/manager-api/index.js +1231 -2425
- package/dist/manager-errors.d.ts +3 -0
- package/dist/manager-errors.js +3 -3
- package/dist/node-logger/index.js +1253 -2601
- package/dist/preview/globals.js +2 -3
- package/dist/preview/runtime.js +10364 -21990
- package/dist/preview-api/index.d.ts +67 -68
- package/dist/preview-api/index.js +13 -13
- package/dist/preview-errors.d.ts +3 -0
- package/dist/preview-errors.js +4 -4
- package/dist/router/index.js +347 -899
- package/dist/server-errors.d.ts +3 -0
- package/dist/server-errors.js +10 -10
- package/dist/telemetry/index.js +24 -24
- package/dist/test/index.js +5860 -11645
- package/dist/theming/create.js +4 -4
- package/dist/theming/index.d.ts +3363 -2597
- package/dist/theming/index.js +490 -1086
- package/dist/types/index.js +2 -11
- package/dist/viewport/index.js +3 -3
- package/package.json +5 -5
- package/dist/_browser-chunks/Color-FQNEU7YS.js +0 -1695
- package/dist/_browser-chunks/WithTooltip-6NHN2GXF.js +0 -2343
- package/dist/_browser-chunks/chunk-6A7OIVEL.js +0 -66
- package/dist/_browser-chunks/chunk-AW46NMGV.js +0 -1308
- package/dist/_browser-chunks/chunk-B4A3ADP3.js +0 -3816
- package/dist/_browser-chunks/chunk-FSBVR7H5.js +0 -106
- package/dist/_browser-chunks/chunk-FUOHXXZT.js +0 -23
- package/dist/_browser-chunks/chunk-GTKOCWCT.js +0 -17
- package/dist/_browser-chunks/chunk-HHW4FUMO.js +0 -12
- package/dist/_browser-chunks/chunk-JVSKG4YS.js +0 -4052
- package/dist/_browser-chunks/chunk-LASUB7TL.js +0 -76
- package/dist/_browser-chunks/chunk-LYCSRYYR.js +0 -101
- package/dist/_browser-chunks/chunk-NVV6MIOE.js +0 -243
- package/dist/_browser-chunks/chunk-OBXWFEPB.js +0 -852
- package/dist/_browser-chunks/chunk-OPCDBBL3.js +0 -48
- package/dist/_browser-chunks/chunk-PB6FZ3WE.js +0 -130
- package/dist/_browser-chunks/chunk-RW5PKMWM.js +0 -4182
- package/dist/_browser-chunks/chunk-SYS437NN.js +0 -122
- package/dist/_browser-chunks/chunk-U46RQHA4.js +0 -12
- package/dist/_browser-chunks/chunk-UTNZYD2N.js +0 -311
- package/dist/_browser-chunks/chunk-VUAFL5XK.js +0 -20
- package/dist/_browser-chunks/chunk-XDGMHOV7.js +0 -2197
- package/dist/_browser-chunks/chunk-XW6KSYKF.js +0 -16
- package/dist/_browser-chunks/chunk-Y3M7TW6K.js +0 -1041
- package/dist/_browser-chunks/chunk-ZNRFDIVA.js +0 -233
- package/dist/_node-chunks/camelcase-QALD4XFE.js +0 -18
- package/dist/_node-chunks/chunk-2XY53ALL.js +0 -420
- package/dist/_node-chunks/chunk-3CBQMG2A.js +0 -6712
- package/dist/_node-chunks/chunk-3WDAPZYQ.js +0 -28
- package/dist/_node-chunks/chunk-4ZB555EJ.js +0 -697
- package/dist/_node-chunks/chunk-52DXKXY3.js +0 -4272
- package/dist/_node-chunks/chunk-5OVB4A6F.js +0 -69
- package/dist/_node-chunks/chunk-AGHGNXGH.js +0 -18
- package/dist/_node-chunks/chunk-B23X5ZCK.js +0 -1531
- package/dist/_node-chunks/chunk-B2DAHWJK.js +0 -220
- package/dist/_node-chunks/chunk-CC4PW5MJ.js +0 -34
- package/dist/_node-chunks/chunk-D7NIZELR.js +0 -2256
- package/dist/_node-chunks/chunk-DO5Q3H4L.js +0 -1250
- package/dist/_node-chunks/chunk-ECK7WVFX.js +0 -304
- package/dist/_node-chunks/chunk-EUH3NHXA.js +0 -79
- package/dist/_node-chunks/chunk-FOQHPHCV.js +0 -1657
- package/dist/_node-chunks/chunk-G6EL47NS.js +0 -111
- package/dist/_node-chunks/chunk-GFLS4TJB.js +0 -90
- package/dist/_node-chunks/chunk-J3XZKWHE.js +0 -1586
- package/dist/_node-chunks/chunk-LE63EHJ5.js +0 -1518
- package/dist/_node-chunks/chunk-M47XA42S.js +0 -4741
- package/dist/_node-chunks/chunk-OOI74AL3.js +0 -61
- package/dist/_node-chunks/chunk-PRJHT3GJ.js +0 -61
- package/dist/_node-chunks/chunk-Q52PVUSU.js +0 -101
- package/dist/_node-chunks/chunk-SDCF5RNN.js +0 -1198
- package/dist/_node-chunks/chunk-UJ5SJ23M.js +0 -5029
- package/dist/_node-chunks/chunk-UPHK4ETU.js +0 -64658
- package/dist/_node-chunks/chunk-V7VURIPB.js +0 -1544
- package/dist/_node-chunks/dist-6TXHNR5C.js +0 -175
- package/dist/_node-chunks/globby-PBTV6PX6.js +0 -5222
- package/dist/_node-chunks/lib-4RTDZVGX.js +0 -518
- package/dist/_node-chunks/mdx-N42X6CFJ-COWEH7KR.js +0 -22017
- package/dist/_node-chunks/p-limit-PBVZQOFY.js +0 -168
- package/dist/_node-chunks/plugin-EOZKYZAG.js +0 -159
- package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-35HMSMR5.js +0 -69102
- package/dist/_node-chunks/webpack-mock-plugin-GT3MA5E2.js +0 -124
|
@@ -0,0 +1,2491 @@
|
|
|
1
|
+
// ../node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js
|
|
2
|
+
var f = {
|
|
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
|
+
}, h = Object.entries(f);
|
|
45
|
+
function a(n) {
|
|
46
|
+
return String(n);
|
|
47
|
+
}
|
|
48
|
+
a.open = "";
|
|
49
|
+
a.close = "";
|
|
50
|
+
var B = h.reduce(
|
|
51
|
+
(n, [e]) => (n[e] = a, n),
|
|
52
|
+
{ isColorSupported: !1 }
|
|
53
|
+
);
|
|
54
|
+
function C(n = !1) {
|
|
55
|
+
let e = typeof process < "u" ? process : void 0, i = e?.env || {}, g = e?.argv || [];
|
|
56
|
+
return !("NO_COLOR" in i || g.includes("--no-color")) && ("FORCE_COLOR" in i || g.includes("--color") || e?.platform === "win32" || n && i.TERM !== "dumb" || "CI" in i) || typeof window < "u" && !!window.chrome;
|
|
57
|
+
}
|
|
58
|
+
function p(n = !1) {
|
|
59
|
+
let e = C(n), i = (r, t, c, o) => {
|
|
60
|
+
let l = "", s2 = 0;
|
|
61
|
+
do
|
|
62
|
+
l += r.substring(s2, o) + c, s2 = o + t.length, o = r.indexOf(t, s2);
|
|
63
|
+
while (~o);
|
|
64
|
+
return l + r.substring(s2);
|
|
65
|
+
}, g = (r, t, c = r) => {
|
|
66
|
+
let o = (l) => {
|
|
67
|
+
let s2 = String(l), b = s2.indexOf(t, r.length);
|
|
68
|
+
return ~b ? r + i(s2, t, c, b) + t : r + s2 + t;
|
|
69
|
+
};
|
|
70
|
+
return o.open = r, o.close = t, o;
|
|
71
|
+
}, u = {
|
|
72
|
+
isColorSupported: e
|
|
73
|
+
}, d = (r) => `\x1B[${r}m`;
|
|
74
|
+
for (let [r, t] of h)
|
|
75
|
+
u[r] = e ? g(
|
|
76
|
+
d(t[0]),
|
|
77
|
+
d(t[1]),
|
|
78
|
+
t[2]
|
|
79
|
+
) : a;
|
|
80
|
+
return u;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// ../node_modules/tinyrainbow/dist/browser.js
|
|
84
|
+
var s = p();
|
|
85
|
+
|
|
86
|
+
// ../node_modules/@vitest/pretty-format/dist/index.js
|
|
87
|
+
function _mergeNamespaces(n, m2) {
|
|
88
|
+
return m2.forEach(function(e) {
|
|
89
|
+
e && typeof e != "string" && !Array.isArray(e) && Object.keys(e).forEach(function(k) {
|
|
90
|
+
if (k !== "default" && !(k in n)) {
|
|
91
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
92
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
93
|
+
enumerable: !0,
|
|
94
|
+
get: function() {
|
|
95
|
+
return e[k];
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}), Object.freeze(n);
|
|
101
|
+
}
|
|
102
|
+
function getKeysOfEnumerableProperties(object, compareKeys) {
|
|
103
|
+
let rawKeys = Object.keys(object), keys = compareKeys === null ? rawKeys : rawKeys.sort(compareKeys);
|
|
104
|
+
if (Object.getOwnPropertySymbols)
|
|
105
|
+
for (let symbol of Object.getOwnPropertySymbols(object))
|
|
106
|
+
Object.getOwnPropertyDescriptor(object, symbol).enumerable && keys.push(symbol);
|
|
107
|
+
return keys;
|
|
108
|
+
}
|
|
109
|
+
function printIteratorEntries(iterator, config, indentation, depth, refs, printer2, separator = ": ") {
|
|
110
|
+
let result = "", width = 0, current = iterator.next();
|
|
111
|
+
if (!current.done) {
|
|
112
|
+
result += config.spacingOuter;
|
|
113
|
+
let indentationNext = indentation + config.indent;
|
|
114
|
+
for (; !current.done; ) {
|
|
115
|
+
if (result += indentationNext, width++ === config.maxWidth) {
|
|
116
|
+
result += "\u2026";
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
let name = printer2(current.value[0], config, indentationNext, depth, refs), value = printer2(current.value[1], config, indentationNext, depth, refs);
|
|
120
|
+
result += name + separator + value, current = iterator.next(), current.done ? config.min || (result += ",") : result += `,${config.spacingInner}`;
|
|
121
|
+
}
|
|
122
|
+
result += config.spacingOuter + indentation;
|
|
123
|
+
}
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
function printIteratorValues(iterator, config, indentation, depth, refs, printer2) {
|
|
127
|
+
let result = "", width = 0, current = iterator.next();
|
|
128
|
+
if (!current.done) {
|
|
129
|
+
result += config.spacingOuter;
|
|
130
|
+
let indentationNext = indentation + config.indent;
|
|
131
|
+
for (; !current.done; ) {
|
|
132
|
+
if (result += indentationNext, width++ === config.maxWidth) {
|
|
133
|
+
result += "\u2026";
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
result += printer2(current.value, config, indentationNext, depth, refs), current = iterator.next(), current.done ? config.min || (result += ",") : result += `,${config.spacingInner}`;
|
|
137
|
+
}
|
|
138
|
+
result += config.spacingOuter + indentation;
|
|
139
|
+
}
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
142
|
+
function printListItems(list, config, indentation, depth, refs, printer2) {
|
|
143
|
+
let result = "";
|
|
144
|
+
list = list instanceof ArrayBuffer ? new DataView(list) : list;
|
|
145
|
+
let isDataView = (l) => l instanceof DataView, length = isDataView(list) ? list.byteLength : list.length;
|
|
146
|
+
if (length > 0) {
|
|
147
|
+
result += config.spacingOuter;
|
|
148
|
+
let indentationNext = indentation + config.indent;
|
|
149
|
+
for (let i = 0; i < length; i++) {
|
|
150
|
+
if (result += indentationNext, i === config.maxWidth) {
|
|
151
|
+
result += "\u2026";
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
(isDataView(list) || i in list) && (result += printer2(isDataView(list) ? list.getInt8(i) : list[i], config, indentationNext, depth, refs)), i < length - 1 ? result += `,${config.spacingInner}` : config.min || (result += ",");
|
|
155
|
+
}
|
|
156
|
+
result += config.spacingOuter + indentation;
|
|
157
|
+
}
|
|
158
|
+
return result;
|
|
159
|
+
}
|
|
160
|
+
function printObjectProperties(val, config, indentation, depth, refs, printer2) {
|
|
161
|
+
let result = "", keys = getKeysOfEnumerableProperties(val, config.compareKeys);
|
|
162
|
+
if (keys.length > 0) {
|
|
163
|
+
result += config.spacingOuter;
|
|
164
|
+
let indentationNext = indentation + config.indent;
|
|
165
|
+
for (let i = 0; i < keys.length; i++) {
|
|
166
|
+
let key = keys[i], name = printer2(key, config, indentationNext, depth, refs), value = printer2(val[key], config, indentationNext, depth, refs);
|
|
167
|
+
result += `${indentationNext + name}: ${value}`, i < keys.length - 1 ? result += `,${config.spacingInner}` : config.min || (result += ",");
|
|
168
|
+
}
|
|
169
|
+
result += config.spacingOuter + indentation;
|
|
170
|
+
}
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
173
|
+
var asymmetricMatcher = typeof Symbol == "function" && Symbol.for ? Symbol.for("jest.asymmetricMatcher") : 1267621, SPACE$2 = " ", serialize$5 = (val, config, indentation, depth, refs, printer2) => {
|
|
174
|
+
let stringedValue = val.toString();
|
|
175
|
+
if (stringedValue === "ArrayContaining" || stringedValue === "ArrayNotContaining")
|
|
176
|
+
return ++depth > config.maxDepth ? `[${stringedValue}]` : `${stringedValue + SPACE$2}[${printListItems(val.sample, config, indentation, depth, refs, printer2)}]`;
|
|
177
|
+
if (stringedValue === "ObjectContaining" || stringedValue === "ObjectNotContaining")
|
|
178
|
+
return ++depth > config.maxDepth ? `[${stringedValue}]` : `${stringedValue + SPACE$2}{${printObjectProperties(val.sample, config, indentation, depth, refs, printer2)}}`;
|
|
179
|
+
if (stringedValue === "StringMatching" || stringedValue === "StringNotMatching" || stringedValue === "StringContaining" || stringedValue === "StringNotContaining")
|
|
180
|
+
return stringedValue + SPACE$2 + printer2(val.sample, config, indentation, depth, refs);
|
|
181
|
+
if (typeof val.toAsymmetricMatcher != "function")
|
|
182
|
+
throw new TypeError(`Asymmetric matcher ${val.constructor.name} does not implement toAsymmetricMatcher()`);
|
|
183
|
+
return val.toAsymmetricMatcher();
|
|
184
|
+
}, test$5 = (val) => val && val.$$typeof === asymmetricMatcher, plugin$5 = {
|
|
185
|
+
serialize: serialize$5,
|
|
186
|
+
test: test$5
|
|
187
|
+
}, SPACE$1 = " ", OBJECT_NAMES = /* @__PURE__ */ new Set(["DOMStringMap", "NamedNodeMap"]), ARRAY_REGEXP = /^(?:HTML\w*Collection|NodeList)$/;
|
|
188
|
+
function testName(name) {
|
|
189
|
+
return OBJECT_NAMES.has(name) || ARRAY_REGEXP.test(name);
|
|
190
|
+
}
|
|
191
|
+
var test$4 = (val) => val && val.constructor && !!val.constructor.name && testName(val.constructor.name);
|
|
192
|
+
function isNamedNodeMap(collection) {
|
|
193
|
+
return collection.constructor.name === "NamedNodeMap";
|
|
194
|
+
}
|
|
195
|
+
var serialize$4 = (collection, config, indentation, depth, refs, printer2) => {
|
|
196
|
+
let name = collection.constructor.name;
|
|
197
|
+
return ++depth > config.maxDepth ? `[${name}]` : (config.min ? "" : name + SPACE$1) + (OBJECT_NAMES.has(name) ? `{${printObjectProperties(isNamedNodeMap(collection) ? [...collection].reduce((props, attribute) => (props[attribute.name] = attribute.value, props), {}) : { ...collection }, config, indentation, depth, refs, printer2)}}` : `[${printListItems([...collection], config, indentation, depth, refs, printer2)}]`);
|
|
198
|
+
}, plugin$4 = {
|
|
199
|
+
serialize: serialize$4,
|
|
200
|
+
test: test$4
|
|
201
|
+
};
|
|
202
|
+
function escapeHTML(str) {
|
|
203
|
+
return str.replaceAll("<", "<").replaceAll(">", ">");
|
|
204
|
+
}
|
|
205
|
+
function printProps(keys, props, config, indentation, depth, refs, printer2) {
|
|
206
|
+
let indentationNext = indentation + config.indent, colors = config.colors;
|
|
207
|
+
return keys.map((key) => {
|
|
208
|
+
let value = props[key], printed = printer2(value, config, indentationNext, depth, refs);
|
|
209
|
+
return typeof value != "string" && (printed.includes(`
|
|
210
|
+
`) && (printed = config.spacingOuter + indentationNext + printed + config.spacingOuter + indentation), printed = `{${printed}}`), `${config.spacingInner + indentation + colors.prop.open + key + colors.prop.close}=${colors.value.open}${printed}${colors.value.close}`;
|
|
211
|
+
}).join("");
|
|
212
|
+
}
|
|
213
|
+
function printChildren(children, config, indentation, depth, refs, printer2) {
|
|
214
|
+
return children.map((child) => config.spacingOuter + indentation + (typeof child == "string" ? printText(child, config) : printer2(child, config, indentation, depth, refs))).join("");
|
|
215
|
+
}
|
|
216
|
+
function printText(text, config) {
|
|
217
|
+
let contentColor = config.colors.content;
|
|
218
|
+
return contentColor.open + escapeHTML(text) + contentColor.close;
|
|
219
|
+
}
|
|
220
|
+
function printComment(comment, config) {
|
|
221
|
+
let commentColor = config.colors.comment;
|
|
222
|
+
return `${commentColor.open}<!--${escapeHTML(comment)}-->${commentColor.close}`;
|
|
223
|
+
}
|
|
224
|
+
function printElement(type, printedProps, printedChildren, config, indentation) {
|
|
225
|
+
let tagColor = config.colors.tag;
|
|
226
|
+
return `${tagColor.open}<${type}${printedProps && tagColor.close + printedProps + config.spacingOuter + indentation + tagColor.open}${printedChildren ? `>${tagColor.close}${printedChildren}${config.spacingOuter}${indentation}${tagColor.open}</${type}` : `${printedProps && !config.min ? "" : " "}/`}>${tagColor.close}`;
|
|
227
|
+
}
|
|
228
|
+
function printElementAsLeaf(type, config) {
|
|
229
|
+
let tagColor = config.colors.tag;
|
|
230
|
+
return `${tagColor.open}<${type}${tagColor.close} \u2026${tagColor.open} />${tagColor.close}`;
|
|
231
|
+
}
|
|
232
|
+
var ELEMENT_NODE = 1, TEXT_NODE = 3, COMMENT_NODE = 8, FRAGMENT_NODE = 11, ELEMENT_REGEXP = /^(?:(?:HTML|SVG)\w*)?Element$/;
|
|
233
|
+
function testHasAttribute(val) {
|
|
234
|
+
try {
|
|
235
|
+
return typeof val.hasAttribute == "function" && val.hasAttribute("is");
|
|
236
|
+
} catch {
|
|
237
|
+
return !1;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
function testNode(val) {
|
|
241
|
+
let constructorName = val.constructor.name, { nodeType, tagName } = val, isCustomElement = typeof tagName == "string" && tagName.includes("-") || testHasAttribute(val);
|
|
242
|
+
return nodeType === ELEMENT_NODE && (ELEMENT_REGEXP.test(constructorName) || isCustomElement) || nodeType === TEXT_NODE && constructorName === "Text" || nodeType === COMMENT_NODE && constructorName === "Comment" || nodeType === FRAGMENT_NODE && constructorName === "DocumentFragment";
|
|
243
|
+
}
|
|
244
|
+
var test$3 = (val) => {
|
|
245
|
+
var _val$constructor;
|
|
246
|
+
return (val == null || (_val$constructor = val.constructor) === null || _val$constructor === void 0 ? void 0 : _val$constructor.name) && testNode(val);
|
|
247
|
+
};
|
|
248
|
+
function nodeIsText(node) {
|
|
249
|
+
return node.nodeType === TEXT_NODE;
|
|
250
|
+
}
|
|
251
|
+
function nodeIsComment(node) {
|
|
252
|
+
return node.nodeType === COMMENT_NODE;
|
|
253
|
+
}
|
|
254
|
+
function nodeIsFragment(node) {
|
|
255
|
+
return node.nodeType === FRAGMENT_NODE;
|
|
256
|
+
}
|
|
257
|
+
var serialize$3 = (node, config, indentation, depth, refs, printer2) => {
|
|
258
|
+
if (nodeIsText(node))
|
|
259
|
+
return printText(node.data, config);
|
|
260
|
+
if (nodeIsComment(node))
|
|
261
|
+
return printComment(node.data, config);
|
|
262
|
+
let type = nodeIsFragment(node) ? "DocumentFragment" : node.tagName.toLowerCase();
|
|
263
|
+
return ++depth > config.maxDepth ? printElementAsLeaf(type, config) : printElement(type, printProps(nodeIsFragment(node) ? [] : Array.from(node.attributes, (attr) => attr.name).sort(), nodeIsFragment(node) ? {} : [...node.attributes].reduce((props, attribute) => (props[attribute.name] = attribute.value, props), {}), config, indentation + config.indent, depth, refs, printer2), printChildren(Array.prototype.slice.call(node.childNodes || node.children), config, indentation + config.indent, depth, refs, printer2), config, indentation);
|
|
264
|
+
}, plugin$3 = {
|
|
265
|
+
serialize: serialize$3,
|
|
266
|
+
test: test$3
|
|
267
|
+
}, IS_ITERABLE_SENTINEL = "@@__IMMUTABLE_ITERABLE__@@", IS_LIST_SENTINEL = "@@__IMMUTABLE_LIST__@@", IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@", IS_MAP_SENTINEL = "@@__IMMUTABLE_MAP__@@", IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@", IS_RECORD_SENTINEL = "@@__IMMUTABLE_RECORD__@@", IS_SEQ_SENTINEL = "@@__IMMUTABLE_SEQ__@@", IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@", IS_STACK_SENTINEL = "@@__IMMUTABLE_STACK__@@", getImmutableName = (name) => `Immutable.${name}`, printAsLeaf = (name) => `[${name}]`, SPACE = " ", LAZY = "\u2026";
|
|
268
|
+
function printImmutableEntries(val, config, indentation, depth, refs, printer2, type) {
|
|
269
|
+
return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : `${getImmutableName(type) + SPACE}{${printIteratorEntries(val.entries(), config, indentation, depth, refs, printer2)}}`;
|
|
270
|
+
}
|
|
271
|
+
function getRecordEntries(val) {
|
|
272
|
+
let i = 0;
|
|
273
|
+
return { next() {
|
|
274
|
+
if (i < val._keys.length) {
|
|
275
|
+
let key = val._keys[i++];
|
|
276
|
+
return {
|
|
277
|
+
done: !1,
|
|
278
|
+
value: [key, val.get(key)]
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
return {
|
|
282
|
+
done: !0,
|
|
283
|
+
value: void 0
|
|
284
|
+
};
|
|
285
|
+
} };
|
|
286
|
+
}
|
|
287
|
+
function printImmutableRecord(val, config, indentation, depth, refs, printer2) {
|
|
288
|
+
let name = getImmutableName(val._name || "Record");
|
|
289
|
+
return ++depth > config.maxDepth ? printAsLeaf(name) : `${name + SPACE}{${printIteratorEntries(getRecordEntries(val), config, indentation, depth, refs, printer2)}}`;
|
|
290
|
+
}
|
|
291
|
+
function printImmutableSeq(val, config, indentation, depth, refs, printer2) {
|
|
292
|
+
let name = getImmutableName("Seq");
|
|
293
|
+
return ++depth > config.maxDepth ? printAsLeaf(name) : val[IS_KEYED_SENTINEL] ? `${name + SPACE}{${val._iter || val._object ? printIteratorEntries(val.entries(), config, indentation, depth, refs, printer2) : LAZY}}` : `${name + SPACE}[${val._iter || val._array || val._collection || val._iterable ? printIteratorValues(val.values(), config, indentation, depth, refs, printer2) : LAZY}]`;
|
|
294
|
+
}
|
|
295
|
+
function printImmutableValues(val, config, indentation, depth, refs, printer2, type) {
|
|
296
|
+
return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : `${getImmutableName(type) + SPACE}[${printIteratorValues(val.values(), config, indentation, depth, refs, printer2)}]`;
|
|
297
|
+
}
|
|
298
|
+
var serialize$2 = (val, config, indentation, depth, refs, printer2) => val[IS_MAP_SENTINEL] ? printImmutableEntries(val, config, indentation, depth, refs, printer2, val[IS_ORDERED_SENTINEL] ? "OrderedMap" : "Map") : val[IS_LIST_SENTINEL] ? printImmutableValues(val, config, indentation, depth, refs, printer2, "List") : val[IS_SET_SENTINEL] ? printImmutableValues(val, config, indentation, depth, refs, printer2, val[IS_ORDERED_SENTINEL] ? "OrderedSet" : "Set") : val[IS_STACK_SENTINEL] ? printImmutableValues(val, config, indentation, depth, refs, printer2, "Stack") : val[IS_SEQ_SENTINEL] ? printImmutableSeq(val, config, indentation, depth, refs, printer2) : printImmutableRecord(val, config, indentation, depth, refs, printer2), test$2 = (val) => val && (val[IS_ITERABLE_SENTINEL] === !0 || val[IS_RECORD_SENTINEL] === !0), plugin$2 = {
|
|
299
|
+
serialize: serialize$2,
|
|
300
|
+
test: test$2
|
|
301
|
+
};
|
|
302
|
+
function getDefaultExportFromCjs(x) {
|
|
303
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
|
|
304
|
+
}
|
|
305
|
+
var reactIs$1 = { exports: {} }, reactIs_production = {};
|
|
306
|
+
var hasRequiredReactIs_production;
|
|
307
|
+
function requireReactIs_production() {
|
|
308
|
+
if (hasRequiredReactIs_production) return reactIs_production;
|
|
309
|
+
hasRequiredReactIs_production = 1;
|
|
310
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
|
311
|
+
function typeOf(object) {
|
|
312
|
+
if (typeof object == "object" && object !== null) {
|
|
313
|
+
var $$typeof = object.$$typeof;
|
|
314
|
+
switch ($$typeof) {
|
|
315
|
+
case REACT_ELEMENT_TYPE:
|
|
316
|
+
switch (object = object.type, object) {
|
|
317
|
+
case REACT_FRAGMENT_TYPE:
|
|
318
|
+
case REACT_PROFILER_TYPE:
|
|
319
|
+
case REACT_STRICT_MODE_TYPE:
|
|
320
|
+
case REACT_SUSPENSE_TYPE:
|
|
321
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
322
|
+
case REACT_VIEW_TRANSITION_TYPE:
|
|
323
|
+
return object;
|
|
324
|
+
default:
|
|
325
|
+
switch (object = object && object.$$typeof, object) {
|
|
326
|
+
case REACT_CONTEXT_TYPE:
|
|
327
|
+
case REACT_FORWARD_REF_TYPE:
|
|
328
|
+
case REACT_LAZY_TYPE:
|
|
329
|
+
case REACT_MEMO_TYPE:
|
|
330
|
+
return object;
|
|
331
|
+
case REACT_CONSUMER_TYPE:
|
|
332
|
+
return object;
|
|
333
|
+
default:
|
|
334
|
+
return $$typeof;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
case REACT_PORTAL_TYPE:
|
|
338
|
+
return $$typeof;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return reactIs_production.ContextConsumer = REACT_CONSUMER_TYPE, reactIs_production.ContextProvider = REACT_CONTEXT_TYPE, reactIs_production.Element = REACT_ELEMENT_TYPE, reactIs_production.ForwardRef = REACT_FORWARD_REF_TYPE, reactIs_production.Fragment = REACT_FRAGMENT_TYPE, reactIs_production.Lazy = REACT_LAZY_TYPE, reactIs_production.Memo = REACT_MEMO_TYPE, reactIs_production.Portal = REACT_PORTAL_TYPE, reactIs_production.Profiler = REACT_PROFILER_TYPE, reactIs_production.StrictMode = REACT_STRICT_MODE_TYPE, reactIs_production.Suspense = REACT_SUSPENSE_TYPE, reactIs_production.SuspenseList = REACT_SUSPENSE_LIST_TYPE, reactIs_production.isContextConsumer = function(object) {
|
|
343
|
+
return typeOf(object) === REACT_CONSUMER_TYPE;
|
|
344
|
+
}, reactIs_production.isContextProvider = function(object) {
|
|
345
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
346
|
+
}, reactIs_production.isElement = function(object) {
|
|
347
|
+
return typeof object == "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
348
|
+
}, reactIs_production.isForwardRef = function(object) {
|
|
349
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
350
|
+
}, reactIs_production.isFragment = function(object) {
|
|
351
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
352
|
+
}, reactIs_production.isLazy = function(object) {
|
|
353
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
354
|
+
}, reactIs_production.isMemo = function(object) {
|
|
355
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
356
|
+
}, reactIs_production.isPortal = function(object) {
|
|
357
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
358
|
+
}, reactIs_production.isProfiler = function(object) {
|
|
359
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
360
|
+
}, reactIs_production.isStrictMode = function(object) {
|
|
361
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
362
|
+
}, reactIs_production.isSuspense = function(object) {
|
|
363
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
364
|
+
}, reactIs_production.isSuspenseList = function(object) {
|
|
365
|
+
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
366
|
+
}, reactIs_production.isValidElementType = function(type) {
|
|
367
|
+
return typeof type == "string" || typeof type == "function" || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type == "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || type.getModuleId !== void 0);
|
|
368
|
+
}, reactIs_production.typeOf = typeOf, reactIs_production;
|
|
369
|
+
}
|
|
370
|
+
var reactIs_development$1 = {};
|
|
371
|
+
var hasRequiredReactIs_development$1;
|
|
372
|
+
function requireReactIs_development$1() {
|
|
373
|
+
return hasRequiredReactIs_development$1 || (hasRequiredReactIs_development$1 = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
374
|
+
function typeOf(object) {
|
|
375
|
+
if (typeof object == "object" && object !== null) {
|
|
376
|
+
var $$typeof = object.$$typeof;
|
|
377
|
+
switch ($$typeof) {
|
|
378
|
+
case REACT_ELEMENT_TYPE:
|
|
379
|
+
switch (object = object.type, object) {
|
|
380
|
+
case REACT_FRAGMENT_TYPE:
|
|
381
|
+
case REACT_PROFILER_TYPE:
|
|
382
|
+
case REACT_STRICT_MODE_TYPE:
|
|
383
|
+
case REACT_SUSPENSE_TYPE:
|
|
384
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
385
|
+
case REACT_VIEW_TRANSITION_TYPE:
|
|
386
|
+
return object;
|
|
387
|
+
default:
|
|
388
|
+
switch (object = object && object.$$typeof, object) {
|
|
389
|
+
case REACT_CONTEXT_TYPE:
|
|
390
|
+
case REACT_FORWARD_REF_TYPE:
|
|
391
|
+
case REACT_LAZY_TYPE:
|
|
392
|
+
case REACT_MEMO_TYPE:
|
|
393
|
+
return object;
|
|
394
|
+
case REACT_CONSUMER_TYPE:
|
|
395
|
+
return object;
|
|
396
|
+
default:
|
|
397
|
+
return $$typeof;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
case REACT_PORTAL_TYPE:
|
|
401
|
+
return $$typeof;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
|
406
|
+
reactIs_development$1.ContextConsumer = REACT_CONSUMER_TYPE, reactIs_development$1.ContextProvider = REACT_CONTEXT_TYPE, reactIs_development$1.Element = REACT_ELEMENT_TYPE, reactIs_development$1.ForwardRef = REACT_FORWARD_REF_TYPE, reactIs_development$1.Fragment = REACT_FRAGMENT_TYPE, reactIs_development$1.Lazy = REACT_LAZY_TYPE, reactIs_development$1.Memo = REACT_MEMO_TYPE, reactIs_development$1.Portal = REACT_PORTAL_TYPE, reactIs_development$1.Profiler = REACT_PROFILER_TYPE, reactIs_development$1.StrictMode = REACT_STRICT_MODE_TYPE, reactIs_development$1.Suspense = REACT_SUSPENSE_TYPE, reactIs_development$1.SuspenseList = REACT_SUSPENSE_LIST_TYPE, reactIs_development$1.isContextConsumer = function(object) {
|
|
407
|
+
return typeOf(object) === REACT_CONSUMER_TYPE;
|
|
408
|
+
}, reactIs_development$1.isContextProvider = function(object) {
|
|
409
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
410
|
+
}, reactIs_development$1.isElement = function(object) {
|
|
411
|
+
return typeof object == "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
412
|
+
}, reactIs_development$1.isForwardRef = function(object) {
|
|
413
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
414
|
+
}, reactIs_development$1.isFragment = function(object) {
|
|
415
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
416
|
+
}, reactIs_development$1.isLazy = function(object) {
|
|
417
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
418
|
+
}, reactIs_development$1.isMemo = function(object) {
|
|
419
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
420
|
+
}, reactIs_development$1.isPortal = function(object) {
|
|
421
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
422
|
+
}, reactIs_development$1.isProfiler = function(object) {
|
|
423
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
424
|
+
}, reactIs_development$1.isStrictMode = function(object) {
|
|
425
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
426
|
+
}, reactIs_development$1.isSuspense = function(object) {
|
|
427
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
428
|
+
}, reactIs_development$1.isSuspenseList = function(object) {
|
|
429
|
+
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
430
|
+
}, reactIs_development$1.isValidElementType = function(type) {
|
|
431
|
+
return typeof type == "string" || typeof type == "function" || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type == "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || type.getModuleId !== void 0);
|
|
432
|
+
}, reactIs_development$1.typeOf = typeOf;
|
|
433
|
+
})()), reactIs_development$1;
|
|
434
|
+
}
|
|
435
|
+
var hasRequiredReactIs$1;
|
|
436
|
+
function requireReactIs$1() {
|
|
437
|
+
return hasRequiredReactIs$1 || (hasRequiredReactIs$1 = 1, process.env.NODE_ENV === "production" ? reactIs$1.exports = requireReactIs_production() : reactIs$1.exports = requireReactIs_development$1()), reactIs$1.exports;
|
|
438
|
+
}
|
|
439
|
+
var reactIsExports$1 = requireReactIs$1(), index$1 = getDefaultExportFromCjs(reactIsExports$1), ReactIs19 = _mergeNamespaces({
|
|
440
|
+
__proto__: null,
|
|
441
|
+
default: index$1
|
|
442
|
+
}, [reactIsExports$1]), reactIs = { exports: {} }, reactIs_production_min = {};
|
|
443
|
+
var hasRequiredReactIs_production_min;
|
|
444
|
+
function requireReactIs_production_min() {
|
|
445
|
+
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
446
|
+
hasRequiredReactIs_production_min = 1;
|
|
447
|
+
var b = Symbol.for("react.element"), c = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), e = Symbol.for("react.strict_mode"), f2 = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), h2 = Symbol.for("react.context"), k = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), m2 = Symbol.for("react.suspense"), n = Symbol.for("react.suspense_list"), p2 = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), t = Symbol.for("react.offscreen"), u;
|
|
448
|
+
u = Symbol.for("react.module.reference");
|
|
449
|
+
function v(a2) {
|
|
450
|
+
if (typeof a2 == "object" && a2 !== null) {
|
|
451
|
+
var r = a2.$$typeof;
|
|
452
|
+
switch (r) {
|
|
453
|
+
case b:
|
|
454
|
+
switch (a2 = a2.type, a2) {
|
|
455
|
+
case d:
|
|
456
|
+
case f2:
|
|
457
|
+
case e:
|
|
458
|
+
case m2:
|
|
459
|
+
case n:
|
|
460
|
+
return a2;
|
|
461
|
+
default:
|
|
462
|
+
switch (a2 = a2 && a2.$$typeof, a2) {
|
|
463
|
+
case k:
|
|
464
|
+
case h2:
|
|
465
|
+
case l:
|
|
466
|
+
case q:
|
|
467
|
+
case p2:
|
|
468
|
+
case g:
|
|
469
|
+
return a2;
|
|
470
|
+
default:
|
|
471
|
+
return r;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
case c:
|
|
475
|
+
return r;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
return reactIs_production_min.ContextConsumer = h2, reactIs_production_min.ContextProvider = g, reactIs_production_min.Element = b, reactIs_production_min.ForwardRef = l, reactIs_production_min.Fragment = d, reactIs_production_min.Lazy = q, reactIs_production_min.Memo = p2, reactIs_production_min.Portal = c, reactIs_production_min.Profiler = f2, reactIs_production_min.StrictMode = e, reactIs_production_min.Suspense = m2, reactIs_production_min.SuspenseList = n, reactIs_production_min.isAsyncMode = function() {
|
|
480
|
+
return !1;
|
|
481
|
+
}, reactIs_production_min.isConcurrentMode = function() {
|
|
482
|
+
return !1;
|
|
483
|
+
}, reactIs_production_min.isContextConsumer = function(a2) {
|
|
484
|
+
return v(a2) === h2;
|
|
485
|
+
}, reactIs_production_min.isContextProvider = function(a2) {
|
|
486
|
+
return v(a2) === g;
|
|
487
|
+
}, reactIs_production_min.isElement = function(a2) {
|
|
488
|
+
return typeof a2 == "object" && a2 !== null && a2.$$typeof === b;
|
|
489
|
+
}, reactIs_production_min.isForwardRef = function(a2) {
|
|
490
|
+
return v(a2) === l;
|
|
491
|
+
}, reactIs_production_min.isFragment = function(a2) {
|
|
492
|
+
return v(a2) === d;
|
|
493
|
+
}, reactIs_production_min.isLazy = function(a2) {
|
|
494
|
+
return v(a2) === q;
|
|
495
|
+
}, reactIs_production_min.isMemo = function(a2) {
|
|
496
|
+
return v(a2) === p2;
|
|
497
|
+
}, reactIs_production_min.isPortal = function(a2) {
|
|
498
|
+
return v(a2) === c;
|
|
499
|
+
}, reactIs_production_min.isProfiler = function(a2) {
|
|
500
|
+
return v(a2) === f2;
|
|
501
|
+
}, reactIs_production_min.isStrictMode = function(a2) {
|
|
502
|
+
return v(a2) === e;
|
|
503
|
+
}, reactIs_production_min.isSuspense = function(a2) {
|
|
504
|
+
return v(a2) === m2;
|
|
505
|
+
}, reactIs_production_min.isSuspenseList = function(a2) {
|
|
506
|
+
return v(a2) === n;
|
|
507
|
+
}, reactIs_production_min.isValidElementType = function(a2) {
|
|
508
|
+
return typeof a2 == "string" || typeof a2 == "function" || a2 === d || a2 === f2 || a2 === e || a2 === m2 || a2 === n || a2 === t || typeof a2 == "object" && a2 !== null && (a2.$$typeof === q || a2.$$typeof === p2 || a2.$$typeof === g || a2.$$typeof === h2 || a2.$$typeof === l || a2.$$typeof === u || a2.getModuleId !== void 0);
|
|
509
|
+
}, reactIs_production_min.typeOf = v, reactIs_production_min;
|
|
510
|
+
}
|
|
511
|
+
var reactIs_development = {};
|
|
512
|
+
var hasRequiredReactIs_development;
|
|
513
|
+
function requireReactIs_development() {
|
|
514
|
+
return hasRequiredReactIs_development || (hasRequiredReactIs_development = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
515
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_PROVIDER_TYPE = Symbol.for("react.provider"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), enableScopeAPI = !1, enableCacheElement = !1, enableTransitionTracing = !1, enableLegacyHidden = !1, enableDebugTracing = !1, REACT_MODULE_REFERENCE;
|
|
516
|
+
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
517
|
+
function isValidElementType(type) {
|
|
518
|
+
return !!(typeof type == "string" || typeof type == "function" || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing || typeof type == "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
519
|
+
// types supported by any Flight configuration anywhere since
|
|
520
|
+
// we don't know which Flight build this will end up being used
|
|
521
|
+
// with.
|
|
522
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0));
|
|
523
|
+
}
|
|
524
|
+
function typeOf(object) {
|
|
525
|
+
if (typeof object == "object" && object !== null) {
|
|
526
|
+
var $$typeof = object.$$typeof;
|
|
527
|
+
switch ($$typeof) {
|
|
528
|
+
case REACT_ELEMENT_TYPE:
|
|
529
|
+
var type = object.type;
|
|
530
|
+
switch (type) {
|
|
531
|
+
case REACT_FRAGMENT_TYPE:
|
|
532
|
+
case REACT_PROFILER_TYPE:
|
|
533
|
+
case REACT_STRICT_MODE_TYPE:
|
|
534
|
+
case REACT_SUSPENSE_TYPE:
|
|
535
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
536
|
+
return type;
|
|
537
|
+
default:
|
|
538
|
+
var $$typeofType = type && type.$$typeof;
|
|
539
|
+
switch ($$typeofType) {
|
|
540
|
+
case REACT_SERVER_CONTEXT_TYPE:
|
|
541
|
+
case REACT_CONTEXT_TYPE:
|
|
542
|
+
case REACT_FORWARD_REF_TYPE:
|
|
543
|
+
case REACT_LAZY_TYPE:
|
|
544
|
+
case REACT_MEMO_TYPE:
|
|
545
|
+
case REACT_PROVIDER_TYPE:
|
|
546
|
+
return $$typeofType;
|
|
547
|
+
default:
|
|
548
|
+
return $$typeof;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
case REACT_PORTAL_TYPE:
|
|
552
|
+
return $$typeof;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
var ContextConsumer = REACT_CONTEXT_TYPE, ContextProvider = REACT_PROVIDER_TYPE, Element2 = REACT_ELEMENT_TYPE, ForwardRef = REACT_FORWARD_REF_TYPE, Fragment = REACT_FRAGMENT_TYPE, Lazy = REACT_LAZY_TYPE, Memo = REACT_MEMO_TYPE, Portal = REACT_PORTAL_TYPE, Profiler = REACT_PROFILER_TYPE, StrictMode = REACT_STRICT_MODE_TYPE, Suspense = REACT_SUSPENSE_TYPE, SuspenseList = REACT_SUSPENSE_LIST_TYPE, hasWarnedAboutDeprecatedIsAsyncMode = !1, hasWarnedAboutDeprecatedIsConcurrentMode = !1;
|
|
557
|
+
function isAsyncMode(object) {
|
|
558
|
+
return hasWarnedAboutDeprecatedIsAsyncMode || (hasWarnedAboutDeprecatedIsAsyncMode = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")), !1;
|
|
559
|
+
}
|
|
560
|
+
function isConcurrentMode(object) {
|
|
561
|
+
return hasWarnedAboutDeprecatedIsConcurrentMode || (hasWarnedAboutDeprecatedIsConcurrentMode = !0, console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")), !1;
|
|
562
|
+
}
|
|
563
|
+
function isContextConsumer(object) {
|
|
564
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
565
|
+
}
|
|
566
|
+
function isContextProvider(object) {
|
|
567
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
568
|
+
}
|
|
569
|
+
function isElement(object) {
|
|
570
|
+
return typeof object == "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
571
|
+
}
|
|
572
|
+
function isForwardRef(object) {
|
|
573
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
574
|
+
}
|
|
575
|
+
function isFragment(object) {
|
|
576
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
577
|
+
}
|
|
578
|
+
function isLazy(object) {
|
|
579
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
580
|
+
}
|
|
581
|
+
function isMemo(object) {
|
|
582
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
583
|
+
}
|
|
584
|
+
function isPortal(object) {
|
|
585
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
586
|
+
}
|
|
587
|
+
function isProfiler(object) {
|
|
588
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
589
|
+
}
|
|
590
|
+
function isStrictMode(object) {
|
|
591
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
592
|
+
}
|
|
593
|
+
function isSuspense(object) {
|
|
594
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
595
|
+
}
|
|
596
|
+
function isSuspenseList(object) {
|
|
597
|
+
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
598
|
+
}
|
|
599
|
+
reactIs_development.ContextConsumer = ContextConsumer, reactIs_development.ContextProvider = ContextProvider, reactIs_development.Element = Element2, reactIs_development.ForwardRef = ForwardRef, reactIs_development.Fragment = Fragment, reactIs_development.Lazy = Lazy, reactIs_development.Memo = Memo, reactIs_development.Portal = Portal, reactIs_development.Profiler = Profiler, reactIs_development.StrictMode = StrictMode, reactIs_development.Suspense = Suspense, reactIs_development.SuspenseList = SuspenseList, reactIs_development.isAsyncMode = isAsyncMode, reactIs_development.isConcurrentMode = isConcurrentMode, reactIs_development.isContextConsumer = isContextConsumer, reactIs_development.isContextProvider = isContextProvider, reactIs_development.isElement = isElement, reactIs_development.isForwardRef = isForwardRef, reactIs_development.isFragment = isFragment, reactIs_development.isLazy = isLazy, reactIs_development.isMemo = isMemo, reactIs_development.isPortal = isPortal, reactIs_development.isProfiler = isProfiler, reactIs_development.isStrictMode = isStrictMode, reactIs_development.isSuspense = isSuspense, reactIs_development.isSuspenseList = isSuspenseList, reactIs_development.isValidElementType = isValidElementType, reactIs_development.typeOf = typeOf;
|
|
600
|
+
})()), reactIs_development;
|
|
601
|
+
}
|
|
602
|
+
var hasRequiredReactIs;
|
|
603
|
+
function requireReactIs() {
|
|
604
|
+
return hasRequiredReactIs || (hasRequiredReactIs = 1, process.env.NODE_ENV === "production" ? reactIs.exports = requireReactIs_production_min() : reactIs.exports = requireReactIs_development()), reactIs.exports;
|
|
605
|
+
}
|
|
606
|
+
var reactIsExports = requireReactIs(), index = getDefaultExportFromCjs(reactIsExports), ReactIs18 = _mergeNamespaces({
|
|
607
|
+
__proto__: null,
|
|
608
|
+
default: index
|
|
609
|
+
}, [reactIsExports]), reactIsMethods = [
|
|
610
|
+
"isAsyncMode",
|
|
611
|
+
"isConcurrentMode",
|
|
612
|
+
"isContextConsumer",
|
|
613
|
+
"isContextProvider",
|
|
614
|
+
"isElement",
|
|
615
|
+
"isForwardRef",
|
|
616
|
+
"isFragment",
|
|
617
|
+
"isLazy",
|
|
618
|
+
"isMemo",
|
|
619
|
+
"isPortal",
|
|
620
|
+
"isProfiler",
|
|
621
|
+
"isStrictMode",
|
|
622
|
+
"isSuspense",
|
|
623
|
+
"isSuspenseList",
|
|
624
|
+
"isValidElementType"
|
|
625
|
+
], ReactIs = Object.fromEntries(reactIsMethods.map((m2) => [m2, (v) => ReactIs18[m2](v) || ReactIs19[m2](v)]));
|
|
626
|
+
function getChildren(arg, children = []) {
|
|
627
|
+
if (Array.isArray(arg))
|
|
628
|
+
for (let item of arg)
|
|
629
|
+
getChildren(item, children);
|
|
630
|
+
else arg != null && arg !== !1 && arg !== "" && children.push(arg);
|
|
631
|
+
return children;
|
|
632
|
+
}
|
|
633
|
+
function getType(element) {
|
|
634
|
+
let type = element.type;
|
|
635
|
+
if (typeof type == "string")
|
|
636
|
+
return type;
|
|
637
|
+
if (typeof type == "function")
|
|
638
|
+
return type.displayName || type.name || "Unknown";
|
|
639
|
+
if (ReactIs.isFragment(element))
|
|
640
|
+
return "React.Fragment";
|
|
641
|
+
if (ReactIs.isSuspense(element))
|
|
642
|
+
return "React.Suspense";
|
|
643
|
+
if (typeof type == "object" && type !== null) {
|
|
644
|
+
if (ReactIs.isContextProvider(element))
|
|
645
|
+
return "Context.Provider";
|
|
646
|
+
if (ReactIs.isContextConsumer(element))
|
|
647
|
+
return "Context.Consumer";
|
|
648
|
+
if (ReactIs.isForwardRef(element)) {
|
|
649
|
+
if (type.displayName)
|
|
650
|
+
return type.displayName;
|
|
651
|
+
let functionName = type.render.displayName || type.render.name || "";
|
|
652
|
+
return functionName === "" ? "ForwardRef" : `ForwardRef(${functionName})`;
|
|
653
|
+
}
|
|
654
|
+
if (ReactIs.isMemo(element)) {
|
|
655
|
+
let functionName = type.displayName || type.type.displayName || type.type.name || "";
|
|
656
|
+
return functionName === "" ? "Memo" : `Memo(${functionName})`;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
return "UNDEFINED";
|
|
660
|
+
}
|
|
661
|
+
function getPropKeys$1(element) {
|
|
662
|
+
let { props } = element;
|
|
663
|
+
return Object.keys(props).filter((key) => key !== "children" && props[key] !== void 0).sort();
|
|
664
|
+
}
|
|
665
|
+
var serialize$1 = (element, config, indentation, depth, refs, printer2) => ++depth > config.maxDepth ? printElementAsLeaf(getType(element), config) : printElement(getType(element), printProps(getPropKeys$1(element), element.props, config, indentation + config.indent, depth, refs, printer2), printChildren(getChildren(element.props.children), config, indentation + config.indent, depth, refs, printer2), config, indentation), test$1 = (val) => val != null && ReactIs.isElement(val), plugin$1 = {
|
|
666
|
+
serialize: serialize$1,
|
|
667
|
+
test: test$1
|
|
668
|
+
}, testSymbol = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.test.json") : 245830487;
|
|
669
|
+
function getPropKeys(object) {
|
|
670
|
+
let { props } = object;
|
|
671
|
+
return props ? Object.keys(props).filter((key) => props[key] !== void 0).sort() : [];
|
|
672
|
+
}
|
|
673
|
+
var serialize = (object, config, indentation, depth, refs, printer2) => ++depth > config.maxDepth ? printElementAsLeaf(object.type, config) : printElement(object.type, object.props ? printProps(getPropKeys(object), object.props, config, indentation + config.indent, depth, refs, printer2) : "", object.children ? printChildren(object.children, config, indentation + config.indent, depth, refs, printer2) : "", config, indentation), test = (val) => val && val.$$typeof === testSymbol, plugin = {
|
|
674
|
+
serialize,
|
|
675
|
+
test
|
|
676
|
+
}, toString = Object.prototype.toString, toISOString = Date.prototype.toISOString, errorToString = Error.prototype.toString, regExpToString = RegExp.prototype.toString;
|
|
677
|
+
function getConstructorName(val) {
|
|
678
|
+
return typeof val.constructor == "function" && val.constructor.name || "Object";
|
|
679
|
+
}
|
|
680
|
+
function isWindow(val) {
|
|
681
|
+
return typeof window < "u" && val === window;
|
|
682
|
+
}
|
|
683
|
+
var SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/, NEWLINE_REGEXP = /\n/g, PrettyFormatPluginError = class extends Error {
|
|
684
|
+
constructor(message, stack) {
|
|
685
|
+
super(message), this.stack = stack, this.name = this.constructor.name;
|
|
686
|
+
}
|
|
687
|
+
};
|
|
688
|
+
function isToStringedArrayType(toStringed) {
|
|
689
|
+
return toStringed === "[object Array]" || toStringed === "[object ArrayBuffer]" || toStringed === "[object DataView]" || toStringed === "[object Float32Array]" || toStringed === "[object Float64Array]" || toStringed === "[object Int8Array]" || toStringed === "[object Int16Array]" || toStringed === "[object Int32Array]" || toStringed === "[object Uint8Array]" || toStringed === "[object Uint8ClampedArray]" || toStringed === "[object Uint16Array]" || toStringed === "[object Uint32Array]";
|
|
690
|
+
}
|
|
691
|
+
function printNumber(val) {
|
|
692
|
+
return Object.is(val, -0) ? "-0" : String(val);
|
|
693
|
+
}
|
|
694
|
+
function printBigInt(val) {
|
|
695
|
+
return `${val}n`;
|
|
696
|
+
}
|
|
697
|
+
function printFunction(val, printFunctionName) {
|
|
698
|
+
return printFunctionName ? `[Function ${val.name || "anonymous"}]` : "[Function]";
|
|
699
|
+
}
|
|
700
|
+
function printSymbol(val) {
|
|
701
|
+
return String(val).replace(SYMBOL_REGEXP, "Symbol($1)");
|
|
702
|
+
}
|
|
703
|
+
function printError(val) {
|
|
704
|
+
return `[${errorToString.call(val)}]`;
|
|
705
|
+
}
|
|
706
|
+
function printBasicValue(val, printFunctionName, escapeRegex, escapeString) {
|
|
707
|
+
if (val === !0 || val === !1)
|
|
708
|
+
return `${val}`;
|
|
709
|
+
if (val === void 0)
|
|
710
|
+
return "undefined";
|
|
711
|
+
if (val === null)
|
|
712
|
+
return "null";
|
|
713
|
+
let typeOf = typeof val;
|
|
714
|
+
if (typeOf === "number")
|
|
715
|
+
return printNumber(val);
|
|
716
|
+
if (typeOf === "bigint")
|
|
717
|
+
return printBigInt(val);
|
|
718
|
+
if (typeOf === "string")
|
|
719
|
+
return escapeString ? `"${val.replaceAll(/"|\\/g, "\\$&")}"` : `"${val}"`;
|
|
720
|
+
if (typeOf === "function")
|
|
721
|
+
return printFunction(val, printFunctionName);
|
|
722
|
+
if (typeOf === "symbol")
|
|
723
|
+
return printSymbol(val);
|
|
724
|
+
let toStringed = toString.call(val);
|
|
725
|
+
return toStringed === "[object WeakMap]" ? "WeakMap {}" : toStringed === "[object WeakSet]" ? "WeakSet {}" : toStringed === "[object Function]" || toStringed === "[object GeneratorFunction]" ? printFunction(val, printFunctionName) : toStringed === "[object Symbol]" ? printSymbol(val) : toStringed === "[object Date]" ? Number.isNaN(+val) ? "Date { NaN }" : toISOString.call(val) : toStringed === "[object Error]" ? printError(val) : toStringed === "[object RegExp]" ? escapeRegex ? regExpToString.call(val).replaceAll(/[$()*+.?[\\\]^{|}]/g, "\\$&") : regExpToString.call(val) : val instanceof Error ? printError(val) : null;
|
|
726
|
+
}
|
|
727
|
+
function printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON) {
|
|
728
|
+
if (refs.includes(val))
|
|
729
|
+
return "[Circular]";
|
|
730
|
+
refs = [...refs], refs.push(val);
|
|
731
|
+
let hitMaxDepth = ++depth > config.maxDepth, min = config.min;
|
|
732
|
+
if (config.callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON == "function" && !hasCalledToJSON)
|
|
733
|
+
return printer(val.toJSON(), config, indentation, depth, refs, !0);
|
|
734
|
+
let toStringed = toString.call(val);
|
|
735
|
+
return toStringed === "[object Arguments]" ? hitMaxDepth ? "[Arguments]" : `${min ? "" : "Arguments "}[${printListItems(val, config, indentation, depth, refs, printer)}]` : isToStringedArrayType(toStringed) ? hitMaxDepth ? `[${val.constructor.name}]` : `${min || !config.printBasicPrototype && val.constructor.name === "Array" ? "" : `${val.constructor.name} `}[${printListItems(val, config, indentation, depth, refs, printer)}]` : toStringed === "[object Map]" ? hitMaxDepth ? "[Map]" : `Map {${printIteratorEntries(val.entries(), config, indentation, depth, refs, printer, " => ")}}` : toStringed === "[object Set]" ? hitMaxDepth ? "[Set]" : `Set {${printIteratorValues(val.values(), config, indentation, depth, refs, printer)}}` : hitMaxDepth || isWindow(val) ? `[${getConstructorName(val)}]` : `${min || !config.printBasicPrototype && getConstructorName(val) === "Object" ? "" : `${getConstructorName(val)} `}{${printObjectProperties(val, config, indentation, depth, refs, printer)}}`;
|
|
736
|
+
}
|
|
737
|
+
var ErrorPlugin = {
|
|
738
|
+
test: (val) => val && val instanceof Error,
|
|
739
|
+
serialize(val, config, indentation, depth, refs, printer2) {
|
|
740
|
+
if (refs.includes(val))
|
|
741
|
+
return "[Circular]";
|
|
742
|
+
refs = [...refs, val];
|
|
743
|
+
let hitMaxDepth = ++depth > config.maxDepth, { message, cause, ...rest } = val, entries = {
|
|
744
|
+
message,
|
|
745
|
+
...typeof cause < "u" ? { cause } : {},
|
|
746
|
+
...val instanceof AggregateError ? { errors: val.errors } : {},
|
|
747
|
+
...rest
|
|
748
|
+
}, name = val.name !== "Error" ? val.name : getConstructorName(val);
|
|
749
|
+
return hitMaxDepth ? `[${name}]` : `${name} {${printIteratorEntries(Object.entries(entries).values(), config, indentation, depth, refs, printer2)}}`;
|
|
750
|
+
}
|
|
751
|
+
};
|
|
752
|
+
function isNewPlugin(plugin2) {
|
|
753
|
+
return plugin2.serialize != null;
|
|
754
|
+
}
|
|
755
|
+
function printPlugin(plugin2, val, config, indentation, depth, refs) {
|
|
756
|
+
let printed;
|
|
757
|
+
try {
|
|
758
|
+
printed = isNewPlugin(plugin2) ? plugin2.serialize(val, config, indentation, depth, refs, printer) : plugin2.print(val, (valChild) => printer(valChild, config, indentation, depth, refs), (str) => {
|
|
759
|
+
let indentationNext = indentation + config.indent;
|
|
760
|
+
return indentationNext + str.replaceAll(NEWLINE_REGEXP, `
|
|
761
|
+
${indentationNext}`);
|
|
762
|
+
}, {
|
|
763
|
+
edgeSpacing: config.spacingOuter,
|
|
764
|
+
min: config.min,
|
|
765
|
+
spacing: config.spacingInner
|
|
766
|
+
}, config.colors);
|
|
767
|
+
} catch (error) {
|
|
768
|
+
throw new PrettyFormatPluginError(error.message, error.stack);
|
|
769
|
+
}
|
|
770
|
+
if (typeof printed != "string")
|
|
771
|
+
throw new TypeError(`pretty-format: Plugin must return type "string" but instead returned "${typeof printed}".`);
|
|
772
|
+
return printed;
|
|
773
|
+
}
|
|
774
|
+
function findPlugin(plugins2, val) {
|
|
775
|
+
for (let plugin2 of plugins2)
|
|
776
|
+
try {
|
|
777
|
+
if (plugin2.test(val))
|
|
778
|
+
return plugin2;
|
|
779
|
+
} catch (error) {
|
|
780
|
+
throw new PrettyFormatPluginError(error.message, error.stack);
|
|
781
|
+
}
|
|
782
|
+
return null;
|
|
783
|
+
}
|
|
784
|
+
function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
|
|
785
|
+
let plugin2 = findPlugin(config.plugins, val);
|
|
786
|
+
if (plugin2 !== null)
|
|
787
|
+
return printPlugin(plugin2, val, config, indentation, depth, refs);
|
|
788
|
+
let basicResult = printBasicValue(val, config.printFunctionName, config.escapeRegex, config.escapeString);
|
|
789
|
+
return basicResult !== null ? basicResult : printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON);
|
|
790
|
+
}
|
|
791
|
+
var DEFAULT_THEME = {
|
|
792
|
+
comment: "gray",
|
|
793
|
+
content: "reset",
|
|
794
|
+
prop: "yellow",
|
|
795
|
+
tag: "cyan",
|
|
796
|
+
value: "green"
|
|
797
|
+
}, DEFAULT_THEME_KEYS = Object.keys(DEFAULT_THEME), DEFAULT_OPTIONS = {
|
|
798
|
+
callToJSON: !0,
|
|
799
|
+
compareKeys: void 0,
|
|
800
|
+
escapeRegex: !1,
|
|
801
|
+
escapeString: !0,
|
|
802
|
+
highlight: !1,
|
|
803
|
+
indent: 2,
|
|
804
|
+
maxDepth: Number.POSITIVE_INFINITY,
|
|
805
|
+
maxWidth: Number.POSITIVE_INFINITY,
|
|
806
|
+
min: !1,
|
|
807
|
+
plugins: [],
|
|
808
|
+
printBasicPrototype: !0,
|
|
809
|
+
printFunctionName: !0,
|
|
810
|
+
theme: DEFAULT_THEME
|
|
811
|
+
};
|
|
812
|
+
function validateOptions(options) {
|
|
813
|
+
for (let key of Object.keys(options))
|
|
814
|
+
if (!Object.prototype.hasOwnProperty.call(DEFAULT_OPTIONS, key))
|
|
815
|
+
throw new Error(`pretty-format: Unknown option "${key}".`);
|
|
816
|
+
if (options.min && options.indent !== void 0 && options.indent !== 0)
|
|
817
|
+
throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');
|
|
818
|
+
}
|
|
819
|
+
function getColorsHighlight() {
|
|
820
|
+
return DEFAULT_THEME_KEYS.reduce((colors, key) => {
|
|
821
|
+
let value = DEFAULT_THEME[key], color = value && s[value];
|
|
822
|
+
if (color && typeof color.close == "string" && typeof color.open == "string")
|
|
823
|
+
colors[key] = color;
|
|
824
|
+
else
|
|
825
|
+
throw new Error(`pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`);
|
|
826
|
+
return colors;
|
|
827
|
+
}, /* @__PURE__ */ Object.create(null));
|
|
828
|
+
}
|
|
829
|
+
function getColorsEmpty() {
|
|
830
|
+
return DEFAULT_THEME_KEYS.reduce((colors, key) => (colors[key] = {
|
|
831
|
+
close: "",
|
|
832
|
+
open: ""
|
|
833
|
+
}, colors), /* @__PURE__ */ Object.create(null));
|
|
834
|
+
}
|
|
835
|
+
function getPrintFunctionName(options) {
|
|
836
|
+
return options?.printFunctionName ?? DEFAULT_OPTIONS.printFunctionName;
|
|
837
|
+
}
|
|
838
|
+
function getEscapeRegex(options) {
|
|
839
|
+
return options?.escapeRegex ?? DEFAULT_OPTIONS.escapeRegex;
|
|
840
|
+
}
|
|
841
|
+
function getEscapeString(options) {
|
|
842
|
+
return options?.escapeString ?? DEFAULT_OPTIONS.escapeString;
|
|
843
|
+
}
|
|
844
|
+
function getConfig(options) {
|
|
845
|
+
return {
|
|
846
|
+
callToJSON: options?.callToJSON ?? DEFAULT_OPTIONS.callToJSON,
|
|
847
|
+
colors: options?.highlight ? getColorsHighlight() : getColorsEmpty(),
|
|
848
|
+
compareKeys: typeof options?.compareKeys == "function" || options?.compareKeys === null ? options.compareKeys : DEFAULT_OPTIONS.compareKeys,
|
|
849
|
+
escapeRegex: getEscapeRegex(options),
|
|
850
|
+
escapeString: getEscapeString(options),
|
|
851
|
+
indent: options?.min ? "" : createIndent(options?.indent ?? DEFAULT_OPTIONS.indent),
|
|
852
|
+
maxDepth: options?.maxDepth ?? DEFAULT_OPTIONS.maxDepth,
|
|
853
|
+
maxWidth: options?.maxWidth ?? DEFAULT_OPTIONS.maxWidth,
|
|
854
|
+
min: options?.min ?? DEFAULT_OPTIONS.min,
|
|
855
|
+
plugins: options?.plugins ?? DEFAULT_OPTIONS.plugins,
|
|
856
|
+
printBasicPrototype: options?.printBasicPrototype ?? !0,
|
|
857
|
+
printFunctionName: getPrintFunctionName(options),
|
|
858
|
+
spacingInner: options?.min ? " " : `
|
|
859
|
+
`,
|
|
860
|
+
spacingOuter: options?.min ? "" : `
|
|
861
|
+
`
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
function createIndent(indent) {
|
|
865
|
+
return Array.from({ length: indent + 1 }).join(" ");
|
|
866
|
+
}
|
|
867
|
+
function format(val, options) {
|
|
868
|
+
if (options && (validateOptions(options), options.plugins)) {
|
|
869
|
+
let plugin2 = findPlugin(options.plugins, val);
|
|
870
|
+
if (plugin2 !== null)
|
|
871
|
+
return printPlugin(plugin2, val, getConfig(options), "", 0, []);
|
|
872
|
+
}
|
|
873
|
+
let basicResult = printBasicValue(val, getPrintFunctionName(options), getEscapeRegex(options), getEscapeString(options));
|
|
874
|
+
return basicResult !== null ? basicResult : printComplexValue(val, getConfig(options), "", 0, []);
|
|
875
|
+
}
|
|
876
|
+
var plugins = {
|
|
877
|
+
AsymmetricMatcher: plugin$5,
|
|
878
|
+
DOMCollection: plugin$4,
|
|
879
|
+
DOMElement: plugin$3,
|
|
880
|
+
Immutable: plugin$2,
|
|
881
|
+
ReactElement: plugin$1,
|
|
882
|
+
ReactTestComponent: plugin,
|
|
883
|
+
Error: ErrorPlugin
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
// ../node_modules/loupe/lib/helpers.js
|
|
887
|
+
var ansiColors = {
|
|
888
|
+
bold: ["1", "22"],
|
|
889
|
+
dim: ["2", "22"],
|
|
890
|
+
italic: ["3", "23"],
|
|
891
|
+
underline: ["4", "24"],
|
|
892
|
+
// 5 & 6 are blinking
|
|
893
|
+
inverse: ["7", "27"],
|
|
894
|
+
hidden: ["8", "28"],
|
|
895
|
+
strike: ["9", "29"],
|
|
896
|
+
// 10-20 are fonts
|
|
897
|
+
// 21-29 are resets for 1-9
|
|
898
|
+
black: ["30", "39"],
|
|
899
|
+
red: ["31", "39"],
|
|
900
|
+
green: ["32", "39"],
|
|
901
|
+
yellow: ["33", "39"],
|
|
902
|
+
blue: ["34", "39"],
|
|
903
|
+
magenta: ["35", "39"],
|
|
904
|
+
cyan: ["36", "39"],
|
|
905
|
+
white: ["37", "39"],
|
|
906
|
+
brightblack: ["30;1", "39"],
|
|
907
|
+
brightred: ["31;1", "39"],
|
|
908
|
+
brightgreen: ["32;1", "39"],
|
|
909
|
+
brightyellow: ["33;1", "39"],
|
|
910
|
+
brightblue: ["34;1", "39"],
|
|
911
|
+
brightmagenta: ["35;1", "39"],
|
|
912
|
+
brightcyan: ["36;1", "39"],
|
|
913
|
+
brightwhite: ["37;1", "39"],
|
|
914
|
+
grey: ["90", "39"]
|
|
915
|
+
}, styles = {
|
|
916
|
+
special: "cyan",
|
|
917
|
+
number: "yellow",
|
|
918
|
+
bigint: "yellow",
|
|
919
|
+
boolean: "yellow",
|
|
920
|
+
undefined: "grey",
|
|
921
|
+
null: "bold",
|
|
922
|
+
string: "green",
|
|
923
|
+
symbol: "green",
|
|
924
|
+
date: "magenta",
|
|
925
|
+
regexp: "red"
|
|
926
|
+
}, truncator = "\u2026";
|
|
927
|
+
function colorise(value, styleType) {
|
|
928
|
+
let color = ansiColors[styles[styleType]] || ansiColors[styleType] || "";
|
|
929
|
+
return color ? `\x1B[${color[0]}m${String(value)}\x1B[${color[1]}m` : String(value);
|
|
930
|
+
}
|
|
931
|
+
function normaliseOptions({
|
|
932
|
+
showHidden = !1,
|
|
933
|
+
depth = 2,
|
|
934
|
+
colors = !1,
|
|
935
|
+
customInspect = !0,
|
|
936
|
+
showProxy = !1,
|
|
937
|
+
maxArrayLength = 1 / 0,
|
|
938
|
+
breakLength = 1 / 0,
|
|
939
|
+
seen = [],
|
|
940
|
+
// eslint-disable-next-line no-shadow
|
|
941
|
+
truncate: truncate2 = 1 / 0,
|
|
942
|
+
stylize = String
|
|
943
|
+
} = {}, inspect3) {
|
|
944
|
+
let options = {
|
|
945
|
+
showHidden: !!showHidden,
|
|
946
|
+
depth: Number(depth),
|
|
947
|
+
colors: !!colors,
|
|
948
|
+
customInspect: !!customInspect,
|
|
949
|
+
showProxy: !!showProxy,
|
|
950
|
+
maxArrayLength: Number(maxArrayLength),
|
|
951
|
+
breakLength: Number(breakLength),
|
|
952
|
+
truncate: Number(truncate2),
|
|
953
|
+
seen,
|
|
954
|
+
inspect: inspect3,
|
|
955
|
+
stylize
|
|
956
|
+
};
|
|
957
|
+
return options.colors && (options.stylize = colorise), options;
|
|
958
|
+
}
|
|
959
|
+
function isHighSurrogate(char) {
|
|
960
|
+
return char >= "\uD800" && char <= "\uDBFF";
|
|
961
|
+
}
|
|
962
|
+
function truncate(string, length, tail = truncator) {
|
|
963
|
+
string = String(string);
|
|
964
|
+
let tailLength = tail.length, stringLength = string.length;
|
|
965
|
+
if (tailLength > length && stringLength > tailLength)
|
|
966
|
+
return tail;
|
|
967
|
+
if (stringLength > length && stringLength > tailLength) {
|
|
968
|
+
let end = length - tailLength;
|
|
969
|
+
return end > 0 && isHighSurrogate(string[end - 1]) && (end = end - 1), `${string.slice(0, end)}${tail}`;
|
|
970
|
+
}
|
|
971
|
+
return string;
|
|
972
|
+
}
|
|
973
|
+
function inspectList(list, options, inspectItem, separator = ", ") {
|
|
974
|
+
inspectItem = inspectItem || options.inspect;
|
|
975
|
+
let size = list.length;
|
|
976
|
+
if (size === 0)
|
|
977
|
+
return "";
|
|
978
|
+
let originalLength = options.truncate, output = "", peek = "", truncated = "";
|
|
979
|
+
for (let i = 0; i < size; i += 1) {
|
|
980
|
+
let last = i + 1 === list.length, secondToLast = i + 2 === list.length;
|
|
981
|
+
truncated = `${truncator}(${list.length - i})`;
|
|
982
|
+
let value = list[i];
|
|
983
|
+
options.truncate = originalLength - output.length - (last ? 0 : separator.length);
|
|
984
|
+
let string = peek || inspectItem(value, options) + (last ? "" : separator), nextLength = output.length + string.length, truncatedLength = nextLength + truncated.length;
|
|
985
|
+
if (last && nextLength > originalLength && output.length + truncated.length <= originalLength || !last && !secondToLast && truncatedLength > originalLength || (peek = last ? "" : inspectItem(list[i + 1], options) + (secondToLast ? "" : separator), !last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength))
|
|
986
|
+
break;
|
|
987
|
+
if (output += string, !last && !secondToLast && nextLength + peek.length >= originalLength) {
|
|
988
|
+
truncated = `${truncator}(${list.length - i - 1})`;
|
|
989
|
+
break;
|
|
990
|
+
}
|
|
991
|
+
truncated = "";
|
|
992
|
+
}
|
|
993
|
+
return `${output}${truncated}`;
|
|
994
|
+
}
|
|
995
|
+
function quoteComplexKey(key) {
|
|
996
|
+
return key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/) ? key : JSON.stringify(key).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
|
|
997
|
+
}
|
|
998
|
+
function inspectProperty([key, value], options) {
|
|
999
|
+
return options.truncate -= 2, typeof key == "string" ? key = quoteComplexKey(key) : typeof key != "number" && (key = `[${options.inspect(key, options)}]`), options.truncate -= key.length, value = options.inspect(value, options), `${key}: ${value}`;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
// ../node_modules/loupe/lib/array.js
|
|
1003
|
+
function inspectArray(array, options) {
|
|
1004
|
+
let nonIndexProperties = Object.keys(array).slice(array.length);
|
|
1005
|
+
if (!array.length && !nonIndexProperties.length)
|
|
1006
|
+
return "[]";
|
|
1007
|
+
options.truncate -= 4;
|
|
1008
|
+
let listContents = inspectList(array, options);
|
|
1009
|
+
options.truncate -= listContents.length;
|
|
1010
|
+
let propertyContents = "";
|
|
1011
|
+
return nonIndexProperties.length && (propertyContents = inspectList(nonIndexProperties.map((key) => [key, array[key]]), options, inspectProperty)), `[ ${listContents}${propertyContents ? `, ${propertyContents}` : ""} ]`;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
// ../node_modules/loupe/lib/typedarray.js
|
|
1015
|
+
var getArrayName = (array) => typeof Buffer == "function" && array instanceof Buffer ? "Buffer" : array[Symbol.toStringTag] ? array[Symbol.toStringTag] : array.constructor.name;
|
|
1016
|
+
function inspectTypedArray(array, options) {
|
|
1017
|
+
let name = getArrayName(array);
|
|
1018
|
+
options.truncate -= name.length + 4;
|
|
1019
|
+
let nonIndexProperties = Object.keys(array).slice(array.length);
|
|
1020
|
+
if (!array.length && !nonIndexProperties.length)
|
|
1021
|
+
return `${name}[]`;
|
|
1022
|
+
let output = "";
|
|
1023
|
+
for (let i = 0; i < array.length; i++) {
|
|
1024
|
+
let string = `${options.stylize(truncate(array[i], options.truncate), "number")}${i === array.length - 1 ? "" : ", "}`;
|
|
1025
|
+
if (options.truncate -= string.length, array[i] !== array.length && options.truncate <= 3) {
|
|
1026
|
+
output += `${truncator}(${array.length - array[i] + 1})`;
|
|
1027
|
+
break;
|
|
1028
|
+
}
|
|
1029
|
+
output += string;
|
|
1030
|
+
}
|
|
1031
|
+
let propertyContents = "";
|
|
1032
|
+
return nonIndexProperties.length && (propertyContents = inspectList(nonIndexProperties.map((key) => [key, array[key]]), options, inspectProperty)), `${name}[ ${output}${propertyContents ? `, ${propertyContents}` : ""} ]`;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
// ../node_modules/loupe/lib/date.js
|
|
1036
|
+
function inspectDate(dateObject, options) {
|
|
1037
|
+
let stringRepresentation = dateObject.toJSON();
|
|
1038
|
+
if (stringRepresentation === null)
|
|
1039
|
+
return "Invalid Date";
|
|
1040
|
+
let split = stringRepresentation.split("T"), date = split[0];
|
|
1041
|
+
return options.stylize(`${date}T${truncate(split[1], options.truncate - date.length - 1)}`, "date");
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
// ../node_modules/loupe/lib/function.js
|
|
1045
|
+
function inspectFunction(func, options) {
|
|
1046
|
+
let functionType = func[Symbol.toStringTag] || "Function", name = func.name;
|
|
1047
|
+
return name ? options.stylize(`[${functionType} ${truncate(name, options.truncate - 11)}]`, "special") : options.stylize(`[${functionType}]`, "special");
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
// ../node_modules/loupe/lib/map.js
|
|
1051
|
+
function inspectMapEntry([key, value], options) {
|
|
1052
|
+
return options.truncate -= 4, key = options.inspect(key, options), options.truncate -= key.length, value = options.inspect(value, options), `${key} => ${value}`;
|
|
1053
|
+
}
|
|
1054
|
+
function mapToEntries(map) {
|
|
1055
|
+
let entries = [];
|
|
1056
|
+
return map.forEach((value, key) => {
|
|
1057
|
+
entries.push([key, value]);
|
|
1058
|
+
}), entries;
|
|
1059
|
+
}
|
|
1060
|
+
function inspectMap(map, options) {
|
|
1061
|
+
return map.size === 0 ? "Map{}" : (options.truncate -= 7, `Map{ ${inspectList(mapToEntries(map), options, inspectMapEntry)} }`);
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
// ../node_modules/loupe/lib/number.js
|
|
1065
|
+
var isNaN = Number.isNaN || ((i) => i !== i);
|
|
1066
|
+
function inspectNumber(number, options) {
|
|
1067
|
+
return isNaN(number) ? options.stylize("NaN", "number") : number === 1 / 0 ? options.stylize("Infinity", "number") : number === -1 / 0 ? options.stylize("-Infinity", "number") : number === 0 ? options.stylize(1 / number === 1 / 0 ? "+0" : "-0", "number") : options.stylize(truncate(String(number), options.truncate), "number");
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
// ../node_modules/loupe/lib/bigint.js
|
|
1071
|
+
function inspectBigInt(number, options) {
|
|
1072
|
+
let nums = truncate(number.toString(), options.truncate - 1);
|
|
1073
|
+
return nums !== truncator && (nums += "n"), options.stylize(nums, "bigint");
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
// ../node_modules/loupe/lib/regexp.js
|
|
1077
|
+
function inspectRegExp(value, options) {
|
|
1078
|
+
let flags = value.toString().split("/")[2], sourceLength = options.truncate - (2 + flags.length), source = value.source;
|
|
1079
|
+
return options.stylize(`/${truncate(source, sourceLength)}/${flags}`, "regexp");
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
// ../node_modules/loupe/lib/set.js
|
|
1083
|
+
function arrayFromSet(set) {
|
|
1084
|
+
let values = [];
|
|
1085
|
+
return set.forEach((value) => {
|
|
1086
|
+
values.push(value);
|
|
1087
|
+
}), values;
|
|
1088
|
+
}
|
|
1089
|
+
function inspectSet(set, options) {
|
|
1090
|
+
return set.size === 0 ? "Set{}" : (options.truncate -= 7, `Set{ ${inspectList(arrayFromSet(set), options)} }`);
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
// ../node_modules/loupe/lib/string.js
|
|
1094
|
+
var stringEscapeChars = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", "g"), escapeCharacters = {
|
|
1095
|
+
"\b": "\\b",
|
|
1096
|
+
" ": "\\t",
|
|
1097
|
+
"\n": "\\n",
|
|
1098
|
+
"\f": "\\f",
|
|
1099
|
+
"\r": "\\r",
|
|
1100
|
+
"'": "\\'",
|
|
1101
|
+
"\\": "\\\\"
|
|
1102
|
+
}, hex = 16, unicodeLength = 4;
|
|
1103
|
+
function escape(char) {
|
|
1104
|
+
return escapeCharacters[char] || `\\u${`0000${char.charCodeAt(0).toString(hex)}`.slice(-unicodeLength)}`;
|
|
1105
|
+
}
|
|
1106
|
+
function inspectString(string, options) {
|
|
1107
|
+
return stringEscapeChars.test(string) && (string = string.replace(stringEscapeChars, escape)), options.stylize(`'${truncate(string, options.truncate - 2)}'`, "string");
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
// ../node_modules/loupe/lib/symbol.js
|
|
1111
|
+
function inspectSymbol(value) {
|
|
1112
|
+
return "description" in Symbol.prototype ? value.description ? `Symbol(${value.description})` : "Symbol()" : value.toString();
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
// ../node_modules/loupe/lib/promise.js
|
|
1116
|
+
var getPromiseValue = () => "Promise{\u2026}", promise_default = getPromiseValue;
|
|
1117
|
+
|
|
1118
|
+
// ../node_modules/loupe/lib/object.js
|
|
1119
|
+
function inspectObject(object, options) {
|
|
1120
|
+
let properties = Object.getOwnPropertyNames(object), symbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : [];
|
|
1121
|
+
if (properties.length === 0 && symbols.length === 0)
|
|
1122
|
+
return "{}";
|
|
1123
|
+
if (options.truncate -= 4, options.seen = options.seen || [], options.seen.includes(object))
|
|
1124
|
+
return "[Circular]";
|
|
1125
|
+
options.seen.push(object);
|
|
1126
|
+
let propertyContents = inspectList(properties.map((key) => [key, object[key]]), options, inspectProperty), symbolContents = inspectList(symbols.map((key) => [key, object[key]]), options, inspectProperty);
|
|
1127
|
+
options.seen.pop();
|
|
1128
|
+
let sep = "";
|
|
1129
|
+
return propertyContents && symbolContents && (sep = ", "), `{ ${propertyContents}${sep}${symbolContents} }`;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
// ../node_modules/loupe/lib/class.js
|
|
1133
|
+
var toStringTag = typeof Symbol < "u" && Symbol.toStringTag ? Symbol.toStringTag : !1;
|
|
1134
|
+
function inspectClass(value, options) {
|
|
1135
|
+
let name = "";
|
|
1136
|
+
return toStringTag && toStringTag in value && (name = value[toStringTag]), name = name || value.constructor.name, (!name || name === "_class") && (name = "<Anonymous Class>"), options.truncate -= name.length, `${name}${inspectObject(value, options)}`;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
// ../node_modules/loupe/lib/arguments.js
|
|
1140
|
+
function inspectArguments(args, options) {
|
|
1141
|
+
return args.length === 0 ? "Arguments[]" : (options.truncate -= 13, `Arguments[ ${inspectList(args, options)} ]`);
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
// ../node_modules/loupe/lib/error.js
|
|
1145
|
+
var errorKeys = [
|
|
1146
|
+
"stack",
|
|
1147
|
+
"line",
|
|
1148
|
+
"column",
|
|
1149
|
+
"name",
|
|
1150
|
+
"message",
|
|
1151
|
+
"fileName",
|
|
1152
|
+
"lineNumber",
|
|
1153
|
+
"columnNumber",
|
|
1154
|
+
"number",
|
|
1155
|
+
"description",
|
|
1156
|
+
"cause"
|
|
1157
|
+
];
|
|
1158
|
+
function inspectObject2(error, options) {
|
|
1159
|
+
let properties = Object.getOwnPropertyNames(error).filter((key) => errorKeys.indexOf(key) === -1), name = error.name;
|
|
1160
|
+
options.truncate -= name.length;
|
|
1161
|
+
let message = "";
|
|
1162
|
+
if (typeof error.message == "string" ? message = truncate(error.message, options.truncate) : properties.unshift("message"), message = message ? `: ${message}` : "", options.truncate -= message.length + 5, options.seen = options.seen || [], options.seen.includes(error))
|
|
1163
|
+
return "[Circular]";
|
|
1164
|
+
options.seen.push(error);
|
|
1165
|
+
let propertyContents = inspectList(properties.map((key) => [key, error[key]]), options, inspectProperty);
|
|
1166
|
+
return `${name}${message}${propertyContents ? ` { ${propertyContents} }` : ""}`;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
// ../node_modules/loupe/lib/html.js
|
|
1170
|
+
function inspectAttribute([key, value], options) {
|
|
1171
|
+
return options.truncate -= 3, value ? `${options.stylize(String(key), "yellow")}=${options.stylize(`"${value}"`, "string")}` : `${options.stylize(String(key), "yellow")}`;
|
|
1172
|
+
}
|
|
1173
|
+
function inspectNodeCollection(collection, options) {
|
|
1174
|
+
return inspectList(collection, options, inspectNode, `
|
|
1175
|
+
`);
|
|
1176
|
+
}
|
|
1177
|
+
function inspectNode(node, options) {
|
|
1178
|
+
switch (node.nodeType) {
|
|
1179
|
+
case 1:
|
|
1180
|
+
return inspectHTML(node, options);
|
|
1181
|
+
case 3:
|
|
1182
|
+
return options.inspect(node.data, options);
|
|
1183
|
+
default:
|
|
1184
|
+
return options.inspect(node, options);
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
function inspectHTML(element, options) {
|
|
1188
|
+
let properties = element.getAttributeNames(), name = element.tagName.toLowerCase(), head = options.stylize(`<${name}`, "special"), headClose = options.stylize(">", "special"), tail = options.stylize(`</${name}>`, "special");
|
|
1189
|
+
options.truncate -= name.length * 2 + 5;
|
|
1190
|
+
let propertyContents = "";
|
|
1191
|
+
properties.length > 0 && (propertyContents += " ", propertyContents += inspectList(properties.map((key) => [key, element.getAttribute(key)]), options, inspectAttribute, " ")), options.truncate -= propertyContents.length;
|
|
1192
|
+
let truncate2 = options.truncate, children = inspectNodeCollection(element.children, options);
|
|
1193
|
+
return children && children.length > truncate2 && (children = `${truncator}(${element.children.length})`), `${head}${propertyContents}${headClose}${children}${tail}`;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
// ../node_modules/loupe/lib/index.js
|
|
1197
|
+
var symbolsSupported = typeof Symbol == "function" && typeof Symbol.for == "function", chaiInspect = symbolsSupported ? Symbol.for("chai/inspect") : "@@chai/inspect", nodeInspect = Symbol.for("nodejs.util.inspect.custom"), constructorMap = /* @__PURE__ */ new WeakMap(), stringTagMap = {}, baseTypesMap = {
|
|
1198
|
+
undefined: (value, options) => options.stylize("undefined", "undefined"),
|
|
1199
|
+
null: (value, options) => options.stylize("null", "null"),
|
|
1200
|
+
boolean: (value, options) => options.stylize(String(value), "boolean"),
|
|
1201
|
+
Boolean: (value, options) => options.stylize(String(value), "boolean"),
|
|
1202
|
+
number: inspectNumber,
|
|
1203
|
+
Number: inspectNumber,
|
|
1204
|
+
bigint: inspectBigInt,
|
|
1205
|
+
BigInt: inspectBigInt,
|
|
1206
|
+
string: inspectString,
|
|
1207
|
+
String: inspectString,
|
|
1208
|
+
function: inspectFunction,
|
|
1209
|
+
Function: inspectFunction,
|
|
1210
|
+
symbol: inspectSymbol,
|
|
1211
|
+
// A Symbol polyfill will return `Symbol` not `symbol` from typedetect
|
|
1212
|
+
Symbol: inspectSymbol,
|
|
1213
|
+
Array: inspectArray,
|
|
1214
|
+
Date: inspectDate,
|
|
1215
|
+
Map: inspectMap,
|
|
1216
|
+
Set: inspectSet,
|
|
1217
|
+
RegExp: inspectRegExp,
|
|
1218
|
+
Promise: promise_default,
|
|
1219
|
+
// WeakSet, WeakMap are totally opaque to us
|
|
1220
|
+
WeakSet: (value, options) => options.stylize("WeakSet{\u2026}", "special"),
|
|
1221
|
+
WeakMap: (value, options) => options.stylize("WeakMap{\u2026}", "special"),
|
|
1222
|
+
Arguments: inspectArguments,
|
|
1223
|
+
Int8Array: inspectTypedArray,
|
|
1224
|
+
Uint8Array: inspectTypedArray,
|
|
1225
|
+
Uint8ClampedArray: inspectTypedArray,
|
|
1226
|
+
Int16Array: inspectTypedArray,
|
|
1227
|
+
Uint16Array: inspectTypedArray,
|
|
1228
|
+
Int32Array: inspectTypedArray,
|
|
1229
|
+
Uint32Array: inspectTypedArray,
|
|
1230
|
+
Float32Array: inspectTypedArray,
|
|
1231
|
+
Float64Array: inspectTypedArray,
|
|
1232
|
+
Generator: () => "",
|
|
1233
|
+
DataView: () => "",
|
|
1234
|
+
ArrayBuffer: () => "",
|
|
1235
|
+
Error: inspectObject2,
|
|
1236
|
+
HTMLCollection: inspectNodeCollection,
|
|
1237
|
+
NodeList: inspectNodeCollection
|
|
1238
|
+
}, inspectCustom = (value, options, type, inspectFn) => chaiInspect in value && typeof value[chaiInspect] == "function" ? value[chaiInspect](options) : nodeInspect in value && typeof value[nodeInspect] == "function" ? value[nodeInspect](options.depth, options, inspectFn) : "inspect" in value && typeof value.inspect == "function" ? value.inspect(options.depth, options) : "constructor" in value && constructorMap.has(value.constructor) ? constructorMap.get(value.constructor)(value, options) : stringTagMap[type] ? stringTagMap[type](value, options) : "", toString2 = Object.prototype.toString;
|
|
1239
|
+
function inspect(value, opts = {}) {
|
|
1240
|
+
let options = normaliseOptions(opts, inspect), { customInspect } = options, type = value === null ? "null" : typeof value;
|
|
1241
|
+
if (type === "object" && (type = toString2.call(value).slice(8, -1)), type in baseTypesMap)
|
|
1242
|
+
return baseTypesMap[type](value, options);
|
|
1243
|
+
if (customInspect && value) {
|
|
1244
|
+
let output = inspectCustom(value, options, type, inspect);
|
|
1245
|
+
if (output)
|
|
1246
|
+
return typeof output == "string" ? output : inspect(output, options);
|
|
1247
|
+
}
|
|
1248
|
+
let proto = value ? Object.getPrototypeOf(value) : !1;
|
|
1249
|
+
return proto === Object.prototype || proto === null ? inspectObject(value, options) : value && typeof HTMLElement == "function" && value instanceof HTMLElement ? inspectHTML(value, options) : "constructor" in value ? value.constructor !== Object ? inspectClass(value, options) : inspectObject(value, options) : value === Object(value) ? inspectObject(value, options) : options.stylize(String(value), type);
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
// ../node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js
|
|
1253
|
+
var { AsymmetricMatcher, DOMCollection, DOMElement, Immutable, ReactElement, ReactTestComponent } = plugins, PLUGINS = [
|
|
1254
|
+
ReactTestComponent,
|
|
1255
|
+
ReactElement,
|
|
1256
|
+
DOMElement,
|
|
1257
|
+
DOMCollection,
|
|
1258
|
+
Immutable,
|
|
1259
|
+
AsymmetricMatcher
|
|
1260
|
+
];
|
|
1261
|
+
function stringify(object, maxDepth = 10, { maxLength, ...options } = {}) {
|
|
1262
|
+
let MAX_LENGTH = maxLength ?? 1e4, result;
|
|
1263
|
+
try {
|
|
1264
|
+
result = format(object, {
|
|
1265
|
+
maxDepth,
|
|
1266
|
+
escapeString: !1,
|
|
1267
|
+
plugins: PLUGINS,
|
|
1268
|
+
...options
|
|
1269
|
+
});
|
|
1270
|
+
} catch {
|
|
1271
|
+
result = format(object, {
|
|
1272
|
+
callToJSON: !1,
|
|
1273
|
+
maxDepth,
|
|
1274
|
+
escapeString: !1,
|
|
1275
|
+
plugins: PLUGINS,
|
|
1276
|
+
...options
|
|
1277
|
+
});
|
|
1278
|
+
}
|
|
1279
|
+
return result.length >= MAX_LENGTH && maxDepth > 1 ? stringify(object, Math.floor(Math.min(maxDepth, Number.MAX_SAFE_INTEGER) / 2), {
|
|
1280
|
+
maxLength,
|
|
1281
|
+
...options
|
|
1282
|
+
}) : result;
|
|
1283
|
+
}
|
|
1284
|
+
var formatRegExp = /%[sdjifoOc%]/g;
|
|
1285
|
+
function format2(...args) {
|
|
1286
|
+
if (typeof args[0] != "string") {
|
|
1287
|
+
let objects = [];
|
|
1288
|
+
for (let i2 = 0; i2 < args.length; i2++)
|
|
1289
|
+
objects.push(inspect2(args[i2], {
|
|
1290
|
+
depth: 0,
|
|
1291
|
+
colors: !1
|
|
1292
|
+
}));
|
|
1293
|
+
return objects.join(" ");
|
|
1294
|
+
}
|
|
1295
|
+
let len = args.length, i = 1, template = args[0], str = String(template).replace(formatRegExp, (x) => {
|
|
1296
|
+
if (x === "%%")
|
|
1297
|
+
return "%";
|
|
1298
|
+
if (i >= len)
|
|
1299
|
+
return x;
|
|
1300
|
+
switch (x) {
|
|
1301
|
+
case "%s": {
|
|
1302
|
+
let value = args[i++];
|
|
1303
|
+
return typeof value == "bigint" ? `${value.toString()}n` : typeof value == "number" && value === 0 && 1 / value < 0 ? "-0" : typeof value == "object" && value !== null ? typeof value.toString == "function" && value.toString !== Object.prototype.toString ? value.toString() : inspect2(value, {
|
|
1304
|
+
depth: 0,
|
|
1305
|
+
colors: !1
|
|
1306
|
+
}) : String(value);
|
|
1307
|
+
}
|
|
1308
|
+
case "%d": {
|
|
1309
|
+
let value = args[i++];
|
|
1310
|
+
return typeof value == "bigint" ? `${value.toString()}n` : Number(value).toString();
|
|
1311
|
+
}
|
|
1312
|
+
case "%i": {
|
|
1313
|
+
let value = args[i++];
|
|
1314
|
+
return typeof value == "bigint" ? `${value.toString()}n` : Number.parseInt(String(value)).toString();
|
|
1315
|
+
}
|
|
1316
|
+
case "%f":
|
|
1317
|
+
return Number.parseFloat(String(args[i++])).toString();
|
|
1318
|
+
case "%o":
|
|
1319
|
+
return inspect2(args[i++], {
|
|
1320
|
+
showHidden: !0,
|
|
1321
|
+
showProxy: !0
|
|
1322
|
+
});
|
|
1323
|
+
case "%O":
|
|
1324
|
+
return inspect2(args[i++]);
|
|
1325
|
+
case "%c":
|
|
1326
|
+
return i++, "";
|
|
1327
|
+
case "%j":
|
|
1328
|
+
try {
|
|
1329
|
+
return JSON.stringify(args[i++]);
|
|
1330
|
+
} catch (err) {
|
|
1331
|
+
let m2 = err.message;
|
|
1332
|
+
if (m2.includes("circular structure") || m2.includes("cyclic structures") || m2.includes("cyclic object"))
|
|
1333
|
+
return "[Circular]";
|
|
1334
|
+
throw err;
|
|
1335
|
+
}
|
|
1336
|
+
default:
|
|
1337
|
+
return x;
|
|
1338
|
+
}
|
|
1339
|
+
});
|
|
1340
|
+
for (let x = args[i]; i < len; x = args[++i])
|
|
1341
|
+
x === null || typeof x != "object" ? str += ` ${x}` : str += ` ${inspect2(x)}`;
|
|
1342
|
+
return str;
|
|
1343
|
+
}
|
|
1344
|
+
function inspect2(obj, options = {}) {
|
|
1345
|
+
return options.truncate === 0 && (options.truncate = Number.POSITIVE_INFINITY), inspect(obj, options);
|
|
1346
|
+
}
|
|
1347
|
+
function getDefaultExportFromCjs2(x) {
|
|
1348
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
// ../node_modules/@vitest/utils/dist/helpers.js
|
|
1352
|
+
function assertTypes(value, name, types) {
|
|
1353
|
+
let receivedType = typeof value;
|
|
1354
|
+
if (!types.includes(receivedType))
|
|
1355
|
+
throw new TypeError(`${name} value must be ${types.join(" or ")}, received "${receivedType}"`);
|
|
1356
|
+
}
|
|
1357
|
+
function isObject(item) {
|
|
1358
|
+
return item != null && typeof item == "object" && !Array.isArray(item);
|
|
1359
|
+
}
|
|
1360
|
+
function isFinalObj(obj) {
|
|
1361
|
+
return obj === Object.prototype || obj === Function.prototype || obj === RegExp.prototype;
|
|
1362
|
+
}
|
|
1363
|
+
function getType2(value) {
|
|
1364
|
+
return Object.prototype.toString.apply(value).slice(8, -1);
|
|
1365
|
+
}
|
|
1366
|
+
function collectOwnProperties(obj, collector) {
|
|
1367
|
+
let collect = typeof collector == "function" ? collector : (key) => collector.add(key);
|
|
1368
|
+
Object.getOwnPropertyNames(obj).forEach(collect), Object.getOwnPropertySymbols(obj).forEach(collect);
|
|
1369
|
+
}
|
|
1370
|
+
function getOwnProperties(obj) {
|
|
1371
|
+
let ownProps = /* @__PURE__ */ new Set();
|
|
1372
|
+
return isFinalObj(obj) ? [] : (collectOwnProperties(obj, ownProps), Array.from(ownProps));
|
|
1373
|
+
}
|
|
1374
|
+
var defaultCloneOptions = { forceWritable: !1 };
|
|
1375
|
+
function deepClone(val, options = defaultCloneOptions) {
|
|
1376
|
+
return clone(val, /* @__PURE__ */ new WeakMap(), options);
|
|
1377
|
+
}
|
|
1378
|
+
function clone(val, seen, options = defaultCloneOptions) {
|
|
1379
|
+
let k, out;
|
|
1380
|
+
if (seen.has(val))
|
|
1381
|
+
return seen.get(val);
|
|
1382
|
+
if (Array.isArray(val)) {
|
|
1383
|
+
for (out = Array.from({ length: k = val.length }), seen.set(val, out); k--; )
|
|
1384
|
+
out[k] = clone(val[k], seen, options);
|
|
1385
|
+
return out;
|
|
1386
|
+
}
|
|
1387
|
+
if (Object.prototype.toString.call(val) === "[object Object]") {
|
|
1388
|
+
out = Object.create(Object.getPrototypeOf(val)), seen.set(val, out);
|
|
1389
|
+
let props = getOwnProperties(val);
|
|
1390
|
+
for (let k2 of props) {
|
|
1391
|
+
let descriptor = Object.getOwnPropertyDescriptor(val, k2);
|
|
1392
|
+
if (!descriptor)
|
|
1393
|
+
continue;
|
|
1394
|
+
let cloned = clone(val[k2], seen, options);
|
|
1395
|
+
options.forceWritable ? Object.defineProperty(out, k2, {
|
|
1396
|
+
enumerable: descriptor.enumerable,
|
|
1397
|
+
configurable: !0,
|
|
1398
|
+
writable: !0,
|
|
1399
|
+
value: cloned
|
|
1400
|
+
}) : "get" in descriptor ? Object.defineProperty(out, k2, {
|
|
1401
|
+
...descriptor,
|
|
1402
|
+
get() {
|
|
1403
|
+
return cloned;
|
|
1404
|
+
}
|
|
1405
|
+
}) : Object.defineProperty(out, k2, {
|
|
1406
|
+
...descriptor,
|
|
1407
|
+
value: cloned
|
|
1408
|
+
});
|
|
1409
|
+
}
|
|
1410
|
+
return out;
|
|
1411
|
+
}
|
|
1412
|
+
return val;
|
|
1413
|
+
}
|
|
1414
|
+
function noop() {
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
// ../node_modules/@vitest/utils/dist/diff.js
|
|
1418
|
+
var DIFF_DELETE = -1, DIFF_INSERT = 1, DIFF_EQUAL = 0, Diff = class {
|
|
1419
|
+
0;
|
|
1420
|
+
1;
|
|
1421
|
+
constructor(op, text) {
|
|
1422
|
+
this[0] = op, this[1] = text;
|
|
1423
|
+
}
|
|
1424
|
+
};
|
|
1425
|
+
function diff_commonPrefix(text1, text2) {
|
|
1426
|
+
if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0))
|
|
1427
|
+
return 0;
|
|
1428
|
+
let pointermin = 0, pointermax = Math.min(text1.length, text2.length), pointermid = pointermax, pointerstart = 0;
|
|
1429
|
+
for (; pointermin < pointermid; )
|
|
1430
|
+
text1.substring(pointerstart, pointermid) === text2.substring(pointerstart, pointermid) ? (pointermin = pointermid, pointerstart = pointermin) : pointermax = pointermid, pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
|
|
1431
|
+
return pointermid;
|
|
1432
|
+
}
|
|
1433
|
+
function diff_commonSuffix(text1, text2) {
|
|
1434
|
+
if (!text1 || !text2 || text1.charAt(text1.length - 1) !== text2.charAt(text2.length - 1))
|
|
1435
|
+
return 0;
|
|
1436
|
+
let pointermin = 0, pointermax = Math.min(text1.length, text2.length), pointermid = pointermax, pointerend = 0;
|
|
1437
|
+
for (; pointermin < pointermid; )
|
|
1438
|
+
text1.substring(text1.length - pointermid, text1.length - pointerend) === text2.substring(text2.length - pointermid, text2.length - pointerend) ? (pointermin = pointermid, pointerend = pointermin) : pointermax = pointermid, pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
|
|
1439
|
+
return pointermid;
|
|
1440
|
+
}
|
|
1441
|
+
function diff_commonOverlap_(text1, text2) {
|
|
1442
|
+
let text1_length = text1.length, text2_length = text2.length;
|
|
1443
|
+
if (text1_length === 0 || text2_length === 0)
|
|
1444
|
+
return 0;
|
|
1445
|
+
text1_length > text2_length ? text1 = text1.substring(text1_length - text2_length) : text1_length < text2_length && (text2 = text2.substring(0, text1_length));
|
|
1446
|
+
let text_length = Math.min(text1_length, text2_length);
|
|
1447
|
+
if (text1 === text2)
|
|
1448
|
+
return text_length;
|
|
1449
|
+
let best = 0, length = 1;
|
|
1450
|
+
for (; ; ) {
|
|
1451
|
+
let pattern = text1.substring(text_length - length), found = text2.indexOf(pattern);
|
|
1452
|
+
if (found === -1)
|
|
1453
|
+
return best;
|
|
1454
|
+
length += found, (found === 0 || text1.substring(text_length - length) === text2.substring(0, length)) && (best = length, length++);
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
function diff_cleanupSemantic(diffs) {
|
|
1458
|
+
let changes = !1, equalities = [], equalitiesLength = 0, lastEquality = null, pointer = 0, length_insertions1 = 0, length_deletions1 = 0, length_insertions2 = 0, length_deletions2 = 0;
|
|
1459
|
+
for (; pointer < diffs.length; )
|
|
1460
|
+
diffs[pointer][0] === DIFF_EQUAL ? (equalities[equalitiesLength++] = pointer, length_insertions1 = length_insertions2, length_deletions1 = length_deletions2, length_insertions2 = 0, length_deletions2 = 0, lastEquality = diffs[pointer][1]) : (diffs[pointer][0] === DIFF_INSERT ? length_insertions2 += diffs[pointer][1].length : length_deletions2 += diffs[pointer][1].length, lastEquality && lastEquality.length <= Math.max(length_insertions1, length_deletions1) && lastEquality.length <= Math.max(length_insertions2, length_deletions2) && (diffs.splice(equalities[equalitiesLength - 1], 0, new Diff(DIFF_DELETE, lastEquality)), diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT, equalitiesLength--, equalitiesLength--, pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1, length_insertions1 = 0, length_deletions1 = 0, length_insertions2 = 0, length_deletions2 = 0, lastEquality = null, changes = !0)), pointer++;
|
|
1461
|
+
for (changes && diff_cleanupMerge(diffs), diff_cleanupSemanticLossless(diffs), pointer = 1; pointer < diffs.length; ) {
|
|
1462
|
+
if (diffs[pointer - 1][0] === DIFF_DELETE && diffs[pointer][0] === DIFF_INSERT) {
|
|
1463
|
+
let deletion = diffs[pointer - 1][1], insertion = diffs[pointer][1], overlap_length1 = diff_commonOverlap_(deletion, insertion), overlap_length2 = diff_commonOverlap_(insertion, deletion);
|
|
1464
|
+
overlap_length1 >= overlap_length2 ? (overlap_length1 >= deletion.length / 2 || overlap_length1 >= insertion.length / 2) && (diffs.splice(pointer, 0, new Diff(DIFF_EQUAL, insertion.substring(0, overlap_length1))), diffs[pointer - 1][1] = deletion.substring(0, deletion.length - overlap_length1), diffs[pointer + 1][1] = insertion.substring(overlap_length1), pointer++) : (overlap_length2 >= deletion.length / 2 || overlap_length2 >= insertion.length / 2) && (diffs.splice(pointer, 0, new Diff(DIFF_EQUAL, deletion.substring(0, overlap_length2))), diffs[pointer - 1][0] = DIFF_INSERT, diffs[pointer - 1][1] = insertion.substring(0, insertion.length - overlap_length2), diffs[pointer + 1][0] = DIFF_DELETE, diffs[pointer + 1][1] = deletion.substring(overlap_length2), pointer++), pointer++;
|
|
1465
|
+
}
|
|
1466
|
+
pointer++;
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
var nonAlphaNumericRegex_ = /[^a-z0-9]/i, whitespaceRegex_ = /\s/, linebreakRegex_ = /[\r\n]/, blanklineEndRegex_ = /\n\r?\n$/, blanklineStartRegex_ = /^\r?\n\r?\n/;
|
|
1470
|
+
function diff_cleanupSemanticLossless(diffs) {
|
|
1471
|
+
let pointer = 1;
|
|
1472
|
+
for (; pointer < diffs.length - 1; ) {
|
|
1473
|
+
if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) {
|
|
1474
|
+
let equality1 = diffs[pointer - 1][1], edit = diffs[pointer][1], equality2 = diffs[pointer + 1][1], commonOffset = diff_commonSuffix(equality1, edit);
|
|
1475
|
+
if (commonOffset) {
|
|
1476
|
+
let commonString = edit.substring(edit.length - commonOffset);
|
|
1477
|
+
equality1 = equality1.substring(0, equality1.length - commonOffset), edit = commonString + edit.substring(0, edit.length - commonOffset), equality2 = commonString + equality2;
|
|
1478
|
+
}
|
|
1479
|
+
let bestEquality1 = equality1, bestEdit = edit, bestEquality2 = equality2, bestScore = diff_cleanupSemanticScore_(equality1, edit) + diff_cleanupSemanticScore_(edit, equality2);
|
|
1480
|
+
for (; edit.charAt(0) === equality2.charAt(0); ) {
|
|
1481
|
+
equality1 += edit.charAt(0), edit = edit.substring(1) + equality2.charAt(0), equality2 = equality2.substring(1);
|
|
1482
|
+
let score = diff_cleanupSemanticScore_(equality1, edit) + diff_cleanupSemanticScore_(edit, equality2);
|
|
1483
|
+
score >= bestScore && (bestScore = score, bestEquality1 = equality1, bestEdit = edit, bestEquality2 = equality2);
|
|
1484
|
+
}
|
|
1485
|
+
diffs[pointer - 1][1] !== bestEquality1 && (bestEquality1 ? diffs[pointer - 1][1] = bestEquality1 : (diffs.splice(pointer - 1, 1), pointer--), diffs[pointer][1] = bestEdit, bestEquality2 ? diffs[pointer + 1][1] = bestEquality2 : (diffs.splice(pointer + 1, 1), pointer--));
|
|
1486
|
+
}
|
|
1487
|
+
pointer++;
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
function diff_cleanupMerge(diffs) {
|
|
1491
|
+
diffs.push(new Diff(DIFF_EQUAL, ""));
|
|
1492
|
+
let pointer = 0, count_delete = 0, count_insert = 0, text_delete = "", text_insert = "", commonlength;
|
|
1493
|
+
for (; pointer < diffs.length; )
|
|
1494
|
+
switch (diffs[pointer][0]) {
|
|
1495
|
+
case DIFF_INSERT:
|
|
1496
|
+
count_insert++, text_insert += diffs[pointer][1], pointer++;
|
|
1497
|
+
break;
|
|
1498
|
+
case DIFF_DELETE:
|
|
1499
|
+
count_delete++, text_delete += diffs[pointer][1], pointer++;
|
|
1500
|
+
break;
|
|
1501
|
+
case DIFF_EQUAL:
|
|
1502
|
+
count_delete + count_insert > 1 ? (count_delete !== 0 && count_insert !== 0 && (commonlength = diff_commonPrefix(text_insert, text_delete), commonlength !== 0 && (pointer - count_delete - count_insert > 0 && diffs[pointer - count_delete - count_insert - 1][0] === DIFF_EQUAL ? diffs[pointer - count_delete - count_insert - 1][1] += text_insert.substring(0, commonlength) : (diffs.splice(0, 0, new Diff(DIFF_EQUAL, text_insert.substring(0, commonlength))), pointer++), text_insert = text_insert.substring(commonlength), text_delete = text_delete.substring(commonlength)), commonlength = diff_commonSuffix(text_insert, text_delete), commonlength !== 0 && (diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1], text_insert = text_insert.substring(0, text_insert.length - commonlength), text_delete = text_delete.substring(0, text_delete.length - commonlength))), pointer -= count_delete + count_insert, diffs.splice(pointer, count_delete + count_insert), text_delete.length && (diffs.splice(pointer, 0, new Diff(DIFF_DELETE, text_delete)), pointer++), text_insert.length && (diffs.splice(pointer, 0, new Diff(DIFF_INSERT, text_insert)), pointer++), pointer++) : pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL ? (diffs[pointer - 1][1] += diffs[pointer][1], diffs.splice(pointer, 1)) : pointer++, count_insert = 0, count_delete = 0, text_delete = "", text_insert = "";
|
|
1503
|
+
break;
|
|
1504
|
+
}
|
|
1505
|
+
diffs[diffs.length - 1][1] === "" && diffs.pop();
|
|
1506
|
+
let changes = !1;
|
|
1507
|
+
for (pointer = 1; pointer < diffs.length - 1; )
|
|
1508
|
+
diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL && (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) === diffs[pointer - 1][1] ? (diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length), diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1], diffs.splice(pointer - 1, 1), changes = !0) : diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) === diffs[pointer + 1][1] && (diffs[pointer - 1][1] += diffs[pointer + 1][1], diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1], diffs.splice(pointer + 1, 1), changes = !0)), pointer++;
|
|
1509
|
+
changes && diff_cleanupMerge(diffs);
|
|
1510
|
+
}
|
|
1511
|
+
function diff_cleanupSemanticScore_(one, two) {
|
|
1512
|
+
if (!one || !two)
|
|
1513
|
+
return 6;
|
|
1514
|
+
let char1 = one.charAt(one.length - 1), char2 = two.charAt(0), nonAlphaNumeric1 = char1.match(nonAlphaNumericRegex_), nonAlphaNumeric2 = char2.match(nonAlphaNumericRegex_), whitespace1 = nonAlphaNumeric1 && char1.match(whitespaceRegex_), whitespace2 = nonAlphaNumeric2 && char2.match(whitespaceRegex_), lineBreak1 = whitespace1 && char1.match(linebreakRegex_), lineBreak2 = whitespace2 && char2.match(linebreakRegex_), blankLine1 = lineBreak1 && one.match(blanklineEndRegex_), blankLine2 = lineBreak2 && two.match(blanklineStartRegex_);
|
|
1515
|
+
return blankLine1 || blankLine2 ? 5 : lineBreak1 || lineBreak2 ? 4 : nonAlphaNumeric1 && !whitespace1 && whitespace2 ? 3 : whitespace1 || whitespace2 ? 2 : nonAlphaNumeric1 || nonAlphaNumeric2 ? 1 : 0;
|
|
1516
|
+
}
|
|
1517
|
+
var NO_DIFF_MESSAGE = "Compared values have no visual difference.", SIMILAR_MESSAGE = "Compared values serialize to the same structure.\nPrinting internal object structure without calling `toJSON` instead.", build = {}, hasRequiredBuild;
|
|
1518
|
+
function requireBuild() {
|
|
1519
|
+
if (hasRequiredBuild) return build;
|
|
1520
|
+
hasRequiredBuild = 1, Object.defineProperty(build, "__esModule", {
|
|
1521
|
+
value: !0
|
|
1522
|
+
}), build.default = diffSequence;
|
|
1523
|
+
let pkg = "diff-sequences", NOT_YET_SET = 0, countCommonItemsF = (aIndex, aEnd, bIndex, bEnd, isCommon) => {
|
|
1524
|
+
let nCommon = 0;
|
|
1525
|
+
for (; aIndex < aEnd && bIndex < bEnd && isCommon(aIndex, bIndex); )
|
|
1526
|
+
aIndex += 1, bIndex += 1, nCommon += 1;
|
|
1527
|
+
return nCommon;
|
|
1528
|
+
}, countCommonItemsR = (aStart, aIndex, bStart, bIndex, isCommon) => {
|
|
1529
|
+
let nCommon = 0;
|
|
1530
|
+
for (; aStart <= aIndex && bStart <= bIndex && isCommon(aIndex, bIndex); )
|
|
1531
|
+
aIndex -= 1, bIndex -= 1, nCommon += 1;
|
|
1532
|
+
return nCommon;
|
|
1533
|
+
}, extendPathsF = (d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF) => {
|
|
1534
|
+
let iF = 0, kF = -d, aFirst = aIndexesF[iF], aIndexPrev1 = aFirst;
|
|
1535
|
+
aIndexesF[iF] += countCommonItemsF(
|
|
1536
|
+
aFirst + 1,
|
|
1537
|
+
aEnd,
|
|
1538
|
+
bF + aFirst - kF + 1,
|
|
1539
|
+
bEnd,
|
|
1540
|
+
isCommon
|
|
1541
|
+
);
|
|
1542
|
+
let nF = d < iMaxF ? d : iMaxF;
|
|
1543
|
+
for (iF += 1, kF += 2; iF <= nF; iF += 1, kF += 2) {
|
|
1544
|
+
if (iF !== d && aIndexPrev1 < aIndexesF[iF])
|
|
1545
|
+
aFirst = aIndexesF[iF];
|
|
1546
|
+
else if (aFirst = aIndexPrev1 + 1, aEnd <= aFirst)
|
|
1547
|
+
return iF - 1;
|
|
1548
|
+
aIndexPrev1 = aIndexesF[iF], aIndexesF[iF] = aFirst + countCommonItemsF(aFirst + 1, aEnd, bF + aFirst - kF + 1, bEnd, isCommon);
|
|
1549
|
+
}
|
|
1550
|
+
return iMaxF;
|
|
1551
|
+
}, extendPathsR = (d, aStart, bStart, bR, isCommon, aIndexesR, iMaxR) => {
|
|
1552
|
+
let iR = 0, kR = d, aFirst = aIndexesR[iR], aIndexPrev1 = aFirst;
|
|
1553
|
+
aIndexesR[iR] -= countCommonItemsR(
|
|
1554
|
+
aStart,
|
|
1555
|
+
aFirst - 1,
|
|
1556
|
+
bStart,
|
|
1557
|
+
bR + aFirst - kR - 1,
|
|
1558
|
+
isCommon
|
|
1559
|
+
);
|
|
1560
|
+
let nR = d < iMaxR ? d : iMaxR;
|
|
1561
|
+
for (iR += 1, kR -= 2; iR <= nR; iR += 1, kR -= 2) {
|
|
1562
|
+
if (iR !== d && aIndexesR[iR] < aIndexPrev1)
|
|
1563
|
+
aFirst = aIndexesR[iR];
|
|
1564
|
+
else if (aFirst = aIndexPrev1 - 1, aFirst < aStart)
|
|
1565
|
+
return iR - 1;
|
|
1566
|
+
aIndexPrev1 = aIndexesR[iR], aIndexesR[iR] = aFirst - countCommonItemsR(
|
|
1567
|
+
aStart,
|
|
1568
|
+
aFirst - 1,
|
|
1569
|
+
bStart,
|
|
1570
|
+
bR + aFirst - kR - 1,
|
|
1571
|
+
isCommon
|
|
1572
|
+
);
|
|
1573
|
+
}
|
|
1574
|
+
return iMaxR;
|
|
1575
|
+
}, extendOverlappablePathsF = (d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division) => {
|
|
1576
|
+
let bF = bStart - aStart, aLength = aEnd - aStart, baDeltaLength = bEnd - bStart - aLength, kMinOverlapF = -baDeltaLength - (d - 1), kMaxOverlapF = -baDeltaLength + (d - 1), aIndexPrev1 = NOT_YET_SET, nF = d < iMaxF ? d : iMaxF;
|
|
1577
|
+
for (let iF = 0, kF = -d; iF <= nF; iF += 1, kF += 2) {
|
|
1578
|
+
let insert = iF === 0 || iF !== d && aIndexPrev1 < aIndexesF[iF], aLastPrev = insert ? aIndexesF[iF] : aIndexPrev1, aFirst = insert ? aLastPrev : aLastPrev + 1, bFirst = bF + aFirst - kF, nCommonF = countCommonItemsF(
|
|
1579
|
+
aFirst + 1,
|
|
1580
|
+
aEnd,
|
|
1581
|
+
bFirst + 1,
|
|
1582
|
+
bEnd,
|
|
1583
|
+
isCommon
|
|
1584
|
+
), aLast = aFirst + nCommonF;
|
|
1585
|
+
if (aIndexPrev1 = aIndexesF[iF], aIndexesF[iF] = aLast, kMinOverlapF <= kF && kF <= kMaxOverlapF) {
|
|
1586
|
+
let iR = (d - 1 - (kF + baDeltaLength)) / 2;
|
|
1587
|
+
if (iR <= iMaxR && aIndexesR[iR] - 1 <= aLast) {
|
|
1588
|
+
let bLastPrev = bF + aLastPrev - (insert ? kF + 1 : kF - 1), nCommonR = countCommonItemsR(
|
|
1589
|
+
aStart,
|
|
1590
|
+
aLastPrev,
|
|
1591
|
+
bStart,
|
|
1592
|
+
bLastPrev,
|
|
1593
|
+
isCommon
|
|
1594
|
+
), aIndexPrevFirst = aLastPrev - nCommonR, bIndexPrevFirst = bLastPrev - nCommonR, aEndPreceding = aIndexPrevFirst + 1, bEndPreceding = bIndexPrevFirst + 1;
|
|
1595
|
+
division.nChangePreceding = d - 1, d - 1 === aEndPreceding + bEndPreceding - aStart - bStart ? (division.aEndPreceding = aStart, division.bEndPreceding = bStart) : (division.aEndPreceding = aEndPreceding, division.bEndPreceding = bEndPreceding), division.nCommonPreceding = nCommonR, nCommonR !== 0 && (division.aCommonPreceding = aEndPreceding, division.bCommonPreceding = bEndPreceding), division.nCommonFollowing = nCommonF, nCommonF !== 0 && (division.aCommonFollowing = aFirst + 1, division.bCommonFollowing = bFirst + 1);
|
|
1596
|
+
let aStartFollowing = aLast + 1, bStartFollowing = bFirst + nCommonF + 1;
|
|
1597
|
+
return division.nChangeFollowing = d - 1, d - 1 === aEnd + bEnd - aStartFollowing - bStartFollowing ? (division.aStartFollowing = aEnd, division.bStartFollowing = bEnd) : (division.aStartFollowing = aStartFollowing, division.bStartFollowing = bStartFollowing), !0;
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
return !1;
|
|
1602
|
+
}, extendOverlappablePathsR = (d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division) => {
|
|
1603
|
+
let bR = bEnd - aEnd, aLength = aEnd - aStart, baDeltaLength = bEnd - bStart - aLength, kMinOverlapR = baDeltaLength - d, kMaxOverlapR = baDeltaLength + d, aIndexPrev1 = NOT_YET_SET, nR = d < iMaxR ? d : iMaxR;
|
|
1604
|
+
for (let iR = 0, kR = d; iR <= nR; iR += 1, kR -= 2) {
|
|
1605
|
+
let insert = iR === 0 || iR !== d && aIndexesR[iR] < aIndexPrev1, aLastPrev = insert ? aIndexesR[iR] : aIndexPrev1, aFirst = insert ? aLastPrev : aLastPrev - 1, bFirst = bR + aFirst - kR, nCommonR = countCommonItemsR(
|
|
1606
|
+
aStart,
|
|
1607
|
+
aFirst - 1,
|
|
1608
|
+
bStart,
|
|
1609
|
+
bFirst - 1,
|
|
1610
|
+
isCommon
|
|
1611
|
+
), aLast = aFirst - nCommonR;
|
|
1612
|
+
if (aIndexPrev1 = aIndexesR[iR], aIndexesR[iR] = aLast, kMinOverlapR <= kR && kR <= kMaxOverlapR) {
|
|
1613
|
+
let iF = (d + (kR - baDeltaLength)) / 2;
|
|
1614
|
+
if (iF <= iMaxF && aLast - 1 <= aIndexesF[iF]) {
|
|
1615
|
+
let bLast = bFirst - nCommonR;
|
|
1616
|
+
if (division.nChangePreceding = d, d === aLast + bLast - aStart - bStart ? (division.aEndPreceding = aStart, division.bEndPreceding = bStart) : (division.aEndPreceding = aLast, division.bEndPreceding = bLast), division.nCommonPreceding = nCommonR, nCommonR !== 0 && (division.aCommonPreceding = aLast, division.bCommonPreceding = bLast), division.nChangeFollowing = d - 1, d === 1)
|
|
1617
|
+
division.nCommonFollowing = 0, division.aStartFollowing = aEnd, division.bStartFollowing = bEnd;
|
|
1618
|
+
else {
|
|
1619
|
+
let bLastPrev = bR + aLastPrev - (insert ? kR - 1 : kR + 1), nCommonF = countCommonItemsF(
|
|
1620
|
+
aLastPrev,
|
|
1621
|
+
aEnd,
|
|
1622
|
+
bLastPrev,
|
|
1623
|
+
bEnd,
|
|
1624
|
+
isCommon
|
|
1625
|
+
);
|
|
1626
|
+
division.nCommonFollowing = nCommonF, nCommonF !== 0 && (division.aCommonFollowing = aLastPrev, division.bCommonFollowing = bLastPrev);
|
|
1627
|
+
let aStartFollowing = aLastPrev + nCommonF, bStartFollowing = bLastPrev + nCommonF;
|
|
1628
|
+
d - 1 === aEnd + bEnd - aStartFollowing - bStartFollowing ? (division.aStartFollowing = aEnd, division.bStartFollowing = bEnd) : (division.aStartFollowing = aStartFollowing, division.bStartFollowing = bStartFollowing);
|
|
1629
|
+
}
|
|
1630
|
+
return !0;
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
return !1;
|
|
1635
|
+
}, divide = (nChange, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, aIndexesR, division) => {
|
|
1636
|
+
let bF = bStart - aStart, bR = bEnd - aEnd, aLength = aEnd - aStart, bLength = bEnd - bStart, baDeltaLength = bLength - aLength, iMaxF = aLength, iMaxR = aLength;
|
|
1637
|
+
if (aIndexesF[0] = aStart - 1, aIndexesR[0] = aEnd, baDeltaLength % 2 === 0) {
|
|
1638
|
+
let dMin = (nChange || baDeltaLength) / 2, dMax = (aLength + bLength) / 2;
|
|
1639
|
+
for (let d = 1; d <= dMax; d += 1)
|
|
1640
|
+
if (iMaxF = extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF), d < dMin)
|
|
1641
|
+
iMaxR = extendPathsR(d, aStart, bStart, bR, isCommon, aIndexesR, iMaxR);
|
|
1642
|
+
else if (
|
|
1643
|
+
// If a reverse path overlaps a forward path in the same diagonal,
|
|
1644
|
+
// return a division of the index intervals at the middle change.
|
|
1645
|
+
extendOverlappablePathsR(
|
|
1646
|
+
d,
|
|
1647
|
+
aStart,
|
|
1648
|
+
aEnd,
|
|
1649
|
+
bStart,
|
|
1650
|
+
bEnd,
|
|
1651
|
+
isCommon,
|
|
1652
|
+
aIndexesF,
|
|
1653
|
+
iMaxF,
|
|
1654
|
+
aIndexesR,
|
|
1655
|
+
iMaxR,
|
|
1656
|
+
division
|
|
1657
|
+
)
|
|
1658
|
+
)
|
|
1659
|
+
return;
|
|
1660
|
+
} else {
|
|
1661
|
+
let dMin = ((nChange || baDeltaLength) + 1) / 2, dMax = (aLength + bLength + 1) / 2, d = 1;
|
|
1662
|
+
for (iMaxF = extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF), d += 1; d <= dMax; d += 1)
|
|
1663
|
+
if (iMaxR = extendPathsR(
|
|
1664
|
+
d - 1,
|
|
1665
|
+
aStart,
|
|
1666
|
+
bStart,
|
|
1667
|
+
bR,
|
|
1668
|
+
isCommon,
|
|
1669
|
+
aIndexesR,
|
|
1670
|
+
iMaxR
|
|
1671
|
+
), d < dMin)
|
|
1672
|
+
iMaxF = extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF);
|
|
1673
|
+
else if (
|
|
1674
|
+
// If a forward path overlaps a reverse path in the same diagonal,
|
|
1675
|
+
// return a division of the index intervals at the middle change.
|
|
1676
|
+
extendOverlappablePathsF(
|
|
1677
|
+
d,
|
|
1678
|
+
aStart,
|
|
1679
|
+
aEnd,
|
|
1680
|
+
bStart,
|
|
1681
|
+
bEnd,
|
|
1682
|
+
isCommon,
|
|
1683
|
+
aIndexesF,
|
|
1684
|
+
iMaxF,
|
|
1685
|
+
aIndexesR,
|
|
1686
|
+
iMaxR,
|
|
1687
|
+
division
|
|
1688
|
+
)
|
|
1689
|
+
)
|
|
1690
|
+
return;
|
|
1691
|
+
}
|
|
1692
|
+
throw new Error(
|
|
1693
|
+
`${pkg}: no overlap aStart=${aStart} aEnd=${aEnd} bStart=${bStart} bEnd=${bEnd}`
|
|
1694
|
+
);
|
|
1695
|
+
}, findSubsequences = (nChange, aStart, aEnd, bStart, bEnd, transposed, callbacks, aIndexesF, aIndexesR, division) => {
|
|
1696
|
+
if (bEnd - bStart < aEnd - aStart) {
|
|
1697
|
+
if (transposed = !transposed, transposed && callbacks.length === 1) {
|
|
1698
|
+
let { foundSubsequence: foundSubsequence2, isCommon: isCommon2 } = callbacks[0];
|
|
1699
|
+
callbacks[1] = {
|
|
1700
|
+
foundSubsequence: (nCommon, bCommon, aCommon) => {
|
|
1701
|
+
foundSubsequence2(nCommon, aCommon, bCommon);
|
|
1702
|
+
},
|
|
1703
|
+
isCommon: (bIndex, aIndex) => isCommon2(aIndex, bIndex)
|
|
1704
|
+
};
|
|
1705
|
+
}
|
|
1706
|
+
let tStart = aStart, tEnd = aEnd;
|
|
1707
|
+
aStart = bStart, aEnd = bEnd, bStart = tStart, bEnd = tEnd;
|
|
1708
|
+
}
|
|
1709
|
+
let { foundSubsequence, isCommon } = callbacks[transposed ? 1 : 0];
|
|
1710
|
+
divide(
|
|
1711
|
+
nChange,
|
|
1712
|
+
aStart,
|
|
1713
|
+
aEnd,
|
|
1714
|
+
bStart,
|
|
1715
|
+
bEnd,
|
|
1716
|
+
isCommon,
|
|
1717
|
+
aIndexesF,
|
|
1718
|
+
aIndexesR,
|
|
1719
|
+
division
|
|
1720
|
+
);
|
|
1721
|
+
let {
|
|
1722
|
+
nChangePreceding,
|
|
1723
|
+
aEndPreceding,
|
|
1724
|
+
bEndPreceding,
|
|
1725
|
+
nCommonPreceding,
|
|
1726
|
+
aCommonPreceding,
|
|
1727
|
+
bCommonPreceding,
|
|
1728
|
+
nCommonFollowing,
|
|
1729
|
+
aCommonFollowing,
|
|
1730
|
+
bCommonFollowing,
|
|
1731
|
+
nChangeFollowing,
|
|
1732
|
+
aStartFollowing,
|
|
1733
|
+
bStartFollowing
|
|
1734
|
+
} = division;
|
|
1735
|
+
aStart < aEndPreceding && bStart < bEndPreceding && findSubsequences(
|
|
1736
|
+
nChangePreceding,
|
|
1737
|
+
aStart,
|
|
1738
|
+
aEndPreceding,
|
|
1739
|
+
bStart,
|
|
1740
|
+
bEndPreceding,
|
|
1741
|
+
transposed,
|
|
1742
|
+
callbacks,
|
|
1743
|
+
aIndexesF,
|
|
1744
|
+
aIndexesR,
|
|
1745
|
+
division
|
|
1746
|
+
), nCommonPreceding !== 0 && foundSubsequence(nCommonPreceding, aCommonPreceding, bCommonPreceding), nCommonFollowing !== 0 && foundSubsequence(nCommonFollowing, aCommonFollowing, bCommonFollowing), aStartFollowing < aEnd && bStartFollowing < bEnd && findSubsequences(
|
|
1747
|
+
nChangeFollowing,
|
|
1748
|
+
aStartFollowing,
|
|
1749
|
+
aEnd,
|
|
1750
|
+
bStartFollowing,
|
|
1751
|
+
bEnd,
|
|
1752
|
+
transposed,
|
|
1753
|
+
callbacks,
|
|
1754
|
+
aIndexesF,
|
|
1755
|
+
aIndexesR,
|
|
1756
|
+
division
|
|
1757
|
+
);
|
|
1758
|
+
}, validateLength = (name, arg) => {
|
|
1759
|
+
if (typeof arg != "number")
|
|
1760
|
+
throw new TypeError(`${pkg}: ${name} typeof ${typeof arg} is not a number`);
|
|
1761
|
+
if (!Number.isSafeInteger(arg))
|
|
1762
|
+
throw new RangeError(`${pkg}: ${name} value ${arg} is not a safe integer`);
|
|
1763
|
+
if (arg < 0)
|
|
1764
|
+
throw new RangeError(`${pkg}: ${name} value ${arg} is a negative integer`);
|
|
1765
|
+
}, validateCallback = (name, arg) => {
|
|
1766
|
+
let type = typeof arg;
|
|
1767
|
+
if (type !== "function")
|
|
1768
|
+
throw new TypeError(`${pkg}: ${name} typeof ${type} is not a function`);
|
|
1769
|
+
};
|
|
1770
|
+
function diffSequence(aLength, bLength, isCommon, foundSubsequence) {
|
|
1771
|
+
validateLength("aLength", aLength), validateLength("bLength", bLength), validateCallback("isCommon", isCommon), validateCallback("foundSubsequence", foundSubsequence);
|
|
1772
|
+
let nCommonF = countCommonItemsF(0, aLength, 0, bLength, isCommon);
|
|
1773
|
+
if (nCommonF !== 0 && foundSubsequence(nCommonF, 0, 0), aLength !== nCommonF || bLength !== nCommonF) {
|
|
1774
|
+
let aStart = nCommonF, bStart = nCommonF, nCommonR = countCommonItemsR(
|
|
1775
|
+
aStart,
|
|
1776
|
+
aLength - 1,
|
|
1777
|
+
bStart,
|
|
1778
|
+
bLength - 1,
|
|
1779
|
+
isCommon
|
|
1780
|
+
), aEnd = aLength - nCommonR, bEnd = bLength - nCommonR, nCommonFR = nCommonF + nCommonR;
|
|
1781
|
+
aLength !== nCommonFR && bLength !== nCommonFR && findSubsequences(
|
|
1782
|
+
0,
|
|
1783
|
+
aStart,
|
|
1784
|
+
aEnd,
|
|
1785
|
+
bStart,
|
|
1786
|
+
bEnd,
|
|
1787
|
+
!1,
|
|
1788
|
+
[
|
|
1789
|
+
{
|
|
1790
|
+
foundSubsequence,
|
|
1791
|
+
isCommon
|
|
1792
|
+
}
|
|
1793
|
+
],
|
|
1794
|
+
[NOT_YET_SET],
|
|
1795
|
+
[NOT_YET_SET],
|
|
1796
|
+
{
|
|
1797
|
+
aCommonFollowing: NOT_YET_SET,
|
|
1798
|
+
aCommonPreceding: NOT_YET_SET,
|
|
1799
|
+
aEndPreceding: NOT_YET_SET,
|
|
1800
|
+
aStartFollowing: NOT_YET_SET,
|
|
1801
|
+
bCommonFollowing: NOT_YET_SET,
|
|
1802
|
+
bCommonPreceding: NOT_YET_SET,
|
|
1803
|
+
bEndPreceding: NOT_YET_SET,
|
|
1804
|
+
bStartFollowing: NOT_YET_SET,
|
|
1805
|
+
nChangeFollowing: NOT_YET_SET,
|
|
1806
|
+
nChangePreceding: NOT_YET_SET,
|
|
1807
|
+
nCommonFollowing: NOT_YET_SET,
|
|
1808
|
+
nCommonPreceding: NOT_YET_SET
|
|
1809
|
+
}
|
|
1810
|
+
), nCommonR !== 0 && foundSubsequence(nCommonR, aEnd, bEnd);
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
return build;
|
|
1814
|
+
}
|
|
1815
|
+
var buildExports = requireBuild(), diffSequences = getDefaultExportFromCjs2(buildExports);
|
|
1816
|
+
function formatTrailingSpaces(line, trailingSpaceFormatter) {
|
|
1817
|
+
return line.replace(/\s+$/, (match) => trailingSpaceFormatter(match));
|
|
1818
|
+
}
|
|
1819
|
+
function printDiffLine(line, isFirstOrLast, color, indicator, trailingSpaceFormatter, emptyFirstOrLastLinePlaceholder) {
|
|
1820
|
+
return line.length !== 0 ? color(`${indicator} ${formatTrailingSpaces(line, trailingSpaceFormatter)}`) : indicator !== " " ? color(indicator) : isFirstOrLast && emptyFirstOrLastLinePlaceholder.length !== 0 ? color(`${indicator} ${emptyFirstOrLastLinePlaceholder}`) : "";
|
|
1821
|
+
}
|
|
1822
|
+
function printDeleteLine(line, isFirstOrLast, { aColor, aIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder }) {
|
|
1823
|
+
return printDiffLine(line, isFirstOrLast, aColor, aIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder);
|
|
1824
|
+
}
|
|
1825
|
+
function printInsertLine(line, isFirstOrLast, { bColor, bIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder }) {
|
|
1826
|
+
return printDiffLine(line, isFirstOrLast, bColor, bIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder);
|
|
1827
|
+
}
|
|
1828
|
+
function printCommonLine(line, isFirstOrLast, { commonColor, commonIndicator, commonLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder }) {
|
|
1829
|
+
return printDiffLine(line, isFirstOrLast, commonColor, commonIndicator, commonLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder);
|
|
1830
|
+
}
|
|
1831
|
+
function createPatchMark(aStart, aEnd, bStart, bEnd, { patchColor }) {
|
|
1832
|
+
return patchColor(`@@ -${aStart + 1},${aEnd - aStart} +${bStart + 1},${bEnd - bStart} @@`);
|
|
1833
|
+
}
|
|
1834
|
+
function joinAlignedDiffsNoExpand(diffs, options) {
|
|
1835
|
+
let iLength = diffs.length, nContextLines = options.contextLines, nContextLines2 = nContextLines + nContextLines, jLength = iLength, hasExcessAtStartOrEnd = !1, nExcessesBetweenChanges = 0, i = 0;
|
|
1836
|
+
for (; i !== iLength; ) {
|
|
1837
|
+
let iStart = i;
|
|
1838
|
+
for (; i !== iLength && diffs[i][0] === DIFF_EQUAL; )
|
|
1839
|
+
i += 1;
|
|
1840
|
+
if (iStart !== i)
|
|
1841
|
+
if (iStart === 0)
|
|
1842
|
+
i > nContextLines && (jLength -= i - nContextLines, hasExcessAtStartOrEnd = !0);
|
|
1843
|
+
else if (i === iLength) {
|
|
1844
|
+
let n = i - iStart;
|
|
1845
|
+
n > nContextLines && (jLength -= n - nContextLines, hasExcessAtStartOrEnd = !0);
|
|
1846
|
+
} else {
|
|
1847
|
+
let n = i - iStart;
|
|
1848
|
+
n > nContextLines2 && (jLength -= n - nContextLines2, nExcessesBetweenChanges += 1);
|
|
1849
|
+
}
|
|
1850
|
+
for (; i !== iLength && diffs[i][0] !== DIFF_EQUAL; )
|
|
1851
|
+
i += 1;
|
|
1852
|
+
}
|
|
1853
|
+
let hasPatch = nExcessesBetweenChanges !== 0 || hasExcessAtStartOrEnd;
|
|
1854
|
+
nExcessesBetweenChanges !== 0 ? jLength += nExcessesBetweenChanges + 1 : hasExcessAtStartOrEnd && (jLength += 1);
|
|
1855
|
+
let jLast = jLength - 1, lines = [], jPatchMark = 0;
|
|
1856
|
+
hasPatch && lines.push("");
|
|
1857
|
+
let aStart = 0, bStart = 0, aEnd = 0, bEnd = 0, pushCommonLine = (line) => {
|
|
1858
|
+
let j = lines.length;
|
|
1859
|
+
lines.push(printCommonLine(line, j === 0 || j === jLast, options)), aEnd += 1, bEnd += 1;
|
|
1860
|
+
}, pushDeleteLine = (line) => {
|
|
1861
|
+
let j = lines.length;
|
|
1862
|
+
lines.push(printDeleteLine(line, j === 0 || j === jLast, options)), aEnd += 1;
|
|
1863
|
+
}, pushInsertLine = (line) => {
|
|
1864
|
+
let j = lines.length;
|
|
1865
|
+
lines.push(printInsertLine(line, j === 0 || j === jLast, options)), bEnd += 1;
|
|
1866
|
+
};
|
|
1867
|
+
for (i = 0; i !== iLength; ) {
|
|
1868
|
+
let iStart = i;
|
|
1869
|
+
for (; i !== iLength && diffs[i][0] === DIFF_EQUAL; )
|
|
1870
|
+
i += 1;
|
|
1871
|
+
if (iStart !== i)
|
|
1872
|
+
if (iStart === 0) {
|
|
1873
|
+
i > nContextLines && (iStart = i - nContextLines, aStart = iStart, bStart = iStart, aEnd = aStart, bEnd = bStart);
|
|
1874
|
+
for (let iCommon = iStart; iCommon !== i; iCommon += 1)
|
|
1875
|
+
pushCommonLine(diffs[iCommon][1]);
|
|
1876
|
+
} else if (i === iLength) {
|
|
1877
|
+
let iEnd = i - iStart > nContextLines ? iStart + nContextLines : i;
|
|
1878
|
+
for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1)
|
|
1879
|
+
pushCommonLine(diffs[iCommon][1]);
|
|
1880
|
+
} else {
|
|
1881
|
+
let nCommon = i - iStart;
|
|
1882
|
+
if (nCommon > nContextLines2) {
|
|
1883
|
+
let iEnd = iStart + nContextLines;
|
|
1884
|
+
for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1)
|
|
1885
|
+
pushCommonLine(diffs[iCommon][1]);
|
|
1886
|
+
lines[jPatchMark] = createPatchMark(aStart, aEnd, bStart, bEnd, options), jPatchMark = lines.length, lines.push("");
|
|
1887
|
+
let nOmit = nCommon - nContextLines2;
|
|
1888
|
+
aStart = aEnd + nOmit, bStart = bEnd + nOmit, aEnd = aStart, bEnd = bStart;
|
|
1889
|
+
for (let iCommon = i - nContextLines; iCommon !== i; iCommon += 1)
|
|
1890
|
+
pushCommonLine(diffs[iCommon][1]);
|
|
1891
|
+
} else
|
|
1892
|
+
for (let iCommon = iStart; iCommon !== i; iCommon += 1)
|
|
1893
|
+
pushCommonLine(diffs[iCommon][1]);
|
|
1894
|
+
}
|
|
1895
|
+
for (; i !== iLength && diffs[i][0] === DIFF_DELETE; )
|
|
1896
|
+
pushDeleteLine(diffs[i][1]), i += 1;
|
|
1897
|
+
for (; i !== iLength && diffs[i][0] === DIFF_INSERT; )
|
|
1898
|
+
pushInsertLine(diffs[i][1]), i += 1;
|
|
1899
|
+
}
|
|
1900
|
+
return hasPatch && (lines[jPatchMark] = createPatchMark(aStart, aEnd, bStart, bEnd, options)), lines.join(`
|
|
1901
|
+
`);
|
|
1902
|
+
}
|
|
1903
|
+
function joinAlignedDiffsExpand(diffs, options) {
|
|
1904
|
+
return diffs.map((diff2, i, diffs2) => {
|
|
1905
|
+
let line = diff2[1], isFirstOrLast = i === 0 || i === diffs2.length - 1;
|
|
1906
|
+
switch (diff2[0]) {
|
|
1907
|
+
case DIFF_DELETE:
|
|
1908
|
+
return printDeleteLine(line, isFirstOrLast, options);
|
|
1909
|
+
case DIFF_INSERT:
|
|
1910
|
+
return printInsertLine(line, isFirstOrLast, options);
|
|
1911
|
+
default:
|
|
1912
|
+
return printCommonLine(line, isFirstOrLast, options);
|
|
1913
|
+
}
|
|
1914
|
+
}).join(`
|
|
1915
|
+
`);
|
|
1916
|
+
}
|
|
1917
|
+
var noColor = (string) => string, DIFF_CONTEXT_DEFAULT = 5, DIFF_TRUNCATE_THRESHOLD_DEFAULT = 0;
|
|
1918
|
+
function getDefaultOptions() {
|
|
1919
|
+
return {
|
|
1920
|
+
aAnnotation: "Expected",
|
|
1921
|
+
aColor: s.green,
|
|
1922
|
+
aIndicator: "-",
|
|
1923
|
+
bAnnotation: "Received",
|
|
1924
|
+
bColor: s.red,
|
|
1925
|
+
bIndicator: "+",
|
|
1926
|
+
changeColor: s.inverse,
|
|
1927
|
+
changeLineTrailingSpaceColor: noColor,
|
|
1928
|
+
commonColor: s.dim,
|
|
1929
|
+
commonIndicator: " ",
|
|
1930
|
+
commonLineTrailingSpaceColor: noColor,
|
|
1931
|
+
compareKeys: void 0,
|
|
1932
|
+
contextLines: DIFF_CONTEXT_DEFAULT,
|
|
1933
|
+
emptyFirstOrLastLinePlaceholder: "",
|
|
1934
|
+
expand: !1,
|
|
1935
|
+
includeChangeCounts: !1,
|
|
1936
|
+
omitAnnotationLines: !1,
|
|
1937
|
+
patchColor: s.yellow,
|
|
1938
|
+
printBasicPrototype: !1,
|
|
1939
|
+
truncateThreshold: DIFF_TRUNCATE_THRESHOLD_DEFAULT,
|
|
1940
|
+
truncateAnnotation: "... Diff result is truncated",
|
|
1941
|
+
truncateAnnotationColor: noColor
|
|
1942
|
+
};
|
|
1943
|
+
}
|
|
1944
|
+
function getCompareKeys(compareKeys) {
|
|
1945
|
+
return compareKeys && typeof compareKeys == "function" ? compareKeys : void 0;
|
|
1946
|
+
}
|
|
1947
|
+
function getContextLines(contextLines) {
|
|
1948
|
+
return typeof contextLines == "number" && Number.isSafeInteger(contextLines) && contextLines >= 0 ? contextLines : DIFF_CONTEXT_DEFAULT;
|
|
1949
|
+
}
|
|
1950
|
+
function normalizeDiffOptions(options = {}) {
|
|
1951
|
+
return {
|
|
1952
|
+
...getDefaultOptions(),
|
|
1953
|
+
...options,
|
|
1954
|
+
compareKeys: getCompareKeys(options.compareKeys),
|
|
1955
|
+
contextLines: getContextLines(options.contextLines)
|
|
1956
|
+
};
|
|
1957
|
+
}
|
|
1958
|
+
function isEmptyString(lines) {
|
|
1959
|
+
return lines.length === 1 && lines[0].length === 0;
|
|
1960
|
+
}
|
|
1961
|
+
function countChanges(diffs) {
|
|
1962
|
+
let a2 = 0, b = 0;
|
|
1963
|
+
return diffs.forEach((diff2) => {
|
|
1964
|
+
switch (diff2[0]) {
|
|
1965
|
+
case DIFF_DELETE:
|
|
1966
|
+
a2 += 1;
|
|
1967
|
+
break;
|
|
1968
|
+
case DIFF_INSERT:
|
|
1969
|
+
b += 1;
|
|
1970
|
+
break;
|
|
1971
|
+
}
|
|
1972
|
+
}), {
|
|
1973
|
+
a: a2,
|
|
1974
|
+
b
|
|
1975
|
+
};
|
|
1976
|
+
}
|
|
1977
|
+
function printAnnotation({ aAnnotation, aColor, aIndicator, bAnnotation, bColor, bIndicator, includeChangeCounts, omitAnnotationLines }, changeCounts) {
|
|
1978
|
+
if (omitAnnotationLines)
|
|
1979
|
+
return "";
|
|
1980
|
+
let aRest = "", bRest = "";
|
|
1981
|
+
if (includeChangeCounts) {
|
|
1982
|
+
let aCount = String(changeCounts.a), bCount = String(changeCounts.b), baAnnotationLengthDiff = bAnnotation.length - aAnnotation.length, aAnnotationPadding = " ".repeat(Math.max(0, baAnnotationLengthDiff)), bAnnotationPadding = " ".repeat(Math.max(0, -baAnnotationLengthDiff)), baCountLengthDiff = bCount.length - aCount.length, aCountPadding = " ".repeat(Math.max(0, baCountLengthDiff)), bCountPadding = " ".repeat(Math.max(0, -baCountLengthDiff));
|
|
1983
|
+
aRest = `${aAnnotationPadding} ${aIndicator} ${aCountPadding}${aCount}`, bRest = `${bAnnotationPadding} ${bIndicator} ${bCountPadding}${bCount}`;
|
|
1984
|
+
}
|
|
1985
|
+
let a2 = `${aIndicator} ${aAnnotation}${aRest}`, b = `${bIndicator} ${bAnnotation}${bRest}`;
|
|
1986
|
+
return `${aColor(a2)}
|
|
1987
|
+
${bColor(b)}
|
|
1988
|
+
|
|
1989
|
+
`;
|
|
1990
|
+
}
|
|
1991
|
+
function printDiffLines(diffs, truncated, options) {
|
|
1992
|
+
return printAnnotation(options, countChanges(diffs)) + (options.expand ? joinAlignedDiffsExpand(diffs, options) : joinAlignedDiffsNoExpand(diffs, options)) + (truncated ? options.truncateAnnotationColor(`
|
|
1993
|
+
${options.truncateAnnotation}`) : "");
|
|
1994
|
+
}
|
|
1995
|
+
function diffLinesUnified(aLines, bLines, options) {
|
|
1996
|
+
let normalizedOptions = normalizeDiffOptions(options), [diffs, truncated] = diffLinesRaw(isEmptyString(aLines) ? [] : aLines, isEmptyString(bLines) ? [] : bLines, normalizedOptions);
|
|
1997
|
+
return printDiffLines(diffs, truncated, normalizedOptions);
|
|
1998
|
+
}
|
|
1999
|
+
function diffLinesUnified2(aLinesDisplay, bLinesDisplay, aLinesCompare, bLinesCompare, options) {
|
|
2000
|
+
if (isEmptyString(aLinesDisplay) && isEmptyString(aLinesCompare) && (aLinesDisplay = [], aLinesCompare = []), isEmptyString(bLinesDisplay) && isEmptyString(bLinesCompare) && (bLinesDisplay = [], bLinesCompare = []), aLinesDisplay.length !== aLinesCompare.length || bLinesDisplay.length !== bLinesCompare.length)
|
|
2001
|
+
return diffLinesUnified(aLinesDisplay, bLinesDisplay, options);
|
|
2002
|
+
let [diffs, truncated] = diffLinesRaw(aLinesCompare, bLinesCompare, options), aIndex = 0, bIndex = 0;
|
|
2003
|
+
return diffs.forEach((diff2) => {
|
|
2004
|
+
switch (diff2[0]) {
|
|
2005
|
+
case DIFF_DELETE:
|
|
2006
|
+
diff2[1] = aLinesDisplay[aIndex], aIndex += 1;
|
|
2007
|
+
break;
|
|
2008
|
+
case DIFF_INSERT:
|
|
2009
|
+
diff2[1] = bLinesDisplay[bIndex], bIndex += 1;
|
|
2010
|
+
break;
|
|
2011
|
+
default:
|
|
2012
|
+
diff2[1] = bLinesDisplay[bIndex], aIndex += 1, bIndex += 1;
|
|
2013
|
+
}
|
|
2014
|
+
}), printDiffLines(diffs, truncated, normalizeDiffOptions(options));
|
|
2015
|
+
}
|
|
2016
|
+
function diffLinesRaw(aLines, bLines, options) {
|
|
2017
|
+
let truncate2 = options?.truncateThreshold ?? !1, truncateThreshold = Math.max(Math.floor(options?.truncateThreshold ?? 0), 0), aLength = truncate2 ? Math.min(aLines.length, truncateThreshold) : aLines.length, bLength = truncate2 ? Math.min(bLines.length, truncateThreshold) : bLines.length, truncated = aLength !== aLines.length || bLength !== bLines.length, isCommon = (aIndex2, bIndex2) => aLines[aIndex2] === bLines[bIndex2], diffs = [], aIndex = 0, bIndex = 0;
|
|
2018
|
+
for (diffSequences(aLength, bLength, isCommon, (nCommon, aCommon, bCommon) => {
|
|
2019
|
+
for (; aIndex !== aCommon; aIndex += 1)
|
|
2020
|
+
diffs.push(new Diff(DIFF_DELETE, aLines[aIndex]));
|
|
2021
|
+
for (; bIndex !== bCommon; bIndex += 1)
|
|
2022
|
+
diffs.push(new Diff(DIFF_INSERT, bLines[bIndex]));
|
|
2023
|
+
for (; nCommon !== 0; nCommon -= 1, aIndex += 1, bIndex += 1)
|
|
2024
|
+
diffs.push(new Diff(DIFF_EQUAL, bLines[bIndex]));
|
|
2025
|
+
}); aIndex !== aLength; aIndex += 1)
|
|
2026
|
+
diffs.push(new Diff(DIFF_DELETE, aLines[aIndex]));
|
|
2027
|
+
for (; bIndex !== bLength; bIndex += 1)
|
|
2028
|
+
diffs.push(new Diff(DIFF_INSERT, bLines[bIndex]));
|
|
2029
|
+
return [diffs, truncated];
|
|
2030
|
+
}
|
|
2031
|
+
function getType3(value) {
|
|
2032
|
+
if (value === void 0)
|
|
2033
|
+
return "undefined";
|
|
2034
|
+
if (value === null)
|
|
2035
|
+
return "null";
|
|
2036
|
+
if (Array.isArray(value))
|
|
2037
|
+
return "array";
|
|
2038
|
+
if (typeof value == "boolean")
|
|
2039
|
+
return "boolean";
|
|
2040
|
+
if (typeof value == "function")
|
|
2041
|
+
return "function";
|
|
2042
|
+
if (typeof value == "number")
|
|
2043
|
+
return "number";
|
|
2044
|
+
if (typeof value == "string")
|
|
2045
|
+
return "string";
|
|
2046
|
+
if (typeof value == "bigint")
|
|
2047
|
+
return "bigint";
|
|
2048
|
+
if (typeof value == "object") {
|
|
2049
|
+
if (value != null) {
|
|
2050
|
+
if (value.constructor === RegExp)
|
|
2051
|
+
return "regexp";
|
|
2052
|
+
if (value.constructor === Map)
|
|
2053
|
+
return "map";
|
|
2054
|
+
if (value.constructor === Set)
|
|
2055
|
+
return "set";
|
|
2056
|
+
if (value.constructor === Date)
|
|
2057
|
+
return "date";
|
|
2058
|
+
}
|
|
2059
|
+
return "object";
|
|
2060
|
+
} else if (typeof value == "symbol")
|
|
2061
|
+
return "symbol";
|
|
2062
|
+
throw new Error(`value of unknown type: ${value}`);
|
|
2063
|
+
}
|
|
2064
|
+
function getNewLineSymbol(string) {
|
|
2065
|
+
return string.includes(`\r
|
|
2066
|
+
`) ? `\r
|
|
2067
|
+
` : `
|
|
2068
|
+
`;
|
|
2069
|
+
}
|
|
2070
|
+
function diffStrings(a2, b, options) {
|
|
2071
|
+
let truncate2 = options?.truncateThreshold ?? !1, truncateThreshold = Math.max(Math.floor(options?.truncateThreshold ?? 0), 0), aLength = a2.length, bLength = b.length;
|
|
2072
|
+
if (truncate2) {
|
|
2073
|
+
let aMultipleLines = a2.includes(`
|
|
2074
|
+
`), bMultipleLines = b.includes(`
|
|
2075
|
+
`), aNewLineSymbol = getNewLineSymbol(a2), bNewLineSymbol = getNewLineSymbol(b), _a = aMultipleLines ? `${a2.split(aNewLineSymbol, truncateThreshold).join(aNewLineSymbol)}
|
|
2076
|
+
` : a2, _b = bMultipleLines ? `${b.split(bNewLineSymbol, truncateThreshold).join(bNewLineSymbol)}
|
|
2077
|
+
` : b;
|
|
2078
|
+
aLength = _a.length, bLength = _b.length;
|
|
2079
|
+
}
|
|
2080
|
+
let truncated = aLength !== a2.length || bLength !== b.length, isCommon = (aIndex2, bIndex2) => a2[aIndex2] === b[bIndex2], aIndex = 0, bIndex = 0, diffs = [];
|
|
2081
|
+
return diffSequences(aLength, bLength, isCommon, (nCommon, aCommon, bCommon) => {
|
|
2082
|
+
aIndex !== aCommon && diffs.push(new Diff(DIFF_DELETE, a2.slice(aIndex, aCommon))), bIndex !== bCommon && diffs.push(new Diff(DIFF_INSERT, b.slice(bIndex, bCommon))), aIndex = aCommon + nCommon, bIndex = bCommon + nCommon, diffs.push(new Diff(DIFF_EQUAL, b.slice(bCommon, bIndex)));
|
|
2083
|
+
}), aIndex !== aLength && diffs.push(new Diff(DIFF_DELETE, a2.slice(aIndex))), bIndex !== bLength && diffs.push(new Diff(DIFF_INSERT, b.slice(bIndex))), [diffs, truncated];
|
|
2084
|
+
}
|
|
2085
|
+
function concatenateRelevantDiffs(op, diffs, changeColor) {
|
|
2086
|
+
return diffs.reduce((reduced, diff2) => reduced + (diff2[0] === DIFF_EQUAL ? diff2[1] : diff2[0] === op && diff2[1].length !== 0 ? changeColor(diff2[1]) : ""), "");
|
|
2087
|
+
}
|
|
2088
|
+
var ChangeBuffer = class {
|
|
2089
|
+
op;
|
|
2090
|
+
line;
|
|
2091
|
+
lines;
|
|
2092
|
+
changeColor;
|
|
2093
|
+
constructor(op, changeColor) {
|
|
2094
|
+
this.op = op, this.line = [], this.lines = [], this.changeColor = changeColor;
|
|
2095
|
+
}
|
|
2096
|
+
pushSubstring(substring) {
|
|
2097
|
+
this.pushDiff(new Diff(this.op, substring));
|
|
2098
|
+
}
|
|
2099
|
+
pushLine() {
|
|
2100
|
+
this.lines.push(this.line.length !== 1 ? new Diff(this.op, concatenateRelevantDiffs(this.op, this.line, this.changeColor)) : this.line[0][0] === this.op ? this.line[0] : new Diff(this.op, this.line[0][1])), this.line.length = 0;
|
|
2101
|
+
}
|
|
2102
|
+
isLineEmpty() {
|
|
2103
|
+
return this.line.length === 0;
|
|
2104
|
+
}
|
|
2105
|
+
// Minor input to buffer.
|
|
2106
|
+
pushDiff(diff2) {
|
|
2107
|
+
this.line.push(diff2);
|
|
2108
|
+
}
|
|
2109
|
+
// Main input to buffer.
|
|
2110
|
+
align(diff2) {
|
|
2111
|
+
let string = diff2[1];
|
|
2112
|
+
if (string.includes(`
|
|
2113
|
+
`)) {
|
|
2114
|
+
let substrings = string.split(`
|
|
2115
|
+
`), iLast = substrings.length - 1;
|
|
2116
|
+
substrings.forEach((substring, i) => {
|
|
2117
|
+
i < iLast ? (this.pushSubstring(substring), this.pushLine()) : substring.length !== 0 && this.pushSubstring(substring);
|
|
2118
|
+
});
|
|
2119
|
+
} else
|
|
2120
|
+
this.pushDiff(diff2);
|
|
2121
|
+
}
|
|
2122
|
+
// Output from buffer.
|
|
2123
|
+
moveLinesTo(lines) {
|
|
2124
|
+
this.isLineEmpty() || this.pushLine(), lines.push(...this.lines), this.lines.length = 0;
|
|
2125
|
+
}
|
|
2126
|
+
}, CommonBuffer = class {
|
|
2127
|
+
deleteBuffer;
|
|
2128
|
+
insertBuffer;
|
|
2129
|
+
lines;
|
|
2130
|
+
constructor(deleteBuffer, insertBuffer) {
|
|
2131
|
+
this.deleteBuffer = deleteBuffer, this.insertBuffer = insertBuffer, this.lines = [];
|
|
2132
|
+
}
|
|
2133
|
+
pushDiffCommonLine(diff2) {
|
|
2134
|
+
this.lines.push(diff2);
|
|
2135
|
+
}
|
|
2136
|
+
pushDiffChangeLines(diff2) {
|
|
2137
|
+
let isDiffEmpty = diff2[1].length === 0;
|
|
2138
|
+
(!isDiffEmpty || this.deleteBuffer.isLineEmpty()) && this.deleteBuffer.pushDiff(diff2), (!isDiffEmpty || this.insertBuffer.isLineEmpty()) && this.insertBuffer.pushDiff(diff2);
|
|
2139
|
+
}
|
|
2140
|
+
flushChangeLines() {
|
|
2141
|
+
this.deleteBuffer.moveLinesTo(this.lines), this.insertBuffer.moveLinesTo(this.lines);
|
|
2142
|
+
}
|
|
2143
|
+
// Input to buffer.
|
|
2144
|
+
align(diff2) {
|
|
2145
|
+
let op = diff2[0], string = diff2[1];
|
|
2146
|
+
if (string.includes(`
|
|
2147
|
+
`)) {
|
|
2148
|
+
let substrings = string.split(`
|
|
2149
|
+
`), iLast = substrings.length - 1;
|
|
2150
|
+
substrings.forEach((substring, i) => {
|
|
2151
|
+
if (i === 0) {
|
|
2152
|
+
let subdiff = new Diff(op, substring);
|
|
2153
|
+
this.deleteBuffer.isLineEmpty() && this.insertBuffer.isLineEmpty() ? (this.flushChangeLines(), this.pushDiffCommonLine(subdiff)) : (this.pushDiffChangeLines(subdiff), this.flushChangeLines());
|
|
2154
|
+
} else i < iLast ? this.pushDiffCommonLine(new Diff(op, substring)) : substring.length !== 0 && this.pushDiffChangeLines(new Diff(op, substring));
|
|
2155
|
+
});
|
|
2156
|
+
} else
|
|
2157
|
+
this.pushDiffChangeLines(diff2);
|
|
2158
|
+
}
|
|
2159
|
+
// Output from buffer.
|
|
2160
|
+
getLines() {
|
|
2161
|
+
return this.flushChangeLines(), this.lines;
|
|
2162
|
+
}
|
|
2163
|
+
};
|
|
2164
|
+
function getAlignedDiffs(diffs, changeColor) {
|
|
2165
|
+
let deleteBuffer = new ChangeBuffer(DIFF_DELETE, changeColor), insertBuffer = new ChangeBuffer(DIFF_INSERT, changeColor), commonBuffer = new CommonBuffer(deleteBuffer, insertBuffer);
|
|
2166
|
+
return diffs.forEach((diff2) => {
|
|
2167
|
+
switch (diff2[0]) {
|
|
2168
|
+
case DIFF_DELETE:
|
|
2169
|
+
deleteBuffer.align(diff2);
|
|
2170
|
+
break;
|
|
2171
|
+
case DIFF_INSERT:
|
|
2172
|
+
insertBuffer.align(diff2);
|
|
2173
|
+
break;
|
|
2174
|
+
default:
|
|
2175
|
+
commonBuffer.align(diff2);
|
|
2176
|
+
}
|
|
2177
|
+
}), commonBuffer.getLines();
|
|
2178
|
+
}
|
|
2179
|
+
function hasCommonDiff(diffs, isMultiline) {
|
|
2180
|
+
if (isMultiline) {
|
|
2181
|
+
let iLast = diffs.length - 1;
|
|
2182
|
+
return diffs.some((diff2, i) => diff2[0] === DIFF_EQUAL && (i !== iLast || diff2[1] !== `
|
|
2183
|
+
`));
|
|
2184
|
+
}
|
|
2185
|
+
return diffs.some((diff2) => diff2[0] === DIFF_EQUAL);
|
|
2186
|
+
}
|
|
2187
|
+
function diffStringsUnified(a2, b, options) {
|
|
2188
|
+
if (a2 !== b && a2.length !== 0 && b.length !== 0) {
|
|
2189
|
+
let isMultiline = a2.includes(`
|
|
2190
|
+
`) || b.includes(`
|
|
2191
|
+
`), [diffs, truncated] = diffStringsRaw(isMultiline ? `${a2}
|
|
2192
|
+
` : a2, isMultiline ? `${b}
|
|
2193
|
+
` : b, !0, options);
|
|
2194
|
+
if (hasCommonDiff(diffs, isMultiline)) {
|
|
2195
|
+
let optionsNormalized = normalizeDiffOptions(options), lines = getAlignedDiffs(diffs, optionsNormalized.changeColor);
|
|
2196
|
+
return printDiffLines(lines, truncated, optionsNormalized);
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
return diffLinesUnified(a2.split(`
|
|
2200
|
+
`), b.split(`
|
|
2201
|
+
`), options);
|
|
2202
|
+
}
|
|
2203
|
+
function diffStringsRaw(a2, b, cleanup, options) {
|
|
2204
|
+
let [diffs, truncated] = diffStrings(a2, b, options);
|
|
2205
|
+
return cleanup && diff_cleanupSemantic(diffs), [diffs, truncated];
|
|
2206
|
+
}
|
|
2207
|
+
function getCommonMessage(message, options) {
|
|
2208
|
+
let { commonColor } = normalizeDiffOptions(options);
|
|
2209
|
+
return commonColor(message);
|
|
2210
|
+
}
|
|
2211
|
+
var { AsymmetricMatcher: AsymmetricMatcher2, DOMCollection: DOMCollection2, DOMElement: DOMElement2, Immutable: Immutable2, ReactElement: ReactElement2, ReactTestComponent: ReactTestComponent2 } = plugins, PLUGINS2 = [
|
|
2212
|
+
ReactTestComponent2,
|
|
2213
|
+
ReactElement2,
|
|
2214
|
+
DOMElement2,
|
|
2215
|
+
DOMCollection2,
|
|
2216
|
+
Immutable2,
|
|
2217
|
+
AsymmetricMatcher2,
|
|
2218
|
+
plugins.Error
|
|
2219
|
+
], FORMAT_OPTIONS = {
|
|
2220
|
+
maxDepth: 20,
|
|
2221
|
+
plugins: PLUGINS2
|
|
2222
|
+
}, FALLBACK_FORMAT_OPTIONS = {
|
|
2223
|
+
callToJSON: !1,
|
|
2224
|
+
maxDepth: 8,
|
|
2225
|
+
plugins: PLUGINS2
|
|
2226
|
+
};
|
|
2227
|
+
function diff(a2, b, options) {
|
|
2228
|
+
if (Object.is(a2, b))
|
|
2229
|
+
return "";
|
|
2230
|
+
let aType = getType3(a2), expectedType = aType, omitDifference = !1;
|
|
2231
|
+
if (aType === "object" && typeof a2.asymmetricMatch == "function") {
|
|
2232
|
+
if (a2.$$typeof !== Symbol.for("jest.asymmetricMatcher") || typeof a2.getExpectedType != "function")
|
|
2233
|
+
return;
|
|
2234
|
+
expectedType = a2.getExpectedType(), omitDifference = expectedType === "string";
|
|
2235
|
+
}
|
|
2236
|
+
if (expectedType !== getType3(b)) {
|
|
2237
|
+
let truncate2 = function(s2) {
|
|
2238
|
+
return s2.length <= MAX_LENGTH ? s2 : `${s2.slice(0, MAX_LENGTH)}...`;
|
|
2239
|
+
}, { aAnnotation, aColor, aIndicator, bAnnotation, bColor, bIndicator } = normalizeDiffOptions(options), formatOptions = getFormatOptions(FALLBACK_FORMAT_OPTIONS, options), aDisplay = format(a2, formatOptions), bDisplay = format(b, formatOptions), MAX_LENGTH = 1e5;
|
|
2240
|
+
aDisplay = truncate2(aDisplay), bDisplay = truncate2(bDisplay);
|
|
2241
|
+
let aDiff = `${aColor(`${aIndicator} ${aAnnotation}:`)}
|
|
2242
|
+
${aDisplay}`, bDiff = `${bColor(`${bIndicator} ${bAnnotation}:`)}
|
|
2243
|
+
${bDisplay}`;
|
|
2244
|
+
return `${aDiff}
|
|
2245
|
+
|
|
2246
|
+
${bDiff}`;
|
|
2247
|
+
}
|
|
2248
|
+
if (!omitDifference)
|
|
2249
|
+
switch (aType) {
|
|
2250
|
+
case "string":
|
|
2251
|
+
return diffLinesUnified(a2.split(`
|
|
2252
|
+
`), b.split(`
|
|
2253
|
+
`), options);
|
|
2254
|
+
case "boolean":
|
|
2255
|
+
case "number":
|
|
2256
|
+
return comparePrimitive(a2, b, options);
|
|
2257
|
+
case "map":
|
|
2258
|
+
return compareObjects(sortMap(a2), sortMap(b), options);
|
|
2259
|
+
case "set":
|
|
2260
|
+
return compareObjects(sortSet(a2), sortSet(b), options);
|
|
2261
|
+
default:
|
|
2262
|
+
return compareObjects(a2, b, options);
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
function comparePrimitive(a2, b, options) {
|
|
2266
|
+
let aFormat = format(a2, FORMAT_OPTIONS), bFormat = format(b, FORMAT_OPTIONS);
|
|
2267
|
+
return aFormat === bFormat ? "" : diffLinesUnified(aFormat.split(`
|
|
2268
|
+
`), bFormat.split(`
|
|
2269
|
+
`), options);
|
|
2270
|
+
}
|
|
2271
|
+
function sortMap(map) {
|
|
2272
|
+
return new Map(Array.from(map.entries()).sort());
|
|
2273
|
+
}
|
|
2274
|
+
function sortSet(set) {
|
|
2275
|
+
return new Set(Array.from(set.values()).sort());
|
|
2276
|
+
}
|
|
2277
|
+
function compareObjects(a2, b, options) {
|
|
2278
|
+
let difference, hasThrown = !1;
|
|
2279
|
+
try {
|
|
2280
|
+
let formatOptions = getFormatOptions(FORMAT_OPTIONS, options);
|
|
2281
|
+
difference = getObjectsDifference(a2, b, formatOptions, options);
|
|
2282
|
+
} catch {
|
|
2283
|
+
hasThrown = !0;
|
|
2284
|
+
}
|
|
2285
|
+
let noDiffMessage = getCommonMessage(NO_DIFF_MESSAGE, options);
|
|
2286
|
+
if (difference === void 0 || difference === noDiffMessage) {
|
|
2287
|
+
let formatOptions = getFormatOptions(FALLBACK_FORMAT_OPTIONS, options);
|
|
2288
|
+
difference = getObjectsDifference(a2, b, formatOptions, options), difference !== noDiffMessage && !hasThrown && (difference = `${getCommonMessage(SIMILAR_MESSAGE, options)}
|
|
2289
|
+
|
|
2290
|
+
${difference}`);
|
|
2291
|
+
}
|
|
2292
|
+
return difference;
|
|
2293
|
+
}
|
|
2294
|
+
function getFormatOptions(formatOptions, options) {
|
|
2295
|
+
let { compareKeys, printBasicPrototype, maxDepth } = normalizeDiffOptions(options);
|
|
2296
|
+
return {
|
|
2297
|
+
...formatOptions,
|
|
2298
|
+
compareKeys,
|
|
2299
|
+
printBasicPrototype,
|
|
2300
|
+
maxDepth: maxDepth ?? formatOptions.maxDepth
|
|
2301
|
+
};
|
|
2302
|
+
}
|
|
2303
|
+
function getObjectsDifference(a2, b, formatOptions, options) {
|
|
2304
|
+
let formatOptionsZeroIndent = {
|
|
2305
|
+
...formatOptions,
|
|
2306
|
+
indent: 0
|
|
2307
|
+
}, aCompare = format(a2, formatOptionsZeroIndent), bCompare = format(b, formatOptionsZeroIndent);
|
|
2308
|
+
if (aCompare === bCompare)
|
|
2309
|
+
return getCommonMessage(NO_DIFF_MESSAGE, options);
|
|
2310
|
+
{
|
|
2311
|
+
let aDisplay = format(a2, formatOptions), bDisplay = format(b, formatOptions);
|
|
2312
|
+
return diffLinesUnified2(aDisplay.split(`
|
|
2313
|
+
`), bDisplay.split(`
|
|
2314
|
+
`), aCompare.split(`
|
|
2315
|
+
`), bCompare.split(`
|
|
2316
|
+
`), options);
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
var MAX_DIFF_STRING_LENGTH = 2e4;
|
|
2320
|
+
function isAsymmetricMatcher(data) {
|
|
2321
|
+
return getType2(data) === "Object" && typeof data.asymmetricMatch == "function";
|
|
2322
|
+
}
|
|
2323
|
+
function isReplaceable(obj1, obj2) {
|
|
2324
|
+
let obj1Type = getType2(obj1), obj2Type = getType2(obj2);
|
|
2325
|
+
return obj1Type === obj2Type && (obj1Type === "Object" || obj1Type === "Array");
|
|
2326
|
+
}
|
|
2327
|
+
function printDiffOrStringify(received, expected, options) {
|
|
2328
|
+
let { aAnnotation, bAnnotation } = normalizeDiffOptions(options);
|
|
2329
|
+
if (typeof expected == "string" && typeof received == "string" && expected.length > 0 && received.length > 0 && expected.length <= MAX_DIFF_STRING_LENGTH && received.length <= MAX_DIFF_STRING_LENGTH && expected !== received) {
|
|
2330
|
+
if (expected.includes(`
|
|
2331
|
+
`) || received.includes(`
|
|
2332
|
+
`))
|
|
2333
|
+
return diffStringsUnified(expected, received, options);
|
|
2334
|
+
let [diffs] = diffStringsRaw(expected, received, !0), hasCommonDiff2 = diffs.some((diff2) => diff2[0] === DIFF_EQUAL), printLabel = getLabelPrinter(aAnnotation, bAnnotation), expectedLine = printLabel(aAnnotation) + printExpected(getCommonAndChangedSubstrings(diffs, DIFF_DELETE, hasCommonDiff2)), receivedLine = printLabel(bAnnotation) + printReceived(getCommonAndChangedSubstrings(diffs, DIFF_INSERT, hasCommonDiff2));
|
|
2335
|
+
return `${expectedLine}
|
|
2336
|
+
${receivedLine}`;
|
|
2337
|
+
}
|
|
2338
|
+
let clonedExpected = deepClone(expected, { forceWritable: !0 }), clonedReceived = deepClone(received, { forceWritable: !0 }), { replacedExpected, replacedActual } = replaceAsymmetricMatcher(clonedReceived, clonedExpected);
|
|
2339
|
+
return diff(replacedExpected, replacedActual, options);
|
|
2340
|
+
}
|
|
2341
|
+
function replaceAsymmetricMatcher(actual, expected, actualReplaced = /* @__PURE__ */ new WeakSet(), expectedReplaced = /* @__PURE__ */ new WeakSet()) {
|
|
2342
|
+
return actual instanceof Error && expected instanceof Error && typeof actual.cause < "u" && typeof expected.cause > "u" ? (delete actual.cause, {
|
|
2343
|
+
replacedActual: actual,
|
|
2344
|
+
replacedExpected: expected
|
|
2345
|
+
}) : isReplaceable(actual, expected) ? actualReplaced.has(actual) || expectedReplaced.has(expected) ? {
|
|
2346
|
+
replacedActual: actual,
|
|
2347
|
+
replacedExpected: expected
|
|
2348
|
+
} : (actualReplaced.add(actual), expectedReplaced.add(expected), getOwnProperties(expected).forEach((key) => {
|
|
2349
|
+
let expectedValue = expected[key], actualValue = actual[key];
|
|
2350
|
+
if (isAsymmetricMatcher(expectedValue))
|
|
2351
|
+
expectedValue.asymmetricMatch(actualValue) && (actual[key] = expectedValue);
|
|
2352
|
+
else if (isAsymmetricMatcher(actualValue))
|
|
2353
|
+
actualValue.asymmetricMatch(expectedValue) && (expected[key] = actualValue);
|
|
2354
|
+
else if (isReplaceable(actualValue, expectedValue)) {
|
|
2355
|
+
let replaced = replaceAsymmetricMatcher(actualValue, expectedValue, actualReplaced, expectedReplaced);
|
|
2356
|
+
actual[key] = replaced.replacedActual, expected[key] = replaced.replacedExpected;
|
|
2357
|
+
}
|
|
2358
|
+
}), {
|
|
2359
|
+
replacedActual: actual,
|
|
2360
|
+
replacedExpected: expected
|
|
2361
|
+
}) : {
|
|
2362
|
+
replacedActual: actual,
|
|
2363
|
+
replacedExpected: expected
|
|
2364
|
+
};
|
|
2365
|
+
}
|
|
2366
|
+
function getLabelPrinter(...strings) {
|
|
2367
|
+
let maxLength = strings.reduce((max, string) => string.length > max ? string.length : max, 0);
|
|
2368
|
+
return (string) => `${string}: ${" ".repeat(maxLength - string.length)}`;
|
|
2369
|
+
}
|
|
2370
|
+
var SPACE_SYMBOL = "\xB7";
|
|
2371
|
+
function replaceTrailingSpaces(text) {
|
|
2372
|
+
return text.replace(/\s+$/gm, (spaces) => SPACE_SYMBOL.repeat(spaces.length));
|
|
2373
|
+
}
|
|
2374
|
+
function printReceived(object) {
|
|
2375
|
+
return s.red(replaceTrailingSpaces(stringify(object)));
|
|
2376
|
+
}
|
|
2377
|
+
function printExpected(value) {
|
|
2378
|
+
return s.green(replaceTrailingSpaces(stringify(value)));
|
|
2379
|
+
}
|
|
2380
|
+
function getCommonAndChangedSubstrings(diffs, op, hasCommonDiff2) {
|
|
2381
|
+
return diffs.reduce((reduced, diff2) => reduced + (diff2[0] === DIFF_EQUAL ? diff2[1] : diff2[0] === op ? hasCommonDiff2 ? s.inverse(diff2[1]) : diff2[1] : ""), "");
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
// ../node_modules/@vitest/utils/dist/error.js
|
|
2385
|
+
var IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@", IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
|
|
2386
|
+
function isImmutable(v) {
|
|
2387
|
+
return v && (v[IS_COLLECTION_SYMBOL] || v[IS_RECORD_SYMBOL]);
|
|
2388
|
+
}
|
|
2389
|
+
var OBJECT_PROTO = Object.getPrototypeOf({});
|
|
2390
|
+
function getUnserializableMessage(err) {
|
|
2391
|
+
return err instanceof Error ? `<unserializable>: ${err.message}` : typeof err == "string" ? `<unserializable>: ${err}` : "<unserializable>";
|
|
2392
|
+
}
|
|
2393
|
+
function serializeValue(val, seen = /* @__PURE__ */ new WeakMap()) {
|
|
2394
|
+
if (!val || typeof val == "string")
|
|
2395
|
+
return val;
|
|
2396
|
+
if (val instanceof Error && "toJSON" in val && typeof val.toJSON == "function") {
|
|
2397
|
+
let jsonValue = val.toJSON();
|
|
2398
|
+
return jsonValue && jsonValue !== val && typeof jsonValue == "object" && (typeof val.message == "string" && safe(() => jsonValue.message ?? (jsonValue.message = val.message)), typeof val.stack == "string" && safe(() => jsonValue.stack ?? (jsonValue.stack = val.stack)), typeof val.name == "string" && safe(() => jsonValue.name ?? (jsonValue.name = val.name)), val.cause != null && safe(() => jsonValue.cause ?? (jsonValue.cause = serializeValue(val.cause, seen)))), serializeValue(jsonValue, seen);
|
|
2399
|
+
}
|
|
2400
|
+
if (typeof val == "function")
|
|
2401
|
+
return `Function<${val.name || "anonymous"}>`;
|
|
2402
|
+
if (typeof val == "symbol")
|
|
2403
|
+
return val.toString();
|
|
2404
|
+
if (typeof val != "object")
|
|
2405
|
+
return val;
|
|
2406
|
+
if (typeof Buffer < "u" && val instanceof Buffer)
|
|
2407
|
+
return `<Buffer(${val.length}) ...>`;
|
|
2408
|
+
if (typeof Uint8Array < "u" && val instanceof Uint8Array)
|
|
2409
|
+
return `<Uint8Array(${val.length}) ...>`;
|
|
2410
|
+
if (isImmutable(val))
|
|
2411
|
+
return serializeValue(val.toJSON(), seen);
|
|
2412
|
+
if (val instanceof Promise || val.constructor && val.constructor.prototype === "AsyncFunction")
|
|
2413
|
+
return "Promise";
|
|
2414
|
+
if (typeof Element < "u" && val instanceof Element)
|
|
2415
|
+
return val.tagName;
|
|
2416
|
+
if (typeof val.asymmetricMatch == "function")
|
|
2417
|
+
return `${val.toString()} ${format2(val.sample)}`;
|
|
2418
|
+
if (typeof val.toJSON == "function")
|
|
2419
|
+
return serializeValue(val.toJSON(), seen);
|
|
2420
|
+
if (seen.has(val))
|
|
2421
|
+
return seen.get(val);
|
|
2422
|
+
if (Array.isArray(val)) {
|
|
2423
|
+
let clone2 = new Array(val.length);
|
|
2424
|
+
return seen.set(val, clone2), val.forEach((e, i) => {
|
|
2425
|
+
try {
|
|
2426
|
+
clone2[i] = serializeValue(e, seen);
|
|
2427
|
+
} catch (err) {
|
|
2428
|
+
clone2[i] = getUnserializableMessage(err);
|
|
2429
|
+
}
|
|
2430
|
+
}), clone2;
|
|
2431
|
+
} else {
|
|
2432
|
+
let clone2 = /* @__PURE__ */ Object.create(null);
|
|
2433
|
+
seen.set(val, clone2);
|
|
2434
|
+
let obj = val;
|
|
2435
|
+
for (; obj && obj !== OBJECT_PROTO; )
|
|
2436
|
+
Object.getOwnPropertyNames(obj).forEach((key) => {
|
|
2437
|
+
if (!(key in clone2))
|
|
2438
|
+
try {
|
|
2439
|
+
clone2[key] = serializeValue(val[key], seen);
|
|
2440
|
+
} catch (err) {
|
|
2441
|
+
delete clone2[key], clone2[key] = getUnserializableMessage(err);
|
|
2442
|
+
}
|
|
2443
|
+
}), obj = Object.getPrototypeOf(obj);
|
|
2444
|
+
return clone2;
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
function safe(fn) {
|
|
2448
|
+
try {
|
|
2449
|
+
return fn();
|
|
2450
|
+
} catch {
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
function normalizeErrorMessage(message) {
|
|
2454
|
+
return message.replace(/__(vite_ssr_import|vi_import)_\d+__\./g, "");
|
|
2455
|
+
}
|
|
2456
|
+
function processError(_err, diffOptions, seen = /* @__PURE__ */ new WeakSet()) {
|
|
2457
|
+
if (!_err || typeof _err != "object")
|
|
2458
|
+
return { message: String(_err) };
|
|
2459
|
+
let err = _err;
|
|
2460
|
+
(err.showDiff || err.showDiff === void 0 && err.expected !== void 0 && err.actual !== void 0) && (err.diff = printDiffOrStringify(err.actual, err.expected, {
|
|
2461
|
+
...diffOptions,
|
|
2462
|
+
...err.diffOptions
|
|
2463
|
+
})), "expected" in err && typeof err.expected != "string" && (err.expected = stringify(err.expected, 10)), "actual" in err && typeof err.actual != "string" && (err.actual = stringify(err.actual, 10));
|
|
2464
|
+
try {
|
|
2465
|
+
typeof err.message == "string" && (err.message = normalizeErrorMessage(err.message));
|
|
2466
|
+
} catch {
|
|
2467
|
+
}
|
|
2468
|
+
try {
|
|
2469
|
+
!seen.has(err) && typeof err.cause == "object" && (seen.add(err), err.cause = processError(err.cause, diffOptions, seen));
|
|
2470
|
+
} catch {
|
|
2471
|
+
}
|
|
2472
|
+
try {
|
|
2473
|
+
return serializeValue(err);
|
|
2474
|
+
} catch (e) {
|
|
2475
|
+
return serializeValue(new Error(`Failed to fully serialize error: ${e?.message}
|
|
2476
|
+
Inner error message: ${err?.message}`));
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2479
|
+
|
|
2480
|
+
export {
|
|
2481
|
+
s,
|
|
2482
|
+
stringify,
|
|
2483
|
+
getDefaultExportFromCjs2 as getDefaultExportFromCjs,
|
|
2484
|
+
assertTypes,
|
|
2485
|
+
isObject,
|
|
2486
|
+
getType2 as getType,
|
|
2487
|
+
noop,
|
|
2488
|
+
diff,
|
|
2489
|
+
printDiffOrStringify,
|
|
2490
|
+
processError
|
|
2491
|
+
};
|