twd-js 1.6.5 → 1.6.6
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.es.js +769 -720
- package/dist/index.cjs.js +260 -38
- package/dist/index.es.js +2614 -2514
- package/dist/mock-sw.js +1 -1
- package/package.json +1 -1
package/dist/bundled.es.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
function
|
|
1
|
+
var re, w, Be, nt, M, be, De, Pe, ae, J, P, Fe, fe, ce, ue, st, Y = {}, Z = [], ot = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ne = Array.isArray;
|
|
2
|
+
function I(e, t) {
|
|
3
3
|
for (var r in t) e[r] = t[r];
|
|
4
4
|
return e;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function he(e) {
|
|
7
7
|
e && e.parentNode && e.parentNode.removeChild(e);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
var n,
|
|
11
|
-
for (
|
|
12
|
-
if (arguments.length > 2 && (l.children = arguments.length > 3 ?
|
|
13
|
-
return
|
|
9
|
+
function it(e, t, r) {
|
|
10
|
+
var n, s, o, l = {};
|
|
11
|
+
for (o in t) o == "key" ? n = t[o] : o == "ref" ? s = t[o] : l[o] = t[o];
|
|
12
|
+
if (arguments.length > 2 && (l.children = arguments.length > 3 ? re.call(arguments, 2) : r), typeof e == "function" && e.defaultProps != null) for (o in e.defaultProps) l[o] === void 0 && (l[o] = e.defaultProps[o]);
|
|
13
|
+
return K(e, l, n, s, null);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
var
|
|
15
|
+
function K(e, t, r, n, s) {
|
|
16
|
+
var o = {
|
|
17
17
|
type: e,
|
|
18
18
|
props: t,
|
|
19
19
|
key: r,
|
|
@@ -24,88 +24,88 @@ function Q(e, t, r, n, o) {
|
|
|
24
24
|
__e: null,
|
|
25
25
|
__c: null,
|
|
26
26
|
constructor: void 0,
|
|
27
|
-
__v:
|
|
27
|
+
__v: s ?? ++Be,
|
|
28
28
|
__i: -1,
|
|
29
29
|
__u: 0
|
|
30
30
|
};
|
|
31
|
-
return
|
|
31
|
+
return s == null && w.vnode != null && w.vnode(o), o;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function q(e) {
|
|
34
34
|
return e.children;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function X(e, t) {
|
|
37
37
|
this.props = e, this.context = t;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
if (t == null) return e.__ ?
|
|
39
|
+
function W(e, t) {
|
|
40
|
+
if (t == null) return e.__ ? W(e.__, e.__i + 1) : null;
|
|
41
41
|
for (var r; t < e.__k.length; t++) if ((r = e.__k[t]) != null && r.__e != null) return r.__e;
|
|
42
|
-
return typeof e.type == "function" ?
|
|
42
|
+
return typeof e.type == "function" ? W(e) : null;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function at(e) {
|
|
45
45
|
if (e.__P && e.__d) {
|
|
46
|
-
var t = e.__v, r = t.__e, n = [],
|
|
47
|
-
|
|
46
|
+
var t = e.__v, r = t.__e, n = [], s = [], o = I({}, t);
|
|
47
|
+
o.__v = t.__v + 1, w.vnode && w.vnode(o), ge(e.__P, o, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [r] : null, n, r ?? W(t), !!(32 & t.__u), s), o.__v = t.__v, o.__.__k[o.__i] = o, qe(n, o, s), t.__e = t.__ = null, o.__e != r && Oe(o);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Oe(e) {
|
|
51
51
|
if ((e = e.__) != null && e.__c != null) return e.__e = e.__c.base = null, e.__k.some(function(t) {
|
|
52
52
|
if (t != null && t.__e != null) return e.__e = e.__c.base = t.__e;
|
|
53
|
-
}),
|
|
53
|
+
}), Oe(e);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
(!e.__d && (e.__d = !0) && M.push(e) && !
|
|
55
|
+
function ke(e) {
|
|
56
|
+
(!e.__d && (e.__d = !0) && M.push(e) && !ee.__r++ || be != w.debounceRendering) && ((be = w.debounceRendering) || De)(ee);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function ee() {
|
|
59
59
|
try {
|
|
60
|
-
for (var e, t = 1; M.length; ) M.length > t && M.sort(
|
|
60
|
+
for (var e, t = 1; M.length; ) M.length > t && M.sort(Pe), e = M.shift(), t = M.length, at(e);
|
|
61
61
|
} finally {
|
|
62
|
-
M.length =
|
|
62
|
+
M.length = ee.__r = 0;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
var i,
|
|
67
|
-
for (u =
|
|
65
|
+
function je(e, t, r, n, s, o, l, c, u, a, _) {
|
|
66
|
+
var i, f, p, y, C, k, g, m = n && n.__k || Z, R = t.length;
|
|
67
|
+
for (u = lt(r, t, m, u, R), i = 0; i < R; i++) (p = r.__k[i]) != null && (f = p.__i != -1 && m[p.__i] || Y, p.__i = i, k = ge(e, p, f, s, o, l, c, u, a, _), y = p.__e, p.ref && f.ref != p.ref && (f.ref && me(f.ref, null, p), _.push(p.ref, p.__c || y, p)), C == null && y != null && (C = y), (g = !!(4 & p.__u)) || f.__k === p.__k ? (u = Ue(p, u, e, g), g && f.__e && (f.__e = null)) : typeof p.type == "function" && k !== void 0 ? u = k : y && (u = y.nextSibling), p.__u &= -7);
|
|
68
68
|
return r.__e = C, u;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
var
|
|
72
|
-
for (e.__k = new Array(
|
|
73
|
-
if (i) for (
|
|
70
|
+
function lt(e, t, r, n, s) {
|
|
71
|
+
var o, l, c, u, a, _ = r.length, i = _, f = 0;
|
|
72
|
+
for (e.__k = new Array(s), o = 0; o < s; o++) (l = t[o]) != null && typeof l != "boolean" && typeof l != "function" ? (typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? l = e.__k[o] = K(null, l, null, null, null) : ne(l) ? l = e.__k[o] = K(q, { children: l }, null, null, null) : l.constructor === void 0 && l.__b > 0 ? l = e.__k[o] = K(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : e.__k[o] = l, u = o + f, l.__ = e, l.__b = e.__b + 1, c = null, (a = l.__i = dt(l, r, u, i)) != -1 && (i--, (c = r[a]) && (c.__u |= 2)), c == null || c.__v == null ? (a == -1 && (s > _ ? f-- : s < _ && f++), typeof l.type != "function" && (l.__u |= 4)) : a != u && (a == u - 1 ? f-- : a == u + 1 ? f++ : (a > u ? f-- : f++, l.__u |= 4))) : e.__k[o] = null;
|
|
73
|
+
if (i) for (o = 0; o < _; o++) (c = r[o]) != null && (2 & c.__u) == 0 && (c.__e == n && (n = W(c)), Je(c, c));
|
|
74
74
|
return n;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
var
|
|
76
|
+
function Ue(e, t, r, n) {
|
|
77
|
+
var s, o;
|
|
78
78
|
if (typeof e.type == "function") {
|
|
79
|
-
for (
|
|
79
|
+
for (s = e.__k, o = 0; s && o < s.length; o++) s[o] && (s[o].__ = e, t = Ue(s[o], t, r, n));
|
|
80
80
|
return t;
|
|
81
81
|
}
|
|
82
|
-
e.__e != t && (n && (t && e.type && !t.parentNode && (t =
|
|
82
|
+
e.__e != t && (n && (t && e.type && !t.parentNode && (t = W(e)), r.insertBefore(e.__e, t || null)), t = e.__e);
|
|
83
83
|
do
|
|
84
84
|
t = t && t.nextSibling;
|
|
85
85
|
while (t != null && t.nodeType == 8);
|
|
86
86
|
return t;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
var
|
|
90
|
-
if (a === null &&
|
|
91
|
-
if (n > (
|
|
92
|
-
for (
|
|
88
|
+
function dt(e, t, r, n) {
|
|
89
|
+
var s, o, l, c = e.key, u = e.type, a = t[r], _ = a != null && (2 & a.__u) == 0;
|
|
90
|
+
if (a === null && c == null || _ && c == a.key && u == a.type) return r;
|
|
91
|
+
if (n > (_ ? 1 : 0)) {
|
|
92
|
+
for (s = r - 1, o = r + 1; s >= 0 || o < t.length; ) if ((a = t[l = s >= 0 ? s-- : o++]) != null && (2 & a.__u) == 0 && c == a.key && u == a.type) return l;
|
|
93
93
|
}
|
|
94
94
|
return -1;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
t[0] == "-" ? e.setProperty(t, r ?? "") : e[t] = r == null ? "" : typeof r != "number" ||
|
|
96
|
+
function xe(e, t, r) {
|
|
97
|
+
t[0] == "-" ? e.setProperty(t, r ?? "") : e[t] = r == null ? "" : typeof r != "number" || ot.test(t) ? r : r + "px";
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
var
|
|
99
|
+
function V(e, t, r, n, s) {
|
|
100
|
+
var o, l;
|
|
101
101
|
e: if (t == "style") if (typeof r == "string") e.style.cssText = r;
|
|
102
102
|
else {
|
|
103
|
-
if (typeof n == "string" && (e.style.cssText = n = ""), n) for (t in n) r && t in r ||
|
|
104
|
-
if (r) for (t in r) n && r[t] == n[t] ||
|
|
103
|
+
if (typeof n == "string" && (e.style.cssText = n = ""), n) for (t in n) r && t in r || xe(e.style, t, "");
|
|
104
|
+
if (r) for (t in r) n && r[t] == n[t] || xe(e.style, t, r[t]);
|
|
105
105
|
}
|
|
106
|
-
else if (t[0] == "o" && t[1] == "n")
|
|
106
|
+
else if (t[0] == "o" && t[1] == "n") o = t != (t = t.replace(Fe, "$1")), l = t.toLowerCase(), t = l in e || t == "onFocusOut" || t == "onFocusIn" ? l.slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + o] = r, r ? n ? r[P] = n[P] : (r[P] = fe, e.addEventListener(t, o ? ue : ce, o)) : e.removeEventListener(t, o ? ue : ce, o);
|
|
107
107
|
else {
|
|
108
|
-
if (
|
|
108
|
+
if (s == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
109
109
|
else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
|
|
110
110
|
e[t] = r ?? "";
|
|
111
111
|
break e;
|
|
@@ -114,141 +114,141 @@ function K(e, t, r, n, o) {
|
|
|
114
114
|
typeof r == "function" || (r == null || r === !1 && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && r == 1 ? "" : r));
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function Se(e) {
|
|
118
118
|
return function(t) {
|
|
119
119
|
if (this.l) {
|
|
120
120
|
var r = this.l[t.type + e];
|
|
121
|
-
if (t[
|
|
122
|
-
else if (t[
|
|
123
|
-
return r(
|
|
121
|
+
if (t[J] == null) t[J] = fe++;
|
|
122
|
+
else if (t[J] < r[P]) return;
|
|
123
|
+
return r(w.event ? w.event(t) : t);
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
var
|
|
127
|
+
function ge(e, t, r, n, s, o, l, c, u, a) {
|
|
128
|
+
var _, i, f, p, y, C, k, g, m, R, N, z, h, b, $, E = t.type;
|
|
129
129
|
if (t.constructor !== void 0) return null;
|
|
130
|
-
128 & r.__u && (u = !!(32 & r.__u),
|
|
130
|
+
128 & r.__u && (u = !!(32 & r.__u), o = [c = t.__e = r.__e]), (_ = w.__b) && _(t);
|
|
131
131
|
e: if (typeof E == "function") try {
|
|
132
|
-
if (g = t.props,
|
|
132
|
+
if (g = t.props, m = E.prototype && E.prototype.render, R = (_ = E.contextType) && n[_.__c], N = _ ? R ? R.props.value : _.__ : n, r.__c ? k = (i = t.__c = r.__c).__ = i.__E : (m ? t.__c = i = new E(g, N) : (t.__c = i = new X(g, N), i.constructor = E, i.render = ut), R && R.sub(i), i.state || (i.state = {}), i.__n = n, f = i.__d = !0, i.__h = [], i._sb = []), m && i.__s == null && (i.__s = i.state), m && E.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = I({}, i.__s)), I(i.__s, E.getDerivedStateFromProps(g, i.__s))), p = i.props, y = i.state, i.__v = t, f) m && E.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), m && i.componentDidMount != null && i.__h.push(i.componentDidMount);
|
|
133
133
|
else {
|
|
134
|
-
if (
|
|
135
|
-
t.__v != r.__v && (i.props = g, i.state = i.__s, i.__d = !1), t.__e = r.__e, t.__k = r.__k, t.__k.some(function(
|
|
136
|
-
|
|
137
|
-
}),
|
|
134
|
+
if (m && E.getDerivedStateFromProps == null && g !== p && i.componentWillReceiveProps != null && i.componentWillReceiveProps(g, N), t.__v == r.__v || !i.__e && i.shouldComponentUpdate != null && i.shouldComponentUpdate(g, i.__s, N) === !1) {
|
|
135
|
+
t.__v != r.__v && (i.props = g, i.state = i.__s, i.__d = !1), t.__e = r.__e, t.__k = r.__k, t.__k.some(function(L) {
|
|
136
|
+
L && (L.__ = t);
|
|
137
|
+
}), Z.push.apply(i.__h, i._sb), i._sb = [], i.__h.length && l.push(i);
|
|
138
138
|
break e;
|
|
139
139
|
}
|
|
140
|
-
i.componentWillUpdate != null && i.componentWillUpdate(g, i.__s,
|
|
141
|
-
i.componentDidUpdate(p,
|
|
140
|
+
i.componentWillUpdate != null && i.componentWillUpdate(g, i.__s, N), m && i.componentDidUpdate != null && i.__h.push(function() {
|
|
141
|
+
i.componentDidUpdate(p, y, C);
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
-
if (i.context =
|
|
144
|
+
if (i.context = N, i.props = g, i.__P = e, i.__e = !1, z = w.__r, h = 0, m) i.state = i.__s, i.__d = !1, z && z(t), _ = i.render(i.props, i.state, i.context), Z.push.apply(i.__h, i._sb), i._sb = [];
|
|
145
145
|
else do
|
|
146
|
-
i.__d = !1, z && z(t),
|
|
146
|
+
i.__d = !1, z && z(t), _ = i.render(i.props, i.state, i.context), i.state = i.__s;
|
|
147
147
|
while (i.__d && ++h < 25);
|
|
148
|
-
i.state = i.__s, i.getChildContext != null && (n =
|
|
149
|
-
} catch (
|
|
150
|
-
if (t.__v = null, u ||
|
|
151
|
-
for (t.__u |= u ? 160 : 128;
|
|
152
|
-
|
|
148
|
+
i.state = i.__s, i.getChildContext != null && (n = I(I({}, n), i.getChildContext())), m && !f && i.getSnapshotBeforeUpdate != null && (C = i.getSnapshotBeforeUpdate(p, y)), b = _ != null && _.type === q && _.key == null ? Ve(_.props.children) : _, c = je(e, ne(b) ? b : [b], t, r, n, s, o, l, c, u, a), i.base = t.__e, t.__u &= -161, i.__h.length && l.push(i), k && (i.__E = i.__ = null);
|
|
149
|
+
} catch (L) {
|
|
150
|
+
if (t.__v = null, u || o != null) if (L.then) {
|
|
151
|
+
for (t.__u |= u ? 160 : 128; c && c.nodeType == 8 && c.nextSibling; ) c = c.nextSibling;
|
|
152
|
+
o[o.indexOf(c)] = null, t.__e = c;
|
|
153
153
|
} else {
|
|
154
|
-
for (
|
|
155
|
-
|
|
154
|
+
for ($ = o.length; $--; ) he(o[$]);
|
|
155
|
+
_e(t);
|
|
156
156
|
}
|
|
157
|
-
else t.__e = r.__e, t.__k = r.__k,
|
|
158
|
-
|
|
157
|
+
else t.__e = r.__e, t.__k = r.__k, L.then || _e(t);
|
|
158
|
+
w.__e(L, t, r);
|
|
159
159
|
}
|
|
160
|
-
else
|
|
161
|
-
return (
|
|
160
|
+
else o == null && t.__v == r.__v ? (t.__k = r.__k, t.__e = r.__e) : c = t.__e = ct(r.__e, t, r, n, s, o, l, u, a);
|
|
161
|
+
return (_ = w.diffed) && _(t), 128 & t.__u ? void 0 : c;
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(
|
|
163
|
+
function _e(e) {
|
|
164
|
+
e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(_e));
|
|
165
165
|
}
|
|
166
|
-
function
|
|
167
|
-
for (var n = 0; n < r.length; n++)
|
|
168
|
-
|
|
166
|
+
function qe(e, t, r) {
|
|
167
|
+
for (var n = 0; n < r.length; n++) me(r[n], r[++n], r[++n]);
|
|
168
|
+
w.__c && w.__c(t, e), e.some(function(s) {
|
|
169
169
|
try {
|
|
170
|
-
e =
|
|
171
|
-
|
|
170
|
+
e = s.__h, s.__h = [], e.some(function(o) {
|
|
171
|
+
o.call(s);
|
|
172
172
|
});
|
|
173
|
-
} catch (
|
|
174
|
-
|
|
173
|
+
} catch (o) {
|
|
174
|
+
w.__e(o, s.__v);
|
|
175
175
|
}
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
-
function
|
|
179
|
-
return typeof e != "object" || e == null || e.__b > 0 ? e :
|
|
178
|
+
function Ve(e) {
|
|
179
|
+
return typeof e != "object" || e == null || e.__b > 0 ? e : ne(e) ? e.map(Ve) : I({}, e);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
var a,
|
|
183
|
-
if (
|
|
184
|
-
for (a = 0; a <
|
|
185
|
-
e = p,
|
|
181
|
+
function ct(e, t, r, n, s, o, l, c, u) {
|
|
182
|
+
var a, _, i, f, p, y, C, k = r.props || Y, g = t.props, m = t.type;
|
|
183
|
+
if (m == "svg" ? s = "http://www.w3.org/2000/svg" : m == "math" ? s = "http://www.w3.org/1998/Math/MathML" : s || (s = "http://www.w3.org/1999/xhtml"), o != null) {
|
|
184
|
+
for (a = 0; a < o.length; a++) if ((p = o[a]) && "setAttribute" in p == !!m && (m ? p.localName == m : p.nodeType == 3)) {
|
|
185
|
+
e = p, o[a] = null;
|
|
186
186
|
break;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
if (e == null) {
|
|
190
|
-
if (
|
|
191
|
-
e = document.createElementNS(
|
|
190
|
+
if (m == null) return document.createTextNode(g);
|
|
191
|
+
e = document.createElementNS(s, m, g.is && g), c && (w.__m && w.__m(t, o), c = !1), o = null;
|
|
192
192
|
}
|
|
193
|
-
if (
|
|
193
|
+
if (m == null) k === g || c && e.data == g || (e.data = g);
|
|
194
194
|
else {
|
|
195
|
-
if (
|
|
196
|
-
for (a in k) p = k[a], a == "dangerouslySetInnerHTML" ? i = p : a == "children" || a in g || a == "value" && "defaultValue" in g || a == "checked" && "defaultChecked" in g ||
|
|
197
|
-
for (a in g) p = g[a], a == "children" ?
|
|
198
|
-
if (
|
|
199
|
-
else if (i && (e.innerHTML = ""),
|
|
200
|
-
|
|
195
|
+
if (o = o && re.call(e.childNodes), !c && o != null) for (k = {}, a = 0; a < e.attributes.length; a++) k[(p = e.attributes[a]).name] = p.value;
|
|
196
|
+
for (a in k) p = k[a], a == "dangerouslySetInnerHTML" ? i = p : a == "children" || a in g || a == "value" && "defaultValue" in g || a == "checked" && "defaultChecked" in g || V(e, a, null, p, s);
|
|
197
|
+
for (a in g) p = g[a], a == "children" ? f = p : a == "dangerouslySetInnerHTML" ? _ = p : a == "value" ? y = p : a == "checked" ? C = p : c && typeof p != "function" || k[a] === p || V(e, a, p, k[a], s);
|
|
198
|
+
if (_) c || i && (_.__html == i.__html || _.__html == e.innerHTML) || (e.innerHTML = _.__html), t.__k = [];
|
|
199
|
+
else if (i && (e.innerHTML = ""), je(t.type == "template" ? e.content : e, ne(f) ? f : [f], t, r, n, m == "foreignObject" ? "http://www.w3.org/1999/xhtml" : s, o, l, o ? o[0] : r.__k && W(r, 0), c, u), o != null) for (a = o.length; a--; ) he(o[a]);
|
|
200
|
+
c || (a = "value", m == "progress" && y == null ? e.removeAttribute("value") : y != null && (y !== e[a] || m == "progress" && !y || m == "option" && y != k[a]) && V(e, a, y, k[a], s), a = "checked", C != null && C != e[a] && V(e, a, C, k[a], s));
|
|
201
201
|
}
|
|
202
202
|
return e;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function me(e, t, r) {
|
|
205
205
|
try {
|
|
206
206
|
if (typeof e == "function") {
|
|
207
207
|
var n = typeof e.__u == "function";
|
|
208
208
|
n && e.__u(), n && t == null || (e.__u = e(t));
|
|
209
209
|
} else e.current = t;
|
|
210
|
-
} catch (
|
|
211
|
-
|
|
210
|
+
} catch (s) {
|
|
211
|
+
w.__e(s, r);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
var n,
|
|
216
|
-
if (
|
|
214
|
+
function Je(e, t, r) {
|
|
215
|
+
var n, s;
|
|
216
|
+
if (w.unmount && w.unmount(e), (n = e.ref) && (n.current && n.current != e.__e || me(n, null, t)), (n = e.__c) != null) {
|
|
217
217
|
if (n.componentWillUnmount) try {
|
|
218
218
|
n.componentWillUnmount();
|
|
219
|
-
} catch (
|
|
220
|
-
|
|
219
|
+
} catch (o) {
|
|
220
|
+
w.__e(o, t);
|
|
221
221
|
}
|
|
222
222
|
n.base = n.__P = null;
|
|
223
223
|
}
|
|
224
|
-
if (n = e.__k) for (
|
|
225
|
-
r ||
|
|
224
|
+
if (n = e.__k) for (s = 0; s < n.length; s++) n[s] && Je(n[s], t, r || typeof e.type != "function");
|
|
225
|
+
r || he(e.__e), e.__c = e.__ = e.__e = void 0;
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function ut(e, t, r) {
|
|
228
228
|
return this.constructor(e, r);
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
var n,
|
|
232
|
-
t == document && (t = document.documentElement),
|
|
230
|
+
function _t(e, t, r) {
|
|
231
|
+
var n, s, o, l;
|
|
232
|
+
t == document && (t = document.documentElement), w.__ && w.__(e, t), s = (n = typeof r == "function") ? null : r && r.__k || t.__k, o = [], l = [], ge(t, e = (!n && r || t).__k = it(q, null, [e]), s || Y, Y, t.namespaceURI, !n && r ? [r] : s ? null : t.firstChild ? re.call(t.childNodes) : null, o, !n && r ? r : s ? s.__e : t.firstChild, n, l), qe(o, e, l);
|
|
233
233
|
}
|
|
234
|
-
|
|
235
|
-
for (var
|
|
236
|
-
if ((
|
|
237
|
-
} catch (
|
|
238
|
-
e =
|
|
234
|
+
re = Z.slice, w = { __e: function(e, t, r, n) {
|
|
235
|
+
for (var s, o, l; t = t.__; ) if ((s = t.__c) && !s.__) try {
|
|
236
|
+
if ((o = s.constructor) && o.getDerivedStateFromError != null && (s.setState(o.getDerivedStateFromError(e)), l = s.__d), s.componentDidCatch != null && (s.componentDidCatch(e, n || {}), l = s.__d), l) return s.__E = s;
|
|
237
|
+
} catch (c) {
|
|
238
|
+
e = c;
|
|
239
239
|
}
|
|
240
240
|
throw e;
|
|
241
|
-
} },
|
|
241
|
+
} }, Be = 0, nt = function(e) {
|
|
242
242
|
return e != null && e.constructor === void 0;
|
|
243
|
-
},
|
|
244
|
-
var r = this.__s != null && this.__s != this.state ? this.__s : this.__s =
|
|
245
|
-
typeof e == "function" && (e = e(
|
|
246
|
-
},
|
|
247
|
-
this.__v && (this.__e = !0, e && this.__h.push(e),
|
|
248
|
-
},
|
|
243
|
+
}, X.prototype.setState = function(e, t) {
|
|
244
|
+
var r = this.__s != null && this.__s != this.state ? this.__s : this.__s = I({}, this.state);
|
|
245
|
+
typeof e == "function" && (e = e(I({}, r), this.props)), e && I(r, e), e != null && this.__v && (t && this._sb.push(t), ke(this));
|
|
246
|
+
}, X.prototype.forceUpdate = function(e) {
|
|
247
|
+
this.__v && (this.__e = !0, e && this.__h.push(e), ke(this));
|
|
248
|
+
}, X.prototype.render = q, M = [], De = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Pe = function(e, t) {
|
|
249
249
|
return e.__v.__b - t.__v.__b;
|
|
250
|
-
},
|
|
251
|
-
var
|
|
250
|
+
}, ee.__r = 0, ae = Math.random().toString(8), J = "__d" + ae, P = "__a" + ae, Fe = /(PointerCapture)$|Capture$/i, fe = 0, ce = Se(!1), ue = Se(!0), st = 0;
|
|
251
|
+
var pt = {
|
|
252
252
|
primary: "#2563eb",
|
|
253
253
|
background: "#1e293b",
|
|
254
254
|
backgroundSecondary: "#182130",
|
|
@@ -296,172 +296,406 @@ var ht = {
|
|
|
296
296
|
iconColor: "#f1f5f9",
|
|
297
297
|
iconColorSecondary: "#cbd5e1"
|
|
298
298
|
};
|
|
299
|
-
function
|
|
299
|
+
function ft(e = {}) {
|
|
300
300
|
return Object.entries({
|
|
301
|
-
...
|
|
301
|
+
...pt,
|
|
302
302
|
...e
|
|
303
303
|
}).map(([t, r]) => `${`--twd-${t.replace(/([A-Z])/g, "-$1").toLowerCase()}`}: ${r};`).join(`
|
|
304
304
|
`);
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function ht(e) {
|
|
307
307
|
const t = "twd-theme-variables";
|
|
308
308
|
let r = document.getElementById(t);
|
|
309
309
|
r || (r = document.createElement("style"), r.id = t, document.head.appendChild(r));
|
|
310
|
-
const n =
|
|
310
|
+
const n = ft(e);
|
|
311
311
|
r.textContent = `
|
|
312
312
|
:root {
|
|
313
313
|
${n}
|
|
314
314
|
}
|
|
315
315
|
`;
|
|
316
316
|
}
|
|
317
|
-
var
|
|
317
|
+
var gt = `
|
|
318
|
+
/* ========================
|
|
319
|
+
Animation keyframes
|
|
320
|
+
======================== */
|
|
321
|
+
@keyframes twd-spin {
|
|
322
|
+
0% { transform: rotate(0deg); }
|
|
323
|
+
100% { transform: rotate(360deg); }
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/* ========================
|
|
327
|
+
Buttons — shared base
|
|
328
|
+
======================== */
|
|
329
|
+
.twd-btn {
|
|
330
|
+
cursor: pointer;
|
|
331
|
+
border-radius: var(--twd-border-radius);
|
|
332
|
+
transition: all var(--twd-animation-duration) ease;
|
|
333
|
+
}
|
|
334
|
+
.twd-btn:hover { filter: brightness(1.15); }
|
|
335
|
+
.twd-btn:active { filter: brightness(0.9); }
|
|
336
|
+
.twd-btn:focus-visible {
|
|
337
|
+
outline: 2px solid var(--twd-primary);
|
|
338
|
+
outline-offset: 2px;
|
|
339
|
+
}
|
|
340
|
+
.twd-btn:disabled {
|
|
341
|
+
opacity: 0.5;
|
|
342
|
+
cursor: not-allowed;
|
|
343
|
+
}
|
|
344
|
+
.twd-btn:disabled:hover { filter: none; }
|
|
345
|
+
|
|
346
|
+
/* ========================
|
|
347
|
+
Button variants
|
|
348
|
+
======================== */
|
|
349
|
+
.twd-btn-primary {
|
|
350
|
+
background: var(--twd-button-primary);
|
|
351
|
+
color: var(--twd-button-primary-text);
|
|
352
|
+
padding: var(--twd-spacing-xs) var(--twd-spacing-md);
|
|
353
|
+
border: none;
|
|
354
|
+
}
|
|
355
|
+
.twd-btn-secondary {
|
|
356
|
+
background: var(--twd-button-secondary);
|
|
357
|
+
color: var(--twd-button-secondary-text);
|
|
358
|
+
padding: var(--twd-spacing-xs) var(--twd-spacing-md);
|
|
359
|
+
border: 1px solid var(--twd-button-border);
|
|
360
|
+
}
|
|
361
|
+
.twd-btn-icon {
|
|
362
|
+
background: transparent;
|
|
363
|
+
border: 1px solid var(--twd-border-light);
|
|
364
|
+
padding: 0;
|
|
365
|
+
width: 24px;
|
|
366
|
+
height: 24px;
|
|
367
|
+
display: flex;
|
|
368
|
+
align-items: center;
|
|
369
|
+
justify-content: center;
|
|
370
|
+
vertical-align: middle;
|
|
371
|
+
font-size: var(--twd-font-size-sm);
|
|
372
|
+
}
|
|
373
|
+
.twd-btn-mock-rules {
|
|
374
|
+
background: var(--twd-button-secondary);
|
|
375
|
+
border: 1px solid var(--twd-button-border);
|
|
376
|
+
border-radius: var(--twd-border-radius-lg);
|
|
377
|
+
padding: var(--twd-spacing-md) var(--twd-spacing-lg);
|
|
378
|
+
font-size: var(--twd-font-size-sm);
|
|
379
|
+
color: var(--twd-button-secondary-text);
|
|
380
|
+
display: flex;
|
|
381
|
+
align-items: center;
|
|
382
|
+
gap: var(--twd-spacing-md);
|
|
383
|
+
margin-bottom: 10px;
|
|
384
|
+
width: 100%;
|
|
385
|
+
text-align: left;
|
|
386
|
+
transition: all var(--twd-animation-duration) ease;
|
|
387
|
+
box-shadow: var(--twd-shadow-sm);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/* ========================
|
|
391
|
+
Sidebar layout
|
|
392
|
+
======================== */
|
|
393
|
+
.twd-sidebar {
|
|
394
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
395
|
+
position: fixed;
|
|
396
|
+
top: 0;
|
|
397
|
+
bottom: 0;
|
|
398
|
+
width: var(--twd-sidebar-width);
|
|
399
|
+
background: var(--twd-background);
|
|
400
|
+
font-size: var(--twd-font-size-md);
|
|
401
|
+
overflow-y: auto;
|
|
402
|
+
box-shadow: var(--twd-shadow);
|
|
403
|
+
text-align: left;
|
|
404
|
+
z-index: var(--twd-z-index-sidebar);
|
|
405
|
+
pointer-events: all;
|
|
406
|
+
isolation: isolate;
|
|
407
|
+
}
|
|
408
|
+
.twd-sidebar-header {
|
|
409
|
+
padding: var(--twd-spacing-md);
|
|
410
|
+
background: var(--twd-background);
|
|
411
|
+
position: sticky;
|
|
412
|
+
top: 0;
|
|
413
|
+
z-index: var(--twd-z-index-sticky);
|
|
414
|
+
border-bottom: 1px solid var(--twd-border);
|
|
415
|
+
}
|
|
416
|
+
.twd-sidebar-header-row {
|
|
417
|
+
display: flex;
|
|
418
|
+
justify-content: space-between;
|
|
419
|
+
align-items: center;
|
|
420
|
+
margin-bottom: var(--twd-spacing-xl);
|
|
421
|
+
}
|
|
422
|
+
.twd-sidebar-header-buttons {
|
|
423
|
+
display: flex;
|
|
424
|
+
gap: var(--twd-spacing-xs);
|
|
425
|
+
}
|
|
426
|
+
.twd-sidebar-stats {
|
|
427
|
+
display: flex;
|
|
428
|
+
justify-content: space-between;
|
|
429
|
+
align-items: center;
|
|
430
|
+
font-size: var(--twd-font-size-md);
|
|
431
|
+
color: var(--twd-text-secondary);
|
|
432
|
+
margin-bottom: 10px;
|
|
433
|
+
}
|
|
434
|
+
.twd-sidebar-stats-counts {
|
|
435
|
+
display: flex;
|
|
436
|
+
gap: var(--twd-spacing-xs);
|
|
437
|
+
}
|
|
438
|
+
.twd-sidebar-content {
|
|
439
|
+
padding: var(--twd-spacing-md);
|
|
440
|
+
}
|
|
441
|
+
.twd-sidebar-closed {
|
|
442
|
+
position: fixed;
|
|
443
|
+
top: 50%;
|
|
444
|
+
transform: translateY(-50%);
|
|
445
|
+
z-index: var(--twd-z-index-sidebar);
|
|
446
|
+
background: var(--twd-button-primary);
|
|
447
|
+
color: var(--twd-button-primary-text);
|
|
448
|
+
padding: var(--twd-spacing-sm) 10px;
|
|
449
|
+
font-size: var(--twd-font-size-sm);
|
|
450
|
+
}
|
|
451
|
+
.twd-sidebar-version {
|
|
452
|
+
color: var(--twd-text-secondary);
|
|
453
|
+
font-size: var(--twd-font-size-sm);
|
|
454
|
+
align-self: center;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/* ========================
|
|
458
|
+
Test list
|
|
459
|
+
======================== */
|
|
460
|
+
.twd-test-list {
|
|
461
|
+
list-style: none;
|
|
462
|
+
padding: 0;
|
|
463
|
+
margin: 0;
|
|
464
|
+
}
|
|
465
|
+
.twd-test-group {
|
|
466
|
+
background: var(--twd-describe-bg);
|
|
467
|
+
border-left: 3px solid var(--twd-describe-border);
|
|
468
|
+
border-radius: var(--twd-border-radius);
|
|
469
|
+
padding: var(--twd-spacing-xs) var(--twd-spacing-sm);
|
|
470
|
+
margin-bottom: var(--twd-spacing-sm);
|
|
471
|
+
}
|
|
472
|
+
.twd-test-group-toggle {
|
|
473
|
+
font-weight: var(--twd-font-weight-medium);
|
|
474
|
+
font-size: var(--twd-font-size-sm);
|
|
475
|
+
cursor: pointer;
|
|
476
|
+
color: var(--twd-describe-text);
|
|
477
|
+
display: flex;
|
|
478
|
+
align-items: center;
|
|
479
|
+
justify-content: space-between;
|
|
480
|
+
gap: var(--twd-spacing-sm);
|
|
481
|
+
text-transform: uppercase;
|
|
482
|
+
letter-spacing: 0.05em;
|
|
483
|
+
}
|
|
484
|
+
.twd-test-item {
|
|
485
|
+
display: flex;
|
|
486
|
+
align-items: left;
|
|
487
|
+
justify-content: space-between;
|
|
488
|
+
padding: var(--twd-spacing-sm) var(--twd-spacing-sm);
|
|
489
|
+
border-radius: var(--twd-border-radius);
|
|
490
|
+
}
|
|
491
|
+
.twd-test-item-name {
|
|
492
|
+
font-weight: var(--twd-font-weight-medium);
|
|
493
|
+
font-size: var(--twd-font-size-md);
|
|
494
|
+
color: var(--twd-text);
|
|
495
|
+
max-width: 220px;
|
|
496
|
+
}
|
|
497
|
+
.twd-test-item-logs {
|
|
498
|
+
border-radius: var(--twd-border-radius);
|
|
499
|
+
max-height: 260px;
|
|
500
|
+
overflow-y: auto;
|
|
501
|
+
padding: 0;
|
|
502
|
+
background: var(--twd-background-secondary);
|
|
503
|
+
list-style: none;
|
|
504
|
+
margin-top: var(--twd-spacing-xs);
|
|
505
|
+
text-align: left;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
/* ========================
|
|
509
|
+
Status variants
|
|
510
|
+
======================== */
|
|
511
|
+
.twd-status-pass { background: var(--twd-success-bg); }
|
|
512
|
+
.twd-status-fail { background: var(--twd-error-bg); }
|
|
513
|
+
.twd-status-skip { background: var(--twd-skip-bg); }
|
|
514
|
+
.twd-status-running { background: var(--twd-warning-bg); }
|
|
515
|
+
|
|
516
|
+
/* ========================
|
|
517
|
+
Search
|
|
518
|
+
======================== */
|
|
519
|
+
.twd-search-wrapper {
|
|
520
|
+
position: relative;
|
|
521
|
+
margin-bottom: var(--twd-spacing-md);
|
|
522
|
+
}
|
|
523
|
+
.twd-search-input {
|
|
524
|
+
width: 100%;
|
|
525
|
+
padding: var(--twd-spacing-md);
|
|
526
|
+
background: var(--twd-background);
|
|
527
|
+
color: var(--twd-text);
|
|
528
|
+
border: 1px solid var(--twd-border);
|
|
529
|
+
border-radius: var(--twd-border-radius);
|
|
530
|
+
font-size: var(--twd-font-size-md);
|
|
531
|
+
box-sizing: border-box;
|
|
532
|
+
}
|
|
533
|
+
.twd-search-input:focus-visible {
|
|
534
|
+
outline: 2px solid var(--twd-primary);
|
|
535
|
+
outline-offset: 2px;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
/* ========================
|
|
539
|
+
Loader
|
|
540
|
+
======================== */
|
|
541
|
+
.twd-loader {
|
|
542
|
+
animation: twd-spin 1s linear infinite;
|
|
543
|
+
}
|
|
544
|
+
`;
|
|
545
|
+
function mt() {
|
|
546
|
+
const e = "twd-styles";
|
|
547
|
+
if (document.getElementById(e)) return;
|
|
548
|
+
const t = document.createElement("style");
|
|
549
|
+
t.id = e, t.textContent = gt, document.head.appendChild(t);
|
|
550
|
+
}
|
|
551
|
+
var vt = (e) => {
|
|
318
552
|
const { Component: t, createRoot: r, theme: n } = e;
|
|
319
|
-
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
},
|
|
323
|
-
for (const
|
|
324
|
-
|
|
553
|
+
ht(n), mt();
|
|
554
|
+
const s = document.createElement("div");
|
|
555
|
+
s.setAttribute("id", "twd-sidebar-root"), document.body.appendChild(s), r(s).render(t);
|
|
556
|
+
}, wt = async (e, t, r, n) => {
|
|
557
|
+
for (const s in e) await e[s]();
|
|
558
|
+
vt({
|
|
325
559
|
Component: t,
|
|
326
560
|
createRoot: r,
|
|
327
561
|
theme: n
|
|
328
562
|
});
|
|
329
|
-
},
|
|
330
|
-
function
|
|
331
|
-
|
|
332
|
-
var r =
|
|
563
|
+
}, O, x, le, Te, te = 0, Ke = [], S = w, $e = S.__b, Ce = S.__r, Re = S.diffed, Ee = S.__c, Ne = S.unmount, Ie = S.__;
|
|
564
|
+
function ve(e, t) {
|
|
565
|
+
S.__h && S.__h(x, e, te || t), te = 0;
|
|
566
|
+
var r = x.__H || (x.__H = {
|
|
333
567
|
__: [],
|
|
334
568
|
__h: []
|
|
335
569
|
});
|
|
336
570
|
return e >= r.__.length && r.__.push({}), r.__[e];
|
|
337
571
|
}
|
|
338
|
-
function
|
|
339
|
-
return
|
|
572
|
+
function B(e) {
|
|
573
|
+
return te = 1, yt(Ge, e);
|
|
340
574
|
}
|
|
341
|
-
function
|
|
342
|
-
var n =
|
|
343
|
-
if (n.t = e, !n.__c && (n.__ = [r ? r(t) :
|
|
344
|
-
var u = n.__N ? n.__N[0] : n.__[0], a = n.t(u,
|
|
575
|
+
function yt(e, t, r) {
|
|
576
|
+
var n = ve(O++, 2);
|
|
577
|
+
if (n.t = e, !n.__c && (n.__ = [r ? r(t) : Ge(void 0, t), function(c) {
|
|
578
|
+
var u = n.__N ? n.__N[0] : n.__[0], a = n.t(u, c);
|
|
345
579
|
u !== a && (n.__N = [a, n.__[1]], n.__c.setState({}));
|
|
346
|
-
}], n.__c =
|
|
347
|
-
var
|
|
580
|
+
}], n.__c = x, !x.__f)) {
|
|
581
|
+
var s = function(c, u, a) {
|
|
348
582
|
if (!n.__c.__H) return !0;
|
|
349
|
-
var
|
|
350
|
-
return
|
|
583
|
+
var _ = n.__c.__H.__.filter(function(f) {
|
|
584
|
+
return f.__c;
|
|
351
585
|
});
|
|
352
|
-
if (
|
|
353
|
-
return !
|
|
354
|
-
})) return !
|
|
355
|
-
var i = n.__c.props !==
|
|
356
|
-
return
|
|
357
|
-
if (
|
|
358
|
-
var p =
|
|
359
|
-
|
|
586
|
+
if (_.every(function(f) {
|
|
587
|
+
return !f.__N;
|
|
588
|
+
})) return !o || o.call(this, c, u, a);
|
|
589
|
+
var i = n.__c.props !== c;
|
|
590
|
+
return _.some(function(f) {
|
|
591
|
+
if (f.__N) {
|
|
592
|
+
var p = f.__[0];
|
|
593
|
+
f.__ = f.__N, f.__N = void 0, p !== f.__[0] && (i = !0);
|
|
360
594
|
}
|
|
361
|
-
}),
|
|
595
|
+
}), o && o.call(this, c, u, a) || i;
|
|
362
596
|
};
|
|
363
|
-
|
|
364
|
-
var
|
|
365
|
-
|
|
597
|
+
x.__f = !0;
|
|
598
|
+
var o = x.shouldComponentUpdate, l = x.componentWillUpdate;
|
|
599
|
+
x.componentWillUpdate = function(c, u, a) {
|
|
366
600
|
if (this.__e) {
|
|
367
|
-
var
|
|
368
|
-
|
|
601
|
+
var _ = o;
|
|
602
|
+
o = void 0, s(c, u, a), o = _;
|
|
369
603
|
}
|
|
370
|
-
l && l.call(this,
|
|
371
|
-
},
|
|
604
|
+
l && l.call(this, c, u, a);
|
|
605
|
+
}, x.shouldComponentUpdate = s;
|
|
372
606
|
}
|
|
373
607
|
return n.__N || n.__;
|
|
374
608
|
}
|
|
375
|
-
function
|
|
376
|
-
var r =
|
|
377
|
-
!
|
|
609
|
+
function se(e, t) {
|
|
610
|
+
var r = ve(O++, 3);
|
|
611
|
+
!S.__s && Xe(r.__H, t) && (r.__ = e, r.u = t, x.__H.__h.push(r));
|
|
378
612
|
}
|
|
379
|
-
function
|
|
380
|
-
return
|
|
613
|
+
function F(e) {
|
|
614
|
+
return te = 5, G(function() {
|
|
381
615
|
return { current: e };
|
|
382
616
|
}, []);
|
|
383
617
|
}
|
|
384
|
-
function
|
|
385
|
-
var r =
|
|
386
|
-
return
|
|
618
|
+
function G(e, t) {
|
|
619
|
+
var r = ve(O++, 7);
|
|
620
|
+
return Xe(r.__H, t) && (r.__ = e(), r.__H = t, r.__h = e), r.__;
|
|
387
621
|
}
|
|
388
622
|
function bt() {
|
|
389
|
-
for (var e; e =
|
|
623
|
+
for (var e; e = Ke.shift(); ) {
|
|
390
624
|
var t = e.__H;
|
|
391
625
|
if (e.__P && t) try {
|
|
392
|
-
t.__h.some(
|
|
626
|
+
t.__h.some(Q), t.__h.some(pe), t.__h = [];
|
|
393
627
|
} catch (r) {
|
|
394
|
-
t.__h = [],
|
|
628
|
+
t.__h = [], S.__e(r, e.__v);
|
|
395
629
|
}
|
|
396
630
|
}
|
|
397
631
|
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
},
|
|
401
|
-
e && t.__k && t.__k.__m && (e.__m = t.__k.__m),
|
|
402
|
-
},
|
|
403
|
-
|
|
404
|
-
var t = (
|
|
405
|
-
t && (
|
|
632
|
+
S.__b = function(e) {
|
|
633
|
+
x = null, $e && $e(e);
|
|
634
|
+
}, S.__ = function(e, t) {
|
|
635
|
+
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Ie && Ie(e, t);
|
|
636
|
+
}, S.__r = function(e) {
|
|
637
|
+
Ce && Ce(e), O = 0;
|
|
638
|
+
var t = (x = e.__c).__H;
|
|
639
|
+
t && (le === x ? (t.__h = [], x.__h = [], t.__.some(function(r) {
|
|
406
640
|
r.__N && (r.__ = r.__N), r.u = r.__N = void 0;
|
|
407
|
-
})) : (t.__h.some(
|
|
408
|
-
},
|
|
409
|
-
|
|
641
|
+
})) : (t.__h.some(Q), t.__h.some(pe), t.__h = [], O = 0)), le = x;
|
|
642
|
+
}, S.diffed = function(e) {
|
|
643
|
+
Re && Re(e);
|
|
410
644
|
var t = e.__c;
|
|
411
|
-
t && t.__H && (t.__H.__h.length && (
|
|
645
|
+
t && t.__H && (t.__H.__h.length && (Ke.push(t) !== 1 && Te === S.requestAnimationFrame || ((Te = S.requestAnimationFrame) || kt)(bt)), t.__H.__.some(function(r) {
|
|
412
646
|
r.u && (r.__H = r.u), r.u = void 0;
|
|
413
|
-
})),
|
|
414
|
-
},
|
|
647
|
+
})), le = x = null;
|
|
648
|
+
}, S.__c = function(e, t) {
|
|
415
649
|
t.some(function(r) {
|
|
416
650
|
try {
|
|
417
|
-
r.__h.some(
|
|
418
|
-
return !n.__ ||
|
|
651
|
+
r.__h.some(Q), r.__h = r.__h.filter(function(n) {
|
|
652
|
+
return !n.__ || pe(n);
|
|
419
653
|
});
|
|
420
654
|
} catch (n) {
|
|
421
|
-
t.some(function(
|
|
422
|
-
|
|
423
|
-
}), t = [],
|
|
655
|
+
t.some(function(s) {
|
|
656
|
+
s.__h && (s.__h = []);
|
|
657
|
+
}), t = [], S.__e(n, r.__v);
|
|
424
658
|
}
|
|
425
|
-
}),
|
|
426
|
-
},
|
|
427
|
-
|
|
659
|
+
}), Ee && Ee(e, t);
|
|
660
|
+
}, S.unmount = function(e) {
|
|
661
|
+
Ne && Ne(e);
|
|
428
662
|
var t, r = e.__c;
|
|
429
663
|
r && r.__H && (r.__H.__.some(function(n) {
|
|
430
664
|
try {
|
|
431
|
-
|
|
432
|
-
} catch (
|
|
433
|
-
t =
|
|
665
|
+
Q(n);
|
|
666
|
+
} catch (s) {
|
|
667
|
+
t = s;
|
|
434
668
|
}
|
|
435
|
-
}), r.__H = void 0, t &&
|
|
669
|
+
}), r.__H = void 0, t && S.__e(t, r.__v));
|
|
436
670
|
};
|
|
437
|
-
var
|
|
671
|
+
var Ae = typeof requestAnimationFrame == "function";
|
|
438
672
|
function kt(e) {
|
|
439
673
|
var t, r = function() {
|
|
440
|
-
clearTimeout(n),
|
|
674
|
+
clearTimeout(n), Ae && cancelAnimationFrame(t), setTimeout(e);
|
|
441
675
|
}, n = setTimeout(r, 35);
|
|
442
|
-
|
|
676
|
+
Ae && (t = requestAnimationFrame(r));
|
|
443
677
|
}
|
|
444
|
-
function
|
|
445
|
-
var t =
|
|
446
|
-
typeof r == "function" && (e.__c = void 0, r()),
|
|
678
|
+
function Q(e) {
|
|
679
|
+
var t = x, r = e.__c;
|
|
680
|
+
typeof r == "function" && (e.__c = void 0, r()), x = t;
|
|
447
681
|
}
|
|
448
|
-
function
|
|
449
|
-
var t =
|
|
450
|
-
e.__c = e.__(),
|
|
682
|
+
function pe(e) {
|
|
683
|
+
var t = x;
|
|
684
|
+
e.__c = e.__(), x = t;
|
|
451
685
|
}
|
|
452
|
-
function
|
|
686
|
+
function Xe(e, t) {
|
|
453
687
|
return !e || e.length !== t.length || t.some(function(r, n) {
|
|
454
688
|
return r !== e[n];
|
|
455
689
|
});
|
|
456
690
|
}
|
|
457
|
-
function
|
|
691
|
+
function Ge(e, t) {
|
|
458
692
|
return typeof t == "function" ? t(e) : t;
|
|
459
693
|
}
|
|
460
|
-
var
|
|
461
|
-
function
|
|
694
|
+
var xt = 0;
|
|
695
|
+
function d(e, t, r, n, s, o) {
|
|
462
696
|
t || (t = {});
|
|
463
|
-
var l,
|
|
464
|
-
if ("ref" in u) for (
|
|
697
|
+
var l, c, u = t;
|
|
698
|
+
if ("ref" in u) for (c in u = {}, t) c == "ref" ? l = t[c] : u[c] = t[c];
|
|
465
699
|
var a = {
|
|
466
700
|
type: e,
|
|
467
701
|
props: u,
|
|
@@ -473,16 +707,16 @@ function c(e, t, r, n, o, s) {
|
|
|
473
707
|
__e: null,
|
|
474
708
|
__c: null,
|
|
475
709
|
constructor: void 0,
|
|
476
|
-
__v: --
|
|
710
|
+
__v: --xt,
|
|
477
711
|
__i: -1,
|
|
478
712
|
__u: 0,
|
|
479
|
-
__source:
|
|
480
|
-
__self:
|
|
713
|
+
__source: s,
|
|
714
|
+
__self: o
|
|
481
715
|
};
|
|
482
|
-
if (typeof e == "function" && (l = e.defaultProps)) for (
|
|
483
|
-
return
|
|
716
|
+
if (typeof e == "function" && (l = e.defaultProps)) for (c in l) u[c] === void 0 && (u[c] = l[c]);
|
|
717
|
+
return w.vnode && w.vnode(a), a;
|
|
484
718
|
}
|
|
485
|
-
var
|
|
719
|
+
var St = () => /* @__PURE__ */ d("svg", {
|
|
486
720
|
xmlns: "http://www.w3.org/2000/svg",
|
|
487
721
|
width: "24",
|
|
488
722
|
height: "24",
|
|
@@ -492,18 +726,10 @@ var xt = { animation: "spin 1s linear infinite" }, Tt = () => /* @__PURE__ */ c(
|
|
|
492
726
|
strokeWidth: "2",
|
|
493
727
|
strokeLinecap: "round",
|
|
494
728
|
strokeLinejoin: "round",
|
|
495
|
-
className: "lucide lucide-loader-circle-icon lucide-loader-circle",
|
|
496
|
-
style: xt,
|
|
729
|
+
className: "lucide lucide-loader-circle-icon lucide-loader-circle twd-loader",
|
|
497
730
|
"data-testid": "loader-icon",
|
|
498
|
-
children: /* @__PURE__ */
|
|
499
|
-
}),
|
|
500
|
-
X && !document.getElementById("loader-spin-keyframes") && (X.id = "loader-spin-keyframes", X.innerHTML = `
|
|
501
|
-
@keyframes spin {
|
|
502
|
-
0% { transform: rotate(0deg); }
|
|
503
|
-
100% { transform: rotate(360deg); }
|
|
504
|
-
}
|
|
505
|
-
`, document.head.appendChild(X));
|
|
506
|
-
var ae = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ c("svg", {
|
|
731
|
+
children: /* @__PURE__ */ d("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
732
|
+
}), oe = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ d("svg", {
|
|
507
733
|
xmlns: "http://www.w3.org/2000/svg",
|
|
508
734
|
width: "16",
|
|
509
735
|
height: "16",
|
|
@@ -516,33 +742,33 @@ var ae = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ c("sv
|
|
|
516
742
|
className: `lucide ${e}`,
|
|
517
743
|
"data-testid": r,
|
|
518
744
|
children: t
|
|
519
|
-
}),
|
|
745
|
+
}), Tt = () => /* @__PURE__ */ d(oe, {
|
|
520
746
|
className: "lucide-play-icon lucide-play",
|
|
521
747
|
dataTestId: "play-icon",
|
|
522
|
-
children: /* @__PURE__ */
|
|
523
|
-
}),
|
|
748
|
+
children: /* @__PURE__ */ d("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" })
|
|
749
|
+
}), Qe = ({ id: e, name: t, skip: r, only: n }) => /* @__PURE__ */ d(q, { children: [
|
|
524
750
|
t,
|
|
525
751
|
" ",
|
|
526
|
-
n && /* @__PURE__ */
|
|
752
|
+
n && /* @__PURE__ */ d("span", {
|
|
527
753
|
style: { color: "var(--twd-primary)" },
|
|
528
754
|
"data-testid": `only-indicator-${e}`,
|
|
529
755
|
children: [" ", "(only)"]
|
|
530
756
|
}),
|
|
531
|
-
r && /* @__PURE__ */
|
|
757
|
+
r && /* @__PURE__ */ d("span", {
|
|
532
758
|
style: { color: "var(--twd-text-secondary)" },
|
|
533
759
|
"data-testid": `skip-indicator-${e}`,
|
|
534
760
|
children: [" ", "(skipped)"]
|
|
535
761
|
})
|
|
536
|
-
] }),
|
|
762
|
+
] }), A = /* @__PURE__ */ (function(e) {
|
|
537
763
|
return e.CHAI_DIFF = "chai-diff", e.CHAI_MESSAGE = "chai-message", e.ERROR = "error", e;
|
|
538
|
-
})({}),
|
|
764
|
+
})({}), $t = (e) => {
|
|
539
765
|
try {
|
|
540
766
|
const t = JSON.parse(e);
|
|
541
767
|
if (t && typeof t == "object" && "type" in t) return t;
|
|
542
768
|
} catch {
|
|
543
769
|
}
|
|
544
770
|
return null;
|
|
545
|
-
},
|
|
771
|
+
}, Me = (e) => {
|
|
546
772
|
if (e === null) return "null";
|
|
547
773
|
if (e === void 0) return "undefined";
|
|
548
774
|
if (typeof e == "string") return e;
|
|
@@ -552,15 +778,15 @@ var ae = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ c("sv
|
|
|
552
778
|
return String(e);
|
|
553
779
|
}
|
|
554
780
|
return String(e);
|
|
555
|
-
},
|
|
781
|
+
}, Ct = (e) => e.startsWith("Assertion passed") || e.startsWith("Event fired") ? {
|
|
556
782
|
color: "var(--twd-success)",
|
|
557
783
|
fontWeight: "var(--twd-font-weight-bold)"
|
|
558
784
|
} : e.startsWith("Test failed") ? {
|
|
559
785
|
color: "var(--twd-error)",
|
|
560
786
|
fontWeight: "var(--twd-font-weight-bold)"
|
|
561
|
-
} : {},
|
|
562
|
-
const r =
|
|
563
|
-
if (r?.type ===
|
|
787
|
+
} : {}, Rt = (e) => e.type === A.CHAI_MESSAGE || e.type === A.ERROR, Et = (e, t) => t && Rt(t) ? t.message : e, Nt = ({ log: e, index: t }) => {
|
|
788
|
+
const r = $t(e);
|
|
789
|
+
if (r?.type === A.CHAI_DIFF) return /* @__PURE__ */ d("li", {
|
|
564
790
|
style: {
|
|
565
791
|
fontSize: "var(--twd-font-size-sm)",
|
|
566
792
|
padding: "var(--twd-spacing-sm)",
|
|
@@ -568,7 +794,7 @@ var ae = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ c("sv
|
|
|
568
794
|
color: "var(--twd-text)"
|
|
569
795
|
},
|
|
570
796
|
children: [
|
|
571
|
-
/* @__PURE__ */
|
|
797
|
+
/* @__PURE__ */ d("div", {
|
|
572
798
|
style: {
|
|
573
799
|
color: "var(--twd-error)",
|
|
574
800
|
fontWeight: "var(--twd-font-weight-bold)",
|
|
@@ -576,20 +802,20 @@ var ae = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ c("sv
|
|
|
576
802
|
},
|
|
577
803
|
children: "❌ Assertion failed"
|
|
578
804
|
}),
|
|
579
|
-
/* @__PURE__ */
|
|
805
|
+
/* @__PURE__ */ d("div", {
|
|
580
806
|
style: {
|
|
581
807
|
marginTop: "var(--twd-spacing-xs)",
|
|
582
808
|
paddingLeft: "var(--twd-spacing-sm)",
|
|
583
809
|
borderLeft: "2px solid var(--twd-success)"
|
|
584
810
|
},
|
|
585
|
-
children: [/* @__PURE__ */
|
|
811
|
+
children: [/* @__PURE__ */ d("div", {
|
|
586
812
|
style: {
|
|
587
813
|
color: "var(--twd-success)",
|
|
588
814
|
fontWeight: "var(--twd-font-weight-medium)",
|
|
589
815
|
marginBottom: "var(--twd-spacing-xs)"
|
|
590
816
|
},
|
|
591
817
|
children: "Expected:"
|
|
592
|
-
}), /* @__PURE__ */
|
|
818
|
+
}), /* @__PURE__ */ d("pre", {
|
|
593
819
|
style: {
|
|
594
820
|
margin: 0,
|
|
595
821
|
padding: "var(--twd-spacing-xs)",
|
|
@@ -600,23 +826,23 @@ var ae = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ c("sv
|
|
|
600
826
|
whiteSpace: "pre-wrap",
|
|
601
827
|
wordBreak: "break-word"
|
|
602
828
|
},
|
|
603
|
-
children:
|
|
829
|
+
children: Me(r.expected)
|
|
604
830
|
})]
|
|
605
831
|
}),
|
|
606
|
-
/* @__PURE__ */
|
|
832
|
+
/* @__PURE__ */ d("div", {
|
|
607
833
|
style: {
|
|
608
834
|
marginTop: "var(--twd-spacing-xs)",
|
|
609
835
|
paddingLeft: "var(--twd-spacing-sm)",
|
|
610
836
|
borderLeft: "2px solid var(--twd-error)"
|
|
611
837
|
},
|
|
612
|
-
children: [/* @__PURE__ */
|
|
838
|
+
children: [/* @__PURE__ */ d("div", {
|
|
613
839
|
style: {
|
|
614
840
|
color: "var(--twd-error)",
|
|
615
841
|
fontWeight: "var(--twd-font-weight-medium)",
|
|
616
842
|
marginBottom: "var(--twd-spacing-xs)"
|
|
617
843
|
},
|
|
618
844
|
children: "Actual:"
|
|
619
|
-
}), /* @__PURE__ */
|
|
845
|
+
}), /* @__PURE__ */ d("pre", {
|
|
620
846
|
style: {
|
|
621
847
|
margin: 0,
|
|
622
848
|
padding: "var(--twd-spacing-xs)",
|
|
@@ -627,97 +853,44 @@ var ae = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ c("sv
|
|
|
627
853
|
whiteSpace: "pre-wrap",
|
|
628
854
|
wordBreak: "break-word"
|
|
629
855
|
},
|
|
630
|
-
children:
|
|
856
|
+
children: Me(r.actual)
|
|
631
857
|
})]
|
|
632
858
|
})
|
|
633
859
|
]
|
|
634
860
|
}, t);
|
|
635
|
-
const n =
|
|
636
|
-
return /* @__PURE__ */
|
|
861
|
+
const n = Et(e, r);
|
|
862
|
+
return /* @__PURE__ */ d("li", {
|
|
637
863
|
style: {
|
|
638
864
|
fontSize: "var(--twd-font-size-sm)",
|
|
639
865
|
padding: "var(--twd-spacing-xs) var(--twd-spacing-sm)",
|
|
640
866
|
borderBottom: "1px solid var(--twd-border-light)",
|
|
641
867
|
color: "var(--twd-text)",
|
|
642
|
-
|
|
868
|
+
...Ct(n)
|
|
643
869
|
},
|
|
644
870
|
children: n
|
|
645
871
|
}, t);
|
|
646
|
-
},
|
|
647
|
-
|
|
648
|
-
item: {
|
|
649
|
-
display: "flex",
|
|
650
|
-
alignItems: "left",
|
|
651
|
-
justifyContent: "space-between",
|
|
652
|
-
padding: "var(--twd-spacing-sm) var(--twd-spacing-sm)",
|
|
653
|
-
borderRadius: "var(--twd-border-radius)"
|
|
654
|
-
},
|
|
655
|
-
nameSpan: {
|
|
656
|
-
fontWeight: "var(--twd-font-weight-medium)",
|
|
657
|
-
fontSize: "var(--twd-font-size-md)",
|
|
658
|
-
color: "var(--twd-text)",
|
|
659
|
-
maxWidth: "220px"
|
|
660
|
-
},
|
|
661
|
-
button: {
|
|
662
|
-
background: "transparent",
|
|
663
|
-
border: "1px solid var(--twd-border-light)",
|
|
664
|
-
borderRadius: "var(--twd-border-radius)",
|
|
665
|
-
padding: "0",
|
|
666
|
-
cursor: "pointer",
|
|
667
|
-
verticalAlign: "middle",
|
|
668
|
-
fontSize: "var(--twd-font-size-sm)",
|
|
669
|
-
width: "24px",
|
|
670
|
-
height: "24px",
|
|
671
|
-
display: "flex",
|
|
672
|
-
alignItems: "center",
|
|
673
|
-
justifyContent: "center"
|
|
674
|
-
},
|
|
675
|
-
logsList: {
|
|
676
|
-
borderRadius: "var(--twd-border-radius)",
|
|
677
|
-
maxHeight: "260px",
|
|
678
|
-
overflowY: "auto",
|
|
679
|
-
padding: 0,
|
|
680
|
-
background: "var(--twd-background-secondary)",
|
|
681
|
-
listStyle: "none",
|
|
682
|
-
marginTop: "var(--twd-spacing-xs)",
|
|
683
|
-
textAlign: "left"
|
|
684
|
-
}
|
|
685
|
-
}, Lt = (e) => {
|
|
686
|
-
switch (e.status) {
|
|
872
|
+
}, It = (e) => {
|
|
873
|
+
switch (e) {
|
|
687
874
|
case "pass":
|
|
688
|
-
return
|
|
689
|
-
item: { background: "var(--twd-success-bg)" },
|
|
690
|
-
container: { borderLeft: "3px solid var(--twd-success)" }
|
|
691
|
-
};
|
|
875
|
+
return "twd-status-pass";
|
|
692
876
|
case "fail":
|
|
693
|
-
return
|
|
694
|
-
item: { background: "var(--twd-error-bg)" },
|
|
695
|
-
container: { borderLeft: "3px solid var(--twd-error)" }
|
|
696
|
-
};
|
|
877
|
+
return "twd-status-fail";
|
|
697
878
|
case "skip":
|
|
698
|
-
return
|
|
879
|
+
return "twd-status-skip";
|
|
699
880
|
case "running":
|
|
700
|
-
return
|
|
881
|
+
return "twd-status-running";
|
|
701
882
|
default:
|
|
702
|
-
return
|
|
883
|
+
return "";
|
|
703
884
|
}
|
|
704
|
-
},
|
|
705
|
-
const
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
...d.item,
|
|
712
|
-
...u && { border: "1px dashed var(--twd-border)" }
|
|
713
|
-
}), [d, u]);
|
|
714
|
-
ie(() => {
|
|
715
|
-
const _ = o.current;
|
|
716
|
-
!_ || !e.logs || e.logs.length === 0 || ((s.current === "running" && (e.status === "pass" || e.status === "fail") || e.logs.length > l.current) && setTimeout(() => {
|
|
717
|
-
_.scrollTop = _.scrollHeight;
|
|
718
|
-
}, 0), s.current = e.status, l.current = e.logs.length);
|
|
885
|
+
}, At = ({ node: e, depth: t, id: r, runTest: n }) => {
|
|
886
|
+
const s = F(null), o = F(e.status), l = F(e.logs?.length || 0), c = typeof window < "u" && sessionStorage.getItem("twd-last-run-test-name") === e.name;
|
|
887
|
+
se(() => {
|
|
888
|
+
const a = s.current;
|
|
889
|
+
!a || !e.logs || e.logs.length === 0 || ((o.current === "running" && (e.status === "pass" || e.status === "fail") || e.logs.length > l.current) && setTimeout(() => {
|
|
890
|
+
a.scrollTop = a.scrollHeight;
|
|
891
|
+
}, 0), o.current = e.status, l.current = e.logs.length);
|
|
719
892
|
}, [e.status, e.logs]);
|
|
720
|
-
const
|
|
893
|
+
const u = () => {
|
|
721
894
|
switch (e.status) {
|
|
722
895
|
case "pass":
|
|
723
896
|
return "passed";
|
|
@@ -731,136 +904,115 @@ var ae = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ c("sv
|
|
|
731
904
|
return "not run";
|
|
732
905
|
}
|
|
733
906
|
};
|
|
734
|
-
return /* @__PURE__ */
|
|
735
|
-
style:
|
|
907
|
+
return /* @__PURE__ */ d("li", {
|
|
908
|
+
style: {
|
|
909
|
+
marginBottom: "var(--twd-spacing-xs)",
|
|
910
|
+
marginLeft: `calc(${t} * var(--twd-spacing-sm))`
|
|
911
|
+
},
|
|
736
912
|
"data-testid": `test-list-item-${r}`,
|
|
737
913
|
"data-test-name": e.name,
|
|
738
914
|
role: "listitem",
|
|
739
|
-
"aria-label": `Test ${e.name}, status: ${
|
|
740
|
-
children: [/* @__PURE__ */
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
915
|
+
"aria-label": `Test ${e.name}, status: ${u()}`,
|
|
916
|
+
children: [/* @__PURE__ */ d("div", {
|
|
917
|
+
className: `twd-test-item ${It(e.status)}`,
|
|
918
|
+
style: c ? { border: "1px dashed var(--twd-border)" } : void 0,
|
|
919
|
+
children: [/* @__PURE__ */ d("span", {
|
|
920
|
+
className: "twd-test-item-name",
|
|
921
|
+
children: /* @__PURE__ */ d(Qe, {
|
|
745
922
|
id: r,
|
|
746
923
|
name: e.name,
|
|
747
924
|
skip: e.skip,
|
|
748
925
|
only: e.only
|
|
749
926
|
})
|
|
750
|
-
}), /* @__PURE__ */
|
|
927
|
+
}), /* @__PURE__ */ d("button", {
|
|
751
928
|
onClick: () => n(r),
|
|
752
929
|
"aria-label": `Run ${e.name} test`,
|
|
753
|
-
|
|
930
|
+
className: "twd-btn twd-btn-icon",
|
|
754
931
|
disabled: e.status === "running",
|
|
755
932
|
"data-testid": `run-test-button-${r}`,
|
|
756
|
-
children: e.status === "running" ? /* @__PURE__ */
|
|
933
|
+
children: e.status === "running" ? /* @__PURE__ */ d(St, {}) : /* @__PURE__ */ d(Tt, {})
|
|
757
934
|
})]
|
|
758
|
-
}), e.logs && e.logs.length > 0 && /* @__PURE__ */
|
|
759
|
-
ref:
|
|
760
|
-
|
|
761
|
-
children: e.logs.map((
|
|
762
|
-
log:
|
|
763
|
-
index:
|
|
764
|
-
},
|
|
935
|
+
}), e.logs && e.logs.length > 0 && /* @__PURE__ */ d("ul", {
|
|
936
|
+
ref: s,
|
|
937
|
+
className: "twd-test-item-logs",
|
|
938
|
+
children: e.logs.map((a, _) => /* @__PURE__ */ d(Nt, {
|
|
939
|
+
log: a,
|
|
940
|
+
index: _
|
|
941
|
+
}, _))
|
|
765
942
|
})]
|
|
766
943
|
}, e.name);
|
|
767
|
-
},
|
|
944
|
+
}, Mt = () => /* @__PURE__ */ d(oe, {
|
|
768
945
|
className: "lucide-chevron-down-icon lucide-chevron-down",
|
|
769
946
|
dataTestId: "chevron-down-icon",
|
|
770
|
-
children: /* @__PURE__ */
|
|
771
|
-
}),
|
|
947
|
+
children: /* @__PURE__ */ d("path", { d: "m6 9 6 6 6-6" })
|
|
948
|
+
}), zt = () => /* @__PURE__ */ d(oe, {
|
|
772
949
|
className: "lucide-chevron-right-icon lucide-chevron-right",
|
|
773
950
|
dataTestId: "chevron-right-icon",
|
|
774
|
-
children: /* @__PURE__ */
|
|
775
|
-
}),
|
|
776
|
-
const [n,
|
|
777
|
-
...
|
|
778
|
-
[a]: !
|
|
951
|
+
children: /* @__PURE__ */ d("path", { d: "m9 18 6-6-6-6" })
|
|
952
|
+
}), Lt = ({ roots: e, runTest: t, searchQuery: r = "" }) => {
|
|
953
|
+
const [n, s] = B({}), o = F(null), l = F(!1), c = (a) => s((_) => ({
|
|
954
|
+
..._,
|
|
955
|
+
[a]: !_[a]
|
|
779
956
|
}));
|
|
780
|
-
|
|
957
|
+
se(() => {
|
|
781
958
|
if (l.current) return;
|
|
782
959
|
const a = sessionStorage.getItem("twd-last-run-test-name");
|
|
783
960
|
if (!a) return;
|
|
784
|
-
const
|
|
961
|
+
const _ = setTimeout(() => {
|
|
785
962
|
const i = document.querySelector(`[data-test-name="${a}"]`);
|
|
786
963
|
if (i) {
|
|
787
|
-
const
|
|
788
|
-
if (
|
|
789
|
-
const p = i.getBoundingClientRect(),
|
|
790
|
-
|
|
791
|
-
top: k -
|
|
964
|
+
const f = o.current?.closest('[data-testid="twd-sidebar"]');
|
|
965
|
+
if (f) {
|
|
966
|
+
const p = i.getBoundingClientRect(), y = f.getBoundingClientRect(), C = f.scrollTop, k = p.top - y.top + C, g = f.querySelector('[data-testid="twd-sidebar-header"]'), m = g ? g.getBoundingClientRect().height + 16 : 150;
|
|
967
|
+
f.scrollTo({
|
|
968
|
+
top: k - m,
|
|
792
969
|
behavior: "smooth"
|
|
793
970
|
});
|
|
794
971
|
}
|
|
795
972
|
l.current = !0;
|
|
796
973
|
}
|
|
797
974
|
}, 100);
|
|
798
|
-
return () => clearTimeout(
|
|
975
|
+
return () => clearTimeout(_);
|
|
799
976
|
}, []);
|
|
800
|
-
const u = (a,
|
|
801
|
-
if (a.type === "test") return /* @__PURE__ */
|
|
977
|
+
const u = (a, _ = 0) => {
|
|
978
|
+
if (a.type === "test") return /* @__PURE__ */ d(At, {
|
|
802
979
|
node: a,
|
|
803
|
-
depth:
|
|
980
|
+
depth: _,
|
|
804
981
|
id: a.id,
|
|
805
982
|
runTest: () => t(a.id)
|
|
806
983
|
}, a.id);
|
|
807
984
|
const i = n[a.id];
|
|
808
|
-
return /* @__PURE__ */
|
|
809
|
-
style: { marginLeft: `calc(${
|
|
810
|
-
children: [/* @__PURE__ */
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
borderRadius: "var(--twd-border-radius)",
|
|
815
|
-
padding: "var(--twd-spacing-xs) var(--twd-spacing-sm)",
|
|
816
|
-
marginBottom: "var(--twd-spacing-sm)"
|
|
817
|
-
},
|
|
818
|
-
children: /* @__PURE__ */ c("span", {
|
|
819
|
-
style: {
|
|
820
|
-
fontWeight: "var(--twd-font-weight-medium)",
|
|
821
|
-
fontSize: "var(--twd-font-size-sm)",
|
|
822
|
-
cursor: "pointer",
|
|
823
|
-
color: "var(--twd-describe-text)",
|
|
824
|
-
display: "flex",
|
|
825
|
-
alignItems: "center",
|
|
826
|
-
justifyContent: "space-between",
|
|
827
|
-
gap: "var(--twd-spacing-sm)",
|
|
828
|
-
textTransform: "uppercase",
|
|
829
|
-
letterSpacing: "0.05em"
|
|
830
|
-
},
|
|
985
|
+
return /* @__PURE__ */ d("li", {
|
|
986
|
+
style: { marginLeft: `calc(${_} * var(--twd-spacing-lg))` },
|
|
987
|
+
children: [/* @__PURE__ */ d("div", {
|
|
988
|
+
className: "twd-test-group",
|
|
989
|
+
children: /* @__PURE__ */ d("span", {
|
|
990
|
+
className: "twd-test-group-toggle",
|
|
831
991
|
"data-testid": `test-group-${a.name}`,
|
|
832
992
|
tabIndex: 0,
|
|
833
993
|
role: "button",
|
|
834
994
|
"aria-expanded": !i,
|
|
835
995
|
"aria-label": `${i ? "Expand" : "Collapse"} test suite ${a.name}`,
|
|
836
|
-
onClick: () =>
|
|
837
|
-
children: [/* @__PURE__ */
|
|
996
|
+
onClick: () => c(a.id),
|
|
997
|
+
children: [/* @__PURE__ */ d(Qe, {
|
|
838
998
|
id: a.id,
|
|
839
999
|
name: a.name,
|
|
840
1000
|
skip: a.skip,
|
|
841
1001
|
only: a.only
|
|
842
|
-
}), i ? /* @__PURE__ */
|
|
1002
|
+
}), i ? /* @__PURE__ */ d(zt, {}) : /* @__PURE__ */ d(Mt, {})]
|
|
843
1003
|
})
|
|
844
|
-
}), !i && a.childrenNodes && a.childrenNodes.length > 0 && /* @__PURE__ */
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
padding: 0,
|
|
848
|
-
margin: 0
|
|
849
|
-
},
|
|
850
|
-
children: a.childrenNodes.map((_) => u(_, f + 1))
|
|
1004
|
+
}), !i && a.childrenNodes && a.childrenNodes.length > 0 && /* @__PURE__ */ d("ul", {
|
|
1005
|
+
className: "twd-test-list",
|
|
1006
|
+
children: a.childrenNodes.map((f) => u(f, _ + 1))
|
|
851
1007
|
})]
|
|
852
1008
|
}, a.id);
|
|
853
1009
|
};
|
|
854
|
-
return /* @__PURE__ */
|
|
855
|
-
ref:
|
|
856
|
-
|
|
857
|
-
listStyle: "none",
|
|
858
|
-
padding: 0,
|
|
859
|
-
margin: 0
|
|
860
|
-
},
|
|
1010
|
+
return /* @__PURE__ */ d("ul", {
|
|
1011
|
+
ref: o,
|
|
1012
|
+
className: "twd-test-list",
|
|
861
1013
|
role: "list",
|
|
862
1014
|
"aria-label": "Test list",
|
|
863
|
-
children: e.length === 0 && r ? /* @__PURE__ */
|
|
1015
|
+
children: e.length === 0 && r ? /* @__PURE__ */ d("li", {
|
|
864
1016
|
style: {
|
|
865
1017
|
padding: "var(--twd-spacing-md)",
|
|
866
1018
|
color: "var(--twd-text-secondary)",
|
|
@@ -874,7 +1026,7 @@ var ae = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ c("sv
|
|
|
874
1026
|
]
|
|
875
1027
|
}) : e.map((a) => u(a))
|
|
876
1028
|
});
|
|
877
|
-
},
|
|
1029
|
+
}, Wt = {
|
|
878
1030
|
left: {
|
|
879
1031
|
left: 0,
|
|
880
1032
|
borderTopRightRadius: "var(--twd-border-radius-lg)",
|
|
@@ -889,61 +1041,51 @@ var ae = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ c("sv
|
|
|
889
1041
|
borderTopRightRadius: "0",
|
|
890
1042
|
borderBottomRightRadius: "0"
|
|
891
1043
|
}
|
|
892
|
-
},
|
|
1044
|
+
}, Ht = ({ setOpen: e, position: t }) => /* @__PURE__ */ d("button", {
|
|
893
1045
|
"aria-label": "Open TWD sidebar",
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
top: "50%",
|
|
897
|
-
transform: "translateY(-50%)",
|
|
898
|
-
zIndex: "var(--twd-z-index-sidebar)",
|
|
899
|
-
background: "var(--twd-button-primary)",
|
|
900
|
-
color: "var(--twd-button-primary-text)",
|
|
901
|
-
padding: "var(--twd-spacing-sm) 10px",
|
|
902
|
-
cursor: "pointer",
|
|
903
|
-
fontSize: "var(--twd-font-size-sm)",
|
|
904
|
-
...Ht[t]
|
|
905
|
-
},
|
|
1046
|
+
className: "twd-btn twd-sidebar-closed",
|
|
1047
|
+
style: { ...Wt[t] },
|
|
906
1048
|
onClick: () => e(!0),
|
|
907
1049
|
children: "TWD"
|
|
908
|
-
}),
|
|
909
|
-
|
|
1050
|
+
}), Bt = ({ isOpen: e, position: t }) => {
|
|
1051
|
+
se(() => {
|
|
910
1052
|
const r = document.documentElement, n = getComputedStyle(document.documentElement).getPropertyValue("--twd-sidebar-width") || "280px";
|
|
911
1053
|
return e ? t === "left" ? r.style.marginLeft = n : r.style.marginRight = n : (r.style.marginRight = "0", r.style.marginLeft = "0"), () => {
|
|
912
1054
|
r.style.marginRight = "0", r.style.marginLeft = "0";
|
|
913
1055
|
};
|
|
914
1056
|
}, [e, t]);
|
|
915
1057
|
};
|
|
916
|
-
function
|
|
1058
|
+
function j(e) {
|
|
917
1059
|
"@babel/helpers - typeof";
|
|
918
|
-
return
|
|
1060
|
+
return j = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
919
1061
|
return typeof t;
|
|
920
1062
|
} : function(t) {
|
|
921
1063
|
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
922
|
-
},
|
|
1064
|
+
}, j(e);
|
|
923
1065
|
}
|
|
924
|
-
function
|
|
925
|
-
if (
|
|
1066
|
+
function Dt(e, t) {
|
|
1067
|
+
if (j(e) != "object" || !e) return e;
|
|
926
1068
|
var r = e[Symbol.toPrimitive];
|
|
927
1069
|
if (r !== void 0) {
|
|
928
1070
|
var n = r.call(e, t || "default");
|
|
929
|
-
if (
|
|
1071
|
+
if (j(n) != "object") return n;
|
|
930
1072
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
931
1073
|
}
|
|
932
1074
|
return (t === "string" ? String : Number)(e);
|
|
933
1075
|
}
|
|
934
|
-
function
|
|
935
|
-
var t =
|
|
936
|
-
return
|
|
1076
|
+
function Pt(e) {
|
|
1077
|
+
var t = Dt(e, "string");
|
|
1078
|
+
return j(t) == "symbol" ? t : t + "";
|
|
937
1079
|
}
|
|
938
|
-
function
|
|
939
|
-
return (t =
|
|
1080
|
+
function ze(e, t, r) {
|
|
1081
|
+
return (t = Pt(t)) in e ? Object.defineProperty(e, t, {
|
|
940
1082
|
value: r,
|
|
941
1083
|
enumerable: !0,
|
|
942
1084
|
configurable: !0,
|
|
943
1085
|
writable: !0
|
|
944
1086
|
}) : e[t] = r, e;
|
|
945
1087
|
}
|
|
946
|
-
var
|
|
1088
|
+
var Ft = () => typeof window < "u" ? (window.__TWD_STATE__ || (window.__TWD_STATE__ = {
|
|
947
1089
|
handlers: /* @__PURE__ */ new Map(),
|
|
948
1090
|
beforeEachHooks: /* @__PURE__ */ new Map(),
|
|
949
1091
|
afterEachHooks: /* @__PURE__ */ new Map(),
|
|
@@ -953,9 +1095,9 @@ var Ot = () => typeof window < "u" ? (window.__TWD_STATE__ || (window.__TWD_STAT
|
|
|
953
1095
|
beforeEachHooks: /* @__PURE__ */ new Map(),
|
|
954
1096
|
afterEachHooks: /* @__PURE__ */ new Map(),
|
|
955
1097
|
stack: []
|
|
956
|
-
},
|
|
957
|
-
const r =
|
|
958
|
-
|
|
1098
|
+
}, ie = Ft(), v = ie.handlers, Le = ie.beforeEachHooks, We = ie.afterEachHooks, T = ie.stack, H = () => Math.random().toString(36).slice(2, 11), Ye = (e, t) => {
|
|
1099
|
+
const r = H(), n = T.at(-1);
|
|
1100
|
+
v.set(r, {
|
|
959
1101
|
id: r,
|
|
960
1102
|
name: e,
|
|
961
1103
|
type: "suite",
|
|
@@ -964,11 +1106,11 @@ var Ot = () => typeof window < "u" ? (window.__TWD_STATE__ || (window.__TWD_STAT
|
|
|
964
1106
|
depth: T.length,
|
|
965
1107
|
parent: n,
|
|
966
1108
|
handler: t
|
|
967
|
-
}), n &&
|
|
1109
|
+
}), n && v.get(n).children.push(r), T.push(r), t(), T.pop();
|
|
968
1110
|
};
|
|
969
|
-
|
|
970
|
-
const r =
|
|
971
|
-
|
|
1111
|
+
Ye.only = (e, t) => {
|
|
1112
|
+
const r = H(), n = T.at(-1);
|
|
1113
|
+
v.set(r, {
|
|
972
1114
|
id: r,
|
|
973
1115
|
name: e,
|
|
974
1116
|
type: "suite",
|
|
@@ -978,11 +1120,11 @@ et.only = (e, t) => {
|
|
|
978
1120
|
parent: n,
|
|
979
1121
|
handler: t,
|
|
980
1122
|
only: !0
|
|
981
|
-
}), n &&
|
|
1123
|
+
}), n && v.get(n).children.push(r), T.push(r), t(), T.pop();
|
|
982
1124
|
};
|
|
983
|
-
|
|
984
|
-
const r =
|
|
985
|
-
|
|
1125
|
+
Ye.skip = (e, t) => {
|
|
1126
|
+
const r = H(), n = T.at(-1);
|
|
1127
|
+
v.set(r, {
|
|
986
1128
|
id: r,
|
|
987
1129
|
name: e,
|
|
988
1130
|
type: "suite",
|
|
@@ -992,10 +1134,10 @@ et.skip = (e, t) => {
|
|
|
992
1134
|
parent: n,
|
|
993
1135
|
handler: t,
|
|
994
1136
|
skip: !0
|
|
995
|
-
}), n &&
|
|
1137
|
+
}), n && v.get(n).children.push(r), T.push(r), t(), T.pop();
|
|
996
1138
|
};
|
|
997
|
-
var
|
|
998
|
-
const r =
|
|
1139
|
+
var Ze = (e, t) => {
|
|
1140
|
+
const r = H(), n = T.at(-1), s = {
|
|
999
1141
|
id: r,
|
|
1000
1142
|
name: e,
|
|
1001
1143
|
type: "test",
|
|
@@ -1004,10 +1146,10 @@ var tt = (e, t) => {
|
|
|
1004
1146
|
logs: [],
|
|
1005
1147
|
parent: n
|
|
1006
1148
|
};
|
|
1007
|
-
n &&
|
|
1149
|
+
n && v.get(n).children.push(r), v.set(r, s);
|
|
1008
1150
|
};
|
|
1009
|
-
|
|
1010
|
-
const r =
|
|
1151
|
+
Ze.only = (e, t) => {
|
|
1152
|
+
const r = H(), n = T.at(-1), s = {
|
|
1011
1153
|
id: r,
|
|
1012
1154
|
name: e,
|
|
1013
1155
|
type: "test",
|
|
@@ -1017,10 +1159,10 @@ tt.only = (e, t) => {
|
|
|
1017
1159
|
parent: n,
|
|
1018
1160
|
only: !0
|
|
1019
1161
|
};
|
|
1020
|
-
n &&
|
|
1162
|
+
n && v.get(n).children.push(r), v.set(r, s);
|
|
1021
1163
|
};
|
|
1022
|
-
|
|
1023
|
-
const r =
|
|
1164
|
+
Ze.skip = (e, t) => {
|
|
1165
|
+
const r = H(), n = T.at(-1), s = {
|
|
1024
1166
|
id: r,
|
|
1025
1167
|
name: e,
|
|
1026
1168
|
type: "test",
|
|
@@ -1031,170 +1173,154 @@ tt.skip = (e, t) => {
|
|
|
1031
1173
|
parent: n,
|
|
1032
1174
|
skip: !0
|
|
1033
1175
|
};
|
|
1034
|
-
n &&
|
|
1176
|
+
n && v.get(n).children.push(r), v.set(r, s);
|
|
1035
1177
|
};
|
|
1036
|
-
var
|
|
1178
|
+
var Ot = (e) => {
|
|
1037
1179
|
const t = [], r = [];
|
|
1038
1180
|
let n = e;
|
|
1039
1181
|
for (; n; )
|
|
1040
|
-
|
|
1182
|
+
Le.has(n) && t.unshift(...Le.get(n)), We.has(n) && r.push(...We.get(n)), n = v.get(n)?.parent;
|
|
1041
1183
|
return {
|
|
1042
1184
|
before: t,
|
|
1043
1185
|
after: r
|
|
1044
1186
|
};
|
|
1045
|
-
},
|
|
1046
|
-
const t =
|
|
1047
|
-
return t ? t.only ? !0 : t.children ? t.children.some((r) =>
|
|
1048
|
-
},
|
|
1049
|
-
let t =
|
|
1187
|
+
}, D = (e) => {
|
|
1188
|
+
const t = v.get(e);
|
|
1189
|
+
return t ? t.only ? !0 : t.children ? t.children.some((r) => D(r)) : !1 : !1;
|
|
1190
|
+
}, jt = (e) => {
|
|
1191
|
+
let t = v.get(e);
|
|
1050
1192
|
for (; t?.parent; ) {
|
|
1051
|
-
const r =
|
|
1193
|
+
const r = v.get(t.parent);
|
|
1052
1194
|
if (r?.only) return !0;
|
|
1053
1195
|
t = r;
|
|
1054
1196
|
}
|
|
1055
1197
|
return !1;
|
|
1056
|
-
},
|
|
1057
|
-
let t =
|
|
1198
|
+
}, de = (e) => {
|
|
1199
|
+
let t = v.get(e);
|
|
1058
1200
|
for (; t; ) {
|
|
1059
1201
|
if (t.skip) return !0;
|
|
1060
1202
|
if (!t.parent) break;
|
|
1061
|
-
t =
|
|
1203
|
+
t = v.get(t.parent);
|
|
1062
1204
|
}
|
|
1063
1205
|
return !1;
|
|
1064
|
-
},
|
|
1206
|
+
}, et = class {
|
|
1065
1207
|
constructor(e, t) {
|
|
1066
|
-
|
|
1208
|
+
ze(this, "events", void 0), ze(this, "retryCount", void 0), this.events = e, this.retryCount = t?.retryCount ?? 1;
|
|
1067
1209
|
}
|
|
1068
1210
|
async runAll() {
|
|
1069
|
-
const e = Array.from(
|
|
1211
|
+
const e = Array.from(v.values()).filter((r) => !r.parent && r.type === "suite"), t = Array.from(v.values()).some((r) => r.only);
|
|
1070
1212
|
for (const r of e) await this.runSuite(r, t);
|
|
1071
|
-
return
|
|
1213
|
+
return v;
|
|
1072
1214
|
}
|
|
1073
1215
|
async runSingle(e) {
|
|
1074
|
-
const t =
|
|
1216
|
+
const t = v.get(e);
|
|
1075
1217
|
!t || t.type !== "test" || await this.runTest(t, !1);
|
|
1076
1218
|
}
|
|
1077
1219
|
async runByIds(e) {
|
|
1078
|
-
const t = new Set(e), r = Array.from(
|
|
1079
|
-
for (const
|
|
1080
|
-
return
|
|
1220
|
+
const t = new Set(e), r = Array.from(v.values()).filter((s) => !s.parent && s.type === "suite"), n = Array.from(v.values()).some((s) => s.only);
|
|
1221
|
+
for (const s of r) await this.runSuiteByIds(s, t, n);
|
|
1222
|
+
return v;
|
|
1081
1223
|
}
|
|
1082
1224
|
async runSuiteByIds(e, t, r) {
|
|
1083
1225
|
if (!this.hasDescendantInSet(e, t)) return;
|
|
1084
|
-
if (
|
|
1226
|
+
if (de(e.id) && !D(e.id)) {
|
|
1085
1227
|
this.events.onSkip?.(e);
|
|
1086
1228
|
return;
|
|
1087
1229
|
}
|
|
1088
|
-
if (r && !
|
|
1230
|
+
if (r && !D(e.id)) return;
|
|
1089
1231
|
this.events.onSuiteStart?.(e);
|
|
1090
|
-
const n = (e.children || []).map((
|
|
1091
|
-
for (const
|
|
1232
|
+
const n = (e.children || []).map((s) => v.get(s));
|
|
1233
|
+
for (const s of n) s.type === "suite" ? await this.runSuiteByIds(s, t, r) : s.type === "test" && t.has(s.id) && await this.runTest(s, r);
|
|
1092
1234
|
this.events.onSuiteEnd?.(e);
|
|
1093
1235
|
}
|
|
1094
1236
|
hasDescendantInSet(e, t) {
|
|
1095
1237
|
return t.has(e.id) ? !0 : e.children ? e.children.some((r) => {
|
|
1096
|
-
const n =
|
|
1238
|
+
const n = v.get(r);
|
|
1097
1239
|
return n ? this.hasDescendantInSet(n, t) : !1;
|
|
1098
1240
|
}) : !1;
|
|
1099
1241
|
}
|
|
1100
1242
|
async runSuite(e, t) {
|
|
1101
|
-
if (
|
|
1243
|
+
if (de(e.id) && !D(e.id)) {
|
|
1102
1244
|
this.events.onSkip?.(e);
|
|
1103
1245
|
return;
|
|
1104
1246
|
}
|
|
1105
|
-
if (t && !
|
|
1247
|
+
if (t && !D(e.id)) return;
|
|
1106
1248
|
this.events.onSuiteStart?.(e);
|
|
1107
|
-
const r = (e.children || []).map((n) =>
|
|
1249
|
+
const r = (e.children || []).map((n) => v.get(n));
|
|
1108
1250
|
for (const n of r) n.type === "suite" ? await this.runSuite(n, t) : n.type === "test" && await this.runTest(n, t);
|
|
1109
1251
|
this.events.onSuiteEnd?.(e);
|
|
1110
1252
|
}
|
|
1111
1253
|
async runTest(e, t) {
|
|
1112
|
-
if ((
|
|
1254
|
+
if ((de(e.id) || e.skip) && !e.only) {
|
|
1113
1255
|
this.events.onSkip(e);
|
|
1114
1256
|
return;
|
|
1115
1257
|
}
|
|
1116
|
-
const r =
|
|
1258
|
+
const r = jt(e.id);
|
|
1117
1259
|
if (t && !e.only && !r) {
|
|
1118
1260
|
this.events.onSkip(e);
|
|
1119
1261
|
return;
|
|
1120
1262
|
}
|
|
1121
1263
|
this.events.onStart?.(e);
|
|
1122
|
-
const n =
|
|
1123
|
-
let
|
|
1124
|
-
for (let
|
|
1264
|
+
const n = Ot(e.parent);
|
|
1265
|
+
let s = null;
|
|
1266
|
+
for (let o = 1; o <= this.retryCount; o++) try {
|
|
1125
1267
|
for (const l of n.before) await l();
|
|
1126
|
-
e.logs = [], await e.handler(), this.events.onPass(e,
|
|
1268
|
+
e.logs = [], await e.handler(), this.events.onPass(e, o > 1 ? o : void 0);
|
|
1127
1269
|
return;
|
|
1128
1270
|
} catch (l) {
|
|
1129
|
-
|
|
1271
|
+
s = l;
|
|
1130
1272
|
} finally {
|
|
1131
1273
|
for (const l of n.after) await l();
|
|
1132
1274
|
}
|
|
1133
|
-
this.events.onFail(e,
|
|
1275
|
+
this.events.onFail(e, s);
|
|
1134
1276
|
}
|
|
1135
1277
|
};
|
|
1136
|
-
window.__testRunner =
|
|
1137
|
-
var
|
|
1278
|
+
window.__testRunner = et;
|
|
1279
|
+
var we = "1.6.6", Ut = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
|
|
1138
1280
|
rules: [],
|
|
1139
1281
|
counts: {}
|
|
1140
1282
|
}), window.__TWD_MOCK_STATE__) : {
|
|
1141
1283
|
rules: [],
|
|
1142
1284
|
counts: {}
|
|
1143
|
-
},
|
|
1144
|
-
if (
|
|
1285
|
+
}, U = Ut(), ye = U.rules, He = !1, qt = async (e) => {
|
|
1286
|
+
if (He) {
|
|
1145
1287
|
console.warn("[TWD] Request mocking already initialized");
|
|
1146
1288
|
return;
|
|
1147
1289
|
}
|
|
1148
|
-
"serviceWorker" in navigator && (
|
|
1290
|
+
"serviceWorker" in navigator && (He = !0, await navigator.serviceWorker.register(`${e ?? "/mock-sw.js"}?v=${we}`), navigator.serviceWorker.controller || await new Promise((t) => {
|
|
1149
1291
|
navigator.serviceWorker.addEventListener("controllerchange", t, { once: !0 });
|
|
1150
1292
|
}), navigator.serviceWorker.addEventListener("message", (t) => {
|
|
1151
1293
|
if (t.data?.type === "EXECUTED") {
|
|
1152
|
-
const { alias: r, request: n, hitCount:
|
|
1153
|
-
|
|
1294
|
+
const { alias: r, request: n, hitCount: s } = t.data, o = ye.find((l) => l.alias === r);
|
|
1295
|
+
o && (o.executed = !0, o.request = n, o.hitCount = s), U.counts[r] = s ?? (U.counts[r] ?? 0) + 1;
|
|
1154
1296
|
}
|
|
1155
1297
|
}));
|
|
1156
|
-
},
|
|
1298
|
+
}, Vt = () => ye, Jt = () => {
|
|
1157
1299
|
navigator.serviceWorker.controller?.postMessage({
|
|
1158
1300
|
type: "CLEAR_RULES",
|
|
1159
|
-
version:
|
|
1160
|
-
}),
|
|
1161
|
-
for (const e in
|
|
1162
|
-
},
|
|
1301
|
+
version: we
|
|
1302
|
+
}), ye.length = 0;
|
|
1303
|
+
for (const e in U.counts) delete U.counts[e];
|
|
1304
|
+
}, Kt = () => /* @__PURE__ */ d(oe, {
|
|
1163
1305
|
className: "lucide-wifi-pen-icon lucide-wifi-pen",
|
|
1164
1306
|
dataTestId: "wifi-pen-icon",
|
|
1165
1307
|
children: [
|
|
1166
|
-
/* @__PURE__ */
|
|
1167
|
-
/* @__PURE__ */
|
|
1168
|
-
/* @__PURE__ */
|
|
1169
|
-
/* @__PURE__ */
|
|
1308
|
+
/* @__PURE__ */ d("path", { d: "M2 8.82a15 15 0 0 1 20 0" }),
|
|
1309
|
+
/* @__PURE__ */ d("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" }),
|
|
1310
|
+
/* @__PURE__ */ d("path", { d: "M5 12.859a10 10 0 0 1 10.5-2.222" }),
|
|
1311
|
+
/* @__PURE__ */ d("path", { d: "M8.5 16.429a5 5 0 0 1 3-1.406" })
|
|
1170
1312
|
]
|
|
1171
|
-
}),
|
|
1172
|
-
const e =
|
|
1173
|
-
return /* @__PURE__ */
|
|
1313
|
+
}), Xt = () => {
|
|
1314
|
+
const e = Vt(), t = e.filter((n) => n.executed);
|
|
1315
|
+
return /* @__PURE__ */ d("button", {
|
|
1174
1316
|
onClick: () => {
|
|
1175
1317
|
console.group("🌐 TWD Mock Rules"), console.log("Total rules:", e.length), console.log("Triggered rules:", t.length), console.log("Rules details:"), console.log(e), console.groupEnd();
|
|
1176
1318
|
},
|
|
1177
1319
|
"aria-label": "View mock rules details in console",
|
|
1178
|
-
|
|
1179
|
-
background: "var(--twd-button-secondary)",
|
|
1180
|
-
border: "1px solid var(--twd-button-border)",
|
|
1181
|
-
borderRadius: "var(--twd-border-radius-lg)",
|
|
1182
|
-
padding: "var(--twd-spacing-md) var(--twd-spacing-lg)",
|
|
1183
|
-
cursor: "pointer",
|
|
1184
|
-
fontSize: "var(--twd-font-size-sm)",
|
|
1185
|
-
color: "var(--twd-button-secondary-text)",
|
|
1186
|
-
display: "flex",
|
|
1187
|
-
alignItems: "center",
|
|
1188
|
-
gap: "var(--twd-spacing-md)",
|
|
1189
|
-
marginBottom: "10px",
|
|
1190
|
-
width: "100%",
|
|
1191
|
-
textAlign: "left",
|
|
1192
|
-
transition: "all var(--twd-animation-duration) ease",
|
|
1193
|
-
boxShadow: "var(--twd-shadow-sm)"
|
|
1194
|
-
},
|
|
1320
|
+
className: "twd-btn twd-btn-mock-rules",
|
|
1195
1321
|
children: [
|
|
1196
|
-
/* @__PURE__ */
|
|
1197
|
-
/* @__PURE__ */
|
|
1322
|
+
/* @__PURE__ */ d(Kt, {}),
|
|
1323
|
+
/* @__PURE__ */ d("span", {
|
|
1198
1324
|
style: { flex: 1 },
|
|
1199
1325
|
children: [
|
|
1200
1326
|
"Rules: ",
|
|
@@ -1204,7 +1330,7 @@ var be = "1.6.5", qt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ ||
|
|
|
1204
1330
|
" triggered"
|
|
1205
1331
|
]
|
|
1206
1332
|
}),
|
|
1207
|
-
/* @__PURE__ */
|
|
1333
|
+
/* @__PURE__ */ d("span", {
|
|
1208
1334
|
style: {
|
|
1209
1335
|
fontSize: "var(--twd-font-size-xs)",
|
|
1210
1336
|
color: "var(--twd-text)",
|
|
@@ -1214,11 +1340,11 @@ var be = "1.6.5", qt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ ||
|
|
|
1214
1340
|
})
|
|
1215
1341
|
]
|
|
1216
1342
|
});
|
|
1217
|
-
},
|
|
1218
|
-
function
|
|
1219
|
-
|
|
1343
|
+
}, Gt = /* @__PURE__ */ new Map();
|
|
1344
|
+
function Qt() {
|
|
1345
|
+
Gt.clear();
|
|
1220
1346
|
}
|
|
1221
|
-
var
|
|
1347
|
+
var Yt = (e) => e instanceof Error && "actual" in e && "expected" in e, tt = (e) => e.actual !== void 0 && e.expected !== void 0 ? {
|
|
1222
1348
|
type: "diff",
|
|
1223
1349
|
actual: e.actual,
|
|
1224
1350
|
expected: e.expected,
|
|
@@ -1226,61 +1352,48 @@ var Zt = (e) => e instanceof Error && "actual" in e && "expected" in e, nt = (e)
|
|
|
1226
1352
|
} : {
|
|
1227
1353
|
type: "message",
|
|
1228
1354
|
message: e.message
|
|
1229
|
-
},
|
|
1230
|
-
const t =
|
|
1355
|
+
}, Zt = (e) => {
|
|
1356
|
+
const t = tt(e);
|
|
1231
1357
|
t.type === "diff" ? (console.error(`Assertion failed with operator: ${t.operator || "unknown"}`), console.group("Expected:"), console.log(t.expected), console.groupEnd(), console.group("Actual:"), console.log(t.actual), console.groupEnd()) : console.error(t.message);
|
|
1232
|
-
},
|
|
1358
|
+
}, er = (e) => {
|
|
1233
1359
|
if (e.status === "pass") return `Test "${e.name}" passed.`;
|
|
1234
1360
|
if (e.status === "fail") {
|
|
1235
1361
|
if (!e.logs || e.logs.length === 0) return `Test "${e.name}" failed.`;
|
|
1236
1362
|
const t = e.logs[e.logs.length - 1];
|
|
1237
1363
|
try {
|
|
1238
1364
|
const r = JSON.parse(t);
|
|
1239
|
-
return r.type ===
|
|
1365
|
+
return r.type === A.CHAI_MESSAGE || r.type === A.ERROR ? `Test "${e.name}" failed. ${r.message}` : r.type === A.CHAI_DIFF ? `Test "${e.name}" failed. Expected value does not match actual value.` : `Test "${e.name}" failed.`;
|
|
1240
1366
|
} catch {
|
|
1241
1367
|
return `Test "${e.name}" failed. ${t}`;
|
|
1242
1368
|
}
|
|
1243
1369
|
} else if (e.status === "skip") return `Test "${e.name}" skipped.`;
|
|
1244
1370
|
return "";
|
|
1245
|
-
},
|
|
1246
|
-
const t = e.filter((l) => l.type === "test"), r = t.filter((l) => l.status === "pass").length, n = t.filter((l) => l.status === "fail").length,
|
|
1247
|
-
return n > 0 ? (
|
|
1248
|
-
},
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
marginBottom: "var(--twd-spacing-md)"
|
|
1252
|
-
},
|
|
1253
|
-
children: /* @__PURE__ */ c("input", {
|
|
1371
|
+
}, tr = (e) => {
|
|
1372
|
+
const t = e.filter((l) => l.type === "test"), r = t.filter((l) => l.status === "pass").length, n = t.filter((l) => l.status === "fail").length, s = t.filter((l) => l.status === "skip").length, o = [];
|
|
1373
|
+
return n > 0 ? (o.push("Test run completed."), o.push(`${r} test${r !== 1 ? "s" : ""} passed`), o.push(`${n} test${n !== 1 ? "s" : ""} failed`), s > 0 && o.push(`${s} test${s !== 1 ? "s" : ""} skipped`), o.join(", ") + ".") : (o.push("All tests passed."), o.push(`${r} test${r !== 1 ? "s" : ""} completed`), s > 0 && o.push(`${s} test${s !== 1 ? "s" : ""} skipped`), o.join(", ") + ".");
|
|
1374
|
+
}, rr = ({ value: e, onChange: t }) => /* @__PURE__ */ d("div", {
|
|
1375
|
+
className: "twd-search-wrapper",
|
|
1376
|
+
children: /* @__PURE__ */ d("input", {
|
|
1254
1377
|
type: "search",
|
|
1255
1378
|
id: "twd-search-input",
|
|
1256
1379
|
"aria-label": "Filter tests",
|
|
1257
1380
|
placeholder: "Filter tests...",
|
|
1258
1381
|
value: e,
|
|
1259
1382
|
onInput: (r) => t(r.target.value),
|
|
1260
|
-
|
|
1261
|
-
width: "100%",
|
|
1262
|
-
padding: "var(--twd-spacing-md)",
|
|
1263
|
-
background: "var(--twd-background)",
|
|
1264
|
-
color: "var(--twd-text)",
|
|
1265
|
-
border: "1px solid var(--twd-border)",
|
|
1266
|
-
borderRadius: "var(--twd-border-radius)",
|
|
1267
|
-
fontSize: "var(--twd-font-size-md)",
|
|
1268
|
-
boxSizing: "border-box",
|
|
1269
|
-
outline: "none"
|
|
1270
|
-
}
|
|
1383
|
+
className: "twd-search-input"
|
|
1271
1384
|
})
|
|
1272
|
-
}),
|
|
1385
|
+
}), nr = (e, t) => {
|
|
1273
1386
|
if (!t.trim()) return e;
|
|
1274
|
-
const r = t.toLowerCase(), n = (
|
|
1275
|
-
const
|
|
1276
|
-
if (
|
|
1277
|
-
const l = (
|
|
1278
|
-
return
|
|
1279
|
-
...
|
|
1280
|
-
childrenNodes:
|
|
1387
|
+
const r = t.toLowerCase(), n = (s) => {
|
|
1388
|
+
const o = s.name.toLowerCase().includes(r);
|
|
1389
|
+
if (s.type === "test") return o ? s : null;
|
|
1390
|
+
const l = (s.childrenNodes || []).map(n).filter((c) => c !== null);
|
|
1391
|
+
return o || l.length > 0 ? {
|
|
1392
|
+
...s,
|
|
1393
|
+
childrenNodes: o ? s.childrenNodes : l
|
|
1281
1394
|
} : null;
|
|
1282
1395
|
};
|
|
1283
|
-
return e.map(n).filter((
|
|
1396
|
+
return e.map(n).filter((s) => s !== null);
|
|
1284
1397
|
}, sr = (e) => {
|
|
1285
1398
|
const t = /* @__PURE__ */ new Map(), r = [];
|
|
1286
1399
|
for (const n of e) t.set(n.id, {
|
|
@@ -1289,7 +1402,7 @@ var Zt = (e) => e instanceof Error && "actual" in e && "expected" in e, nt = (e)
|
|
|
1289
1402
|
});
|
|
1290
1403
|
for (const n of t.values()) n.parent ? t.get(n.parent)?.childrenNodes?.push(n) : r.push(n);
|
|
1291
1404
|
return r;
|
|
1292
|
-
},
|
|
1405
|
+
}, or = {
|
|
1293
1406
|
left: {
|
|
1294
1407
|
left: 0,
|
|
1295
1408
|
borderRight: "1px solid var(--twd-border)"
|
|
@@ -1298,104 +1411,90 @@ var Zt = (e) => e instanceof Error && "actual" in e && "expected" in e, nt = (e)
|
|
|
1298
1411
|
right: 0,
|
|
1299
1412
|
borderLeft: "1px solid var(--twd-border)"
|
|
1300
1413
|
}
|
|
1301
|
-
},
|
|
1414
|
+
}, ir = (e) => e ? sessionStorage.getItem("twd-search-filter") || "" : (sessionStorage.removeItem("twd-search-filter"), ""), ar = (e) => sessionStorage.getItem("twd-sidebar-open") ? sessionStorage.getItem("twd-sidebar-open") === "true" : e, rt = (e) => {
|
|
1302
1415
|
const t = [];
|
|
1303
1416
|
for (const r of e)
|
|
1304
|
-
r.type === "test" && t.push(r.id), r.childrenNodes && t.push(...
|
|
1417
|
+
r.type === "test" && t.push(r.id), r.childrenNodes && t.push(...rt(r.childrenNodes));
|
|
1305
1418
|
return t;
|
|
1306
|
-
},
|
|
1307
|
-
const [n,
|
|
1308
|
-
|
|
1309
|
-
isOpen:
|
|
1419
|
+
}, lr = ({ open: e, position: t = "left", search: r }) => {
|
|
1420
|
+
const [n, s] = B(0), [o, l] = B(ar(e));
|
|
1421
|
+
Bt({
|
|
1422
|
+
isOpen: o,
|
|
1310
1423
|
position: t
|
|
1311
1424
|
});
|
|
1312
|
-
const [
|
|
1313
|
-
|
|
1314
|
-
const h = () =>
|
|
1425
|
+
const [c, u] = B(""), [a, _] = B(ir(r));
|
|
1426
|
+
se(() => {
|
|
1427
|
+
const h = () => s((b) => b + 1);
|
|
1315
1428
|
return window.addEventListener("twd:state-change", h), () => window.removeEventListener("twd:state-change", h);
|
|
1316
1429
|
}, []);
|
|
1317
|
-
const i = new
|
|
1430
|
+
const i = new et({
|
|
1318
1431
|
onStart: (h) => {
|
|
1319
|
-
h.status = "running",
|
|
1432
|
+
h.status = "running", s((b) => b + 1);
|
|
1320
1433
|
},
|
|
1321
1434
|
onPass: (h) => {
|
|
1322
|
-
h.status = "pass",
|
|
1435
|
+
h.status = "pass", s((b) => b + 1);
|
|
1323
1436
|
},
|
|
1324
1437
|
onFail: (h, b) => {
|
|
1325
|
-
if (h.status = "fail", console.group(`%c❌ Test failed: ${h.name}`, "color: red; font-weight: bold;"),
|
|
1326
|
-
|
|
1327
|
-
const
|
|
1328
|
-
|
|
1329
|
-
type:
|
|
1330
|
-
expected:
|
|
1331
|
-
actual:
|
|
1438
|
+
if (h.status = "fail", console.group(`%c❌ Test failed: ${h.name}`, "color: red; font-weight: bold;"), Yt(b)) {
|
|
1439
|
+
Zt(b);
|
|
1440
|
+
const $ = tt(b);
|
|
1441
|
+
$.type === "diff" ? h.logs.push(JSON.stringify({
|
|
1442
|
+
type: A.CHAI_DIFF,
|
|
1443
|
+
expected: $.expected,
|
|
1444
|
+
actual: $.actual
|
|
1332
1445
|
})) : h.logs.push(JSON.stringify({
|
|
1333
|
-
type:
|
|
1334
|
-
message: `Test failed: ${
|
|
1446
|
+
type: A.CHAI_MESSAGE,
|
|
1447
|
+
message: `Test failed: ${$.message}`
|
|
1335
1448
|
}));
|
|
1336
1449
|
} else
|
|
1337
1450
|
console.error(b.message), h.logs.push(JSON.stringify({
|
|
1338
|
-
type:
|
|
1451
|
+
type: A.ERROR,
|
|
1339
1452
|
message: `Test failed: ${b.message}`
|
|
1340
1453
|
}));
|
|
1341
|
-
console.groupEnd(),
|
|
1454
|
+
console.groupEnd(), s(($) => $ + 1);
|
|
1342
1455
|
},
|
|
1343
1456
|
onSkip: (h) => {
|
|
1344
|
-
h.status = "skip",
|
|
1457
|
+
h.status = "skip", s((b) => b + 1);
|
|
1345
1458
|
}
|
|
1346
|
-
}),
|
|
1347
|
-
|
|
1459
|
+
}), f = (h) => {
|
|
1460
|
+
_(h), h ? sessionStorage.setItem("twd-search-filter", h) : sessionStorage.removeItem("twd-search-filter");
|
|
1348
1461
|
}, p = (h) => {
|
|
1349
1462
|
l(h), sessionStorage.setItem("twd-sidebar-open", h.toString());
|
|
1350
|
-
},
|
|
1463
|
+
}, y = Array.from(v.values()), C = G(() => sr(y), [n]), k = G(() => nr(C, a), [C, a]), { filteredTestIds: g, displayTests: m } = G(() => {
|
|
1351
1464
|
if (a) {
|
|
1352
|
-
const h =
|
|
1465
|
+
const h = rt(k), b = new Set(h);
|
|
1353
1466
|
return {
|
|
1354
1467
|
filteredTestIds: h,
|
|
1355
|
-
displayTests:
|
|
1468
|
+
displayTests: y.filter(($) => $.type === "test" && b.has($.id))
|
|
1356
1469
|
};
|
|
1357
1470
|
}
|
|
1358
1471
|
return {
|
|
1359
1472
|
filteredTestIds: null,
|
|
1360
|
-
displayTests:
|
|
1473
|
+
displayTests: y.filter((h) => h.type === "test")
|
|
1361
1474
|
};
|
|
1362
1475
|
}, [
|
|
1363
1476
|
k,
|
|
1364
1477
|
a,
|
|
1365
1478
|
n
|
|
1366
|
-
]),
|
|
1367
|
-
u(""), sessionStorage.removeItem("twd-last-run-test-name"), g ? await i.runByIds(g) : await i.runAll(), u(
|
|
1368
|
-
},
|
|
1369
|
-
const b = Array.from(
|
|
1370
|
-
b && (u(""), sessionStorage.setItem("twd-last-run-test-name", b.name), await i.runSingle(b.id), u(
|
|
1479
|
+
]), R = async () => {
|
|
1480
|
+
u(""), sessionStorage.removeItem("twd-last-run-test-name"), g ? await i.runByIds(g) : await i.runAll(), u(tr(y));
|
|
1481
|
+
}, N = async (h) => {
|
|
1482
|
+
const b = Array.from(v.values()).filter(($) => $.type === "test").find(($) => $.id === h);
|
|
1483
|
+
b && (u(""), sessionStorage.setItem("twd-last-run-test-name", b.name), await i.runSingle(b.id), u(er(b)));
|
|
1371
1484
|
};
|
|
1372
|
-
if (!
|
|
1485
|
+
if (!o) return /* @__PURE__ */ d(Ht, {
|
|
1373
1486
|
position: t,
|
|
1374
1487
|
setOpen: p
|
|
1375
1488
|
});
|
|
1376
|
-
const z =
|
|
1377
|
-
return /* @__PURE__ */
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
position: "fixed",
|
|
1381
|
-
top: 0,
|
|
1382
|
-
bottom: 0,
|
|
1383
|
-
width: "var(--twd-sidebar-width)",
|
|
1384
|
-
background: "var(--twd-background)",
|
|
1385
|
-
fontSize: "var(--twd-font-size-md)",
|
|
1386
|
-
overflowY: "auto",
|
|
1387
|
-
boxShadow: "var(--twd-shadow)",
|
|
1388
|
-
textAlign: "left",
|
|
1389
|
-
zIndex: "var(--twd-z-index-sidebar)",
|
|
1390
|
-
pointerEvents: "all",
|
|
1391
|
-
isolation: "isolate",
|
|
1392
|
-
...ir[t]
|
|
1393
|
-
},
|
|
1489
|
+
const z = m.length;
|
|
1490
|
+
return /* @__PURE__ */ d("div", {
|
|
1491
|
+
className: "twd-sidebar",
|
|
1492
|
+
style: or[t],
|
|
1394
1493
|
"data-testid": "twd-sidebar",
|
|
1395
1494
|
role: "complementary",
|
|
1396
1495
|
"aria-label": "Test While Developing sidebar",
|
|
1397
1496
|
children: [
|
|
1398
|
-
/* @__PURE__ */
|
|
1497
|
+
/* @__PURE__ */ d("div", {
|
|
1399
1498
|
"aria-live": "polite",
|
|
1400
1499
|
"aria-atomic": "true",
|
|
1401
1500
|
style: {
|
|
@@ -1408,142 +1507,92 @@ var Zt = (e) => e instanceof Error && "actual" in e && "expected" in e, nt = (e)
|
|
|
1408
1507
|
overflow: "hidden",
|
|
1409
1508
|
clip: "rect(0 0 0 0)"
|
|
1410
1509
|
},
|
|
1411
|
-
children:
|
|
1510
|
+
children: c
|
|
1412
1511
|
}),
|
|
1413
|
-
/* @__PURE__ */
|
|
1512
|
+
/* @__PURE__ */ d("div", {
|
|
1414
1513
|
"data-testid": "twd-sidebar-header",
|
|
1415
|
-
|
|
1416
|
-
padding: "var(--twd-spacing-md)",
|
|
1417
|
-
background: "var(--twd-background)",
|
|
1418
|
-
position: "sticky",
|
|
1419
|
-
top: 0,
|
|
1420
|
-
zIndex: "var(--twd-z-index-sticky)",
|
|
1421
|
-
borderBottom: "1px solid var(--twd-border)"
|
|
1422
|
-
},
|
|
1514
|
+
className: "twd-sidebar-header",
|
|
1423
1515
|
children: [
|
|
1424
|
-
/* @__PURE__ */
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
alignItems: "center",
|
|
1429
|
-
marginBottom: "var(--twd-spacing-xl)"
|
|
1430
|
-
},
|
|
1431
|
-
children: [/* @__PURE__ */ c("div", {
|
|
1432
|
-
style: {
|
|
1433
|
-
display: "flex",
|
|
1434
|
-
gap: "var(--twd-spacing-xs)"
|
|
1435
|
-
},
|
|
1516
|
+
/* @__PURE__ */ d("div", {
|
|
1517
|
+
className: "twd-sidebar-header-row",
|
|
1518
|
+
children: [/* @__PURE__ */ d("div", {
|
|
1519
|
+
className: "twd-sidebar-header-buttons",
|
|
1436
1520
|
children: [
|
|
1437
|
-
/* @__PURE__ */
|
|
1438
|
-
onClick:
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
color: "var(--twd-button-primary-text)",
|
|
1442
|
-
padding: "var(--twd-spacing-xs) var(--twd-spacing-md)",
|
|
1443
|
-
borderRadius: "var(--twd-border-radius)",
|
|
1444
|
-
border: "none",
|
|
1445
|
-
cursor: "pointer"
|
|
1446
|
-
},
|
|
1447
|
-
children: /* @__PURE__ */ c("span", {
|
|
1521
|
+
/* @__PURE__ */ d("button", {
|
|
1522
|
+
onClick: R,
|
|
1523
|
+
className: "twd-btn twd-btn-primary",
|
|
1524
|
+
children: /* @__PURE__ */ d("span", {
|
|
1448
1525
|
"aria-live": "polite",
|
|
1449
1526
|
children: a ? "Run Filtered" : "Run All"
|
|
1450
1527
|
})
|
|
1451
1528
|
}),
|
|
1452
|
-
/* @__PURE__ */
|
|
1529
|
+
/* @__PURE__ */ d("button", {
|
|
1453
1530
|
onClick: () => {
|
|
1454
|
-
|
|
1531
|
+
Jt(), Qt();
|
|
1455
1532
|
},
|
|
1456
1533
|
"aria-label": "Clear all mocks",
|
|
1457
|
-
|
|
1458
|
-
background: "var(--twd-button-secondary)",
|
|
1459
|
-
color: "var(--twd-button-secondary-text)",
|
|
1460
|
-
padding: "var(--twd-spacing-xs) var(--twd-spacing-md)",
|
|
1461
|
-
borderRadius: "var(--twd-border-radius)",
|
|
1462
|
-
border: "1px solid var(--twd-button-border)",
|
|
1463
|
-
cursor: "pointer"
|
|
1464
|
-
},
|
|
1534
|
+
className: "twd-btn twd-btn-secondary",
|
|
1465
1535
|
children: "Clear mocks"
|
|
1466
1536
|
}),
|
|
1467
|
-
/* @__PURE__ */
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
fontSize: "var(--twd-font-size-sm)",
|
|
1471
|
-
alignSelf: "center"
|
|
1472
|
-
},
|
|
1473
|
-
children: ["v", be]
|
|
1537
|
+
/* @__PURE__ */ d("span", {
|
|
1538
|
+
className: "twd-sidebar-version",
|
|
1539
|
+
children: ["v", we]
|
|
1474
1540
|
})
|
|
1475
1541
|
]
|
|
1476
|
-
}), /* @__PURE__ */
|
|
1542
|
+
}), /* @__PURE__ */ d("button", {
|
|
1477
1543
|
"aria-label": "Close sidebar",
|
|
1478
|
-
|
|
1479
|
-
background: "transparent",
|
|
1480
|
-
border: "none",
|
|
1481
|
-
cursor: "pointer",
|
|
1482
|
-
fontSize: "var(--twd-font-size-md)",
|
|
1483
|
-
paddingRight: "0",
|
|
1484
|
-
paddingLeft: "0"
|
|
1485
|
-
},
|
|
1544
|
+
className: "twd-btn twd-btn-icon",
|
|
1486
1545
|
onClick: () => p(!1),
|
|
1487
1546
|
children: "✖"
|
|
1488
1547
|
})]
|
|
1489
1548
|
}),
|
|
1490
|
-
/* @__PURE__ */
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
justifyContent: "space-between",
|
|
1494
|
-
alignItems: "center",
|
|
1495
|
-
fontSize: "var(--twd-font-size-md)",
|
|
1496
|
-
color: "var(--twd-text-secondary)",
|
|
1497
|
-
marginBottom: "10px"
|
|
1498
|
-
},
|
|
1499
|
-
children: [/* @__PURE__ */ c("span", {
|
|
1549
|
+
/* @__PURE__ */ d("div", {
|
|
1550
|
+
className: "twd-sidebar-stats",
|
|
1551
|
+
children: [/* @__PURE__ */ d("span", {
|
|
1500
1552
|
style: { color: "var(--twd-text)" },
|
|
1501
1553
|
children: ["Total: ", z]
|
|
1502
|
-
}), /* @__PURE__ */
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
gap: "var(--twd-spacing-xs)"
|
|
1506
|
-
},
|
|
1507
|
-
children: [/* @__PURE__ */ c("span", {
|
|
1554
|
+
}), /* @__PURE__ */ d("div", {
|
|
1555
|
+
className: "twd-sidebar-stats-counts",
|
|
1556
|
+
children: [/* @__PURE__ */ d("span", {
|
|
1508
1557
|
style: { color: "var(--twd-success)" },
|
|
1509
|
-
children: ["✓ ",
|
|
1510
|
-
}), /* @__PURE__ */
|
|
1558
|
+
children: ["✓ ", m.filter((h) => h.status === "pass").length]
|
|
1559
|
+
}), /* @__PURE__ */ d("span", {
|
|
1511
1560
|
style: { color: "var(--twd-error)" },
|
|
1512
|
-
children: ["✗ ",
|
|
1561
|
+
children: ["✗ ", m.filter((h) => h.status === "fail").length]
|
|
1513
1562
|
})]
|
|
1514
1563
|
})]
|
|
1515
1564
|
}),
|
|
1516
|
-
/* @__PURE__ */
|
|
1517
|
-
r && /* @__PURE__ */
|
|
1565
|
+
/* @__PURE__ */ d(Xt, {}),
|
|
1566
|
+
r && /* @__PURE__ */ d(rr, {
|
|
1518
1567
|
value: a,
|
|
1519
|
-
onChange:
|
|
1568
|
+
onChange: f
|
|
1520
1569
|
})
|
|
1521
1570
|
]
|
|
1522
1571
|
}),
|
|
1523
|
-
/* @__PURE__ */
|
|
1524
|
-
|
|
1525
|
-
children: /* @__PURE__ */
|
|
1572
|
+
/* @__PURE__ */ d("div", {
|
|
1573
|
+
className: "twd-sidebar-content",
|
|
1574
|
+
children: /* @__PURE__ */ d(Lt, {
|
|
1526
1575
|
roots: k,
|
|
1527
|
-
runTest:
|
|
1576
|
+
runTest: N,
|
|
1528
1577
|
searchQuery: a
|
|
1529
1578
|
})
|
|
1530
1579
|
})
|
|
1531
1580
|
]
|
|
1532
1581
|
});
|
|
1533
|
-
},
|
|
1534
|
-
|
|
1535
|
-
} }),
|
|
1536
|
-
const { open: r = !0, position: n = "left", serviceWorker:
|
|
1537
|
-
|
|
1582
|
+
}, dr = (e) => ({ render: (t) => {
|
|
1583
|
+
_t(t, e);
|
|
1584
|
+
} }), cr = (e, t) => {
|
|
1585
|
+
const { open: r = !0, position: n = "left", serviceWorker: s = !0, serviceWorkerUrl: o = "/mock-sw.js", theme: l, search: c } = t || {};
|
|
1586
|
+
wt(e, /* @__PURE__ */ d(lr, {
|
|
1538
1587
|
open: r,
|
|
1539
1588
|
position: n,
|
|
1540
|
-
...
|
|
1541
|
-
}),
|
|
1589
|
+
...c !== void 0 && { search: c }
|
|
1590
|
+
}), dr, l), s && qt(o).then(() => {
|
|
1542
1591
|
console.log("Request mocking initialized");
|
|
1543
1592
|
}).catch((u) => {
|
|
1544
1593
|
console.error("Error initializing request mocking:", u);
|
|
1545
1594
|
});
|
|
1546
1595
|
};
|
|
1547
1596
|
export {
|
|
1548
|
-
|
|
1597
|
+
cr as initTWD
|
|
1549
1598
|
};
|