twd-js 1.5.2 → 1.6.0

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