storybook 9.0.0-alpha.1 → 9.0.0-alpha.3

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.
Files changed (214) hide show
  1. package/README.md +31 -29
  2. package/assets/browser/favicon.svg +1 -0
  3. package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
  4. package/assets/browser/nunito-sans-bold.woff2 +0 -0
  5. package/assets/browser/nunito-sans-italic.woff2 +0 -0
  6. package/assets/browser/nunito-sans-regular.woff2 +0 -0
  7. package/assets/docs/message-reference.png +0 -0
  8. package/assets/server/addon.tsconfig.json +6 -0
  9. package/assets/server/base-preview-body.html +119 -0
  10. package/assets/server/base-preview-head.html +451 -0
  11. package/assets/server/template.ejs +87 -0
  12. package/bin/index.cjs +1 -1
  13. package/dist/babel/index.cjs +54034 -0
  14. package/dist/babel/index.d.ts +7488 -0
  15. package/dist/babel/index.js +54044 -0
  16. package/dist/bin/index.cjs +123 -0
  17. package/dist/bin/index.js +117 -0
  18. package/dist/builder-manager/index.cjs +2167 -0
  19. package/dist/builder-manager/index.d.ts +19 -0
  20. package/dist/builder-manager/index.js +2189 -0
  21. package/dist/channels/index.cjs +1936 -0
  22. package/dist/channels/index.d.ts +108 -0
  23. package/dist/channels/index.js +1883 -0
  24. package/dist/cli/bin/index.cjs +2687 -0
  25. package/dist/cli/bin/index.d.ts +2 -0
  26. package/dist/cli/bin/index.js +2707 -0
  27. package/dist/cli/index.cjs +17327 -0
  28. package/dist/cli/index.d.ts +209 -0
  29. package/dist/cli/index.js +17349 -0
  30. package/dist/client-logger/index.cjs +112 -0
  31. package/dist/client-logger/index.d.ts +29 -0
  32. package/dist/client-logger/index.js +70 -0
  33. package/dist/common/index.cjs +20560 -0
  34. package/dist/common/index.d.ts +954 -0
  35. package/dist/common/index.js +20645 -0
  36. package/dist/components/index.cjs +30056 -0
  37. package/dist/components/index.d.ts +1423 -0
  38. package/dist/components/index.js +25416 -0
  39. package/dist/core-events/index.cjs +167 -0
  40. package/dist/core-events/index.d.ts +313 -0
  41. package/dist/core-events/index.js +149 -0
  42. package/dist/core-server/index.cjs +37870 -0
  43. package/dist/core-server/index.d.ts +462 -0
  44. package/dist/core-server/index.js +37964 -0
  45. package/dist/core-server/presets/common-manager.js +28 -0
  46. package/dist/core-server/presets/common-override-preset.cjs +4824 -0
  47. package/dist/core-server/presets/common-override-preset.js +4829 -0
  48. package/dist/core-server/presets/common-preset.cjs +10228 -0
  49. package/dist/core-server/presets/common-preset.js +10306 -0
  50. package/dist/csf/index.cjs +223 -0
  51. package/dist/csf/index.d.ts +752 -0
  52. package/dist/csf/index.js +216 -0
  53. package/dist/csf-tools/index.cjs +1422 -0
  54. package/dist/csf-tools/index.d.ts +250 -0
  55. package/dist/csf-tools/index.js +1439 -0
  56. package/dist/docs-tools/index.cjs +923 -0
  57. package/dist/docs-tools/index.d.ts +162 -0
  58. package/dist/docs-tools/index.js +909 -0
  59. package/dist/index.cjs +17 -1
  60. package/dist/index.d.ts +1 -1
  61. package/dist/index.js +2 -7
  62. package/dist/instrumenter/index.cjs +3273 -0
  63. package/dist/instrumenter/index.d.ts +104 -0
  64. package/dist/instrumenter/index.js +4800 -0
  65. package/dist/manager/globals-module-info.cjs +666 -0
  66. package/dist/manager/globals-module-info.d.ts +36 -0
  67. package/dist/manager/globals-module-info.js +653 -0
  68. package/dist/manager/globals-runtime.js +41565 -0
  69. package/dist/manager/globals.cjs +43 -0
  70. package/dist/manager/globals.d.ts +21 -0
  71. package/dist/manager/globals.js +30 -0
  72. package/dist/manager/runtime.js +12043 -0
  73. package/dist/manager-api/index.cjs +10770 -0
  74. package/dist/manager-api/index.d.ts +1211 -0
  75. package/dist/manager-api/index.js +4545 -0
  76. package/dist/manager-errors.d.ts +65 -0
  77. package/dist/manager-errors.js +83 -0
  78. package/dist/node-logger/index.cjs +1642 -0
  79. package/dist/node-logger/index.d.ts +117 -0
  80. package/dist/node-logger/index.js +1652 -0
  81. package/dist/preview/globals.cjs +34 -0
  82. package/dist/preview/globals.d.ts +12 -0
  83. package/dist/preview/globals.js +21 -0
  84. package/dist/preview/runtime.js +7721 -0
  85. package/dist/preview-api/index.cjs +5656 -0
  86. package/dist/preview-api/index.d.ts +1356 -0
  87. package/dist/preview-api/index.js +5663 -0
  88. package/dist/preview-errors.cjs +486 -0
  89. package/dist/preview-errors.d.ts +188 -0
  90. package/dist/preview-errors.js +433 -0
  91. package/dist/router/index.cjs +3320 -0
  92. package/dist/router/index.d.ts +385 -0
  93. package/dist/router/index.js +1849 -0
  94. package/dist/server-errors.cjs +710 -0
  95. package/dist/server-errors.d.ts +272 -0
  96. package/dist/server-errors.js +711 -0
  97. package/dist/telemetry/index.cjs +3683 -0
  98. package/dist/telemetry/index.d.ts +112 -0
  99. package/dist/telemetry/index.js +3720 -0
  100. package/dist/test/index.cjs +34915 -0
  101. package/dist/test/index.d.ts +186 -0
  102. package/dist/test/index.js +32798 -0
  103. package/dist/theming/create.cjs +2422 -0
  104. package/dist/theming/create.d.ts +50 -0
  105. package/dist/theming/create.js +990 -0
  106. package/dist/theming/index.cjs +4832 -0
  107. package/dist/theming/index.d.ts +11939 -0
  108. package/dist/theming/index.js +3253 -0
  109. package/dist/types/index.cjs +27 -0
  110. package/dist/types/index.d.ts +2541 -0
  111. package/dist/types/index.js +7 -0
  112. package/package.json +329 -212
  113. package/.eslintrc.cjs +0 -31
  114. package/__mocks__/@aw-web-design/x-default-browser.js +0 -2
  115. package/core/babel/index.cjs +0 -1
  116. package/core/babel/index.d.ts +0 -2
  117. package/core/babel/index.js +0 -1
  118. package/core/builder-manager/index.cjs +0 -1
  119. package/core/builder-manager/index.d.ts +0 -2
  120. package/core/builder-manager/index.js +0 -1
  121. package/core/channels/index.cjs +0 -1
  122. package/core/channels/index.d.ts +0 -2
  123. package/core/channels/index.js +0 -1
  124. package/core/cli/bin/index.cjs +0 -1
  125. package/core/cli/bin/index.d.ts +0 -2
  126. package/core/cli/bin/index.js +0 -1
  127. package/core/cli/index.cjs +0 -1
  128. package/core/cli/index.d.ts +0 -2
  129. package/core/cli/index.js +0 -1
  130. package/core/client-logger/index.cjs +0 -1
  131. package/core/client-logger/index.d.ts +0 -2
  132. package/core/client-logger/index.js +0 -1
  133. package/core/common/index.cjs +0 -1
  134. package/core/common/index.d.ts +0 -2
  135. package/core/common/index.js +0 -1
  136. package/core/components/index.cjs +0 -1
  137. package/core/components/index.d.ts +0 -2
  138. package/core/components/index.js +0 -1
  139. package/core/core-events/index.cjs +0 -1
  140. package/core/core-events/index.d.ts +0 -2
  141. package/core/core-events/index.js +0 -1
  142. package/core/core-server/index.cjs +0 -1
  143. package/core/core-server/index.d.ts +0 -2
  144. package/core/core-server/index.js +0 -1
  145. package/core/core-server/presets/common-manager.js +0 -1
  146. package/core/core-server/presets/common-override-preset.cjs +0 -1
  147. package/core/core-server/presets/common-override-preset.js +0 -1
  148. package/core/core-server/presets/common-preset.cjs +0 -1
  149. package/core/core-server/presets/common-preset.js +0 -1
  150. package/core/csf/index.cjs +0 -1
  151. package/core/csf/index.d.ts +0 -2
  152. package/core/csf/index.js +0 -1
  153. package/core/csf-tools/index.cjs +0 -1
  154. package/core/csf-tools/index.d.ts +0 -2
  155. package/core/csf-tools/index.js +0 -1
  156. package/core/docs-tools/index.cjs +0 -1
  157. package/core/docs-tools/index.d.ts +0 -2
  158. package/core/docs-tools/index.js +0 -1
  159. package/core/index.cjs +0 -1
  160. package/core/index.d.ts +0 -2
  161. package/core/index.js +0 -1
  162. package/core/manager/globals-module-info.cjs +0 -1
  163. package/core/manager/globals-module-info.d.ts +0 -2
  164. package/core/manager/globals-module-info.js +0 -1
  165. package/core/manager/globals-runtime.js +0 -1
  166. package/core/manager/globals.cjs +0 -1
  167. package/core/manager/globals.d.ts +0 -2
  168. package/core/manager/globals.js +0 -1
  169. package/core/manager-api/index.cjs +0 -1
  170. package/core/manager-api/index.d.ts +0 -2
  171. package/core/manager-api/index.js +0 -1
  172. package/core/manager-errors.d.ts +0 -2
  173. package/core/manager-errors.js +0 -1
  174. package/core/node-logger/index.cjs +0 -1
  175. package/core/node-logger/index.d.ts +0 -2
  176. package/core/node-logger/index.js +0 -1
  177. package/core/preview/globals.cjs +0 -1
  178. package/core/preview/globals.d.ts +0 -2
  179. package/core/preview/globals.js +0 -1
  180. package/core/preview/runtime.js +0 -1
  181. package/core/preview-api/index.cjs +0 -1
  182. package/core/preview-api/index.d.ts +0 -2
  183. package/core/preview-api/index.js +0 -1
  184. package/core/preview-errors.cjs +0 -1
  185. package/core/preview-errors.d.ts +0 -2
  186. package/core/preview-errors.js +0 -1
  187. package/core/router/index.cjs +0 -1
  188. package/core/router/index.d.ts +0 -2
  189. package/core/router/index.js +0 -1
  190. package/core/server-errors.cjs +0 -1
  191. package/core/server-errors.d.ts +0 -2
  192. package/core/server-errors.js +0 -1
  193. package/core/telemetry/index.cjs +0 -1
  194. package/core/telemetry/index.d.ts +0 -2
  195. package/core/telemetry/index.js +0 -1
  196. package/core/theming/create.cjs +0 -1
  197. package/core/theming/create.d.ts +0 -2
  198. package/core/theming/create.js +0 -1
  199. package/core/theming/index.cjs +0 -1
  200. package/core/theming/index.d.ts +0 -2
  201. package/core/theming/index.js +0 -1
  202. package/core/types/index.cjs +0 -1
  203. package/core/types/index.d.ts +0 -2
  204. package/core/types/index.js +0 -1
  205. package/core.cjs +0 -0
  206. package/core.d.ts +0 -0
  207. package/core.js +0 -1
  208. package/dist/chunk-OWLSIX54.js +0 -8
  209. package/dist/core-path.cjs +0 -1
  210. package/dist/core-path.d.ts +0 -3
  211. package/dist/core-path.js +0 -9
  212. package/dist/proxy.cjs +0 -1
  213. package/dist/proxy.d.ts +0 -2
  214. package/dist/proxy.js +0 -9
@@ -0,0 +1,3273 @@
1
+ "use strict";
2
+ var lr = Object.create;
3
+ var Et = Object.defineProperty;
4
+ var ar = Object.getOwnPropertyDescriptor;
5
+ var fr = Object.getOwnPropertyNames;
6
+ var pr = Object.getPrototypeOf, mr = Object.prototype.hasOwnProperty;
7
+ var i = (t, e) => Et(t, "name", { value: e, configurable: !0 });
8
+ var gr = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports), hr = (t, e) => {
9
+ for (var n in e)
10
+ Et(t, n, { get: e[n], enumerable: !0 });
11
+ }, Pe = (t, e, n, r) => {
12
+ if (e && typeof e == "object" || typeof e == "function")
13
+ for (let o of fr(e))
14
+ !mr.call(t, o) && o !== n && Et(t, o, { get: () => e[o], enumerable: !(r = ar(e, o)) || r.enumerable });
15
+ return t;
16
+ };
17
+ var yr = (t, e, n) => (n = t != null ? lr(pr(t)) : {}, Pe(
18
+ // If the importer is in node compatibility mode or this is not an ESM
19
+ // file that has been converted to a CommonJS file using a Babel-
20
+ // compatible transform (i.e. "__esModule" has not been set), then set
21
+ // "default" to the CommonJS "module.exports" for node compatibility.
22
+ e || !t || !t.__esModule ? Et(n, "default", { value: t, enumerable: !0 }) : n,
23
+ t
24
+ )), dr = (t) => Pe(Et({}, "__esModule", { value: !0 }), t);
25
+
26
+ // ../node_modules/@storybook/global/dist/index.js
27
+ var xe = gr((ri, Le) => {
28
+ "use strict";
29
+ var Ht = Object.defineProperty, br = Object.getOwnPropertyDescriptor, Sr = Object.getOwnPropertyNames, _r = Object.prototype.hasOwnProperty,
30
+ Er = /* @__PURE__ */ i((t, e) => {
31
+ for (var n in e)
32
+ Ht(t, n, { get: e[n], enumerable: !0 });
33
+ }, "__export"), Or = /* @__PURE__ */ i((t, e, n, r) => {
34
+ if (e && typeof e == "object" || typeof e == "function")
35
+ for (let o of Sr(e))
36
+ !_r.call(t, o) && o !== n && Ht(t, o, { get: /* @__PURE__ */ i(() => e[o], "get"), enumerable: !(r = br(e, o)) || r.enumerable });
37
+ return t;
38
+ }, "__copyProps"), wr = /* @__PURE__ */ i((t) => Or(Ht({}, "__esModule", { value: !0 }), t), "__toCommonJS"), Me = {};
39
+ Er(Me, {
40
+ global: /* @__PURE__ */ i(() => Cr, "global")
41
+ });
42
+ Le.exports = wr(Me);
43
+ var Cr = (() => {
44
+ let t;
45
+ return typeof window < "u" ? t = window : typeof globalThis < "u" ? t = globalThis : typeof global < "u" ? t = global : typeof self < "u" ?
46
+ t = self : t = {}, t;
47
+ })();
48
+ });
49
+
50
+ // src/instrumenter/index.ts
51
+ var ei = {};
52
+ hr(ei, {
53
+ CallStates: () => er,
54
+ EVENTS: () => nt,
55
+ instrument: () => cr
56
+ });
57
+ module.exports = dr(ei);
58
+
59
+ // src/instrumenter/instrumenter.ts
60
+ var sr = require("storybook/internal/client-logger"), gt = require("storybook/internal/core-events"), ir = require("storybook/internal/preview-api"),
61
+ U = yr(xe(), 1);
62
+
63
+ // ../node_modules/@vitest/utils/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js
64
+ var $r = {
65
+ reset: [0, 0],
66
+ bold: [1, 22, "\x1B[22m\x1B[1m"],
67
+ dim: [2, 22, "\x1B[22m\x1B[2m"],
68
+ italic: [3, 23],
69
+ underline: [4, 24],
70
+ inverse: [7, 27],
71
+ hidden: [8, 28],
72
+ strikethrough: [9, 29],
73
+ black: [30, 39],
74
+ red: [31, 39],
75
+ green: [32, 39],
76
+ yellow: [33, 39],
77
+ blue: [34, 39],
78
+ magenta: [35, 39],
79
+ cyan: [36, 39],
80
+ white: [37, 39],
81
+ gray: [90, 39],
82
+ bgBlack: [40, 49],
83
+ bgRed: [41, 49],
84
+ bgGreen: [42, 49],
85
+ bgYellow: [43, 49],
86
+ bgBlue: [44, 49],
87
+ bgMagenta: [45, 49],
88
+ bgCyan: [46, 49],
89
+ bgWhite: [47, 49],
90
+ blackBright: [90, 39],
91
+ redBright: [91, 39],
92
+ greenBright: [92, 39],
93
+ yellowBright: [93, 39],
94
+ blueBright: [94, 39],
95
+ magentaBright: [95, 39],
96
+ cyanBright: [96, 39],
97
+ whiteBright: [97, 39],
98
+ bgBlackBright: [100, 49],
99
+ bgRedBright: [101, 49],
100
+ bgGreenBright: [102, 49],
101
+ bgYellowBright: [103, 49],
102
+ bgBlueBright: [104, 49],
103
+ bgMagentaBright: [105, 49],
104
+ bgCyanBright: [106, 49],
105
+ bgWhiteBright: [107, 49]
106
+ }, Tr = Object.entries($r);
107
+ function Jt(t) {
108
+ return String(t);
109
+ }
110
+ i(Jt, "a");
111
+ Jt.open = "";
112
+ Jt.close = "";
113
+ function je(t = !1) {
114
+ let e = typeof process < "u" ? process : void 0, n = e?.env || {}, r = e?.argv || [];
115
+ return !("NO_COLOR" in n || r.includes("--no-color")) && ("FORCE_COLOR" in n || r.includes("--color") || e?.platform === "win32" || t && n.
116
+ TERM !== "dumb" || "CI" in n) || typeof window < "u" && !!window.chrome;
117
+ }
118
+ i(je, "C");
119
+ function De(t = !1) {
120
+ let e = je(t), n = /* @__PURE__ */ i((c, u, l, f) => {
121
+ let p = "", a = 0;
122
+ do
123
+ p += c.substring(a, f) + l, a = f + u.length, f = c.indexOf(u, a);
124
+ while (~f);
125
+ return p + c.substring(a);
126
+ }, "i"), r = /* @__PURE__ */ i((c, u, l = c) => {
127
+ let f = /* @__PURE__ */ i((p) => {
128
+ let a = String(p), _ = a.indexOf(u, c.length);
129
+ return ~_ ? c + n(a, u, l, _) + u : c + a + u;
130
+ }, "o");
131
+ return f.open = c, f.close = u, f;
132
+ }, "g"), o = {
133
+ isColorSupported: e
134
+ }, s = /* @__PURE__ */ i((c) => `\x1B[${c}m`, "d");
135
+ for (let [c, u] of Tr)
136
+ o[c] = e ? r(
137
+ s(u[0]),
138
+ s(u[1]),
139
+ u[2]
140
+ ) : Jt;
141
+ return o;
142
+ }
143
+ i(De, "p");
144
+
145
+ // ../node_modules/@vitest/utils/node_modules/tinyrainbow/dist/node.js
146
+ var Fe = require("tty"), v = De((0, Fe.isatty)(1));
147
+
148
+ // ../node_modules/@vitest/utils/node_modules/@vitest/pretty-format/dist/index.js
149
+ function Ar(t, e) {
150
+ let n = Object.keys(t), r = e === null ? n : n.sort(e);
151
+ if (Object.getOwnPropertySymbols)
152
+ for (let o of Object.getOwnPropertySymbols(t))
153
+ Object.getOwnPropertyDescriptor(t, o).enumerable && r.push(o);
154
+ return r;
155
+ }
156
+ i(Ar, "getKeysOfEnumerableProperties");
157
+ function Pt(t, e, n, r, o, s, c = ": ") {
158
+ let u = "", l = 0, f = t.next();
159
+ if (!f.done) {
160
+ u += e.spacingOuter;
161
+ let p = n + e.indent;
162
+ for (; !f.done; ) {
163
+ if (u += p, l++ === e.maxWidth) {
164
+ u += "\u2026";
165
+ break;
166
+ }
167
+ let a = s(
168
+ f.value[0],
169
+ e,
170
+ p,
171
+ r,
172
+ o
173
+ ), _ = s(
174
+ f.value[1],
175
+ e,
176
+ p,
177
+ r,
178
+ o
179
+ );
180
+ u += a + c + _, f = t.next(), f.done ? e.min || (u += ",") : u += `,${e.spacingInner}`;
181
+ }
182
+ u += e.spacingOuter + n;
183
+ }
184
+ return u;
185
+ }
186
+ i(Pt, "printIteratorEntries");
187
+ function vt(t, e, n, r, o, s) {
188
+ let c = "", u = 0, l = t.next();
189
+ if (!l.done) {
190
+ c += e.spacingOuter;
191
+ let f = n + e.indent;
192
+ for (; !l.done; ) {
193
+ if (c += f, u++ === e.maxWidth) {
194
+ c += "\u2026";
195
+ break;
196
+ }
197
+ c += s(l.value, e, f, r, o), l = t.next(), l.done ? e.min || (c += ",") : c += `,${e.spacingInner}`;
198
+ }
199
+ c += e.spacingOuter + n;
200
+ }
201
+ return c;
202
+ }
203
+ i(vt, "printIteratorValues");
204
+ function It(t, e, n, r, o, s) {
205
+ let c = "";
206
+ t = t instanceof ArrayBuffer ? new DataView(t) : t;
207
+ let u = /* @__PURE__ */ i((f) => f instanceof DataView, "isDataView"), l = u(t) ? t.byteLength : t.length;
208
+ if (l > 0) {
209
+ c += e.spacingOuter;
210
+ let f = n + e.indent;
211
+ for (let p = 0; p < l; p++) {
212
+ if (c += f, p === e.maxWidth) {
213
+ c += "\u2026";
214
+ break;
215
+ }
216
+ (u(t) || p in t) && (c += s(
217
+ u(t) ? t.getInt8(p) : t[p],
218
+ e,
219
+ f,
220
+ r,
221
+ o
222
+ )), p < l - 1 ? c += `,${e.spacingInner}` : e.min || (c += ",");
223
+ }
224
+ c += e.spacingOuter + n;
225
+ }
226
+ return c;
227
+ }
228
+ i(It, "printListItems");
229
+ function te(t, e, n, r, o, s) {
230
+ let c = "", u = Ar(t, e.compareKeys);
231
+ if (u.length > 0) {
232
+ c += e.spacingOuter;
233
+ let l = n + e.indent;
234
+ for (let f = 0; f < u.length; f++) {
235
+ let p = u[f], a = s(p, e, l, r, o), _ = s(t[p], e, l, r, o);
236
+ c += `${l + a}: ${_}`, f < u.length - 1 ? c += `,${e.spacingInner}` : e.min || (c += ",");
237
+ }
238
+ c += e.spacingOuter + n;
239
+ }
240
+ return c;
241
+ }
242
+ i(te, "printObjectProperties");
243
+ var Nr = typeof Symbol == "function" && Symbol.for ? Symbol.for("jest.asymmetricMatcher") : 1267621, At = " ", Ir = /* @__PURE__ */ i((t, e, n, r, o, s) => {
244
+ let c = t.toString();
245
+ if (c === "ArrayContaining" || c === "ArrayNotContaining")
246
+ return ++r > e.maxDepth ? `[${c}]` : `${c + At}[${It(
247
+ t.sample,
248
+ e,
249
+ n,
250
+ r,
251
+ o,
252
+ s
253
+ )}]`;
254
+ if (c === "ObjectContaining" || c === "ObjectNotContaining")
255
+ return ++r > e.maxDepth ? `[${c}]` : `${c + At}{${te(
256
+ t.sample,
257
+ e,
258
+ n,
259
+ r,
260
+ o,
261
+ s
262
+ )}}`;
263
+ if (c === "StringMatching" || c === "StringNotMatching" || c === "StringContaining" || c === "StringNotContaining")
264
+ return c + At + s(t.sample, e, n, r, o);
265
+ if (typeof t.toAsymmetricMatcher != "function")
266
+ throw new TypeError(
267
+ `Asymmetric matcher ${t.constructor.name} does not implement toAsymmetricMatcher()`
268
+ );
269
+ return t.toAsymmetricMatcher();
270
+ }, "serialize$5"), Rr = /* @__PURE__ */ i((t) => t && t.$$typeof === Nr, "test$5"), Pr = { serialize: Ir, test: Rr }, Mr = " ", Je = /* @__PURE__ */ new Set(
271
+ ["DOMStringMap", "NamedNodeMap"]), Lr = /^(?:HTML\w*Collection|NodeList)$/;
272
+ function xr(t) {
273
+ return Je.has(t) || Lr.test(t);
274
+ }
275
+ i(xr, "testName");
276
+ var jr = /* @__PURE__ */ i((t) => t && t.constructor && !!t.constructor.name && xr(t.constructor.name), "test$4");
277
+ function Dr(t) {
278
+ return t.constructor.name === "NamedNodeMap";
279
+ }
280
+ i(Dr, "isNamedNodeMap");
281
+ var Fr = /* @__PURE__ */ i((t, e, n, r, o, s) => {
282
+ let c = t.constructor.name;
283
+ return ++r > e.maxDepth ? `[${c}]` : (e.min ? "" : c + Mr) + (Je.has(c) ? `{${te(
284
+ Dr(t) ? [...t].reduce(
285
+ (u, l) => (u[l.name] = l.value, u),
286
+ {}
287
+ ) : { ...t },
288
+ e,
289
+ n,
290
+ r,
291
+ o,
292
+ s
293
+ )}}` : `[${It(
294
+ [...t],
295
+ e,
296
+ n,
297
+ r,
298
+ o,
299
+ s
300
+ )}]`);
301
+ }, "serialize$4"), kr = { serialize: Fr, test: jr };
302
+ function Xe(t) {
303
+ return t.replaceAll("<", "&lt;").replaceAll(">", "&gt;");
304
+ }
305
+ i(Xe, "escapeHTML");
306
+ function ee(t, e, n, r, o, s, c) {
307
+ let u = r + n.indent, l = n.colors;
308
+ return t.map((f) => {
309
+ let p = e[f], a = c(p, n, u, o, s);
310
+ return typeof p != "string" && (a.includes(`
311
+ `) && (a = n.spacingOuter + u + a + n.spacingOuter + r), a = `{${a}}`), `${n.spacingInner + r + l.prop.open + f + l.prop.close}=${l.value.open}${a}${l.
312
+ value.close}`;
313
+ }).join("");
314
+ }
315
+ i(ee, "printProps");
316
+ function ne(t, e, n, r, o, s) {
317
+ return t.map(
318
+ (c) => e.spacingOuter + n + (typeof c == "string" ? Ze(c, e) : s(c, e, n, r, o))
319
+ ).join("");
320
+ }
321
+ i(ne, "printChildren");
322
+ function Ze(t, e) {
323
+ let n = e.colors.content;
324
+ return n.open + Xe(t) + n.close;
325
+ }
326
+ i(Ze, "printText");
327
+ function Br(t, e) {
328
+ let n = e.colors.comment;
329
+ return `${n.open}<!--${Xe(t)}-->${n.close}`;
330
+ }
331
+ i(Br, "printComment");
332
+ function re(t, e, n, r, o) {
333
+ let s = r.colors.tag;
334
+ return `${s.open}<${t}${e && s.close + e + r.spacingOuter + o + s.open}${n ? `>${s.close}${n}${r.spacingOuter}${o}${s.open}</${t}` : `${e &&
335
+ !r.min ? "" : " "}/`}>${s.close}`;
336
+ }
337
+ i(re, "printElement");
338
+ function oe(t, e) {
339
+ let n = e.colors.tag;
340
+ return `${n.open}<${t}${n.close} \u2026${n.open} />${n.close}`;
341
+ }
342
+ i(oe, "printElementAsLeaf");
343
+ var zr = 1, Qe = 3, ve = 8, tn = 11, Ur = /^(?:(?:HTML|SVG)\w*)?Element$/;
344
+ function Yr(t) {
345
+ try {
346
+ return typeof t.hasAttribute == "function" && t.hasAttribute("is");
347
+ } catch {
348
+ return !1;
349
+ }
350
+ }
351
+ i(Yr, "testHasAttribute");
352
+ function Wr(t) {
353
+ let e = t.constructor.name, { nodeType: n, tagName: r } = t, o = typeof r == "string" && r.includes("-") || Yr(t);
354
+ return n === zr && (Ur.test(e) || o) || n === Qe && e === "Text" || n === ve && e === "Comment" || n === tn && e === "DocumentFragment";
355
+ }
356
+ i(Wr, "testNode");
357
+ var Vr = /* @__PURE__ */ i((t) => {
358
+ var e;
359
+ return ((e = t?.constructor) == null ? void 0 : e.name) && Wr(t);
360
+ }, "test$3");
361
+ function Kr(t) {
362
+ return t.nodeType === Qe;
363
+ }
364
+ i(Kr, "nodeIsText");
365
+ function qr(t) {
366
+ return t.nodeType === ve;
367
+ }
368
+ i(qr, "nodeIsComment");
369
+ function Xt(t) {
370
+ return t.nodeType === tn;
371
+ }
372
+ i(Xt, "nodeIsFragment");
373
+ var Gr = /* @__PURE__ */ i((t, e, n, r, o, s) => {
374
+ if (Kr(t))
375
+ return Ze(t.data, e);
376
+ if (qr(t))
377
+ return Br(t.data, e);
378
+ let c = Xt(t) ? "DocumentFragment" : t.tagName.toLowerCase();
379
+ return ++r > e.maxDepth ? oe(c, e) : re(
380
+ c,
381
+ ee(
382
+ Xt(t) ? [] : Array.from(t.attributes, (u) => u.name).sort(),
383
+ Xt(t) ? {} : [...t.attributes].reduce(
384
+ (u, l) => (u[l.name] = l.value, u),
385
+ {}
386
+ ),
387
+ e,
388
+ n + e.indent,
389
+ r,
390
+ o,
391
+ s
392
+ ),
393
+ ne(
394
+ Array.prototype.slice.call(t.childNodes || t.children),
395
+ e,
396
+ n + e.indent,
397
+ r,
398
+ o,
399
+ s
400
+ ),
401
+ e,
402
+ n
403
+ );
404
+ }, "serialize$3"), Hr = { serialize: Gr, test: Vr }, Jr = "@@__IMMUTABLE_ITERABLE__@@", Xr = "@@__IMMUTABLE_LIST__@@", Zr = "@@__IMMUTABLE_K\
405
+ EYED__@@", Qr = "@@__IMMUTABLE_MAP__@@", ke = "@@__IMMUTABLE_ORDERED__@@", vr = "@@__IMMUTABLE_RECORD__@@", to = "@@__IMMUTABLE_SEQ__@@", eo = "\
406
+ @@__IMMUTABLE_SET__@@", no = "@@__IMMUTABLE_STACK__@@", yt = /* @__PURE__ */ i((t) => `Immutable.${t}`, "getImmutableName"), Mt = /* @__PURE__ */ i(
407
+ (t) => `[${t}]`, "printAsLeaf"), Ot = " ", Be = "\u2026";
408
+ function ro(t, e, n, r, o, s, c) {
409
+ return ++r > e.maxDepth ? Mt(yt(c)) : `${yt(c) + Ot}{${Pt(
410
+ t.entries(),
411
+ e,
412
+ n,
413
+ r,
414
+ o,
415
+ s
416
+ )}}`;
417
+ }
418
+ i(ro, "printImmutableEntries");
419
+ function oo(t) {
420
+ let e = 0;
421
+ return {
422
+ next() {
423
+ if (e < t._keys.length) {
424
+ let n = t._keys[e++];
425
+ return { done: !1, value: [n, t.get(n)] };
426
+ }
427
+ return { done: !0, value: void 0 };
428
+ }
429
+ };
430
+ }
431
+ i(oo, "getRecordEntries");
432
+ function so(t, e, n, r, o, s) {
433
+ let c = yt(t._name || "Record");
434
+ return ++r > e.maxDepth ? Mt(c) : `${c + Ot}{${Pt(
435
+ oo(t),
436
+ e,
437
+ n,
438
+ r,
439
+ o,
440
+ s
441
+ )}}`;
442
+ }
443
+ i(so, "printImmutableRecord");
444
+ function io(t, e, n, r, o, s) {
445
+ let c = yt("Seq");
446
+ return ++r > e.maxDepth ? Mt(c) : t[Zr] ? `${c + Ot}{${// from Immutable collection of entries or from ECMAScript object
447
+ t._iter || t._object ? Pt(
448
+ t.entries(),
449
+ e,
450
+ n,
451
+ r,
452
+ o,
453
+ s
454
+ ) : Be}}` : `${c + Ot}[${t._iter || t._array || t._collection || t._iterable ? vt(
455
+ t.values(),
456
+ e,
457
+ n,
458
+ r,
459
+ o,
460
+ s
461
+ ) : Be}]`;
462
+ }
463
+ i(io, "printImmutableSeq");
464
+ function Zt(t, e, n, r, o, s, c) {
465
+ return ++r > e.maxDepth ? Mt(yt(c)) : `${yt(c) + Ot}[${vt(
466
+ t.values(),
467
+ e,
468
+ n,
469
+ r,
470
+ o,
471
+ s
472
+ )}]`;
473
+ }
474
+ i(Zt, "printImmutableValues");
475
+ var co = /* @__PURE__ */ i((t, e, n, r, o, s) => t[Qr] ? ro(
476
+ t,
477
+ e,
478
+ n,
479
+ r,
480
+ o,
481
+ s,
482
+ t[ke] ? "OrderedMap" : "Map"
483
+ ) : t[Xr] ? Zt(
484
+ t,
485
+ e,
486
+ n,
487
+ r,
488
+ o,
489
+ s,
490
+ "List"
491
+ ) : t[eo] ? Zt(
492
+ t,
493
+ e,
494
+ n,
495
+ r,
496
+ o,
497
+ s,
498
+ t[ke] ? "OrderedSet" : "Set"
499
+ ) : t[no] ? Zt(
500
+ t,
501
+ e,
502
+ n,
503
+ r,
504
+ o,
505
+ s,
506
+ "Stack"
507
+ ) : t[to] ? io(t, e, n, r, o, s) : so(t, e, n, r, o, s), "serialize$2"), uo = /* @__PURE__ */ i((t) => t && (t[Jr] === !0 || t[vr] === !0), "\
508
+ test$2"), lo = { serialize: co, test: uo }, Nt = { exports: {} }, T = {};
509
+ var ze;
510
+ function ao() {
511
+ if (ze) return T;
512
+ ze = 1;
513
+ var t = Symbol.for("react.element"), e = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"),
514
+ o = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), c = Symbol.for("react.context"), u = Symbol.for("react.server_context"),
515
+ l = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), a = Symbol.for("react.memo"),
516
+ _ = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), g;
517
+ g = Symbol.for("react.module.reference");
518
+ function y(m) {
519
+ if (typeof m == "object" && m !== null) {
520
+ var b = m.$$typeof;
521
+ switch (b) {
522
+ case t:
523
+ switch (m = m.type, m) {
524
+ case n:
525
+ case o:
526
+ case r:
527
+ case f:
528
+ case p:
529
+ return m;
530
+ default:
531
+ switch (m = m && m.$$typeof, m) {
532
+ case u:
533
+ case c:
534
+ case l:
535
+ case _:
536
+ case a:
537
+ case s:
538
+ return m;
539
+ default:
540
+ return b;
541
+ }
542
+ }
543
+ case e:
544
+ return b;
545
+ }
546
+ }
547
+ }
548
+ return i(y, "v"), T.ContextConsumer = c, T.ContextProvider = s, T.Element = t, T.ForwardRef = l, T.Fragment = n, T.Lazy = _, T.Memo = a, T.
549
+ Portal = e, T.Profiler = o, T.StrictMode = r, T.Suspense = f, T.SuspenseList = p, T.isAsyncMode = function() {
550
+ return !1;
551
+ }, T.isConcurrentMode = function() {
552
+ return !1;
553
+ }, T.isContextConsumer = function(m) {
554
+ return y(m) === c;
555
+ }, T.isContextProvider = function(m) {
556
+ return y(m) === s;
557
+ }, T.isElement = function(m) {
558
+ return typeof m == "object" && m !== null && m.$$typeof === t;
559
+ }, T.isForwardRef = function(m) {
560
+ return y(m) === l;
561
+ }, T.isFragment = function(m) {
562
+ return y(m) === n;
563
+ }, T.isLazy = function(m) {
564
+ return y(m) === _;
565
+ }, T.isMemo = function(m) {
566
+ return y(m) === a;
567
+ }, T.isPortal = function(m) {
568
+ return y(m) === e;
569
+ }, T.isProfiler = function(m) {
570
+ return y(m) === o;
571
+ }, T.isStrictMode = function(m) {
572
+ return y(m) === r;
573
+ }, T.isSuspense = function(m) {
574
+ return y(m) === f;
575
+ }, T.isSuspenseList = function(m) {
576
+ return y(m) === p;
577
+ }, T.isValidElementType = function(m) {
578
+ return typeof m == "string" || typeof m == "function" || m === n || m === o || m === r || m === f || m === p || m === h || typeof m == "\
579
+ object" && m !== null && (m.$$typeof === _ || m.$$typeof === a || m.$$typeof === s || m.$$typeof === c || m.$$typeof === l || m.$$typeof ===
580
+ g || m.getModuleId !== void 0);
581
+ }, T.typeOf = y, T;
582
+ }
583
+ i(ao, "requireReactIs_production_min");
584
+ var A = {};
585
+ var Ue;
586
+ function fo() {
587
+ return Ue || (Ue = 1, process.env.NODE_ENV !== "production" && function() {
588
+ var t = Symbol.for("react.element"), e = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"),
589
+ o = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), c = Symbol.for("react.context"), u = Symbol.for("react.server_contex\
590
+ t"), l = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), a = Symbol.for("react.mem\
591
+ o"), _ = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), g = !1, y = !1, m = !1, b = !1, E = !1, $;
592
+ $ = Symbol.for("react.module.reference");
593
+ function d(w) {
594
+ return !!(typeof w == "string" || typeof w == "function" || w === n || w === o || E || w === r || w === f || w === p || b || w === h ||
595
+ g || y || m || typeof w == "object" && w !== null && (w.$$typeof === _ || w.$$typeof === a || w.$$typeof === s || w.$$typeof === c || w.
596
+ $$typeof === l || // This needs to include all possible module reference object
597
+ // types supported by any Flight configuration anywhere since
598
+ // we don't know which Flight build this will end up being used
599
+ // with.
600
+ w.$$typeof === $ || w.getModuleId !== void 0));
601
+ }
602
+ i(d, "isValidElementType");
603
+ function S(w) {
604
+ if (typeof w == "object" && w !== null) {
605
+ var Gt = w.$$typeof;
606
+ switch (Gt) {
607
+ case t:
608
+ var Tt = w.type;
609
+ switch (Tt) {
610
+ case n:
611
+ case o:
612
+ case r:
613
+ case f:
614
+ case p:
615
+ return Tt;
616
+ default:
617
+ var Re = Tt && Tt.$$typeof;
618
+ switch (Re) {
619
+ case u:
620
+ case c:
621
+ case l:
622
+ case _:
623
+ case a:
624
+ case s:
625
+ return Re;
626
+ default:
627
+ return Gt;
628
+ }
629
+ }
630
+ case e:
631
+ return Gt;
632
+ }
633
+ }
634
+ }
635
+ i(S, "typeOf");
636
+ var C = c, O = s, N = t, G = l, Q = n, P = _, k = a, H = e, Y = o, R = r, L = f, x = p, J = !1, D = !1;
637
+ function V(w) {
638
+ return J || (J = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")), !1;
639
+ }
640
+ i(V, "isAsyncMode");
641
+ function rt(w) {
642
+ return D || (D = !0, console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")), !1;
643
+ }
644
+ i(rt, "isConcurrentMode");
645
+ function K(w) {
646
+ return S(w) === c;
647
+ }
648
+ i(K, "isContextConsumer");
649
+ function q(w) {
650
+ return S(w) === s;
651
+ }
652
+ i(q, "isContextProvider");
653
+ function st(w) {
654
+ return typeof w == "object" && w !== null && w.$$typeof === t;
655
+ }
656
+ i(st, "isElement");
657
+ function X(w) {
658
+ return S(w) === l;
659
+ }
660
+ i(X, "isForwardRef");
661
+ function W(w) {
662
+ return S(w) === n;
663
+ }
664
+ i(W, "isFragment");
665
+ function ot(w) {
666
+ return S(w) === _;
667
+ }
668
+ i(ot, "isLazy");
669
+ function ht(w) {
670
+ return S(w) === a;
671
+ }
672
+ i(ht, "isMemo");
673
+ function ut(w) {
674
+ return S(w) === e;
675
+ }
676
+ i(ut, "isPortal");
677
+ function _t(w) {
678
+ return S(w) === o;
679
+ }
680
+ i(_t, "isProfiler");
681
+ function Ct(w) {
682
+ return S(w) === r;
683
+ }
684
+ i(Ct, "isStrictMode");
685
+ function $t(w) {
686
+ return S(w) === f;
687
+ }
688
+ i($t, "isSuspense");
689
+ function ur(w) {
690
+ return S(w) === p;
691
+ }
692
+ i(ur, "isSuspenseList"), A.ContextConsumer = C, A.ContextProvider = O, A.Element = N, A.ForwardRef = G, A.Fragment = Q, A.Lazy = P, A.Memo =
693
+ k, A.Portal = H, A.Profiler = Y, A.StrictMode = R, A.Suspense = L, A.SuspenseList = x, A.isAsyncMode = V, A.isConcurrentMode = rt, A.isContextConsumer =
694
+ K, A.isContextProvider = q, A.isElement = st, A.isForwardRef = X, A.isFragment = W, A.isLazy = ot, A.isMemo = ht, A.isPortal = ut, A.isProfiler =
695
+ _t, A.isStrictMode = Ct, A.isSuspense = $t, A.isSuspenseList = ur, A.isValidElementType = d, A.typeOf = S;
696
+ }()), A;
697
+ }
698
+ i(fo, "requireReactIs_development");
699
+ var Ye;
700
+ function po() {
701
+ return Ye || (Ye = 1, process.env.NODE_ENV === "production" ? Nt.exports = ao() : Nt.exports = fo()), Nt.exports;
702
+ }
703
+ i(po, "requireReactIs");
704
+ var at = po();
705
+ function en(t, e = []) {
706
+ if (Array.isArray(t))
707
+ for (let n of t)
708
+ en(n, e);
709
+ else t != null && t !== !1 && t !== "" && e.push(t);
710
+ return e;
711
+ }
712
+ i(en, "getChildren");
713
+ function We(t) {
714
+ let e = t.type;
715
+ if (typeof e == "string")
716
+ return e;
717
+ if (typeof e == "function")
718
+ return e.displayName || e.name || "Unknown";
719
+ if (at.isFragment(t))
720
+ return "React.Fragment";
721
+ if (at.isSuspense(t))
722
+ return "React.Suspense";
723
+ if (typeof e == "object" && e !== null) {
724
+ if (at.isContextProvider(t))
725
+ return "Context.Provider";
726
+ if (at.isContextConsumer(t))
727
+ return "Context.Consumer";
728
+ if (at.isForwardRef(t)) {
729
+ if (e.displayName)
730
+ return e.displayName;
731
+ let n = e.render.displayName || e.render.name || "";
732
+ return n === "" ? "ForwardRef" : `ForwardRef(${n})`;
733
+ }
734
+ if (at.isMemo(t)) {
735
+ let n = e.displayName || e.type.displayName || e.type.name || "";
736
+ return n === "" ? "Memo" : `Memo(${n})`;
737
+ }
738
+ }
739
+ return "UNDEFINED";
740
+ }
741
+ i(We, "getType");
742
+ function mo(t) {
743
+ let { props: e } = t;
744
+ return Object.keys(e).filter((n) => n !== "children" && e[n] !== void 0).sort();
745
+ }
746
+ i(mo, "getPropKeys$1");
747
+ var go = /* @__PURE__ */ i((t, e, n, r, o, s) => ++r > e.maxDepth ? oe(We(t), e) : re(
748
+ We(t),
749
+ ee(
750
+ mo(t),
751
+ t.props,
752
+ e,
753
+ n + e.indent,
754
+ r,
755
+ o,
756
+ s
757
+ ),
758
+ ne(
759
+ en(t.props.children),
760
+ e,
761
+ n + e.indent,
762
+ r,
763
+ o,
764
+ s
765
+ ),
766
+ e,
767
+ n
768
+ ), "serialize$1"), ho = /* @__PURE__ */ i((t) => t != null && at.isElement(t), "test$1"), yo = { serialize: go, test: ho }, bo = typeof Symbol ==
769
+ "function" && Symbol.for ? Symbol.for("react.test.json") : 245830487;
770
+ function So(t) {
771
+ let { props: e } = t;
772
+ return e ? Object.keys(e).filter((n) => e[n] !== void 0).sort() : [];
773
+ }
774
+ i(So, "getPropKeys");
775
+ var _o = /* @__PURE__ */ i((t, e, n, r, o, s) => ++r > e.maxDepth ? oe(t.type, e) : re(
776
+ t.type,
777
+ t.props ? ee(
778
+ So(t),
779
+ t.props,
780
+ e,
781
+ n + e.indent,
782
+ r,
783
+ o,
784
+ s
785
+ ) : "",
786
+ t.children ? ne(
787
+ t.children,
788
+ e,
789
+ n + e.indent,
790
+ r,
791
+ o,
792
+ s
793
+ ) : "",
794
+ e,
795
+ n
796
+ ), "serialize"), Eo = /* @__PURE__ */ i((t) => t && t.$$typeof === bo, "test"), Oo = { serialize: _o, test: Eo }, nn = Object.prototype.toString,
797
+ wo = Date.prototype.toISOString, Co = Error.prototype.toString, Ve = RegExp.prototype.toString;
798
+ function Qt(t) {
799
+ return typeof t.constructor == "function" && t.constructor.name || "Object";
800
+ }
801
+ i(Qt, "getConstructorName");
802
+ function $o(t) {
803
+ return typeof window < "u" && t === window;
804
+ }
805
+ i($o, "isWindow");
806
+ var To = /^Symbol\((.*)\)(.*)$/, Ao = /\n/g, Rt = class extends Error {
807
+ static {
808
+ i(this, "PrettyFormatPluginError");
809
+ }
810
+ constructor(e, n) {
811
+ super(e), this.stack = n, this.name = this.constructor.name;
812
+ }
813
+ };
814
+ function No(t) {
815
+ return t === "[object Array]" || t === "[object ArrayBuffer]" || t === "[object DataView]" || t === "[object Float32Array]" || t === "[obj\
816
+ ect Float64Array]" || t === "[object Int8Array]" || t === "[object Int16Array]" || t === "[object Int32Array]" || t === "[object Uint8Array]" ||
817
+ t === "[object Uint8ClampedArray]" || t === "[object Uint16Array]" || t === "[object Uint32Array]";
818
+ }
819
+ i(No, "isToStringedArrayType");
820
+ function Io(t) {
821
+ return Object.is(t, -0) ? "-0" : String(t);
822
+ }
823
+ i(Io, "printNumber");
824
+ function Ro(t) {
825
+ return `${t}n`;
826
+ }
827
+ i(Ro, "printBigInt");
828
+ function Ke(t, e) {
829
+ return e ? `[Function ${t.name || "anonymous"}]` : "[Function]";
830
+ }
831
+ i(Ke, "printFunction");
832
+ function qe(t) {
833
+ return String(t).replace(To, "Symbol($1)");
834
+ }
835
+ i(qe, "printSymbol");
836
+ function Ge(t) {
837
+ return `[${Co.call(t)}]`;
838
+ }
839
+ i(Ge, "printError");
840
+ function rn(t, e, n, r) {
841
+ if (t === !0 || t === !1)
842
+ return `${t}`;
843
+ if (t === void 0)
844
+ return "undefined";
845
+ if (t === null)
846
+ return "null";
847
+ let o = typeof t;
848
+ if (o === "number")
849
+ return Io(t);
850
+ if (o === "bigint")
851
+ return Ro(t);
852
+ if (o === "string")
853
+ return r ? `"${t.replaceAll(/"|\\/g, "\\$&")}"` : `"${t}"`;
854
+ if (o === "function")
855
+ return Ke(t, e);
856
+ if (o === "symbol")
857
+ return qe(t);
858
+ let s = nn.call(t);
859
+ return s === "[object WeakMap]" ? "WeakMap {}" : s === "[object WeakSet]" ? "WeakSet {}" : s === "[object Function]" || s === "[object Gen\
860
+ eratorFunction]" ? Ke(t, e) : s === "[object Symbol]" ? qe(t) : s === "[object Date]" ? Number.isNaN(+t) ? "Date { NaN }" : wo.call(t) : s ===
861
+ "[object Error]" ? Ge(t) : s === "[object RegExp]" ? n ? Ve.call(t).replaceAll(/[$()*+.?[\\\]^{|}]/g, "\\$&") : Ve.call(t) : t instanceof Error ?
862
+ Ge(t) : null;
863
+ }
864
+ i(rn, "printBasicValue");
865
+ function on(t, e, n, r, o, s) {
866
+ if (o.includes(t))
867
+ return "[Circular]";
868
+ o = [...o], o.push(t);
869
+ let c = ++r > e.maxDepth, u = e.min;
870
+ if (e.callToJSON && !c && t.toJSON && typeof t.toJSON == "function" && !s)
871
+ return lt(t.toJSON(), e, n, r, o, !0);
872
+ let l = nn.call(t);
873
+ return l === "[object Arguments]" ? c ? "[Arguments]" : `${u ? "" : "Arguments "}[${It(
874
+ t,
875
+ e,
876
+ n,
877
+ r,
878
+ o,
879
+ lt
880
+ )}]` : No(l) ? c ? `[${t.constructor.name}]` : `${u || !e.printBasicPrototype && t.constructor.name === "Array" ? "" : `${t.constructor.name}\
881
+ `}[${It(t, e, n, r, o, lt)}]` : l === "[object Map]" ? c ? "[Map]" : `Map {${Pt(
882
+ t.entries(),
883
+ e,
884
+ n,
885
+ r,
886
+ o,
887
+ lt,
888
+ " => "
889
+ )}}` : l === "[object Set]" ? c ? "[Set]" : `Set {${vt(
890
+ t.values(),
891
+ e,
892
+ n,
893
+ r,
894
+ o,
895
+ lt
896
+ )}}` : c || $o(t) ? `[${Qt(t)}]` : `${u || !e.printBasicPrototype && Qt(t) === "Object" ? "" : `${Qt(t)} `}{${te(
897
+ t,
898
+ e,
899
+ n,
900
+ r,
901
+ o,
902
+ lt
903
+ )}}`;
904
+ }
905
+ i(on, "printComplexValue");
906
+ function Po(t) {
907
+ return t.serialize != null;
908
+ }
909
+ i(Po, "isNewPlugin");
910
+ function sn(t, e, n, r, o, s) {
911
+ let c;
912
+ try {
913
+ c = Po(t) ? t.serialize(e, n, r, o, s, lt) : t.print(
914
+ e,
915
+ (u) => lt(u, n, r, o, s),
916
+ (u) => {
917
+ let l = r + n.indent;
918
+ return l + u.replaceAll(Ao, `
919
+ ${l}`);
920
+ },
921
+ {
922
+ edgeSpacing: n.spacingOuter,
923
+ min: n.min,
924
+ spacing: n.spacingInner
925
+ },
926
+ n.colors
927
+ );
928
+ } catch (u) {
929
+ throw new Rt(u.message, u.stack);
930
+ }
931
+ if (typeof c != "string")
932
+ throw new TypeError(
933
+ `pretty-format: Plugin must return type "string" but instead returned "${typeof c}".`
934
+ );
935
+ return c;
936
+ }
937
+ i(sn, "printPlugin");
938
+ function cn(t, e) {
939
+ for (let n of t)
940
+ try {
941
+ if (n.test(e))
942
+ return n;
943
+ } catch (r) {
944
+ throw new Rt(r.message, r.stack);
945
+ }
946
+ return null;
947
+ }
948
+ i(cn, "findPlugin");
949
+ function lt(t, e, n, r, o, s) {
950
+ let c = cn(e.plugins, t);
951
+ if (c !== null)
952
+ return sn(c, t, e, n, r, o);
953
+ let u = rn(
954
+ t,
955
+ e.printFunctionName,
956
+ e.escapeRegex,
957
+ e.escapeString
958
+ );
959
+ return u !== null ? u : on(
960
+ t,
961
+ e,
962
+ n,
963
+ r,
964
+ o,
965
+ s
966
+ );
967
+ }
968
+ i(lt, "printer");
969
+ var se = {
970
+ comment: "gray",
971
+ content: "reset",
972
+ prop: "yellow",
973
+ tag: "cyan",
974
+ value: "green"
975
+ }, un = Object.keys(se), tt = {
976
+ callToJSON: !0,
977
+ compareKeys: void 0,
978
+ escapeRegex: !1,
979
+ escapeString: !0,
980
+ highlight: !1,
981
+ indent: 2,
982
+ maxDepth: Number.POSITIVE_INFINITY,
983
+ maxWidth: Number.POSITIVE_INFINITY,
984
+ min: !1,
985
+ plugins: [],
986
+ printBasicPrototype: !0,
987
+ printFunctionName: !0,
988
+ theme: se
989
+ };
990
+ function Mo(t) {
991
+ for (let e of Object.keys(t))
992
+ if (!Object.prototype.hasOwnProperty.call(tt, e))
993
+ throw new Error(`pretty-format: Unknown option "${e}".`);
994
+ if (t.min && t.indent !== void 0 && t.indent !== 0)
995
+ throw new Error(
996
+ 'pretty-format: Options "min" and "indent" cannot be used together.'
997
+ );
998
+ }
999
+ i(Mo, "validateOptions");
1000
+ function Lo() {
1001
+ return un.reduce((t, e) => {
1002
+ let n = se[e], r = n && v[n];
1003
+ if (r && typeof r.close == "string" && typeof r.open == "string")
1004
+ t[e] = r;
1005
+ else
1006
+ throw new Error(
1007
+ `pretty-format: Option "theme" has a key "${e}" whose value "${n}" is undefined in ansi-styles.`
1008
+ );
1009
+ return t;
1010
+ }, /* @__PURE__ */ Object.create(null));
1011
+ }
1012
+ i(Lo, "getColorsHighlight");
1013
+ function xo() {
1014
+ return un.reduce((t, e) => (t[e] = { close: "", open: "" }, t), /* @__PURE__ */ Object.create(null));
1015
+ }
1016
+ i(xo, "getColorsEmpty");
1017
+ function ln(t) {
1018
+ return t?.printFunctionName ?? tt.printFunctionName;
1019
+ }
1020
+ i(ln, "getPrintFunctionName");
1021
+ function an(t) {
1022
+ return t?.escapeRegex ?? tt.escapeRegex;
1023
+ }
1024
+ i(an, "getEscapeRegex");
1025
+ function fn(t) {
1026
+ return t?.escapeString ?? tt.escapeString;
1027
+ }
1028
+ i(fn, "getEscapeString");
1029
+ function He(t) {
1030
+ return {
1031
+ callToJSON: t?.callToJSON ?? tt.callToJSON,
1032
+ colors: t?.highlight ? Lo() : xo(),
1033
+ compareKeys: typeof t?.compareKeys == "function" || t?.compareKeys === null ? t.compareKeys : tt.compareKeys,
1034
+ escapeRegex: an(t),
1035
+ escapeString: fn(t),
1036
+ indent: t?.min ? "" : jo(t?.indent ?? tt.indent),
1037
+ maxDepth: t?.maxDepth ?? tt.maxDepth,
1038
+ maxWidth: t?.maxWidth ?? tt.maxWidth,
1039
+ min: t?.min ?? tt.min,
1040
+ plugins: t?.plugins ?? tt.plugins,
1041
+ printBasicPrototype: t?.printBasicPrototype ?? !0,
1042
+ printFunctionName: ln(t),
1043
+ spacingInner: t?.min ? " " : `
1044
+ `,
1045
+ spacingOuter: t?.min ? "" : `
1046
+ `
1047
+ };
1048
+ }
1049
+ i(He, "getConfig");
1050
+ function jo(t) {
1051
+ return Array.from({ length: t + 1 }).join(" ");
1052
+ }
1053
+ i(jo, "createIndent");
1054
+ function Z(t, e) {
1055
+ if (e && (Mo(e), e.plugins)) {
1056
+ let r = cn(e.plugins, t);
1057
+ if (r !== null)
1058
+ return sn(r, t, He(e), "", 0, []);
1059
+ }
1060
+ let n = rn(
1061
+ t,
1062
+ ln(e),
1063
+ an(e),
1064
+ fn(e)
1065
+ );
1066
+ return n !== null ? n : on(t, He(e), "", 0, []);
1067
+ }
1068
+ i(Z, "format");
1069
+ var Lt = {
1070
+ AsymmetricMatcher: Pr,
1071
+ DOMCollection: kr,
1072
+ DOMElement: Hr,
1073
+ Immutable: lo,
1074
+ ReactElement: yo,
1075
+ ReactTestComponent: Oo
1076
+ };
1077
+
1078
+ // ../node_modules/loupe/lib/helpers.js
1079
+ var pn = {
1080
+ bold: ["1", "22"],
1081
+ dim: ["2", "22"],
1082
+ italic: ["3", "23"],
1083
+ underline: ["4", "24"],
1084
+ // 5 & 6 are blinking
1085
+ inverse: ["7", "27"],
1086
+ hidden: ["8", "28"],
1087
+ strike: ["9", "29"],
1088
+ // 10-20 are fonts
1089
+ // 21-29 are resets for 1-9
1090
+ black: ["30", "39"],
1091
+ red: ["31", "39"],
1092
+ green: ["32", "39"],
1093
+ yellow: ["33", "39"],
1094
+ blue: ["34", "39"],
1095
+ magenta: ["35", "39"],
1096
+ cyan: ["36", "39"],
1097
+ white: ["37", "39"],
1098
+ brightblack: ["30;1", "39"],
1099
+ brightred: ["31;1", "39"],
1100
+ brightgreen: ["32;1", "39"],
1101
+ brightyellow: ["33;1", "39"],
1102
+ brightblue: ["34;1", "39"],
1103
+ brightmagenta: ["35;1", "39"],
1104
+ brightcyan: ["36;1", "39"],
1105
+ brightwhite: ["37;1", "39"],
1106
+ grey: ["90", "39"]
1107
+ }, Do = {
1108
+ special: "cyan",
1109
+ number: "yellow",
1110
+ bigint: "yellow",
1111
+ boolean: "yellow",
1112
+ undefined: "grey",
1113
+ null: "bold",
1114
+ string: "green",
1115
+ symbol: "green",
1116
+ date: "magenta",
1117
+ regexp: "red"
1118
+ }, it = "\u2026";
1119
+ function Fo(t, e) {
1120
+ let n = pn[Do[e]] || pn[e] || "";
1121
+ return n ? `\x1B[${n[0]}m${String(t)}\x1B[${n[1]}m` : String(t);
1122
+ }
1123
+ i(Fo, "colorise");
1124
+ function mn({
1125
+ showHidden: t = !1,
1126
+ depth: e = 2,
1127
+ colors: n = !1,
1128
+ customInspect: r = !0,
1129
+ showProxy: o = !1,
1130
+ maxArrayLength: s = 1 / 0,
1131
+ breakLength: c = 1 / 0,
1132
+ seen: u = [],
1133
+ // eslint-disable-next-line no-shadow
1134
+ truncate: l = 1 / 0,
1135
+ stylize: f = String
1136
+ } = {}, p) {
1137
+ let a = {
1138
+ showHidden: !!t,
1139
+ depth: Number(e),
1140
+ colors: !!n,
1141
+ customInspect: !!r,
1142
+ showProxy: !!o,
1143
+ maxArrayLength: Number(s),
1144
+ breakLength: Number(c),
1145
+ truncate: Number(l),
1146
+ seen: u,
1147
+ inspect: p,
1148
+ stylize: f
1149
+ };
1150
+ return a.colors && (a.stylize = Fo), a;
1151
+ }
1152
+ i(mn, "normaliseOptions");
1153
+ function ko(t) {
1154
+ return t >= "\uD800" && t <= "\uDBFF";
1155
+ }
1156
+ i(ko, "isHighSurrogate");
1157
+ function B(t, e, n = it) {
1158
+ t = String(t);
1159
+ let r = n.length, o = t.length;
1160
+ if (r > e && o > r)
1161
+ return n;
1162
+ if (o > e && o > r) {
1163
+ let s = e - r;
1164
+ return s > 0 && ko(t[s - 1]) && (s = s - 1), `${t.slice(0, s)}${n}`;
1165
+ }
1166
+ return t;
1167
+ }
1168
+ i(B, "truncate");
1169
+ function j(t, e, n, r = ", ") {
1170
+ n = n || e.inspect;
1171
+ let o = t.length;
1172
+ if (o === 0)
1173
+ return "";
1174
+ let s = e.truncate, c = "", u = "", l = "";
1175
+ for (let f = 0; f < o; f += 1) {
1176
+ let p = f + 1 === t.length, a = f + 2 === t.length;
1177
+ l = `${it}(${t.length - f})`;
1178
+ let _ = t[f];
1179
+ e.truncate = s - c.length - (p ? 0 : r.length);
1180
+ let h = u || n(_, e) + (p ? "" : r), g = c.length + h.length, y = g + l.length;
1181
+ if (p && g > s && c.length + l.length <= s || !p && !a && y > s || (u = p ? "" : n(t[f + 1], e) + (a ? "" : r), !p && a && y > s && g + u.
1182
+ length > s))
1183
+ break;
1184
+ if (c += h, !p && !a && g + u.length >= s) {
1185
+ l = `${it}(${t.length - f - 1})`;
1186
+ break;
1187
+ }
1188
+ l = "";
1189
+ }
1190
+ return `${c}${l}`;
1191
+ }
1192
+ i(j, "inspectList");
1193
+ function Bo(t) {
1194
+ return t.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/) ? t : JSON.stringify(t).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
1195
+ }
1196
+ i(Bo, "quoteComplexKey");
1197
+ function ct([t, e], n) {
1198
+ return n.truncate -= 2, typeof t == "string" ? t = Bo(t) : typeof t != "number" && (t = `[${n.inspect(t, n)}]`), n.truncate -= t.length, e =
1199
+ n.inspect(e, n), `${t}: ${e}`;
1200
+ }
1201
+ i(ct, "inspectProperty");
1202
+
1203
+ // ../node_modules/loupe/lib/array.js
1204
+ function ie(t, e) {
1205
+ let n = Object.keys(t).slice(t.length);
1206
+ if (!t.length && !n.length)
1207
+ return "[]";
1208
+ e.truncate -= 4;
1209
+ let r = j(t, e);
1210
+ e.truncate -= r.length;
1211
+ let o = "";
1212
+ return n.length && (o = j(n.map((s) => [s, t[s]]), e, ct)), `[ ${r}${o ? `, ${o}` : ""} ]`;
1213
+ }
1214
+ i(ie, "inspectArray");
1215
+
1216
+ // ../node_modules/loupe/lib/typedarray.js
1217
+ var zo = /* @__PURE__ */ i((t) => typeof Buffer == "function" && t instanceof Buffer ? "Buffer" : t[Symbol.toStringTag] ? t[Symbol.toStringTag] :
1218
+ t.constructor.name, "getArrayName");
1219
+ function et(t, e) {
1220
+ let n = zo(t);
1221
+ e.truncate -= n.length + 4;
1222
+ let r = Object.keys(t).slice(t.length);
1223
+ if (!t.length && !r.length)
1224
+ return `${n}[]`;
1225
+ let o = "";
1226
+ for (let c = 0; c < t.length; c++) {
1227
+ let u = `${e.stylize(B(t[c], e.truncate), "number")}${c === t.length - 1 ? "" : ", "}`;
1228
+ if (e.truncate -= u.length, t[c] !== t.length && e.truncate <= 3) {
1229
+ o += `${it}(${t.length - t[c] + 1})`;
1230
+ break;
1231
+ }
1232
+ o += u;
1233
+ }
1234
+ let s = "";
1235
+ return r.length && (s = j(r.map((c) => [c, t[c]]), e, ct)), `${n}[ ${o}${s ? `, ${s}` : ""} ]`;
1236
+ }
1237
+ i(et, "inspectTypedArray");
1238
+
1239
+ // ../node_modules/loupe/lib/date.js
1240
+ function ce(t, e) {
1241
+ let n = t.toJSON();
1242
+ if (n === null)
1243
+ return "Invalid Date";
1244
+ let r = n.split("T"), o = r[0];
1245
+ return e.stylize(`${o}T${B(r[1], e.truncate - o.length - 1)}`, "date");
1246
+ }
1247
+ i(ce, "inspectDate");
1248
+
1249
+ // ../node_modules/loupe/lib/function.js
1250
+ function xt(t, e) {
1251
+ let n = t[Symbol.toStringTag] || "Function", r = t.name;
1252
+ return r ? e.stylize(`[${n} ${B(r, e.truncate - 11)}]`, "special") : e.stylize(`[${n}]`, "special");
1253
+ }
1254
+ i(xt, "inspectFunction");
1255
+
1256
+ // ../node_modules/loupe/lib/map.js
1257
+ function Uo([t, e], n) {
1258
+ return n.truncate -= 4, t = n.inspect(t, n), n.truncate -= t.length, e = n.inspect(e, n), `${t} => ${e}`;
1259
+ }
1260
+ i(Uo, "inspectMapEntry");
1261
+ function Yo(t) {
1262
+ let e = [];
1263
+ return t.forEach((n, r) => {
1264
+ e.push([r, n]);
1265
+ }), e;
1266
+ }
1267
+ i(Yo, "mapToEntries");
1268
+ function ue(t, e) {
1269
+ return t.size - 1 <= 0 ? "Map{}" : (e.truncate -= 7, `Map{ ${j(Yo(t), e, Uo)} }`);
1270
+ }
1271
+ i(ue, "inspectMap");
1272
+
1273
+ // ../node_modules/loupe/lib/number.js
1274
+ var Wo = Number.isNaN || ((t) => t !== t);
1275
+ function jt(t, e) {
1276
+ return Wo(t) ? e.stylize("NaN", "number") : t === 1 / 0 ? e.stylize("Infinity", "number") : t === -1 / 0 ? e.stylize("-Infinity", "number") :
1277
+ t === 0 ? e.stylize(1 / t === 1 / 0 ? "+0" : "-0", "number") : e.stylize(B(String(t), e.truncate), "number");
1278
+ }
1279
+ i(jt, "inspectNumber");
1280
+
1281
+ // ../node_modules/loupe/lib/bigint.js
1282
+ function Dt(t, e) {
1283
+ let n = B(t.toString(), e.truncate - 1);
1284
+ return n !== it && (n += "n"), e.stylize(n, "bigint");
1285
+ }
1286
+ i(Dt, "inspectBigInt");
1287
+
1288
+ // ../node_modules/loupe/lib/regexp.js
1289
+ function le(t, e) {
1290
+ let n = t.toString().split("/")[2], r = e.truncate - (2 + n.length), o = t.source;
1291
+ return e.stylize(`/${B(o, r)}/${n}`, "regexp");
1292
+ }
1293
+ i(le, "inspectRegExp");
1294
+
1295
+ // ../node_modules/loupe/lib/set.js
1296
+ function Vo(t) {
1297
+ let e = [];
1298
+ return t.forEach((n) => {
1299
+ e.push(n);
1300
+ }), e;
1301
+ }
1302
+ i(Vo, "arrayFromSet");
1303
+ function ae(t, e) {
1304
+ return t.size === 0 ? "Set{}" : (e.truncate -= 7, `Set{ ${j(Vo(t), e)} }`);
1305
+ }
1306
+ i(ae, "inspectSet");
1307
+
1308
+ // ../node_modules/loupe/lib/string.js
1309
+ var gn = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\u\
1310
+ ffff]", "g"), Ko = {
1311
+ "\b": "\\b",
1312
+ " ": "\\t",
1313
+ "\n": "\\n",
1314
+ "\f": "\\f",
1315
+ "\r": "\\r",
1316
+ "'": "\\'",
1317
+ "\\": "\\\\"
1318
+ }, qo = 16, Go = 4;
1319
+ function Ho(t) {
1320
+ return Ko[t] || `\\u${`0000${t.charCodeAt(0).toString(qo)}`.slice(-Go)}`;
1321
+ }
1322
+ i(Ho, "escape");
1323
+ function Ft(t, e) {
1324
+ return gn.test(t) && (t = t.replace(gn, Ho)), e.stylize(`'${B(t, e.truncate - 2)}'`, "string");
1325
+ }
1326
+ i(Ft, "inspectString");
1327
+
1328
+ // ../node_modules/loupe/lib/symbol.js
1329
+ function kt(t) {
1330
+ return "description" in Symbol.prototype ? t.description ? `Symbol(${t.description})` : "Symbol()" : t.toString();
1331
+ }
1332
+ i(kt, "inspectSymbol");
1333
+
1334
+ // ../node_modules/loupe/lib/promise.js
1335
+ var hn = /* @__PURE__ */ i(() => "Promise{\u2026}", "getPromiseValue");
1336
+ try {
1337
+ let { getPromiseDetails: t, kPending: e, kRejected: n } = process.binding("util");
1338
+ Array.isArray(t(Promise.resolve())) && (hn = /* @__PURE__ */ i((r, o) => {
1339
+ let [s, c] = t(r);
1340
+ return s === e ? "Promise{<pending>}" : `Promise${s === n ? "!" : ""}{${o.inspect(c, o)}}`;
1341
+ }, "getPromiseValue"));
1342
+ } catch {
1343
+ }
1344
+ var yn = hn;
1345
+
1346
+ // ../node_modules/loupe/lib/object.js
1347
+ function ft(t, e) {
1348
+ let n = Object.getOwnPropertyNames(t), r = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t) : [];
1349
+ if (n.length === 0 && r.length === 0)
1350
+ return "{}";
1351
+ if (e.truncate -= 4, e.seen = e.seen || [], e.seen.includes(t))
1352
+ return "[Circular]";
1353
+ e.seen.push(t);
1354
+ let o = j(n.map((u) => [u, t[u]]), e, ct), s = j(r.map((u) => [u, t[u]]), e, ct);
1355
+ e.seen.pop();
1356
+ let c = "";
1357
+ return o && s && (c = ", "), `{ ${o}${c}${s} }`;
1358
+ }
1359
+ i(ft, "inspectObject");
1360
+
1361
+ // ../node_modules/loupe/lib/class.js
1362
+ var fe = typeof Symbol < "u" && Symbol.toStringTag ? Symbol.toStringTag : !1;
1363
+ function pe(t, e) {
1364
+ let n = "";
1365
+ return fe && fe in t && (n = t[fe]), n = n || t.constructor.name, (!n || n === "_class") && (n = "<Anonymous Class>"), e.truncate -= n.length,
1366
+ `${n}${ft(t, e)}`;
1367
+ }
1368
+ i(pe, "inspectClass");
1369
+
1370
+ // ../node_modules/loupe/lib/arguments.js
1371
+ function me(t, e) {
1372
+ return t.length === 0 ? "Arguments[]" : (e.truncate -= 13, `Arguments[ ${j(t, e)} ]`);
1373
+ }
1374
+ i(me, "inspectArguments");
1375
+
1376
+ // ../node_modules/loupe/lib/error.js
1377
+ var Jo = [
1378
+ "stack",
1379
+ "line",
1380
+ "column",
1381
+ "name",
1382
+ "message",
1383
+ "fileName",
1384
+ "lineNumber",
1385
+ "columnNumber",
1386
+ "number",
1387
+ "description",
1388
+ "cause"
1389
+ ];
1390
+ function ge(t, e) {
1391
+ let n = Object.getOwnPropertyNames(t).filter((c) => Jo.indexOf(c) === -1), r = t.name;
1392
+ e.truncate -= r.length;
1393
+ let o = "";
1394
+ if (typeof t.message == "string" ? o = B(t.message, e.truncate) : n.unshift("message"), o = o ? `: ${o}` : "", e.truncate -= o.length + 5,
1395
+ e.seen = e.seen || [], e.seen.includes(t))
1396
+ return "[Circular]";
1397
+ e.seen.push(t);
1398
+ let s = j(n.map((c) => [c, t[c]]), e, ct);
1399
+ return `${r}${o}${s ? ` { ${s} }` : ""}`;
1400
+ }
1401
+ i(ge, "inspectObject");
1402
+
1403
+ // ../node_modules/loupe/lib/html.js
1404
+ function Xo([t, e], n) {
1405
+ return n.truncate -= 3, e ? `${n.stylize(String(t), "yellow")}=${n.stylize(`"${e}"`, "string")}` : `${n.stylize(String(t), "yellow")}`;
1406
+ }
1407
+ i(Xo, "inspectAttribute");
1408
+ function Bt(t, e) {
1409
+ return j(t, e, zt, `
1410
+ `);
1411
+ }
1412
+ i(Bt, "inspectHTMLCollection");
1413
+ function zt(t, e) {
1414
+ let n = t.getAttributeNames(), r = t.tagName.toLowerCase(), o = e.stylize(`<${r}`, "special"), s = e.stylize(">", "special"), c = e.stylize(
1415
+ `</${r}>`, "special");
1416
+ e.truncate -= r.length * 2 + 5;
1417
+ let u = "";
1418
+ n.length > 0 && (u += " ", u += j(n.map((p) => [p, t.getAttribute(p)]), e, Xo, " ")), e.truncate -= u.length;
1419
+ let l = e.truncate, f = Bt(t.children, e);
1420
+ return f && f.length > l && (f = `${it}(${t.children.length})`), `${o}${u}${s}${f}${c}`;
1421
+ }
1422
+ i(zt, "inspectHTML");
1423
+
1424
+ // ../node_modules/loupe/lib/index.js
1425
+ var Zo = typeof Symbol == "function" && typeof Symbol.for == "function", he = Zo ? Symbol.for("chai/inspect") : "@@chai/inspect", dt = !1;
1426
+ try {
1427
+ let t = require("util");
1428
+ dt = t.inspect ? t.inspect.custom : !1;
1429
+ } catch {
1430
+ dt = !1;
1431
+ }
1432
+ var dn = /* @__PURE__ */ new WeakMap(), bn = {}, Sn = {
1433
+ undefined: /* @__PURE__ */ i((t, e) => e.stylize("undefined", "undefined"), "undefined"),
1434
+ null: /* @__PURE__ */ i((t, e) => e.stylize("null", "null"), "null"),
1435
+ boolean: /* @__PURE__ */ i((t, e) => e.stylize(String(t), "boolean"), "boolean"),
1436
+ Boolean: /* @__PURE__ */ i((t, e) => e.stylize(String(t), "boolean"), "Boolean"),
1437
+ number: jt,
1438
+ Number: jt,
1439
+ bigint: Dt,
1440
+ BigInt: Dt,
1441
+ string: Ft,
1442
+ String: Ft,
1443
+ function: xt,
1444
+ Function: xt,
1445
+ symbol: kt,
1446
+ // A Symbol polyfill will return `Symbol` not `symbol` from typedetect
1447
+ Symbol: kt,
1448
+ Array: ie,
1449
+ Date: ce,
1450
+ Map: ue,
1451
+ Set: ae,
1452
+ RegExp: le,
1453
+ Promise: yn,
1454
+ // WeakSet, WeakMap are totally opaque to us
1455
+ WeakSet: /* @__PURE__ */ i((t, e) => e.stylize("WeakSet{\u2026}", "special"), "WeakSet"),
1456
+ WeakMap: /* @__PURE__ */ i((t, e) => e.stylize("WeakMap{\u2026}", "special"), "WeakMap"),
1457
+ Arguments: me,
1458
+ Int8Array: et,
1459
+ Uint8Array: et,
1460
+ Uint8ClampedArray: et,
1461
+ Int16Array: et,
1462
+ Uint16Array: et,
1463
+ Int32Array: et,
1464
+ Uint32Array: et,
1465
+ Float32Array: et,
1466
+ Float64Array: et,
1467
+ Generator: /* @__PURE__ */ i(() => "", "Generator"),
1468
+ DataView: /* @__PURE__ */ i(() => "", "DataView"),
1469
+ ArrayBuffer: /* @__PURE__ */ i(() => "", "ArrayBuffer"),
1470
+ Error: ge,
1471
+ HTMLCollection: Bt,
1472
+ NodeList: Bt
1473
+ }, Qo = /* @__PURE__ */ i((t, e, n) => he in t && typeof t[he] == "function" ? t[he](e) : dt && dt in t && typeof t[dt] == "function" ? t[dt](
1474
+ e.depth, e) : "inspect" in t && typeof t.inspect == "function" ? t.inspect(e.depth, e) : "constructor" in t && dn.has(t.constructor) ? dn.get(
1475
+ t.constructor)(t, e) : bn[n] ? bn[n](t, e) : "", "inspectCustom"), vo = Object.prototype.toString;
1476
+ function Ut(t, e = {}) {
1477
+ let n = mn(e, Ut), { customInspect: r } = n, o = t === null ? "null" : typeof t;
1478
+ if (o === "object" && (o = vo.call(t).slice(8, -1)), o in Sn)
1479
+ return Sn[o](t, n);
1480
+ if (r && t) {
1481
+ let c = Qo(t, n, o);
1482
+ if (c)
1483
+ return typeof c == "string" ? c : Ut(c, n);
1484
+ }
1485
+ let s = t ? Object.getPrototypeOf(t) : !1;
1486
+ return s === Object.prototype || s === null ? ft(t, n) : t && typeof HTMLElement == "function" && t instanceof HTMLElement ? zt(t, n) : "c\
1487
+ onstructor" in t ? t.constructor !== Object ? pe(t, n) : ft(t, n) : t === Object(t) ? ft(t, n) : n.stylize(String(t), o);
1488
+ }
1489
+ i(Ut, "inspect");
1490
+
1491
+ // ../node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js
1492
+ var {
1493
+ AsymmetricMatcher: es,
1494
+ DOMCollection: ns,
1495
+ DOMElement: rs,
1496
+ Immutable: os,
1497
+ ReactElement: ss,
1498
+ ReactTestComponent: is
1499
+ } = Lt, _n = [
1500
+ is,
1501
+ ss,
1502
+ rs,
1503
+ ns,
1504
+ os,
1505
+ es
1506
+ ];
1507
+ function pt(t, e = 10, { maxLength: n, ...r } = {}) {
1508
+ let o = n ?? 1e4, s;
1509
+ try {
1510
+ s = Z(t, {
1511
+ maxDepth: e,
1512
+ escapeString: !1,
1513
+ // min: true,
1514
+ plugins: _n,
1515
+ ...r
1516
+ });
1517
+ } catch {
1518
+ s = Z(t, {
1519
+ callToJSON: !1,
1520
+ maxDepth: e,
1521
+ escapeString: !1,
1522
+ // min: true,
1523
+ plugins: _n,
1524
+ ...r
1525
+ });
1526
+ }
1527
+ return s.length >= o && e > 1 ? pt(t, Math.floor(e / 2)) : s;
1528
+ }
1529
+ i(pt, "stringify");
1530
+ var cs = /%[sdjifoOc%]/g;
1531
+ function En(...t) {
1532
+ if (typeof t[0] != "string") {
1533
+ let s = [];
1534
+ for (let c = 0; c < t.length; c++)
1535
+ s.push(wt(t[c], { depth: 0, colors: !1 }));
1536
+ return s.join(" ");
1537
+ }
1538
+ let e = t.length, n = 1, r = t[0], o = String(r).replace(cs, (s) => {
1539
+ if (s === "%%")
1540
+ return "%";
1541
+ if (n >= e)
1542
+ return s;
1543
+ switch (s) {
1544
+ case "%s": {
1545
+ let c = t[n++];
1546
+ return typeof c == "bigint" ? `${c.toString()}n` : typeof c == "number" && c === 0 && 1 / c < 0 ? "-0" : typeof c == "object" && c !==
1547
+ null ? wt(c, { depth: 0, colors: !1 }) : String(c);
1548
+ }
1549
+ case "%d": {
1550
+ let c = t[n++];
1551
+ return typeof c == "bigint" ? `${c.toString()}n` : Number(c).toString();
1552
+ }
1553
+ case "%i": {
1554
+ let c = t[n++];
1555
+ return typeof c == "bigint" ? `${c.toString()}n` : Number.parseInt(String(c)).toString();
1556
+ }
1557
+ case "%f":
1558
+ return Number.parseFloat(String(t[n++])).toString();
1559
+ case "%o":
1560
+ return wt(t[n++], { showHidden: !0, showProxy: !0 });
1561
+ case "%O":
1562
+ return wt(t[n++]);
1563
+ case "%c":
1564
+ return n++, "";
1565
+ case "%j":
1566
+ try {
1567
+ return JSON.stringify(t[n++]);
1568
+ } catch (c) {
1569
+ let u = c.message;
1570
+ if (
1571
+ // chromium
1572
+ u.includes("circular structure") || u.includes("cyclic structures") || u.includes("cyclic object")
1573
+ )
1574
+ return "[Circular]";
1575
+ throw c;
1576
+ }
1577
+ default:
1578
+ return s;
1579
+ }
1580
+ });
1581
+ for (let s = t[n]; n < e; s = t[++n])
1582
+ s === null || typeof s != "object" ? o += ` ${s}` : o += ` ${wt(s)}`;
1583
+ return o;
1584
+ }
1585
+ i(En, "format");
1586
+ function wt(t, e = {}) {
1587
+ return e.truncate === 0 && (e.truncate = Number.POSITIVE_INFINITY), Ut(t, e);
1588
+ }
1589
+ i(wt, "inspect");
1590
+ function On(t) {
1591
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
1592
+ }
1593
+ i(On, "getDefaultExportFromCjs");
1594
+
1595
+ // ../node_modules/@vitest/utils/dist/helpers.js
1596
+ function us(t) {
1597
+ return t === Object.prototype || t === Function.prototype || t === RegExp.prototype;
1598
+ }
1599
+ i(us, "isFinalObj");
1600
+ function Yt(t) {
1601
+ return Object.prototype.toString.apply(t).slice(8, -1);
1602
+ }
1603
+ i(Yt, "getType");
1604
+ function ls(t, e) {
1605
+ let n = typeof e == "function" ? e : (r) => e.add(r);
1606
+ Object.getOwnPropertyNames(t).forEach(n), Object.getOwnPropertySymbols(t).forEach(n);
1607
+ }
1608
+ i(ls, "collectOwnProperties");
1609
+ function de(t) {
1610
+ let e = /* @__PURE__ */ new Set();
1611
+ return us(t) ? [] : (ls(t, e), Array.from(e));
1612
+ }
1613
+ i(de, "getOwnProperties");
1614
+ var wn = { forceWritable: !1 };
1615
+ function be(t, e = wn) {
1616
+ return ye(t, /* @__PURE__ */ new WeakMap(), e);
1617
+ }
1618
+ i(be, "deepClone");
1619
+ function ye(t, e, n = wn) {
1620
+ let r, o;
1621
+ if (e.has(t))
1622
+ return e.get(t);
1623
+ if (Array.isArray(t)) {
1624
+ for (o = Array.from({ length: r = t.length }), e.set(t, o); r--; )
1625
+ o[r] = ye(t[r], e, n);
1626
+ return o;
1627
+ }
1628
+ if (Object.prototype.toString.call(t) === "[object Object]") {
1629
+ o = Object.create(Object.getPrototypeOf(t)), e.set(t, o);
1630
+ let s = de(t);
1631
+ for (let c of s) {
1632
+ let u = Object.getOwnPropertyDescriptor(t, c);
1633
+ if (!u)
1634
+ continue;
1635
+ let l = ye(t[c], e, n);
1636
+ n.forceWritable ? Object.defineProperty(o, c, {
1637
+ enumerable: u.enumerable,
1638
+ configurable: !0,
1639
+ writable: !0,
1640
+ value: l
1641
+ }) : "get" in u ? Object.defineProperty(o, c, {
1642
+ ...u,
1643
+ get() {
1644
+ return l;
1645
+ }
1646
+ }) : Object.defineProperty(o, c, {
1647
+ ...u,
1648
+ value: l
1649
+ });
1650
+ }
1651
+ return o;
1652
+ }
1653
+ return t;
1654
+ }
1655
+ i(ye, "clone");
1656
+
1657
+ // ../node_modules/@vitest/utils/dist/diff.js
1658
+ function Cn(t) {
1659
+ if (t === void 0)
1660
+ return "undefined";
1661
+ if (t === null)
1662
+ return "null";
1663
+ if (Array.isArray(t))
1664
+ return "array";
1665
+ if (typeof t == "boolean")
1666
+ return "boolean";
1667
+ if (typeof t == "function")
1668
+ return "function";
1669
+ if (typeof t == "number")
1670
+ return "number";
1671
+ if (typeof t == "string")
1672
+ return "string";
1673
+ if (typeof t == "bigint")
1674
+ return "bigint";
1675
+ if (typeof t == "object") {
1676
+ if (t != null) {
1677
+ if (t.constructor === RegExp)
1678
+ return "regexp";
1679
+ if (t.constructor === Map)
1680
+ return "map";
1681
+ if (t.constructor === Set)
1682
+ return "set";
1683
+ if (t.constructor === Date)
1684
+ return "date";
1685
+ }
1686
+ return "object";
1687
+ } else if (typeof t == "symbol")
1688
+ return "symbol";
1689
+ throw new Error(`value of unknown type: ${t}`);
1690
+ }
1691
+ i(Cn, "getType");
1692
+ var z = -1, F = 1, M = 0, I = class {
1693
+ static {
1694
+ i(this, "Diff");
1695
+ }
1696
+ 0;
1697
+ 1;
1698
+ constructor(e, n) {
1699
+ this[0] = e, this[1] = n;
1700
+ }
1701
+ }, as = /* @__PURE__ */ i(function(t, e) {
1702
+ if (!t || !e || t.charAt(0) !== e.charAt(0))
1703
+ return 0;
1704
+ let n = 0, r = Math.min(t.length, e.length), o = r, s = 0;
1705
+ for (; n < o; )
1706
+ t.substring(s, o) === e.substring(s, o) ? (n = o, s = n) : r = o, o = Math.floor((r - n) / 2 + n);
1707
+ return o;
1708
+ }, "diff_commonPrefix"), Bn = /* @__PURE__ */ i(function(t, e) {
1709
+ if (!t || !e || t.charAt(t.length - 1) !== e.charAt(e.length - 1))
1710
+ return 0;
1711
+ let n = 0, r = Math.min(t.length, e.length), o = r, s = 0;
1712
+ for (; n < o; )
1713
+ t.substring(t.length - o, t.length - s) === e.substring(e.length - o, e.length - s) ? (n = o, s = n) : r = o, o = Math.floor((r - n) / 2 +
1714
+ n);
1715
+ return o;
1716
+ }, "diff_commonSuffix"), $n = /* @__PURE__ */ i(function(t, e) {
1717
+ let n = t.length, r = e.length;
1718
+ if (n === 0 || r === 0)
1719
+ return 0;
1720
+ n > r ? t = t.substring(n - r) : n < r && (e = e.substring(0, n));
1721
+ let o = Math.min(n, r);
1722
+ if (t === e)
1723
+ return o;
1724
+ let s = 0, c = 1;
1725
+ for (; ; ) {
1726
+ let u = t.substring(o - c), l = e.indexOf(u);
1727
+ if (l === -1)
1728
+ return s;
1729
+ c += l, (l === 0 || t.substring(o - c) === e.substring(0, c)) && (s = c, c++);
1730
+ }
1731
+ }, "diff_commonOverlap_"), fs = /* @__PURE__ */ i(function(t) {
1732
+ let e = !1, n = [], r = 0, o = null, s = 0, c = 0, u = 0, l = 0, f = 0;
1733
+ for (; s < t.length; )
1734
+ t[s][0] === M ? (n[r++] = s, c = l, u = f, l = 0, f = 0, o = t[s][1]) : (t[s][0] === F ? l += t[s][1].length : f += t[s][1].length, o &&
1735
+ o.length <= Math.max(c, u) && o.length <= Math.max(l, f) && (t.splice(
1736
+ n[r - 1],
1737
+ 0,
1738
+ new I(z, o)
1739
+ ), t[n[r - 1] + 1][0] = F, r--, r--, s = r > 0 ? n[r - 1] : -1, c = 0, u = 0, l = 0, f = 0, o = null, e = !0)), s++;
1740
+ for (e && zn(t), gs(t), s = 1; s < t.length; ) {
1741
+ if (t[s - 1][0] === z && t[s][0] === F) {
1742
+ let p = t[s - 1][1], a = t[s][1], _ = $n(p, a), h = $n(a, p);
1743
+ _ >= h ? (_ >= p.length / 2 || _ >= a.length / 2) && (t.splice(
1744
+ s,
1745
+ 0,
1746
+ new I(M, a.substring(0, _))
1747
+ ), t[s - 1][1] = p.substring(
1748
+ 0,
1749
+ p.length - _
1750
+ ), t[s + 1][1] = a.substring(_), s++) : (h >= p.length / 2 || h >= a.length / 2) && (t.splice(
1751
+ s,
1752
+ 0,
1753
+ new I(M, p.substring(0, h))
1754
+ ), t[s - 1][0] = F, t[s - 1][1] = a.substring(
1755
+ 0,
1756
+ a.length - h
1757
+ ), t[s + 1][0] = z, t[s + 1][1] = p.substring(h), s++), s++;
1758
+ }
1759
+ s++;
1760
+ }
1761
+ }, "diff_cleanupSemantic"), Tn = /[^a-z0-9]/i, An = /\s/, Nn = /[\r\n]/, ps = /\n\r?\n$/, ms = /^\r?\n\r?\n/;
1762
+ function gs(t) {
1763
+ let e = 1;
1764
+ for (; e < t.length - 1; ) {
1765
+ if (t[e - 1][0] === M && t[e + 1][0] === M) {
1766
+ let n = t[e - 1][1], r = t[e][1], o = t[e + 1][1], s = Bn(n, r);
1767
+ if (s) {
1768
+ let p = r.substring(r.length - s);
1769
+ n = n.substring(0, n.length - s), r = p + r.substring(0, r.length - s), o = p + o;
1770
+ }
1771
+ let c = n, u = r, l = o, f = Wt(n, r) + Wt(r, o);
1772
+ for (; r.charAt(0) === o.charAt(0); ) {
1773
+ n += r.charAt(0), r = r.substring(1) + o.charAt(0), o = o.substring(1);
1774
+ let p = Wt(n, r) + Wt(r, o);
1775
+ p >= f && (f = p, c = n, u = r, l = o);
1776
+ }
1777
+ t[e - 1][1] !== c && (c ? t[e - 1][1] = c : (t.splice(e - 1, 1), e--), t[e][1] = u, l ? t[e + 1][1] = l : (t.splice(e + 1, 1), e--));
1778
+ }
1779
+ e++;
1780
+ }
1781
+ }
1782
+ i(gs, "diff_cleanupSemanticLossless");
1783
+ function zn(t) {
1784
+ t.push(new I(M, ""));
1785
+ let e = 0, n = 0, r = 0, o = "", s = "", c;
1786
+ for (; e < t.length; )
1787
+ switch (t[e][0]) {
1788
+ case F:
1789
+ r++, s += t[e][1], e++;
1790
+ break;
1791
+ case z:
1792
+ n++, o += t[e][1], e++;
1793
+ break;
1794
+ case M:
1795
+ n + r > 1 ? (n !== 0 && r !== 0 && (c = as(s, o), c !== 0 && (e - n - r > 0 && t[e - n - r - 1][0] === M ? t[e - n - r - 1][1] += s.
1796
+ substring(0, c) : (t.splice(
1797
+ 0,
1798
+ 0,
1799
+ new I(M, s.substring(0, c))
1800
+ ), e++), s = s.substring(c), o = o.substring(c)), c = Bn(s, o), c !== 0 && (t[e][1] = s.substring(s.length - c) + t[e][1], s = s.substring(
1801
+ 0,
1802
+ s.length - c
1803
+ ), o = o.substring(
1804
+ 0,
1805
+ o.length - c
1806
+ ))), e -= n + r, t.splice(e, n + r), o.length && (t.splice(e, 0, new I(z, o)), e++), s.length && (t.splice(e, 0, new I(F, s)), e++),
1807
+ e++) : e !== 0 && t[e - 1][0] === M ? (t[e - 1][1] += t[e][1], t.splice(e, 1)) : e++, r = 0, n = 0, o = "", s = "";
1808
+ break;
1809
+ }
1810
+ t[t.length - 1][1] === "" && t.pop();
1811
+ let u = !1;
1812
+ for (e = 1; e < t.length - 1; )
1813
+ t[e - 1][0] === M && t[e + 1][0] === M && (t[e][1].substring(
1814
+ t[e][1].length - t[e - 1][1].length
1815
+ ) === t[e - 1][1] ? (t[e][1] = t[e - 1][1] + t[e][1].substring(
1816
+ 0,
1817
+ t[e][1].length - t[e - 1][1].length
1818
+ ), t[e + 1][1] = t[e - 1][1] + t[e + 1][1], t.splice(e - 1, 1), u = !0) : t[e][1].substring(0, t[e + 1][1].length) === t[e + 1][1] && (t[e -
1819
+ 1][1] += t[e + 1][1], t[e][1] = t[e][1].substring(t[e + 1][1].length) + t[e + 1][1], t.splice(e + 1, 1), u = !0)), e++;
1820
+ u && zn(t);
1821
+ }
1822
+ i(zn, "diff_cleanupMerge");
1823
+ function Wt(t, e) {
1824
+ if (!t || !e)
1825
+ return 6;
1826
+ let n = t.charAt(t.length - 1), r = e.charAt(0), o = n.match(Tn), s = r.match(Tn), c = o && n.match(An), u = s && r.match(An), l = c && n.
1827
+ match(Nn), f = u && r.match(Nn), p = l && t.match(ps), a = f && e.match(ms);
1828
+ return p || a ? 5 : l || f ? 4 : o && !c && u ? 3 : c || u ? 2 : o || s ? 1 : 0;
1829
+ }
1830
+ i(Wt, "diff_cleanupSemanticScore_");
1831
+ var Un = "Compared values have no visual difference.", hs = "Compared values serialize to the same structure.\nPrinting internal object struc\
1832
+ ture without calling `toJSON` instead.", Vt = {}, In;
1833
+ function ys() {
1834
+ if (In) return Vt;
1835
+ In = 1, Object.defineProperty(Vt, "__esModule", {
1836
+ value: !0
1837
+ }), Vt.default = _;
1838
+ let t = "diff-sequences", e = 0, n = /* @__PURE__ */ i((h, g, y, m, b) => {
1839
+ let E = 0;
1840
+ for (; h < g && y < m && b(h, y); )
1841
+ h += 1, y += 1, E += 1;
1842
+ return E;
1843
+ }, "countCommonItemsF"), r = /* @__PURE__ */ i((h, g, y, m, b) => {
1844
+ let E = 0;
1845
+ for (; h <= g && y <= m && b(g, m); )
1846
+ g -= 1, m -= 1, E += 1;
1847
+ return E;
1848
+ }, "countCommonItemsR"), o = /* @__PURE__ */ i((h, g, y, m, b, E, $) => {
1849
+ let d = 0, S = -h, C = E[d], O = C;
1850
+ E[d] += n(
1851
+ C + 1,
1852
+ g,
1853
+ m + C - S + 1,
1854
+ y,
1855
+ b
1856
+ );
1857
+ let N = h < $ ? h : $;
1858
+ for (d += 1, S += 2; d <= N; d += 1, S += 2) {
1859
+ if (d !== h && O < E[d])
1860
+ C = E[d];
1861
+ else if (C = O + 1, g <= C)
1862
+ return d - 1;
1863
+ O = E[d], E[d] = C + n(C + 1, g, m + C - S + 1, y, b);
1864
+ }
1865
+ return $;
1866
+ }, "extendPathsF"), s = /* @__PURE__ */ i((h, g, y, m, b, E, $) => {
1867
+ let d = 0, S = h, C = E[d], O = C;
1868
+ E[d] -= r(
1869
+ g,
1870
+ C - 1,
1871
+ y,
1872
+ m + C - S - 1,
1873
+ b
1874
+ );
1875
+ let N = h < $ ? h : $;
1876
+ for (d += 1, S -= 2; d <= N; d += 1, S -= 2) {
1877
+ if (d !== h && E[d] < O)
1878
+ C = E[d];
1879
+ else if (C = O - 1, C < g)
1880
+ return d - 1;
1881
+ O = E[d], E[d] = C - r(
1882
+ g,
1883
+ C - 1,
1884
+ y,
1885
+ m + C - S - 1,
1886
+ b
1887
+ );
1888
+ }
1889
+ return $;
1890
+ }, "extendPathsR"), c = /* @__PURE__ */ i((h, g, y, m, b, E, $, d, S, C, O) => {
1891
+ let N = m - g, G = y - g, P = b - m - G, k = -P - (h - 1), H = -P + (h - 1), Y = e, R = h < d ? h : d;
1892
+ for (let L = 0, x = -h; L <= R; L += 1, x += 2) {
1893
+ let J = L === 0 || L !== h && Y < $[L], D = J ? $[L] : Y, V = J ? D : D + 1, rt = N + V - x, K = n(
1894
+ V + 1,
1895
+ y,
1896
+ rt + 1,
1897
+ b,
1898
+ E
1899
+ ), q = V + K;
1900
+ if (Y = $[L], $[L] = q, k <= x && x <= H) {
1901
+ let st = (h - 1 - (x + P)) / 2;
1902
+ if (st <= C && S[st] - 1 <= q) {
1903
+ let X = N + D - (J ? x + 1 : x - 1), W = r(
1904
+ g,
1905
+ D,
1906
+ m,
1907
+ X,
1908
+ E
1909
+ ), ot = D - W, ht = X - W, ut = ot + 1, _t = ht + 1;
1910
+ O.nChangePreceding = h - 1, h - 1 === ut + _t - g - m ? (O.aEndPreceding = g, O.bEndPreceding = m) : (O.aEndPreceding = ut, O.bEndPreceding =
1911
+ _t), O.nCommonPreceding = W, W !== 0 && (O.aCommonPreceding = ut, O.bCommonPreceding = _t), O.nCommonFollowing = K, K !== 0 && (O.
1912
+ aCommonFollowing = V + 1, O.bCommonFollowing = rt + 1);
1913
+ let Ct = q + 1, $t = rt + K + 1;
1914
+ return O.nChangeFollowing = h - 1, h - 1 === y + b - Ct - $t ? (O.aStartFollowing = y, O.bStartFollowing = b) : (O.aStartFollowing =
1915
+ Ct, O.bStartFollowing = $t), !0;
1916
+ }
1917
+ }
1918
+ }
1919
+ return !1;
1920
+ }, "extendOverlappablePathsF"), u = /* @__PURE__ */ i((h, g, y, m, b, E, $, d, S, C, O) => {
1921
+ let N = b - y, G = y - g, P = b - m - G, k = P - h, H = P + h, Y = e, R = h < C ? h : C;
1922
+ for (let L = 0, x = h; L <= R; L += 1, x -= 2) {
1923
+ let J = L === 0 || L !== h && S[L] < Y, D = J ? S[L] : Y, V = J ? D : D - 1, rt = N + V - x, K = r(
1924
+ g,
1925
+ V - 1,
1926
+ m,
1927
+ rt - 1,
1928
+ E
1929
+ ), q = V - K;
1930
+ if (Y = S[L], S[L] = q, k <= x && x <= H) {
1931
+ let st = (h + (x - P)) / 2;
1932
+ if (st <= d && q - 1 <= $[st]) {
1933
+ let X = rt - K;
1934
+ if (O.nChangePreceding = h, h === q + X - g - m ? (O.aEndPreceding = g, O.bEndPreceding = m) : (O.aEndPreceding = q, O.bEndPreceding =
1935
+ X), O.nCommonPreceding = K, K !== 0 && (O.aCommonPreceding = q, O.bCommonPreceding = X), O.nChangeFollowing = h - 1, h === 1)
1936
+ O.nCommonFollowing = 0, O.aStartFollowing = y, O.bStartFollowing = b;
1937
+ else {
1938
+ let W = N + D - (J ? x - 1 : x + 1), ot = n(
1939
+ D,
1940
+ y,
1941
+ W,
1942
+ b,
1943
+ E
1944
+ );
1945
+ O.nCommonFollowing = ot, ot !== 0 && (O.aCommonFollowing = D, O.bCommonFollowing = W);
1946
+ let ht = D + ot, ut = W + ot;
1947
+ h - 1 === y + b - ht - ut ? (O.aStartFollowing = y, O.bStartFollowing = b) : (O.aStartFollowing = ht, O.bStartFollowing = ut);
1948
+ }
1949
+ return !0;
1950
+ }
1951
+ }
1952
+ }
1953
+ return !1;
1954
+ }, "extendOverlappablePathsR"), l = /* @__PURE__ */ i((h, g, y, m, b, E, $, d, S) => {
1955
+ let C = m - g, O = b - y, N = y - g, G = b - m, Q = G - N, P = N, k = N;
1956
+ if ($[0] = g - 1, d[0] = y, Q % 2 === 0) {
1957
+ let H = (h || Q) / 2, Y = (N + G) / 2;
1958
+ for (let R = 1; R <= Y; R += 1)
1959
+ if (P = o(R, y, b, C, E, $, P), R < H)
1960
+ k = s(R, g, m, O, E, d, k);
1961
+ else if (
1962
+ // If a reverse path overlaps a forward path in the same diagonal,
1963
+ // return a division of the index intervals at the middle change.
1964
+ u(
1965
+ R,
1966
+ g,
1967
+ y,
1968
+ m,
1969
+ b,
1970
+ E,
1971
+ $,
1972
+ P,
1973
+ d,
1974
+ k,
1975
+ S
1976
+ )
1977
+ )
1978
+ return;
1979
+ } else {
1980
+ let H = ((h || Q) + 1) / 2, Y = (N + G + 1) / 2, R = 1;
1981
+ for (P = o(R, y, b, C, E, $, P), R += 1; R <= Y; R += 1)
1982
+ if (k = s(
1983
+ R - 1,
1984
+ g,
1985
+ m,
1986
+ O,
1987
+ E,
1988
+ d,
1989
+ k
1990
+ ), R < H)
1991
+ P = o(R, y, b, C, E, $, P);
1992
+ else if (
1993
+ // If a forward path overlaps a reverse path in the same diagonal,
1994
+ // return a division of the index intervals at the middle change.
1995
+ c(
1996
+ R,
1997
+ g,
1998
+ y,
1999
+ m,
2000
+ b,
2001
+ E,
2002
+ $,
2003
+ P,
2004
+ d,
2005
+ k,
2006
+ S
2007
+ )
2008
+ )
2009
+ return;
2010
+ }
2011
+ throw new Error(
2012
+ `${t}: no overlap aStart=${g} aEnd=${y} bStart=${m} bEnd=${b}`
2013
+ );
2014
+ }, "divide"), f = /* @__PURE__ */ i((h, g, y, m, b, E, $, d, S, C) => {
2015
+ if (b - m < y - g) {
2016
+ if (E = !E, E && $.length === 1) {
2017
+ let { foundSubsequence: q, isCommon: st } = $[0];
2018
+ $[1] = {
2019
+ foundSubsequence: /* @__PURE__ */ i((X, W, ot) => {
2020
+ q(X, ot, W);
2021
+ }, "foundSubsequence"),
2022
+ isCommon: /* @__PURE__ */ i((X, W) => st(W, X), "isCommon")
2023
+ };
2024
+ }
2025
+ let rt = g, K = y;
2026
+ g = m, y = b, m = rt, b = K;
2027
+ }
2028
+ let { foundSubsequence: O, isCommon: N } = $[E ? 1 : 0];
2029
+ l(
2030
+ h,
2031
+ g,
2032
+ y,
2033
+ m,
2034
+ b,
2035
+ N,
2036
+ d,
2037
+ S,
2038
+ C
2039
+ );
2040
+ let {
2041
+ nChangePreceding: G,
2042
+ aEndPreceding: Q,
2043
+ bEndPreceding: P,
2044
+ nCommonPreceding: k,
2045
+ aCommonPreceding: H,
2046
+ bCommonPreceding: Y,
2047
+ nCommonFollowing: R,
2048
+ aCommonFollowing: L,
2049
+ bCommonFollowing: x,
2050
+ nChangeFollowing: J,
2051
+ aStartFollowing: D,
2052
+ bStartFollowing: V
2053
+ } = C;
2054
+ g < Q && m < P && f(
2055
+ G,
2056
+ g,
2057
+ Q,
2058
+ m,
2059
+ P,
2060
+ E,
2061
+ $,
2062
+ d,
2063
+ S,
2064
+ C
2065
+ ), k !== 0 && O(k, H, Y), R !== 0 && O(R, L, x), D < y && V < b && f(
2066
+ J,
2067
+ D,
2068
+ y,
2069
+ V,
2070
+ b,
2071
+ E,
2072
+ $,
2073
+ d,
2074
+ S,
2075
+ C
2076
+ );
2077
+ }, "findSubsequences"), p = /* @__PURE__ */ i((h, g) => {
2078
+ if (typeof g != "number")
2079
+ throw new TypeError(`${t}: ${h} typeof ${typeof g} is not a number`);
2080
+ if (!Number.isSafeInteger(g))
2081
+ throw new RangeError(`${t}: ${h} value ${g} is not a safe integer`);
2082
+ if (g < 0)
2083
+ throw new RangeError(`${t}: ${h} value ${g} is a negative integer`);
2084
+ }, "validateLength"), a = /* @__PURE__ */ i((h, g) => {
2085
+ let y = typeof g;
2086
+ if (y !== "function")
2087
+ throw new TypeError(`${t}: ${h} typeof ${y} is not a function`);
2088
+ }, "validateCallback");
2089
+ function _(h, g, y, m) {
2090
+ p("aLength", h), p("bLength", g), a("isCommon", y), a("foundSubsequence", m);
2091
+ let b = n(0, h, 0, g, y);
2092
+ if (b !== 0 && m(b, 0, 0), h !== b || g !== b) {
2093
+ let E = b, $ = b, d = r(
2094
+ E,
2095
+ h - 1,
2096
+ $,
2097
+ g - 1,
2098
+ y
2099
+ ), S = h - d, C = g - d, O = b + d;
2100
+ h !== O && g !== O && f(
2101
+ 0,
2102
+ E,
2103
+ S,
2104
+ $,
2105
+ C,
2106
+ !1,
2107
+ [
2108
+ {
2109
+ foundSubsequence: m,
2110
+ isCommon: y
2111
+ }
2112
+ ],
2113
+ [e],
2114
+ [e],
2115
+ {
2116
+ aCommonFollowing: e,
2117
+ aCommonPreceding: e,
2118
+ aEndPreceding: e,
2119
+ aStartFollowing: e,
2120
+ bCommonFollowing: e,
2121
+ bCommonPreceding: e,
2122
+ bEndPreceding: e,
2123
+ bStartFollowing: e,
2124
+ nChangeFollowing: e,
2125
+ nChangePreceding: e,
2126
+ nCommonFollowing: e,
2127
+ nCommonPreceding: e
2128
+ }
2129
+ ), d !== 0 && m(d, S, C);
2130
+ }
2131
+ }
2132
+ return i(_, "diffSequence"), Vt;
2133
+ }
2134
+ i(ys, "requireBuild");
2135
+ var ds = ys(), Yn = /* @__PURE__ */ On(ds);
2136
+ function bs(t, e) {
2137
+ return t.replace(/\s+$/, (n) => e(n));
2138
+ }
2139
+ i(bs, "formatTrailingSpaces");
2140
+ function $e(t, e, n, r, o, s) {
2141
+ return t.length !== 0 ? n(
2142
+ `${r} ${bs(t, o)}`
2143
+ ) : r !== " " ? n(r) : e && s.length !== 0 ? n(`${r} ${s}`) : "";
2144
+ }
2145
+ i($e, "printDiffLine");
2146
+ function Wn(t, e, {
2147
+ aColor: n,
2148
+ aIndicator: r,
2149
+ changeLineTrailingSpaceColor: o,
2150
+ emptyFirstOrLastLinePlaceholder: s
2151
+ }) {
2152
+ return $e(
2153
+ t,
2154
+ e,
2155
+ n,
2156
+ r,
2157
+ o,
2158
+ s
2159
+ );
2160
+ }
2161
+ i(Wn, "printDeleteLine");
2162
+ function Vn(t, e, {
2163
+ bColor: n,
2164
+ bIndicator: r,
2165
+ changeLineTrailingSpaceColor: o,
2166
+ emptyFirstOrLastLinePlaceholder: s
2167
+ }) {
2168
+ return $e(
2169
+ t,
2170
+ e,
2171
+ n,
2172
+ r,
2173
+ o,
2174
+ s
2175
+ );
2176
+ }
2177
+ i(Vn, "printInsertLine");
2178
+ function Kn(t, e, {
2179
+ commonColor: n,
2180
+ commonIndicator: r,
2181
+ commonLineTrailingSpaceColor: o,
2182
+ emptyFirstOrLastLinePlaceholder: s
2183
+ }) {
2184
+ return $e(
2185
+ t,
2186
+ e,
2187
+ n,
2188
+ r,
2189
+ o,
2190
+ s
2191
+ );
2192
+ }
2193
+ i(Kn, "printCommonLine");
2194
+ function Rn(t, e, n, r, { patchColor: o }) {
2195
+ return o(
2196
+ `@@ -${t + 1},${e - t} +${n + 1},${r - n} @@`
2197
+ );
2198
+ }
2199
+ i(Rn, "createPatchMark");
2200
+ function Ss(t, e) {
2201
+ let n = t.length, r = e.contextLines, o = r + r, s = n, c = !1, u = 0, l = 0;
2202
+ for (; l !== n; ) {
2203
+ let d = l;
2204
+ for (; l !== n && t[l][0] === M; )
2205
+ l += 1;
2206
+ if (d !== l)
2207
+ if (d === 0)
2208
+ l > r && (s -= l - r, c = !0);
2209
+ else if (l === n) {
2210
+ let S = l - d;
2211
+ S > r && (s -= S - r, c = !0);
2212
+ } else {
2213
+ let S = l - d;
2214
+ S > o && (s -= S - o, u += 1);
2215
+ }
2216
+ for (; l !== n && t[l][0] !== M; )
2217
+ l += 1;
2218
+ }
2219
+ let f = u !== 0 || c;
2220
+ u !== 0 ? s += u + 1 : c && (s += 1);
2221
+ let p = s - 1, a = [], _ = 0;
2222
+ f && a.push("");
2223
+ let h = 0, g = 0, y = 0, m = 0, b = /* @__PURE__ */ i((d) => {
2224
+ let S = a.length;
2225
+ a.push(Kn(d, S === 0 || S === p, e)), y += 1, m += 1;
2226
+ }, "pushCommonLine"), E = /* @__PURE__ */ i((d) => {
2227
+ let S = a.length;
2228
+ a.push(Wn(d, S === 0 || S === p, e)), y += 1;
2229
+ }, "pushDeleteLine"), $ = /* @__PURE__ */ i((d) => {
2230
+ let S = a.length;
2231
+ a.push(Vn(d, S === 0 || S === p, e)), m += 1;
2232
+ }, "pushInsertLine");
2233
+ for (l = 0; l !== n; ) {
2234
+ let d = l;
2235
+ for (; l !== n && t[l][0] === M; )
2236
+ l += 1;
2237
+ if (d !== l)
2238
+ if (d === 0) {
2239
+ l > r && (d = l - r, h = d, g = d, y = h, m = g);
2240
+ for (let S = d; S !== l; S += 1)
2241
+ b(t[S][1]);
2242
+ } else if (l === n) {
2243
+ let S = l - d > r ? d + r : l;
2244
+ for (let C = d; C !== S; C += 1)
2245
+ b(t[C][1]);
2246
+ } else {
2247
+ let S = l - d;
2248
+ if (S > o) {
2249
+ let C = d + r;
2250
+ for (let N = d; N !== C; N += 1)
2251
+ b(t[N][1]);
2252
+ a[_] = Rn(
2253
+ h,
2254
+ y,
2255
+ g,
2256
+ m,
2257
+ e
2258
+ ), _ = a.length, a.push("");
2259
+ let O = S - o;
2260
+ h = y + O, g = m + O, y = h, m = g;
2261
+ for (let N = l - r; N !== l; N += 1)
2262
+ b(t[N][1]);
2263
+ } else
2264
+ for (let C = d; C !== l; C += 1)
2265
+ b(t[C][1]);
2266
+ }
2267
+ for (; l !== n && t[l][0] === z; )
2268
+ E(t[l][1]), l += 1;
2269
+ for (; l !== n && t[l][0] === F; )
2270
+ $(t[l][1]), l += 1;
2271
+ }
2272
+ return f && (a[_] = Rn(h, y, g, m, e)), a.join(`
2273
+ `);
2274
+ }
2275
+ i(Ss, "joinAlignedDiffsNoExpand");
2276
+ function _s(t, e) {
2277
+ return t.map((n, r, o) => {
2278
+ let s = n[1], c = r === 0 || r === o.length - 1;
2279
+ switch (n[0]) {
2280
+ case z:
2281
+ return Wn(s, c, e);
2282
+ case F:
2283
+ return Vn(s, c, e);
2284
+ default:
2285
+ return Kn(s, c, e);
2286
+ }
2287
+ }).join(`
2288
+ `);
2289
+ }
2290
+ i(_s, "joinAlignedDiffsExpand");
2291
+ var Se = /* @__PURE__ */ i((t) => t, "noColor"), qn = 5, Es = 0;
2292
+ function Os() {
2293
+ return {
2294
+ aAnnotation: "Expected",
2295
+ aColor: v.green,
2296
+ aIndicator: "-",
2297
+ bAnnotation: "Received",
2298
+ bColor: v.red,
2299
+ bIndicator: "+",
2300
+ changeColor: v.inverse,
2301
+ changeLineTrailingSpaceColor: Se,
2302
+ commonColor: v.dim,
2303
+ commonIndicator: " ",
2304
+ commonLineTrailingSpaceColor: Se,
2305
+ compareKeys: void 0,
2306
+ contextLines: qn,
2307
+ emptyFirstOrLastLinePlaceholder: "",
2308
+ expand: !0,
2309
+ includeChangeCounts: !1,
2310
+ omitAnnotationLines: !1,
2311
+ patchColor: v.yellow,
2312
+ truncateThreshold: Es,
2313
+ truncateAnnotation: "... Diff result is truncated",
2314
+ truncateAnnotationColor: Se
2315
+ };
2316
+ }
2317
+ i(Os, "getDefaultOptions");
2318
+ function ws(t) {
2319
+ return t && typeof t == "function" ? t : void 0;
2320
+ }
2321
+ i(ws, "getCompareKeys");
2322
+ function Cs(t) {
2323
+ return typeof t == "number" && Number.isSafeInteger(t) && t >= 0 ? t : qn;
2324
+ }
2325
+ i(Cs, "getContextLines");
2326
+ function mt(t = {}) {
2327
+ return {
2328
+ ...Os(),
2329
+ ...t,
2330
+ compareKeys: ws(t.compareKeys),
2331
+ contextLines: Cs(t.contextLines)
2332
+ };
2333
+ }
2334
+ i(mt, "normalizeDiffOptions");
2335
+ function bt(t) {
2336
+ return t.length === 1 && t[0].length === 0;
2337
+ }
2338
+ i(bt, "isEmptyString");
2339
+ function $s(t) {
2340
+ let e = 0, n = 0;
2341
+ return t.forEach((r) => {
2342
+ switch (r[0]) {
2343
+ case z:
2344
+ e += 1;
2345
+ break;
2346
+ case F:
2347
+ n += 1;
2348
+ break;
2349
+ }
2350
+ }), { a: e, b: n };
2351
+ }
2352
+ i($s, "countChanges");
2353
+ function Ts({
2354
+ aAnnotation: t,
2355
+ aColor: e,
2356
+ aIndicator: n,
2357
+ bAnnotation: r,
2358
+ bColor: o,
2359
+ bIndicator: s,
2360
+ includeChangeCounts: c,
2361
+ omitAnnotationLines: u
2362
+ }, l) {
2363
+ if (u)
2364
+ return "";
2365
+ let f = "", p = "";
2366
+ if (c) {
2367
+ let h = String(l.a), g = String(l.b), y = r.length - t.length, m = " ".repeat(Math.max(0, y)), b = " ".repeat(Math.max(0, -y)), E = g.length -
2368
+ h.length, $ = " ".repeat(Math.max(0, E)), d = " ".repeat(Math.max(0, -E));
2369
+ f = `${m} ${n} ${$}${h}`, p = `${b} ${s} ${d}${g}`;
2370
+ }
2371
+ let a = `${n} ${t}${f}`, _ = `${s} ${r}${p}`;
2372
+ return `${e(a)}
2373
+ ${o(_)}
2374
+
2375
+ `;
2376
+ }
2377
+ i(Ts, "printAnnotation");
2378
+ function Te(t, e, n) {
2379
+ return Ts(n, $s(t)) + (n.expand ? _s(t, n) : Ss(t, n)) + (e ? n.truncateAnnotationColor(`
2380
+ ${n.truncateAnnotation}`) : "");
2381
+ }
2382
+ i(Te, "printDiffLines");
2383
+ function qt(t, e, n) {
2384
+ let r = mt(n), [o, s] = Gn(
2385
+ bt(t) ? [] : t,
2386
+ bt(e) ? [] : e,
2387
+ r
2388
+ );
2389
+ return Te(o, s, r);
2390
+ }
2391
+ i(qt, "diffLinesUnified");
2392
+ function As(t, e, n, r, o) {
2393
+ if (bt(t) && bt(n) && (t = [], n = []), bt(e) && bt(r) && (e = [], r = []), t.length !== n.length || e.length !== r.length)
2394
+ return qt(t, e, o);
2395
+ let [s, c] = Gn(
2396
+ n,
2397
+ r,
2398
+ o
2399
+ ), u = 0, l = 0;
2400
+ return s.forEach((f) => {
2401
+ switch (f[0]) {
2402
+ case z:
2403
+ f[1] = t[u], u += 1;
2404
+ break;
2405
+ case F:
2406
+ f[1] = e[l], l += 1;
2407
+ break;
2408
+ default:
2409
+ f[1] = e[l], u += 1, l += 1;
2410
+ }
2411
+ }), Te(s, c, mt(o));
2412
+ }
2413
+ i(As, "diffLinesUnified2");
2414
+ function Gn(t, e, n) {
2415
+ let r = n?.truncateThreshold ?? !1, o = Math.max(
2416
+ Math.floor(n?.truncateThreshold ?? 0),
2417
+ 0
2418
+ ), s = r ? Math.min(t.length, o) : t.length, c = r ? Math.min(e.length, o) : e.length, u = s !== t.length || c !== e.length, l = /* @__PURE__ */ i(
2419
+ (h, g) => t[h] === e[g], "isCommon"), f = [], p = 0, a = 0;
2420
+ for (Yn(s, c, l, /* @__PURE__ */ i((h, g, y) => {
2421
+ for (; p !== g; p += 1)
2422
+ f.push(new I(z, t[p]));
2423
+ for (; a !== y; a += 1)
2424
+ f.push(new I(F, e[a]));
2425
+ for (; h !== 0; h -= 1, p += 1, a += 1)
2426
+ f.push(new I(M, e[a]));
2427
+ }, "foundSubsequence")); p !== s; p += 1)
2428
+ f.push(new I(z, t[p]));
2429
+ for (; a !== c; a += 1)
2430
+ f.push(new I(F, e[a]));
2431
+ return [f, u];
2432
+ }
2433
+ i(Gn, "diffLinesRaw");
2434
+ function Pn(t) {
2435
+ return t.includes(`\r
2436
+ `) ? `\r
2437
+ ` : `
2438
+ `;
2439
+ }
2440
+ i(Pn, "getNewLineSymbol");
2441
+ function Ns(t, e, n) {
2442
+ let r = n?.truncateThreshold ?? !1, o = Math.max(
2443
+ Math.floor(n?.truncateThreshold ?? 0),
2444
+ 0
2445
+ ), s = t.length, c = e.length;
2446
+ if (r) {
2447
+ let h = t.includes(`
2448
+ `), g = e.includes(`
2449
+ `), y = Pn(t), m = Pn(e), b = h ? `${t.split(y, o).join(y)}
2450
+ ` : t, E = g ? `${e.split(m, o).join(m)}
2451
+ ` : e;
2452
+ s = b.length, c = E.length;
2453
+ }
2454
+ let u = s !== t.length || c !== e.length, l = /* @__PURE__ */ i((h, g) => t[h] === e[g], "isCommon"), f = 0, p = 0, a = [];
2455
+ return Yn(s, c, l, /* @__PURE__ */ i((h, g, y) => {
2456
+ f !== g && a.push(new I(z, t.slice(f, g))), p !== y && a.push(new I(F, e.slice(p, y))), f = g + h, p = y + h, a.push(new I(M, e.slice(y,
2457
+ p)));
2458
+ }, "foundSubsequence")), f !== s && a.push(new I(z, t.slice(f))), p !== c && a.push(new I(F, e.slice(p))), [a, u];
2459
+ }
2460
+ i(Ns, "diffStrings");
2461
+ function Is(t, e, n) {
2462
+ return e.reduce(
2463
+ (r, o) => r + (o[0] === M ? o[1] : o[0] === t && o[1].length !== 0 ? n(o[1]) : ""),
2464
+ ""
2465
+ );
2466
+ }
2467
+ i(Is, "concatenateRelevantDiffs");
2468
+ var Kt = class {
2469
+ static {
2470
+ i(this, "ChangeBuffer");
2471
+ }
2472
+ op;
2473
+ line;
2474
+ // incomplete line
2475
+ lines;
2476
+ // complete lines
2477
+ changeColor;
2478
+ constructor(e, n) {
2479
+ this.op = e, this.line = [], this.lines = [], this.changeColor = n;
2480
+ }
2481
+ pushSubstring(e) {
2482
+ this.pushDiff(new I(this.op, e));
2483
+ }
2484
+ pushLine() {
2485
+ this.lines.push(
2486
+ this.line.length !== 1 ? new I(
2487
+ this.op,
2488
+ Is(this.op, this.line, this.changeColor)
2489
+ ) : this.line[0][0] === this.op ? this.line[0] : new I(this.op, this.line[0][1])
2490
+ // was common diff
2491
+ ), this.line.length = 0;
2492
+ }
2493
+ isLineEmpty() {
2494
+ return this.line.length === 0;
2495
+ }
2496
+ // Minor input to buffer.
2497
+ pushDiff(e) {
2498
+ this.line.push(e);
2499
+ }
2500
+ // Main input to buffer.
2501
+ align(e) {
2502
+ let n = e[1];
2503
+ if (n.includes(`
2504
+ `)) {
2505
+ let r = n.split(`
2506
+ `), o = r.length - 1;
2507
+ r.forEach((s, c) => {
2508
+ c < o ? (this.pushSubstring(s), this.pushLine()) : s.length !== 0 && this.pushSubstring(s);
2509
+ });
2510
+ } else
2511
+ this.pushDiff(e);
2512
+ }
2513
+ // Output from buffer.
2514
+ moveLinesTo(e) {
2515
+ this.isLineEmpty() || this.pushLine(), e.push(...this.lines), this.lines.length = 0;
2516
+ }
2517
+ }, Ee = class {
2518
+ static {
2519
+ i(this, "CommonBuffer");
2520
+ }
2521
+ deleteBuffer;
2522
+ insertBuffer;
2523
+ lines;
2524
+ constructor(e, n) {
2525
+ this.deleteBuffer = e, this.insertBuffer = n, this.lines = [];
2526
+ }
2527
+ pushDiffCommonLine(e) {
2528
+ this.lines.push(e);
2529
+ }
2530
+ pushDiffChangeLines(e) {
2531
+ let n = e[1].length === 0;
2532
+ (!n || this.deleteBuffer.isLineEmpty()) && this.deleteBuffer.pushDiff(e), (!n || this.insertBuffer.isLineEmpty()) && this.insertBuffer.pushDiff(
2533
+ e);
2534
+ }
2535
+ flushChangeLines() {
2536
+ this.deleteBuffer.moveLinesTo(this.lines), this.insertBuffer.moveLinesTo(this.lines);
2537
+ }
2538
+ // Input to buffer.
2539
+ align(e) {
2540
+ let n = e[0], r = e[1];
2541
+ if (r.includes(`
2542
+ `)) {
2543
+ let o = r.split(`
2544
+ `), s = o.length - 1;
2545
+ o.forEach((c, u) => {
2546
+ if (u === 0) {
2547
+ let l = new I(n, c);
2548
+ this.deleteBuffer.isLineEmpty() && this.insertBuffer.isLineEmpty() ? (this.flushChangeLines(), this.pushDiffCommonLine(l)) : (this.
2549
+ pushDiffChangeLines(l), this.flushChangeLines());
2550
+ } else u < s ? this.pushDiffCommonLine(new I(n, c)) : c.length !== 0 && this.pushDiffChangeLines(new I(n, c));
2551
+ });
2552
+ } else
2553
+ this.pushDiffChangeLines(e);
2554
+ }
2555
+ // Output from buffer.
2556
+ getLines() {
2557
+ return this.flushChangeLines(), this.lines;
2558
+ }
2559
+ };
2560
+ function Rs(t, e) {
2561
+ let n = new Kt(z, e), r = new Kt(F, e), o = new Ee(n, r);
2562
+ return t.forEach((s) => {
2563
+ switch (s[0]) {
2564
+ case z:
2565
+ n.align(s);
2566
+ break;
2567
+ case F:
2568
+ r.align(s);
2569
+ break;
2570
+ default:
2571
+ o.align(s);
2572
+ }
2573
+ }), o.getLines();
2574
+ }
2575
+ i(Rs, "getAlignedDiffs");
2576
+ function Ps(t, e) {
2577
+ if (e) {
2578
+ let n = t.length - 1;
2579
+ return t.some(
2580
+ (r, o) => r[0] === M && (o !== n || r[1] !== `
2581
+ `)
2582
+ );
2583
+ }
2584
+ return t.some((n) => n[0] === M);
2585
+ }
2586
+ i(Ps, "hasCommonDiff");
2587
+ function Ms(t, e, n) {
2588
+ if (t !== e && t.length !== 0 && e.length !== 0) {
2589
+ let r = t.includes(`
2590
+ `) || e.includes(`
2591
+ `), [o, s] = Hn(
2592
+ r ? `${t}
2593
+ ` : t,
2594
+ r ? `${e}
2595
+ ` : e,
2596
+ !0,
2597
+ // cleanupSemantic
2598
+ n
2599
+ );
2600
+ if (Ps(o, r)) {
2601
+ let c = mt(n), u = Rs(o, c.changeColor);
2602
+ return Te(u, s, c);
2603
+ }
2604
+ }
2605
+ return qt(t.split(`
2606
+ `), e.split(`
2607
+ `), n);
2608
+ }
2609
+ i(Ms, "diffStringsUnified");
2610
+ function Hn(t, e, n, r) {
2611
+ let [o, s] = Ns(t, e, r);
2612
+ return n && fs(o), [o, s];
2613
+ }
2614
+ i(Hn, "diffStringsRaw");
2615
+ function Oe(t, e) {
2616
+ let { commonColor: n } = mt(e);
2617
+ return n(t);
2618
+ }
2619
+ i(Oe, "getCommonMessage");
2620
+ var {
2621
+ AsymmetricMatcher: Ls,
2622
+ DOMCollection: xs,
2623
+ DOMElement: js,
2624
+ Immutable: Ds,
2625
+ ReactElement: Fs,
2626
+ ReactTestComponent: ks
2627
+ } = Lt, Jn = [
2628
+ ks,
2629
+ Fs,
2630
+ js,
2631
+ xs,
2632
+ Ds,
2633
+ Ls
2634
+ ], we = {
2635
+ plugins: Jn
2636
+ }, Xn = {
2637
+ callToJSON: !1,
2638
+ maxDepth: 10,
2639
+ plugins: Jn
2640
+ };
2641
+ function Bs(t, e, n) {
2642
+ if (Object.is(t, e))
2643
+ return "";
2644
+ let r = Cn(t), o = r, s = !1;
2645
+ if (r === "object" && typeof t.asymmetricMatch == "function") {
2646
+ if (t.$$typeof !== Symbol.for("jest.asymmetricMatcher") || typeof t.getExpectedType != "function")
2647
+ return;
2648
+ o = t.getExpectedType(), s = o === "string";
2649
+ }
2650
+ if (o !== Cn(e)) {
2651
+ let { aAnnotation: c, aColor: u, aIndicator: l, bAnnotation: f, bColor: p, bIndicator: a } = mt(n), _ = Ce(Xn, n), h = Z(t, _), g = Z(e,
2652
+ _), y = `${u(`${l} ${c}:`)}
2653
+ ${h}`, m = `${p(`${a} ${f}:`)}
2654
+ ${g}`;
2655
+ return `${y}
2656
+
2657
+ ${m}`;
2658
+ }
2659
+ if (!s)
2660
+ switch (r) {
2661
+ case "string":
2662
+ return qt(t.split(`
2663
+ `), e.split(`
2664
+ `), n);
2665
+ case "boolean":
2666
+ case "number":
2667
+ return zs(t, e, n);
2668
+ case "map":
2669
+ return _e(Mn(t), Mn(e), n);
2670
+ case "set":
2671
+ return _e(Ln(t), Ln(e), n);
2672
+ default:
2673
+ return _e(t, e, n);
2674
+ }
2675
+ }
2676
+ i(Bs, "diff");
2677
+ function zs(t, e, n) {
2678
+ let r = Z(t, we), o = Z(e, we);
2679
+ return r === o ? "" : qt(r.split(`
2680
+ `), o.split(`
2681
+ `), n);
2682
+ }
2683
+ i(zs, "comparePrimitive");
2684
+ function Mn(t) {
2685
+ return new Map(Array.from(t.entries()).sort());
2686
+ }
2687
+ i(Mn, "sortMap");
2688
+ function Ln(t) {
2689
+ return new Set(Array.from(t.values()).sort());
2690
+ }
2691
+ i(Ln, "sortSet");
2692
+ function _e(t, e, n) {
2693
+ let r, o = !1;
2694
+ try {
2695
+ let c = Ce(we, n);
2696
+ r = xn(t, e, c, n);
2697
+ } catch {
2698
+ o = !0;
2699
+ }
2700
+ let s = Oe(Un, n);
2701
+ if (r === void 0 || r === s) {
2702
+ let c = Ce(Xn, n);
2703
+ r = xn(t, e, c, n), r !== s && !o && (r = `${Oe(
2704
+ hs,
2705
+ n
2706
+ )}
2707
+
2708
+ ${r}`);
2709
+ }
2710
+ return r;
2711
+ }
2712
+ i(_e, "compareObjects");
2713
+ function Ce(t, e) {
2714
+ let { compareKeys: n } = mt(e);
2715
+ return {
2716
+ ...t,
2717
+ compareKeys: n
2718
+ };
2719
+ }
2720
+ i(Ce, "getFormatOptions");
2721
+ function xn(t, e, n, r) {
2722
+ let o = { ...n, indent: 0 }, s = Z(t, o), c = Z(e, o);
2723
+ if (s === c)
2724
+ return Oe(Un, r);
2725
+ {
2726
+ let u = Z(t, n), l = Z(e, n);
2727
+ return As(
2728
+ u.split(`
2729
+ `),
2730
+ l.split(`
2731
+ `),
2732
+ s.split(`
2733
+ `),
2734
+ c.split(`
2735
+ `),
2736
+ r
2737
+ );
2738
+ }
2739
+ }
2740
+ i(xn, "getObjectsDifference");
2741
+ var jn = 2e4;
2742
+ function Dn(t) {
2743
+ return Yt(t) === "Object" && typeof t.asymmetricMatch == "function";
2744
+ }
2745
+ i(Dn, "isAsymmetricMatcher");
2746
+ function Fn(t, e) {
2747
+ let n = Yt(t), r = Yt(e);
2748
+ return n === r && (n === "Object" || n === "Array");
2749
+ }
2750
+ i(Fn, "isReplaceable");
2751
+ function Zn(t, e, n) {
2752
+ let { aAnnotation: r, bAnnotation: o } = mt(n);
2753
+ if (typeof t == "string" && typeof e == "string" && t.length > 0 && e.length > 0 && t.length <= jn && e.length <= jn && t !== e) {
2754
+ if (t.includes(`
2755
+ `) || e.includes(`
2756
+ `))
2757
+ return Ms(e, t, n);
2758
+ let [p] = Hn(e, t, !0), a = p.some((y) => y[0] === M), _ = Us(r, o), h = _(r) + Vs(
2759
+ kn(p, z, a)
2760
+ ), g = _(o) + Ws(
2761
+ kn(p, F, a)
2762
+ );
2763
+ return `${h}
2764
+ ${g}`;
2765
+ }
2766
+ let s = be(t, { forceWritable: !0 }), c = be(e, { forceWritable: !0 }), { replacedExpected: u, replacedActual: l } = Qn(s, c);
2767
+ return Bs(u, l, n);
2768
+ }
2769
+ i(Zn, "printDiffOrStringify");
2770
+ function Qn(t, e, n = /* @__PURE__ */ new WeakSet(), r = /* @__PURE__ */ new WeakSet()) {
2771
+ return Fn(t, e) ? n.has(t) || r.has(e) ? { replacedActual: t, replacedExpected: e } : (n.add(t), r.add(e), de(e).forEach((o) => {
2772
+ let s = e[o], c = t[o];
2773
+ if (Dn(s))
2774
+ s.asymmetricMatch(c) && (t[o] = s);
2775
+ else if (Dn(c))
2776
+ c.asymmetricMatch(s) && (e[o] = c);
2777
+ else if (Fn(c, s)) {
2778
+ let u = Qn(
2779
+ c,
2780
+ s,
2781
+ n,
2782
+ r
2783
+ );
2784
+ t[o] = u.replacedActual, e[o] = u.replacedExpected;
2785
+ }
2786
+ }), {
2787
+ replacedActual: t,
2788
+ replacedExpected: e
2789
+ }) : { replacedActual: t, replacedExpected: e };
2790
+ }
2791
+ i(Qn, "replaceAsymmetricMatcher");
2792
+ function Us(...t) {
2793
+ let e = t.reduce(
2794
+ (n, r) => r.length > n ? r.length : n,
2795
+ 0
2796
+ );
2797
+ return (n) => `${n}: ${" ".repeat(e - n.length)}`;
2798
+ }
2799
+ i(Us, "getLabelPrinter");
2800
+ var Ys = "\xB7";
2801
+ function vn(t) {
2802
+ return t.replace(/\s+$/gm, (e) => Ys.repeat(e.length));
2803
+ }
2804
+ i(vn, "replaceTrailingSpaces");
2805
+ function Ws(t) {
2806
+ return v.red(vn(pt(t)));
2807
+ }
2808
+ i(Ws, "printReceived");
2809
+ function Vs(t) {
2810
+ return v.green(vn(pt(t)));
2811
+ }
2812
+ i(Vs, "printExpected");
2813
+ function kn(t, e, n) {
2814
+ return t.reduce(
2815
+ (r, o) => r + (o[0] === M ? o[1] : o[0] === e ? n ? v.inverse(o[1]) : o[1] : ""),
2816
+ ""
2817
+ );
2818
+ }
2819
+ i(kn, "getCommonAndChangedSubstrings");
2820
+
2821
+ // ../node_modules/@vitest/utils/dist/error.js
2822
+ var Ks = "@@__IMMUTABLE_RECORD__@@", qs = "@@__IMMUTABLE_ITERABLE__@@";
2823
+ function Gs(t) {
2824
+ return t && (t[qs] || t[Ks]);
2825
+ }
2826
+ i(Gs, "isImmutable");
2827
+ var Hs = Object.getPrototypeOf({});
2828
+ function tr(t) {
2829
+ return t instanceof Error ? `<unserializable>: ${t.message}` : typeof t == "string" ? `<unserializable>: ${t}` : "<unserializable>";
2830
+ }
2831
+ i(tr, "getUnserializableMessage");
2832
+ function St(t, e = /* @__PURE__ */ new WeakMap()) {
2833
+ if (!t || typeof t == "string")
2834
+ return t;
2835
+ if (typeof t == "function")
2836
+ return `Function<${t.name || "anonymous"}>`;
2837
+ if (typeof t == "symbol")
2838
+ return t.toString();
2839
+ if (typeof t != "object")
2840
+ return t;
2841
+ if (Gs(t))
2842
+ return St(t.toJSON(), e);
2843
+ if (t instanceof Promise || t.constructor && t.constructor.prototype === "AsyncFunction")
2844
+ return "Promise";
2845
+ if (typeof Element < "u" && t instanceof Element)
2846
+ return t.tagName;
2847
+ if (typeof t.asymmetricMatch == "function")
2848
+ return `${t.toString()} ${En(t.sample)}`;
2849
+ if (typeof t.toJSON == "function")
2850
+ return St(t.toJSON(), e);
2851
+ if (e.has(t))
2852
+ return e.get(t);
2853
+ if (Array.isArray(t)) {
2854
+ let n = new Array(t.length);
2855
+ return e.set(t, n), t.forEach((r, o) => {
2856
+ try {
2857
+ n[o] = St(r, e);
2858
+ } catch (s) {
2859
+ n[o] = tr(s);
2860
+ }
2861
+ }), n;
2862
+ } else {
2863
+ let n = /* @__PURE__ */ Object.create(null);
2864
+ e.set(t, n);
2865
+ let r = t;
2866
+ for (; r && r !== Hs; )
2867
+ Object.getOwnPropertyNames(r).forEach((o) => {
2868
+ if (!(o in n))
2869
+ try {
2870
+ n[o] = St(t[o], e);
2871
+ } catch (s) {
2872
+ delete n[o], n[o] = tr(s);
2873
+ }
2874
+ }), r = Object.getPrototypeOf(r);
2875
+ return n;
2876
+ }
2877
+ }
2878
+ i(St, "serializeValue");
2879
+ function Js(t) {
2880
+ return t.replace(/__(vite_ssr_import|vi_import)_\d+__\./g, "");
2881
+ }
2882
+ i(Js, "normalizeErrorMessage");
2883
+ function Ae(t, e, n = /* @__PURE__ */ new WeakSet()) {
2884
+ if (!t || typeof t != "object")
2885
+ return { message: String(t) };
2886
+ let r = t;
2887
+ r.stack && (r.stackStr = String(r.stack)), r.name && (r.nameStr = String(r.name)), (r.showDiff || r.showDiff === void 0 && r.expected !== void 0 &&
2888
+ r.actual !== void 0) && (r.diff = Zn(r.actual, r.expected, {
2889
+ ...e,
2890
+ ...r.diffOptions
2891
+ })), typeof r.expected != "string" && (r.expected = pt(r.expected, 10)), typeof r.actual != "string" && (r.actual = pt(r.actual, 10));
2892
+ try {
2893
+ typeof r.message == "string" && (r.message = Js(r.message));
2894
+ } catch {
2895
+ }
2896
+ try {
2897
+ !n.has(r) && typeof r.cause == "object" && (n.add(r), r.cause = Ae(r.cause, e, n));
2898
+ } catch {
2899
+ }
2900
+ try {
2901
+ return St(r);
2902
+ } catch (o) {
2903
+ return St(
2904
+ new Error(
2905
+ `Failed to fully serialize error: ${o?.message}
2906
+ Inner error message: ${r?.message}`
2907
+ )
2908
+ );
2909
+ }
2910
+ }
2911
+ i(Ae, "processError");
2912
+
2913
+ // src/instrumenter/types.ts
2914
+ var er = /* @__PURE__ */ ((o) => (o.DONE = "done", o.ERROR = "error", o.ACTIVE = "active", o.WAITING = "waiting", o))(er || {});
2915
+
2916
+ // src/instrumenter/instrumenter.ts
2917
+ var nt = {
2918
+ CALL: "storybook/instrumenter/call",
2919
+ SYNC: "storybook/instrumenter/sync",
2920
+ START: "storybook/instrumenter/start",
2921
+ BACK: "storybook/instrumenter/back",
2922
+ GOTO: "storybook/instrumenter/goto",
2923
+ NEXT: "storybook/instrumenter/next",
2924
+ END: "storybook/instrumenter/end"
2925
+ }, nr = {
2926
+ start: !1,
2927
+ back: !1,
2928
+ goto: !1,
2929
+ next: !1,
2930
+ end: !1
2931
+ }, Xs = new Error(
2932
+ "This function ran after the play function completed. Did you forget to `await` it?"
2933
+ ), rr = /* @__PURE__ */ i((t) => Object.prototype.toString.call(t) === "[object Object]", "isObject"), Zs = /* @__PURE__ */ i((t) => Object.
2934
+ prototype.toString.call(t) === "[object Module]", "isModule"), Qs = /* @__PURE__ */ i((t) => {
2935
+ if (!rr(t) && !Zs(t))
2936
+ return !1;
2937
+ if (t.constructor === void 0)
2938
+ return !0;
2939
+ let e = t.constructor.prototype;
2940
+ return !!rr(e);
2941
+ }, "isInstrumentable"), vs = /* @__PURE__ */ i((t) => {
2942
+ try {
2943
+ return new t.constructor();
2944
+ } catch {
2945
+ return {};
2946
+ }
2947
+ }, "construct"), Ne = /* @__PURE__ */ i(() => ({
2948
+ renderPhase: void 0,
2949
+ isDebugging: !1,
2950
+ isPlaying: !1,
2951
+ isLocked: !1,
2952
+ cursor: 0,
2953
+ calls: [],
2954
+ shadowCalls: [],
2955
+ callRefsByResult: /* @__PURE__ */ new Map(),
2956
+ chainedCallIds: /* @__PURE__ */ new Set(),
2957
+ ancestors: [],
2958
+ playUntil: void 0,
2959
+ resolvers: {},
2960
+ syncTimeout: void 0
2961
+ }), "getInitialState"), or = /* @__PURE__ */ i((t, e = !1) => {
2962
+ let n = (e ? t.shadowCalls : t.calls).filter((o) => o.retain);
2963
+ if (!n.length)
2964
+ return;
2965
+ let r = new Map(
2966
+ Array.from(t.callRefsByResult.entries()).filter(([, o]) => o.retain)
2967
+ );
2968
+ return { cursor: n.length, calls: n, callRefsByResult: r };
2969
+ }, "getRetainedState"), Ie = class {
2970
+ constructor() {
2971
+ this.initialized = !1;
2972
+ this.channel = ir.addons.getChannel(), this.state = U.global.window?.parent.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER_STATE__ || {};
2973
+ let e = /* @__PURE__ */ i(({
2974
+ storyId: u,
2975
+ isPlaying: l = !0,
2976
+ isDebugging: f = !1
2977
+ }) => {
2978
+ let p = this.getState(u);
2979
+ this.setState(u, {
2980
+ ...Ne(),
2981
+ ...or(p, f),
2982
+ shadowCalls: f ? p.shadowCalls : [],
2983
+ chainedCallIds: f ? p.chainedCallIds : /* @__PURE__ */ new Set(),
2984
+ playUntil: f ? p.playUntil : void 0,
2985
+ isPlaying: l,
2986
+ isDebugging: f
2987
+ }), this.sync(u);
2988
+ }, "resetState");
2989
+ this.channel.on(gt.FORCE_REMOUNT, e), this.channel.on(gt.STORY_RENDER_PHASE_CHANGED, ({ storyId: u, newPhase: l }) => {
2990
+ let { isDebugging: f } = this.getState(u);
2991
+ this.setState(u, { renderPhase: l }), l === "preparing" && f && e({ storyId: u }), l === "playing" && e({ storyId: u, isDebugging: f }),
2992
+ l === "played" && this.setState(u, {
2993
+ isLocked: !1,
2994
+ isPlaying: !1,
2995
+ isDebugging: !1
2996
+ }), l === "errored" && this.setState(u, {
2997
+ isLocked: !1,
2998
+ isPlaying: !1
2999
+ });
3000
+ }), this.channel.on(gt.SET_CURRENT_STORY, () => {
3001
+ this.initialized ? this.cleanup() : this.initialized = !0;
3002
+ });
3003
+ let n = /* @__PURE__ */ i(({ storyId: u, playUntil: l }) => {
3004
+ this.getState(u).isDebugging || this.setState(u, ({ calls: p }) => ({
3005
+ calls: [],
3006
+ shadowCalls: p.map((a) => ({ ...a, status: "waiting" })),
3007
+ isDebugging: !0
3008
+ }));
3009
+ let f = this.getLog(u);
3010
+ this.setState(u, ({ shadowCalls: p }) => {
3011
+ if (l || !f.length)
3012
+ return { playUntil: l };
3013
+ let a = p.findIndex((_) => _.id === f[0].callId);
3014
+ return {
3015
+ playUntil: p.slice(0, a).filter((_) => _.interceptable && !_.ancestors?.length).slice(-1)[0]?.id
3016
+ };
3017
+ }), this.channel.emit(gt.FORCE_REMOUNT, { storyId: u, isDebugging: !0 });
3018
+ }, "start"), r = /* @__PURE__ */ i(({ storyId: u }) => {
3019
+ let l = this.getLog(u).filter((p) => !p.ancestors?.length), f = l.reduceRight((p, a, _) => p >= 0 || a.status === "waiting" ? p : _, -1);
3020
+ n({ storyId: u, playUntil: l[f - 1]?.callId });
3021
+ }, "back"), o = /* @__PURE__ */ i(({ storyId: u, callId: l }) => {
3022
+ let { calls: f, shadowCalls: p, resolvers: a } = this.getState(u), _ = f.find(({ id: g }) => g === l), h = p.find(({ id: g }) => g ===
3023
+ l);
3024
+ if (!_ && h && Object.values(a).length > 0) {
3025
+ let g = this.getLog(u).find((y) => y.status === "waiting")?.callId;
3026
+ h.id !== g && this.setState(u, { playUntil: h.id }), Object.values(a).forEach((y) => y());
3027
+ } else
3028
+ n({ storyId: u, playUntil: l });
3029
+ }, "goto"), s = /* @__PURE__ */ i(({ storyId: u }) => {
3030
+ let { resolvers: l } = this.getState(u);
3031
+ if (Object.values(l).length > 0)
3032
+ Object.values(l).forEach((f) => f());
3033
+ else {
3034
+ let f = this.getLog(u).find((p) => p.status === "waiting")?.callId;
3035
+ f ? n({ storyId: u, playUntil: f }) : c({ storyId: u });
3036
+ }
3037
+ }, "next"), c = /* @__PURE__ */ i(({ storyId: u }) => {
3038
+ this.setState(u, { playUntil: void 0, isDebugging: !1 }), Object.values(this.getState(u).resolvers).forEach((l) => l());
3039
+ }, "end");
3040
+ this.channel.on(nt.START, n), this.channel.on(nt.BACK, r), this.channel.on(nt.GOTO, o), this.channel.on(nt.NEXT, s), this.channel.on(nt.
3041
+ END, c);
3042
+ }
3043
+ static {
3044
+ i(this, "Instrumenter");
3045
+ }
3046
+ getState(e) {
3047
+ return this.state[e] || Ne();
3048
+ }
3049
+ setState(e, n) {
3050
+ let r = this.getState(e), o = typeof n == "function" ? n(r) : n;
3051
+ this.state = { ...this.state, [e]: { ...r, ...o } }, U.global.window?.parent && (U.global.window.parent.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER_STATE__ =
3052
+ this.state);
3053
+ }
3054
+ cleanup() {
3055
+ this.state = Object.entries(this.state).reduce(
3056
+ (n, [r, o]) => {
3057
+ let s = or(o);
3058
+ return s && (n[r] = Object.assign(Ne(), s)), n;
3059
+ },
3060
+ {}
3061
+ );
3062
+ let e = { controlStates: nr, logItems: [] };
3063
+ this.channel.emit(nt.SYNC, e), U.global.window?.parent && (U.global.window.parent.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER_STATE__ = this.
3064
+ state);
3065
+ }
3066
+ getLog(e) {
3067
+ let { calls: n, shadowCalls: r } = this.getState(e), o = [...r];
3068
+ n.forEach((c, u) => {
3069
+ o[u] = c;
3070
+ });
3071
+ let s = /* @__PURE__ */ new Set();
3072
+ return o.reduceRight((c, u) => (u.args.forEach((l) => {
3073
+ l?.__callId__ && s.add(l.__callId__);
3074
+ }), u.path.forEach((l) => {
3075
+ l.__callId__ && s.add(l.__callId__);
3076
+ }), (u.interceptable || u.exception) && !s.has(u.id) && (c.unshift({ callId: u.id, status: u.status, ancestors: u.ancestors }), s.add(u.
3077
+ id)), c), []);
3078
+ }
3079
+ // Traverses the object structure to recursively patch all function properties.
3080
+ // Returns the original object, or a new object with the same constructor,
3081
+ // depending on whether it should mutate.
3082
+ instrument(e, n, r = 0) {
3083
+ if (!Qs(e))
3084
+ return e;
3085
+ let { mutate: o = !1, path: s = [] } = n, c = n.getKeys ? n.getKeys(e, r) : Object.keys(e);
3086
+ return r += 1, c.reduce(
3087
+ (u, l) => {
3088
+ let f = ti(e, l);
3089
+ if (typeof f?.get == "function") {
3090
+ let a = /* @__PURE__ */ i(() => f?.get?.bind(e)?.(), "getter");
3091
+ return Object.defineProperty(u, l, {
3092
+ get: /* @__PURE__ */ i(() => this.instrument(a(), { ...n, path: s.concat(l) }, r), "get")
3093
+ }), u;
3094
+ }
3095
+ let p = e[l];
3096
+ return typeof p != "function" ? (u[l] = this.instrument(p, { ...n, path: s.concat(l) }, r), u) : "__originalFn__" in p && typeof p.__originalFn__ ==
3097
+ "function" ? (u[l] = p, u) : (u[l] = (...a) => this.track(l, p, e, a, n), u[l].__originalFn__ = p, Object.defineProperty(u[l], "name",
3098
+ { value: l, writable: !1 }), Object.keys(p).length > 0 && Object.assign(
3099
+ u[l],
3100
+ this.instrument({ ...p }, { ...n, path: s.concat(l) }, r)
3101
+ ), u);
3102
+ },
3103
+ o ? e : vs(e)
3104
+ );
3105
+ }
3106
+ // Monkey patch an object method to record calls.
3107
+ // Returns a function that invokes the original function, records the invocation ("call") and
3108
+ // returns the original result.
3109
+ track(e, n, r, o, s) {
3110
+ let c = o?.[0]?.__storyId__ || U.global.__STORYBOOK_PREVIEW__?.selectionStore?.selection?.storyId, { cursor: u, ancestors: l } = this.getState(
3111
+ c);
3112
+ this.setState(c, { cursor: u + 1 });
3113
+ let f = `${l.slice(-1)[0] || c} [${u}] ${e}`, { path: p = [], intercept: a = !1, retain: _ = !1 } = s, h = typeof a == "function" ? a(e,
3114
+ p) : a, g = { id: f, cursor: u, storyId: c, ancestors: l, path: p, method: e, args: o, interceptable: h, retain: _ }, m = (h && !l.length ?
3115
+ this.intercept : this.invoke).call(this, n, r, g, s);
3116
+ return this.instrument(m, { ...s, mutate: !0, path: [{ __callId__: g.id }] });
3117
+ }
3118
+ intercept(e, n, r, o) {
3119
+ let { chainedCallIds: s, isDebugging: c, playUntil: u } = this.getState(r.storyId), l = s.has(r.id);
3120
+ return !c || l || u ? (u === r.id && this.setState(r.storyId, { playUntil: void 0 }), this.invoke(e, n, r, o)) : new Promise((f) => {
3121
+ this.setState(r.storyId, ({ resolvers: p }) => ({
3122
+ isLocked: !1,
3123
+ resolvers: { ...p, [r.id]: f }
3124
+ }));
3125
+ }).then(() => (this.setState(r.storyId, (f) => {
3126
+ let { [r.id]: p, ...a } = f.resolvers;
3127
+ return { isLocked: !0, resolvers: a };
3128
+ }), this.invoke(e, n, r, o)));
3129
+ }
3130
+ invoke(e, n, r, o) {
3131
+ let { callRefsByResult: s, renderPhase: c } = this.getState(r.storyId), u = 25, l = /* @__PURE__ */ i((a, _, h) => {
3132
+ if (h.includes(a))
3133
+ return "[Circular]";
3134
+ if (h = [...h, a], _ > u)
3135
+ return "...";
3136
+ if (s.has(a))
3137
+ return s.get(a);
3138
+ if (a instanceof Array)
3139
+ return a.map((g) => l(g, ++_, h));
3140
+ if (a instanceof Date)
3141
+ return { __date__: { value: a.toISOString() } };
3142
+ if (a instanceof Error) {
3143
+ let { name: g, message: y, stack: m } = a;
3144
+ return { __error__: { name: g, message: y, stack: m } };
3145
+ }
3146
+ if (a instanceof RegExp) {
3147
+ let { flags: g, source: y } = a;
3148
+ return { __regexp__: { flags: g, source: y } };
3149
+ }
3150
+ if (a instanceof U.global.window?.HTMLElement) {
3151
+ let { prefix: g, localName: y, id: m, classList: b, innerText: E } = a, $ = Array.from(b);
3152
+ return { __element__: { prefix: g, localName: y, id: m, classNames: $, innerText: E } };
3153
+ }
3154
+ return typeof a == "function" ? {
3155
+ __function__: { name: "getMockName" in a ? a.getMockName() : a.name }
3156
+ } : typeof a == "symbol" ? { __symbol__: { description: a.description } } : typeof a == "object" && a?.constructor?.name && a?.constructor?.
3157
+ name !== "Object" ? { __class__: { name: a.constructor.name } } : Object.prototype.toString.call(a) === "[object Object]" ? Object.fromEntries(
3158
+ Object.entries(a).map(([g, y]) => [g, l(y, ++_, h)])
3159
+ ) : a;
3160
+ }, "serializeValues"), f = {
3161
+ ...r,
3162
+ args: r.args.map((a) => l(a, 0, []))
3163
+ };
3164
+ r.path.forEach((a) => {
3165
+ a?.__callId__ && this.setState(r.storyId, ({ chainedCallIds: _ }) => ({
3166
+ chainedCallIds: new Set(Array.from(_).concat(a.__callId__))
3167
+ }));
3168
+ });
3169
+ let p = /* @__PURE__ */ i((a) => {
3170
+ if (a instanceof Error) {
3171
+ let { name: _, message: h, stack: g, callId: y = r.id } = a, {
3172
+ showDiff: m = void 0,
3173
+ diff: b = void 0,
3174
+ actual: E = void 0,
3175
+ expected: $ = void 0
3176
+ } = a.name === "AssertionError" ? Ae(a) : a, d = { name: _, message: h, stack: g, callId: y, showDiff: m, diff: b, actual: E, expected: $ };
3177
+ if (this.update({ ...f, status: "error", exception: d }), this.setState(r.storyId, (S) => ({
3178
+ callRefsByResult: new Map([
3179
+ ...Array.from(S.callRefsByResult.entries()),
3180
+ [a, { __callId__: r.id, retain: r.retain }]
3181
+ ])
3182
+ })), r.ancestors?.length)
3183
+ throw Object.prototype.hasOwnProperty.call(a, "callId") || Object.defineProperty(a, "callId", { value: r.id }), a;
3184
+ }
3185
+ throw a;
3186
+ }, "handleException");
3187
+ try {
3188
+ if (c === "played" && !r.retain)
3189
+ throw Xs;
3190
+ let _ = (o.getArgs ? o.getArgs(r, this.getState(r.storyId)) : r.args).map((g) => typeof g != "function" || Object.keys(g).length ? g :
3191
+ (...y) => {
3192
+ let { cursor: m, ancestors: b } = this.getState(r.storyId);
3193
+ this.setState(r.storyId, { cursor: 0, ancestors: [...b, r.id] });
3194
+ let E = /* @__PURE__ */ i(() => this.setState(r.storyId, { cursor: m, ancestors: b }), "restore"), $ = !1;
3195
+ try {
3196
+ let d = g(...y);
3197
+ return d instanceof Promise ? ($ = !0, d.finally(E)) : d;
3198
+ } finally {
3199
+ $ || E();
3200
+ }
3201
+ }), h = e.apply(n, _);
3202
+ return h && ["object", "function", "symbol"].includes(typeof h) && this.setState(r.storyId, (g) => ({
3203
+ callRefsByResult: new Map([
3204
+ ...Array.from(g.callRefsByResult.entries()),
3205
+ [h, { __callId__: r.id, retain: r.retain }]
3206
+ ])
3207
+ })), this.update({
3208
+ ...f,
3209
+ status: h instanceof Promise ? "active" : "done"
3210
+ }), h instanceof Promise ? h.then((g) => (this.update({ ...f, status: "done" }), g), p) : h;
3211
+ } catch (a) {
3212
+ return p(a);
3213
+ }
3214
+ }
3215
+ // Sends the call info to the manager and synchronizes the log.
3216
+ update(e) {
3217
+ this.channel.emit(nt.CALL, e), this.setState(e.storyId, ({ calls: n }) => {
3218
+ let r = n.concat(e).reduce((o, s) => Object.assign(o, { [s.id]: s }), {});
3219
+ return {
3220
+ // Calls are sorted to ensure parent calls always come before calls in their callback.
3221
+ calls: Object.values(r).sort(
3222
+ (o, s) => o.id.localeCompare(s.id, void 0, { numeric: !0 })
3223
+ )
3224
+ };
3225
+ }), this.sync(e.storyId);
3226
+ }
3227
+ // Builds a log of interceptable calls and control states and sends it to the manager.
3228
+ // Uses a 0ms debounce because this might get called many times in one tick.
3229
+ sync(e) {
3230
+ let n = /* @__PURE__ */ i(() => {
3231
+ let { isLocked: r, isPlaying: o } = this.getState(e), s = this.getLog(e), c = s.filter(({ ancestors: a }) => !a.length).find((a) => a.
3232
+ status === "waiting")?.callId, u = s.some((a) => a.status === "active");
3233
+ if (r || u || s.length === 0) {
3234
+ let a = { controlStates: nr, logItems: s };
3235
+ this.channel.emit(nt.SYNC, a);
3236
+ return;
3237
+ }
3238
+ let l = s.some(
3239
+ (a) => a.status === "done" || a.status === "error"
3240
+ ), p = { controlStates: {
3241
+ start: l,
3242
+ back: l,
3243
+ goto: !0,
3244
+ next: o,
3245
+ end: o
3246
+ }, logItems: s, pausedAt: c };
3247
+ this.channel.emit(nt.SYNC, p);
3248
+ }, "synchronize");
3249
+ this.setState(e, ({ syncTimeout: r }) => (clearTimeout(r), { syncTimeout: setTimeout(n, 0) }));
3250
+ }
3251
+ };
3252
+ function cr(t, e = {}) {
3253
+ try {
3254
+ let n = !1, r = !1;
3255
+ return U.global.window?.location?.search?.includes("instrument=true") ? n = !0 : U.global.window?.location?.search?.includes("instrument\
3256
+ =false") && (r = !0), U.global.window?.parent === U.global.window && !n || r ? t : (U.global.window && !U.global.window.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER__ &&
3257
+ (U.global.window.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER__ = new Ie()), (U.global.window?.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER__).
3258
+ instrument(t, e));
3259
+ } catch (n) {
3260
+ return sr.once.warn(n), t;
3261
+ }
3262
+ }
3263
+ i(cr, "instrument");
3264
+ function ti(t, e) {
3265
+ let n = t;
3266
+ for (; n != null; ) {
3267
+ let r = Object.getOwnPropertyDescriptor(n, e);
3268
+ if (r)
3269
+ return r;
3270
+ n = Object.getPrototypeOf(n);
3271
+ }
3272
+ }
3273
+ i(ti, "getPropertyDescriptor");