twd-js 1.6.0 → 1.6.2

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