twd-js 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundled.d.ts +18 -0
- package/dist/bundled.es.js +63 -60
- package/dist/bundled.umd.js +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/mock-sw.js +1 -1
- package/package.json +1 -1
package/dist/bundled.d.ts
CHANGED
|
@@ -4,6 +4,24 @@ interface TestModule {
|
|
|
4
4
|
interface InitTWDOptions {
|
|
5
5
|
open?: boolean;
|
|
6
6
|
position?: "left" | "right";
|
|
7
|
+
serviceWorker?: boolean;
|
|
8
|
+
serviceWorkerUrl?: string;
|
|
7
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Initialize TWD with tests and optional configuration
|
|
12
|
+
* @param files The test modules
|
|
13
|
+
* @param options The options for the initialization
|
|
14
|
+
* @param options.open Whether to open the sidebar
|
|
15
|
+
* @param options.position The position of the sidebar
|
|
16
|
+
* @param options.serviceWorker Whether to use the service worker
|
|
17
|
+
* @param options.serviceWorkerUrl The URL of the service worker
|
|
18
|
+
* @returns void
|
|
19
|
+
* @example
|
|
20
|
+
* initTWD(testModules, { open: true, position: 'left' });
|
|
21
|
+
* @example
|
|
22
|
+
* initTWD(testModules, { open: true, position: 'left', serviceWorker: false });
|
|
23
|
+
* @example
|
|
24
|
+
* initTWD(testModules, { open: true, position: 'left', serviceWorker: true, serviceWorkerUrl: '/mock-sw.js' });
|
|
25
|
+
*/
|
|
8
26
|
export declare const initTWD: (files: TestModule, options?: InitTWDOptions) => void;
|
|
9
27
|
export {};
|
package/dist/bundled.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var O, h, xe, C, le, Se, Te, Ee, ne, G, X, M = {}, Re = [], Ue = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, q = Array.isArray;
|
|
2
2
|
function T(t, e) {
|
|
3
3
|
for (var n in e) t[n] = e[n];
|
|
4
4
|
return t;
|
|
@@ -6,10 +6,10 @@ function T(t, e) {
|
|
|
6
6
|
function re(t) {
|
|
7
7
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function Fe(t, e, n) {
|
|
10
10
|
var r, s, i, _ = {};
|
|
11
11
|
for (i in e) i == "key" ? r = e[i] : i == "ref" ? s = e[i] : _[i] = e[i];
|
|
12
|
-
if (arguments.length > 2 && (_.children = arguments.length > 3 ?
|
|
12
|
+
if (arguments.length > 2 && (_.children = arguments.length > 3 ? O.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (i in t.defaultProps) _[i] === void 0 && (_[i] = t.defaultProps[i]);
|
|
13
13
|
return B(t, _, r, s, null);
|
|
14
14
|
}
|
|
15
15
|
function B(t, e, n, r, s) {
|
|
@@ -19,7 +19,7 @@ function B(t, e, n, r, s) {
|
|
|
19
19
|
function L(t) {
|
|
20
20
|
return t.children;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function U(t, e) {
|
|
23
23
|
this.props = t, this.context = e;
|
|
24
24
|
}
|
|
25
25
|
function A(t, e) {
|
|
@@ -41,7 +41,7 @@ function ae(t) {
|
|
|
41
41
|
(!t.__d && (t.__d = !0) && C.push(t) && !z.__r++ || le != h.debounceRendering) && ((le = h.debounceRendering) || Se)(z);
|
|
42
42
|
}
|
|
43
43
|
function z() {
|
|
44
|
-
for (var t, e, n, r, s, i, _, l = 1; C.length; ) C.length > l && C.sort(Te), t = C.shift(), l = C.length, t.__d && (n = void 0, r = void 0, s = (r = (e = t).__v).__e, i = [], _ = [], e.__P && ((n = T({}, r)).__v = r.__v + 1, h.vnode && h.vnode(n), oe(e.__P, n, r, e.__n, e.__P.namespaceURI, 32 & r.__u ? [s] : null, i, s ?? A(r), !!(32 & r.__u), _), n.__v = r.__v, n.__.__k[n.__i] = n,
|
|
44
|
+
for (var t, e, n, r, s, i, _, l = 1; C.length; ) C.length > l && C.sort(Te), t = C.shift(), l = C.length, t.__d && (n = void 0, r = void 0, s = (r = (e = t).__v).__e, i = [], _ = [], e.__P && ((n = T({}, r)).__v = r.__v + 1, h.vnode && h.vnode(n), oe(e.__P, n, r, e.__n, e.__P.namespaceURI, 32 & r.__u ? [s] : null, i, s ?? A(r), !!(32 & r.__u), _), n.__v = r.__v, n.__.__k[n.__i] = n, We(i, n, _), r.__e = r.__ = null, n.__e != s && Ce(n)));
|
|
45
45
|
z.__r = 0;
|
|
46
46
|
}
|
|
47
47
|
function $e(t, e, n, r, s, i, _, l, u, a, p) {
|
|
@@ -51,7 +51,7 @@ function $e(t, e, n, r, s, i, _, l, u, a, p) {
|
|
|
51
51
|
}
|
|
52
52
|
function ze(t, e, n, r, s) {
|
|
53
53
|
var i, _, l, u, a, p = n.length, o = p, f = 0;
|
|
54
|
-
for (t.__k = new Array(s), i = 0; i < s; i++) (_ = e[i]) != null && typeof _ != "boolean" && typeof _ != "function" ? (typeof _ == "string" || typeof _ == "number" || typeof _ == "bigint" || _.constructor == String ? _ = t.__k[i] = B(null, _, null, null, null) : q(_) ? _ = t.__k[i] = B(L, { children: _ }, null, null, null) : _.constructor == null && _.__b > 0 ? _ = t.__k[i] = B(_.type, _.props, _.key, _.ref ? _.ref : null, _.__v) : t.__k[i] = _, u = i + f, _.__ = t, _.__b = t.__b + 1, (a = _.__i =
|
|
54
|
+
for (t.__k = new Array(s), i = 0; i < s; i++) (_ = e[i]) != null && typeof _ != "boolean" && typeof _ != "function" ? (typeof _ == "string" || typeof _ == "number" || typeof _ == "bigint" || _.constructor == String ? _ = t.__k[i] = B(null, _, null, null, null) : q(_) ? _ = t.__k[i] = B(L, { children: _ }, null, null, null) : _.constructor == null && _.__b > 0 ? _ = t.__k[i] = B(_.type, _.props, _.key, _.ref ? _.ref : null, _.__v) : t.__k[i] = _, u = i + f, _.__ = t, _.__b = t.__b + 1, (a = _.__i = je(_, n, u, o)) != -1 && (o--, (l = n[a]) && (l.__u |= 2)), l == null || l.__v == null ? (a == -1 && (s > p ? f-- : s < p && f++), typeof _.type != "function" && (_.__u |= 4)) : a != u && (a == u - 1 ? f-- : a == u + 1 ? f++ : (a > u ? f-- : f++, _.__u |= 4))) : t.__k[i] = null;
|
|
55
55
|
if (o) for (i = 0; i < p; i++) (l = n[i]) != null && (2 & l.__u) == 0 && (l.__e == r && (r = A(l)), Me(l, l));
|
|
56
56
|
return r;
|
|
57
57
|
}
|
|
@@ -67,7 +67,7 @@ function Ae(t, e, n, r) {
|
|
|
67
67
|
while (e != null && e.nodeType == 8);
|
|
68
68
|
return e;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function je(t, e, n, r) {
|
|
71
71
|
var s, i, _, l = t.key, u = t.type, a = e[n], p = a != null && (2 & a.__u) == 0;
|
|
72
72
|
if (a === null && l == null || p && l == a.key && u == a.type) return n;
|
|
73
73
|
if (r > (p ? 1 : 0)) {
|
|
@@ -76,9 +76,9 @@ function Oe(t, e, n, r) {
|
|
|
76
76
|
return -1;
|
|
77
77
|
}
|
|
78
78
|
function ce(t, e, n) {
|
|
79
|
-
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" ||
|
|
79
|
+
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || Ue.test(e) ? n : n + "px";
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function D(t, e, n, r, s) {
|
|
82
82
|
var i, _;
|
|
83
83
|
e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
|
|
84
84
|
else {
|
|
@@ -107,11 +107,11 @@ function ue(t) {
|
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
function oe(t, e, n, r, s, i, _, l, u, a) {
|
|
110
|
-
var p, o, f, d, b, x, k, m, g, E, R, N,
|
|
110
|
+
var p, o, f, d, b, x, k, m, g, E, R, N, W, _e, I, H, K, S = e.type;
|
|
111
111
|
if (e.constructor != null) return null;
|
|
112
112
|
128 & n.__u && (u = !!(32 & n.__u), i = [l = e.__e = n.__e]), (p = h.__b) && p(e);
|
|
113
113
|
e: if (typeof S == "function") try {
|
|
114
|
-
if (m = e.props, g = "prototype" in S && S.prototype.render, E = (p = S.contextType) && r[p.__c], R = p ? E ? E.props.value : p.__ : r, n.__c ? k = (o = e.__c = n.__c).__ = o.__E : (g ? e.__c = o = new S(m, R) : (e.__c = o = new
|
|
114
|
+
if (m = e.props, g = "prototype" in S && S.prototype.render, E = (p = S.contextType) && r[p.__c], R = p ? E ? E.props.value : p.__ : r, n.__c ? k = (o = e.__c = n.__c).__ = o.__E : (g ? e.__c = o = new S(m, R) : (e.__c = o = new U(m, R), o.constructor = S, o.render = qe), E && E.sub(o), o.state || (o.state = {}), o.__n = r, f = o.__d = !0, o.__h = [], o._sb = []), g && o.__s == null && (o.__s = o.state), g && S.getDerivedStateFromProps != null && (o.__s == o.state && (o.__s = T({}, o.__s)), T(o.__s, S.getDerivedStateFromProps(m, o.__s))), d = o.props, b = o.state, o.__v = e, f) g && S.getDerivedStateFromProps == null && o.componentWillMount != null && o.componentWillMount(), g && o.componentDidMount != null && o.__h.push(o.componentDidMount);
|
|
115
115
|
else {
|
|
116
116
|
if (g && S.getDerivedStateFromProps == null && m !== d && o.componentWillReceiveProps != null && o.componentWillReceiveProps(m, R), e.__v == n.__v || !o.__e && o.shouldComponentUpdate != null && o.shouldComponentUpdate(m, o.__s, R) === !1) {
|
|
117
117
|
for (e.__v != n.__v && (o.props = m, o.state = o.__s, o.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function($) {
|
|
@@ -124,13 +124,13 @@ function oe(t, e, n, r, s, i, _, l, u, a) {
|
|
|
124
124
|
o.componentDidUpdate(d, b, x);
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
if (o.context = R, o.props = m, o.__P = t, o.__e = !1,
|
|
128
|
-
for (o.state = o.__s, o.__d = !1,
|
|
127
|
+
if (o.context = R, o.props = m, o.__P = t, o.__e = !1, W = h.__r, _e = 0, g) {
|
|
128
|
+
for (o.state = o.__s, o.__d = !1, W && W(e), p = o.render(o.props, o.state, o.context), I = 0; I < o._sb.length; I++) o.__h.push(o._sb[I]);
|
|
129
129
|
o._sb = [];
|
|
130
130
|
} else do
|
|
131
|
-
o.__d = !1,
|
|
131
|
+
o.__d = !1, W && W(e), p = o.render(o.props, o.state, o.context), o.state = o.__s;
|
|
132
132
|
while (o.__d && ++_e < 25);
|
|
133
|
-
o.state = o.__s, o.getChildContext != null && (r = T(T({}, r), o.getChildContext())), g && !f && o.getSnapshotBeforeUpdate != null && (x = o.getSnapshotBeforeUpdate(d, b)),
|
|
133
|
+
o.state = o.__s, o.getChildContext != null && (r = T(T({}, r), o.getChildContext())), g && !f && o.getSnapshotBeforeUpdate != null && (x = o.getSnapshotBeforeUpdate(d, b)), H = p, p != null && p.type === L && p.key == null && (H = He(p.props.children)), l = $e(t, q(H) ? H : [H], e, n, r, s, i, _, l, u, a), o.base = e.__e, e.__u &= -161, o.__h.length && _.push(o), k && (o.__E = o.__ = null);
|
|
134
134
|
} catch ($) {
|
|
135
135
|
if (e.__v = null, u || i != null) if ($.then) {
|
|
136
136
|
for (e.__u |= u ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
|
|
@@ -142,13 +142,13 @@ function oe(t, e, n, r, s, i, _, l, u, a) {
|
|
|
142
142
|
else e.__e = n.__e, e.__k = n.__k, $.then || J(e);
|
|
143
143
|
h.__e($, e, n);
|
|
144
144
|
}
|
|
145
|
-
else i == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e =
|
|
145
|
+
else i == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = Oe(n.__e, e, n, r, s, i, _, u, a);
|
|
146
146
|
return (p = h.diffed) && p(e), 128 & e.__u ? void 0 : l;
|
|
147
147
|
}
|
|
148
148
|
function J(t) {
|
|
149
149
|
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(J);
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function We(t, e, n) {
|
|
152
152
|
for (var r = 0; r < n.length; r++) ie(n[r], n[++r], n[++r]);
|
|
153
153
|
h.__c && h.__c(e, t), t.some(function(s) {
|
|
154
154
|
try {
|
|
@@ -160,10 +160,10 @@ function He(t, e, n) {
|
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : q(t) ? t.map(
|
|
163
|
+
function He(t) {
|
|
164
|
+
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : q(t) ? t.map(He) : T({}, t);
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function Oe(t, e, n, r, s, i, _, l, u) {
|
|
167
167
|
var a, p, o, f, d, b, x, k = n.props || M, m = e.props, g = e.type;
|
|
168
168
|
if (g == "svg" ? s = "http://www.w3.org/2000/svg" : g == "math" ? s = "http://www.w3.org/1998/Math/MathML" : s || (s = "http://www.w3.org/1999/xhtml"), i != null) {
|
|
169
169
|
for (a = 0; a < i.length; a++) if ((d = i[a]) && "setAttribute" in d == !!g && (g ? d.localName == g : d.nodeType == 3)) {
|
|
@@ -177,18 +177,18 @@ function je(t, e, n, r, s, i, _, l, u) {
|
|
|
177
177
|
}
|
|
178
178
|
if (g == null) k === m || l && t.data == m || (t.data = m);
|
|
179
179
|
else {
|
|
180
|
-
if (i = i &&
|
|
180
|
+
if (i = i && O.call(t.childNodes), !l && i != null) for (k = {}, a = 0; a < t.attributes.length; a++) k[(d = t.attributes[a]).name] = d.value;
|
|
181
181
|
for (a in k) if (d = k[a], a != "children") {
|
|
182
182
|
if (a == "dangerouslySetInnerHTML") o = d;
|
|
183
183
|
else if (!(a in m)) {
|
|
184
184
|
if (a == "value" && "defaultValue" in m || a == "checked" && "defaultChecked" in m) continue;
|
|
185
|
-
|
|
185
|
+
D(t, a, null, d, s);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
for (a in m) d = m[a], a == "children" ? f = d : a == "dangerouslySetInnerHTML" ? p = d : a == "value" ? b = d : a == "checked" ? x = d : l && typeof d != "function" || k[a] === d ||
|
|
188
|
+
for (a in m) d = m[a], a == "children" ? f = d : a == "dangerouslySetInnerHTML" ? p = d : a == "value" ? b = d : a == "checked" ? x = d : l && typeof d != "function" || k[a] === d || D(t, a, d, k[a], s);
|
|
189
189
|
if (p) l || o && (p.__html == o.__html || p.__html == t.innerHTML) || (t.innerHTML = p.__html), e.__k = [];
|
|
190
190
|
else if (o && (t.innerHTML = ""), $e(e.type == "template" ? t.content : t, q(f) ? f : [f], e, n, r, g == "foreignObject" ? "http://www.w3.org/1999/xhtml" : s, i, _, i ? i[0] : n.__k && A(n, 0), l, u), i != null) for (a = i.length; a--; ) re(i[a]);
|
|
191
|
-
l || (a = "value", g == "progress" && b == null ? t.removeAttribute("value") : b != null && (b !== t[a] || g == "progress" && !b || g == "option" && b != k[a]) &&
|
|
191
|
+
l || (a = "value", g == "progress" && b == null ? t.removeAttribute("value") : b != null && (b !== t[a] || g == "progress" && !b || g == "option" && b != k[a]) && D(t, a, b, k[a], s), a = "checked", x != null && x != t[a] && D(t, a, x, k[a], s));
|
|
192
192
|
}
|
|
193
193
|
return t;
|
|
194
194
|
}
|
|
@@ -220,21 +220,21 @@ function qe(t, e, n) {
|
|
|
220
220
|
}
|
|
221
221
|
function Ve(t, e, n) {
|
|
222
222
|
var r, s, i, _;
|
|
223
|
-
e == document && (e = document.documentElement), h.__ && h.__(t, e), s = (r = !1) ? null : e.__k, i = [], _ = [], oe(e, t = e.__k =
|
|
223
|
+
e == document && (e = document.documentElement), h.__ && h.__(t, e), s = (r = !1) ? null : e.__k, i = [], _ = [], oe(e, t = e.__k = Fe(L, null, [t]), s || M, M, e.namespaceURI, s ? null : e.firstChild ? O.call(e.childNodes) : null, i, s ? s.__e : e.firstChild, r, _), We(i, t, _);
|
|
224
224
|
}
|
|
225
|
-
|
|
225
|
+
O = Re.slice, h = { __e: function(t, e, n, r) {
|
|
226
226
|
for (var s, i, _; e = e.__; ) if ((s = e.__c) && !s.__) try {
|
|
227
227
|
if ((i = s.constructor) && i.getDerivedStateFromError != null && (s.setState(i.getDerivedStateFromError(t)), _ = s.__d), s.componentDidCatch != null && (s.componentDidCatch(t, r || {}), _ = s.__d), _) return s.__E = s;
|
|
228
228
|
} catch (l) {
|
|
229
229
|
t = l;
|
|
230
230
|
}
|
|
231
231
|
throw t;
|
|
232
|
-
} }, xe = 0,
|
|
232
|
+
} }, xe = 0, U.prototype.setState = function(t, e) {
|
|
233
233
|
var n;
|
|
234
234
|
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = T({}, this.state), typeof t == "function" && (t = t(T({}, n), this.props)), t && T(n, t), t != null && this.__v && (e && this._sb.push(e), ae(this));
|
|
235
|
-
},
|
|
235
|
+
}, U.prototype.forceUpdate = function(t) {
|
|
236
236
|
this.__v && (this.__e = !0, t && this.__h.push(t), ae(this));
|
|
237
|
-
},
|
|
237
|
+
}, U.prototype.render = L, C = [], Se = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Te = function(t, e) {
|
|
238
238
|
return t.__v.__b - e.__v.__b;
|
|
239
239
|
}, z.__r = 0, Ee = /(PointerCapture)$|Capture$/i, ne = 0, G = ue(!1), X = ue(!0);
|
|
240
240
|
var Ke = 0;
|
|
@@ -253,7 +253,7 @@ const Ye = (t) => {
|
|
|
253
253
|
for (const r in t) await t[r]();
|
|
254
254
|
Ye({ Component: e, createRoot: n });
|
|
255
255
|
};
|
|
256
|
-
var
|
|
256
|
+
var j, y, Y, de, Q = 0, Le = [], v = h, fe = v.__b, pe = v.__r, he = v.diffed, ge = v.__c, me = v.unmount, ye = v.__;
|
|
257
257
|
function Ne(t, e) {
|
|
258
258
|
v.__h && v.__h(y, t, Q || e), Q = 0;
|
|
259
259
|
var n = y.__H || (y.__H = { __: [], __h: [] });
|
|
@@ -263,7 +263,7 @@ function Z(t) {
|
|
|
263
263
|
return Q = 1, Xe(Ie, t);
|
|
264
264
|
}
|
|
265
265
|
function Xe(t, e, n) {
|
|
266
|
-
var r = Ne(
|
|
266
|
+
var r = Ne(j++, 2);
|
|
267
267
|
if (r.t = t, !r.__c && (r.__ = [Ie(void 0, e), function(l) {
|
|
268
268
|
var u = r.__N ? r.__N[0] : r.__[0], a = r.t(u, l);
|
|
269
269
|
u !== a && (r.__N = [a, r.__[1]], r.__c.setState({}));
|
|
@@ -297,12 +297,12 @@ function Xe(t, e, n) {
|
|
|
297
297
|
return r.__N || r.__;
|
|
298
298
|
}
|
|
299
299
|
function Je(t, e) {
|
|
300
|
-
var n = Ne(
|
|
300
|
+
var n = Ne(j++, 3);
|
|
301
301
|
!v.__s && et(n.__H, e) && (n.__ = t, n.u = e, y.__H.__h.push(n));
|
|
302
302
|
}
|
|
303
303
|
function Qe() {
|
|
304
304
|
for (var t; t = Le.shift(); ) if (t.__P && t.__H) try {
|
|
305
|
-
t.__H.__h.forEach(
|
|
305
|
+
t.__H.__h.forEach(F), t.__H.__h.forEach(ee), t.__H.__h = [];
|
|
306
306
|
} catch (e) {
|
|
307
307
|
t.__H.__h = [], v.__e(e, t.__v);
|
|
308
308
|
}
|
|
@@ -312,11 +312,11 @@ v.__b = function(t) {
|
|
|
312
312
|
}, v.__ = function(t, e) {
|
|
313
313
|
t && e.__k && e.__k.__m && (t.__m = e.__k.__m), ye && ye(t, e);
|
|
314
314
|
}, v.__r = function(t) {
|
|
315
|
-
pe && pe(t),
|
|
315
|
+
pe && pe(t), j = 0;
|
|
316
316
|
var e = (y = t.__c).__H;
|
|
317
317
|
e && (Y === y ? (e.__h = [], y.__h = [], e.__.forEach(function(n) {
|
|
318
318
|
n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
|
|
319
|
-
})) : (e.__h.forEach(
|
|
319
|
+
})) : (e.__h.forEach(F), e.__h.forEach(ee), e.__h = [], j = 0)), Y = y;
|
|
320
320
|
}, v.diffed = function(t) {
|
|
321
321
|
he && he(t);
|
|
322
322
|
var e = t.__c;
|
|
@@ -326,7 +326,7 @@ v.__b = function(t) {
|
|
|
326
326
|
}, v.__c = function(t, e) {
|
|
327
327
|
e.some(function(n) {
|
|
328
328
|
try {
|
|
329
|
-
n.__h.forEach(
|
|
329
|
+
n.__h.forEach(F), n.__h = n.__h.filter(function(r) {
|
|
330
330
|
return !r.__ || ee(r);
|
|
331
331
|
});
|
|
332
332
|
} catch (r) {
|
|
@@ -340,7 +340,7 @@ v.__b = function(t) {
|
|
|
340
340
|
var e, n = t.__c;
|
|
341
341
|
n && n.__H && (n.__H.__.forEach(function(r) {
|
|
342
342
|
try {
|
|
343
|
-
|
|
343
|
+
F(r);
|
|
344
344
|
} catch (s) {
|
|
345
345
|
e = s;
|
|
346
346
|
}
|
|
@@ -353,7 +353,7 @@ function Ze(t) {
|
|
|
353
353
|
}, r = setTimeout(n, 35);
|
|
354
354
|
ve && (e = requestAnimationFrame(n));
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function F(t) {
|
|
357
357
|
var e = y, n = t.__c;
|
|
358
358
|
typeof n == "function" && (t.__c = void 0, n()), y = e;
|
|
359
359
|
}
|
|
@@ -394,13 +394,13 @@ const tt = (t) => {
|
|
|
394
394
|
"data-testid": "loader-icon",
|
|
395
395
|
children: /* @__PURE__ */ c("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
396
396
|
}
|
|
397
|
-
),
|
|
398
|
-
|
|
397
|
+
), P = document.createElement("style");
|
|
398
|
+
P && !document.getElementById("loader-spin-keyframes") && (P.id = "loader-spin-keyframes", P.innerHTML = `
|
|
399
399
|
@keyframes spin {
|
|
400
400
|
0% { transform: rotate(0deg); }
|
|
401
401
|
100% { transform: rotate(360deg); }
|
|
402
402
|
}
|
|
403
|
-
`, document.head.appendChild(
|
|
403
|
+
`, document.head.appendChild(P));
|
|
404
404
|
const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
|
|
405
405
|
"svg",
|
|
406
406
|
{
|
|
@@ -417,7 +417,7 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
|
|
|
417
417
|
"data-testid": n,
|
|
418
418
|
children: e
|
|
419
419
|
}
|
|
420
|
-
), ot = () => /* @__PURE__ */ c(V, { className: "lucide-play-icon lucide-play", dataTestId: "play-icon", children: /* @__PURE__ */ c("path", { d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" }) }),
|
|
420
|
+
), ot = () => /* @__PURE__ */ c(V, { className: "lucide-play-icon lucide-play", dataTestId: "play-icon", children: /* @__PURE__ */ c("path", { d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" }) }), De = ({ id: t, name: e, skip: n, only: r }) => /* @__PURE__ */ c(L, { children: [
|
|
421
421
|
e,
|
|
422
422
|
" ",
|
|
423
423
|
r && /* @__PURE__ */ c(
|
|
@@ -515,7 +515,7 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
|
|
|
515
515
|
{
|
|
516
516
|
style: { fontWeight: "500", color: "#374151", maxWidth: "220px" },
|
|
517
517
|
children: /* @__PURE__ */ c(
|
|
518
|
-
|
|
518
|
+
De,
|
|
519
519
|
{
|
|
520
520
|
id: n,
|
|
521
521
|
name: t.name,
|
|
@@ -619,7 +619,7 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
|
|
|
619
619
|
"aria-expanded": !a,
|
|
620
620
|
onClick: () => s(l.id),
|
|
621
621
|
children: [
|
|
622
|
-
/* @__PURE__ */ c(
|
|
622
|
+
/* @__PURE__ */ c(De, { id: l.id, name: l.name, skip: l.skip, only: l.only }),
|
|
623
623
|
a ? /* @__PURE__ */ c(at, {}) : /* @__PURE__ */ c(lt, {})
|
|
624
624
|
]
|
|
625
625
|
}
|
|
@@ -704,7 +704,7 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
|
|
|
704
704
|
}
|
|
705
705
|
return !1;
|
|
706
706
|
};
|
|
707
|
-
class
|
|
707
|
+
class Pe {
|
|
708
708
|
events;
|
|
709
709
|
constructor(e) {
|
|
710
710
|
this.events = e;
|
|
@@ -756,20 +756,23 @@ class De {
|
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
758
|
}
|
|
759
|
-
window.__testRunner =
|
|
760
|
-
const mt = "1.3.
|
|
759
|
+
window.__testRunner = Pe;
|
|
760
|
+
const mt = "1.3.2", yt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
|
|
761
761
|
rules: []
|
|
762
762
|
}), window.__TWD_MOCK_STATE__) : {
|
|
763
763
|
rules: []
|
|
764
764
|
}, vt = yt(), Be = vt.rules, bt = async (t) => {
|
|
765
|
-
"serviceWorker" in navigator
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
765
|
+
if ("serviceWorker" in navigator) {
|
|
766
|
+
const e = t ?? "/mock-sw.js";
|
|
767
|
+
await navigator.serviceWorker.register(`${e}?v=${mt}`), navigator.serviceWorker.controller || await new Promise((n) => {
|
|
768
|
+
navigator.serviceWorker.addEventListener("controllerchange", n, { once: !0 });
|
|
769
|
+
}), navigator.serviceWorker.addEventListener("message", (n) => {
|
|
770
|
+
if (n.data?.type === "EXECUTED") {
|
|
771
|
+
const { alias: r, request: s } = n.data, i = Be.find((_) => _.alias === r);
|
|
772
|
+
i && (i.executed = !0, i.request = s);
|
|
773
|
+
}
|
|
774
|
+
});
|
|
775
|
+
}
|
|
773
776
|
}, kt = () => Be, wt = () => /* @__PURE__ */ c(V, { className: "lucide-wifi-pen-icon lucide-wifi-pen", dataTestId: "wifi-pen-icon", children: [
|
|
774
777
|
/* @__PURE__ */ c("path", { d: "M2 8.82a15 15 0 0 1 20 0" }),
|
|
775
778
|
/* @__PURE__ */ c("path", { d: "M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z" }),
|
|
@@ -824,7 +827,7 @@ const mt = "1.3.1", yt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__
|
|
|
824
827
|
}, Tt = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Et = ({ open: t, position: e = "left" }) => {
|
|
825
828
|
const [n, r] = Z(0), [s, i] = Z(t);
|
|
826
829
|
ft({ isOpen: s, position: e });
|
|
827
|
-
const _ = new
|
|
830
|
+
const _ = new Pe({
|
|
828
831
|
onStart: (o) => {
|
|
829
832
|
o.status = "running", r((f) => f + 1);
|
|
830
833
|
},
|
|
@@ -942,11 +945,11 @@ const mt = "1.3.1", yt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__
|
|
|
942
945
|
Ve(e, t);
|
|
943
946
|
}
|
|
944
947
|
}), Ct = (t, e) => {
|
|
945
|
-
const { open: n = !0, position: r = "left" } = e || {};
|
|
946
|
-
Ge(t, /* @__PURE__ */ c(Et, { open: n, position: r }), Rt), bt().then(() => {
|
|
948
|
+
const { open: n = !0, position: r = "left", serviceWorker: s = !0, serviceWorkerUrl: i = "/mock-sw.js" } = e || {};
|
|
949
|
+
Ge(t, /* @__PURE__ */ c(Et, { open: n, position: r }), Rt), s && bt(i).then(() => {
|
|
947
950
|
console.log("Request mocking initialized");
|
|
948
|
-
}).catch((
|
|
949
|
-
console.error("Error initializing request mocking:",
|
|
951
|
+
}).catch((_) => {
|
|
952
|
+
console.error("Error initializing request mocking:", _);
|
|
950
953
|
});
|
|
951
954
|
};
|
|
952
955
|
export {
|
package/dist/bundled.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(A,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(A=typeof globalThis<"u"?globalThis:A||self,E(A.TWD={}))})(this,(function(A){"use strict";var E,h,le,C,ae,ce,ue,de,Y,G,X,M={},fe=[],Ue=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,D=Array.isArray;function T(t,e){for(var n in e)t[n]=e[n];return t}function J(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function je(t,e,n){var o,s,i,_={};for(i in e)i=="key"?o=e[i]:i=="ref"?s=e[i]:_[i]=e[i];if(arguments.length>2&&(_.children=arguments.length>3?E.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)_[i]===void 0&&(_[i]=t.defaultProps[i]);return P(t,_,o,s,null)}function P(t,e,n,o,s){var i={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++le,__i:-1,__u:0};return s==null&&h.vnode!=null&&h.vnode(i),i}function L(t){return t.children}function B(t,e){this.props=t,this.context=e}function W(t,e){if(e==null)return t.__?W(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?W(t):null}function pe(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return pe(t)}}function he(t){(!t.__d&&(t.__d=!0)&&C.push(t)&&!F.__r++||ae!=h.debounceRendering)&&((ae=h.debounceRendering)||ce)(F)}function F(){for(var t,e,n,o,s,i,_,l=1;C.length;)C.length>l&&C.sort(ue),t=C.shift(),l=C.length,t.__d&&(n=void 0,o=void 0,s=(o=(e=t).__v).__e,i=[],_=[],e.__P&&((n=T({},o)).__v=o.__v+1,h.vnode&&h.vnode(n),Q(e.__P,n,o,e.__n,e.__P.namespaceURI,32&o.__u?[s]:null,i,s??W(o),!!(32&o.__u),_),n.__v=o.__v,n.__.__k[n.__i]=n,be(i,n,_),o.__e=o.__=null,n.__e!=s&&pe(n)));F.__r=0}function ge(t,e,n,o,s,i,_,l,u,a,p){var r,f,d,b,x,k,m,g=o&&o.__k||fe,R=e.length;for(u=ze(n,e,g,u,R),r=0;r<R;r++)(d=n.__k[r])!=null&&(f=d.__i==-1?M:g[d.__i]||M,d.__i=r,k=Q(t,d,f,s,i,_,l,u,a,p),b=d.__e,d.ref&&f.ref!=d.ref&&(f.ref&&ee(f.ref,null,d),p.push(d.ref,d.__c||b,d)),x==null&&b!=null&&(x=b),(m=!!(4&d.__u))||f.__k===d.__k?u=me(d,u,t,m):typeof d.type=="function"&&k!==void 0?u=k:b&&(u=b.nextSibling),d.__u&=-7);return n.__e=x,u}function ze(t,e,n,o,s){var i,_,l,u,a,p=n.length,r=p,f=0;for(t.__k=new Array(s),i=0;i<s;i++)(_=e[i])!=null&&typeof _!="boolean"&&typeof _!="function"?(typeof _=="string"||typeof _=="number"||typeof _=="bigint"||_.constructor==String?_=t.__k[i]=P(null,_,null,null,null):D(_)?_=t.__k[i]=P(L,{children:_},null,null,null):_.constructor==null&&_.__b>0?_=t.__k[i]=P(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):t.__k[i]=_,u=i+f,_.__=t,_.__b=t.__b+1,(a=_.__i=Oe(_,n,u,r))!=-1&&(r--,(l=n[a])&&(l.__u|=2)),l==null||l.__v==null?(a==-1&&(s>p?f--:s<p&&f++),typeof _.type!="function"&&(_.__u|=4)):a!=u&&(a==u-1?f--:a==u+1?f++:(a>u?f--:f++,_.__u|=4))):t.__k[i]=null;if(r)for(i=0;i<p;i++)(l=n[i])!=null&&(2&l.__u)==0&&(l.__e==o&&(o=W(l)),we(l,l));return o}function me(t,e,n,o){var s,i;if(typeof t.type=="function"){for(s=t.__k,i=0;s&&i<s.length;i++)s[i]&&(s[i].__=t,e=me(s[i],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=W(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Oe(t,e,n,o){var s,i,_,l=t.key,u=t.type,a=e[n],p=a!=null&&(2&a.__u)==0;if(a===null&&l==null||p&&l==a.key&&u==a.type)return n;if(o>(p?1:0)){for(s=n-1,i=n+1;s>=0||i<e.length;)if((a=e[_=s>=0?s--:i++])!=null&&(2&a.__u)==0&&l==a.key&&u==a.type)return _}return-1}function ye(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Ue.test(e)?n:n+"px"}function U(t,e,n,o,s){var i,_;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||ye(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||ye(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(de,"$1")),_=e.toLowerCase(),e=_ in t||e=="onFocusOut"||e=="onFocusIn"?_.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?o?n.u=o.u:(n.u=Y,t.addEventListener(e,i?X:G,i)):t.removeEventListener(e,i?X:G,i);else{if(s=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function ve(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Y++;else if(e.t<n.u)return;return n(h.event?h.event(e):e)}}}function Q(t,e,n,o,s,i,_,l,u,a){var p,r,f,d,b,x,k,m,g,R,$,V,N,Fe,K,I,_e,S=e.type;if(e.constructor!=null)return null;128&n.__u&&(u=!!(32&n.__u),i=[l=e.__e=n.__e]),(p=h.__b)&&p(e);e:if(typeof S=="function")try{if(m=e.props,g="prototype"in S&&S.prototype.render,R=(p=S.contextType)&&o[p.__c],$=p?R?R.props.value:p.__:o,n.__c?k=(r=e.__c=n.__c).__=r.__E:(g?e.__c=r=new S(m,$):(e.__c=r=new B(m,$),r.constructor=S,r.render=Ve),R&&R.sub(r),r.state||(r.state={}),r.__n=o,f=r.__d=!0,r.__h=[],r._sb=[]),g&&r.__s==null&&(r.__s=r.state),g&&S.getDerivedStateFromProps!=null&&(r.__s==r.state&&(r.__s=T({},r.__s)),T(r.__s,S.getDerivedStateFromProps(m,r.__s))),d=r.props,b=r.state,r.__v=e,f)g&&S.getDerivedStateFromProps==null&&r.componentWillMount!=null&&r.componentWillMount(),g&&r.componentDidMount!=null&&r.__h.push(r.componentDidMount);else{if(g&&S.getDerivedStateFromProps==null&&m!==d&&r.componentWillReceiveProps!=null&&r.componentWillReceiveProps(m,$),e.__v==n.__v||!r.__e&&r.shouldComponentUpdate!=null&&r.shouldComponentUpdate(m,r.__s,$)===!1){for(e.__v!=n.__v&&(r.props=m,r.state=r.__s,r.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(H){H&&(H.__=e)}),V=0;V<r._sb.length;V++)r.__h.push(r._sb[V]);r._sb=[],r.__h.length&&_.push(r);break e}r.componentWillUpdate!=null&&r.componentWillUpdate(m,r.__s,$),g&&r.componentDidUpdate!=null&&r.__h.push(function(){r.componentDidUpdate(d,b,x)})}if(r.context=$,r.props=m,r.__P=t,r.__e=!1,N=h.__r,Fe=0,g){for(r.state=r.__s,r.__d=!1,N&&N(e),p=r.render(r.props,r.state,r.context),K=0;K<r._sb.length;K++)r.__h.push(r._sb[K]);r._sb=[]}else do r.__d=!1,N&&N(e),p=r.render(r.props,r.state,r.context),r.state=r.__s;while(r.__d&&++Fe<25);r.state=r.__s,r.getChildContext!=null&&(o=T(T({},o),r.getChildContext())),g&&!f&&r.getSnapshotBeforeUpdate!=null&&(x=r.getSnapshotBeforeUpdate(d,b)),I=p,p!=null&&p.type===L&&p.key==null&&(I=ke(p.props.children)),l=ge(t,D(I)?I:[I],e,n,o,s,i,_,l,u,a),r.base=e.__e,e.__u&=-161,r.__h.length&&_.push(r),k&&(r.__E=r.__=null)}catch(H){if(e.__v=null,u||i!=null)if(H.then){for(e.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;i[i.indexOf(l)]=null,e.__e=l}else{for(_e=i.length;_e--;)J(i[_e]);Z(e)}else e.__e=n.__e,e.__k=n.__k,H.then||Z(e);h.__e(H,e,n)}else i==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=qe(n.__e,e,n,o,s,i,_,u,a);return(p=h.diffed)&&p(e),128&e.__u?void 0:l}function Z(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Z)}function be(t,e,n){for(var o=0;o<n.length;o++)ee(n[o],n[++o],n[++o]);h.__c&&h.__c(e,t),t.some(function(s){try{t=s.__h,s.__h=[],t.some(function(i){i.call(s)})}catch(i){h.__e(i,s.__v)}})}function ke(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:D(t)?t.map(ke):T({},t)}function qe(t,e,n,o,s,i,_,l,u){var a,p,r,f,d,b,x,k=n.props||M,m=e.props,g=e.type;if(g=="svg"?s="http://www.w3.org/2000/svg":g=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),i!=null){for(a=0;a<i.length;a++)if((d=i[a])&&"setAttribute"in d==!!g&&(g?d.localName==g:d.nodeType==3)){t=d,i[a]=null;break}}if(t==null){if(g==null)return document.createTextNode(m);t=document.createElementNS(s,g,m.is&&m),l&&(h.__m&&h.__m(e,i),l=!1),i=null}if(g==null)k===m||l&&t.data==m||(t.data=m);else{if(i=i&&E.call(t.childNodes),!l&&i!=null)for(k={},a=0;a<t.attributes.length;a++)k[(d=t.attributes[a]).name]=d.value;for(a in k)if(d=k[a],a!="children"){if(a=="dangerouslySetInnerHTML")r=d;else if(!(a in m)){if(a=="value"&&"defaultValue"in m||a=="checked"&&"defaultChecked"in m)continue;U(t,a,null,d,s)}}for(a in m)d=m[a],a=="children"?f=d:a=="dangerouslySetInnerHTML"?p=d:a=="value"?b=d:a=="checked"?x=d:l&&typeof d!="function"||k[a]===d||U(t,a,d,k[a],s);if(p)l||r&&(p.__html==r.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(r&&(t.innerHTML=""),ge(e.type=="template"?t.content:t,D(f)?f:[f],e,n,o,g=="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,_,i?i[0]:n.__k&&W(n,0),l,u),i!=null)for(a=i.length;a--;)J(i[a]);l||(a="value",g=="progress"&&b==null?t.removeAttribute("value"):b!=null&&(b!==t[a]||g=="progress"&&!b||g=="option"&&b!=k[a])&&U(t,a,b,k[a],s),a="checked",x!=null&&x!=t[a]&&U(t,a,x,k[a],s))}return t}function ee(t,e,n){try{if(typeof t=="function"){var o=typeof t.__u=="function";o&&t.__u(),o&&e==null||(t.__u=t(e))}else t.current=e}catch(s){h.__e(s,n)}}function we(t,e,n){var o,s;if(h.unmount&&h.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||ee(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){h.__e(i,e)}o.base=o.__P=null}if(o=t.__k)for(s=0;s<o.length;s++)o[s]&&we(o[s],e,n||typeof t.type!="function");n||J(t.__e),t.__c=t.__=t.__e=void 0}function Ve(t,e,n){return this.constructor(t,n)}function Ke(t,e,n){var o,s,i,_;e==document&&(e=document.documentElement),h.__&&h.__(t,e),s=(o=!1)?null:e.__k,i=[],_=[],Q(e,t=e.__k=je(L,null,[t]),s||M,M,e.namespaceURI,s?null:e.firstChild?E.call(e.childNodes):null,i,s?s.__e:e.firstChild,o,_),be(i,t,_)}E=fe.slice,h={__e:function(t,e,n,o){for(var s,i,_;e=e.__;)if((s=e.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(t)),_=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(t,o||{}),_=s.__d),_)return s.__E=s}catch(l){t=l}throw t}},le=0,B.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=T({},this.state),typeof t=="function"&&(t=t(T({},n),this.props)),t&&T(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),he(this))},B.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),he(this))},B.prototype.render=L,C=[],ce=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ue=function(t,e){return t.__v.__b-e.__v.__b},F.__r=0,de=/(PointerCapture)$|Capture$/i,Y=0,G=ve(!1),X=ve(!0);var Ye=0;function c(t,e,n,o,s,i){e||(e={});var _,l,u=e;if("ref"in u)for(l in u={},e)l=="ref"?_=e[l]:u[l]=e[l];var a={type:t,props:u,key:n,ref:_,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ye,__i:-1,__u:0,__source:s,__self:i};if(typeof t=="function"&&(_=t.defaultProps))for(l in _)u[l]===void 0&&(u[l]=_[l]);return h.vnode&&h.vnode(a),a}const Ge=t=>{const{Component:e,createRoot:n}=t,o=document.createElement("div");o.setAttribute("id","twd-sidebar-root"),document.body.appendChild(o),n(o).render(e)},Xe=async(t,e,n)=>{for(const o in t)await t[o]();Ge({Component:e,createRoot:n})};var j,y,te,xe,ne=0,Se=[],v=h,Te=v.__b,Ee=v.__r,Re=v.diffed,Ce=v.__c,$e=v.unmount,Ae=v.__;function We(t,e){v.__h&&v.__h(y,t,ne||e),ne=0;var n=y.__H||(y.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function oe(t){return ne=1,Je(Me,t)}function Je(t,e,n){var o=We(j++,2);if(o.t=t,!o.__c&&(o.__=[Me(void 0,e),function(l){var u=o.__N?o.__N[0]:o.__[0],a=o.t(u,l);u!==a&&(o.__N=[a,o.__[1]],o.__c.setState({}))}],o.__c=y,!y.__f)){var s=function(l,u,a){if(!o.__c.__H)return!0;var p=o.__c.__H.__.filter(function(f){return!!f.__c});if(p.every(function(f){return!f.__N}))return!i||i.call(this,l,u,a);var r=o.__c.props!==l;return p.forEach(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(r=!0)}}),i&&i.call(this,l,u,a)||r};y.__f=!0;var i=y.shouldComponentUpdate,_=y.componentWillUpdate;y.componentWillUpdate=function(l,u,a){if(this.__e){var p=i;i=void 0,s(l,u,a),i=p}_&&_.call(this,l,u,a)},y.shouldComponentUpdate=s}return o.__N||o.__}function Qe(t,e){var n=We(j++,3);!v.__s&&tt(n.__H,e)&&(n.__=t,n.u=e,y.__H.__h.push(n))}function Ze(){for(var t;t=Se.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(z),t.__H.__h.forEach(re),t.__H.__h=[]}catch(e){t.__H.__h=[],v.__e(e,t.__v)}}v.__b=function(t){y=null,Te&&Te(t)},v.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Ae&&Ae(t,e)},v.__r=function(t){Ee&&Ee(t),j=0;var e=(y=t.__c).__H;e&&(te===y?(e.__h=[],y.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(z),e.__h.forEach(re),e.__h=[],j=0)),te=y},v.diffed=function(t){Re&&Re(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Se.push(e)!==1&&xe===v.requestAnimationFrame||((xe=v.requestAnimationFrame)||et)(Ze)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),te=y=null},v.__c=function(t,e){e.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(o){return!o.__||re(o)})}catch(o){e.some(function(s){s.__h&&(s.__h=[])}),e=[],v.__e(o,n.__v)}}),Ce&&Ce(t,e)},v.unmount=function(t){$e&&$e(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{z(o)}catch(s){e=s}}),n.__H=void 0,e&&v.__e(e,n.__v))};var He=typeof requestAnimationFrame=="function";function et(t){var e,n=function(){clearTimeout(o),He&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);He&&(e=requestAnimationFrame(n))}function z(t){var e=y,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),y=e}function re(t){var e=y;t.__c=t.__(),y=e}function tt(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function Me(t,e){return typeof e=="function"?e(t):e}const nt=t=>{const e=new Map,n=[];for(const o of t)e.set(o.id,{...o,childrenNodes:[]});for(const o of e.values())o.parent?e.get(o.parent)?.childrenNodes?.push(o):n.push(o);return n},ot={animation:"spin 1s linear infinite"},rt=()=>c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#364153",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle-icon lucide-loader-circle",style:ot,"data-testid":"loader-icon",children:c("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),O=document.createElement("style");O&&!document.getElementById("loader-spin-keyframes")&&(O.id="loader-spin-keyframes",O.innerHTML=`
|
|
1
|
+
(function(W,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(W=typeof globalThis<"u"?globalThis:W||self,E(W.TWD={}))})(this,(function(W){"use strict";var E,h,le,C,ae,ce,ue,de,Y,G,X,M={},fe=[],Fe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,D=Array.isArray;function T(t,e){for(var n in e)t[n]=e[n];return t}function J(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function je(t,e,n){var r,s,i,_={};for(i in e)i=="key"?r=e[i]:i=="ref"?s=e[i]:_[i]=e[i];if(arguments.length>2&&(_.children=arguments.length>3?E.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)_[i]===void 0&&(_[i]=t.defaultProps[i]);return P(t,_,r,s,null)}function P(t,e,n,r,s){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++le,__i:-1,__u:0};return s==null&&h.vnode!=null&&h.vnode(i),i}function L(t){return t.children}function B(t,e){this.props=t,this.context=e}function A(t,e){if(e==null)return t.__?A(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?A(t):null}function pe(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return pe(t)}}function he(t){(!t.__d&&(t.__d=!0)&&C.push(t)&&!U.__r++||ae!=h.debounceRendering)&&((ae=h.debounceRendering)||ce)(U)}function U(){for(var t,e,n,r,s,i,_,l=1;C.length;)C.length>l&&C.sort(ue),t=C.shift(),l=C.length,t.__d&&(n=void 0,r=void 0,s=(r=(e=t).__v).__e,i=[],_=[],e.__P&&((n=T({},r)).__v=r.__v+1,h.vnode&&h.vnode(n),Q(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[s]:null,i,s??A(r),!!(32&r.__u),_),n.__v=r.__v,n.__.__k[n.__i]=n,be(i,n,_),r.__e=r.__=null,n.__e!=s&&pe(n)));U.__r=0}function ge(t,e,n,r,s,i,_,l,u,a,p){var o,f,d,b,x,k,m,g=r&&r.__k||fe,R=e.length;for(u=ze(n,e,g,u,R),o=0;o<R;o++)(d=n.__k[o])!=null&&(f=d.__i==-1?M:g[d.__i]||M,d.__i=o,k=Q(t,d,f,s,i,_,l,u,a,p),b=d.__e,d.ref&&f.ref!=d.ref&&(f.ref&&ee(f.ref,null,d),p.push(d.ref,d.__c||b,d)),x==null&&b!=null&&(x=b),(m=!!(4&d.__u))||f.__k===d.__k?u=me(d,u,t,m):typeof d.type=="function"&&k!==void 0?u=k:b&&(u=b.nextSibling),d.__u&=-7);return n.__e=x,u}function ze(t,e,n,r,s){var i,_,l,u,a,p=n.length,o=p,f=0;for(t.__k=new Array(s),i=0;i<s;i++)(_=e[i])!=null&&typeof _!="boolean"&&typeof _!="function"?(typeof _=="string"||typeof _=="number"||typeof _=="bigint"||_.constructor==String?_=t.__k[i]=P(null,_,null,null,null):D(_)?_=t.__k[i]=P(L,{children:_},null,null,null):_.constructor==null&&_.__b>0?_=t.__k[i]=P(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):t.__k[i]=_,u=i+f,_.__=t,_.__b=t.__b+1,(a=_.__i=Oe(_,n,u,o))!=-1&&(o--,(l=n[a])&&(l.__u|=2)),l==null||l.__v==null?(a==-1&&(s>p?f--:s<p&&f++),typeof _.type!="function"&&(_.__u|=4)):a!=u&&(a==u-1?f--:a==u+1?f++:(a>u?f--:f++,_.__u|=4))):t.__k[i]=null;if(o)for(i=0;i<p;i++)(l=n[i])!=null&&(2&l.__u)==0&&(l.__e==r&&(r=A(l)),we(l,l));return r}function me(t,e,n,r){var s,i;if(typeof t.type=="function"){for(s=t.__k,i=0;s&&i<s.length;i++)s[i]&&(s[i].__=t,e=me(s[i],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=A(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Oe(t,e,n,r){var s,i,_,l=t.key,u=t.type,a=e[n],p=a!=null&&(2&a.__u)==0;if(a===null&&l==null||p&&l==a.key&&u==a.type)return n;if(r>(p?1:0)){for(s=n-1,i=n+1;s>=0||i<e.length;)if((a=e[_=s>=0?s--:i++])!=null&&(2&a.__u)==0&&l==a.key&&u==a.type)return _}return-1}function ye(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Fe.test(e)?n:n+"px"}function F(t,e,n,r,s){var i,_;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||ye(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||ye(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(de,"$1")),_=e.toLowerCase(),e=_ in t||e=="onFocusOut"||e=="onFocusIn"?_.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.u=r.u:(n.u=Y,t.addEventListener(e,i?X:G,i)):t.removeEventListener(e,i?X:G,i);else{if(s=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function ve(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Y++;else if(e.t<n.u)return;return n(h.event?h.event(e):e)}}}function Q(t,e,n,r,s,i,_,l,u,a){var p,o,f,d,b,x,k,m,g,R,$,V,N,Ue,K,I,_e,S=e.type;if(e.constructor!=null)return null;128&n.__u&&(u=!!(32&n.__u),i=[l=e.__e=n.__e]),(p=h.__b)&&p(e);e:if(typeof S=="function")try{if(m=e.props,g="prototype"in S&&S.prototype.render,R=(p=S.contextType)&&r[p.__c],$=p?R?R.props.value:p.__:r,n.__c?k=(o=e.__c=n.__c).__=o.__E:(g?e.__c=o=new S(m,$):(e.__c=o=new B(m,$),o.constructor=S,o.render=Ve),R&&R.sub(o),o.state||(o.state={}),o.__n=r,f=o.__d=!0,o.__h=[],o._sb=[]),g&&o.__s==null&&(o.__s=o.state),g&&S.getDerivedStateFromProps!=null&&(o.__s==o.state&&(o.__s=T({},o.__s)),T(o.__s,S.getDerivedStateFromProps(m,o.__s))),d=o.props,b=o.state,o.__v=e,f)g&&S.getDerivedStateFromProps==null&&o.componentWillMount!=null&&o.componentWillMount(),g&&o.componentDidMount!=null&&o.__h.push(o.componentDidMount);else{if(g&&S.getDerivedStateFromProps==null&&m!==d&&o.componentWillReceiveProps!=null&&o.componentWillReceiveProps(m,$),e.__v==n.__v||!o.__e&&o.shouldComponentUpdate!=null&&o.shouldComponentUpdate(m,o.__s,$)===!1){for(e.__v!=n.__v&&(o.props=m,o.state=o.__s,o.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(H){H&&(H.__=e)}),V=0;V<o._sb.length;V++)o.__h.push(o._sb[V]);o._sb=[],o.__h.length&&_.push(o);break e}o.componentWillUpdate!=null&&o.componentWillUpdate(m,o.__s,$),g&&o.componentDidUpdate!=null&&o.__h.push(function(){o.componentDidUpdate(d,b,x)})}if(o.context=$,o.props=m,o.__P=t,o.__e=!1,N=h.__r,Ue=0,g){for(o.state=o.__s,o.__d=!1,N&&N(e),p=o.render(o.props,o.state,o.context),K=0;K<o._sb.length;K++)o.__h.push(o._sb[K]);o._sb=[]}else do o.__d=!1,N&&N(e),p=o.render(o.props,o.state,o.context),o.state=o.__s;while(o.__d&&++Ue<25);o.state=o.__s,o.getChildContext!=null&&(r=T(T({},r),o.getChildContext())),g&&!f&&o.getSnapshotBeforeUpdate!=null&&(x=o.getSnapshotBeforeUpdate(d,b)),I=p,p!=null&&p.type===L&&p.key==null&&(I=ke(p.props.children)),l=ge(t,D(I)?I:[I],e,n,r,s,i,_,l,u,a),o.base=e.__e,e.__u&=-161,o.__h.length&&_.push(o),k&&(o.__E=o.__=null)}catch(H){if(e.__v=null,u||i!=null)if(H.then){for(e.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;i[i.indexOf(l)]=null,e.__e=l}else{for(_e=i.length;_e--;)J(i[_e]);Z(e)}else e.__e=n.__e,e.__k=n.__k,H.then||Z(e);h.__e(H,e,n)}else i==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=qe(n.__e,e,n,r,s,i,_,u,a);return(p=h.diffed)&&p(e),128&e.__u?void 0:l}function Z(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Z)}function be(t,e,n){for(var r=0;r<n.length;r++)ee(n[r],n[++r],n[++r]);h.__c&&h.__c(e,t),t.some(function(s){try{t=s.__h,s.__h=[],t.some(function(i){i.call(s)})}catch(i){h.__e(i,s.__v)}})}function ke(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:D(t)?t.map(ke):T({},t)}function qe(t,e,n,r,s,i,_,l,u){var a,p,o,f,d,b,x,k=n.props||M,m=e.props,g=e.type;if(g=="svg"?s="http://www.w3.org/2000/svg":g=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),i!=null){for(a=0;a<i.length;a++)if((d=i[a])&&"setAttribute"in d==!!g&&(g?d.localName==g:d.nodeType==3)){t=d,i[a]=null;break}}if(t==null){if(g==null)return document.createTextNode(m);t=document.createElementNS(s,g,m.is&&m),l&&(h.__m&&h.__m(e,i),l=!1),i=null}if(g==null)k===m||l&&t.data==m||(t.data=m);else{if(i=i&&E.call(t.childNodes),!l&&i!=null)for(k={},a=0;a<t.attributes.length;a++)k[(d=t.attributes[a]).name]=d.value;for(a in k)if(d=k[a],a!="children"){if(a=="dangerouslySetInnerHTML")o=d;else if(!(a in m)){if(a=="value"&&"defaultValue"in m||a=="checked"&&"defaultChecked"in m)continue;F(t,a,null,d,s)}}for(a in m)d=m[a],a=="children"?f=d:a=="dangerouslySetInnerHTML"?p=d:a=="value"?b=d:a=="checked"?x=d:l&&typeof d!="function"||k[a]===d||F(t,a,d,k[a],s);if(p)l||o&&(p.__html==o.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(o&&(t.innerHTML=""),ge(e.type=="template"?t.content:t,D(f)?f:[f],e,n,r,g=="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,_,i?i[0]:n.__k&&A(n,0),l,u),i!=null)for(a=i.length;a--;)J(i[a]);l||(a="value",g=="progress"&&b==null?t.removeAttribute("value"):b!=null&&(b!==t[a]||g=="progress"&&!b||g=="option"&&b!=k[a])&&F(t,a,b,k[a],s),a="checked",x!=null&&x!=t[a]&&F(t,a,x,k[a],s))}return t}function ee(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(s){h.__e(s,n)}}function we(t,e,n){var r,s;if(h.unmount&&h.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||ee(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){h.__e(i,e)}r.base=r.__P=null}if(r=t.__k)for(s=0;s<r.length;s++)r[s]&&we(r[s],e,n||typeof t.type!="function");n||J(t.__e),t.__c=t.__=t.__e=void 0}function Ve(t,e,n){return this.constructor(t,n)}function Ke(t,e,n){var r,s,i,_;e==document&&(e=document.documentElement),h.__&&h.__(t,e),s=(r=!1)?null:e.__k,i=[],_=[],Q(e,t=e.__k=je(L,null,[t]),s||M,M,e.namespaceURI,s?null:e.firstChild?E.call(e.childNodes):null,i,s?s.__e:e.firstChild,r,_),be(i,t,_)}E=fe.slice,h={__e:function(t,e,n,r){for(var s,i,_;e=e.__;)if((s=e.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(t)),_=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(t,r||{}),_=s.__d),_)return s.__E=s}catch(l){t=l}throw t}},le=0,B.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=T({},this.state),typeof t=="function"&&(t=t(T({},n),this.props)),t&&T(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),he(this))},B.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),he(this))},B.prototype.render=L,C=[],ce=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ue=function(t,e){return t.__v.__b-e.__v.__b},U.__r=0,de=/(PointerCapture)$|Capture$/i,Y=0,G=ve(!1),X=ve(!0);var Ye=0;function c(t,e,n,r,s,i){e||(e={});var _,l,u=e;if("ref"in u)for(l in u={},e)l=="ref"?_=e[l]:u[l]=e[l];var a={type:t,props:u,key:n,ref:_,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ye,__i:-1,__u:0,__source:s,__self:i};if(typeof t=="function"&&(_=t.defaultProps))for(l in _)u[l]===void 0&&(u[l]=_[l]);return h.vnode&&h.vnode(a),a}const Ge=t=>{const{Component:e,createRoot:n}=t,r=document.createElement("div");r.setAttribute("id","twd-sidebar-root"),document.body.appendChild(r),n(r).render(e)},Xe=async(t,e,n)=>{for(const r in t)await t[r]();Ge({Component:e,createRoot:n})};var j,y,te,xe,ne=0,Se=[],v=h,Te=v.__b,Ee=v.__r,Re=v.diffed,Ce=v.__c,$e=v.unmount,We=v.__;function Ae(t,e){v.__h&&v.__h(y,t,ne||e),ne=0;var n=y.__H||(y.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function re(t){return ne=1,Je(Me,t)}function Je(t,e,n){var r=Ae(j++,2);if(r.t=t,!r.__c&&(r.__=[Me(void 0,e),function(l){var u=r.__N?r.__N[0]:r.__[0],a=r.t(u,l);u!==a&&(r.__N=[a,r.__[1]],r.__c.setState({}))}],r.__c=y,!y.__f)){var s=function(l,u,a){if(!r.__c.__H)return!0;var p=r.__c.__H.__.filter(function(f){return!!f.__c});if(p.every(function(f){return!f.__N}))return!i||i.call(this,l,u,a);var o=r.__c.props!==l;return p.forEach(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(o=!0)}}),i&&i.call(this,l,u,a)||o};y.__f=!0;var i=y.shouldComponentUpdate,_=y.componentWillUpdate;y.componentWillUpdate=function(l,u,a){if(this.__e){var p=i;i=void 0,s(l,u,a),i=p}_&&_.call(this,l,u,a)},y.shouldComponentUpdate=s}return r.__N||r.__}function Qe(t,e){var n=Ae(j++,3);!v.__s&&tt(n.__H,e)&&(n.__=t,n.u=e,y.__H.__h.push(n))}function Ze(){for(var t;t=Se.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(z),t.__H.__h.forEach(oe),t.__H.__h=[]}catch(e){t.__H.__h=[],v.__e(e,t.__v)}}v.__b=function(t){y=null,Te&&Te(t)},v.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),We&&We(t,e)},v.__r=function(t){Ee&&Ee(t),j=0;var e=(y=t.__c).__H;e&&(te===y?(e.__h=[],y.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(z),e.__h.forEach(oe),e.__h=[],j=0)),te=y},v.diffed=function(t){Re&&Re(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Se.push(e)!==1&&xe===v.requestAnimationFrame||((xe=v.requestAnimationFrame)||et)(Ze)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),te=y=null},v.__c=function(t,e){e.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(r){return!r.__||oe(r)})}catch(r){e.some(function(s){s.__h&&(s.__h=[])}),e=[],v.__e(r,n.__v)}}),Ce&&Ce(t,e)},v.unmount=function(t){$e&&$e(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{z(r)}catch(s){e=s}}),n.__H=void 0,e&&v.__e(e,n.__v))};var He=typeof requestAnimationFrame=="function";function et(t){var e,n=function(){clearTimeout(r),He&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);He&&(e=requestAnimationFrame(n))}function z(t){var e=y,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),y=e}function oe(t){var e=y;t.__c=t.__(),y=e}function tt(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Me(t,e){return typeof e=="function"?e(t):e}const nt=t=>{const e=new Map,n=[];for(const r of t)e.set(r.id,{...r,childrenNodes:[]});for(const r of e.values())r.parent?e.get(r.parent)?.childrenNodes?.push(r):n.push(r);return n},rt={animation:"spin 1s linear infinite"},ot=()=>c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#364153",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle-icon lucide-loader-circle",style:rt,"data-testid":"loader-icon",children:c("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),O=document.createElement("style");O&&!document.getElementById("loader-spin-keyframes")&&(O.id="loader-spin-keyframes",O.innerHTML=`
|
|
2
2
|
@keyframes spin {
|
|
3
3
|
0% { transform: rotate(0deg); }
|
|
4
4
|
100% { transform: rotate(360deg); }
|
|
5
5
|
}
|
|
6
|
-
`,document.head.appendChild(O));const q=({className:t,children:e,dataTestId:n})=>c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`lucide ${t}`,"data-testid":n,children:e}),it=()=>c(q,{className:"lucide-play-icon lucide-play",dataTestId:"play-icon",children:c("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})}),Le=({id:t,name:e,skip:n,only:o})=>c(L,{children:[e," ",o&&c("span",{style:{color:"#2563eb"},"data-testid":`only-indicator-${t}`,children:[" ","(only)"]}),n&&c("span",{style:{color:"#6b7280"},"data-testid":`skip-indicator-${t}`,children:[" ","(skipped)"]})]}),st=t=>{switch(t.status){case"pass":return{item:{background:"#dcfce7"},container:{borderLeft:"3px solid #00c951"}};case"fail":return{item:{background:"#fee2e2"},container:{borderLeft:"3px solid #fb2c36"}};case"skip":return{item:{background:"#f3f4f6"}};case"running":return{item:{background:"#fef9c3"}};default:return{item:{background:"transparent"}}}},_t=t=>t.startsWith("Assertion passed")||t.startsWith("Event fired")?{color:"#0d542b",fontWeight:"700"}:t.startsWith("Test failed")?{color:"#fb2c36",fontWeight:"700"}:{},lt=({node:t,depth:e,id:n,runTest:o})=>{const s=st(t);return c("li",{style:{marginBottom:"4px",marginLeft:e*6,...s.container},"data-testid":`test-list-item-${n}`,children:[c("div",{style:{display:"flex",alignItems:"left",justifyContent:"space-between",padding:"4px 6px",borderRadius:"4px",...s.item},children:[c("span",{style:{fontWeight:"500",color:"#374151",maxWidth:"220px"},children:c(Le,{id:n,name:t.name,skip:t.skip,only:t.only})}),c("button",{onClick:()=>o(n),"aria-label":`Run ${t.name} test`,style:{background:"transparent",border:"1px solid #d1d5db",borderRadius:"4px",padding:"0",cursor:"pointer",verticalAlign:"middle",fontSize:"12px",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"},disabled:t.status==="running","data-testid":`run-test-button-${n}`,children:t.status==="running"?c(rt,{}):c(it,{})})]}),t.logs&&t.logs.length>0&&c("ul",{style:{borderRadius:"4px",maxHeight:"260px",overflowY:"auto",padding:0,background:"#f3f4f6",listStyle:"none",marginTop:"4px",textAlign:"left"},children:t.logs.map((i,_)=>c("li",{style:{fontSize:"12px",padding:"4px 6px",borderBottom:"1px solid #d1d5db",color:"#374151",..._t(i)},children:i},_))})]},t.name)},at=()=>c(q,{className:"lucide-chevron-down-icon lucide-chevron-down",dataTestId:"chevron-down-icon",children:c("path",{d:"m6 9 6 6 6-6"})}),ct=()=>c(q,{className:"lucide-chevron-right-icon lucide-chevron-right",dataTestId:"chevron-right-icon",children:c("path",{d:"m9 18 6-6-6-6"})}),ut=({tests:t,runTest:e})=>{const[n,o]=oe({}),s=l=>o(u=>({...u,[l]:!u[l]})),i=(l,u=0)=>{if(l.type==="test")return c(lt,{node:l,depth:u,id:l.id,runTest:()=>e(l.id)},l.id);const a=n[l.id];return c("li",{style:{marginLeft:u*12},children:[c("span",{style:{fontWeight:"bold",cursor:"pointer",color:"#374151",display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"4px",gap:"6px"},"data-testid":`test-group-${l.name}`,tabIndex:0,role:"button","aria-expanded":!a,onClick:()=>s(l.id),children:[c(Le,{id:l.id,name:l.name,skip:l.skip,only:l.only}),a?c(ct,{}):c(at,{})]}),!a&&l.childrenNodes&&l.childrenNodes.length>0&&c("ul",{style:{listStyle:"none",padding:0,margin:0},children:l.childrenNodes.map(p=>i(p,u+1))})]},l.id)},_=nt(t);return c("ul",{style:{listStyle:"none",padding:0,margin:0},children:_.map(l=>i(l))})},dt={left:{left:0,borderTopRightRadius:"6px",borderBottomRightRadius:"6px",borderTopLeftRadius:"0",borderBottomLeftRadius:"0"},right:{right:0,borderTopLeftRadius:"6px",borderBottomLeftRadius:"6px",borderTopRightRadius:"0",borderBottomRightRadius:"0"}},ft=({setOpen:t,position:e})=>c("button",{"aria-label":"Open TWD sidebar",style:{position:"fixed",top:"50%",transform:"translateY(-50%)",background:"#1A6EF4",color:"white",padding:"6px 10px",cursor:"pointer",fontSize:"12px",...dt[e]},onClick:()=>t(!0),children:"TWD"}),pt=({isOpen:t,position:e})=>{Qe(()=>{const n=document.documentElement;return t?e==="left"?n.style.marginLeft="280px":n.style.marginRight="280px":(n.style.marginRight="0",n.style.marginLeft="0"),()=>{n.style.marginRight="0",n.style.marginLeft="0"}},[t,e])},ie=typeof window<"u"?(window.__TWD_STATE__||(window.__TWD_STATE__={handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]}),window.__TWD_STATE__):{handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]},w=ie.handlers,Ne=ie.beforeEachHooks,Ie=ie.afterEachHooks,ht=t=>{const e=[],n=[];let o=t;for(;o;)Ne.has(o)&&e.unshift(...Ne.get(o)),Ie.has(o)&&n.push(...Ie.get(o)),o=w.get(o)?.parent;return{before:e,after:n}},se=t=>{const e=w.get(t);return e?e.only?!0:e.children?e.children.some(n=>se(n)):!1:!1},gt=t=>{let e=w.get(t);for(;e?.parent;){const n=w.get(e.parent);if(n?.only)return!0;e=n}return!1},De=t=>{let e=w.get(t);for(;e;){if(e.skip)return!0;if(!e.parent)break;e=w.get(e.parent)}return!1};class Pe{events;constructor(e){this.events=e}async runAll(){const e=Array.from(w.values()).filter(o=>!o.parent&&o.type==="suite"),n=Array.from(w.values()).some(o=>o.only);for(const o of e)await this.runSuite(o,n);return w}async runSingle(e){const n=w.get(e);if(!n||n.type!=="test")return;await this.runTest(n,!1)}async runSuite(e,n){if(De(e.id)&&!se(e.id)){this.events.onSkip?.(e);return}if(n&&!se(e.id))return;this.events.onSuiteStart?.(e);const s=(e.children||[]).map(i=>w.get(i));for(const i of s)i.type==="suite"?await this.runSuite(i,n):i.type==="test"&&await this.runTest(i,n);this.events.onSuiteEnd?.(e)}async runTest(e,n){if((De(e.id)||e.skip)&&!e.only){this.events.onSkip(e);return}const s=gt(e.id);if(n&&!e.only&&!s){this.events.onSkip(e);return}this.events.onStart?.(e);const i=ht(e.parent);try{for(const _ of i.before)await _();e.logs=[],await e.handler(),this.events.onPass(e)}catch(_){this.events.onFail(e,_)}finally{for(const _ of i.after)await _()}}}window.__testRunner=Pe;const mt="1.3.1",Be=(typeof window<"u"?(window.__TWD_MOCK_STATE__||(window.__TWD_MOCK_STATE__={rules:[]}),window.__TWD_MOCK_STATE__):{rules:[]}).rules,yt=async t=>{"serviceWorker"in navigator&&(await navigator.serviceWorker.register(`/mock-sw.js?v=${mt}`),navigator.serviceWorker.controller||await new Promise(n=>{navigator.serviceWorker.addEventListener("controllerchange",n,{once:!0})}),navigator.serviceWorker.addEventListener("message",n=>{if(n.data?.type==="EXECUTED"){const{alias:o,request:s}=n.data,i=Be.find(_=>_.alias===o);i&&(i.executed=!0,i.request=s)}}))},vt=()=>Be,bt=()=>c(q,{className:"lucide-wifi-pen-icon lucide-wifi-pen",dataTestId:"wifi-pen-icon",children:[c("path",{d:"M2 8.82a15 15 0 0 1 20 0"}),c("path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"}),c("path",{d:"M5 12.859a10 10 0 0 1 10.5-2.222"}),c("path",{d:"M8.5 16.429a5 5 0 0 1 3-1.406"})]}),kt=()=>{const t=vt(),e=t.filter(o=>o.executed);return c("button",{onClick:()=>{console.group("🌐 TWD Mock Rules"),console.log("Total rules:",t.length),console.log("Triggered rules:",e.length),console.log("Rules details:"),console.log(t),console.groupEnd()},"aria-label":"View mock rules details in console",style:{background:"#f8fafc",border:"1px solid #cbd5e1",borderRadius:"6px",padding:"8px 12px",cursor:"pointer",fontSize:"12px",color:"#475569",display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px",width:"100%",textAlign:"left",transition:"all 0.2s ease",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"},children:[c(bt,{}),c("span",{style:{flex:1},children:["Rules: ",e.length,"/",t.length," triggered"]}),c("span",{style:{fontSize:"10px",color:"#1E293B",fontWeight:"500"},children:"View rules in console"})]})},wt={left:{left:0,borderRight:"1px solid #e5e7eb"},right:{right:0,borderLeft:"1px solid #e5e7eb"}},xt='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',St=({open:t,position:e="left"})=>{const[n,o]=oe(0),[s,i]=oe(t);pt({isOpen:s,position:e});const _=new Pe({onStart:r=>{r.status="running",o(f=>f+1)},onPass:r=>{r.status="pass",o(f=>f+1)},onFail:(r,f)=>{r.status="fail",console.error("Test failed:",r.name,f),r.logs.push(`Test failed: ${f.message}`),o(d=>d+1)},onSkip:r=>{r.status="skip",o(f=>f+1)}}),l=async()=>{await _.runAll()},u=async r=>{const f=Array.from(w.values()).filter(d=>d.type==="test").find(d=>d.id===r);f&&await _.runSingle(f.id)},a=Array.from(w.values());if(!s)return c(ft,{position:e,setOpen:i});const p=a.filter(r=>r.type==="test").length;return c("div",{style:{fontFamily:xt,position:"fixed",top:0,bottom:0,width:"280px",background:"#f9fafb",fontSize:"14px",overflowY:"auto",boxShadow:"2px 0 6px rgba(0,0,0,0.1)",textAlign:"left",zIndex:1e3,...wt[e]},"data-testid":"twd-sidebar",children:[c("div",{style:{padding:"8px",background:"#f9fafb",position:"sticky",top:0,zIndex:1e3,borderBottom:"1px solid #e5e7eb"},children:[c("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"14px"},children:[c("button",{onClick:l,style:{background:"#1A6EF4",color:"white",padding:"4px 8px",borderRadius:"4px",border:"none",cursor:"pointer"},children:"Run All"}),c("button",{"aria-label":"Close sidebar",style:{background:"transparent",border:"none",cursor:"pointer",fontSize:"14px",paddingRight:"0",paddingLeft:"0"},onClick:()=>i(!1),children:"✖"})]}),c("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"14px",color:"#6b7280",marginBottom:"10px"},children:[c("span",{style:{color:"#374151"},children:["Total: ",p]}),c("div",{style:{display:"flex",gap:"4px"},children:[c("span",{style:{color:"#00c951"},children:["✓ ",a.filter(r=>r.status==="pass").length]}),c("span",{style:{color:"#fb2c36"},children:["✗ ",a.filter(r=>r.status==="fail").length]})]})]}),c(kt,{})]}),c("div",{style:{padding:"8px"},children:c(ut,{tests:a.map(r=>({name:r.name,depth:r.depth,status:r.status,logs:r.logs,id:r.id,parent:r.parent,type:r.type,only:r.only,skip:r.skip})),runTest:u})})]})},Tt=t=>({render:e=>{Ke(e,t)}}),Et=(t,e)=>{const{open:n=!0,position:o="left"}=e||{};Xe(t,c(St,{open:n,position:o}),Tt),yt().then(()=>{console.log("Request mocking initialized")}).catch(s=>{console.error("Error initializing request mocking:",s)})};A.initTWD=Et,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}));
|
|
6
|
+
`,document.head.appendChild(O));const q=({className:t,children:e,dataTestId:n})=>c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`lucide ${t}`,"data-testid":n,children:e}),it=()=>c(q,{className:"lucide-play-icon lucide-play",dataTestId:"play-icon",children:c("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})}),Le=({id:t,name:e,skip:n,only:r})=>c(L,{children:[e," ",r&&c("span",{style:{color:"#2563eb"},"data-testid":`only-indicator-${t}`,children:[" ","(only)"]}),n&&c("span",{style:{color:"#6b7280"},"data-testid":`skip-indicator-${t}`,children:[" ","(skipped)"]})]}),st=t=>{switch(t.status){case"pass":return{item:{background:"#dcfce7"},container:{borderLeft:"3px solid #00c951"}};case"fail":return{item:{background:"#fee2e2"},container:{borderLeft:"3px solid #fb2c36"}};case"skip":return{item:{background:"#f3f4f6"}};case"running":return{item:{background:"#fef9c3"}};default:return{item:{background:"transparent"}}}},_t=t=>t.startsWith("Assertion passed")||t.startsWith("Event fired")?{color:"#0d542b",fontWeight:"700"}:t.startsWith("Test failed")?{color:"#fb2c36",fontWeight:"700"}:{},lt=({node:t,depth:e,id:n,runTest:r})=>{const s=st(t);return c("li",{style:{marginBottom:"4px",marginLeft:e*6,...s.container},"data-testid":`test-list-item-${n}`,children:[c("div",{style:{display:"flex",alignItems:"left",justifyContent:"space-between",padding:"4px 6px",borderRadius:"4px",...s.item},children:[c("span",{style:{fontWeight:"500",color:"#374151",maxWidth:"220px"},children:c(Le,{id:n,name:t.name,skip:t.skip,only:t.only})}),c("button",{onClick:()=>r(n),"aria-label":`Run ${t.name} test`,style:{background:"transparent",border:"1px solid #d1d5db",borderRadius:"4px",padding:"0",cursor:"pointer",verticalAlign:"middle",fontSize:"12px",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"},disabled:t.status==="running","data-testid":`run-test-button-${n}`,children:t.status==="running"?c(ot,{}):c(it,{})})]}),t.logs&&t.logs.length>0&&c("ul",{style:{borderRadius:"4px",maxHeight:"260px",overflowY:"auto",padding:0,background:"#f3f4f6",listStyle:"none",marginTop:"4px",textAlign:"left"},children:t.logs.map((i,_)=>c("li",{style:{fontSize:"12px",padding:"4px 6px",borderBottom:"1px solid #d1d5db",color:"#374151",..._t(i)},children:i},_))})]},t.name)},at=()=>c(q,{className:"lucide-chevron-down-icon lucide-chevron-down",dataTestId:"chevron-down-icon",children:c("path",{d:"m6 9 6 6 6-6"})}),ct=()=>c(q,{className:"lucide-chevron-right-icon lucide-chevron-right",dataTestId:"chevron-right-icon",children:c("path",{d:"m9 18 6-6-6-6"})}),ut=({tests:t,runTest:e})=>{const[n,r]=re({}),s=l=>r(u=>({...u,[l]:!u[l]})),i=(l,u=0)=>{if(l.type==="test")return c(lt,{node:l,depth:u,id:l.id,runTest:()=>e(l.id)},l.id);const a=n[l.id];return c("li",{style:{marginLeft:u*12},children:[c("span",{style:{fontWeight:"bold",cursor:"pointer",color:"#374151",display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"4px",gap:"6px"},"data-testid":`test-group-${l.name}`,tabIndex:0,role:"button","aria-expanded":!a,onClick:()=>s(l.id),children:[c(Le,{id:l.id,name:l.name,skip:l.skip,only:l.only}),a?c(ct,{}):c(at,{})]}),!a&&l.childrenNodes&&l.childrenNodes.length>0&&c("ul",{style:{listStyle:"none",padding:0,margin:0},children:l.childrenNodes.map(p=>i(p,u+1))})]},l.id)},_=nt(t);return c("ul",{style:{listStyle:"none",padding:0,margin:0},children:_.map(l=>i(l))})},dt={left:{left:0,borderTopRightRadius:"6px",borderBottomRightRadius:"6px",borderTopLeftRadius:"0",borderBottomLeftRadius:"0"},right:{right:0,borderTopLeftRadius:"6px",borderBottomLeftRadius:"6px",borderTopRightRadius:"0",borderBottomRightRadius:"0"}},ft=({setOpen:t,position:e})=>c("button",{"aria-label":"Open TWD sidebar",style:{position:"fixed",top:"50%",transform:"translateY(-50%)",background:"#1A6EF4",color:"white",padding:"6px 10px",cursor:"pointer",fontSize:"12px",...dt[e]},onClick:()=>t(!0),children:"TWD"}),pt=({isOpen:t,position:e})=>{Qe(()=>{const n=document.documentElement;return t?e==="left"?n.style.marginLeft="280px":n.style.marginRight="280px":(n.style.marginRight="0",n.style.marginLeft="0"),()=>{n.style.marginRight="0",n.style.marginLeft="0"}},[t,e])},ie=typeof window<"u"?(window.__TWD_STATE__||(window.__TWD_STATE__={handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]}),window.__TWD_STATE__):{handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]},w=ie.handlers,Ne=ie.beforeEachHooks,Ie=ie.afterEachHooks,ht=t=>{const e=[],n=[];let r=t;for(;r;)Ne.has(r)&&e.unshift(...Ne.get(r)),Ie.has(r)&&n.push(...Ie.get(r)),r=w.get(r)?.parent;return{before:e,after:n}},se=t=>{const e=w.get(t);return e?e.only?!0:e.children?e.children.some(n=>se(n)):!1:!1},gt=t=>{let e=w.get(t);for(;e?.parent;){const n=w.get(e.parent);if(n?.only)return!0;e=n}return!1},De=t=>{let e=w.get(t);for(;e;){if(e.skip)return!0;if(!e.parent)break;e=w.get(e.parent)}return!1};class Pe{events;constructor(e){this.events=e}async runAll(){const e=Array.from(w.values()).filter(r=>!r.parent&&r.type==="suite"),n=Array.from(w.values()).some(r=>r.only);for(const r of e)await this.runSuite(r,n);return w}async runSingle(e){const n=w.get(e);if(!n||n.type!=="test")return;await this.runTest(n,!1)}async runSuite(e,n){if(De(e.id)&&!se(e.id)){this.events.onSkip?.(e);return}if(n&&!se(e.id))return;this.events.onSuiteStart?.(e);const s=(e.children||[]).map(i=>w.get(i));for(const i of s)i.type==="suite"?await this.runSuite(i,n):i.type==="test"&&await this.runTest(i,n);this.events.onSuiteEnd?.(e)}async runTest(e,n){if((De(e.id)||e.skip)&&!e.only){this.events.onSkip(e);return}const s=gt(e.id);if(n&&!e.only&&!s){this.events.onSkip(e);return}this.events.onStart?.(e);const i=ht(e.parent);try{for(const _ of i.before)await _();e.logs=[],await e.handler(),this.events.onPass(e)}catch(_){this.events.onFail(e,_)}finally{for(const _ of i.after)await _()}}}window.__testRunner=Pe;const mt="1.3.2",Be=(typeof window<"u"?(window.__TWD_MOCK_STATE__||(window.__TWD_MOCK_STATE__={rules:[]}),window.__TWD_MOCK_STATE__):{rules:[]}).rules,yt=async t=>{if("serviceWorker"in navigator){const e=t??"/mock-sw.js";await navigator.serviceWorker.register(`${e}?v=${mt}`),navigator.serviceWorker.controller||await new Promise(n=>{navigator.serviceWorker.addEventListener("controllerchange",n,{once:!0})}),navigator.serviceWorker.addEventListener("message",n=>{if(n.data?.type==="EXECUTED"){const{alias:r,request:s}=n.data,i=Be.find(_=>_.alias===r);i&&(i.executed=!0,i.request=s)}})}},vt=()=>Be,bt=()=>c(q,{className:"lucide-wifi-pen-icon lucide-wifi-pen",dataTestId:"wifi-pen-icon",children:[c("path",{d:"M2 8.82a15 15 0 0 1 20 0"}),c("path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"}),c("path",{d:"M5 12.859a10 10 0 0 1 10.5-2.222"}),c("path",{d:"M8.5 16.429a5 5 0 0 1 3-1.406"})]}),kt=()=>{const t=vt(),e=t.filter(r=>r.executed);return c("button",{onClick:()=>{console.group("🌐 TWD Mock Rules"),console.log("Total rules:",t.length),console.log("Triggered rules:",e.length),console.log("Rules details:"),console.log(t),console.groupEnd()},"aria-label":"View mock rules details in console",style:{background:"#f8fafc",border:"1px solid #cbd5e1",borderRadius:"6px",padding:"8px 12px",cursor:"pointer",fontSize:"12px",color:"#475569",display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px",width:"100%",textAlign:"left",transition:"all 0.2s ease",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"},children:[c(bt,{}),c("span",{style:{flex:1},children:["Rules: ",e.length,"/",t.length," triggered"]}),c("span",{style:{fontSize:"10px",color:"#1E293B",fontWeight:"500"},children:"View rules in console"})]})},wt={left:{left:0,borderRight:"1px solid #e5e7eb"},right:{right:0,borderLeft:"1px solid #e5e7eb"}},xt='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',St=({open:t,position:e="left"})=>{const[n,r]=re(0),[s,i]=re(t);pt({isOpen:s,position:e});const _=new Pe({onStart:o=>{o.status="running",r(f=>f+1)},onPass:o=>{o.status="pass",r(f=>f+1)},onFail:(o,f)=>{o.status="fail",console.error("Test failed:",o.name,f),o.logs.push(`Test failed: ${f.message}`),r(d=>d+1)},onSkip:o=>{o.status="skip",r(f=>f+1)}}),l=async()=>{await _.runAll()},u=async o=>{const f=Array.from(w.values()).filter(d=>d.type==="test").find(d=>d.id===o);f&&await _.runSingle(f.id)},a=Array.from(w.values());if(!s)return c(ft,{position:e,setOpen:i});const p=a.filter(o=>o.type==="test").length;return c("div",{style:{fontFamily:xt,position:"fixed",top:0,bottom:0,width:"280px",background:"#f9fafb",fontSize:"14px",overflowY:"auto",boxShadow:"2px 0 6px rgba(0,0,0,0.1)",textAlign:"left",zIndex:1e3,...wt[e]},"data-testid":"twd-sidebar",children:[c("div",{style:{padding:"8px",background:"#f9fafb",position:"sticky",top:0,zIndex:1e3,borderBottom:"1px solid #e5e7eb"},children:[c("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"14px"},children:[c("button",{onClick:l,style:{background:"#1A6EF4",color:"white",padding:"4px 8px",borderRadius:"4px",border:"none",cursor:"pointer"},children:"Run All"}),c("button",{"aria-label":"Close sidebar",style:{background:"transparent",border:"none",cursor:"pointer",fontSize:"14px",paddingRight:"0",paddingLeft:"0"},onClick:()=>i(!1),children:"✖"})]}),c("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"14px",color:"#6b7280",marginBottom:"10px"},children:[c("span",{style:{color:"#374151"},children:["Total: ",p]}),c("div",{style:{display:"flex",gap:"4px"},children:[c("span",{style:{color:"#00c951"},children:["✓ ",a.filter(o=>o.status==="pass").length]}),c("span",{style:{color:"#fb2c36"},children:["✗ ",a.filter(o=>o.status==="fail").length]})]})]}),c(kt,{})]}),c("div",{style:{padding:"8px"},children:c(ut,{tests:a.map(o=>({name:o.name,depth:o.depth,status:o.status,logs:o.logs,id:o.id,parent:o.parent,type:o.type,only:o.only,skip:o.skip})),runTest:u})})]})},Tt=t=>({render:e=>{Ke(e,t)}}),Et=(t,e)=>{const{open:n=!0,position:r="left",serviceWorker:s=!0,serviceWorkerUrl:i="/mock-sw.js"}=e||{};Xe(t,c(St,{open:n,position:r}),Tt),s&&yt(i).then(()=>{console.log("Request mocking initialized")}).catch(_=>{console.error("Error initializing request mocking:",_)})};W.initTWD=Et,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xo=require("./runner.cjs.js"),B=require("./jsx-runtime-CjngqUuo.js"),oi=require("react"),lm=(e,t,r=2e3,n=50)=>new Promise((o,i)=>{const a=Date.now(),s=()=>{const l=t();if(l)return o(l);if(Date.now()-a>r)return i(new Error(`Timeout waiting for element ${e}`));setTimeout(s,n)};s()}),um=(e,t,r=2e3,n=50)=>new Promise((o,i)=>{const a=Date.now(),s=()=>{const l=t();if(l&&l.length>0)return o(Array.from(l));if(Date.now()-a>r)return i(new Error(`Timeout waiting for elements ${e}`));setTimeout(s,n)};s()}),ii=e=>new Promise(t=>setTimeout(t,e)),Yi=(e,t,r,n)=>{if(!e&&!t)throw new Error(n);if(e&&t)throw new Error(n.replace("to be","to not be").replace("to have","to not have").replace("to contain","to not contain"));return r};function cm(e){if(!e.isConnected)return!1;let t=e;for(;t;){const r=getComputedStyle(t);if(r.display==="none"||r.visibility==="hidden"||r.visibility==="collapse")return!1;t=t.parentElement}return!0}const dm={"have.text":{positive:{pass:e=>`Assertion passed: Text is exactly "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected text to be "${e[0]}", but got "${t}"`},negative:{pass:e=>`Assertion passed: Text is not exactly "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected text to not be "${e[0]}", but got "${t}"`}},"contain.text":{positive:{pass:e=>`Assertion passed: Text contains "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected text to contain "${e[0]}", but got "${t}"`},negative:{pass:e=>`Assertion passed: Text does not contain "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected text to not contain "${e[0]}", but got "${t}"`}},"be.empty":{positive:{pass:()=>"Assertion passed: Text is empty",fail:(e,t)=>`Assertion failed: Expected text to be empty, but got "${t}"`},negative:{pass:()=>"Assertion passed: Text is not empty",fail:(e,t)=>`Assertion failed: Expected text to not be empty, but got "${t}"`}},"have.attr":{positive:{pass:e=>`Assertion passed: Attribute "${e[0]}" is "${e[1]}"`,fail:(e,t)=>`Assertion failed: Expected attribute "${e[0]}" to be "${e[1]}", but got "${t}"`},negative:{pass:e=>`Assertion passed: Attribute "${e[0]}" is not "${e[1]}"`,fail:(e,t)=>`Assertion failed: Expected attribute "${e[0]}" to not be "${e[1]}", but got "${t}"`}},"have.value":{positive:{pass:e=>`Assertion passed: Value is "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected value to be "${e[0]}", but got "${t}"`},negative:{pass:e=>`Assertion passed: Value is not "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected value to not be "${e[0]}", but got "${t}"`}},"be.disabled":{positive:{pass:()=>"Assertion passed: Element is disabled",fail:()=>"Assertion failed: Expected element to be disabled"},negative:{pass:()=>"Assertion passed: Element is not disabled",fail:()=>"Assertion failed: Expected element to not be disabled"}},"be.enabled":{positive:{pass:()=>"Assertion passed: Element is enabled",fail:()=>"Assertion failed: Expected element to be enabled"},negative:{pass:()=>"Assertion passed: Element is not enabled",fail:()=>"Assertion failed: Expected element to not be enabled"}},"be.checked":{positive:{pass:()=>"Assertion passed: Element is checked",fail:()=>"Assertion failed: Expected element to be checked"},negative:{pass:()=>"Assertion passed: Element is not checked",fail:()=>"Assertion failed: Expected element to not be checked"}},"be.selected":{positive:{pass:()=>"Assertion passed: Element is selected",fail:()=>"Assertion failed: Expected element to be selected"},negative:{pass:()=>"Assertion passed: Element is not selected",fail:()=>"Assertion failed: Expected element to not be selected"}},"be.focused":{positive:{pass:()=>"Assertion passed: Element is focused",fail:()=>"Assertion failed: Expected element to be focused"},negative:{pass:()=>"Assertion passed: Element is not focused",fail:()=>"Assertion failed: Expected element to not be focused"}},"be.visible":{positive:{pass:()=>"Assertion passed: Element is visible",fail:()=>"Assertion failed: Expected element to be visible"},negative:{pass:()=>"Assertion passed: Element is not visible",fail:()=>"Assertion failed: Expected element to not be visible"}},"have.class":{positive:{pass:e=>`Assertion passed: Element has class "${e[0]}"`,fail:e=>`Assertion failed: Expected element to have class "${e[0]}"`},negative:{pass:e=>`Assertion passed: Element does not have class "${e[0]}"`,fail:e=>`Assertion failed: Expected element to not have class "${e[0]}"`}}},ji=(e,t,...r)=>{const n=t.startsWith("not."),o=n?t.slice(4):t,i=(e.textContent||"").trim(),a=dm[o];if(!a)throw new Error(`Unknown assertion: ${o}`);const s=n?"negative":"positive";let l,u;switch(o){case"have.text":l=i===r[0],u=i;break;case"contain.text":l=i.includes(r[0]),u=i;break;case"be.empty":l=i.length===0,u=i;break;case"have.attr":u=e.getAttribute(r[0]),l=u===r[1];break;case"have.value":u=e.value,l=u===r[0];break;case"be.disabled":l=e.disabled===!0;break;case"be.enabled":l=e.disabled===!1;break;case"be.checked":l=e.checked===!0;break;case"be.selected":l=e.selected===!0;break;case"be.focused":l=document.activeElement===e;break;case"be.visible":l=cm(e);break;case"have.class":l=e.classList.contains(r[0]);break;default:throw new Error(`Unknown assertion: ${o}`)}return Yi(l,n,a[s].pass(r),a[s].fail(r,u))},Re=e=>{const t=xo.handlers.size?Array.from(xo.handlers.values()).find(r=>r.status==="running"):null;t&&t.logs?.push(e)},xa="1.3.1",fm=()=>typeof window<"u"?(window.__TWD_MOCK_STATE__||(window.__TWD_MOCK_STATE__={rules:[]}),window.__TWD_MOCK_STATE__):{rules:[]},pm=fm(),Xe=pm.rules,mm=100,hm=async e=>{if("serviceWorker"in navigator){const t=e??"/mock-sw.js";await navigator.serviceWorker.register(`${t}?v=${xa}`),navigator.serviceWorker.controller||await new Promise(r=>{navigator.serviceWorker.addEventListener("controllerchange",r,{once:!0})}),navigator.serviceWorker.addEventListener("message",r=>{if(r.data?.type==="EXECUTED"){const{alias:n,request:o}=r.data,i=Xe.find(a=>a.alias===n);i&&(i.executed=!0,i.request=o)}})}},bm=async(e,t)=>{const r={alias:e,...t,executed:!1},n=Xe.findIndex(o=>o.alias===e);n!==-1?Xe[n]=r:Xe.push(r),navigator.serviceWorker.controller?.postMessage({type:"ADD_RULE",rule:r,version:xa}),await ii(mm),await Promise.resolve()},vm=async e=>await Promise.all(e.map(r=>bd(r))),bd=async(e,t=10,r=100)=>{if(!Xe.find(o=>o.alias===e))throw new Error(`Rule ${e} not found`);for(let o=0;o<t;o++){const i=Xe.find(a=>a.alias===e&&a.executed);if(i)return Promise.resolve(i);o<t-1&&await new Promise(a=>setTimeout(a,r))}throw console.log(`Rule ${e} was not executed within ${t*r}ms`),new Error(`Rule ${e} was not executed within ${t*r}ms`)},vd=()=>Xe,ym=()=>{navigator.serviceWorker.controller?.postMessage({type:"CLEAR_RULES",version:xa}),Xe.length=0},gm=(e,t)=>{const r=e.startsWith("not.");switch(r?e.slice(4):e){case"eq":return Yi(window.location.href===t,r,`Assertion passed: URL is ${t}`,`Assertion failed: Expected URL to be ${t}, but got ${window.location.href}`);case"contain.url":return Yi(window.location.href.includes(t),r,`Assertion passed: URL contains ${t}`,`Assertion failed: Expected URL to contain ${t}, but got ${window.location.href}`);default:throw new Error(`Unknown assertion: ${e}`)}},Rm=()=>({location:window.location,should:async(e,t,r=5)=>{let n="",o;for(let i=0;i<r;i++)try{n=gm(e,t),Re(n);break}catch(a){await new Promise(s=>setTimeout(s,100)),o=a}if(o)throw o;return n}}),wm=100,Em=async(e,t)=>{if(Re(`visit("${e}")`),window.location.pathname===e||t){const r=`/__dummy_${Math.random().toString(36).slice(2)}`;window.history.pushState({},"",r),window.dispatchEvent(new PopStateEvent("popstate")),await ii(10)}window.history.pushState({},"",e),window.dispatchEvent(new PopStateEvent("popstate")),await ii(wm)},xm={get:async e=>{const t=`body > div:not(#twd-sidebar-root) ${e}`;Re(`Searching get("${e}")`);const r=await lm(e,()=>document.querySelector(t)),n={el:r,should:(o,...i)=>{const a=ji(r,o,...i);return Re(a),n}};return n},setInputValue:(e,t)=>{const{set:r}=Object.getOwnPropertyDescriptor(e.__proto__,"value");r.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0}))},getAll:async e=>{const t=`body > div:not(#twd-sidebar-root) ${e}`;return Re(`Searching getAll("${e}")`),(await um(e,()=>document.querySelectorAll(t))).map(n=>{const o={el:n,should:(i,...a)=>{const s=ji(n,i,...a);return Re(s),o}};return o})},visit:Em,url:Rm,mockRequest:bm,waitForRequest:bd,waitForRequests:vm,initRequestMocking:hm,clearRequestMockRules:ym,getRequestMockRules:vd,should:(e,t,...r)=>{const n=ji(e,t,...r);Re(n)},wait:ii,mockComponent:B.mockComponent,clearComponentMocks:B.clearComponentMocks,notExists:async e=>{const t=`body > div:not(#twd-sidebar-root) ${e}`;if(Re(`Checking notExists("${e}")`),document.querySelector(t))throw new Error(`Element "${e}" exists in the DOM.`);Re(`Assertion passed: Element "${e}" does not exist in the DOM.`)}};var Ca=Object.defineProperty,Cm=(e,t,r)=>t in e?Ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>Ca(e,"name",{value:t,configurable:!0}),qa=(e,t)=>{for(var r in t)Ca(e,r,{get:t[r],enumerable:!0})},yd=(e,t,r)=>Cm(e,typeof t!="symbol"?t+"":t,r),ai={};qa(ai,{addChainableMethod:()=>$a,addLengthGuard:()=>jo,addMethod:()=>ka,addProperty:()=>Na,checkError:()=>fe,compareByInspect:()=>ui,eql:()=>Gd,events:()=>Ci,expectTypes:()=>Pd,flag:()=>U,getActual:()=>Ei,getMessage:()=>Ta,getName:()=>qi,getOperator:()=>Ua,getOwnEnumerableProperties:()=>Fa,getOwnEnumerablePropertySymbols:()=>La,getPathInfo:()=>Oa,hasProperty:()=>xi,inspect:()=>H,isNaN:()=>ci,isNumeric:()=>ne,isProxyEnabled:()=>ko,isRegExp:()=>di,objDisplay:()=>st,overwriteChainableMethod:()=>Ba,overwriteMethod:()=>Da,overwriteProperty:()=>ja,proxify:()=>_t,test:()=>_a,transferFlags:()=>Ee,type:()=>Q});var fe={};qa(fe,{compatibleConstructor:()=>wd,compatibleInstance:()=>Rd,compatibleMessage:()=>Ed,getConstructorName:()=>xd,getMessage:()=>Cd});function wi(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}x(wi,"isErrorInstance");function gd(e){return Object.prototype.toString.call(e)==="[object RegExp]"}x(gd,"isRegExp");function Rd(e,t){return wi(t)&&e===t}x(Rd,"compatibleInstance");function wd(e,t){return wi(t)?e.constructor===t.constructor||e instanceof t.constructor:(typeof t=="object"||typeof t=="function")&&t.prototype?e.constructor===t||e instanceof t:!1}x(wd,"compatibleConstructor");function Ed(e,t){const r=typeof e=="string"?e:e.message;return gd(t)?t.test(r):typeof t=="string"?r.indexOf(t)!==-1:!1}x(Ed,"compatibleMessage");function xd(e){let t=e;return wi(e)?t=e.constructor.name:typeof e=="function"&&(t=e.name,t===""&&(t=new e().name||t)),t}x(xd,"getConstructorName");function Cd(e){let t="";return e&&e.message?t=e.message:typeof e=="string"&&(t=e),t}x(Cd,"getMessage");function U(e,t,r){let n=e.__flags||(e.__flags=Object.create(null));if(arguments.length===3)n[t]=r;else return n[t]}x(U,"flag");function _a(e,t){let r=U(e,"negate"),n=t[0];return r?!n:n}x(_a,"test");function Q(e){if(typeof e>"u")return"undefined";if(e===null)return"null";const t=e[Symbol.toStringTag];return typeof t=="string"?t:Object.prototype.toString.call(e).slice(8,-1)}x(Q,"type");var qm="captureStackTrace"in Error,qd=class _d extends Error{constructor(t="Unspecified AssertionError",r,n){super(t),yd(this,"message"),this.message=t,qm&&Error.captureStackTrace(this,n||_d);for(const o in r)o in this||(this[o]=r[o])}get name(){return"AssertionError"}get ok(){return!1}toJSON(t){return{...this,name:this.name,message:this.message,ok:!1,stack:t!==!1?this.stack:void 0}}};x(qd,"AssertionError");var G=qd;function Pd(e,t){let r=U(e,"message"),n=U(e,"ssfi");r=r?r+": ":"",e=U(e,"object"),t=t.map(function(a){return a.toLowerCase()}),t.sort();let o=t.map(function(a,s){let l=~["a","e","i","o","u"].indexOf(a.charAt(0))?"an":"a";return(t.length>1&&s===t.length-1?"or ":"")+l+" "+a}).join(", "),i=Q(e).toLowerCase();if(!t.some(function(a){return i===a}))throw new G(r+"object tested must be "+o+", but "+i+" given",void 0,n)}x(Pd,"expectTypes");function Ei(e,t){return t.length>4?t[4]:e._obj}x(Ei,"getActual");var qs={bold:["1","22"],dim:["2","22"],italic:["3","23"],underline:["4","24"],inverse:["7","27"],hidden:["8","28"],strike:["9","29"],black:["30","39"],red:["31","39"],green:["32","39"],yellow:["33","39"],blue:["34","39"],magenta:["35","39"],cyan:["36","39"],white:["37","39"],brightblack:["30;1","39"],brightred:["31;1","39"],brightgreen:["32;1","39"],brightyellow:["33;1","39"],brightblue:["34;1","39"],brightmagenta:["35;1","39"],brightcyan:["36;1","39"],brightwhite:["37;1","39"],grey:["90","39"]},_m={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},yt="…";function Td(e,t){const r=qs[_m[t]]||qs[t]||"";return r?`\x1B[${r[0]}m${String(e)}\x1B[${r[1]}m`:String(e)}x(Td,"colorise");function Sd({showHidden:e=!1,depth:t=2,colors:r=!1,customInspect:n=!0,showProxy:o=!1,maxArrayLength:i=1/0,breakLength:a=1/0,seen:s=[],truncate:l=1/0,stylize:u=String}={},f){const c={showHidden:!!e,depth:Number(t),colors:!!r,customInspect:!!n,showProxy:!!o,maxArrayLength:Number(i),breakLength:Number(a),truncate:Number(l),seen:s,inspect:f,stylize:u};return c.colors&&(c.stylize=Td),c}x(Sd,"normaliseOptions");function Ad(e){return e>="\uD800"&&e<="\uDBFF"}x(Ad,"isHighSurrogate");function Fe(e,t,r=yt){e=String(e);const n=r.length,o=e.length;if(n>t&&o>n)return r;if(o>t&&o>n){let i=t-n;return i>0&&Ad(e[i-1])&&(i=i-1),`${e.slice(0,i)}${r}`}return e}x(Fe,"truncate");function he(e,t,r,n=", "){r=r||t.inspect;const o=e.length;if(o===0)return"";const i=t.truncate;let a="",s="",l="";for(let u=0;u<o;u+=1){const f=u+1===e.length,c=u+2===e.length;l=`${yt}(${e.length-u})`;const d=e[u];t.truncate=i-a.length-(f?0:n.length);const b=s||r(d,t)+(f?"":n),v=a.length+b.length,R=v+l.length;if(f&&v>i&&a.length+l.length<=i||!f&&!c&&R>i||(s=f?"":r(e[u+1],t)+(c?"":n),!f&&c&&R>i&&v+s.length>i))break;if(a+=b,!f&&!c&&v+s.length>=i){l=`${yt}(${e.length-u-1})`;break}l=""}return`${a}${l}`}x(he,"inspectList");function Md(e){return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?e:JSON.stringify(e).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}x(Md,"quoteComplexKey");function gt([e,t],r){return r.truncate-=2,typeof e=="string"?e=Md(e):typeof e!="number"&&(e=`[${r.inspect(e,r)}]`),r.truncate-=e.length,t=r.inspect(t,r),`${e}: ${t}`}x(gt,"inspectProperty");function Od(e,t){const r=Object.keys(e).slice(e.length);if(!e.length&&!r.length)return"[]";t.truncate-=4;const n=he(e,t);t.truncate-=n.length;let o="";return r.length&&(o=he(r.map(i=>[i,e[i]]),t,gt)),`[ ${n}${o?`, ${o}`:""} ]`}x(Od,"inspectArray");var Pm=x(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag]?e[Symbol.toStringTag]:e.constructor.name,"getArrayName");function qe(e,t){const r=Pm(e);t.truncate-=r.length+4;const n=Object.keys(e).slice(e.length);if(!e.length&&!n.length)return`${r}[]`;let o="";for(let a=0;a<e.length;a++){const s=`${t.stylize(Fe(e[a],t.truncate),"number")}${a===e.length-1?"":", "}`;if(t.truncate-=s.length,e[a]!==e.length&&t.truncate<=3){o+=`${yt}(${e.length-e[a]+1})`;break}o+=s}let i="";return n.length&&(i=he(n.map(a=>[a,e[a]]),t,gt)),`${r}[ ${o}${i?`, ${i}`:""} ]`}x(qe,"inspectTypedArray");function Id(e,t){const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),o=n[0];return t.stylize(`${o}T${Fe(n[1],t.truncate-o.length-1)}`,"date")}x(Id,"inspectDate");function Xi(e,t){const r=e[Symbol.toStringTag]||"Function",n=e.name;return n?t.stylize(`[${r} ${Fe(n,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")}x(Xi,"inspectFunction");function Nd([e,t],r){return r.truncate-=4,e=r.inspect(e,r),r.truncate-=e.length,t=r.inspect(t,r),`${e} => ${t}`}x(Nd,"inspectMapEntry");function kd(e){const t=[];return e.forEach((r,n)=>{t.push([n,r])}),t}x(kd,"mapToEntries");function jd(e,t){return e.size===0?"Map{}":(t.truncate-=7,`Map{ ${he(kd(e),t,Nd)} }`)}x(jd,"inspectMap");var Tm=Number.isNaN||(e=>e!==e);function Ji(e,t){return Tm(e)?t.stylize("NaN","number"):e===1/0?t.stylize("Infinity","number"):e===-1/0?t.stylize("-Infinity","number"):e===0?t.stylize(1/e===1/0?"+0":"-0","number"):t.stylize(Fe(String(e),t.truncate),"number")}x(Ji,"inspectNumber");function Qi(e,t){let r=Fe(e.toString(),t.truncate-1);return r!==yt&&(r+="n"),t.stylize(r,"bigint")}x(Qi,"inspectBigInt");function Dd(e,t){const r=e.toString().split("/")[2],n=t.truncate-(2+r.length),o=e.source;return t.stylize(`/${Fe(o,n)}/${r}`,"regexp")}x(Dd,"inspectRegExp");function $d(e){const t=[];return e.forEach(r=>{t.push(r)}),t}x($d,"arrayFromSet");function Bd(e,t){return e.size===0?"Set{}":(t.truncate-=7,`Set{ ${he($d(e),t)} }`)}x(Bd,"inspectSet");var _s=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),Sm={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},Am=16;function Ld(e){return Sm[e]||`\\u${`0000${e.charCodeAt(0).toString(Am)}`.slice(-4)}`}x(Ld,"escape");function Zi(e,t){return _s.test(e)&&(e=e.replace(_s,Ld)),t.stylize(`'${Fe(e,t.truncate-2)}'`,"string")}x(Zi,"inspectString");function ea(e){return"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString()}x(ea,"inspectSymbol");var Mm=x(()=>"Promise{…}","getPromiseValue"),Om=Mm;function Co(e,t){const r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[];if(r.length===0&&n.length===0)return"{}";if(t.truncate-=4,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);const o=he(r.map(s=>[s,e[s]]),t,gt),i=he(n.map(s=>[s,e[s]]),t,gt);t.seen.pop();let a="";return o&&i&&(a=", "),`{ ${o}${a}${i} }`}x(Co,"inspectObject");var Di=typeof Symbol<"u"&&Symbol.toStringTag?Symbol.toStringTag:!1;function Fd(e,t){let r="";return Di&&Di in e&&(r=e[Di]),r=r||e.constructor.name,(!r||r==="_class")&&(r="<Anonymous Class>"),t.truncate-=r.length,`${r}${Co(e,t)}`}x(Fd,"inspectClass");function Ud(e,t){return e.length===0?"Arguments[]":(t.truncate-=13,`Arguments[ ${he(e,t)} ]`)}x(Ud,"inspectArguments");var Im=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description","cause"];function zd(e,t){const r=Object.getOwnPropertyNames(e).filter(a=>Im.indexOf(a)===-1),n=e.name;t.truncate-=n.length;let o="";if(typeof e.message=="string"?o=Fe(e.message,t.truncate):r.unshift("message"),o=o?`: ${o}`:"",t.truncate-=o.length+5,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);const i=he(r.map(a=>[a,e[a]]),t,gt);return`${n}${o}${i?` { ${i} }`:""}`}x(zd,"inspectObject");function Vd([e,t],r){return r.truncate-=3,t?`${r.stylize(String(e),"yellow")}=${r.stylize(`"${t}"`,"string")}`:`${r.stylize(String(e),"yellow")}`}x(Vd,"inspectAttribute");function si(e,t){return he(e,t,Hd,`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xo=require("./runner.cjs.js"),B=require("./jsx-runtime-CjngqUuo.js"),oi=require("react"),lm=(e,t,r=2e3,n=50)=>new Promise((o,i)=>{const a=Date.now(),s=()=>{const l=t();if(l)return o(l);if(Date.now()-a>r)return i(new Error(`Timeout waiting for element ${e}`));setTimeout(s,n)};s()}),um=(e,t,r=2e3,n=50)=>new Promise((o,i)=>{const a=Date.now(),s=()=>{const l=t();if(l&&l.length>0)return o(Array.from(l));if(Date.now()-a>r)return i(new Error(`Timeout waiting for elements ${e}`));setTimeout(s,n)};s()}),ii=e=>new Promise(t=>setTimeout(t,e)),Yi=(e,t,r,n)=>{if(!e&&!t)throw new Error(n);if(e&&t)throw new Error(n.replace("to be","to not be").replace("to have","to not have").replace("to contain","to not contain"));return r};function cm(e){if(!e.isConnected)return!1;let t=e;for(;t;){const r=getComputedStyle(t);if(r.display==="none"||r.visibility==="hidden"||r.visibility==="collapse")return!1;t=t.parentElement}return!0}const dm={"have.text":{positive:{pass:e=>`Assertion passed: Text is exactly "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected text to be "${e[0]}", but got "${t}"`},negative:{pass:e=>`Assertion passed: Text is not exactly "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected text to not be "${e[0]}", but got "${t}"`}},"contain.text":{positive:{pass:e=>`Assertion passed: Text contains "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected text to contain "${e[0]}", but got "${t}"`},negative:{pass:e=>`Assertion passed: Text does not contain "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected text to not contain "${e[0]}", but got "${t}"`}},"be.empty":{positive:{pass:()=>"Assertion passed: Text is empty",fail:(e,t)=>`Assertion failed: Expected text to be empty, but got "${t}"`},negative:{pass:()=>"Assertion passed: Text is not empty",fail:(e,t)=>`Assertion failed: Expected text to not be empty, but got "${t}"`}},"have.attr":{positive:{pass:e=>`Assertion passed: Attribute "${e[0]}" is "${e[1]}"`,fail:(e,t)=>`Assertion failed: Expected attribute "${e[0]}" to be "${e[1]}", but got "${t}"`},negative:{pass:e=>`Assertion passed: Attribute "${e[0]}" is not "${e[1]}"`,fail:(e,t)=>`Assertion failed: Expected attribute "${e[0]}" to not be "${e[1]}", but got "${t}"`}},"have.value":{positive:{pass:e=>`Assertion passed: Value is "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected value to be "${e[0]}", but got "${t}"`},negative:{pass:e=>`Assertion passed: Value is not "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected value to not be "${e[0]}", but got "${t}"`}},"be.disabled":{positive:{pass:()=>"Assertion passed: Element is disabled",fail:()=>"Assertion failed: Expected element to be disabled"},negative:{pass:()=>"Assertion passed: Element is not disabled",fail:()=>"Assertion failed: Expected element to not be disabled"}},"be.enabled":{positive:{pass:()=>"Assertion passed: Element is enabled",fail:()=>"Assertion failed: Expected element to be enabled"},negative:{pass:()=>"Assertion passed: Element is not enabled",fail:()=>"Assertion failed: Expected element to not be enabled"}},"be.checked":{positive:{pass:()=>"Assertion passed: Element is checked",fail:()=>"Assertion failed: Expected element to be checked"},negative:{pass:()=>"Assertion passed: Element is not checked",fail:()=>"Assertion failed: Expected element to not be checked"}},"be.selected":{positive:{pass:()=>"Assertion passed: Element is selected",fail:()=>"Assertion failed: Expected element to be selected"},negative:{pass:()=>"Assertion passed: Element is not selected",fail:()=>"Assertion failed: Expected element to not be selected"}},"be.focused":{positive:{pass:()=>"Assertion passed: Element is focused",fail:()=>"Assertion failed: Expected element to be focused"},negative:{pass:()=>"Assertion passed: Element is not focused",fail:()=>"Assertion failed: Expected element to not be focused"}},"be.visible":{positive:{pass:()=>"Assertion passed: Element is visible",fail:()=>"Assertion failed: Expected element to be visible"},negative:{pass:()=>"Assertion passed: Element is not visible",fail:()=>"Assertion failed: Expected element to not be visible"}},"have.class":{positive:{pass:e=>`Assertion passed: Element has class "${e[0]}"`,fail:e=>`Assertion failed: Expected element to have class "${e[0]}"`},negative:{pass:e=>`Assertion passed: Element does not have class "${e[0]}"`,fail:e=>`Assertion failed: Expected element to not have class "${e[0]}"`}}},ji=(e,t,...r)=>{const n=t.startsWith("not."),o=n?t.slice(4):t,i=(e.textContent||"").trim(),a=dm[o];if(!a)throw new Error(`Unknown assertion: ${o}`);const s=n?"negative":"positive";let l,u;switch(o){case"have.text":l=i===r[0],u=i;break;case"contain.text":l=i.includes(r[0]),u=i;break;case"be.empty":l=i.length===0,u=i;break;case"have.attr":u=e.getAttribute(r[0]),l=u===r[1];break;case"have.value":u=e.value,l=u===r[0];break;case"be.disabled":l=e.disabled===!0;break;case"be.enabled":l=e.disabled===!1;break;case"be.checked":l=e.checked===!0;break;case"be.selected":l=e.selected===!0;break;case"be.focused":l=document.activeElement===e;break;case"be.visible":l=cm(e);break;case"have.class":l=e.classList.contains(r[0]);break;default:throw new Error(`Unknown assertion: ${o}`)}return Yi(l,n,a[s].pass(r),a[s].fail(r,u))},Re=e=>{const t=xo.handlers.size?Array.from(xo.handlers.values()).find(r=>r.status==="running"):null;t&&t.logs?.push(e)},xa="1.3.2",fm=()=>typeof window<"u"?(window.__TWD_MOCK_STATE__||(window.__TWD_MOCK_STATE__={rules:[]}),window.__TWD_MOCK_STATE__):{rules:[]},pm=fm(),Xe=pm.rules,mm=100,hm=async e=>{if("serviceWorker"in navigator){const t=e??"/mock-sw.js";await navigator.serviceWorker.register(`${t}?v=${xa}`),navigator.serviceWorker.controller||await new Promise(r=>{navigator.serviceWorker.addEventListener("controllerchange",r,{once:!0})}),navigator.serviceWorker.addEventListener("message",r=>{if(r.data?.type==="EXECUTED"){const{alias:n,request:o}=r.data,i=Xe.find(a=>a.alias===n);i&&(i.executed=!0,i.request=o)}})}},bm=async(e,t)=>{const r={alias:e,...t,executed:!1},n=Xe.findIndex(o=>o.alias===e);n!==-1?Xe[n]=r:Xe.push(r),navigator.serviceWorker.controller?.postMessage({type:"ADD_RULE",rule:r,version:xa}),await ii(mm),await Promise.resolve()},vm=async e=>await Promise.all(e.map(r=>bd(r))),bd=async(e,t=10,r=100)=>{if(!Xe.find(o=>o.alias===e))throw new Error(`Rule ${e} not found`);for(let o=0;o<t;o++){const i=Xe.find(a=>a.alias===e&&a.executed);if(i)return Promise.resolve(i);o<t-1&&await new Promise(a=>setTimeout(a,r))}throw console.log(`Rule ${e} was not executed within ${t*r}ms`),new Error(`Rule ${e} was not executed within ${t*r}ms`)},vd=()=>Xe,ym=()=>{navigator.serviceWorker.controller?.postMessage({type:"CLEAR_RULES",version:xa}),Xe.length=0},gm=(e,t)=>{const r=e.startsWith("not.");switch(r?e.slice(4):e){case"eq":return Yi(window.location.href===t,r,`Assertion passed: URL is ${t}`,`Assertion failed: Expected URL to be ${t}, but got ${window.location.href}`);case"contain.url":return Yi(window.location.href.includes(t),r,`Assertion passed: URL contains ${t}`,`Assertion failed: Expected URL to contain ${t}, but got ${window.location.href}`);default:throw new Error(`Unknown assertion: ${e}`)}},Rm=()=>({location:window.location,should:async(e,t,r=5)=>{let n="",o;for(let i=0;i<r;i++)try{n=gm(e,t),Re(n);break}catch(a){await new Promise(s=>setTimeout(s,100)),o=a}if(o)throw o;return n}}),wm=100,Em=async(e,t)=>{if(Re(`visit("${e}")`),window.location.pathname===e||t){const r=`/__dummy_${Math.random().toString(36).slice(2)}`;window.history.pushState({},"",r),window.dispatchEvent(new PopStateEvent("popstate")),await ii(10)}window.history.pushState({},"",e),window.dispatchEvent(new PopStateEvent("popstate")),await ii(wm)},xm={get:async e=>{const t=`body > div:not(#twd-sidebar-root) ${e}`;Re(`Searching get("${e}")`);const r=await lm(e,()=>document.querySelector(t)),n={el:r,should:(o,...i)=>{const a=ji(r,o,...i);return Re(a),n}};return n},setInputValue:(e,t)=>{const{set:r}=Object.getOwnPropertyDescriptor(e.__proto__,"value");r.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0}))},getAll:async e=>{const t=`body > div:not(#twd-sidebar-root) ${e}`;return Re(`Searching getAll("${e}")`),(await um(e,()=>document.querySelectorAll(t))).map(n=>{const o={el:n,should:(i,...a)=>{const s=ji(n,i,...a);return Re(s),o}};return o})},visit:Em,url:Rm,mockRequest:bm,waitForRequest:bd,waitForRequests:vm,initRequestMocking:hm,clearRequestMockRules:ym,getRequestMockRules:vd,should:(e,t,...r)=>{const n=ji(e,t,...r);Re(n)},wait:ii,mockComponent:B.mockComponent,clearComponentMocks:B.clearComponentMocks,notExists:async e=>{const t=`body > div:not(#twd-sidebar-root) ${e}`;if(Re(`Checking notExists("${e}")`),document.querySelector(t))throw new Error(`Element "${e}" exists in the DOM.`);Re(`Assertion passed: Element "${e}" does not exist in the DOM.`)}};var Ca=Object.defineProperty,Cm=(e,t,r)=>t in e?Ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>Ca(e,"name",{value:t,configurable:!0}),qa=(e,t)=>{for(var r in t)Ca(e,r,{get:t[r],enumerable:!0})},yd=(e,t,r)=>Cm(e,typeof t!="symbol"?t+"":t,r),ai={};qa(ai,{addChainableMethod:()=>$a,addLengthGuard:()=>jo,addMethod:()=>ka,addProperty:()=>Na,checkError:()=>fe,compareByInspect:()=>ui,eql:()=>Gd,events:()=>Ci,expectTypes:()=>Pd,flag:()=>U,getActual:()=>Ei,getMessage:()=>Ta,getName:()=>qi,getOperator:()=>Ua,getOwnEnumerableProperties:()=>Fa,getOwnEnumerablePropertySymbols:()=>La,getPathInfo:()=>Oa,hasProperty:()=>xi,inspect:()=>H,isNaN:()=>ci,isNumeric:()=>ne,isProxyEnabled:()=>ko,isRegExp:()=>di,objDisplay:()=>st,overwriteChainableMethod:()=>Ba,overwriteMethod:()=>Da,overwriteProperty:()=>ja,proxify:()=>_t,test:()=>_a,transferFlags:()=>Ee,type:()=>Q});var fe={};qa(fe,{compatibleConstructor:()=>wd,compatibleInstance:()=>Rd,compatibleMessage:()=>Ed,getConstructorName:()=>xd,getMessage:()=>Cd});function wi(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}x(wi,"isErrorInstance");function gd(e){return Object.prototype.toString.call(e)==="[object RegExp]"}x(gd,"isRegExp");function Rd(e,t){return wi(t)&&e===t}x(Rd,"compatibleInstance");function wd(e,t){return wi(t)?e.constructor===t.constructor||e instanceof t.constructor:(typeof t=="object"||typeof t=="function")&&t.prototype?e.constructor===t||e instanceof t:!1}x(wd,"compatibleConstructor");function Ed(e,t){const r=typeof e=="string"?e:e.message;return gd(t)?t.test(r):typeof t=="string"?r.indexOf(t)!==-1:!1}x(Ed,"compatibleMessage");function xd(e){let t=e;return wi(e)?t=e.constructor.name:typeof e=="function"&&(t=e.name,t===""&&(t=new e().name||t)),t}x(xd,"getConstructorName");function Cd(e){let t="";return e&&e.message?t=e.message:typeof e=="string"&&(t=e),t}x(Cd,"getMessage");function U(e,t,r){let n=e.__flags||(e.__flags=Object.create(null));if(arguments.length===3)n[t]=r;else return n[t]}x(U,"flag");function _a(e,t){let r=U(e,"negate"),n=t[0];return r?!n:n}x(_a,"test");function Q(e){if(typeof e>"u")return"undefined";if(e===null)return"null";const t=e[Symbol.toStringTag];return typeof t=="string"?t:Object.prototype.toString.call(e).slice(8,-1)}x(Q,"type");var qm="captureStackTrace"in Error,qd=class _d extends Error{constructor(t="Unspecified AssertionError",r,n){super(t),yd(this,"message"),this.message=t,qm&&Error.captureStackTrace(this,n||_d);for(const o in r)o in this||(this[o]=r[o])}get name(){return"AssertionError"}get ok(){return!1}toJSON(t){return{...this,name:this.name,message:this.message,ok:!1,stack:t!==!1?this.stack:void 0}}};x(qd,"AssertionError");var G=qd;function Pd(e,t){let r=U(e,"message"),n=U(e,"ssfi");r=r?r+": ":"",e=U(e,"object"),t=t.map(function(a){return a.toLowerCase()}),t.sort();let o=t.map(function(a,s){let l=~["a","e","i","o","u"].indexOf(a.charAt(0))?"an":"a";return(t.length>1&&s===t.length-1?"or ":"")+l+" "+a}).join(", "),i=Q(e).toLowerCase();if(!t.some(function(a){return i===a}))throw new G(r+"object tested must be "+o+", but "+i+" given",void 0,n)}x(Pd,"expectTypes");function Ei(e,t){return t.length>4?t[4]:e._obj}x(Ei,"getActual");var qs={bold:["1","22"],dim:["2","22"],italic:["3","23"],underline:["4","24"],inverse:["7","27"],hidden:["8","28"],strike:["9","29"],black:["30","39"],red:["31","39"],green:["32","39"],yellow:["33","39"],blue:["34","39"],magenta:["35","39"],cyan:["36","39"],white:["37","39"],brightblack:["30;1","39"],brightred:["31;1","39"],brightgreen:["32;1","39"],brightyellow:["33;1","39"],brightblue:["34;1","39"],brightmagenta:["35;1","39"],brightcyan:["36;1","39"],brightwhite:["37;1","39"],grey:["90","39"]},_m={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},yt="…";function Td(e,t){const r=qs[_m[t]]||qs[t]||"";return r?`\x1B[${r[0]}m${String(e)}\x1B[${r[1]}m`:String(e)}x(Td,"colorise");function Sd({showHidden:e=!1,depth:t=2,colors:r=!1,customInspect:n=!0,showProxy:o=!1,maxArrayLength:i=1/0,breakLength:a=1/0,seen:s=[],truncate:l=1/0,stylize:u=String}={},f){const c={showHidden:!!e,depth:Number(t),colors:!!r,customInspect:!!n,showProxy:!!o,maxArrayLength:Number(i),breakLength:Number(a),truncate:Number(l),seen:s,inspect:f,stylize:u};return c.colors&&(c.stylize=Td),c}x(Sd,"normaliseOptions");function Ad(e){return e>="\uD800"&&e<="\uDBFF"}x(Ad,"isHighSurrogate");function Fe(e,t,r=yt){e=String(e);const n=r.length,o=e.length;if(n>t&&o>n)return r;if(o>t&&o>n){let i=t-n;return i>0&&Ad(e[i-1])&&(i=i-1),`${e.slice(0,i)}${r}`}return e}x(Fe,"truncate");function he(e,t,r,n=", "){r=r||t.inspect;const o=e.length;if(o===0)return"";const i=t.truncate;let a="",s="",l="";for(let u=0;u<o;u+=1){const f=u+1===e.length,c=u+2===e.length;l=`${yt}(${e.length-u})`;const d=e[u];t.truncate=i-a.length-(f?0:n.length);const b=s||r(d,t)+(f?"":n),v=a.length+b.length,R=v+l.length;if(f&&v>i&&a.length+l.length<=i||!f&&!c&&R>i||(s=f?"":r(e[u+1],t)+(c?"":n),!f&&c&&R>i&&v+s.length>i))break;if(a+=b,!f&&!c&&v+s.length>=i){l=`${yt}(${e.length-u-1})`;break}l=""}return`${a}${l}`}x(he,"inspectList");function Md(e){return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?e:JSON.stringify(e).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}x(Md,"quoteComplexKey");function gt([e,t],r){return r.truncate-=2,typeof e=="string"?e=Md(e):typeof e!="number"&&(e=`[${r.inspect(e,r)}]`),r.truncate-=e.length,t=r.inspect(t,r),`${e}: ${t}`}x(gt,"inspectProperty");function Od(e,t){const r=Object.keys(e).slice(e.length);if(!e.length&&!r.length)return"[]";t.truncate-=4;const n=he(e,t);t.truncate-=n.length;let o="";return r.length&&(o=he(r.map(i=>[i,e[i]]),t,gt)),`[ ${n}${o?`, ${o}`:""} ]`}x(Od,"inspectArray");var Pm=x(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag]?e[Symbol.toStringTag]:e.constructor.name,"getArrayName");function qe(e,t){const r=Pm(e);t.truncate-=r.length+4;const n=Object.keys(e).slice(e.length);if(!e.length&&!n.length)return`${r}[]`;let o="";for(let a=0;a<e.length;a++){const s=`${t.stylize(Fe(e[a],t.truncate),"number")}${a===e.length-1?"":", "}`;if(t.truncate-=s.length,e[a]!==e.length&&t.truncate<=3){o+=`${yt}(${e.length-e[a]+1})`;break}o+=s}let i="";return n.length&&(i=he(n.map(a=>[a,e[a]]),t,gt)),`${r}[ ${o}${i?`, ${i}`:""} ]`}x(qe,"inspectTypedArray");function Id(e,t){const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),o=n[0];return t.stylize(`${o}T${Fe(n[1],t.truncate-o.length-1)}`,"date")}x(Id,"inspectDate");function Xi(e,t){const r=e[Symbol.toStringTag]||"Function",n=e.name;return n?t.stylize(`[${r} ${Fe(n,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")}x(Xi,"inspectFunction");function Nd([e,t],r){return r.truncate-=4,e=r.inspect(e,r),r.truncate-=e.length,t=r.inspect(t,r),`${e} => ${t}`}x(Nd,"inspectMapEntry");function kd(e){const t=[];return e.forEach((r,n)=>{t.push([n,r])}),t}x(kd,"mapToEntries");function jd(e,t){return e.size===0?"Map{}":(t.truncate-=7,`Map{ ${he(kd(e),t,Nd)} }`)}x(jd,"inspectMap");var Tm=Number.isNaN||(e=>e!==e);function Ji(e,t){return Tm(e)?t.stylize("NaN","number"):e===1/0?t.stylize("Infinity","number"):e===-1/0?t.stylize("-Infinity","number"):e===0?t.stylize(1/e===1/0?"+0":"-0","number"):t.stylize(Fe(String(e),t.truncate),"number")}x(Ji,"inspectNumber");function Qi(e,t){let r=Fe(e.toString(),t.truncate-1);return r!==yt&&(r+="n"),t.stylize(r,"bigint")}x(Qi,"inspectBigInt");function Dd(e,t){const r=e.toString().split("/")[2],n=t.truncate-(2+r.length),o=e.source;return t.stylize(`/${Fe(o,n)}/${r}`,"regexp")}x(Dd,"inspectRegExp");function $d(e){const t=[];return e.forEach(r=>{t.push(r)}),t}x($d,"arrayFromSet");function Bd(e,t){return e.size===0?"Set{}":(t.truncate-=7,`Set{ ${he($d(e),t)} }`)}x(Bd,"inspectSet");var _s=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),Sm={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},Am=16;function Ld(e){return Sm[e]||`\\u${`0000${e.charCodeAt(0).toString(Am)}`.slice(-4)}`}x(Ld,"escape");function Zi(e,t){return _s.test(e)&&(e=e.replace(_s,Ld)),t.stylize(`'${Fe(e,t.truncate-2)}'`,"string")}x(Zi,"inspectString");function ea(e){return"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString()}x(ea,"inspectSymbol");var Mm=x(()=>"Promise{…}","getPromiseValue"),Om=Mm;function Co(e,t){const r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[];if(r.length===0&&n.length===0)return"{}";if(t.truncate-=4,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);const o=he(r.map(s=>[s,e[s]]),t,gt),i=he(n.map(s=>[s,e[s]]),t,gt);t.seen.pop();let a="";return o&&i&&(a=", "),`{ ${o}${a}${i} }`}x(Co,"inspectObject");var Di=typeof Symbol<"u"&&Symbol.toStringTag?Symbol.toStringTag:!1;function Fd(e,t){let r="";return Di&&Di in e&&(r=e[Di]),r=r||e.constructor.name,(!r||r==="_class")&&(r="<Anonymous Class>"),t.truncate-=r.length,`${r}${Co(e,t)}`}x(Fd,"inspectClass");function Ud(e,t){return e.length===0?"Arguments[]":(t.truncate-=13,`Arguments[ ${he(e,t)} ]`)}x(Ud,"inspectArguments");var Im=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description","cause"];function zd(e,t){const r=Object.getOwnPropertyNames(e).filter(a=>Im.indexOf(a)===-1),n=e.name;t.truncate-=n.length;let o="";if(typeof e.message=="string"?o=Fe(e.message,t.truncate):r.unshift("message"),o=o?`: ${o}`:"",t.truncate-=o.length+5,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);const i=he(r.map(a=>[a,e[a]]),t,gt);return`${n}${o}${i?` { ${i} }`:""}`}x(zd,"inspectObject");function Vd([e,t],r){return r.truncate-=3,t?`${r.stylize(String(e),"yellow")}=${r.stylize(`"${t}"`,"string")}`:`${r.stylize(String(e),"yellow")}`}x(Vd,"inspectAttribute");function si(e,t){return he(e,t,Hd,`
|
|
2
2
|
`)}x(si,"inspectNodeCollection");function Hd(e,t){switch(e.nodeType){case 1:return Pa(e,t);case 3:return t.inspect(e.data,t);default:return t.inspect(e,t)}}x(Hd,"inspectNode");function Pa(e,t){const r=e.getAttributeNames(),n=e.tagName.toLowerCase(),o=t.stylize(`<${n}`,"special"),i=t.stylize(">","special"),a=t.stylize(`</${n}>`,"special");t.truncate-=n.length*2+5;let s="";r.length>0&&(s+=" ",s+=he(r.map(f=>[f,e.getAttribute(f)]),t,Vd," ")),t.truncate-=s.length;const l=t.truncate;let u=si(e.children,t);return u&&u.length>l&&(u=`${yt}(${e.children.length})`),`${o}${s}${i}${u}${a}`}x(Pa,"inspectHTML");var Nm=typeof Symbol=="function"&&typeof Symbol.for=="function",$i=Nm?Symbol.for("chai/inspect"):"@@chai/inspect",Bi=Symbol.for("nodejs.util.inspect.custom"),Ps=new WeakMap,Ts={},Ss={undefined:x((e,t)=>t.stylize("undefined","undefined"),"undefined"),null:x((e,t)=>t.stylize("null","null"),"null"),boolean:x((e,t)=>t.stylize(String(e),"boolean"),"boolean"),Boolean:x((e,t)=>t.stylize(String(e),"boolean"),"Boolean"),number:Ji,Number:Ji,bigint:Qi,BigInt:Qi,string:Zi,String:Zi,function:Xi,Function:Xi,symbol:ea,Symbol:ea,Array:Od,Date:Id,Map:jd,Set:Bd,RegExp:Dd,Promise:Om,WeakSet:x((e,t)=>t.stylize("WeakSet{…}","special"),"WeakSet"),WeakMap:x((e,t)=>t.stylize("WeakMap{…}","special"),"WeakMap"),Arguments:Ud,Int8Array:qe,Uint8Array:qe,Uint8ClampedArray:qe,Int16Array:qe,Uint16Array:qe,Int32Array:qe,Uint32Array:qe,Float32Array:qe,Float64Array:qe,Generator:x(()=>"","Generator"),DataView:x(()=>"","DataView"),ArrayBuffer:x(()=>"","ArrayBuffer"),Error:zd,HTMLCollection:si,NodeList:si},km=x((e,t,r,n)=>$i in e&&typeof e[$i]=="function"?e[$i](t):Bi in e&&typeof e[Bi]=="function"?e[Bi](t.depth,t,n):"inspect"in e&&typeof e.inspect=="function"?e.inspect(t.depth,t):"constructor"in e&&Ps.has(e.constructor)?Ps.get(e.constructor)(e,t):Ts[r]?Ts[r](e,t):"","inspectCustom"),jm=Object.prototype.toString;function qo(e,t={}){const r=Sd(t,qo),{customInspect:n}=r;let o=e===null?"null":typeof e;if(o==="object"&&(o=jm.call(e).slice(8,-1)),o in Ss)return Ss[o](e,r);if(n&&e){const a=km(e,r,o,qo);if(a)return typeof a=="string"?a:qo(a,r)}const i=e?Object.getPrototypeOf(e):!1;return i===Object.prototype||i===null?Co(e,r):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?Pa(e,r):"constructor"in e?e.constructor!==Object?Fd(e,r):Co(e,r):e===Object(e)?Co(e,r):r.stylize(String(e),o)}x(qo,"inspect");var ie={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:["then","catch","inspect","toJSON"],deepEqual:null};function H(e,t,r,n){let o={colors:n,depth:typeof r>"u"?2:r,showHidden:t,truncate:ie.truncateThreshold?ie.truncateThreshold:1/0};return qo(e,o)}x(H,"inspect");function st(e){let t=H(e),r=Object.prototype.toString.call(e);if(ie.truncateThreshold&&t.length>=ie.truncateThreshold){if(r==="[object Function]")return!e.name||e.name===""?"[Function]":"[Function: "+e.name+"]";if(r==="[object Array]")return"[ Array("+e.length+") ]";if(r==="[object Object]"){let n=Object.keys(e);return"{ Object ("+(n.length>2?n.splice(0,2).join(", ")+", ...":n.join(", "))+") }"}else return t}else return t}x(st,"objDisplay");function Ta(e,t){let r=U(e,"negate"),n=U(e,"object"),o=t[3],i=Ei(e,t),a=r?t[2]:t[1],s=U(e,"message");return typeof a=="function"&&(a=a()),a=a||"",a=a.replace(/#\{this\}/g,function(){return st(n)}).replace(/#\{act\}/g,function(){return st(i)}).replace(/#\{exp\}/g,function(){return st(o)}),s?s+": "+a:a}x(Ta,"getMessage");function Ee(e,t,r){let n=e.__flags||(e.__flags=Object.create(null));t.__flags||(t.__flags=Object.create(null)),r=arguments.length===3?r:!0;for(let o in n)(r||o!=="object"&&o!=="ssfi"&&o!=="lockSsfi"&&o!="message")&&(t.__flags[o]=n[o])}x(Ee,"transferFlags");function ta(e){if(typeof e>"u")return"undefined";if(e===null)return"null";const t=e[Symbol.toStringTag];return typeof t=="string"?t:Object.prototype.toString.call(e).slice(8,-1)}x(ta,"type");function Sa(){this._key="chai/deep-eql__"+Math.random()+Date.now()}x(Sa,"FakeMap");Sa.prototype={get:x(function(t){return t[this._key]},"get"),set:x(function(t,r){Object.isExtensible(t)&&Object.defineProperty(t,this._key,{value:r,configurable:!0})},"set")};var Wd=typeof WeakMap=="function"?WeakMap:Sa;function ra(e,t,r){if(!r||ut(e)||ut(t))return null;var n=r.get(e);if(n){var o=n.get(t);if(typeof o=="boolean")return o}return null}x(ra,"memoizeCompare");function go(e,t,r,n){if(!(!r||ut(e)||ut(t))){var o=r.get(e);o?o.set(t,n):(o=new Wd,o.set(t,n),r.set(e,o))}}x(go,"memoizeSet");var Gd=No;function No(e,t,r){if(r&&r.comparator)return na(e,t,r);var n=Aa(e,t);return n!==null?n:na(e,t,r)}x(No,"deepEqual");function Aa(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t?!0:ut(e)||ut(t)?!1:null}x(Aa,"simpleEqual");function na(e,t,r){r=r||{},r.memoize=r.memoize===!1?!1:r.memoize||new Wd;var n=r&&r.comparator,o=ra(e,t,r.memoize);if(o!==null)return o;var i=ra(t,e,r.memoize);if(i!==null)return i;if(n){var a=n(e,t);if(a===!1||a===!0)return go(e,t,r.memoize,a),a;var s=Aa(e,t);if(s!==null)return s}var l=ta(e);if(l!==ta(t))return go(e,t,r.memoize,!1),!1;go(e,t,r.memoize,!0);var u=Kd(e,t,l,r);return go(e,t,r.memoize,u),u}x(na,"extensiveDeepEqual");function Kd(e,t,r,n){switch(r){case"String":case"Number":case"Boolean":case"Date":return No(e.valueOf(),t.valueOf());case"Promise":case"Symbol":case"function":case"WeakMap":case"WeakSet":return e===t;case"Error":return Ma(e,t,["name","message","code"],n);case"Arguments":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"Array":return Je(e,t,n);case"RegExp":return Yd(e,t);case"Generator":return Xd(e,t,n);case"DataView":return Je(new Uint8Array(e.buffer),new Uint8Array(t.buffer),n);case"ArrayBuffer":return Je(new Uint8Array(e),new Uint8Array(t),n);case"Set":return oa(e,t,n);case"Map":return oa(e,t,n);case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.Instant":case"Temporal.ZonedDateTime":case"Temporal.PlainYearMonth":case"Temporal.PlainMonthDay":return e.equals(t);case"Temporal.Duration":return e.total("nanoseconds")===t.total("nanoseconds");case"Temporal.TimeZone":case"Temporal.Calendar":return e.toString()===t.toString();default:return Qd(e,t,n)}}x(Kd,"extensiveDeepEqualByType");function Yd(e,t){return e.toString()===t.toString()}x(Yd,"regexpEqual");function oa(e,t,r){try{if(e.size!==t.size)return!1;if(e.size===0)return!0}catch{return!1}var n=[],o=[];return e.forEach(x(function(a,s){n.push([a,s])},"gatherEntries")),t.forEach(x(function(a,s){o.push([a,s])},"gatherEntries")),Je(n.sort(),o.sort(),r)}x(oa,"entriesEqual");function Je(e,t,r){var n=e.length;if(n!==t.length)return!1;if(n===0)return!0;for(var o=-1;++o<n;)if(No(e[o],t[o],r)===!1)return!1;return!0}x(Je,"iterableEqual");function Xd(e,t,r){return Je(li(e),li(t),r)}x(Xd,"generatorEqual");function Jd(e){return typeof Symbol<"u"&&typeof e=="object"&&typeof Symbol.iterator<"u"&&typeof e[Symbol.iterator]=="function"}x(Jd,"hasIteratorFunction");function ia(e){if(Jd(e))try{return li(e[Symbol.iterator]())}catch{return[]}return[]}x(ia,"getIteratorEntries");function li(e){for(var t=e.next(),r=[t.value];t.done===!1;)t=e.next(),r.push(t.value);return r}x(li,"getGeneratorEntries");function aa(e){var t=[];for(var r in e)t.push(r);return t}x(aa,"getEnumerableKeys");function sa(e){for(var t=[],r=Object.getOwnPropertySymbols(e),n=0;n<r.length;n+=1){var o=r[n];Object.getOwnPropertyDescriptor(e,o).enumerable&&t.push(o)}return t}x(sa,"getEnumerableSymbols");function Ma(e,t,r,n){var o=r.length;if(o===0)return!0;for(var i=0;i<o;i+=1)if(No(e[r[i]],t[r[i]],n)===!1)return!1;return!0}x(Ma,"keysEqual");function Qd(e,t,r){var n=aa(e),o=aa(t),i=sa(e),a=sa(t);if(n=n.concat(i),o=o.concat(a),n.length&&n.length===o.length)return Je(la(n).sort(),la(o).sort())===!1?!1:Ma(e,t,n,r);var s=ia(e),l=ia(t);return s.length&&s.length===l.length?(s.sort(),l.sort(),Je(s,l,r)):n.length===0&&s.length===0&&o.length===0&&l.length===0}x(Qd,"objectEqual");function ut(e){return e===null||typeof e!="object"}x(ut,"isPrimitive");function la(e){return e.map(x(function(r){return typeof r=="symbol"?r.toString():r},"mapSymbol"))}x(la,"mapSymbols");function xi(e,t){return typeof e>"u"||e===null?!1:t in Object(e)}x(xi,"hasProperty");function Zd(e){return e.replace(/([^\\])\[/g,"$1.[").match(/(\\\.|[^.]+?)+/g).map(n=>{if(n==="constructor"||n==="__proto__"||n==="prototype")return{};const i=/^\[(\d+)\]$/.exec(n);let a=null;return i?a={i:parseFloat(i[1])}:a={p:n.replace(/\\([.[\]])/g,"$1")},a})}x(Zd,"parsePath");function ua(e,t,r){let n=e,o=null;r=typeof r>"u"?t.length:r;for(let i=0;i<r;i++){const a=t[i];n&&(typeof a.p>"u"?n=n[a.i]:n=n[a.p],i===r-1&&(o=n))}return o}x(ua,"internalGetPathValue");function Oa(e,t){const r=Zd(t),n=r[r.length-1],o={parent:r.length>1?ua(e,r,r.length-1):e,name:n.p||n.i,value:ua(e,r)};return o.exists=xi(o.parent,o.name),o}x(Oa,"getPathInfo");var ef=class tf{constructor(t,r,n,o){return yd(this,"__flags",{}),U(this,"ssfi",n||tf),U(this,"lockSsfi",o),U(this,"object",t),U(this,"message",r),U(this,"eql",ie.deepEqual||Gd),_t(this)}static get includeStack(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),ie.includeStack}static set includeStack(t){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),ie.includeStack=t}static get showDiff(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),ie.showDiff}static set showDiff(t){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),ie.showDiff=t}static addProperty(t,r){Na(this.prototype,t,r)}static addMethod(t,r){ka(this.prototype,t,r)}static addChainableMethod(t,r,n){$a(this.prototype,t,r,n)}static overwriteProperty(t,r){ja(this.prototype,t,r)}static overwriteMethod(t,r){Da(this.prototype,t,r)}static overwriteChainableMethod(t,r,n){Ba(this.prototype,t,r,n)}assert(t,r,n,o,i,a){const s=_a(this,arguments);if(a!==!1&&(a=!0),o===void 0&&i===void 0&&(a=!1),ie.showDiff!==!0&&(a=!1),!s){r=Ta(this,arguments);const u={actual:Ei(this,arguments),expected:o,showDiff:a},f=Ua(this,arguments);throw f&&(u.operator=f),new G(r,u,ie.includeStack?this.assert:U(this,"ssfi"))}}get _obj(){return U(this,"object")}set _obj(t){U(this,"object",t)}};x(ef,"Assertion");var h=ef,Ci=new EventTarget,rf=class extends Event{constructor(t,r,n){super(t),this.name=String(r),this.fn=n}};x(rf,"PluginEvent");var Ia=rf;function ko(){return ie.useProxy&&typeof Proxy<"u"&&typeof Reflect<"u"}x(ko,"isProxyEnabled");function Na(e,t,r){r=r===void 0?function(){}:r,Object.defineProperty(e,t,{get:x(function n(){!ko()&&!U(this,"lockSsfi")&&U(this,"ssfi",n);let o=r.call(this);if(o!==void 0)return o;let i=new h;return Ee(this,i),i},"propertyGetter"),configurable:!0}),Ci.dispatchEvent(new Ia("addProperty",t,r))}x(Na,"addProperty");var Dm=Object.getOwnPropertyDescriptor(function(){},"length");function jo(e,t,r){return Dm.configurable&&Object.defineProperty(e,"length",{get:x(function(){throw Error(r?"Invalid Chai property: "+t+'.length. Due to a compatibility issue, "length" cannot directly follow "'+t+'". Use "'+t+'.lengthOf" instead.':"Invalid Chai property: "+t+'.length. See docs for proper usage of "'+t+'".')},"get")}),e}x(jo,"addLengthGuard");function nf(e){let t=Object.getOwnPropertyNames(e);function r(o){t.indexOf(o)===-1&&t.push(o)}x(r,"addProperty");let n=Object.getPrototypeOf(e);for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r),n=Object.getPrototypeOf(n);return t}x(nf,"getProperties");var As=["__flags","__methods","_obj","assert"];function _t(e,t){return ko()?new Proxy(e,{get:x(function r(n,o){if(typeof o=="string"&&ie.proxyExcludedKeys.indexOf(o)===-1&&!Reflect.has(n,o)){if(t)throw Error("Invalid Chai property: "+t+"."+o+'. See docs for proper usage of "'+t+'".');let i=null,a=4;throw nf(n).forEach(function(s){if(!Object.prototype.hasOwnProperty(s)&&As.indexOf(s)===-1){let l=of(o,s,a);l<a&&(i=s,a=l)}}),Error(i!==null?"Invalid Chai property: "+o+'. Did you mean "'+i+'"?':"Invalid Chai property: "+o)}return As.indexOf(o)===-1&&!U(n,"lockSsfi")&&U(n,"ssfi",r),Reflect.get(n,o)},"proxyGetter")}):e}x(_t,"proxify");function of(e,t,r){if(Math.abs(e.length-t.length)>=r)return r;let n=[];for(let o=0;o<=e.length;o++)n[o]=Array(t.length+1).fill(0),n[o][0]=o;for(let o=0;o<t.length;o++)n[0][o]=o;for(let o=1;o<=e.length;o++){let i=e.charCodeAt(o-1);for(let a=1;a<=t.length;a++){if(Math.abs(o-a)>=r){n[o][a]=r;continue}n[o][a]=Math.min(n[o-1][a]+1,n[o][a-1]+1,n[o-1][a-1]+(i===t.charCodeAt(a-1)?0:1))}}return n[e.length][t.length]}x(of,"stringDistanceCapped");function ka(e,t,r){let n=x(function(){U(this,"lockSsfi")||U(this,"ssfi",n);let o=r.apply(this,arguments);if(o!==void 0)return o;let i=new h;return Ee(this,i),i},"methodWrapper");jo(n,t,!1),e[t]=_t(n,t),Ci.dispatchEvent(new Ia("addMethod",t,r))}x(ka,"addMethod");function ja(e,t,r){let n=Object.getOwnPropertyDescriptor(e,t),o=x(function(){},"_super");n&&typeof n.get=="function"&&(o=n.get),Object.defineProperty(e,t,{get:x(function i(){!ko()&&!U(this,"lockSsfi")&&U(this,"ssfi",i);let a=U(this,"lockSsfi");U(this,"lockSsfi",!0);let s=r(o).call(this);if(U(this,"lockSsfi",a),s!==void 0)return s;let l=new h;return Ee(this,l),l},"overwritingPropertyGetter"),configurable:!0})}x(ja,"overwriteProperty");function Da(e,t,r){let n=e[t],o=x(function(){throw new Error(t+" is not a function")},"_super");n&&typeof n=="function"&&(o=n);let i=x(function(){U(this,"lockSsfi")||U(this,"ssfi",i);let a=U(this,"lockSsfi");U(this,"lockSsfi",!0);let s=r(o).apply(this,arguments);if(U(this,"lockSsfi",a),s!==void 0)return s;let l=new h;return Ee(this,l),l},"overwritingMethodWrapper");jo(i,t,!1),e[t]=_t(i,t)}x(Da,"overwriteMethod");var $m=typeof Object.setPrototypeOf=="function",Ms=x(function(){},"testFn"),Bm=Object.getOwnPropertyNames(Ms).filter(function(e){let t=Object.getOwnPropertyDescriptor(Ms,e);return typeof t!="object"?!0:!t.configurable}),Lm=Function.prototype.call,Fm=Function.prototype.apply,af=class extends Ia{constructor(t,r,n,o){super(t,r,n),this.chainingBehavior=o}};x(af,"PluginAddChainableMethodEvent");var Um=af;function $a(e,t,r,n){typeof n!="function"&&(n=x(function(){},"chainingBehavior"));let o={method:r,chainingBehavior:n};e.__methods||(e.__methods={}),e.__methods[t]=o,Object.defineProperty(e,t,{get:x(function(){o.chainingBehavior.call(this);let a=x(function(){U(this,"lockSsfi")||U(this,"ssfi",a);let s=o.method.apply(this,arguments);if(s!==void 0)return s;let l=new h;return Ee(this,l),l},"chainableMethodWrapper");if(jo(a,t,!0),$m){let s=Object.create(this);s.call=Lm,s.apply=Fm,Object.setPrototypeOf(a,s)}else Object.getOwnPropertyNames(e).forEach(function(l){if(Bm.indexOf(l)!==-1)return;let u=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(a,l,u)});return Ee(this,a),_t(a)},"chainableMethodGetter"),configurable:!0}),Ci.dispatchEvent(new Um("addChainableMethod",t,r,n))}x($a,"addChainableMethod");function Ba(e,t,r,n){let o=e.__methods[t],i=o.chainingBehavior;o.chainingBehavior=x(function(){let l=n(i).call(this);if(l!==void 0)return l;let u=new h;return Ee(this,u),u},"overwritingChainableMethodGetter");let a=o.method;o.method=x(function(){let l=r(a).apply(this,arguments);if(l!==void 0)return l;let u=new h;return Ee(this,u),u},"overwritingChainableMethodWrapper")}x(Ba,"overwriteChainableMethod");function ui(e,t){return H(e)<H(t)?-1:1}x(ui,"compareByInspect");function La(e){return typeof Object.getOwnPropertySymbols!="function"?[]:Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}x(La,"getOwnEnumerablePropertySymbols");function Fa(e){return Object.keys(e).concat(La(e))}x(Fa,"getOwnEnumerableProperties");var ci=Number.isNaN;function sf(e){let t=Q(e);return["Array","Object","Function"].indexOf(t)!==-1}x(sf,"isObjectType");function Ua(e,t){let r=U(e,"operator"),n=U(e,"negate"),o=t[3],i=n?t[2]:t[1];if(r)return r;if(typeof i=="function"&&(i=i()),i=i||"",!i||/\shave\s/.test(i))return;let a=sf(o);return/\snot\s/.test(i)?a?"notDeepStrictEqual":"notStrictEqual":a?"deepStrictEqual":"strictEqual"}x(Ua,"getOperator");function qi(e){return e.name}x(qi,"getName");function di(e){return Object.prototype.toString.call(e)==="[object RegExp]"}x(di,"isRegExp");function ne(e){return["Number","BigInt"].includes(Q(e))}x(ne,"isNumeric");var{flag:w}=ai;["to","be","been","is","and","has","have","with","that","which","at","of","same","but","does","still","also"].forEach(function(e){h.addProperty(e)});h.addProperty("not",function(){w(this,"negate",!0)});h.addProperty("deep",function(){w(this,"deep",!0)});h.addProperty("nested",function(){w(this,"nested",!0)});h.addProperty("own",function(){w(this,"own",!0)});h.addProperty("ordered",function(){w(this,"ordered",!0)});h.addProperty("any",function(){w(this,"any",!0),w(this,"all",!1)});h.addProperty("all",function(){w(this,"all",!0),w(this,"any",!1)});var Os={function:["function","asyncfunction","generatorfunction","asyncgeneratorfunction"],asyncfunction:["asyncfunction","asyncgeneratorfunction"],generatorfunction:["generatorfunction","asyncgeneratorfunction"],asyncgeneratorfunction:["asyncgeneratorfunction"]};function za(e,t){t&&w(this,"message",t),e=e.toLowerCase();let r=w(this,"object"),n=~["a","e","i","o","u"].indexOf(e.charAt(0))?"an ":"a ";const o=Q(r).toLowerCase();Os.function.includes(e)?this.assert(Os[e].includes(o),"expected #{this} to be "+n+e,"expected #{this} not to be "+n+e):this.assert(e===o,"expected #{this} to be "+n+e,"expected #{this} not to be "+n+e)}x(za,"an");h.addChainableMethod("an",za);h.addChainableMethod("a",za);function lf(e,t){return ci(e)&&ci(t)||e===t}x(lf,"SameValueZero");function Do(){w(this,"contains",!0)}x(Do,"includeChainingBehavior");function $o(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=Q(r).toLowerCase(),o=w(this,"message"),i=w(this,"negate"),a=w(this,"ssfi"),s=w(this,"deep"),l=s?"deep ":"",u=s?w(this,"eql"):lf;o=o?o+": ":"";let f=!1;switch(n){case"string":f=r.indexOf(e)!==-1;break;case"weakset":if(s)throw new G(o+"unable to use .deep.include with WeakSet",void 0,a);f=r.has(e);break;case"map":r.forEach(function(c){f=f||u(c,e)});break;case"set":s?r.forEach(function(c){f=f||u(c,e)}):f=r.has(e);break;case"array":s?f=r.some(function(c){return u(c,e)}):f=r.indexOf(e)!==-1;break;default:{if(e!==Object(e))throw new G(o+"the given combination of arguments ("+n+" and "+Q(e).toLowerCase()+") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a "+Q(e).toLowerCase(),void 0,a);let c=Object.keys(e),d=null,b=0;if(c.forEach(function(v){let R=new h(r);if(Ee(this,R,!0),w(R,"lockSsfi",!0),!i||c.length===1){R.property(v,e[v]);return}try{R.property(v,e[v])}catch(S){if(!fe.compatibleConstructor(S,G))throw S;d===null&&(d=S),b++}},this),i&&c.length>1&&b===c.length)throw d;return}}this.assert(f,"expected #{this} to "+l+"include "+H(e),"expected #{this} to not "+l+"include "+H(e))}x($o,"include");h.addChainableMethod("include",$o,Do);h.addChainableMethod("contain",$o,Do);h.addChainableMethod("contains",$o,Do);h.addChainableMethod("includes",$o,Do);h.addProperty("ok",function(){this.assert(w(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")});h.addProperty("true",function(){this.assert(w(this,"object")===!0,"expected #{this} to be true","expected #{this} to be false",!w(this,"negate"))});h.addProperty("numeric",function(){const e=w(this,"object");this.assert(["Number","BigInt"].includes(Q(e)),"expected #{this} to be numeric","expected #{this} to not be numeric",!w(this,"negate"))});h.addProperty("callable",function(){const e=w(this,"object"),t=w(this,"ssfi"),r=w(this,"message"),n=r?`${r}: `:"",o=w(this,"negate"),i=o?`${n}expected ${H(e)} not to be a callable function`:`${n}expected ${H(e)} to be a callable function`,a=["Function","AsyncFunction","GeneratorFunction","AsyncGeneratorFunction"].includes(Q(e));if(a&&o||!a&&!o)throw new G(i,void 0,t)});h.addProperty("false",function(){this.assert(w(this,"object")===!1,"expected #{this} to be false","expected #{this} to be true",!!w(this,"negate"))});h.addProperty("null",function(){this.assert(w(this,"object")===null,"expected #{this} to be null","expected #{this} not to be null")});h.addProperty("undefined",function(){this.assert(w(this,"object")===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined")});h.addProperty("NaN",function(){this.assert(ci(w(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")});function Va(){let e=w(this,"object");this.assert(e!=null,"expected #{this} to exist","expected #{this} to not exist")}x(Va,"assertExist");h.addProperty("exist",Va);h.addProperty("exists",Va);h.addProperty("empty",function(){let e=w(this,"object"),t=w(this,"ssfi"),r=w(this,"message"),n;switch(r=r?r+": ":"",Q(e).toLowerCase()){case"array":case"string":n=e.length;break;case"map":case"set":n=e.size;break;case"weakmap":case"weakset":throw new G(r+".empty was passed a weak collection",void 0,t);case"function":{const o=r+".empty was passed a function "+qi(e);throw new G(o.trim(),void 0,t)}default:if(e!==Object(e))throw new G(r+".empty was passed non-string primitive "+H(e),void 0,t);n=Object.keys(e).length}this.assert(n===0,"expected #{this} to be empty","expected #{this} not to be empty")});function Ha(){let e=w(this,"object"),t=Q(e);this.assert(t==="Arguments","expected #{this} to be arguments but got "+t,"expected #{this} to not be arguments")}x(Ha,"checkArguments");h.addProperty("arguments",Ha);h.addProperty("Arguments",Ha);function _i(e,t){t&&w(this,"message",t);let r=w(this,"object");if(w(this,"deep")){let n=w(this,"lockSsfi");w(this,"lockSsfi",!0),this.eql(e),w(this,"lockSsfi",n)}else this.assert(e===r,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",e,this._obj,!0)}x(_i,"assertEqual");h.addMethod("equal",_i);h.addMethod("equals",_i);h.addMethod("eq",_i);function Wa(e,t){t&&w(this,"message",t);let r=w(this,"eql");this.assert(r(e,w(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",e,this._obj,!0)}x(Wa,"assertEql");h.addMethod("eql",Wa);h.addMethod("eqls",Wa);function Pi(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"doLength"),o=w(this,"message"),i=o?o+": ":"",a=w(this,"ssfi"),s=Q(r).toLowerCase(),l=Q(e).toLowerCase();if(n&&s!=="map"&&s!=="set"&&new h(r,o,a,!0).to.have.property("length"),!n&&s==="date"&&l!=="date")throw new G(i+"the argument to above must be a date",void 0,a);if(!ne(e)&&(n||ne(r)))throw new G(i+"the argument to above must be a number",void 0,a);if(!n&&s!=="date"&&!ne(r)){let u=s==="string"?"'"+r+"'":r;throw new G(i+"expected "+u+" to be a number or a date",void 0,a)}if(n){let u="length",f;s==="map"||s==="set"?(u="size",f=r.size):f=r.length,this.assert(f>e,"expected #{this} to have a "+u+" above #{exp} but got #{act}","expected #{this} to not have a "+u+" above #{exp}",e,f)}else this.assert(r>e,"expected #{this} to be above #{exp}","expected #{this} to be at most #{exp}",e)}x(Pi,"assertAbove");h.addMethod("above",Pi);h.addMethod("gt",Pi);h.addMethod("greaterThan",Pi);function Ti(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"doLength"),o=w(this,"message"),i=o?o+": ":"",a=w(this,"ssfi"),s=Q(r).toLowerCase(),l=Q(e).toLowerCase(),u,f=!0;if(n&&s!=="map"&&s!=="set"&&new h(r,o,a,!0).to.have.property("length"),!n&&s==="date"&&l!=="date")u=i+"the argument to least must be a date";else if(!ne(e)&&(n||ne(r)))u=i+"the argument to least must be a number";else if(!n&&s!=="date"&&!ne(r)){let c=s==="string"?"'"+r+"'":r;u=i+"expected "+c+" to be a number or a date"}else f=!1;if(f)throw new G(u,void 0,a);if(n){let c="length",d;s==="map"||s==="set"?(c="size",d=r.size):d=r.length,this.assert(d>=e,"expected #{this} to have a "+c+" at least #{exp} but got #{act}","expected #{this} to have a "+c+" below #{exp}",e,d)}else this.assert(r>=e,"expected #{this} to be at least #{exp}","expected #{this} to be below #{exp}",e)}x(Ti,"assertLeast");h.addMethod("least",Ti);h.addMethod("gte",Ti);h.addMethod("greaterThanOrEqual",Ti);function Si(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"doLength"),o=w(this,"message"),i=o?o+": ":"",a=w(this,"ssfi"),s=Q(r).toLowerCase(),l=Q(e).toLowerCase(),u,f=!0;if(n&&s!=="map"&&s!=="set"&&new h(r,o,a,!0).to.have.property("length"),!n&&s==="date"&&l!=="date")u=i+"the argument to below must be a date";else if(!ne(e)&&(n||ne(r)))u=i+"the argument to below must be a number";else if(!n&&s!=="date"&&!ne(r)){let c=s==="string"?"'"+r+"'":r;u=i+"expected "+c+" to be a number or a date"}else f=!1;if(f)throw new G(u,void 0,a);if(n){let c="length",d;s==="map"||s==="set"?(c="size",d=r.size):d=r.length,this.assert(d<e,"expected #{this} to have a "+c+" below #{exp} but got #{act}","expected #{this} to not have a "+c+" below #{exp}",e,d)}else this.assert(r<e,"expected #{this} to be below #{exp}","expected #{this} to be at least #{exp}",e)}x(Si,"assertBelow");h.addMethod("below",Si);h.addMethod("lt",Si);h.addMethod("lessThan",Si);function Ai(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"doLength"),o=w(this,"message"),i=o?o+": ":"",a=w(this,"ssfi"),s=Q(r).toLowerCase(),l=Q(e).toLowerCase(),u,f=!0;if(n&&s!=="map"&&s!=="set"&&new h(r,o,a,!0).to.have.property("length"),!n&&s==="date"&&l!=="date")u=i+"the argument to most must be a date";else if(!ne(e)&&(n||ne(r)))u=i+"the argument to most must be a number";else if(!n&&s!=="date"&&!ne(r)){let c=s==="string"?"'"+r+"'":r;u=i+"expected "+c+" to be a number or a date"}else f=!1;if(f)throw new G(u,void 0,a);if(n){let c="length",d;s==="map"||s==="set"?(c="size",d=r.size):d=r.length,this.assert(d<=e,"expected #{this} to have a "+c+" at most #{exp} but got #{act}","expected #{this} to have a "+c+" above #{exp}",e,d)}else this.assert(r<=e,"expected #{this} to be at most #{exp}","expected #{this} to be above #{exp}",e)}x(Ai,"assertMost");h.addMethod("most",Ai);h.addMethod("lte",Ai);h.addMethod("lessThanOrEqual",Ai);h.addMethod("within",function(e,t,r){r&&w(this,"message",r);let n=w(this,"object"),o=w(this,"doLength"),i=w(this,"message"),a=i?i+": ":"",s=w(this,"ssfi"),l=Q(n).toLowerCase(),u=Q(e).toLowerCase(),f=Q(t).toLowerCase(),c,d=!0,b=u==="date"&&f==="date"?e.toISOString()+".."+t.toISOString():e+".."+t;if(o&&l!=="map"&&l!=="set"&&new h(n,i,s,!0).to.have.property("length"),!o&&l==="date"&&(u!=="date"||f!=="date"))c=a+"the arguments to within must be dates";else if((!ne(e)||!ne(t))&&(o||ne(n)))c=a+"the arguments to within must be numbers";else if(!o&&l!=="date"&&!ne(n)){let v=l==="string"?"'"+n+"'":n;c=a+"expected "+v+" to be a number or a date"}else d=!1;if(d)throw new G(c,void 0,s);if(o){let v="length",R;l==="map"||l==="set"?(v="size",R=n.size):R=n.length,this.assert(R>=e&&R<=t,"expected #{this} to have a "+v+" within "+b,"expected #{this} to not have a "+v+" within "+b)}else this.assert(n>=e&&n<=t,"expected #{this} to be within "+b,"expected #{this} to not be within "+b)});function Ga(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"ssfi"),o=w(this,"message"),i;try{i=r instanceof e}catch(s){throw s instanceof TypeError?(o=o?o+": ":"",new G(o+"The instanceof assertion needs a constructor but "+Q(e)+" was given.",void 0,n)):s}let a=qi(e);a==null&&(a="an unnamed constructor"),this.assert(i,"expected #{this} to be an instance of "+a,"expected #{this} to not be an instance of "+a)}x(Ga,"assertInstanceOf");h.addMethod("instanceof",Ga);h.addMethod("instanceOf",Ga);function Ka(e,t,r){r&&w(this,"message",r);let n=w(this,"nested"),o=w(this,"own"),i=w(this,"message"),a=w(this,"object"),s=w(this,"ssfi"),l=typeof e;if(i=i?i+": ":"",n){if(l!=="string")throw new G(i+"the argument to property must be a string when using nested syntax",void 0,s)}else if(l!=="string"&&l!=="number"&&l!=="symbol")throw new G(i+"the argument to property must be a string, number, or symbol",void 0,s);if(n&&o)throw new G(i+'The "nested" and "own" flags cannot be combined.',void 0,s);if(a==null)throw new G(i+"Target cannot be null or undefined.",void 0,s);let u=w(this,"deep"),f=w(this,"negate"),c=n?Oa(a,e):null,d=n?c.value:a[e],b=u?w(this,"eql"):(S,p)=>S===p,v="";u&&(v+="deep "),o&&(v+="own "),n&&(v+="nested "),v+="property ";let R;o?R=Object.prototype.hasOwnProperty.call(a,e):n?R=c.exists:R=xi(a,e),(!f||arguments.length===1)&&this.assert(R,"expected #{this} to have "+v+H(e),"expected #{this} to not have "+v+H(e)),arguments.length>1&&this.assert(R&&b(t,d),"expected #{this} to have "+v+H(e)+" of #{exp}, but got #{act}","expected #{this} to not have "+v+H(e)+" of #{act}",t,d),w(this,"object",d)}x(Ka,"assertProperty");h.addMethod("property",Ka);function Ya(e,t,r){w(this,"own",!0),Ka.apply(this,arguments)}x(Ya,"assertOwnProperty");h.addMethod("ownProperty",Ya);h.addMethod("haveOwnProperty",Ya);function Xa(e,t,r){typeof t=="string"&&(r=t,t=null),r&&w(this,"message",r);let n=w(this,"object"),o=Object.getOwnPropertyDescriptor(Object(n),e),i=w(this,"eql");o&&t?this.assert(i(t,o),"expected the own property descriptor for "+H(e)+" on #{this} to match "+H(t)+", got "+H(o),"expected the own property descriptor for "+H(e)+" on #{this} to not match "+H(t),t,o,!0):this.assert(o,"expected #{this} to have an own property descriptor for "+H(e),"expected #{this} to not have an own property descriptor for "+H(e)),w(this,"object",o)}x(Xa,"assertOwnPropertyDescriptor");h.addMethod("ownPropertyDescriptor",Xa);h.addMethod("haveOwnPropertyDescriptor",Xa);function Ja(){w(this,"doLength",!0)}x(Ja,"assertLengthChain");function Qa(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=Q(r).toLowerCase(),o=w(this,"message"),i=w(this,"ssfi"),a="length",s;switch(n){case"map":case"set":a="size",s=r.size;break;default:new h(r,o,i,!0).to.have.property("length"),s=r.length}this.assert(s==e,"expected #{this} to have a "+a+" of #{exp} but got #{act}","expected #{this} to not have a "+a+" of #{act}",e,s)}x(Qa,"assertLength");h.addChainableMethod("length",Qa,Ja);h.addChainableMethod("lengthOf",Qa,Ja);function Za(e,t){t&&w(this,"message",t);let r=w(this,"object");this.assert(e.exec(r),"expected #{this} to match "+e,"expected #{this} not to match "+e)}x(Za,"assertMatch");h.addMethod("match",Za);h.addMethod("matches",Za);h.addMethod("string",function(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"message"),o=w(this,"ssfi");new h(r,n,o,!0).is.a("string"),this.assert(~r.indexOf(e),"expected #{this} to contain "+H(e),"expected #{this} to not contain "+H(e))});function es(e){let t=w(this,"object"),r=Q(t),n=Q(e),o=w(this,"ssfi"),i=w(this,"deep"),a,s="",l,u=!0,f=w(this,"message");f=f?f+": ":"";let c=f+"when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";if(r==="Map"||r==="Set")s=i?"deeply ":"",l=[],t.forEach(function(p,q){l.push(q)}),n!=="Array"&&(e=Array.prototype.slice.call(arguments));else{switch(l=Fa(t),n){case"Array":if(arguments.length>1)throw new G(c,void 0,o);break;case"Object":if(arguments.length>1)throw new G(c,void 0,o);e=Object.keys(e);break;default:e=Array.prototype.slice.call(arguments)}e=e.map(function(p){return typeof p=="symbol"?p:String(p)})}if(!e.length)throw new G(f+"keys required",void 0,o);let d=e.length,b=w(this,"any"),v=w(this,"all"),R=e,S=i?w(this,"eql"):(p,q)=>p===q;if(!b&&!v&&(v=!0),b&&(u=R.some(function(p){return l.some(function(q){return S(p,q)})})),v&&(u=R.every(function(p){return l.some(function(q){return S(p,q)})}),w(this,"contains")||(u=u&&e.length==l.length)),d>1){e=e.map(function(q){return H(q)});let p=e.pop();v&&(a=e.join(", ")+", and "+p),b&&(a=e.join(", ")+", or "+p)}else a=H(e[0]);a=(d>1?"keys ":"key ")+a,a=(w(this,"contains")?"contain ":"have ")+a,this.assert(u,"expected #{this} to "+s+a,"expected #{this} to not "+s+a,R.slice(0).sort(ui),l.sort(ui),!0)}x(es,"assertKeys");h.addMethod("keys",es);h.addMethod("key",es);function Mi(e,t,r){r&&w(this,"message",r);let n=w(this,"object"),o=w(this,"ssfi"),i=w(this,"message"),a=w(this,"negate")||!1;new h(n,i,o,!0).is.a("function"),(di(e)||typeof e=="string")&&(t=e,e=null);let s,l=!1;try{n()}catch(b){l=!0,s=b}let u=e===void 0&&t===void 0,f=!!(e&&t),c=!1,d=!1;if(u||!u&&!a){let b="an error";e instanceof Error?b="#{exp}":e&&(b=fe.getConstructorName(e));let v=s;if(s instanceof Error)v=s.toString();else if(typeof s=="string")v=s;else if(s&&(typeof s=="object"||typeof s=="function"))try{v=fe.getConstructorName(s)}catch{}this.assert(l,"expected #{this} to throw "+b,"expected #{this} to not throw an error but #{act} was thrown",e&&e.toString(),v)}if(e&&s&&(e instanceof Error&&fe.compatibleInstance(s,e)===a&&(f&&a?c=!0:this.assert(a,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(s&&!a?" but #{act} was thrown":""),e.toString(),s.toString())),fe.compatibleConstructor(s,e)===a&&(f&&a?c=!0:this.assert(a,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(s?" but #{act} was thrown":""),e instanceof Error?e.toString():e&&fe.getConstructorName(e),s instanceof Error?s.toString():s&&fe.getConstructorName(s)))),s&&t!==void 0&&t!==null){let b="including";di(t)&&(b="matching"),fe.compatibleMessage(s,t)===a&&(f&&a?d=!0:this.assert(a,"expected #{this} to throw error "+b+" #{exp} but got #{act}","expected #{this} to throw error not "+b+" #{exp}",t,fe.getMessage(s)))}c&&d&&this.assert(a,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(s?" but #{act} was thrown":""),e instanceof Error?e.toString():e&&fe.getConstructorName(e),s instanceof Error?s.toString():s&&fe.getConstructorName(s)),w(this,"object",s)}x(Mi,"assertThrows");h.addMethod("throw",Mi);h.addMethod("throws",Mi);h.addMethod("Throw",Mi);function ts(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"itself"),o=typeof r=="function"&&!n?r.prototype[e]:r[e];this.assert(typeof o=="function","expected #{this} to respond to "+H(e),"expected #{this} to not respond to "+H(e))}x(ts,"respondTo");h.addMethod("respondTo",ts);h.addMethod("respondsTo",ts);h.addProperty("itself",function(){w(this,"itself",!0)});function rs(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=e(r);this.assert(n,"expected #{this} to satisfy "+st(e),"expected #{this} to not satisfy"+st(e),!w(this,"negate"),n)}x(rs,"satisfy");h.addMethod("satisfy",rs);h.addMethod("satisfies",rs);function ns(e,t,r){r&&w(this,"message",r);let n=w(this,"object"),o=w(this,"message"),i=w(this,"ssfi");new h(n,o,i,!0).is.numeric;let a="A `delta` value is required for `closeTo`";if(t==null)throw new G(o?`${o}: ${a}`:a,void 0,i);if(new h(t,o,i,!0).is.numeric,a="A `expected` value is required for `closeTo`",e==null)throw new G(o?`${o}: ${a}`:a,void 0,i);new h(e,o,i,!0).is.numeric;const s=x(u=>u<0n?-u:u,"abs"),l=x(u=>parseFloat(parseFloat(u).toPrecision(12)),"strip");this.assert(l(s(n-e))<=t,"expected #{this} to be close to "+e+" +/- "+t,"expected #{this} not to be close to "+e+" +/- "+t)}x(ns,"closeTo");h.addMethod("closeTo",ns);h.addMethod("approximately",ns);function uf(e,t,r,n,o){let i=Array.from(t),a=Array.from(e);if(!n){if(a.length!==i.length)return!1;i=i.slice()}return a.every(function(s,l){if(o)return r?r(s,i[l]):s===i[l];if(!r){let u=i.indexOf(s);return u===-1?!1:(n||i.splice(u,1),!0)}return i.some(function(u,f){return r(s,u)?(n||i.splice(f,1),!0):!1})})}x(uf,"isSubsetOf");h.addMethod("members",function(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"message"),o=w(this,"ssfi");new h(r,n,o,!0).to.be.iterable,new h(e,n,o,!0).to.be.iterable;let i=w(this,"contains"),a=w(this,"ordered"),s,l,u;i?(s=a?"an ordered superset":"a superset",l="expected #{this} to be "+s+" of #{exp}",u="expected #{this} to not be "+s+" of #{exp}"):(s=a?"ordered members":"members",l="expected #{this} to have the same "+s+" as #{exp}",u="expected #{this} to not have the same "+s+" as #{exp}");let f=w(this,"deep")?w(this,"eql"):void 0;this.assert(uf(e,r,f,i,a),l,u,e,r,!0)});h.addProperty("iterable",function(e){e&&w(this,"message",e);let t=w(this,"object");this.assert(t!=null&&t[Symbol.iterator],"expected #{this} to be an iterable","expected #{this} to not be an iterable",t)});function cf(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"message"),o=w(this,"ssfi"),i=w(this,"contains"),a=w(this,"deep"),s=w(this,"eql");new h(e,n,o,!0).to.be.an("array"),i?this.assert(e.some(function(l){return r.indexOf(l)>-1}),"expected #{this} to contain one of #{exp}","expected #{this} to not contain one of #{exp}",e,r):a?this.assert(e.some(function(l){return s(r,l)}),"expected #{this} to deeply equal one of #{exp}","expected #{this} to deeply equal one of #{exp}",e,r):this.assert(e.indexOf(r)>-1,"expected #{this} to be one of #{exp}","expected #{this} to not be one of #{exp}",e,r)}x(cf,"oneOf");h.addMethod("oneOf",cf);function os(e,t,r){r&&w(this,"message",r);let n=w(this,"object"),o=w(this,"message"),i=w(this,"ssfi");new h(n,o,i,!0).is.a("function");let a;t?(new h(e,o,i,!0).to.have.property(t),a=e[t]):(new h(e,o,i,!0).is.a("function"),a=e()),n();let s=t==null?e():e[t],l=t==null?a:"."+t;w(this,"deltaMsgObj",l),w(this,"initialDeltaValue",a),w(this,"finalDeltaValue",s),w(this,"deltaBehavior","change"),w(this,"realDelta",s!==a),this.assert(a!==s,"expected "+l+" to change","expected "+l+" to not change")}x(os,"assertChanges");h.addMethod("change",os);h.addMethod("changes",os);function is(e,t,r){r&&w(this,"message",r);let n=w(this,"object"),o=w(this,"message"),i=w(this,"ssfi");new h(n,o,i,!0).is.a("function");let a;t?(new h(e,o,i,!0).to.have.property(t),a=e[t]):(new h(e,o,i,!0).is.a("function"),a=e()),new h(a,o,i,!0).is.a("number"),n();let s=t==null?e():e[t],l=t==null?a:"."+t;w(this,"deltaMsgObj",l),w(this,"initialDeltaValue",a),w(this,"finalDeltaValue",s),w(this,"deltaBehavior","increase"),w(this,"realDelta",s-a),this.assert(s-a>0,"expected "+l+" to increase","expected "+l+" to not increase")}x(is,"assertIncreases");h.addMethod("increase",is);h.addMethod("increases",is);function as(e,t,r){r&&w(this,"message",r);let n=w(this,"object"),o=w(this,"message"),i=w(this,"ssfi");new h(n,o,i,!0).is.a("function");let a;t?(new h(e,o,i,!0).to.have.property(t),a=e[t]):(new h(e,o,i,!0).is.a("function"),a=e()),new h(a,o,i,!0).is.a("number"),n();let s=t==null?e():e[t],l=t==null?a:"."+t;w(this,"deltaMsgObj",l),w(this,"initialDeltaValue",a),w(this,"finalDeltaValue",s),w(this,"deltaBehavior","decrease"),w(this,"realDelta",a-s),this.assert(s-a<0,"expected "+l+" to decrease","expected "+l+" to not decrease")}x(as,"assertDecreases");h.addMethod("decrease",as);h.addMethod("decreases",as);function df(e,t){t&&w(this,"message",t);let r=w(this,"deltaMsgObj"),n=w(this,"initialDeltaValue"),o=w(this,"finalDeltaValue"),i=w(this,"deltaBehavior"),a=w(this,"realDelta"),s;i==="change"?s=Math.abs(o-n)===Math.abs(e):s=a===Math.abs(e),this.assert(s,"expected "+r+" to "+i+" by "+e,"expected "+r+" to not "+i+" by "+e)}x(df,"assertDelta");h.addMethod("by",df);h.addProperty("extensible",function(){let e=w(this,"object"),t=e===Object(e)&&Object.isExtensible(e);this.assert(t,"expected #{this} to be extensible","expected #{this} to not be extensible")});h.addProperty("sealed",function(){let e=w(this,"object"),t=e===Object(e)?Object.isSealed(e):!0;this.assert(t,"expected #{this} to be sealed","expected #{this} to not be sealed")});h.addProperty("frozen",function(){let e=w(this,"object"),t=e===Object(e)?Object.isFrozen(e):!0;this.assert(t,"expected #{this} to be frozen","expected #{this} to not be frozen")});h.addProperty("finite",function(e){let t=w(this,"object");this.assert(typeof t=="number"&&isFinite(t),"expected #{this} to be a finite number","expected #{this} to not be a finite number")});function fi(e,t){return e===t?!0:typeof t!=typeof e?!1:typeof e!="object"||e===null?e===t:t?Array.isArray(e)?Array.isArray(t)?e.every(function(r){return t.some(function(n){return fi(r,n)})}):!1:e instanceof Date?t instanceof Date?e.getTime()===t.getTime():!1:Object.keys(e).every(function(r){let n=e[r],o=t[r];return typeof n=="object"&&n!==null&&o!==null?fi(n,o):typeof n=="function"?n(o):o===n}):!1}x(fi,"compareSubset");h.addMethod("containSubset",function(e){const t=U(this,"object"),r=ie.showDiff;this.assert(fi(e,t),"expected #{act} to contain subset #{exp}","expected #{act} to not contain subset #{exp}",e,t,r)});function Po(e,t){return new h(e,t)}x(Po,"expect");Po.fail=function(e,t,r,n){throw arguments.length<2&&(r=e,e=void 0),r=r||"expect.fail()",new G(r,{actual:e,expected:t,operator:n},Po.fail)};var ff={};qa(ff,{Should:()=>Vm,should:()=>zm});function ss(){function e(){return this instanceof String||this instanceof Number||this instanceof Boolean||typeof Symbol=="function"&&this instanceof Symbol||typeof BigInt=="function"&&this instanceof BigInt?new h(this.valueOf(),null,e):new h(this,null,e)}x(e,"shouldGetter");function t(n){Object.defineProperty(this,"should",{value:n,enumerable:!0,configurable:!0,writable:!0})}x(t,"shouldSetter"),Object.defineProperty(Object.prototype,"should",{set:t,get:e,configurable:!0});let r={};return r.fail=function(n,o,i,a){throw arguments.length<2&&(i=n,n=void 0),i=i||"should.fail()",new G(i,{actual:n,expected:o,operator:a},r.fail)},r.equal=function(n,o,i){new h(n,i).to.equal(o)},r.Throw=function(n,o,i,a){new h(n,a).to.Throw(o,i)},r.exist=function(n,o){new h(n,o).to.exist},r.not={},r.not.equal=function(n,o,i){new h(n,i).to.not.equal(o)},r.not.Throw=function(n,o,i,a){new h(n,a).to.not.Throw(o,i)},r.not.exist=function(n,o){new h(n,o).to.not.exist},r.throw=r.Throw,r.not.throw=r.not.Throw,r}x(ss,"loadShould");var zm=ss,Vm=ss;function m(e,t){new h(null,null,m,!0).assert(e,t,"[ negation message unavailable ]")}x(m,"assert");m.fail=function(e,t,r,n){throw arguments.length<2&&(r=e,e=void 0),r=r||"assert.fail()",new G(r,{actual:e,expected:t,operator:n},m.fail)};m.isOk=function(e,t){new h(e,t,m.isOk,!0).is.ok};m.isNotOk=function(e,t){new h(e,t,m.isNotOk,!0).is.not.ok};m.equal=function(e,t,r){let n=new h(e,r,m.equal,!0);n.assert(t==U(n,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",t,e,!0)};m.notEqual=function(e,t,r){let n=new h(e,r,m.notEqual,!0);n.assert(t!=U(n,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",t,e,!0)};m.strictEqual=function(e,t,r){new h(e,r,m.strictEqual,!0).to.equal(t)};m.notStrictEqual=function(e,t,r){new h(e,r,m.notStrictEqual,!0).to.not.equal(t)};m.deepEqual=m.deepStrictEqual=function(e,t,r){new h(e,r,m.deepEqual,!0).to.eql(t)};m.notDeepEqual=function(e,t,r){new h(e,r,m.notDeepEqual,!0).to.not.eql(t)};m.isAbove=function(e,t,r){new h(e,r,m.isAbove,!0).to.be.above(t)};m.isAtLeast=function(e,t,r){new h(e,r,m.isAtLeast,!0).to.be.least(t)};m.isBelow=function(e,t,r){new h(e,r,m.isBelow,!0).to.be.below(t)};m.isAtMost=function(e,t,r){new h(e,r,m.isAtMost,!0).to.be.most(t)};m.isTrue=function(e,t){new h(e,t,m.isTrue,!0).is.true};m.isNotTrue=function(e,t){new h(e,t,m.isNotTrue,!0).to.not.equal(!0)};m.isFalse=function(e,t){new h(e,t,m.isFalse,!0).is.false};m.isNotFalse=function(e,t){new h(e,t,m.isNotFalse,!0).to.not.equal(!1)};m.isNull=function(e,t){new h(e,t,m.isNull,!0).to.equal(null)};m.isNotNull=function(e,t){new h(e,t,m.isNotNull,!0).to.not.equal(null)};m.isNaN=function(e,t){new h(e,t,m.isNaN,!0).to.be.NaN};m.isNotNaN=function(e,t){new h(e,t,m.isNotNaN,!0).not.to.be.NaN};m.exists=function(e,t){new h(e,t,m.exists,!0).to.exist};m.notExists=function(e,t){new h(e,t,m.notExists,!0).to.not.exist};m.isUndefined=function(e,t){new h(e,t,m.isUndefined,!0).to.equal(void 0)};m.isDefined=function(e,t){new h(e,t,m.isDefined,!0).to.not.equal(void 0)};m.isCallable=function(e,t){new h(e,t,m.isCallable,!0).is.callable};m.isNotCallable=function(e,t){new h(e,t,m.isNotCallable,!0).is.not.callable};m.isObject=function(e,t){new h(e,t,m.isObject,!0).to.be.a("object")};m.isNotObject=function(e,t){new h(e,t,m.isNotObject,!0).to.not.be.a("object")};m.isArray=function(e,t){new h(e,t,m.isArray,!0).to.be.an("array")};m.isNotArray=function(e,t){new h(e,t,m.isNotArray,!0).to.not.be.an("array")};m.isString=function(e,t){new h(e,t,m.isString,!0).to.be.a("string")};m.isNotString=function(e,t){new h(e,t,m.isNotString,!0).to.not.be.a("string")};m.isNumber=function(e,t){new h(e,t,m.isNumber,!0).to.be.a("number")};m.isNotNumber=function(e,t){new h(e,t,m.isNotNumber,!0).to.not.be.a("number")};m.isNumeric=function(e,t){new h(e,t,m.isNumeric,!0).is.numeric};m.isNotNumeric=function(e,t){new h(e,t,m.isNotNumeric,!0).is.not.numeric};m.isFinite=function(e,t){new h(e,t,m.isFinite,!0).to.be.finite};m.isBoolean=function(e,t){new h(e,t,m.isBoolean,!0).to.be.a("boolean")};m.isNotBoolean=function(e,t){new h(e,t,m.isNotBoolean,!0).to.not.be.a("boolean")};m.typeOf=function(e,t,r){new h(e,r,m.typeOf,!0).to.be.a(t)};m.notTypeOf=function(e,t,r){new h(e,r,m.notTypeOf,!0).to.not.be.a(t)};m.instanceOf=function(e,t,r){new h(e,r,m.instanceOf,!0).to.be.instanceOf(t)};m.notInstanceOf=function(e,t,r){new h(e,r,m.notInstanceOf,!0).to.not.be.instanceOf(t)};m.include=function(e,t,r){new h(e,r,m.include,!0).include(t)};m.notInclude=function(e,t,r){new h(e,r,m.notInclude,!0).not.include(t)};m.deepInclude=function(e,t,r){new h(e,r,m.deepInclude,!0).deep.include(t)};m.notDeepInclude=function(e,t,r){new h(e,r,m.notDeepInclude,!0).not.deep.include(t)};m.nestedInclude=function(e,t,r){new h(e,r,m.nestedInclude,!0).nested.include(t)};m.notNestedInclude=function(e,t,r){new h(e,r,m.notNestedInclude,!0).not.nested.include(t)};m.deepNestedInclude=function(e,t,r){new h(e,r,m.deepNestedInclude,!0).deep.nested.include(t)};m.notDeepNestedInclude=function(e,t,r){new h(e,r,m.notDeepNestedInclude,!0).not.deep.nested.include(t)};m.ownInclude=function(e,t,r){new h(e,r,m.ownInclude,!0).own.include(t)};m.notOwnInclude=function(e,t,r){new h(e,r,m.notOwnInclude,!0).not.own.include(t)};m.deepOwnInclude=function(e,t,r){new h(e,r,m.deepOwnInclude,!0).deep.own.include(t)};m.notDeepOwnInclude=function(e,t,r){new h(e,r,m.notDeepOwnInclude,!0).not.deep.own.include(t)};m.match=function(e,t,r){new h(e,r,m.match,!0).to.match(t)};m.notMatch=function(e,t,r){new h(e,r,m.notMatch,!0).to.not.match(t)};m.property=function(e,t,r){new h(e,r,m.property,!0).to.have.property(t)};m.notProperty=function(e,t,r){new h(e,r,m.notProperty,!0).to.not.have.property(t)};m.propertyVal=function(e,t,r,n){new h(e,n,m.propertyVal,!0).to.have.property(t,r)};m.notPropertyVal=function(e,t,r,n){new h(e,n,m.notPropertyVal,!0).to.not.have.property(t,r)};m.deepPropertyVal=function(e,t,r,n){new h(e,n,m.deepPropertyVal,!0).to.have.deep.property(t,r)};m.notDeepPropertyVal=function(e,t,r,n){new h(e,n,m.notDeepPropertyVal,!0).to.not.have.deep.property(t,r)};m.ownProperty=function(e,t,r){new h(e,r,m.ownProperty,!0).to.have.own.property(t)};m.notOwnProperty=function(e,t,r){new h(e,r,m.notOwnProperty,!0).to.not.have.own.property(t)};m.ownPropertyVal=function(e,t,r,n){new h(e,n,m.ownPropertyVal,!0).to.have.own.property(t,r)};m.notOwnPropertyVal=function(e,t,r,n){new h(e,n,m.notOwnPropertyVal,!0).to.not.have.own.property(t,r)};m.deepOwnPropertyVal=function(e,t,r,n){new h(e,n,m.deepOwnPropertyVal,!0).to.have.deep.own.property(t,r)};m.notDeepOwnPropertyVal=function(e,t,r,n){new h(e,n,m.notDeepOwnPropertyVal,!0).to.not.have.deep.own.property(t,r)};m.nestedProperty=function(e,t,r){new h(e,r,m.nestedProperty,!0).to.have.nested.property(t)};m.notNestedProperty=function(e,t,r){new h(e,r,m.notNestedProperty,!0).to.not.have.nested.property(t)};m.nestedPropertyVal=function(e,t,r,n){new h(e,n,m.nestedPropertyVal,!0).to.have.nested.property(t,r)};m.notNestedPropertyVal=function(e,t,r,n){new h(e,n,m.notNestedPropertyVal,!0).to.not.have.nested.property(t,r)};m.deepNestedPropertyVal=function(e,t,r,n){new h(e,n,m.deepNestedPropertyVal,!0).to.have.deep.nested.property(t,r)};m.notDeepNestedPropertyVal=function(e,t,r,n){new h(e,n,m.notDeepNestedPropertyVal,!0).to.not.have.deep.nested.property(t,r)};m.lengthOf=function(e,t,r){new h(e,r,m.lengthOf,!0).to.have.lengthOf(t)};m.hasAnyKeys=function(e,t,r){new h(e,r,m.hasAnyKeys,!0).to.have.any.keys(t)};m.hasAllKeys=function(e,t,r){new h(e,r,m.hasAllKeys,!0).to.have.all.keys(t)};m.containsAllKeys=function(e,t,r){new h(e,r,m.containsAllKeys,!0).to.contain.all.keys(t)};m.doesNotHaveAnyKeys=function(e,t,r){new h(e,r,m.doesNotHaveAnyKeys,!0).to.not.have.any.keys(t)};m.doesNotHaveAllKeys=function(e,t,r){new h(e,r,m.doesNotHaveAllKeys,!0).to.not.have.all.keys(t)};m.hasAnyDeepKeys=function(e,t,r){new h(e,r,m.hasAnyDeepKeys,!0).to.have.any.deep.keys(t)};m.hasAllDeepKeys=function(e,t,r){new h(e,r,m.hasAllDeepKeys,!0).to.have.all.deep.keys(t)};m.containsAllDeepKeys=function(e,t,r){new h(e,r,m.containsAllDeepKeys,!0).to.contain.all.deep.keys(t)};m.doesNotHaveAnyDeepKeys=function(e,t,r){new h(e,r,m.doesNotHaveAnyDeepKeys,!0).to.not.have.any.deep.keys(t)};m.doesNotHaveAllDeepKeys=function(e,t,r){new h(e,r,m.doesNotHaveAllDeepKeys,!0).to.not.have.all.deep.keys(t)};m.throws=function(e,t,r,n){(typeof t=="string"||t instanceof RegExp)&&(r=t,t=null);let o=new h(e,n,m.throws,!0).to.throw(t,r);return U(o,"object")};m.doesNotThrow=function(e,t,r,n){(typeof t=="string"||t instanceof RegExp)&&(r=t,t=null),new h(e,n,m.doesNotThrow,!0).to.not.throw(t,r)};m.operator=function(e,t,r,n){let o;switch(t){case"==":o=e==r;break;case"===":o=e===r;break;case">":o=e>r;break;case">=":o=e>=r;break;case"<":o=e<r;break;case"<=":o=e<=r;break;case"!=":o=e!=r;break;case"!==":o=e!==r;break;default:throw n=n&&n+": ",new G(n+'Invalid operator "'+t+'"',void 0,m.operator)}let i=new h(o,n,m.operator,!0);i.assert(U(i,"object")===!0,"expected "+H(e)+" to be "+t+" "+H(r),"expected "+H(e)+" to not be "+t+" "+H(r))};m.closeTo=function(e,t,r,n){new h(e,n,m.closeTo,!0).to.be.closeTo(t,r)};m.approximately=function(e,t,r,n){new h(e,n,m.approximately,!0).to.be.approximately(t,r)};m.sameMembers=function(e,t,r){new h(e,r,m.sameMembers,!0).to.have.same.members(t)};m.notSameMembers=function(e,t,r){new h(e,r,m.notSameMembers,!0).to.not.have.same.members(t)};m.sameDeepMembers=function(e,t,r){new h(e,r,m.sameDeepMembers,!0).to.have.same.deep.members(t)};m.notSameDeepMembers=function(e,t,r){new h(e,r,m.notSameDeepMembers,!0).to.not.have.same.deep.members(t)};m.sameOrderedMembers=function(e,t,r){new h(e,r,m.sameOrderedMembers,!0).to.have.same.ordered.members(t)};m.notSameOrderedMembers=function(e,t,r){new h(e,r,m.notSameOrderedMembers,!0).to.not.have.same.ordered.members(t)};m.sameDeepOrderedMembers=function(e,t,r){new h(e,r,m.sameDeepOrderedMembers,!0).to.have.same.deep.ordered.members(t)};m.notSameDeepOrderedMembers=function(e,t,r){new h(e,r,m.notSameDeepOrderedMembers,!0).to.not.have.same.deep.ordered.members(t)};m.includeMembers=function(e,t,r){new h(e,r,m.includeMembers,!0).to.include.members(t)};m.notIncludeMembers=function(e,t,r){new h(e,r,m.notIncludeMembers,!0).to.not.include.members(t)};m.includeDeepMembers=function(e,t,r){new h(e,r,m.includeDeepMembers,!0).to.include.deep.members(t)};m.notIncludeDeepMembers=function(e,t,r){new h(e,r,m.notIncludeDeepMembers,!0).to.not.include.deep.members(t)};m.includeOrderedMembers=function(e,t,r){new h(e,r,m.includeOrderedMembers,!0).to.include.ordered.members(t)};m.notIncludeOrderedMembers=function(e,t,r){new h(e,r,m.notIncludeOrderedMembers,!0).to.not.include.ordered.members(t)};m.includeDeepOrderedMembers=function(e,t,r){new h(e,r,m.includeDeepOrderedMembers,!0).to.include.deep.ordered.members(t)};m.notIncludeDeepOrderedMembers=function(e,t,r){new h(e,r,m.notIncludeDeepOrderedMembers,!0).to.not.include.deep.ordered.members(t)};m.oneOf=function(e,t,r){new h(e,r,m.oneOf,!0).to.be.oneOf(t)};m.isIterable=function(e,t){if(e==null||!e[Symbol.iterator])throw t=t?`${t} expected ${H(e)} to be an iterable`:`expected ${H(e)} to be an iterable`,new G(t,void 0,m.isIterable)};m.changes=function(e,t,r,n){arguments.length===3&&typeof t=="function"&&(n=r,r=null),new h(e,n,m.changes,!0).to.change(t,r)};m.changesBy=function(e,t,r,n,o){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,o=i}else arguments.length===3&&(n=r,r=null);new h(e,o,m.changesBy,!0).to.change(t,r).by(n)};m.doesNotChange=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new h(e,n,m.doesNotChange,!0).to.not.change(t,r)};m.changesButNotBy=function(e,t,r,n,o){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,o=i}else arguments.length===3&&(n=r,r=null);new h(e,o,m.changesButNotBy,!0).to.change(t,r).but.not.by(n)};m.increases=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new h(e,n,m.increases,!0).to.increase(t,r)};m.increasesBy=function(e,t,r,n,o){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,o=i}else arguments.length===3&&(n=r,r=null);new h(e,o,m.increasesBy,!0).to.increase(t,r).by(n)};m.doesNotIncrease=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new h(e,n,m.doesNotIncrease,!0).to.not.increase(t,r)};m.increasesButNotBy=function(e,t,r,n,o){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,o=i}else arguments.length===3&&(n=r,r=null);new h(e,o,m.increasesButNotBy,!0).to.increase(t,r).but.not.by(n)};m.decreases=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new h(e,n,m.decreases,!0).to.decrease(t,r)};m.decreasesBy=function(e,t,r,n,o){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,o=i}else arguments.length===3&&(n=r,r=null);new h(e,o,m.decreasesBy,!0).to.decrease(t,r).by(n)};m.doesNotDecrease=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new h(e,n,m.doesNotDecrease,!0).to.not.decrease(t,r)};m.doesNotDecreaseBy=function(e,t,r,n,o){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,o=i}else arguments.length===3&&(n=r,r=null);return new h(e,o,m.doesNotDecreaseBy,!0).to.not.decrease(t,r).by(n)};m.decreasesButNotBy=function(e,t,r,n,o){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,o=i}else arguments.length===3&&(n=r,r=null);new h(e,o,m.decreasesButNotBy,!0).to.decrease(t,r).but.not.by(n)};m.ifError=function(e){if(e)throw e};m.isExtensible=function(e,t){new h(e,t,m.isExtensible,!0).to.be.extensible};m.isNotExtensible=function(e,t){new h(e,t,m.isNotExtensible,!0).to.not.be.extensible};m.isSealed=function(e,t){new h(e,t,m.isSealed,!0).to.be.sealed};m.isNotSealed=function(e,t){new h(e,t,m.isNotSealed,!0).to.not.be.sealed};m.isFrozen=function(e,t){new h(e,t,m.isFrozen,!0).to.be.frozen};m.isNotFrozen=function(e,t){new h(e,t,m.isNotFrozen,!0).to.not.be.frozen};m.isEmpty=function(e,t){new h(e,t,m.isEmpty,!0).to.be.empty};m.isNotEmpty=function(e,t){new h(e,t,m.isNotEmpty,!0).to.not.be.empty};m.containsSubset=function(e,t,r){new h(e,r).to.containSubset(t)};m.doesNotContainSubset=function(e,t,r){new h(e,r).to.not.containSubset(t)};var Hm=[["isOk","ok"],["isNotOk","notOk"],["throws","throw"],["throws","Throw"],["isExtensible","extensible"],["isNotExtensible","notExtensible"],["isSealed","sealed"],["isNotSealed","notSealed"],["isFrozen","frozen"],["isNotFrozen","notFrozen"],["isEmpty","empty"],["isNotEmpty","notEmpty"],["isCallable","isFunction"],["isNotCallable","isNotFunction"],["containsSubset","containSubset"]];for(const[e,t]of Hm)m[t]=m[e];var Is=[];function pf(e){const t={use:pf,AssertionError:G,util:ai,config:ie,expect:Po,assert:m,Assertion:h,...ff};return~Is.indexOf(e)||(e(t,ai),Is.push(e)),t}x(pf,"use");function Wm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const Gm=e=>{const t=new Map,r=[];for(const n of e)t.set(n.id,{...n,childrenNodes:[]});for(const n of t.values())n.parent?t.get(n.parent)?.childrenNodes?.push(n):r.push(n);return r},Km={animation:"spin 1s linear infinite"},Ym=()=>B.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#364153",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle-icon lucide-loader-circle",style:Km,"data-testid":"loader-icon",children:B.jsxRuntimeExports.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),zo=document.createElement("style");zo&&!document.getElementById("loader-spin-keyframes")&&(zo.id="loader-spin-keyframes",zo.innerHTML=`
|
|
3
3
|
@keyframes spin {
|
|
4
4
|
0% { transform: rotate(0deg); }
|
package/dist/index.es.js
CHANGED
|
@@ -213,7 +213,7 @@ const hm = {
|
|
|
213
213
|
}, we = (e) => {
|
|
214
214
|
const t = ri.size ? Array.from(ri.values()).find((r) => r.status === "running") : null;
|
|
215
215
|
t && t.logs?.push(e);
|
|
216
|
-
}, Ca = "1.3.
|
|
216
|
+
}, Ca = "1.3.2", bm = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
|
|
217
217
|
rules: []
|
|
218
218
|
}), window.__TWD_MOCK_STATE__) : {
|
|
219
219
|
rules: []
|
package/dist/mock-sw.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const h=e=>{try{return new RegExp(e),!0}catch{return!1}},u=e=>{const s=e.split("?")[0];return/\.([a-zA-Z0-9]+)$/.test(s)};function f(e,s,n){return n.find(t=>{const o=t.method.toLowerCase()===e.toLowerCase();if(t.urlRegex&&h(t.url)){const a=new RegExp(t.url);return o&&a.test(s)}if(u(t.url))return o&&s.includes(t.url);const l=t.url===s||s.includes(t.url);return o&&l&&!u(s)})}function p(e,s,n){e.forEach(t=>t.postMessage({type:"EXECUTED",alias:s.alias,request:n}))}const y=(e,s,n)=>{const o=![204,205,304].includes(s),i=o?JSON.stringify(e):null;return new Response(i,{status:s,headers:o?n||{"Content-Type":"application/json"}:n||{}})},c="1.3.
|
|
1
|
+
const h=e=>{try{return new RegExp(e),!0}catch{return!1}},u=e=>{const s=e.split("?")[0];return/\.([a-zA-Z0-9]+)$/.test(s)};function f(e,s,n){return n.find(t=>{const o=t.method.toLowerCase()===e.toLowerCase();if(t.urlRegex&&h(t.url)){const a=new RegExp(t.url);return o&&a.test(s)}if(u(t.url))return o&&s.includes(t.url);const l=t.url===s||s.includes(t.url);return o&&l&&!u(s)})}function p(e,s,n){e.forEach(t=>t.postMessage({type:"EXECUTED",alias:s.alias,request:n}))}const y=(e,s,n)=>{const o=![204,205,304].includes(s),i=o?JSON.stringify(e):null;return new Response(i,{status:s,headers:o?n||{"Content-Type":"application/json"}:n||{}})},c="1.3.2";let r=[];const g=async e=>{const{method:s}=e.request,n=e.request.url,t=f(s,n,r);t&&(console.log("[TWD] Mock hit:",t.alias,s,n),e.respondWith((async()=>{let o=null;const i=e.request.headers.get("content-type")||"application/json";if(i.includes("application/json"))try{o=await e.request.clone().json()}catch{}else if(i.includes("form"))try{const l=await e.request.clone().formData();o={},l.forEach((a,d)=>{o[d]=a})}catch{}else if(i.includes("text"))try{o=await e.request.clone().text()}catch{}else if(i.includes("octet-stream"))try{o=await e.request.clone().arrayBuffer()}catch{}else if(i.includes("image"))try{o=await e.request.clone().blob()}catch{}else try{o=await e.request.clone().text()}catch{}return self.clients.matchAll().then(l=>{p(l,t,o)}),y(t.response,t.status??200,t.responseHeaders)})()))},m=e=>{e!==c&&console.warn(`[TWD] ⚠️ Version mismatch detected:
|
|
2
2
|
Client version: ${e}
|
|
3
3
|
Service Worker version: ${c}
|
|
4
4
|
|