twd-js 1.4.3 → 1.5.1
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 +277 -239
- package/dist/index.cjs.js +32 -32
- package/dist/index.d.ts +27 -0
- package/dist/index.es.js +2775 -2728
- package/dist/mock-sw.js +3 -3
- package/package.json +3 -3
package/dist/bundled.es.js
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var Ze = Object.defineProperty;
|
|
2
|
+
var Qe = (e, t, r) => t in e ? Ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var ge = (e, t, r) => Qe(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
var K, w, We, C, me, He, ze, Ne, le, ne, oe, z = {}, Be = [], et = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Z = Array.isArray;
|
|
5
5
|
function T(e, t) {
|
|
6
6
|
for (var r in t) e[r] = t[r];
|
|
7
7
|
return e;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function ce(e) {
|
|
10
10
|
e && e.parentNode && e.parentNode.removeChild(e);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function tt(e, t, r) {
|
|
13
13
|
var n, s, o, l = {};
|
|
14
14
|
for (o in t) o == "key" ? n = t[o] : o == "ref" ? s = t[o] : l[o] = t[o];
|
|
15
|
-
if (arguments.length > 2 && (l.children = arguments.length > 3 ?
|
|
16
|
-
return
|
|
15
|
+
if (arguments.length > 2 && (l.children = arguments.length > 3 ? K.call(arguments, 2) : r), typeof e == "function" && e.defaultProps != null) for (o in e.defaultProps) l[o] === void 0 && (l[o] = e.defaultProps[o]);
|
|
16
|
+
return U(e, l, n, s, null);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
var o = { type: e, props: t, key: r, ref: n, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: s ?? ++
|
|
18
|
+
function U(e, t, r, n, s) {
|
|
19
|
+
var o = { type: e, props: t, key: r, ref: n, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: s ?? ++We, __i: -1, __u: 0 };
|
|
20
20
|
return s == null && w.vnode != null && w.vnode(o), o;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function D(e) {
|
|
23
23
|
return e.children;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function q(e, t) {
|
|
26
26
|
this.props = e, this.context = t;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
if (t == null) return e.__ ?
|
|
28
|
+
function I(e, t) {
|
|
29
|
+
if (t == null) return e.__ ? I(e.__, e.__i + 1) : null;
|
|
30
30
|
for (var r; t < e.__k.length; t++) if ((r = e.__k[t]) != null && r.__e != null) return r.__e;
|
|
31
|
-
return typeof e.type == "function" ?
|
|
31
|
+
return typeof e.type == "function" ? I(e) : null;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function De(e) {
|
|
34
34
|
var t, r;
|
|
35
35
|
if ((e = e.__) != null && e.__c != null) {
|
|
36
36
|
for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++) if ((r = e.__k[t]) != null && r.__e != null) {
|
|
37
37
|
e.__e = e.__c.base = r.__e;
|
|
38
38
|
break;
|
|
39
39
|
}
|
|
40
|
-
return
|
|
40
|
+
return De(e);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
(!e.__d && (e.__d = !0) && C.push(e) && !
|
|
43
|
+
function ve(e) {
|
|
44
|
+
(!e.__d && (e.__d = !0) && C.push(e) && !G.__r++ || me != w.debounceRendering) && ((me = w.debounceRendering) || He)(G);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
for (var e, t, r, n, s, o, l, c = 1; C.length; ) C.length > c && C.sort(
|
|
48
|
-
|
|
46
|
+
function G() {
|
|
47
|
+
for (var e, t, r, n, s, o, l, c = 1; C.length; ) C.length > c && C.sort(ze), e = C.shift(), c = C.length, e.__d && (r = void 0, n = void 0, s = (n = (t = e).__v).__e, o = [], l = [], t.__P && ((r = T({}, n)).__v = n.__v + 1, w.vnode && w.vnode(r), de(t.__P, r, n, t.__n, t.__P.namespaceURI, 32 & n.__u ? [s] : null, o, s ?? I(n), !!(32 & n.__u), l), r.__v = n.__v, r.__.__k[r.__i] = r, Oe(o, r, l), n.__e = n.__ = null, r.__e != s && De(r)));
|
|
48
|
+
G.__r = 0;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
var i, u, p, _, g, v, m, y = n && n.__k ||
|
|
52
|
-
for (f =
|
|
50
|
+
function Pe(e, t, r, n, s, o, l, c, f, a, h) {
|
|
51
|
+
var i, u, p, _, g, v, m, y = n && n.__k || Be, E = t.length;
|
|
52
|
+
for (f = rt(r, t, y, f, E), i = 0; i < E; i++) (p = r.__k[i]) != null && (u = p.__i == -1 ? z : y[p.__i] || z, p.__i = i, v = de(e, p, u, s, o, l, c, f, a, h), _ = p.__e, p.ref && u.ref != p.ref && (u.ref && _e(u.ref, null, p), h.push(p.ref, p.__c || _, p)), g == null && _ != null && (g = _), (m = !!(4 & p.__u)) || u.__k === p.__k ? f = Fe(p, f, e, m) : typeof p.type == "function" && v !== void 0 ? f = v : _ && (f = _.nextSibling), p.__u &= -7);
|
|
53
53
|
return r.__e = g, f;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function rt(e, t, r, n, s) {
|
|
56
56
|
var o, l, c, f, a, h = r.length, i = h, u = 0;
|
|
57
|
-
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] =
|
|
58
|
-
if (i) for (o = 0; o < h; o++) (c = r[o]) != null && (2 & c.__u) == 0 && (c.__e == n && (n =
|
|
57
|
+
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] = U(null, l, null, null, null) : Z(l) ? l = e.__k[o] = U(D, { children: l }, null, null, null) : l.constructor === void 0 && l.__b > 0 ? l = e.__k[o] = U(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : e.__k[o] = l, f = o + u, l.__ = e, l.__b = e.__b + 1, c = null, (a = l.__i = nt(l, r, f, i)) != -1 && (i--, (c = r[a]) && (c.__u |= 2)), c == null || c.__v == null ? (a == -1 && (s > h ? u-- : s < h && u++), typeof l.type != "function" && (l.__u |= 4)) : a != f && (a == f - 1 ? u-- : a == f + 1 ? u++ : (a > f ? u-- : u++, l.__u |= 4))) : e.__k[o] = null;
|
|
58
|
+
if (i) for (o = 0; o < h; o++) (c = r[o]) != null && (2 & c.__u) == 0 && (c.__e == n && (n = I(c)), Ue(c, c));
|
|
59
59
|
return n;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Fe(e, t, r, n) {
|
|
62
62
|
var s, o;
|
|
63
63
|
if (typeof e.type == "function") {
|
|
64
|
-
for (s = e.__k, o = 0; s && o < s.length; o++) s[o] && (s[o].__ = e, t =
|
|
64
|
+
for (s = e.__k, o = 0; s && o < s.length; o++) s[o] && (s[o].__ = e, t = Fe(s[o], t, r, n));
|
|
65
65
|
return t;
|
|
66
66
|
}
|
|
67
|
-
e.__e != t && (n && (t && e.type && !t.parentNode && (t =
|
|
67
|
+
e.__e != t && (n && (t && e.type && !t.parentNode && (t = I(e)), r.insertBefore(e.__e, t || null)), t = e.__e);
|
|
68
68
|
do
|
|
69
69
|
t = t && t.nextSibling;
|
|
70
70
|
while (t != null && t.nodeType == 8);
|
|
71
71
|
return t;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function nt(e, t, r, n) {
|
|
74
74
|
var s, o, l, c = e.key, f = e.type, a = t[r], h = a != null && (2 & a.__u) == 0;
|
|
75
75
|
if (a === null && c == null || h && c == a.key && f == a.type) return r;
|
|
76
76
|
if (n > (h ? 1 : 0)) {
|
|
@@ -78,17 +78,17 @@ function tt(e, t, r, n) {
|
|
|
78
78
|
}
|
|
79
79
|
return -1;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
t[0] == "-" ? e.setProperty(t, r ?? "") : e[t] = r == null ? "" : typeof r != "number" ||
|
|
81
|
+
function we(e, t, r) {
|
|
82
|
+
t[0] == "-" ? e.setProperty(t, r ?? "") : e[t] = r == null ? "" : typeof r != "number" || et.test(t) ? r : r + "px";
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function O(e, t, r, n, s) {
|
|
85
85
|
var o, l;
|
|
86
86
|
e: if (t == "style") if (typeof r == "string") e.style.cssText = r;
|
|
87
87
|
else {
|
|
88
|
-
if (typeof n == "string" && (e.style.cssText = n = ""), n) for (t in n) r && t in r ||
|
|
89
|
-
if (r) for (t in r) n && r[t] == n[t] ||
|
|
88
|
+
if (typeof n == "string" && (e.style.cssText = n = ""), n) for (t in n) r && t in r || we(e.style, t, "");
|
|
89
|
+
if (r) for (t in r) n && r[t] == n[t] || we(e.style, t, r[t]);
|
|
90
90
|
}
|
|
91
|
-
else if (t[0] == "o" && t[1] == "n") o = t != (t = t.replace(
|
|
91
|
+
else if (t[0] == "o" && t[1] == "n") o = t != (t = t.replace(Ne, "$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.u = n.u : (r.u = le, e.addEventListener(t, o ? oe : ne, o)) : e.removeEventListener(t, o ? oe : ne, o);
|
|
92
92
|
else {
|
|
93
93
|
if (s == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
94
94
|
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 {
|
|
@@ -99,27 +99,27 @@ function F(e, t, r, n, s) {
|
|
|
99
99
|
typeof r == "function" || (r == null || r === !1 && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && r == 1 ? "" : r));
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function ye(e) {
|
|
103
103
|
return function(t) {
|
|
104
104
|
if (this.l) {
|
|
105
105
|
var r = this.l[t.type + e];
|
|
106
|
-
if (t.t == null) t.t =
|
|
106
|
+
if (t.t == null) t.t = le++;
|
|
107
107
|
else if (t.t < r.u) return;
|
|
108
108
|
return r(w.event ? w.event(t) : t);
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
var h, i, u, p, _, g, v, m, y, E, $,
|
|
112
|
+
function de(e, t, r, n, s, o, l, c, f, a) {
|
|
113
|
+
var h, i, u, p, _, g, v, m, y, E, $, P, L, he, F, M, te, x = t.type;
|
|
114
114
|
if (t.constructor !== void 0) return null;
|
|
115
115
|
128 & r.__u && (f = !!(32 & r.__u), o = [c = t.__e = r.__e]), (h = w.__b) && h(t);
|
|
116
116
|
e: if (typeof x == "function") try {
|
|
117
|
-
if (m = t.props, y = "prototype" in x && x.prototype.render, E = (h = x.contextType) && n[h.__c], $ = h ? E ? E.props.value : h.__ : n, r.__c ? v = (i = t.__c = r.__c).__ = i.__E : (y ? t.__c = i = new x(m, $) : (t.__c = i = new
|
|
117
|
+
if (m = t.props, y = "prototype" in x && x.prototype.render, E = (h = x.contextType) && n[h.__c], $ = h ? E ? E.props.value : h.__ : n, r.__c ? v = (i = t.__c = r.__c).__ = i.__E : (y ? t.__c = i = new x(m, $) : (t.__c = i = new q(m, $), i.constructor = x, i.render = st), E && E.sub(i), i.state || (i.state = {}), i.__n = n, u = i.__d = !0, i.__h = [], i._sb = []), y && i.__s == null && (i.__s = i.state), y && x.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = T({}, i.__s)), T(i.__s, x.getDerivedStateFromProps(m, i.__s))), p = i.props, _ = i.state, i.__v = t, u) y && x.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), y && i.componentDidMount != null && i.__h.push(i.componentDidMount);
|
|
118
118
|
else {
|
|
119
119
|
if (y && x.getDerivedStateFromProps == null && m !== p && i.componentWillReceiveProps != null && i.componentWillReceiveProps(m, $), t.__v == r.__v || !i.__e && i.shouldComponentUpdate != null && i.shouldComponentUpdate(m, i.__s, $) === !1) {
|
|
120
|
-
for (t.__v != r.__v && (i.props = m, i.state = i.__s, i.__d = !1), t.__e = r.__e, t.__k = r.__k, t.__k.some(function(
|
|
121
|
-
|
|
122
|
-
}),
|
|
120
|
+
for (t.__v != r.__v && (i.props = m, i.state = i.__s, i.__d = !1), t.__e = r.__e, t.__k = r.__k, t.__k.some(function(A) {
|
|
121
|
+
A && (A.__ = t);
|
|
122
|
+
}), P = 0; P < i._sb.length; P++) i.__h.push(i._sb[P]);
|
|
123
123
|
i._sb = [], i.__h.length && l.push(i);
|
|
124
124
|
break e;
|
|
125
125
|
}
|
|
@@ -127,32 +127,32 @@ function le(e, t, r, n, s, o, l, c, f, a) {
|
|
|
127
127
|
i.componentDidUpdate(p, _, g);
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
if (i.context = $, i.props = m, i.__P = e, i.__e = !1, L = w.__r,
|
|
131
|
-
for (i.state = i.__s, i.__d = !1, L && L(t), h = i.render(i.props, i.state, i.context),
|
|
130
|
+
if (i.context = $, i.props = m, i.__P = e, i.__e = !1, L = w.__r, he = 0, y) {
|
|
131
|
+
for (i.state = i.__s, i.__d = !1, L && L(t), h = i.render(i.props, i.state, i.context), F = 0; F < i._sb.length; F++) i.__h.push(i._sb[F]);
|
|
132
132
|
i._sb = [];
|
|
133
133
|
} else do
|
|
134
134
|
i.__d = !1, L && L(t), h = i.render(i.props, i.state, i.context), i.state = i.__s;
|
|
135
|
-
while (i.__d && ++
|
|
136
|
-
i.state = i.__s, i.getChildContext != null && (n = T(T({}, n), i.getChildContext())), y && !u && i.getSnapshotBeforeUpdate != null && (g = i.getSnapshotBeforeUpdate(p, _)), M = h, h != null && h.type ===
|
|
137
|
-
} catch (
|
|
138
|
-
if (t.__v = null, f || o != null) if (
|
|
135
|
+
while (i.__d && ++he < 25);
|
|
136
|
+
i.state = i.__s, i.getChildContext != null && (n = T(T({}, n), i.getChildContext())), y && !u && i.getSnapshotBeforeUpdate != null && (g = i.getSnapshotBeforeUpdate(p, _)), M = h, h != null && h.type === D && h.key == null && (M = je(h.props.children)), c = Pe(e, Z(M) ? M : [M], t, r, n, s, o, l, c, f, a), i.base = t.__e, t.__u &= -161, i.__h.length && l.push(i), v && (i.__E = i.__ = null);
|
|
137
|
+
} catch (A) {
|
|
138
|
+
if (t.__v = null, f || o != null) if (A.then) {
|
|
139
139
|
for (t.__u |= f ? 160 : 128; c && c.nodeType == 8 && c.nextSibling; ) c = c.nextSibling;
|
|
140
140
|
o[o.indexOf(c)] = null, t.__e = c;
|
|
141
141
|
} else {
|
|
142
|
-
for (
|
|
143
|
-
|
|
142
|
+
for (te = o.length; te--; ) ce(o[te]);
|
|
143
|
+
se(t);
|
|
144
144
|
}
|
|
145
|
-
else t.__e = r.__e, t.__k = r.__k,
|
|
146
|
-
w.__e(
|
|
145
|
+
else t.__e = r.__e, t.__k = r.__k, A.then || se(t);
|
|
146
|
+
w.__e(A, t, r);
|
|
147
147
|
}
|
|
148
|
-
else o == null && t.__v == r.__v ? (t.__k = r.__k, t.__e = r.__e) : c = t.__e =
|
|
148
|
+
else o == null && t.__v == r.__v ? (t.__k = r.__k, t.__e = r.__e) : c = t.__e = ot(r.__e, t, r, n, s, o, l, f, a);
|
|
149
149
|
return (h = w.diffed) && h(t), 128 & t.__u ? void 0 : c;
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
e && e.__c && (e.__c.__e = !0), e && e.__k && e.__k.forEach(
|
|
151
|
+
function se(e) {
|
|
152
|
+
e && e.__c && (e.__c.__e = !0), e && e.__k && e.__k.forEach(se);
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
for (var n = 0; n < r.length; n++)
|
|
154
|
+
function Oe(e, t, r) {
|
|
155
|
+
for (var n = 0; n < r.length; n++) _e(r[n], r[++n], r[++n]);
|
|
156
156
|
w.__c && w.__c(t, e), e.some(function(s) {
|
|
157
157
|
try {
|
|
158
158
|
e = s.__h, s.__h = [], e.some(function(o) {
|
|
@@ -163,10 +163,10 @@ function Pe(e, t, r) {
|
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
|
-
function
|
|
167
|
-
return typeof e != "object" || e == null || e.__b && e.__b > 0 ? e :
|
|
166
|
+
function je(e) {
|
|
167
|
+
return typeof e != "object" || e == null || e.__b && e.__b > 0 ? e : Z(e) ? e.map(je) : T({}, e);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function ot(e, t, r, n, s, o, l, c, f) {
|
|
170
170
|
var a, h, i, u, p, _, g, v = r.props || z, m = t.props, y = t.type;
|
|
171
171
|
if (y == "svg" ? s = "http://www.w3.org/2000/svg" : y == "math" ? s = "http://www.w3.org/1998/Math/MathML" : s || (s = "http://www.w3.org/1999/xhtml"), o != null) {
|
|
172
172
|
for (a = 0; a < o.length; a++) if ((p = o[a]) && "setAttribute" in p == !!y && (y ? p.localName == y : p.nodeType == 3)) {
|
|
@@ -180,22 +180,22 @@ function rt(e, t, r, n, s, o, l, c, f) {
|
|
|
180
180
|
}
|
|
181
181
|
if (y == null) v === m || c && e.data == m || (e.data = m);
|
|
182
182
|
else {
|
|
183
|
-
if (o = o &&
|
|
183
|
+
if (o = o && K.call(e.childNodes), !c && o != null) for (v = {}, a = 0; a < e.attributes.length; a++) v[(p = e.attributes[a]).name] = p.value;
|
|
184
184
|
for (a in v) if (p = v[a], a != "children") {
|
|
185
185
|
if (a == "dangerouslySetInnerHTML") i = p;
|
|
186
186
|
else if (!(a in m)) {
|
|
187
187
|
if (a == "value" && "defaultValue" in m || a == "checked" && "defaultChecked" in m) continue;
|
|
188
|
-
|
|
188
|
+
O(e, a, null, p, s);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
for (a in m) p = m[a], a == "children" ? u = p : a == "dangerouslySetInnerHTML" ? h = p : a == "value" ? _ = p : a == "checked" ? g = p : c && typeof p != "function" || v[a] === p ||
|
|
191
|
+
for (a in m) p = m[a], a == "children" ? u = p : a == "dangerouslySetInnerHTML" ? h = p : a == "value" ? _ = p : a == "checked" ? g = p : c && typeof p != "function" || v[a] === p || O(e, a, p, v[a], s);
|
|
192
192
|
if (h) c || i && (h.__html == i.__html || h.__html == e.innerHTML) || (e.innerHTML = h.__html), t.__k = [];
|
|
193
|
-
else if (i && (e.innerHTML = ""),
|
|
194
|
-
c || (a = "value", y == "progress" && _ == null ? e.removeAttribute("value") : _ != null && (_ !== e[a] || y == "progress" && !_ || y == "option" && _ != v[a]) &&
|
|
193
|
+
else if (i && (e.innerHTML = ""), Pe(t.type == "template" ? e.content : e, Z(u) ? u : [u], t, r, n, y == "foreignObject" ? "http://www.w3.org/1999/xhtml" : s, o, l, o ? o[0] : r.__k && I(r, 0), c, f), o != null) for (a = o.length; a--; ) ce(o[a]);
|
|
194
|
+
c || (a = "value", y == "progress" && _ == null ? e.removeAttribute("value") : _ != null && (_ !== e[a] || y == "progress" && !_ || y == "option" && _ != v[a]) && O(e, a, _, v[a], s), a = "checked", g != null && g != e[a] && O(e, a, g, v[a], s));
|
|
195
195
|
}
|
|
196
196
|
return e;
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function _e(e, t, r) {
|
|
199
199
|
try {
|
|
200
200
|
if (typeof e == "function") {
|
|
201
201
|
var n = typeof e.__u == "function";
|
|
@@ -205,9 +205,9 @@ function ce(e, t, r) {
|
|
|
205
205
|
w.__e(s, r);
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function Ue(e, t, r) {
|
|
209
209
|
var n, s;
|
|
210
|
-
if (w.unmount && w.unmount(e), (n = e.ref) && (n.current && n.current != e.__e ||
|
|
210
|
+
if (w.unmount && w.unmount(e), (n = e.ref) && (n.current && n.current != e.__e || _e(n, null, t)), (n = e.__c) != null) {
|
|
211
211
|
if (n.componentWillUnmount) try {
|
|
212
212
|
n.componentWillUnmount();
|
|
213
213
|
} catch (o) {
|
|
@@ -215,41 +215,41 @@ function Oe(e, t, r) {
|
|
|
215
215
|
}
|
|
216
216
|
n.base = n.__P = null;
|
|
217
217
|
}
|
|
218
|
-
if (n = e.__k) for (s = 0; s < n.length; s++) n[s] &&
|
|
219
|
-
r ||
|
|
218
|
+
if (n = e.__k) for (s = 0; s < n.length; s++) n[s] && Ue(n[s], t, r || typeof e.type != "function");
|
|
219
|
+
r || ce(e.__e), e.__c = e.__ = e.__e = void 0;
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function st(e, t, r) {
|
|
222
222
|
return this.constructor(e, r);
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function it(e, t, r) {
|
|
225
225
|
var n, s, o, l;
|
|
226
|
-
t == document && (t = document.documentElement), w.__ && w.__(e, t), s = (n = !1) ? null : t.__k, o = [], l = [],
|
|
226
|
+
t == document && (t = document.documentElement), w.__ && w.__(e, t), s = (n = !1) ? null : t.__k, o = [], l = [], de(t, e = t.__k = tt(D, null, [e]), s || z, z, t.namespaceURI, s ? null : t.firstChild ? K.call(t.childNodes) : null, o, s ? s.__e : t.firstChild, n, l), Oe(o, e, l);
|
|
227
227
|
}
|
|
228
|
-
|
|
228
|
+
K = Be.slice, w = { __e: function(e, t, r, n) {
|
|
229
229
|
for (var s, o, l; t = t.__; ) if ((s = t.__c) && !s.__) try {
|
|
230
230
|
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;
|
|
231
231
|
} catch (c) {
|
|
232
232
|
e = c;
|
|
233
233
|
}
|
|
234
234
|
throw e;
|
|
235
|
-
} },
|
|
235
|
+
} }, We = 0, q.prototype.setState = function(e, t) {
|
|
236
236
|
var r;
|
|
237
|
-
r = this.__s != null && this.__s != this.state ? this.__s : this.__s = T({}, this.state), typeof e == "function" && (e = e(T({}, r), this.props)), e && T(r, e), e != null && this.__v && (t && this._sb.push(t),
|
|
238
|
-
},
|
|
239
|
-
this.__v && (this.__e = !0, e && this.__h.push(e),
|
|
240
|
-
},
|
|
237
|
+
r = this.__s != null && this.__s != this.state ? this.__s : this.__s = T({}, this.state), typeof e == "function" && (e = e(T({}, r), this.props)), e && T(r, e), e != null && this.__v && (t && this._sb.push(t), ve(this));
|
|
238
|
+
}, q.prototype.forceUpdate = function(e) {
|
|
239
|
+
this.__v && (this.__e = !0, e && this.__h.push(e), ve(this));
|
|
240
|
+
}, q.prototype.render = D, C = [], He = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, ze = function(e, t) {
|
|
241
241
|
return e.__v.__b - t.__v.__b;
|
|
242
|
-
},
|
|
243
|
-
var
|
|
242
|
+
}, G.__r = 0, Ne = /(PointerCapture)$|Capture$/i, le = 0, ne = ye(!1), oe = ye(!0);
|
|
243
|
+
var at = 0;
|
|
244
244
|
function d(e, t, r, n, s, o) {
|
|
245
245
|
t || (t = {});
|
|
246
246
|
var l, c, f = t;
|
|
247
247
|
if ("ref" in f) for (c in f = {}, t) c == "ref" ? l = t[c] : f[c] = t[c];
|
|
248
|
-
var a = { type: e, props: f, key: r, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --
|
|
248
|
+
var a = { type: e, props: f, key: r, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --at, __i: -1, __u: 0, __source: s, __self: o };
|
|
249
249
|
if (typeof e == "function" && (l = e.defaultProps)) for (c in l) f[c] === void 0 && (f[c] = l[c]);
|
|
250
250
|
return w.vnode && w.vnode(a), a;
|
|
251
251
|
}
|
|
252
|
-
const
|
|
252
|
+
const lt = {
|
|
253
253
|
// Colors
|
|
254
254
|
primary: "#2563eb",
|
|
255
255
|
// Darker blue for AA contrast with white text (4.5:1)
|
|
@@ -312,43 +312,43 @@ const it = {
|
|
|
312
312
|
iconColor: "#f1f5f9",
|
|
313
313
|
iconColorSecondary: "#cbd5e1"
|
|
314
314
|
};
|
|
315
|
-
function
|
|
316
|
-
const t = { ...
|
|
315
|
+
function ct(e = {}) {
|
|
316
|
+
const t = { ...lt, ...e };
|
|
317
317
|
return Object.entries(t).map(([r, n]) => `${`--twd-${r.replace(/([A-Z])/g, "-$1").toLowerCase()}`}: ${n};`).join(`
|
|
318
318
|
`);
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function dt(e) {
|
|
321
321
|
const t = "twd-theme-variables";
|
|
322
322
|
let r = document.getElementById(t);
|
|
323
323
|
r || (r = document.createElement("style"), r.id = t, document.head.appendChild(r));
|
|
324
|
-
const n =
|
|
324
|
+
const n = ct(e);
|
|
325
325
|
r.textContent = `
|
|
326
326
|
:root {
|
|
327
327
|
${n}
|
|
328
328
|
}
|
|
329
329
|
`;
|
|
330
330
|
}
|
|
331
|
-
const
|
|
331
|
+
const _t = (e) => {
|
|
332
332
|
const { Component: t, createRoot: r, theme: n } = e;
|
|
333
|
-
|
|
333
|
+
dt(n);
|
|
334
334
|
const s = document.createElement("div");
|
|
335
335
|
s.setAttribute("id", "twd-sidebar-root"), document.body.appendChild(s), r(s).render(t);
|
|
336
|
-
},
|
|
336
|
+
}, ut = async (e, t, r, n) => {
|
|
337
337
|
for (const s in e) await e[s]();
|
|
338
|
-
|
|
338
|
+
_t({ Component: t, createRoot: r, theme: n });
|
|
339
339
|
};
|
|
340
|
-
var N, b,
|
|
341
|
-
function
|
|
342
|
-
k.__h && k.__h(b, e,
|
|
340
|
+
var N, b, re, be, Y = 0, qe = [], k = w, ke = k.__b, Se = k.__r, xe = k.diffed, Te = k.__c, Ee = k.unmount, Re = k.__;
|
|
341
|
+
function ue(e, t) {
|
|
342
|
+
k.__h && k.__h(b, e, Y || t), Y = 0;
|
|
343
343
|
var r = b.__H || (b.__H = { __: [], __h: [] });
|
|
344
344
|
return e >= r.__.length && r.__.push({}), r.__[e];
|
|
345
345
|
}
|
|
346
|
-
function
|
|
347
|
-
return
|
|
346
|
+
function V(e) {
|
|
347
|
+
return Y = 1, pt(Je, e);
|
|
348
348
|
}
|
|
349
|
-
function
|
|
350
|
-
var n =
|
|
351
|
-
if (n.t = e, !n.__c && (n.__ = [
|
|
349
|
+
function pt(e, t, r) {
|
|
350
|
+
var n = ue(N++, 2);
|
|
351
|
+
if (n.t = e, !n.__c && (n.__ = [Je(void 0, t), function(c) {
|
|
352
352
|
var f = n.__N ? n.__N[0] : n.__[0], a = n.t(f, c);
|
|
353
353
|
f !== a && (n.__N = [a, n.__[1]], n.__c.setState({}));
|
|
354
354
|
}], n.__c = b, !b.__f)) {
|
|
@@ -380,97 +380,97 @@ function _t(e, t, r) {
|
|
|
380
380
|
}
|
|
381
381
|
return n.__N || n.__;
|
|
382
382
|
}
|
|
383
|
-
function
|
|
384
|
-
var r =
|
|
385
|
-
!k.__s &&
|
|
383
|
+
function Q(e, t) {
|
|
384
|
+
var r = ue(N++, 3);
|
|
385
|
+
!k.__s && Ve(r.__H, t) && (r.__ = e, r.u = t, b.__H.__h.push(r));
|
|
386
386
|
}
|
|
387
387
|
function H(e) {
|
|
388
|
-
return
|
|
388
|
+
return Y = 5, J(function() {
|
|
389
389
|
return { current: e };
|
|
390
390
|
}, []);
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
var r =
|
|
394
|
-
return
|
|
392
|
+
function J(e, t) {
|
|
393
|
+
var r = ue(N++, 7);
|
|
394
|
+
return Ve(r.__H, t) && (r.__ = e(), r.__H = t, r.__h = e), r.__;
|
|
395
395
|
}
|
|
396
|
-
function
|
|
397
|
-
for (var e; e =
|
|
398
|
-
e.__H.__h.forEach(
|
|
396
|
+
function ft() {
|
|
397
|
+
for (var e; e = qe.shift(); ) if (e.__P && e.__H) try {
|
|
398
|
+
e.__H.__h.forEach(X), e.__H.__h.forEach(ie), e.__H.__h = [];
|
|
399
399
|
} catch (t) {
|
|
400
400
|
e.__H.__h = [], k.__e(t, e.__v);
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
k.__b = function(e) {
|
|
404
|
-
b = null,
|
|
404
|
+
b = null, ke && ke(e);
|
|
405
405
|
}, k.__ = function(e, t) {
|
|
406
|
-
e && t.__k && t.__k.__m && (e.__m = t.__k.__m),
|
|
406
|
+
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Re && Re(e, t);
|
|
407
407
|
}, k.__r = function(e) {
|
|
408
|
-
|
|
408
|
+
Se && Se(e), N = 0;
|
|
409
409
|
var t = (b = e.__c).__H;
|
|
410
|
-
t && (
|
|
410
|
+
t && (re === b ? (t.__h = [], b.__h = [], t.__.forEach(function(r) {
|
|
411
411
|
r.__N && (r.__ = r.__N), r.u = r.__N = void 0;
|
|
412
|
-
})) : (t.__h.forEach(
|
|
412
|
+
})) : (t.__h.forEach(X), t.__h.forEach(ie), t.__h = [], N = 0)), re = b;
|
|
413
413
|
}, k.diffed = function(e) {
|
|
414
|
-
|
|
414
|
+
xe && xe(e);
|
|
415
415
|
var t = e.__c;
|
|
416
|
-
t && t.__H && (t.__H.__h.length && (
|
|
416
|
+
t && t.__H && (t.__H.__h.length && (qe.push(t) !== 1 && be === k.requestAnimationFrame || ((be = k.requestAnimationFrame) || ht)(ft)), t.__H.__.forEach(function(r) {
|
|
417
417
|
r.u && (r.__H = r.u), r.u = void 0;
|
|
418
|
-
})),
|
|
418
|
+
})), re = b = null;
|
|
419
419
|
}, k.__c = function(e, t) {
|
|
420
420
|
t.some(function(r) {
|
|
421
421
|
try {
|
|
422
|
-
r.__h.forEach(
|
|
423
|
-
return !n.__ ||
|
|
422
|
+
r.__h.forEach(X), r.__h = r.__h.filter(function(n) {
|
|
423
|
+
return !n.__ || ie(n);
|
|
424
424
|
});
|
|
425
425
|
} catch (n) {
|
|
426
426
|
t.some(function(s) {
|
|
427
427
|
s.__h && (s.__h = []);
|
|
428
428
|
}), t = [], k.__e(n, r.__v);
|
|
429
429
|
}
|
|
430
|
-
}),
|
|
430
|
+
}), Te && Te(e, t);
|
|
431
431
|
}, k.unmount = function(e) {
|
|
432
|
-
|
|
432
|
+
Ee && Ee(e);
|
|
433
433
|
var t, r = e.__c;
|
|
434
434
|
r && r.__H && (r.__H.__.forEach(function(n) {
|
|
435
435
|
try {
|
|
436
|
-
|
|
436
|
+
X(n);
|
|
437
437
|
} catch (s) {
|
|
438
438
|
t = s;
|
|
439
439
|
}
|
|
440
440
|
}), r.__H = void 0, t && k.__e(t, r.__v));
|
|
441
441
|
};
|
|
442
|
-
var
|
|
443
|
-
function
|
|
442
|
+
var $e = typeof requestAnimationFrame == "function";
|
|
443
|
+
function ht(e) {
|
|
444
444
|
var t, r = function() {
|
|
445
|
-
clearTimeout(n),
|
|
445
|
+
clearTimeout(n), $e && cancelAnimationFrame(t), setTimeout(e);
|
|
446
446
|
}, n = setTimeout(r, 35);
|
|
447
|
-
|
|
447
|
+
$e && (t = requestAnimationFrame(r));
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function X(e) {
|
|
450
450
|
var t = b, r = e.__c;
|
|
451
451
|
typeof r == "function" && (e.__c = void 0, r()), b = t;
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function ie(e) {
|
|
454
454
|
var t = b;
|
|
455
455
|
e.__c = e.__(), b = t;
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function Ve(e, t) {
|
|
458
458
|
return !e || e.length !== t.length || t.some(function(r, n) {
|
|
459
459
|
return r !== e[n];
|
|
460
460
|
});
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function Je(e, t) {
|
|
463
463
|
return typeof t == "function" ? t(e) : t;
|
|
464
464
|
}
|
|
465
|
-
const
|
|
465
|
+
const gt = (e) => {
|
|
466
466
|
const t = /* @__PURE__ */ new Map(), r = [];
|
|
467
467
|
for (const n of e) t.set(n.id, { ...n, childrenNodes: [] });
|
|
468
468
|
for (const n of t.values())
|
|
469
469
|
n.parent ? t.get(n.parent)?.childrenNodes?.push(n) : r.push(n);
|
|
470
470
|
return r;
|
|
471
|
-
},
|
|
471
|
+
}, mt = {
|
|
472
472
|
animation: "spin 1s linear infinite"
|
|
473
|
-
},
|
|
473
|
+
}, vt = () => /* @__PURE__ */ d(
|
|
474
474
|
"svg",
|
|
475
475
|
{
|
|
476
476
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -483,18 +483,18 @@ const ft = (e) => {
|
|
|
483
483
|
strokeLinecap: "round",
|
|
484
484
|
strokeLinejoin: "round",
|
|
485
485
|
className: "lucide lucide-loader-circle-icon lucide-loader-circle",
|
|
486
|
-
style:
|
|
486
|
+
style: mt,
|
|
487
487
|
"data-testid": "loader-icon",
|
|
488
488
|
children: /* @__PURE__ */ d("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
489
489
|
}
|
|
490
|
-
),
|
|
491
|
-
|
|
490
|
+
), j = document.createElement("style");
|
|
491
|
+
j && !document.getElementById("loader-spin-keyframes") && (j.id = "loader-spin-keyframes", j.innerHTML = `
|
|
492
492
|
@keyframes spin {
|
|
493
493
|
0% { transform: rotate(0deg); }
|
|
494
494
|
100% { transform: rotate(360deg); }
|
|
495
495
|
}
|
|
496
|
-
`, document.head.appendChild(
|
|
497
|
-
const
|
|
496
|
+
`, document.head.appendChild(j));
|
|
497
|
+
const ee = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ d(
|
|
498
498
|
"svg",
|
|
499
499
|
{
|
|
500
500
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -510,7 +510,7 @@ const Z = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ d(
|
|
|
510
510
|
"data-testid": r,
|
|
511
511
|
children: t
|
|
512
512
|
}
|
|
513
|
-
),
|
|
513
|
+
), wt = () => /* @__PURE__ */ d(ee, { className: "lucide-play-icon lucide-play", dataTestId: "play-icon", 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" }) }), Xe = ({ id: e, name: t, skip: r, only: n }) => /* @__PURE__ */ d(D, { children: [
|
|
514
514
|
t,
|
|
515
515
|
" ",
|
|
516
516
|
n && /* @__PURE__ */ d(
|
|
@@ -537,7 +537,7 @@ const Z = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ d(
|
|
|
537
537
|
)
|
|
538
538
|
] });
|
|
539
539
|
var R = /* @__PURE__ */ ((e) => (e.CHAI_DIFF = "chai-diff", e.CHAI_MESSAGE = "chai-message", e.ERROR = "error", e))(R || {});
|
|
540
|
-
const
|
|
540
|
+
const yt = (e) => {
|
|
541
541
|
try {
|
|
542
542
|
const t = JSON.parse(e);
|
|
543
543
|
if (t && typeof t == "object" && "type" in t)
|
|
@@ -545,7 +545,7 @@ const vt = (e) => {
|
|
|
545
545
|
} catch {
|
|
546
546
|
}
|
|
547
547
|
return null;
|
|
548
|
-
},
|
|
548
|
+
}, Ce = (e) => {
|
|
549
549
|
if (e === null) return "null";
|
|
550
550
|
if (e === void 0) return "undefined";
|
|
551
551
|
if (typeof e == "string") return e;
|
|
@@ -556,8 +556,8 @@ const vt = (e) => {
|
|
|
556
556
|
return String(e);
|
|
557
557
|
}
|
|
558
558
|
return String(e);
|
|
559
|
-
},
|
|
560
|
-
const r =
|
|
559
|
+
}, bt = (e) => e.startsWith("Assertion passed") || e.startsWith("Event fired") ? { color: "var(--twd-success)", fontWeight: "var(--twd-font-weight-bold)" } : e.startsWith("Test failed") ? { color: "var(--twd-error)", fontWeight: "var(--twd-font-weight-bold)" } : {}, kt = (e) => e.type === "chai-message" || e.type === "error", St = (e, t) => t && kt(t) ? t.message : e, xt = ({ log: e, index: t }) => {
|
|
560
|
+
const r = yt(e);
|
|
561
561
|
if (r?.type === R.CHAI_DIFF)
|
|
562
562
|
return /* @__PURE__ */ d(
|
|
563
563
|
"li",
|
|
@@ -593,7 +593,7 @@ const vt = (e) => {
|
|
|
593
593
|
overflowX: "auto",
|
|
594
594
|
whiteSpace: "pre-wrap",
|
|
595
595
|
wordBreak: "break-word"
|
|
596
|
-
}, children:
|
|
596
|
+
}, children: Ce(r.expected) })
|
|
597
597
|
] }),
|
|
598
598
|
/* @__PURE__ */ d("div", { style: {
|
|
599
599
|
marginTop: "var(--twd-spacing-xs)",
|
|
@@ -614,13 +614,13 @@ const vt = (e) => {
|
|
|
614
614
|
overflowX: "auto",
|
|
615
615
|
whiteSpace: "pre-wrap",
|
|
616
616
|
wordBreak: "break-word"
|
|
617
|
-
}, children:
|
|
617
|
+
}, children: Ce(r.actual) })
|
|
618
618
|
] })
|
|
619
619
|
]
|
|
620
620
|
},
|
|
621
621
|
t
|
|
622
622
|
);
|
|
623
|
-
const n =
|
|
623
|
+
const n = St(e, r);
|
|
624
624
|
return /* @__PURE__ */ d(
|
|
625
625
|
"li",
|
|
626
626
|
{
|
|
@@ -629,7 +629,7 @@ const vt = (e) => {
|
|
|
629
629
|
padding: "var(--twd-spacing-xs) var(--twd-spacing-sm)",
|
|
630
630
|
borderBottom: "1px solid var(--twd-border-light)",
|
|
631
631
|
color: "var(--twd-text)",
|
|
632
|
-
...
|
|
632
|
+
...bt(n)
|
|
633
633
|
},
|
|
634
634
|
children: n
|
|
635
635
|
},
|
|
@@ -676,7 +676,7 @@ const vt = (e) => {
|
|
|
676
676
|
marginTop: "var(--twd-spacing-xs)",
|
|
677
677
|
textAlign: "left"
|
|
678
678
|
}
|
|
679
|
-
},
|
|
679
|
+
}, Tt = (e) => {
|
|
680
680
|
switch (e.status) {
|
|
681
681
|
case "pass":
|
|
682
682
|
return {
|
|
@@ -715,20 +715,20 @@ const vt = (e) => {
|
|
|
715
715
|
}
|
|
716
716
|
};
|
|
717
717
|
}
|
|
718
|
-
},
|
|
718
|
+
}, Et = ({
|
|
719
719
|
node: e,
|
|
720
720
|
depth: t,
|
|
721
721
|
id: r,
|
|
722
722
|
runTest: n
|
|
723
723
|
}) => {
|
|
724
|
-
const s = H(null), o = H(e.status), l = H(e.logs?.length || 0), c =
|
|
724
|
+
const s = H(null), o = H(e.status), l = H(e.logs?.length || 0), c = J(() => Tt(e), [e.status]), f = typeof window < "u" && sessionStorage.getItem("twd-last-run-test-name") === e.name, a = J(
|
|
725
725
|
() => ({
|
|
726
726
|
...W.container,
|
|
727
727
|
marginLeft: `calc(${t} * var(--twd-spacing-sm))`,
|
|
728
728
|
...c.container || {}
|
|
729
729
|
}),
|
|
730
730
|
[t, c]
|
|
731
|
-
), h =
|
|
731
|
+
), h = J(
|
|
732
732
|
() => ({
|
|
733
733
|
...W.item,
|
|
734
734
|
...c.item,
|
|
@@ -738,7 +738,7 @@ const vt = (e) => {
|
|
|
738
738
|
}),
|
|
739
739
|
[c, f]
|
|
740
740
|
);
|
|
741
|
-
|
|
741
|
+
Q(() => {
|
|
742
742
|
const u = s.current;
|
|
743
743
|
if (!u || !e.logs || e.logs.length === 0) return;
|
|
744
744
|
const p = o.current === "running" && (e.status === "pass" || e.status === "fail"), _ = e.logs.length > l.current;
|
|
@@ -771,7 +771,7 @@ const vt = (e) => {
|
|
|
771
771
|
children: [
|
|
772
772
|
/* @__PURE__ */ d("div", { style: h, children: [
|
|
773
773
|
/* @__PURE__ */ d("span", { style: W.nameSpan, children: /* @__PURE__ */ d(
|
|
774
|
-
|
|
774
|
+
Xe,
|
|
775
775
|
{
|
|
776
776
|
id: r,
|
|
777
777
|
name: e.name,
|
|
@@ -787,18 +787,18 @@ const vt = (e) => {
|
|
|
787
787
|
style: W.button,
|
|
788
788
|
disabled: e.status === "running",
|
|
789
789
|
"data-testid": `run-test-button-${r}`,
|
|
790
|
-
children: e.status === "running" ? /* @__PURE__ */ d(
|
|
790
|
+
children: e.status === "running" ? /* @__PURE__ */ d(vt, {}) : /* @__PURE__ */ d(wt, {})
|
|
791
791
|
}
|
|
792
792
|
)
|
|
793
793
|
] }),
|
|
794
|
-
e.logs && e.logs.length > 0 && /* @__PURE__ */ d("ul", { ref: s, style: W.logsList, children: e.logs.map((u, p) => /* @__PURE__ */ d(
|
|
794
|
+
e.logs && e.logs.length > 0 && /* @__PURE__ */ d("ul", { ref: s, style: W.logsList, children: e.logs.map((u, p) => /* @__PURE__ */ d(xt, { log: u, index: p }, p)) })
|
|
795
795
|
]
|
|
796
796
|
},
|
|
797
797
|
e.name
|
|
798
798
|
);
|
|
799
|
-
},
|
|
800
|
-
const [r, n] =
|
|
801
|
-
|
|
799
|
+
}, Rt = () => /* @__PURE__ */ d(ee, { className: "lucide-chevron-down-icon lucide-chevron-down", dataTestId: "chevron-down-icon", children: /* @__PURE__ */ d("path", { d: "m6 9 6 6 6-6" }) }), $t = () => /* @__PURE__ */ d(ee, { className: "lucide-chevron-right-icon lucide-chevron-right", dataTestId: "chevron-right-icon", children: /* @__PURE__ */ d("path", { d: "m9 18 6-6-6-6" }) }), Ct = ({ tests: e, runTest: t }) => {
|
|
800
|
+
const [r, n] = V({}), s = H(null), o = H(!1), l = (a) => n((h) => ({ ...h, [a]: !h[a] }));
|
|
801
|
+
Q(() => {
|
|
802
802
|
if (o.current) return;
|
|
803
803
|
const a = sessionStorage.getItem("twd-last-run-test-name");
|
|
804
804
|
if (!a) return;
|
|
@@ -822,7 +822,7 @@ const vt = (e) => {
|
|
|
822
822
|
const c = (a, h = 0) => {
|
|
823
823
|
if (a.type === "test")
|
|
824
824
|
return /* @__PURE__ */ d(
|
|
825
|
-
|
|
825
|
+
Et,
|
|
826
826
|
{
|
|
827
827
|
node: a,
|
|
828
828
|
depth: h,
|
|
@@ -865,8 +865,8 @@ const vt = (e) => {
|
|
|
865
865
|
"aria-label": `${i ? "Expand" : "Collapse"} test suite ${a.name}`,
|
|
866
866
|
onClick: () => l(a.id),
|
|
867
867
|
children: [
|
|
868
|
-
/* @__PURE__ */ d(
|
|
869
|
-
i ? /* @__PURE__ */ d(
|
|
868
|
+
/* @__PURE__ */ d(Xe, { id: a.id, name: a.name, skip: a.skip, only: a.only }),
|
|
869
|
+
i ? /* @__PURE__ */ d($t, {}) : /* @__PURE__ */ d(Rt, {})
|
|
870
870
|
]
|
|
871
871
|
}
|
|
872
872
|
)
|
|
@@ -874,7 +874,7 @@ const vt = (e) => {
|
|
|
874
874
|
),
|
|
875
875
|
!i && a.childrenNodes && a.childrenNodes.length > 0 && /* @__PURE__ */ d("ul", { style: { listStyle: "none", padding: 0, margin: 0 }, children: a.childrenNodes.map((u) => c(u, h + 1)) })
|
|
876
876
|
] }, a.id);
|
|
877
|
-
}, f =
|
|
877
|
+
}, f = gt(e);
|
|
878
878
|
return /* @__PURE__ */ d(
|
|
879
879
|
"ul",
|
|
880
880
|
{
|
|
@@ -885,7 +885,7 @@ const vt = (e) => {
|
|
|
885
885
|
children: f.map((a) => c(a))
|
|
886
886
|
}
|
|
887
887
|
);
|
|
888
|
-
},
|
|
888
|
+
}, At = {
|
|
889
889
|
left: {
|
|
890
890
|
left: 0,
|
|
891
891
|
borderTopRightRadius: "var(--twd-border-radius-lg)",
|
|
@@ -900,7 +900,7 @@ const vt = (e) => {
|
|
|
900
900
|
borderTopRightRadius: "0",
|
|
901
901
|
borderBottomRightRadius: "0"
|
|
902
902
|
}
|
|
903
|
-
},
|
|
903
|
+
}, It = ({ setOpen: e, position: t }) => /* @__PURE__ */ d(
|
|
904
904
|
"button",
|
|
905
905
|
{
|
|
906
906
|
"aria-label": "Open TWD sidebar",
|
|
@@ -913,19 +913,19 @@ const vt = (e) => {
|
|
|
913
913
|
padding: "var(--twd-spacing-sm) 10px",
|
|
914
914
|
cursor: "pointer",
|
|
915
915
|
fontSize: "var(--twd-font-size-sm)",
|
|
916
|
-
|
|
916
|
+
...At[t]
|
|
917
917
|
},
|
|
918
918
|
onClick: () => e(!0),
|
|
919
919
|
children: "TWD"
|
|
920
920
|
}
|
|
921
|
-
),
|
|
922
|
-
|
|
921
|
+
), Lt = ({ isOpen: e, position: t }) => {
|
|
922
|
+
Q(() => {
|
|
923
923
|
const r = document.documentElement, n = getComputedStyle(document.documentElement).getPropertyValue("--twd-sidebar-width") || "280px";
|
|
924
924
|
return e ? t === "left" ? r.style.marginLeft = n : r.style.marginRight = n : (r.style.marginRight = "0", r.style.marginLeft = "0"), () => {
|
|
925
925
|
r.style.marginRight = "0", r.style.marginLeft = "0";
|
|
926
926
|
};
|
|
927
927
|
}, [e, t]);
|
|
928
|
-
},
|
|
928
|
+
}, Mt = () => typeof window < "u" ? (window.__TWD_STATE__ || (window.__TWD_STATE__ = {
|
|
929
929
|
handlers: /* @__PURE__ */ new Map(),
|
|
930
930
|
beforeEachHooks: /* @__PURE__ */ new Map(),
|
|
931
931
|
afterEachHooks: /* @__PURE__ */ new Map(),
|
|
@@ -935,16 +935,16 @@ const vt = (e) => {
|
|
|
935
935
|
beforeEachHooks: /* @__PURE__ */ new Map(),
|
|
936
936
|
afterEachHooks: /* @__PURE__ */ new Map(),
|
|
937
937
|
stack: []
|
|
938
|
-
},
|
|
938
|
+
}, pe = Mt(), S = pe.handlers, Ae = pe.beforeEachHooks, Ie = pe.afterEachHooks, Wt = (e) => {
|
|
939
939
|
const t = [], r = [];
|
|
940
940
|
let n = e;
|
|
941
941
|
for (; n; )
|
|
942
|
-
|
|
942
|
+
Ae.has(n) && t.unshift(...Ae.get(n)), Ie.has(n) && r.push(...Ie.get(n)), n = S.get(n)?.parent;
|
|
943
943
|
return { before: t, after: r };
|
|
944
|
-
},
|
|
944
|
+
}, ae = (e) => {
|
|
945
945
|
const t = S.get(e);
|
|
946
|
-
return t ? t.only ? !0 : t.children ? t.children.some((r) =>
|
|
947
|
-
},
|
|
946
|
+
return t ? t.only ? !0 : t.children ? t.children.some((r) => ae(r)) : !1 : !1;
|
|
947
|
+
}, Ht = (e) => {
|
|
948
948
|
let t = S.get(e);
|
|
949
949
|
for (; t?.parent; ) {
|
|
950
950
|
const r = S.get(t.parent);
|
|
@@ -952,7 +952,7 @@ const vt = (e) => {
|
|
|
952
952
|
t = r;
|
|
953
953
|
}
|
|
954
954
|
return !1;
|
|
955
|
-
},
|
|
955
|
+
}, Le = (e) => {
|
|
956
956
|
let t = S.get(e);
|
|
957
957
|
for (; t; ) {
|
|
958
958
|
if (t.skip) return !0;
|
|
@@ -961,9 +961,9 @@ const vt = (e) => {
|
|
|
961
961
|
}
|
|
962
962
|
return !1;
|
|
963
963
|
};
|
|
964
|
-
class
|
|
964
|
+
class Ge {
|
|
965
965
|
constructor(t) {
|
|
966
|
-
|
|
966
|
+
ge(this, "events");
|
|
967
967
|
this.events = t;
|
|
968
968
|
}
|
|
969
969
|
async runAll() {
|
|
@@ -980,11 +980,11 @@ class Je {
|
|
|
980
980
|
await this.runTest(r, !1);
|
|
981
981
|
}
|
|
982
982
|
async runSuite(t, r) {
|
|
983
|
-
if (
|
|
983
|
+
if (Le(t.id) && !ae(t.id)) {
|
|
984
984
|
this.events.onSkip?.(t);
|
|
985
985
|
return;
|
|
986
986
|
}
|
|
987
|
-
if (r && !
|
|
987
|
+
if (r && !ae(t.id)) return;
|
|
988
988
|
this.events.onSuiteStart?.(t);
|
|
989
989
|
const s = (t.children || []).map((o) => S.get(o));
|
|
990
990
|
for (const o of s)
|
|
@@ -992,17 +992,17 @@ class Je {
|
|
|
992
992
|
this.events.onSuiteEnd?.(t);
|
|
993
993
|
}
|
|
994
994
|
async runTest(t, r) {
|
|
995
|
-
if ((
|
|
995
|
+
if ((Le(t.id) || t.skip) && !t.only) {
|
|
996
996
|
this.events.onSkip(t);
|
|
997
997
|
return;
|
|
998
998
|
}
|
|
999
|
-
const s =
|
|
999
|
+
const s = Ht(t.id);
|
|
1000
1000
|
if (r && !t.only && !s) {
|
|
1001
1001
|
this.events.onSkip(t);
|
|
1002
1002
|
return;
|
|
1003
1003
|
}
|
|
1004
1004
|
this.events.onStart?.(t);
|
|
1005
|
-
const o =
|
|
1005
|
+
const o = Wt(t.parent);
|
|
1006
1006
|
try {
|
|
1007
1007
|
for (const l of o.before) await l();
|
|
1008
1008
|
t.logs = [], await t.handler(), this.events.onPass(t);
|
|
@@ -1013,36 +1013,45 @@ class Je {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
1015
|
}
|
|
1016
|
-
window.__testRunner =
|
|
1017
|
-
const
|
|
1018
|
-
rules: []
|
|
1016
|
+
window.__testRunner = Ge;
|
|
1017
|
+
const Ye = "1.5.1", zt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
|
|
1018
|
+
rules: [],
|
|
1019
|
+
counts: {}
|
|
1019
1020
|
}), window.__TWD_MOCK_STATE__) : {
|
|
1020
|
-
rules: []
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1021
|
+
rules: [],
|
|
1022
|
+
counts: {}
|
|
1023
|
+
}, B = zt(), fe = B.rules;
|
|
1024
|
+
let Me = !1;
|
|
1023
1025
|
const Nt = async (e) => {
|
|
1024
|
-
if (
|
|
1026
|
+
if (Me) {
|
|
1025
1027
|
console.warn("[TWD] Request mocking already initialized");
|
|
1026
1028
|
return;
|
|
1027
1029
|
}
|
|
1028
1030
|
if ("serviceWorker" in navigator) {
|
|
1029
|
-
|
|
1031
|
+
Me = !0;
|
|
1030
1032
|
const t = e ?? "/mock-sw.js";
|
|
1031
|
-
await navigator.serviceWorker.register(`${t}?v=${
|
|
1033
|
+
await navigator.serviceWorker.register(`${t}?v=${Ye}`), navigator.serviceWorker.controller || await new Promise((r) => {
|
|
1032
1034
|
navigator.serviceWorker.addEventListener("controllerchange", r, { once: !0 });
|
|
1033
1035
|
}), navigator.serviceWorker.addEventListener("message", (r) => {
|
|
1034
1036
|
if (r.data?.type === "EXECUTED") {
|
|
1035
|
-
const { alias: n, request: s } = r.data,
|
|
1036
|
-
|
|
1037
|
+
const { alias: n, request: s, hitCount: o } = r.data, l = fe.find((c) => c.alias === n);
|
|
1038
|
+
l && (l.executed = !0, l.request = s, l.hitCount = o), B.counts[n] = o ?? (B.counts[n] ?? 0) + 1;
|
|
1037
1039
|
}
|
|
1038
1040
|
});
|
|
1039
1041
|
}
|
|
1040
|
-
}, Bt = () =>
|
|
1042
|
+
}, Bt = () => fe, Dt = () => {
|
|
1043
|
+
navigator.serviceWorker.controller?.postMessage({
|
|
1044
|
+
type: "CLEAR_RULES",
|
|
1045
|
+
version: Ye
|
|
1046
|
+
}), fe.length = 0;
|
|
1047
|
+
for (const e in B.counts)
|
|
1048
|
+
delete B.counts[e];
|
|
1049
|
+
}, Pt = () => /* @__PURE__ */ d(ee, { className: "lucide-wifi-pen-icon lucide-wifi-pen", dataTestId: "wifi-pen-icon", children: [
|
|
1041
1050
|
/* @__PURE__ */ d("path", { d: "M2 8.82a15 15 0 0 1 20 0" }),
|
|
1042
1051
|
/* @__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" }),
|
|
1043
1052
|
/* @__PURE__ */ d("path", { d: "M5 12.859a10 10 0 0 1 10.5-2.222" }),
|
|
1044
1053
|
/* @__PURE__ */ d("path", { d: "M8.5 16.429a5 5 0 0 1 3-1.406" })
|
|
1045
|
-
] }),
|
|
1054
|
+
] }), Ft = () => {
|
|
1046
1055
|
const e = Bt(), t = e.filter((n) => n.executed);
|
|
1047
1056
|
return /* @__PURE__ */ d(
|
|
1048
1057
|
"button",
|
|
@@ -1069,7 +1078,7 @@ const Nt = async (e) => {
|
|
|
1069
1078
|
boxShadow: "var(--twd-shadow-sm)"
|
|
1070
1079
|
},
|
|
1071
1080
|
children: [
|
|
1072
|
-
/* @__PURE__ */ d(
|
|
1081
|
+
/* @__PURE__ */ d(Pt, {}),
|
|
1073
1082
|
/* @__PURE__ */ d("span", { style: { flex: 1 }, children: [
|
|
1074
1083
|
"Rules: ",
|
|
1075
1084
|
t.length,
|
|
@@ -1085,7 +1094,11 @@ const Nt = async (e) => {
|
|
|
1085
1094
|
]
|
|
1086
1095
|
}
|
|
1087
1096
|
);
|
|
1088
|
-
},
|
|
1097
|
+
}, Ot = /* @__PURE__ */ new Map();
|
|
1098
|
+
function jt() {
|
|
1099
|
+
Ot.clear();
|
|
1100
|
+
}
|
|
1101
|
+
const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (e) => e.actual !== void 0 && e.expected !== void 0 ? {
|
|
1089
1102
|
type: "diff",
|
|
1090
1103
|
actual: e.actual,
|
|
1091
1104
|
expected: e.expected,
|
|
@@ -1093,14 +1106,14 @@ const Nt = async (e) => {
|
|
|
1093
1106
|
} : {
|
|
1094
1107
|
type: "message",
|
|
1095
1108
|
message: e.message
|
|
1096
|
-
},
|
|
1097
|
-
const t =
|
|
1109
|
+
}, qt = (e) => {
|
|
1110
|
+
const t = Ke(e);
|
|
1098
1111
|
if (t.type === "diff") {
|
|
1099
1112
|
const r = t.operator || "unknown";
|
|
1100
1113
|
console.error(`Assertion failed with operator: ${r}`), console.group("Expected:"), console.log(t.expected), console.groupEnd(), console.group("Actual:"), console.log(t.actual), console.groupEnd();
|
|
1101
1114
|
} else
|
|
1102
1115
|
console.error(t.message);
|
|
1103
|
-
},
|
|
1116
|
+
}, Vt = (e) => {
|
|
1104
1117
|
if (e.status === "pass")
|
|
1105
1118
|
return `Test "${e.name}" passed.`;
|
|
1106
1119
|
if (e.status === "fail") {
|
|
@@ -1116,16 +1129,21 @@ const Nt = async (e) => {
|
|
|
1116
1129
|
} else if (e.status === "skip")
|
|
1117
1130
|
return `Test "${e.name}" skipped.`;
|
|
1118
1131
|
return "";
|
|
1119
|
-
},
|
|
1132
|
+
}, Jt = (e) => {
|
|
1120
1133
|
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 = [];
|
|
1121
1134
|
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(", ") + ".");
|
|
1122
|
-
},
|
|
1135
|
+
}, Xt = {
|
|
1123
1136
|
left: { left: 0, borderRight: "1px solid var(--twd-border)" },
|
|
1124
1137
|
right: { right: 0, borderLeft: "1px solid var(--twd-border)" }
|
|
1125
|
-
},
|
|
1126
|
-
const [r, n] =
|
|
1127
|
-
|
|
1128
|
-
const [l, c] =
|
|
1138
|
+
}, Gt = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Yt = (e) => sessionStorage.getItem("twd-sidebar-open") ? sessionStorage.getItem("twd-sidebar-open") === "true" : e, Kt = ({ open: e, position: t = "left" }) => {
|
|
1139
|
+
const [r, n] = V(0), [s, o] = V(Yt(e));
|
|
1140
|
+
Lt({ isOpen: s, position: t });
|
|
1141
|
+
const [l, c] = V("");
|
|
1142
|
+
Q(() => {
|
|
1143
|
+
const _ = () => n((g) => g + 1);
|
|
1144
|
+
return window.addEventListener("twd:state-change", _), () => window.removeEventListener("twd:state-change", _);
|
|
1145
|
+
}, []);
|
|
1146
|
+
const f = new Ge({
|
|
1129
1147
|
onStart: (_) => {
|
|
1130
1148
|
_.status = "running", n((g) => g + 1);
|
|
1131
1149
|
},
|
|
@@ -1133,9 +1151,9 @@ const Nt = async (e) => {
|
|
|
1133
1151
|
_.status = "pass", n((g) => g + 1);
|
|
1134
1152
|
},
|
|
1135
1153
|
onFail: (_, g) => {
|
|
1136
|
-
if (_.status = "fail", console.group(`%c❌ Test failed: ${_.name}`, "color: red; font-weight: bold;"),
|
|
1137
|
-
|
|
1138
|
-
const v =
|
|
1154
|
+
if (_.status = "fail", console.group(`%c❌ Test failed: ${_.name}`, "color: red; font-weight: bold;"), Ut(g)) {
|
|
1155
|
+
qt(g);
|
|
1156
|
+
const v = Ke(g);
|
|
1139
1157
|
v.type === "diff" ? _.logs.push(JSON.stringify({
|
|
1140
1158
|
type: R.CHAI_DIFF,
|
|
1141
1159
|
expected: v.expected,
|
|
@@ -1158,23 +1176,23 @@ const Nt = async (e) => {
|
|
|
1158
1176
|
o(_), sessionStorage.setItem("twd-sidebar-open", _.toString());
|
|
1159
1177
|
}, h = async () => {
|
|
1160
1178
|
c(""), sessionStorage.removeItem("twd-last-run-test-name"), await f.runAll();
|
|
1161
|
-
const _ =
|
|
1179
|
+
const _ = Jt(u);
|
|
1162
1180
|
c(_);
|
|
1163
1181
|
}, i = async (_) => {
|
|
1164
1182
|
const g = Array.from(S.values()).filter((m) => m.type === "test").find((m) => m.id === _);
|
|
1165
1183
|
if (!g) return;
|
|
1166
1184
|
c(""), sessionStorage.setItem("twd-last-run-test-name", g.name), await f.runSingle(g.id);
|
|
1167
|
-
const v =
|
|
1185
|
+
const v = Vt(g);
|
|
1168
1186
|
c(v);
|
|
1169
1187
|
}, u = Array.from(S.values());
|
|
1170
1188
|
if (!s)
|
|
1171
|
-
return /* @__PURE__ */ d(
|
|
1189
|
+
return /* @__PURE__ */ d(It, { position: t, setOpen: a });
|
|
1172
1190
|
const p = u.filter((_) => _.type === "test").length;
|
|
1173
1191
|
return /* @__PURE__ */ d(
|
|
1174
1192
|
"div",
|
|
1175
1193
|
{
|
|
1176
1194
|
style: {
|
|
1177
|
-
fontFamily:
|
|
1195
|
+
fontFamily: Gt,
|
|
1178
1196
|
position: "fixed",
|
|
1179
1197
|
top: 0,
|
|
1180
1198
|
bottom: 0,
|
|
@@ -1187,7 +1205,7 @@ const Nt = async (e) => {
|
|
|
1187
1205
|
zIndex: "var(--twd-z-index-sidebar)",
|
|
1188
1206
|
pointerEvents: "all",
|
|
1189
1207
|
isolation: "isolate",
|
|
1190
|
-
...
|
|
1208
|
+
...Xt[t]
|
|
1191
1209
|
},
|
|
1192
1210
|
"data-testid": "twd-sidebar",
|
|
1193
1211
|
role: "complementary",
|
|
@@ -1208,21 +1226,41 @@ const Nt = async (e) => {
|
|
|
1208
1226
|
alignItems: "center",
|
|
1209
1227
|
marginBottom: "var(--twd-spacing-xl)"
|
|
1210
1228
|
}, children: [
|
|
1211
|
-
/* @__PURE__ */ d(
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1229
|
+
/* @__PURE__ */ d("div", { style: { display: "flex", gap: "var(--twd-spacing-xs)" }, children: [
|
|
1230
|
+
/* @__PURE__ */ d(
|
|
1231
|
+
"button",
|
|
1232
|
+
{
|
|
1233
|
+
onClick: h,
|
|
1234
|
+
style: {
|
|
1235
|
+
background: "var(--twd-button-primary)",
|
|
1236
|
+
color: "var(--twd-button-primary-text)",
|
|
1237
|
+
padding: "var(--twd-spacing-xs) var(--twd-spacing-md)",
|
|
1238
|
+
borderRadius: "var(--twd-border-radius)",
|
|
1239
|
+
border: "none",
|
|
1240
|
+
cursor: "pointer"
|
|
1241
|
+
},
|
|
1242
|
+
children: "Run All"
|
|
1243
|
+
}
|
|
1244
|
+
),
|
|
1245
|
+
/* @__PURE__ */ d(
|
|
1246
|
+
"button",
|
|
1247
|
+
{
|
|
1248
|
+
onClick: () => {
|
|
1249
|
+
Dt(), jt();
|
|
1250
|
+
},
|
|
1251
|
+
"aria-label": "Clear all mocks",
|
|
1252
|
+
style: {
|
|
1253
|
+
background: "var(--twd-button-secondary)",
|
|
1254
|
+
color: "var(--twd-button-secondary-text)",
|
|
1255
|
+
padding: "var(--twd-spacing-xs) var(--twd-spacing-md)",
|
|
1256
|
+
borderRadius: "var(--twd-border-radius)",
|
|
1257
|
+
border: "1px solid var(--twd-button-border)",
|
|
1258
|
+
cursor: "pointer"
|
|
1259
|
+
},
|
|
1260
|
+
children: "Clear mocks"
|
|
1261
|
+
}
|
|
1262
|
+
)
|
|
1263
|
+
] }),
|
|
1226
1264
|
/* @__PURE__ */ d(
|
|
1227
1265
|
"button",
|
|
1228
1266
|
{
|
|
@@ -1263,10 +1301,10 @@ const Nt = async (e) => {
|
|
|
1263
1301
|
] })
|
|
1264
1302
|
] })
|
|
1265
1303
|
] }),
|
|
1266
|
-
/* @__PURE__ */ d(
|
|
1304
|
+
/* @__PURE__ */ d(Ft, {})
|
|
1267
1305
|
] }),
|
|
1268
1306
|
/* @__PURE__ */ d("div", { style: { padding: "var(--twd-spacing-md)" }, children: /* @__PURE__ */ d(
|
|
1269
|
-
|
|
1307
|
+
Ct,
|
|
1270
1308
|
{
|
|
1271
1309
|
tests: u.map((_) => ({
|
|
1272
1310
|
name: _.name,
|
|
@@ -1285,18 +1323,18 @@ const Nt = async (e) => {
|
|
|
1285
1323
|
]
|
|
1286
1324
|
}
|
|
1287
1325
|
);
|
|
1288
|
-
},
|
|
1326
|
+
}, Zt = (e) => ({
|
|
1289
1327
|
render: (t) => {
|
|
1290
|
-
|
|
1328
|
+
it(t, e);
|
|
1291
1329
|
}
|
|
1292
|
-
}),
|
|
1330
|
+
}), er = (e, t) => {
|
|
1293
1331
|
const { open: r = !0, position: n = "left", serviceWorker: s = !0, serviceWorkerUrl: o = "/mock-sw.js", theme: l } = t || {};
|
|
1294
|
-
|
|
1332
|
+
ut(e, /* @__PURE__ */ d(Kt, { open: r, position: n }), Zt, l), s && Nt(o).then(() => {
|
|
1295
1333
|
console.log("Request mocking initialized");
|
|
1296
1334
|
}).catch((c) => {
|
|
1297
1335
|
console.error("Error initializing request mocking:", c);
|
|
1298
1336
|
});
|
|
1299
1337
|
};
|
|
1300
1338
|
export {
|
|
1301
|
-
|
|
1339
|
+
er as initTWD
|
|
1302
1340
|
};
|