twd-js 1.3.1 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundled.d.ts CHANGED
@@ -4,6 +4,24 @@ interface TestModule {
4
4
  interface InitTWDOptions {
5
5
  open?: boolean;
6
6
  position?: "left" | "right";
7
+ serviceWorker?: boolean;
8
+ serviceWorkerUrl?: string;
7
9
  }
10
+ /**
11
+ * Initialize TWD with tests and optional configuration
12
+ * @param files The test modules
13
+ * @param options The options for the initialization
14
+ * @param options.open Whether to open the sidebar
15
+ * @param options.position The position of the sidebar
16
+ * @param options.serviceWorker Whether to use the service worker
17
+ * @param options.serviceWorkerUrl The URL of the service worker
18
+ * @returns void
19
+ * @example
20
+ * initTWD(testModules, { open: true, position: 'left' });
21
+ * @example
22
+ * initTWD(testModules, { open: true, position: 'left', serviceWorker: false });
23
+ * @example
24
+ * initTWD(testModules, { open: true, position: 'left', serviceWorker: true, serviceWorkerUrl: '/mock-sw.js' });
25
+ */
8
26
  export declare const initTWD: (files: TestModule, options?: InitTWDOptions) => void;
9
27
  export {};
@@ -1,4 +1,4 @@
1
- var j, h, xe, C, le, Se, Te, Ee, ne, G, X, M = {}, Re = [], Fe = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, q = Array.isArray;
1
+ var O, h, xe, C, le, Se, Te, Ee, ne, G, X, M = {}, Re = [], Ue = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, q = Array.isArray;
2
2
  function T(t, e) {
3
3
  for (var n in e) t[n] = e[n];
4
4
  return t;
@@ -6,10 +6,10 @@ function T(t, e) {
6
6
  function re(t) {
7
7
  t && t.parentNode && t.parentNode.removeChild(t);
8
8
  }
9
- function Ue(t, e, n) {
9
+ function Fe(t, e, n) {
10
10
  var r, s, i, _ = {};
11
11
  for (i in e) i == "key" ? r = e[i] : i == "ref" ? s = e[i] : _[i] = e[i];
12
- if (arguments.length > 2 && (_.children = arguments.length > 3 ? j.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (i in t.defaultProps) _[i] === void 0 && (_[i] = t.defaultProps[i]);
12
+ if (arguments.length > 2 && (_.children = arguments.length > 3 ? O.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (i in t.defaultProps) _[i] === void 0 && (_[i] = t.defaultProps[i]);
13
13
  return B(t, _, r, s, null);
14
14
  }
15
15
  function B(t, e, n, r, s) {
@@ -19,7 +19,7 @@ function B(t, e, n, r, s) {
19
19
  function L(t) {
20
20
  return t.children;
21
21
  }
22
- function F(t, e) {
22
+ function U(t, e) {
23
23
  this.props = t, this.context = e;
24
24
  }
25
25
  function A(t, e) {
@@ -41,7 +41,7 @@ function ae(t) {
41
41
  (!t.__d && (t.__d = !0) && C.push(t) && !z.__r++ || le != h.debounceRendering) && ((le = h.debounceRendering) || Se)(z);
42
42
  }
43
43
  function z() {
44
- for (var t, e, n, r, s, i, _, l = 1; C.length; ) C.length > l && C.sort(Te), t = C.shift(), l = C.length, t.__d && (n = void 0, r = void 0, s = (r = (e = t).__v).__e, i = [], _ = [], e.__P && ((n = T({}, r)).__v = r.__v + 1, h.vnode && h.vnode(n), oe(e.__P, n, r, e.__n, e.__P.namespaceURI, 32 & r.__u ? [s] : null, i, s ?? A(r), !!(32 & r.__u), _), n.__v = r.__v, n.__.__k[n.__i] = n, He(i, n, _), r.__e = r.__ = null, n.__e != s && Ce(n)));
44
+ for (var t, e, n, r, s, i, _, l = 1; C.length; ) C.length > l && C.sort(Te), t = C.shift(), l = C.length, t.__d && (n = void 0, r = void 0, s = (r = (e = t).__v).__e, i = [], _ = [], e.__P && ((n = T({}, r)).__v = r.__v + 1, h.vnode && h.vnode(n), oe(e.__P, n, r, e.__n, e.__P.namespaceURI, 32 & r.__u ? [s] : null, i, s ?? A(r), !!(32 & r.__u), _), n.__v = r.__v, n.__.__k[n.__i] = n, We(i, n, _), r.__e = r.__ = null, n.__e != s && Ce(n)));
45
45
  z.__r = 0;
46
46
  }
47
47
  function $e(t, e, n, r, s, i, _, l, u, a, p) {
@@ -51,7 +51,7 @@ function $e(t, e, n, r, s, i, _, l, u, a, p) {
51
51
  }
52
52
  function ze(t, e, n, r, s) {
53
53
  var i, _, l, u, a, p = n.length, o = p, f = 0;
54
- for (t.__k = new Array(s), i = 0; i < s; i++) (_ = e[i]) != null && typeof _ != "boolean" && typeof _ != "function" ? (typeof _ == "string" || typeof _ == "number" || typeof _ == "bigint" || _.constructor == String ? _ = t.__k[i] = B(null, _, null, null, null) : q(_) ? _ = t.__k[i] = B(L, { children: _ }, null, null, null) : _.constructor == null && _.__b > 0 ? _ = t.__k[i] = B(_.type, _.props, _.key, _.ref ? _.ref : null, _.__v) : t.__k[i] = _, u = i + f, _.__ = t, _.__b = t.__b + 1, (a = _.__i = Oe(_, n, u, o)) != -1 && (o--, (l = n[a]) && (l.__u |= 2)), l == null || l.__v == null ? (a == -1 && (s > p ? f-- : s < p && f++), typeof _.type != "function" && (_.__u |= 4)) : a != u && (a == u - 1 ? f-- : a == u + 1 ? f++ : (a > u ? f-- : f++, _.__u |= 4))) : t.__k[i] = null;
54
+ for (t.__k = new Array(s), i = 0; i < s; i++) (_ = e[i]) != null && typeof _ != "boolean" && typeof _ != "function" ? (typeof _ == "string" || typeof _ == "number" || typeof _ == "bigint" || _.constructor == String ? _ = t.__k[i] = B(null, _, null, null, null) : q(_) ? _ = t.__k[i] = B(L, { children: _ }, null, null, null) : _.constructor == null && _.__b > 0 ? _ = t.__k[i] = B(_.type, _.props, _.key, _.ref ? _.ref : null, _.__v) : t.__k[i] = _, u = i + f, _.__ = t, _.__b = t.__b + 1, (a = _.__i = je(_, n, u, o)) != -1 && (o--, (l = n[a]) && (l.__u |= 2)), l == null || l.__v == null ? (a == -1 && (s > p ? f-- : s < p && f++), typeof _.type != "function" && (_.__u |= 4)) : a != u && (a == u - 1 ? f-- : a == u + 1 ? f++ : (a > u ? f-- : f++, _.__u |= 4))) : t.__k[i] = null;
55
55
  if (o) for (i = 0; i < p; i++) (l = n[i]) != null && (2 & l.__u) == 0 && (l.__e == r && (r = A(l)), Me(l, l));
56
56
  return r;
57
57
  }
@@ -67,7 +67,7 @@ function Ae(t, e, n, r) {
67
67
  while (e != null && e.nodeType == 8);
68
68
  return e;
69
69
  }
70
- function Oe(t, e, n, r) {
70
+ function je(t, e, n, r) {
71
71
  var s, i, _, l = t.key, u = t.type, a = e[n], p = a != null && (2 & a.__u) == 0;
72
72
  if (a === null && l == null || p && l == a.key && u == a.type) return n;
73
73
  if (r > (p ? 1 : 0)) {
@@ -76,9 +76,9 @@ function Oe(t, e, n, r) {
76
76
  return -1;
77
77
  }
78
78
  function ce(t, e, n) {
79
- e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || Fe.test(e) ? n : n + "px";
79
+ e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || Ue.test(e) ? n : n + "px";
80
80
  }
81
- function P(t, e, n, r, s) {
81
+ function D(t, e, n, r, s) {
82
82
  var i, _;
83
83
  e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
84
84
  else {
@@ -107,11 +107,11 @@ function ue(t) {
107
107
  };
108
108
  }
109
109
  function oe(t, e, n, r, s, i, _, l, u, a) {
110
- var p, o, f, d, b, x, k, m, g, E, R, N, H, _e, I, W, K, S = e.type;
110
+ var p, o, f, d, b, x, k, m, g, E, R, N, W, _e, I, H, K, S = e.type;
111
111
  if (e.constructor != null) return null;
112
112
  128 & n.__u && (u = !!(32 & n.__u), i = [l = e.__e = n.__e]), (p = h.__b) && p(e);
113
113
  e: if (typeof S == "function") try {
114
- if (m = e.props, g = "prototype" in S && S.prototype.render, E = (p = S.contextType) && r[p.__c], R = p ? E ? E.props.value : p.__ : r, n.__c ? k = (o = e.__c = n.__c).__ = o.__E : (g ? e.__c = o = new S(m, R) : (e.__c = o = new F(m, R), o.constructor = S, o.render = qe), E && E.sub(o), o.state || (o.state = {}), o.__n = r, f = o.__d = !0, o.__h = [], o._sb = []), g && o.__s == null && (o.__s = o.state), g && S.getDerivedStateFromProps != null && (o.__s == o.state && (o.__s = T({}, o.__s)), T(o.__s, S.getDerivedStateFromProps(m, o.__s))), d = o.props, b = o.state, o.__v = e, f) g && S.getDerivedStateFromProps == null && o.componentWillMount != null && o.componentWillMount(), g && o.componentDidMount != null && o.__h.push(o.componentDidMount);
114
+ if (m = e.props, g = "prototype" in S && S.prototype.render, E = (p = S.contextType) && r[p.__c], R = p ? E ? E.props.value : p.__ : r, n.__c ? k = (o = e.__c = n.__c).__ = o.__E : (g ? e.__c = o = new S(m, R) : (e.__c = o = new U(m, R), o.constructor = S, o.render = qe), E && E.sub(o), o.state || (o.state = {}), o.__n = r, f = o.__d = !0, o.__h = [], o._sb = []), g && o.__s == null && (o.__s = o.state), g && S.getDerivedStateFromProps != null && (o.__s == o.state && (o.__s = T({}, o.__s)), T(o.__s, S.getDerivedStateFromProps(m, o.__s))), d = o.props, b = o.state, o.__v = e, f) g && S.getDerivedStateFromProps == null && o.componentWillMount != null && o.componentWillMount(), g && o.componentDidMount != null && o.__h.push(o.componentDidMount);
115
115
  else {
116
116
  if (g && S.getDerivedStateFromProps == null && m !== d && o.componentWillReceiveProps != null && o.componentWillReceiveProps(m, R), e.__v == n.__v || !o.__e && o.shouldComponentUpdate != null && o.shouldComponentUpdate(m, o.__s, R) === !1) {
117
117
  for (e.__v != n.__v && (o.props = m, o.state = o.__s, o.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function($) {
@@ -124,13 +124,13 @@ function oe(t, e, n, r, s, i, _, l, u, a) {
124
124
  o.componentDidUpdate(d, b, x);
125
125
  });
126
126
  }
127
- if (o.context = R, o.props = m, o.__P = t, o.__e = !1, H = h.__r, _e = 0, g) {
128
- for (o.state = o.__s, o.__d = !1, H && H(e), p = o.render(o.props, o.state, o.context), I = 0; I < o._sb.length; I++) o.__h.push(o._sb[I]);
127
+ if (o.context = R, o.props = m, o.__P = t, o.__e = !1, W = h.__r, _e = 0, g) {
128
+ for (o.state = o.__s, o.__d = !1, W && W(e), p = o.render(o.props, o.state, o.context), I = 0; I < o._sb.length; I++) o.__h.push(o._sb[I]);
129
129
  o._sb = [];
130
130
  } else do
131
- o.__d = !1, H && H(e), p = o.render(o.props, o.state, o.context), o.state = o.__s;
131
+ o.__d = !1, W && W(e), p = o.render(o.props, o.state, o.context), o.state = o.__s;
132
132
  while (o.__d && ++_e < 25);
133
- o.state = o.__s, o.getChildContext != null && (r = T(T({}, r), o.getChildContext())), g && !f && o.getSnapshotBeforeUpdate != null && (x = o.getSnapshotBeforeUpdate(d, b)), W = p, p != null && p.type === L && p.key == null && (W = We(p.props.children)), l = $e(t, q(W) ? W : [W], e, n, r, s, i, _, l, u, a), o.base = e.__e, e.__u &= -161, o.__h.length && _.push(o), k && (o.__E = o.__ = null);
133
+ o.state = o.__s, o.getChildContext != null && (r = T(T({}, r), o.getChildContext())), g && !f && o.getSnapshotBeforeUpdate != null && (x = o.getSnapshotBeforeUpdate(d, b)), H = p, p != null && p.type === L && p.key == null && (H = He(p.props.children)), l = $e(t, q(H) ? H : [H], e, n, r, s, i, _, l, u, a), o.base = e.__e, e.__u &= -161, o.__h.length && _.push(o), k && (o.__E = o.__ = null);
134
134
  } catch ($) {
135
135
  if (e.__v = null, u || i != null) if ($.then) {
136
136
  for (e.__u |= u ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
@@ -142,13 +142,13 @@ function oe(t, e, n, r, s, i, _, l, u, a) {
142
142
  else e.__e = n.__e, e.__k = n.__k, $.then || J(e);
143
143
  h.__e($, e, n);
144
144
  }
145
- else i == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = je(n.__e, e, n, r, s, i, _, u, a);
145
+ else i == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = Oe(n.__e, e, n, r, s, i, _, u, a);
146
146
  return (p = h.diffed) && p(e), 128 & e.__u ? void 0 : l;
147
147
  }
148
148
  function J(t) {
149
149
  t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(J);
150
150
  }
151
- function He(t, e, n) {
151
+ function We(t, e, n) {
152
152
  for (var r = 0; r < n.length; r++) ie(n[r], n[++r], n[++r]);
153
153
  h.__c && h.__c(e, t), t.some(function(s) {
154
154
  try {
@@ -160,10 +160,10 @@ function He(t, e, n) {
160
160
  }
161
161
  });
162
162
  }
163
- function We(t) {
164
- return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : q(t) ? t.map(We) : T({}, t);
163
+ function He(t) {
164
+ return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : q(t) ? t.map(He) : T({}, t);
165
165
  }
166
- function je(t, e, n, r, s, i, _, l, u) {
166
+ function Oe(t, e, n, r, s, i, _, l, u) {
167
167
  var a, p, o, f, d, b, x, k = n.props || M, m = e.props, g = e.type;
168
168
  if (g == "svg" ? s = "http://www.w3.org/2000/svg" : g == "math" ? s = "http://www.w3.org/1998/Math/MathML" : s || (s = "http://www.w3.org/1999/xhtml"), i != null) {
169
169
  for (a = 0; a < i.length; a++) if ((d = i[a]) && "setAttribute" in d == !!g && (g ? d.localName == g : d.nodeType == 3)) {
@@ -177,18 +177,18 @@ function je(t, e, n, r, s, i, _, l, u) {
177
177
  }
178
178
  if (g == null) k === m || l && t.data == m || (t.data = m);
179
179
  else {
180
- if (i = i && j.call(t.childNodes), !l && i != null) for (k = {}, a = 0; a < t.attributes.length; a++) k[(d = t.attributes[a]).name] = d.value;
180
+ if (i = i && O.call(t.childNodes), !l && i != null) for (k = {}, a = 0; a < t.attributes.length; a++) k[(d = t.attributes[a]).name] = d.value;
181
181
  for (a in k) if (d = k[a], a != "children") {
182
182
  if (a == "dangerouslySetInnerHTML") o = d;
183
183
  else if (!(a in m)) {
184
184
  if (a == "value" && "defaultValue" in m || a == "checked" && "defaultChecked" in m) continue;
185
- P(t, a, null, d, s);
185
+ D(t, a, null, d, s);
186
186
  }
187
187
  }
188
- for (a in m) d = m[a], a == "children" ? f = d : a == "dangerouslySetInnerHTML" ? p = d : a == "value" ? b = d : a == "checked" ? x = d : l && typeof d != "function" || k[a] === d || P(t, a, d, k[a], s);
188
+ for (a in m) d = m[a], a == "children" ? f = d : a == "dangerouslySetInnerHTML" ? p = d : a == "value" ? b = d : a == "checked" ? x = d : l && typeof d != "function" || k[a] === d || D(t, a, d, k[a], s);
189
189
  if (p) l || o && (p.__html == o.__html || p.__html == t.innerHTML) || (t.innerHTML = p.__html), e.__k = [];
190
190
  else if (o && (t.innerHTML = ""), $e(e.type == "template" ? t.content : t, q(f) ? f : [f], e, n, r, g == "foreignObject" ? "http://www.w3.org/1999/xhtml" : s, i, _, i ? i[0] : n.__k && A(n, 0), l, u), i != null) for (a = i.length; a--; ) re(i[a]);
191
- l || (a = "value", g == "progress" && b == null ? t.removeAttribute("value") : b != null && (b !== t[a] || g == "progress" && !b || g == "option" && b != k[a]) && P(t, a, b, k[a], s), a = "checked", x != null && x != t[a] && P(t, a, x, k[a], s));
191
+ l || (a = "value", g == "progress" && b == null ? t.removeAttribute("value") : b != null && (b !== t[a] || g == "progress" && !b || g == "option" && b != k[a]) && D(t, a, b, k[a], s), a = "checked", x != null && x != t[a] && D(t, a, x, k[a], s));
192
192
  }
193
193
  return t;
194
194
  }
@@ -220,21 +220,21 @@ function qe(t, e, n) {
220
220
  }
221
221
  function Ve(t, e, n) {
222
222
  var r, s, i, _;
223
- e == document && (e = document.documentElement), h.__ && h.__(t, e), s = (r = !1) ? null : e.__k, i = [], _ = [], oe(e, t = e.__k = Ue(L, null, [t]), s || M, M, e.namespaceURI, s ? null : e.firstChild ? j.call(e.childNodes) : null, i, s ? s.__e : e.firstChild, r, _), He(i, t, _);
223
+ e == document && (e = document.documentElement), h.__ && h.__(t, e), s = (r = !1) ? null : e.__k, i = [], _ = [], oe(e, t = e.__k = Fe(L, null, [t]), s || M, M, e.namespaceURI, s ? null : e.firstChild ? O.call(e.childNodes) : null, i, s ? s.__e : e.firstChild, r, _), We(i, t, _);
224
224
  }
225
- j = Re.slice, h = { __e: function(t, e, n, r) {
225
+ O = Re.slice, h = { __e: function(t, e, n, r) {
226
226
  for (var s, i, _; e = e.__; ) if ((s = e.__c) && !s.__) try {
227
227
  if ((i = s.constructor) && i.getDerivedStateFromError != null && (s.setState(i.getDerivedStateFromError(t)), _ = s.__d), s.componentDidCatch != null && (s.componentDidCatch(t, r || {}), _ = s.__d), _) return s.__E = s;
228
228
  } catch (l) {
229
229
  t = l;
230
230
  }
231
231
  throw t;
232
- } }, xe = 0, F.prototype.setState = function(t, e) {
232
+ } }, xe = 0, U.prototype.setState = function(t, e) {
233
233
  var n;
234
234
  n = this.__s != null && this.__s != this.state ? this.__s : this.__s = T({}, this.state), typeof t == "function" && (t = t(T({}, n), this.props)), t && T(n, t), t != null && this.__v && (e && this._sb.push(e), ae(this));
235
- }, F.prototype.forceUpdate = function(t) {
235
+ }, U.prototype.forceUpdate = function(t) {
236
236
  this.__v && (this.__e = !0, t && this.__h.push(t), ae(this));
237
- }, F.prototype.render = L, C = [], Se = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Te = function(t, e) {
237
+ }, U.prototype.render = L, C = [], Se = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Te = function(t, e) {
238
238
  return t.__v.__b - e.__v.__b;
239
239
  }, z.__r = 0, Ee = /(PointerCapture)$|Capture$/i, ne = 0, G = ue(!1), X = ue(!0);
240
240
  var Ke = 0;
@@ -253,7 +253,7 @@ const Ye = (t) => {
253
253
  for (const r in t) await t[r]();
254
254
  Ye({ Component: e, createRoot: n });
255
255
  };
256
- var O, y, Y, de, Q = 0, Le = [], v = h, fe = v.__b, pe = v.__r, he = v.diffed, ge = v.__c, me = v.unmount, ye = v.__;
256
+ var j, y, Y, de, Q = 0, Le = [], v = h, fe = v.__b, pe = v.__r, he = v.diffed, ge = v.__c, me = v.unmount, ye = v.__;
257
257
  function Ne(t, e) {
258
258
  v.__h && v.__h(y, t, Q || e), Q = 0;
259
259
  var n = y.__H || (y.__H = { __: [], __h: [] });
@@ -263,7 +263,7 @@ function Z(t) {
263
263
  return Q = 1, Xe(Ie, t);
264
264
  }
265
265
  function Xe(t, e, n) {
266
- var r = Ne(O++, 2);
266
+ var r = Ne(j++, 2);
267
267
  if (r.t = t, !r.__c && (r.__ = [Ie(void 0, e), function(l) {
268
268
  var u = r.__N ? r.__N[0] : r.__[0], a = r.t(u, l);
269
269
  u !== a && (r.__N = [a, r.__[1]], r.__c.setState({}));
@@ -297,12 +297,12 @@ function Xe(t, e, n) {
297
297
  return r.__N || r.__;
298
298
  }
299
299
  function Je(t, e) {
300
- var n = Ne(O++, 3);
300
+ var n = Ne(j++, 3);
301
301
  !v.__s && et(n.__H, e) && (n.__ = t, n.u = e, y.__H.__h.push(n));
302
302
  }
303
303
  function Qe() {
304
304
  for (var t; t = Le.shift(); ) if (t.__P && t.__H) try {
305
- t.__H.__h.forEach(U), t.__H.__h.forEach(ee), t.__H.__h = [];
305
+ t.__H.__h.forEach(F), t.__H.__h.forEach(ee), t.__H.__h = [];
306
306
  } catch (e) {
307
307
  t.__H.__h = [], v.__e(e, t.__v);
308
308
  }
@@ -312,11 +312,11 @@ v.__b = function(t) {
312
312
  }, v.__ = function(t, e) {
313
313
  t && e.__k && e.__k.__m && (t.__m = e.__k.__m), ye && ye(t, e);
314
314
  }, v.__r = function(t) {
315
- pe && pe(t), O = 0;
315
+ pe && pe(t), j = 0;
316
316
  var e = (y = t.__c).__H;
317
317
  e && (Y === y ? (e.__h = [], y.__h = [], e.__.forEach(function(n) {
318
318
  n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
319
- })) : (e.__h.forEach(U), e.__h.forEach(ee), e.__h = [], O = 0)), Y = y;
319
+ })) : (e.__h.forEach(F), e.__h.forEach(ee), e.__h = [], j = 0)), Y = y;
320
320
  }, v.diffed = function(t) {
321
321
  he && he(t);
322
322
  var e = t.__c;
@@ -326,7 +326,7 @@ v.__b = function(t) {
326
326
  }, v.__c = function(t, e) {
327
327
  e.some(function(n) {
328
328
  try {
329
- n.__h.forEach(U), n.__h = n.__h.filter(function(r) {
329
+ n.__h.forEach(F), n.__h = n.__h.filter(function(r) {
330
330
  return !r.__ || ee(r);
331
331
  });
332
332
  } catch (r) {
@@ -340,7 +340,7 @@ v.__b = function(t) {
340
340
  var e, n = t.__c;
341
341
  n && n.__H && (n.__H.__.forEach(function(r) {
342
342
  try {
343
- U(r);
343
+ F(r);
344
344
  } catch (s) {
345
345
  e = s;
346
346
  }
@@ -353,7 +353,7 @@ function Ze(t) {
353
353
  }, r = setTimeout(n, 35);
354
354
  ve && (e = requestAnimationFrame(n));
355
355
  }
356
- function U(t) {
356
+ function F(t) {
357
357
  var e = y, n = t.__c;
358
358
  typeof n == "function" && (t.__c = void 0, n()), y = e;
359
359
  }
@@ -394,13 +394,13 @@ const tt = (t) => {
394
394
  "data-testid": "loader-icon",
395
395
  children: /* @__PURE__ */ c("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
396
396
  }
397
- ), D = document.createElement("style");
398
- D && !document.getElementById("loader-spin-keyframes") && (D.id = "loader-spin-keyframes", D.innerHTML = `
397
+ ), P = document.createElement("style");
398
+ P && !document.getElementById("loader-spin-keyframes") && (P.id = "loader-spin-keyframes", P.innerHTML = `
399
399
  @keyframes spin {
400
400
  0% { transform: rotate(0deg); }
401
401
  100% { transform: rotate(360deg); }
402
402
  }
403
- `, document.head.appendChild(D));
403
+ `, document.head.appendChild(P));
404
404
  const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
405
405
  "svg",
406
406
  {
@@ -417,7 +417,7 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
417
417
  "data-testid": n,
418
418
  children: e
419
419
  }
420
- ), ot = () => /* @__PURE__ */ c(V, { className: "lucide-play-icon lucide-play", dataTestId: "play-icon", children: /* @__PURE__ */ c("path", { d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" }) }), Pe = ({ id: t, name: e, skip: n, only: r }) => /* @__PURE__ */ c(L, { children: [
420
+ ), ot = () => /* @__PURE__ */ c(V, { className: "lucide-play-icon lucide-play", dataTestId: "play-icon", children: /* @__PURE__ */ c("path", { d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" }) }), De = ({ id: t, name: e, skip: n, only: r }) => /* @__PURE__ */ c(L, { children: [
421
421
  e,
422
422
  " ",
423
423
  r && /* @__PURE__ */ c(
@@ -515,7 +515,7 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
515
515
  {
516
516
  style: { fontWeight: "500", color: "#374151", maxWidth: "220px" },
517
517
  children: /* @__PURE__ */ c(
518
- Pe,
518
+ De,
519
519
  {
520
520
  id: n,
521
521
  name: t.name,
@@ -619,7 +619,7 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
619
619
  "aria-expanded": !a,
620
620
  onClick: () => s(l.id),
621
621
  children: [
622
- /* @__PURE__ */ c(Pe, { id: l.id, name: l.name, skip: l.skip, only: l.only }),
622
+ /* @__PURE__ */ c(De, { id: l.id, name: l.name, skip: l.skip, only: l.only }),
623
623
  a ? /* @__PURE__ */ c(at, {}) : /* @__PURE__ */ c(lt, {})
624
624
  ]
625
625
  }
@@ -704,7 +704,7 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
704
704
  }
705
705
  return !1;
706
706
  };
707
- class De {
707
+ class Pe {
708
708
  events;
709
709
  constructor(e) {
710
710
  this.events = e;
@@ -756,20 +756,23 @@ class De {
756
756
  }
757
757
  }
758
758
  }
759
- window.__testRunner = De;
760
- const mt = "1.3.1", yt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
759
+ window.__testRunner = Pe;
760
+ const mt = "1.3.3", yt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
761
761
  rules: []
762
762
  }), window.__TWD_MOCK_STATE__) : {
763
763
  rules: []
764
764
  }, vt = yt(), Be = vt.rules, bt = async (t) => {
765
- "serviceWorker" in navigator && (await navigator.serviceWorker.register(`/mock-sw.js?v=${mt}`), navigator.serviceWorker.controller || await new Promise((n) => {
766
- navigator.serviceWorker.addEventListener("controllerchange", n, { once: !0 });
767
- }), navigator.serviceWorker.addEventListener("message", (n) => {
768
- if (n.data?.type === "EXECUTED") {
769
- const { alias: r, request: s } = n.data, i = Be.find((_) => _.alias === r);
770
- i && (i.executed = !0, i.request = s);
771
- }
772
- }));
765
+ if ("serviceWorker" in navigator) {
766
+ const e = t ?? "/mock-sw.js";
767
+ await navigator.serviceWorker.register(`${e}?v=${mt}`), navigator.serviceWorker.controller || await new Promise((n) => {
768
+ navigator.serviceWorker.addEventListener("controllerchange", n, { once: !0 });
769
+ }), navigator.serviceWorker.addEventListener("message", (n) => {
770
+ if (n.data?.type === "EXECUTED") {
771
+ const { alias: r, request: s } = n.data, i = Be.find((_) => _.alias === r);
772
+ i && (i.executed = !0, i.request = s);
773
+ }
774
+ });
775
+ }
773
776
  }, kt = () => Be, wt = () => /* @__PURE__ */ c(V, { className: "lucide-wifi-pen-icon lucide-wifi-pen", dataTestId: "wifi-pen-icon", children: [
774
777
  /* @__PURE__ */ c("path", { d: "M2 8.82a15 15 0 0 1 20 0" }),
775
778
  /* @__PURE__ */ c("path", { d: "M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z" }),
@@ -824,7 +827,7 @@ const mt = "1.3.1", yt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__
824
827
  }, Tt = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Et = ({ open: t, position: e = "left" }) => {
825
828
  const [n, r] = Z(0), [s, i] = Z(t);
826
829
  ft({ isOpen: s, position: e });
827
- const _ = new De({
830
+ const _ = new Pe({
828
831
  onStart: (o) => {
829
832
  o.status = "running", r((f) => f + 1);
830
833
  },
@@ -942,11 +945,11 @@ const mt = "1.3.1", yt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__
942
945
  Ve(e, t);
943
946
  }
944
947
  }), Ct = (t, e) => {
945
- const { open: n = !0, position: r = "left" } = e || {};
946
- Ge(t, /* @__PURE__ */ c(Et, { open: n, position: r }), Rt), bt().then(() => {
948
+ const { open: n = !0, position: r = "left", serviceWorker: s = !0, serviceWorkerUrl: i = "/mock-sw.js" } = e || {};
949
+ Ge(t, /* @__PURE__ */ c(Et, { open: n, position: r }), Rt), s && bt(i).then(() => {
947
950
  console.log("Request mocking initialized");
948
- }).catch((s) => {
949
- console.error("Error initializing request mocking:", s);
951
+ }).catch((_) => {
952
+ console.error("Error initializing request mocking:", _);
950
953
  });
951
954
  };
952
955
  export {
@@ -1,6 +1,6 @@
1
- (function(A,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(A=typeof globalThis<"u"?globalThis:A||self,E(A.TWD={}))})(this,(function(A){"use strict";var E,h,le,C,ae,ce,ue,de,Y,G,X,M={},fe=[],Ue=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,D=Array.isArray;function T(t,e){for(var n in e)t[n]=e[n];return t}function J(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function je(t,e,n){var o,s,i,_={};for(i in e)i=="key"?o=e[i]:i=="ref"?s=e[i]:_[i]=e[i];if(arguments.length>2&&(_.children=arguments.length>3?E.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)_[i]===void 0&&(_[i]=t.defaultProps[i]);return P(t,_,o,s,null)}function P(t,e,n,o,s){var i={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++le,__i:-1,__u:0};return s==null&&h.vnode!=null&&h.vnode(i),i}function L(t){return t.children}function B(t,e){this.props=t,this.context=e}function W(t,e){if(e==null)return t.__?W(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?W(t):null}function pe(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return pe(t)}}function he(t){(!t.__d&&(t.__d=!0)&&C.push(t)&&!F.__r++||ae!=h.debounceRendering)&&((ae=h.debounceRendering)||ce)(F)}function F(){for(var t,e,n,o,s,i,_,l=1;C.length;)C.length>l&&C.sort(ue),t=C.shift(),l=C.length,t.__d&&(n=void 0,o=void 0,s=(o=(e=t).__v).__e,i=[],_=[],e.__P&&((n=T({},o)).__v=o.__v+1,h.vnode&&h.vnode(n),Q(e.__P,n,o,e.__n,e.__P.namespaceURI,32&o.__u?[s]:null,i,s??W(o),!!(32&o.__u),_),n.__v=o.__v,n.__.__k[n.__i]=n,be(i,n,_),o.__e=o.__=null,n.__e!=s&&pe(n)));F.__r=0}function ge(t,e,n,o,s,i,_,l,u,a,p){var r,f,d,b,x,k,m,g=o&&o.__k||fe,R=e.length;for(u=ze(n,e,g,u,R),r=0;r<R;r++)(d=n.__k[r])!=null&&(f=d.__i==-1?M:g[d.__i]||M,d.__i=r,k=Q(t,d,f,s,i,_,l,u,a,p),b=d.__e,d.ref&&f.ref!=d.ref&&(f.ref&&ee(f.ref,null,d),p.push(d.ref,d.__c||b,d)),x==null&&b!=null&&(x=b),(m=!!(4&d.__u))||f.__k===d.__k?u=me(d,u,t,m):typeof d.type=="function"&&k!==void 0?u=k:b&&(u=b.nextSibling),d.__u&=-7);return n.__e=x,u}function ze(t,e,n,o,s){var i,_,l,u,a,p=n.length,r=p,f=0;for(t.__k=new Array(s),i=0;i<s;i++)(_=e[i])!=null&&typeof _!="boolean"&&typeof _!="function"?(typeof _=="string"||typeof _=="number"||typeof _=="bigint"||_.constructor==String?_=t.__k[i]=P(null,_,null,null,null):D(_)?_=t.__k[i]=P(L,{children:_},null,null,null):_.constructor==null&&_.__b>0?_=t.__k[i]=P(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):t.__k[i]=_,u=i+f,_.__=t,_.__b=t.__b+1,(a=_.__i=Oe(_,n,u,r))!=-1&&(r--,(l=n[a])&&(l.__u|=2)),l==null||l.__v==null?(a==-1&&(s>p?f--:s<p&&f++),typeof _.type!="function"&&(_.__u|=4)):a!=u&&(a==u-1?f--:a==u+1?f++:(a>u?f--:f++,_.__u|=4))):t.__k[i]=null;if(r)for(i=0;i<p;i++)(l=n[i])!=null&&(2&l.__u)==0&&(l.__e==o&&(o=W(l)),we(l,l));return o}function me(t,e,n,o){var s,i;if(typeof t.type=="function"){for(s=t.__k,i=0;s&&i<s.length;i++)s[i]&&(s[i].__=t,e=me(s[i],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=W(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Oe(t,e,n,o){var s,i,_,l=t.key,u=t.type,a=e[n],p=a!=null&&(2&a.__u)==0;if(a===null&&l==null||p&&l==a.key&&u==a.type)return n;if(o>(p?1:0)){for(s=n-1,i=n+1;s>=0||i<e.length;)if((a=e[_=s>=0?s--:i++])!=null&&(2&a.__u)==0&&l==a.key&&u==a.type)return _}return-1}function ye(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Ue.test(e)?n:n+"px"}function U(t,e,n,o,s){var i,_;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||ye(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||ye(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(de,"$1")),_=e.toLowerCase(),e=_ in t||e=="onFocusOut"||e=="onFocusIn"?_.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?o?n.u=o.u:(n.u=Y,t.addEventListener(e,i?X:G,i)):t.removeEventListener(e,i?X:G,i);else{if(s=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function ve(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Y++;else if(e.t<n.u)return;return n(h.event?h.event(e):e)}}}function Q(t,e,n,o,s,i,_,l,u,a){var p,r,f,d,b,x,k,m,g,R,$,V,N,Fe,K,I,_e,S=e.type;if(e.constructor!=null)return null;128&n.__u&&(u=!!(32&n.__u),i=[l=e.__e=n.__e]),(p=h.__b)&&p(e);e:if(typeof S=="function")try{if(m=e.props,g="prototype"in S&&S.prototype.render,R=(p=S.contextType)&&o[p.__c],$=p?R?R.props.value:p.__:o,n.__c?k=(r=e.__c=n.__c).__=r.__E:(g?e.__c=r=new S(m,$):(e.__c=r=new B(m,$),r.constructor=S,r.render=Ve),R&&R.sub(r),r.state||(r.state={}),r.__n=o,f=r.__d=!0,r.__h=[],r._sb=[]),g&&r.__s==null&&(r.__s=r.state),g&&S.getDerivedStateFromProps!=null&&(r.__s==r.state&&(r.__s=T({},r.__s)),T(r.__s,S.getDerivedStateFromProps(m,r.__s))),d=r.props,b=r.state,r.__v=e,f)g&&S.getDerivedStateFromProps==null&&r.componentWillMount!=null&&r.componentWillMount(),g&&r.componentDidMount!=null&&r.__h.push(r.componentDidMount);else{if(g&&S.getDerivedStateFromProps==null&&m!==d&&r.componentWillReceiveProps!=null&&r.componentWillReceiveProps(m,$),e.__v==n.__v||!r.__e&&r.shouldComponentUpdate!=null&&r.shouldComponentUpdate(m,r.__s,$)===!1){for(e.__v!=n.__v&&(r.props=m,r.state=r.__s,r.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(H){H&&(H.__=e)}),V=0;V<r._sb.length;V++)r.__h.push(r._sb[V]);r._sb=[],r.__h.length&&_.push(r);break e}r.componentWillUpdate!=null&&r.componentWillUpdate(m,r.__s,$),g&&r.componentDidUpdate!=null&&r.__h.push(function(){r.componentDidUpdate(d,b,x)})}if(r.context=$,r.props=m,r.__P=t,r.__e=!1,N=h.__r,Fe=0,g){for(r.state=r.__s,r.__d=!1,N&&N(e),p=r.render(r.props,r.state,r.context),K=0;K<r._sb.length;K++)r.__h.push(r._sb[K]);r._sb=[]}else do r.__d=!1,N&&N(e),p=r.render(r.props,r.state,r.context),r.state=r.__s;while(r.__d&&++Fe<25);r.state=r.__s,r.getChildContext!=null&&(o=T(T({},o),r.getChildContext())),g&&!f&&r.getSnapshotBeforeUpdate!=null&&(x=r.getSnapshotBeforeUpdate(d,b)),I=p,p!=null&&p.type===L&&p.key==null&&(I=ke(p.props.children)),l=ge(t,D(I)?I:[I],e,n,o,s,i,_,l,u,a),r.base=e.__e,e.__u&=-161,r.__h.length&&_.push(r),k&&(r.__E=r.__=null)}catch(H){if(e.__v=null,u||i!=null)if(H.then){for(e.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;i[i.indexOf(l)]=null,e.__e=l}else{for(_e=i.length;_e--;)J(i[_e]);Z(e)}else e.__e=n.__e,e.__k=n.__k,H.then||Z(e);h.__e(H,e,n)}else i==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=qe(n.__e,e,n,o,s,i,_,u,a);return(p=h.diffed)&&p(e),128&e.__u?void 0:l}function Z(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Z)}function be(t,e,n){for(var o=0;o<n.length;o++)ee(n[o],n[++o],n[++o]);h.__c&&h.__c(e,t),t.some(function(s){try{t=s.__h,s.__h=[],t.some(function(i){i.call(s)})}catch(i){h.__e(i,s.__v)}})}function ke(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:D(t)?t.map(ke):T({},t)}function qe(t,e,n,o,s,i,_,l,u){var a,p,r,f,d,b,x,k=n.props||M,m=e.props,g=e.type;if(g=="svg"?s="http://www.w3.org/2000/svg":g=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),i!=null){for(a=0;a<i.length;a++)if((d=i[a])&&"setAttribute"in d==!!g&&(g?d.localName==g:d.nodeType==3)){t=d,i[a]=null;break}}if(t==null){if(g==null)return document.createTextNode(m);t=document.createElementNS(s,g,m.is&&m),l&&(h.__m&&h.__m(e,i),l=!1),i=null}if(g==null)k===m||l&&t.data==m||(t.data=m);else{if(i=i&&E.call(t.childNodes),!l&&i!=null)for(k={},a=0;a<t.attributes.length;a++)k[(d=t.attributes[a]).name]=d.value;for(a in k)if(d=k[a],a!="children"){if(a=="dangerouslySetInnerHTML")r=d;else if(!(a in m)){if(a=="value"&&"defaultValue"in m||a=="checked"&&"defaultChecked"in m)continue;U(t,a,null,d,s)}}for(a in m)d=m[a],a=="children"?f=d:a=="dangerouslySetInnerHTML"?p=d:a=="value"?b=d:a=="checked"?x=d:l&&typeof d!="function"||k[a]===d||U(t,a,d,k[a],s);if(p)l||r&&(p.__html==r.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(r&&(t.innerHTML=""),ge(e.type=="template"?t.content:t,D(f)?f:[f],e,n,o,g=="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,_,i?i[0]:n.__k&&W(n,0),l,u),i!=null)for(a=i.length;a--;)J(i[a]);l||(a="value",g=="progress"&&b==null?t.removeAttribute("value"):b!=null&&(b!==t[a]||g=="progress"&&!b||g=="option"&&b!=k[a])&&U(t,a,b,k[a],s),a="checked",x!=null&&x!=t[a]&&U(t,a,x,k[a],s))}return t}function ee(t,e,n){try{if(typeof t=="function"){var o=typeof t.__u=="function";o&&t.__u(),o&&e==null||(t.__u=t(e))}else t.current=e}catch(s){h.__e(s,n)}}function we(t,e,n){var o,s;if(h.unmount&&h.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||ee(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){h.__e(i,e)}o.base=o.__P=null}if(o=t.__k)for(s=0;s<o.length;s++)o[s]&&we(o[s],e,n||typeof t.type!="function");n||J(t.__e),t.__c=t.__=t.__e=void 0}function Ve(t,e,n){return this.constructor(t,n)}function Ke(t,e,n){var o,s,i,_;e==document&&(e=document.documentElement),h.__&&h.__(t,e),s=(o=!1)?null:e.__k,i=[],_=[],Q(e,t=e.__k=je(L,null,[t]),s||M,M,e.namespaceURI,s?null:e.firstChild?E.call(e.childNodes):null,i,s?s.__e:e.firstChild,o,_),be(i,t,_)}E=fe.slice,h={__e:function(t,e,n,o){for(var s,i,_;e=e.__;)if((s=e.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(t)),_=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(t,o||{}),_=s.__d),_)return s.__E=s}catch(l){t=l}throw t}},le=0,B.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=T({},this.state),typeof t=="function"&&(t=t(T({},n),this.props)),t&&T(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),he(this))},B.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),he(this))},B.prototype.render=L,C=[],ce=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ue=function(t,e){return t.__v.__b-e.__v.__b},F.__r=0,de=/(PointerCapture)$|Capture$/i,Y=0,G=ve(!1),X=ve(!0);var Ye=0;function c(t,e,n,o,s,i){e||(e={});var _,l,u=e;if("ref"in u)for(l in u={},e)l=="ref"?_=e[l]:u[l]=e[l];var a={type:t,props:u,key:n,ref:_,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ye,__i:-1,__u:0,__source:s,__self:i};if(typeof t=="function"&&(_=t.defaultProps))for(l in _)u[l]===void 0&&(u[l]=_[l]);return h.vnode&&h.vnode(a),a}const Ge=t=>{const{Component:e,createRoot:n}=t,o=document.createElement("div");o.setAttribute("id","twd-sidebar-root"),document.body.appendChild(o),n(o).render(e)},Xe=async(t,e,n)=>{for(const o in t)await t[o]();Ge({Component:e,createRoot:n})};var j,y,te,xe,ne=0,Se=[],v=h,Te=v.__b,Ee=v.__r,Re=v.diffed,Ce=v.__c,$e=v.unmount,Ae=v.__;function We(t,e){v.__h&&v.__h(y,t,ne||e),ne=0;var n=y.__H||(y.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function oe(t){return ne=1,Je(Me,t)}function Je(t,e,n){var o=We(j++,2);if(o.t=t,!o.__c&&(o.__=[Me(void 0,e),function(l){var u=o.__N?o.__N[0]:o.__[0],a=o.t(u,l);u!==a&&(o.__N=[a,o.__[1]],o.__c.setState({}))}],o.__c=y,!y.__f)){var s=function(l,u,a){if(!o.__c.__H)return!0;var p=o.__c.__H.__.filter(function(f){return!!f.__c});if(p.every(function(f){return!f.__N}))return!i||i.call(this,l,u,a);var r=o.__c.props!==l;return p.forEach(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(r=!0)}}),i&&i.call(this,l,u,a)||r};y.__f=!0;var i=y.shouldComponentUpdate,_=y.componentWillUpdate;y.componentWillUpdate=function(l,u,a){if(this.__e){var p=i;i=void 0,s(l,u,a),i=p}_&&_.call(this,l,u,a)},y.shouldComponentUpdate=s}return o.__N||o.__}function Qe(t,e){var n=We(j++,3);!v.__s&&tt(n.__H,e)&&(n.__=t,n.u=e,y.__H.__h.push(n))}function Ze(){for(var t;t=Se.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(z),t.__H.__h.forEach(re),t.__H.__h=[]}catch(e){t.__H.__h=[],v.__e(e,t.__v)}}v.__b=function(t){y=null,Te&&Te(t)},v.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Ae&&Ae(t,e)},v.__r=function(t){Ee&&Ee(t),j=0;var e=(y=t.__c).__H;e&&(te===y?(e.__h=[],y.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(z),e.__h.forEach(re),e.__h=[],j=0)),te=y},v.diffed=function(t){Re&&Re(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Se.push(e)!==1&&xe===v.requestAnimationFrame||((xe=v.requestAnimationFrame)||et)(Ze)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),te=y=null},v.__c=function(t,e){e.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(o){return!o.__||re(o)})}catch(o){e.some(function(s){s.__h&&(s.__h=[])}),e=[],v.__e(o,n.__v)}}),Ce&&Ce(t,e)},v.unmount=function(t){$e&&$e(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{z(o)}catch(s){e=s}}),n.__H=void 0,e&&v.__e(e,n.__v))};var He=typeof requestAnimationFrame=="function";function et(t){var e,n=function(){clearTimeout(o),He&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);He&&(e=requestAnimationFrame(n))}function z(t){var e=y,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),y=e}function re(t){var e=y;t.__c=t.__(),y=e}function tt(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function Me(t,e){return typeof e=="function"?e(t):e}const nt=t=>{const e=new Map,n=[];for(const o of t)e.set(o.id,{...o,childrenNodes:[]});for(const o of e.values())o.parent?e.get(o.parent)?.childrenNodes?.push(o):n.push(o);return n},ot={animation:"spin 1s linear infinite"},rt=()=>c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#364153",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle-icon lucide-loader-circle",style:ot,"data-testid":"loader-icon",children:c("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),O=document.createElement("style");O&&!document.getElementById("loader-spin-keyframes")&&(O.id="loader-spin-keyframes",O.innerHTML=`
1
+ (function(W,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(W=typeof globalThis<"u"?globalThis:W||self,E(W.TWD={}))})(this,(function(W){"use strict";var E,h,le,C,ae,ce,ue,de,Y,G,X,M={},fe=[],Fe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,D=Array.isArray;function T(t,e){for(var n in e)t[n]=e[n];return t}function J(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function je(t,e,n){var r,s,i,_={};for(i in e)i=="key"?r=e[i]:i=="ref"?s=e[i]:_[i]=e[i];if(arguments.length>2&&(_.children=arguments.length>3?E.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)_[i]===void 0&&(_[i]=t.defaultProps[i]);return P(t,_,r,s,null)}function P(t,e,n,r,s){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++le,__i:-1,__u:0};return s==null&&h.vnode!=null&&h.vnode(i),i}function L(t){return t.children}function B(t,e){this.props=t,this.context=e}function A(t,e){if(e==null)return t.__?A(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?A(t):null}function pe(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return pe(t)}}function he(t){(!t.__d&&(t.__d=!0)&&C.push(t)&&!U.__r++||ae!=h.debounceRendering)&&((ae=h.debounceRendering)||ce)(U)}function U(){for(var t,e,n,r,s,i,_,l=1;C.length;)C.length>l&&C.sort(ue),t=C.shift(),l=C.length,t.__d&&(n=void 0,r=void 0,s=(r=(e=t).__v).__e,i=[],_=[],e.__P&&((n=T({},r)).__v=r.__v+1,h.vnode&&h.vnode(n),Q(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[s]:null,i,s??A(r),!!(32&r.__u),_),n.__v=r.__v,n.__.__k[n.__i]=n,be(i,n,_),r.__e=r.__=null,n.__e!=s&&pe(n)));U.__r=0}function ge(t,e,n,r,s,i,_,l,u,a,p){var o,f,d,b,x,k,m,g=r&&r.__k||fe,R=e.length;for(u=ze(n,e,g,u,R),o=0;o<R;o++)(d=n.__k[o])!=null&&(f=d.__i==-1?M:g[d.__i]||M,d.__i=o,k=Q(t,d,f,s,i,_,l,u,a,p),b=d.__e,d.ref&&f.ref!=d.ref&&(f.ref&&ee(f.ref,null,d),p.push(d.ref,d.__c||b,d)),x==null&&b!=null&&(x=b),(m=!!(4&d.__u))||f.__k===d.__k?u=me(d,u,t,m):typeof d.type=="function"&&k!==void 0?u=k:b&&(u=b.nextSibling),d.__u&=-7);return n.__e=x,u}function ze(t,e,n,r,s){var i,_,l,u,a,p=n.length,o=p,f=0;for(t.__k=new Array(s),i=0;i<s;i++)(_=e[i])!=null&&typeof _!="boolean"&&typeof _!="function"?(typeof _=="string"||typeof _=="number"||typeof _=="bigint"||_.constructor==String?_=t.__k[i]=P(null,_,null,null,null):D(_)?_=t.__k[i]=P(L,{children:_},null,null,null):_.constructor==null&&_.__b>0?_=t.__k[i]=P(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):t.__k[i]=_,u=i+f,_.__=t,_.__b=t.__b+1,(a=_.__i=Oe(_,n,u,o))!=-1&&(o--,(l=n[a])&&(l.__u|=2)),l==null||l.__v==null?(a==-1&&(s>p?f--:s<p&&f++),typeof _.type!="function"&&(_.__u|=4)):a!=u&&(a==u-1?f--:a==u+1?f++:(a>u?f--:f++,_.__u|=4))):t.__k[i]=null;if(o)for(i=0;i<p;i++)(l=n[i])!=null&&(2&l.__u)==0&&(l.__e==r&&(r=A(l)),we(l,l));return r}function me(t,e,n,r){var s,i;if(typeof t.type=="function"){for(s=t.__k,i=0;s&&i<s.length;i++)s[i]&&(s[i].__=t,e=me(s[i],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=A(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Oe(t,e,n,r){var s,i,_,l=t.key,u=t.type,a=e[n],p=a!=null&&(2&a.__u)==0;if(a===null&&l==null||p&&l==a.key&&u==a.type)return n;if(r>(p?1:0)){for(s=n-1,i=n+1;s>=0||i<e.length;)if((a=e[_=s>=0?s--:i++])!=null&&(2&a.__u)==0&&l==a.key&&u==a.type)return _}return-1}function ye(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Fe.test(e)?n:n+"px"}function F(t,e,n,r,s){var i,_;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||ye(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||ye(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(de,"$1")),_=e.toLowerCase(),e=_ in t||e=="onFocusOut"||e=="onFocusIn"?_.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.u=r.u:(n.u=Y,t.addEventListener(e,i?X:G,i)):t.removeEventListener(e,i?X:G,i);else{if(s=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function ve(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Y++;else if(e.t<n.u)return;return n(h.event?h.event(e):e)}}}function Q(t,e,n,r,s,i,_,l,u,a){var p,o,f,d,b,x,k,m,g,R,$,V,N,Ue,K,I,_e,S=e.type;if(e.constructor!=null)return null;128&n.__u&&(u=!!(32&n.__u),i=[l=e.__e=n.__e]),(p=h.__b)&&p(e);e:if(typeof S=="function")try{if(m=e.props,g="prototype"in S&&S.prototype.render,R=(p=S.contextType)&&r[p.__c],$=p?R?R.props.value:p.__:r,n.__c?k=(o=e.__c=n.__c).__=o.__E:(g?e.__c=o=new S(m,$):(e.__c=o=new B(m,$),o.constructor=S,o.render=Ve),R&&R.sub(o),o.state||(o.state={}),o.__n=r,f=o.__d=!0,o.__h=[],o._sb=[]),g&&o.__s==null&&(o.__s=o.state),g&&S.getDerivedStateFromProps!=null&&(o.__s==o.state&&(o.__s=T({},o.__s)),T(o.__s,S.getDerivedStateFromProps(m,o.__s))),d=o.props,b=o.state,o.__v=e,f)g&&S.getDerivedStateFromProps==null&&o.componentWillMount!=null&&o.componentWillMount(),g&&o.componentDidMount!=null&&o.__h.push(o.componentDidMount);else{if(g&&S.getDerivedStateFromProps==null&&m!==d&&o.componentWillReceiveProps!=null&&o.componentWillReceiveProps(m,$),e.__v==n.__v||!o.__e&&o.shouldComponentUpdate!=null&&o.shouldComponentUpdate(m,o.__s,$)===!1){for(e.__v!=n.__v&&(o.props=m,o.state=o.__s,o.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(H){H&&(H.__=e)}),V=0;V<o._sb.length;V++)o.__h.push(o._sb[V]);o._sb=[],o.__h.length&&_.push(o);break e}o.componentWillUpdate!=null&&o.componentWillUpdate(m,o.__s,$),g&&o.componentDidUpdate!=null&&o.__h.push(function(){o.componentDidUpdate(d,b,x)})}if(o.context=$,o.props=m,o.__P=t,o.__e=!1,N=h.__r,Ue=0,g){for(o.state=o.__s,o.__d=!1,N&&N(e),p=o.render(o.props,o.state,o.context),K=0;K<o._sb.length;K++)o.__h.push(o._sb[K]);o._sb=[]}else do o.__d=!1,N&&N(e),p=o.render(o.props,o.state,o.context),o.state=o.__s;while(o.__d&&++Ue<25);o.state=o.__s,o.getChildContext!=null&&(r=T(T({},r),o.getChildContext())),g&&!f&&o.getSnapshotBeforeUpdate!=null&&(x=o.getSnapshotBeforeUpdate(d,b)),I=p,p!=null&&p.type===L&&p.key==null&&(I=ke(p.props.children)),l=ge(t,D(I)?I:[I],e,n,r,s,i,_,l,u,a),o.base=e.__e,e.__u&=-161,o.__h.length&&_.push(o),k&&(o.__E=o.__=null)}catch(H){if(e.__v=null,u||i!=null)if(H.then){for(e.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;i[i.indexOf(l)]=null,e.__e=l}else{for(_e=i.length;_e--;)J(i[_e]);Z(e)}else e.__e=n.__e,e.__k=n.__k,H.then||Z(e);h.__e(H,e,n)}else i==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=qe(n.__e,e,n,r,s,i,_,u,a);return(p=h.diffed)&&p(e),128&e.__u?void 0:l}function Z(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Z)}function be(t,e,n){for(var r=0;r<n.length;r++)ee(n[r],n[++r],n[++r]);h.__c&&h.__c(e,t),t.some(function(s){try{t=s.__h,s.__h=[],t.some(function(i){i.call(s)})}catch(i){h.__e(i,s.__v)}})}function ke(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:D(t)?t.map(ke):T({},t)}function qe(t,e,n,r,s,i,_,l,u){var a,p,o,f,d,b,x,k=n.props||M,m=e.props,g=e.type;if(g=="svg"?s="http://www.w3.org/2000/svg":g=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),i!=null){for(a=0;a<i.length;a++)if((d=i[a])&&"setAttribute"in d==!!g&&(g?d.localName==g:d.nodeType==3)){t=d,i[a]=null;break}}if(t==null){if(g==null)return document.createTextNode(m);t=document.createElementNS(s,g,m.is&&m),l&&(h.__m&&h.__m(e,i),l=!1),i=null}if(g==null)k===m||l&&t.data==m||(t.data=m);else{if(i=i&&E.call(t.childNodes),!l&&i!=null)for(k={},a=0;a<t.attributes.length;a++)k[(d=t.attributes[a]).name]=d.value;for(a in k)if(d=k[a],a!="children"){if(a=="dangerouslySetInnerHTML")o=d;else if(!(a in m)){if(a=="value"&&"defaultValue"in m||a=="checked"&&"defaultChecked"in m)continue;F(t,a,null,d,s)}}for(a in m)d=m[a],a=="children"?f=d:a=="dangerouslySetInnerHTML"?p=d:a=="value"?b=d:a=="checked"?x=d:l&&typeof d!="function"||k[a]===d||F(t,a,d,k[a],s);if(p)l||o&&(p.__html==o.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(o&&(t.innerHTML=""),ge(e.type=="template"?t.content:t,D(f)?f:[f],e,n,r,g=="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,_,i?i[0]:n.__k&&A(n,0),l,u),i!=null)for(a=i.length;a--;)J(i[a]);l||(a="value",g=="progress"&&b==null?t.removeAttribute("value"):b!=null&&(b!==t[a]||g=="progress"&&!b||g=="option"&&b!=k[a])&&F(t,a,b,k[a],s),a="checked",x!=null&&x!=t[a]&&F(t,a,x,k[a],s))}return t}function ee(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(s){h.__e(s,n)}}function we(t,e,n){var r,s;if(h.unmount&&h.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||ee(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){h.__e(i,e)}r.base=r.__P=null}if(r=t.__k)for(s=0;s<r.length;s++)r[s]&&we(r[s],e,n||typeof t.type!="function");n||J(t.__e),t.__c=t.__=t.__e=void 0}function Ve(t,e,n){return this.constructor(t,n)}function Ke(t,e,n){var r,s,i,_;e==document&&(e=document.documentElement),h.__&&h.__(t,e),s=(r=!1)?null:e.__k,i=[],_=[],Q(e,t=e.__k=je(L,null,[t]),s||M,M,e.namespaceURI,s?null:e.firstChild?E.call(e.childNodes):null,i,s?s.__e:e.firstChild,r,_),be(i,t,_)}E=fe.slice,h={__e:function(t,e,n,r){for(var s,i,_;e=e.__;)if((s=e.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(t)),_=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(t,r||{}),_=s.__d),_)return s.__E=s}catch(l){t=l}throw t}},le=0,B.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=T({},this.state),typeof t=="function"&&(t=t(T({},n),this.props)),t&&T(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),he(this))},B.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),he(this))},B.prototype.render=L,C=[],ce=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ue=function(t,e){return t.__v.__b-e.__v.__b},U.__r=0,de=/(PointerCapture)$|Capture$/i,Y=0,G=ve(!1),X=ve(!0);var Ye=0;function c(t,e,n,r,s,i){e||(e={});var _,l,u=e;if("ref"in u)for(l in u={},e)l=="ref"?_=e[l]:u[l]=e[l];var a={type:t,props:u,key:n,ref:_,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ye,__i:-1,__u:0,__source:s,__self:i};if(typeof t=="function"&&(_=t.defaultProps))for(l in _)u[l]===void 0&&(u[l]=_[l]);return h.vnode&&h.vnode(a),a}const Ge=t=>{const{Component:e,createRoot:n}=t,r=document.createElement("div");r.setAttribute("id","twd-sidebar-root"),document.body.appendChild(r),n(r).render(e)},Xe=async(t,e,n)=>{for(const r in t)await t[r]();Ge({Component:e,createRoot:n})};var j,y,te,xe,ne=0,Se=[],v=h,Te=v.__b,Ee=v.__r,Re=v.diffed,Ce=v.__c,$e=v.unmount,We=v.__;function Ae(t,e){v.__h&&v.__h(y,t,ne||e),ne=0;var n=y.__H||(y.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function re(t){return ne=1,Je(Me,t)}function Je(t,e,n){var r=Ae(j++,2);if(r.t=t,!r.__c&&(r.__=[Me(void 0,e),function(l){var u=r.__N?r.__N[0]:r.__[0],a=r.t(u,l);u!==a&&(r.__N=[a,r.__[1]],r.__c.setState({}))}],r.__c=y,!y.__f)){var s=function(l,u,a){if(!r.__c.__H)return!0;var p=r.__c.__H.__.filter(function(f){return!!f.__c});if(p.every(function(f){return!f.__N}))return!i||i.call(this,l,u,a);var o=r.__c.props!==l;return p.forEach(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(o=!0)}}),i&&i.call(this,l,u,a)||o};y.__f=!0;var i=y.shouldComponentUpdate,_=y.componentWillUpdate;y.componentWillUpdate=function(l,u,a){if(this.__e){var p=i;i=void 0,s(l,u,a),i=p}_&&_.call(this,l,u,a)},y.shouldComponentUpdate=s}return r.__N||r.__}function Qe(t,e){var n=Ae(j++,3);!v.__s&&tt(n.__H,e)&&(n.__=t,n.u=e,y.__H.__h.push(n))}function Ze(){for(var t;t=Se.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(z),t.__H.__h.forEach(oe),t.__H.__h=[]}catch(e){t.__H.__h=[],v.__e(e,t.__v)}}v.__b=function(t){y=null,Te&&Te(t)},v.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),We&&We(t,e)},v.__r=function(t){Ee&&Ee(t),j=0;var e=(y=t.__c).__H;e&&(te===y?(e.__h=[],y.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(z),e.__h.forEach(oe),e.__h=[],j=0)),te=y},v.diffed=function(t){Re&&Re(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Se.push(e)!==1&&xe===v.requestAnimationFrame||((xe=v.requestAnimationFrame)||et)(Ze)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),te=y=null},v.__c=function(t,e){e.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(r){return!r.__||oe(r)})}catch(r){e.some(function(s){s.__h&&(s.__h=[])}),e=[],v.__e(r,n.__v)}}),Ce&&Ce(t,e)},v.unmount=function(t){$e&&$e(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{z(r)}catch(s){e=s}}),n.__H=void 0,e&&v.__e(e,n.__v))};var He=typeof requestAnimationFrame=="function";function et(t){var e,n=function(){clearTimeout(r),He&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);He&&(e=requestAnimationFrame(n))}function z(t){var e=y,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),y=e}function oe(t){var e=y;t.__c=t.__(),y=e}function tt(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Me(t,e){return typeof e=="function"?e(t):e}const nt=t=>{const e=new Map,n=[];for(const r of t)e.set(r.id,{...r,childrenNodes:[]});for(const r of e.values())r.parent?e.get(r.parent)?.childrenNodes?.push(r):n.push(r);return n},rt={animation:"spin 1s linear infinite"},ot=()=>c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#364153",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle-icon lucide-loader-circle",style:rt,"data-testid":"loader-icon",children:c("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),O=document.createElement("style");O&&!document.getElementById("loader-spin-keyframes")&&(O.id="loader-spin-keyframes",O.innerHTML=`
2
2
  @keyframes spin {
3
3
  0% { transform: rotate(0deg); }
4
4
  100% { transform: rotate(360deg); }
5
5
  }
6
- `,document.head.appendChild(O));const q=({className:t,children:e,dataTestId:n})=>c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`lucide ${t}`,"data-testid":n,children:e}),it=()=>c(q,{className:"lucide-play-icon lucide-play",dataTestId:"play-icon",children:c("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})}),Le=({id:t,name:e,skip:n,only:o})=>c(L,{children:[e," ",o&&c("span",{style:{color:"#2563eb"},"data-testid":`only-indicator-${t}`,children:[" ","(only)"]}),n&&c("span",{style:{color:"#6b7280"},"data-testid":`skip-indicator-${t}`,children:[" ","(skipped)"]})]}),st=t=>{switch(t.status){case"pass":return{item:{background:"#dcfce7"},container:{borderLeft:"3px solid #00c951"}};case"fail":return{item:{background:"#fee2e2"},container:{borderLeft:"3px solid #fb2c36"}};case"skip":return{item:{background:"#f3f4f6"}};case"running":return{item:{background:"#fef9c3"}};default:return{item:{background:"transparent"}}}},_t=t=>t.startsWith("Assertion passed")||t.startsWith("Event fired")?{color:"#0d542b",fontWeight:"700"}:t.startsWith("Test failed")?{color:"#fb2c36",fontWeight:"700"}:{},lt=({node:t,depth:e,id:n,runTest:o})=>{const s=st(t);return c("li",{style:{marginBottom:"4px",marginLeft:e*6,...s.container},"data-testid":`test-list-item-${n}`,children:[c("div",{style:{display:"flex",alignItems:"left",justifyContent:"space-between",padding:"4px 6px",borderRadius:"4px",...s.item},children:[c("span",{style:{fontWeight:"500",color:"#374151",maxWidth:"220px"},children:c(Le,{id:n,name:t.name,skip:t.skip,only:t.only})}),c("button",{onClick:()=>o(n),"aria-label":`Run ${t.name} test`,style:{background:"transparent",border:"1px solid #d1d5db",borderRadius:"4px",padding:"0",cursor:"pointer",verticalAlign:"middle",fontSize:"12px",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"},disabled:t.status==="running","data-testid":`run-test-button-${n}`,children:t.status==="running"?c(rt,{}):c(it,{})})]}),t.logs&&t.logs.length>0&&c("ul",{style:{borderRadius:"4px",maxHeight:"260px",overflowY:"auto",padding:0,background:"#f3f4f6",listStyle:"none",marginTop:"4px",textAlign:"left"},children:t.logs.map((i,_)=>c("li",{style:{fontSize:"12px",padding:"4px 6px",borderBottom:"1px solid #d1d5db",color:"#374151",..._t(i)},children:i},_))})]},t.name)},at=()=>c(q,{className:"lucide-chevron-down-icon lucide-chevron-down",dataTestId:"chevron-down-icon",children:c("path",{d:"m6 9 6 6 6-6"})}),ct=()=>c(q,{className:"lucide-chevron-right-icon lucide-chevron-right",dataTestId:"chevron-right-icon",children:c("path",{d:"m9 18 6-6-6-6"})}),ut=({tests:t,runTest:e})=>{const[n,o]=oe({}),s=l=>o(u=>({...u,[l]:!u[l]})),i=(l,u=0)=>{if(l.type==="test")return c(lt,{node:l,depth:u,id:l.id,runTest:()=>e(l.id)},l.id);const a=n[l.id];return c("li",{style:{marginLeft:u*12},children:[c("span",{style:{fontWeight:"bold",cursor:"pointer",color:"#374151",display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"4px",gap:"6px"},"data-testid":`test-group-${l.name}`,tabIndex:0,role:"button","aria-expanded":!a,onClick:()=>s(l.id),children:[c(Le,{id:l.id,name:l.name,skip:l.skip,only:l.only}),a?c(ct,{}):c(at,{})]}),!a&&l.childrenNodes&&l.childrenNodes.length>0&&c("ul",{style:{listStyle:"none",padding:0,margin:0},children:l.childrenNodes.map(p=>i(p,u+1))})]},l.id)},_=nt(t);return c("ul",{style:{listStyle:"none",padding:0,margin:0},children:_.map(l=>i(l))})},dt={left:{left:0,borderTopRightRadius:"6px",borderBottomRightRadius:"6px",borderTopLeftRadius:"0",borderBottomLeftRadius:"0"},right:{right:0,borderTopLeftRadius:"6px",borderBottomLeftRadius:"6px",borderTopRightRadius:"0",borderBottomRightRadius:"0"}},ft=({setOpen:t,position:e})=>c("button",{"aria-label":"Open TWD sidebar",style:{position:"fixed",top:"50%",transform:"translateY(-50%)",background:"#1A6EF4",color:"white",padding:"6px 10px",cursor:"pointer",fontSize:"12px",...dt[e]},onClick:()=>t(!0),children:"TWD"}),pt=({isOpen:t,position:e})=>{Qe(()=>{const n=document.documentElement;return t?e==="left"?n.style.marginLeft="280px":n.style.marginRight="280px":(n.style.marginRight="0",n.style.marginLeft="0"),()=>{n.style.marginRight="0",n.style.marginLeft="0"}},[t,e])},ie=typeof window<"u"?(window.__TWD_STATE__||(window.__TWD_STATE__={handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]}),window.__TWD_STATE__):{handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]},w=ie.handlers,Ne=ie.beforeEachHooks,Ie=ie.afterEachHooks,ht=t=>{const e=[],n=[];let o=t;for(;o;)Ne.has(o)&&e.unshift(...Ne.get(o)),Ie.has(o)&&n.push(...Ie.get(o)),o=w.get(o)?.parent;return{before:e,after:n}},se=t=>{const e=w.get(t);return e?e.only?!0:e.children?e.children.some(n=>se(n)):!1:!1},gt=t=>{let e=w.get(t);for(;e?.parent;){const n=w.get(e.parent);if(n?.only)return!0;e=n}return!1},De=t=>{let e=w.get(t);for(;e;){if(e.skip)return!0;if(!e.parent)break;e=w.get(e.parent)}return!1};class Pe{events;constructor(e){this.events=e}async runAll(){const e=Array.from(w.values()).filter(o=>!o.parent&&o.type==="suite"),n=Array.from(w.values()).some(o=>o.only);for(const o of e)await this.runSuite(o,n);return w}async runSingle(e){const n=w.get(e);if(!n||n.type!=="test")return;await this.runTest(n,!1)}async runSuite(e,n){if(De(e.id)&&!se(e.id)){this.events.onSkip?.(e);return}if(n&&!se(e.id))return;this.events.onSuiteStart?.(e);const s=(e.children||[]).map(i=>w.get(i));for(const i of s)i.type==="suite"?await this.runSuite(i,n):i.type==="test"&&await this.runTest(i,n);this.events.onSuiteEnd?.(e)}async runTest(e,n){if((De(e.id)||e.skip)&&!e.only){this.events.onSkip(e);return}const s=gt(e.id);if(n&&!e.only&&!s){this.events.onSkip(e);return}this.events.onStart?.(e);const i=ht(e.parent);try{for(const _ of i.before)await _();e.logs=[],await e.handler(),this.events.onPass(e)}catch(_){this.events.onFail(e,_)}finally{for(const _ of i.after)await _()}}}window.__testRunner=Pe;const mt="1.3.1",Be=(typeof window<"u"?(window.__TWD_MOCK_STATE__||(window.__TWD_MOCK_STATE__={rules:[]}),window.__TWD_MOCK_STATE__):{rules:[]}).rules,yt=async t=>{"serviceWorker"in navigator&&(await navigator.serviceWorker.register(`/mock-sw.js?v=${mt}`),navigator.serviceWorker.controller||await new Promise(n=>{navigator.serviceWorker.addEventListener("controllerchange",n,{once:!0})}),navigator.serviceWorker.addEventListener("message",n=>{if(n.data?.type==="EXECUTED"){const{alias:o,request:s}=n.data,i=Be.find(_=>_.alias===o);i&&(i.executed=!0,i.request=s)}}))},vt=()=>Be,bt=()=>c(q,{className:"lucide-wifi-pen-icon lucide-wifi-pen",dataTestId:"wifi-pen-icon",children:[c("path",{d:"M2 8.82a15 15 0 0 1 20 0"}),c("path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"}),c("path",{d:"M5 12.859a10 10 0 0 1 10.5-2.222"}),c("path",{d:"M8.5 16.429a5 5 0 0 1 3-1.406"})]}),kt=()=>{const t=vt(),e=t.filter(o=>o.executed);return c("button",{onClick:()=>{console.group("🌐 TWD Mock Rules"),console.log("Total rules:",t.length),console.log("Triggered rules:",e.length),console.log("Rules details:"),console.log(t),console.groupEnd()},"aria-label":"View mock rules details in console",style:{background:"#f8fafc",border:"1px solid #cbd5e1",borderRadius:"6px",padding:"8px 12px",cursor:"pointer",fontSize:"12px",color:"#475569",display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px",width:"100%",textAlign:"left",transition:"all 0.2s ease",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"},children:[c(bt,{}),c("span",{style:{flex:1},children:["Rules: ",e.length,"/",t.length," triggered"]}),c("span",{style:{fontSize:"10px",color:"#1E293B",fontWeight:"500"},children:"View rules in console"})]})},wt={left:{left:0,borderRight:"1px solid #e5e7eb"},right:{right:0,borderLeft:"1px solid #e5e7eb"}},xt='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',St=({open:t,position:e="left"})=>{const[n,o]=oe(0),[s,i]=oe(t);pt({isOpen:s,position:e});const _=new Pe({onStart:r=>{r.status="running",o(f=>f+1)},onPass:r=>{r.status="pass",o(f=>f+1)},onFail:(r,f)=>{r.status="fail",console.error("Test failed:",r.name,f),r.logs.push(`Test failed: ${f.message}`),o(d=>d+1)},onSkip:r=>{r.status="skip",o(f=>f+1)}}),l=async()=>{await _.runAll()},u=async r=>{const f=Array.from(w.values()).filter(d=>d.type==="test").find(d=>d.id===r);f&&await _.runSingle(f.id)},a=Array.from(w.values());if(!s)return c(ft,{position:e,setOpen:i});const p=a.filter(r=>r.type==="test").length;return c("div",{style:{fontFamily:xt,position:"fixed",top:0,bottom:0,width:"280px",background:"#f9fafb",fontSize:"14px",overflowY:"auto",boxShadow:"2px 0 6px rgba(0,0,0,0.1)",textAlign:"left",zIndex:1e3,...wt[e]},"data-testid":"twd-sidebar",children:[c("div",{style:{padding:"8px",background:"#f9fafb",position:"sticky",top:0,zIndex:1e3,borderBottom:"1px solid #e5e7eb"},children:[c("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"14px"},children:[c("button",{onClick:l,style:{background:"#1A6EF4",color:"white",padding:"4px 8px",borderRadius:"4px",border:"none",cursor:"pointer"},children:"Run All"}),c("button",{"aria-label":"Close sidebar",style:{background:"transparent",border:"none",cursor:"pointer",fontSize:"14px",paddingRight:"0",paddingLeft:"0"},onClick:()=>i(!1),children:"✖"})]}),c("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"14px",color:"#6b7280",marginBottom:"10px"},children:[c("span",{style:{color:"#374151"},children:["Total: ",p]}),c("div",{style:{display:"flex",gap:"4px"},children:[c("span",{style:{color:"#00c951"},children:["✓ ",a.filter(r=>r.status==="pass").length]}),c("span",{style:{color:"#fb2c36"},children:["✗ ",a.filter(r=>r.status==="fail").length]})]})]}),c(kt,{})]}),c("div",{style:{padding:"8px"},children:c(ut,{tests:a.map(r=>({name:r.name,depth:r.depth,status:r.status,logs:r.logs,id:r.id,parent:r.parent,type:r.type,only:r.only,skip:r.skip})),runTest:u})})]})},Tt=t=>({render:e=>{Ke(e,t)}}),Et=(t,e)=>{const{open:n=!0,position:o="left"}=e||{};Xe(t,c(St,{open:n,position:o}),Tt),yt().then(()=>{console.log("Request mocking initialized")}).catch(s=>{console.error("Error initializing request mocking:",s)})};A.initTWD=Et,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}));
6
+ `,document.head.appendChild(O));const q=({className:t,children:e,dataTestId:n})=>c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`lucide ${t}`,"data-testid":n,children:e}),it=()=>c(q,{className:"lucide-play-icon lucide-play",dataTestId:"play-icon",children:c("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})}),Le=({id:t,name:e,skip:n,only:r})=>c(L,{children:[e," ",r&&c("span",{style:{color:"#2563eb"},"data-testid":`only-indicator-${t}`,children:[" ","(only)"]}),n&&c("span",{style:{color:"#6b7280"},"data-testid":`skip-indicator-${t}`,children:[" ","(skipped)"]})]}),st=t=>{switch(t.status){case"pass":return{item:{background:"#dcfce7"},container:{borderLeft:"3px solid #00c951"}};case"fail":return{item:{background:"#fee2e2"},container:{borderLeft:"3px solid #fb2c36"}};case"skip":return{item:{background:"#f3f4f6"}};case"running":return{item:{background:"#fef9c3"}};default:return{item:{background:"transparent"}}}},_t=t=>t.startsWith("Assertion passed")||t.startsWith("Event fired")?{color:"#0d542b",fontWeight:"700"}:t.startsWith("Test failed")?{color:"#fb2c36",fontWeight:"700"}:{},lt=({node:t,depth:e,id:n,runTest:r})=>{const s=st(t);return c("li",{style:{marginBottom:"4px",marginLeft:e*6,...s.container},"data-testid":`test-list-item-${n}`,children:[c("div",{style:{display:"flex",alignItems:"left",justifyContent:"space-between",padding:"4px 6px",borderRadius:"4px",...s.item},children:[c("span",{style:{fontWeight:"500",color:"#374151",maxWidth:"220px"},children:c(Le,{id:n,name:t.name,skip:t.skip,only:t.only})}),c("button",{onClick:()=>r(n),"aria-label":`Run ${t.name} test`,style:{background:"transparent",border:"1px solid #d1d5db",borderRadius:"4px",padding:"0",cursor:"pointer",verticalAlign:"middle",fontSize:"12px",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"},disabled:t.status==="running","data-testid":`run-test-button-${n}`,children:t.status==="running"?c(ot,{}):c(it,{})})]}),t.logs&&t.logs.length>0&&c("ul",{style:{borderRadius:"4px",maxHeight:"260px",overflowY:"auto",padding:0,background:"#f3f4f6",listStyle:"none",marginTop:"4px",textAlign:"left"},children:t.logs.map((i,_)=>c("li",{style:{fontSize:"12px",padding:"4px 6px",borderBottom:"1px solid #d1d5db",color:"#374151",..._t(i)},children:i},_))})]},t.name)},at=()=>c(q,{className:"lucide-chevron-down-icon lucide-chevron-down",dataTestId:"chevron-down-icon",children:c("path",{d:"m6 9 6 6 6-6"})}),ct=()=>c(q,{className:"lucide-chevron-right-icon lucide-chevron-right",dataTestId:"chevron-right-icon",children:c("path",{d:"m9 18 6-6-6-6"})}),ut=({tests:t,runTest:e})=>{const[n,r]=re({}),s=l=>r(u=>({...u,[l]:!u[l]})),i=(l,u=0)=>{if(l.type==="test")return c(lt,{node:l,depth:u,id:l.id,runTest:()=>e(l.id)},l.id);const a=n[l.id];return c("li",{style:{marginLeft:u*12},children:[c("span",{style:{fontWeight:"bold",cursor:"pointer",color:"#374151",display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"4px",gap:"6px"},"data-testid":`test-group-${l.name}`,tabIndex:0,role:"button","aria-expanded":!a,onClick:()=>s(l.id),children:[c(Le,{id:l.id,name:l.name,skip:l.skip,only:l.only}),a?c(ct,{}):c(at,{})]}),!a&&l.childrenNodes&&l.childrenNodes.length>0&&c("ul",{style:{listStyle:"none",padding:0,margin:0},children:l.childrenNodes.map(p=>i(p,u+1))})]},l.id)},_=nt(t);return c("ul",{style:{listStyle:"none",padding:0,margin:0},children:_.map(l=>i(l))})},dt={left:{left:0,borderTopRightRadius:"6px",borderBottomRightRadius:"6px",borderTopLeftRadius:"0",borderBottomLeftRadius:"0"},right:{right:0,borderTopLeftRadius:"6px",borderBottomLeftRadius:"6px",borderTopRightRadius:"0",borderBottomRightRadius:"0"}},ft=({setOpen:t,position:e})=>c("button",{"aria-label":"Open TWD sidebar",style:{position:"fixed",top:"50%",transform:"translateY(-50%)",background:"#1A6EF4",color:"white",padding:"6px 10px",cursor:"pointer",fontSize:"12px",...dt[e]},onClick:()=>t(!0),children:"TWD"}),pt=({isOpen:t,position:e})=>{Qe(()=>{const n=document.documentElement;return t?e==="left"?n.style.marginLeft="280px":n.style.marginRight="280px":(n.style.marginRight="0",n.style.marginLeft="0"),()=>{n.style.marginRight="0",n.style.marginLeft="0"}},[t,e])},ie=typeof window<"u"?(window.__TWD_STATE__||(window.__TWD_STATE__={handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]}),window.__TWD_STATE__):{handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]},w=ie.handlers,Ne=ie.beforeEachHooks,Ie=ie.afterEachHooks,ht=t=>{const e=[],n=[];let r=t;for(;r;)Ne.has(r)&&e.unshift(...Ne.get(r)),Ie.has(r)&&n.push(...Ie.get(r)),r=w.get(r)?.parent;return{before:e,after:n}},se=t=>{const e=w.get(t);return e?e.only?!0:e.children?e.children.some(n=>se(n)):!1:!1},gt=t=>{let e=w.get(t);for(;e?.parent;){const n=w.get(e.parent);if(n?.only)return!0;e=n}return!1},De=t=>{let e=w.get(t);for(;e;){if(e.skip)return!0;if(!e.parent)break;e=w.get(e.parent)}return!1};class Pe{events;constructor(e){this.events=e}async runAll(){const e=Array.from(w.values()).filter(r=>!r.parent&&r.type==="suite"),n=Array.from(w.values()).some(r=>r.only);for(const r of e)await this.runSuite(r,n);return w}async runSingle(e){const n=w.get(e);if(!n||n.type!=="test")return;await this.runTest(n,!1)}async runSuite(e,n){if(De(e.id)&&!se(e.id)){this.events.onSkip?.(e);return}if(n&&!se(e.id))return;this.events.onSuiteStart?.(e);const s=(e.children||[]).map(i=>w.get(i));for(const i of s)i.type==="suite"?await this.runSuite(i,n):i.type==="test"&&await this.runTest(i,n);this.events.onSuiteEnd?.(e)}async runTest(e,n){if((De(e.id)||e.skip)&&!e.only){this.events.onSkip(e);return}const s=gt(e.id);if(n&&!e.only&&!s){this.events.onSkip(e);return}this.events.onStart?.(e);const i=ht(e.parent);try{for(const _ of i.before)await _();e.logs=[],await e.handler(),this.events.onPass(e)}catch(_){this.events.onFail(e,_)}finally{for(const _ of i.after)await _()}}}window.__testRunner=Pe;const mt="1.3.3",Be=(typeof window<"u"?(window.__TWD_MOCK_STATE__||(window.__TWD_MOCK_STATE__={rules:[]}),window.__TWD_MOCK_STATE__):{rules:[]}).rules,yt=async t=>{if("serviceWorker"in navigator){const e=t??"/mock-sw.js";await navigator.serviceWorker.register(`${e}?v=${mt}`),navigator.serviceWorker.controller||await new Promise(n=>{navigator.serviceWorker.addEventListener("controllerchange",n,{once:!0})}),navigator.serviceWorker.addEventListener("message",n=>{if(n.data?.type==="EXECUTED"){const{alias:r,request:s}=n.data,i=Be.find(_=>_.alias===r);i&&(i.executed=!0,i.request=s)}})}},vt=()=>Be,bt=()=>c(q,{className:"lucide-wifi-pen-icon lucide-wifi-pen",dataTestId:"wifi-pen-icon",children:[c("path",{d:"M2 8.82a15 15 0 0 1 20 0"}),c("path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"}),c("path",{d:"M5 12.859a10 10 0 0 1 10.5-2.222"}),c("path",{d:"M8.5 16.429a5 5 0 0 1 3-1.406"})]}),kt=()=>{const t=vt(),e=t.filter(r=>r.executed);return c("button",{onClick:()=>{console.group("🌐 TWD Mock Rules"),console.log("Total rules:",t.length),console.log("Triggered rules:",e.length),console.log("Rules details:"),console.log(t),console.groupEnd()},"aria-label":"View mock rules details in console",style:{background:"#f8fafc",border:"1px solid #cbd5e1",borderRadius:"6px",padding:"8px 12px",cursor:"pointer",fontSize:"12px",color:"#475569",display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px",width:"100%",textAlign:"left",transition:"all 0.2s ease",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"},children:[c(bt,{}),c("span",{style:{flex:1},children:["Rules: ",e.length,"/",t.length," triggered"]}),c("span",{style:{fontSize:"10px",color:"#1E293B",fontWeight:"500"},children:"View rules in console"})]})},wt={left:{left:0,borderRight:"1px solid #e5e7eb"},right:{right:0,borderLeft:"1px solid #e5e7eb"}},xt='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',St=({open:t,position:e="left"})=>{const[n,r]=re(0),[s,i]=re(t);pt({isOpen:s,position:e});const _=new Pe({onStart:o=>{o.status="running",r(f=>f+1)},onPass:o=>{o.status="pass",r(f=>f+1)},onFail:(o,f)=>{o.status="fail",console.error("Test failed:",o.name,f),o.logs.push(`Test failed: ${f.message}`),r(d=>d+1)},onSkip:o=>{o.status="skip",r(f=>f+1)}}),l=async()=>{await _.runAll()},u=async o=>{const f=Array.from(w.values()).filter(d=>d.type==="test").find(d=>d.id===o);f&&await _.runSingle(f.id)},a=Array.from(w.values());if(!s)return c(ft,{position:e,setOpen:i});const p=a.filter(o=>o.type==="test").length;return c("div",{style:{fontFamily:xt,position:"fixed",top:0,bottom:0,width:"280px",background:"#f9fafb",fontSize:"14px",overflowY:"auto",boxShadow:"2px 0 6px rgba(0,0,0,0.1)",textAlign:"left",zIndex:1e3,...wt[e]},"data-testid":"twd-sidebar",children:[c("div",{style:{padding:"8px",background:"#f9fafb",position:"sticky",top:0,zIndex:1e3,borderBottom:"1px solid #e5e7eb"},children:[c("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"14px"},children:[c("button",{onClick:l,style:{background:"#1A6EF4",color:"white",padding:"4px 8px",borderRadius:"4px",border:"none",cursor:"pointer"},children:"Run All"}),c("button",{"aria-label":"Close sidebar",style:{background:"transparent",border:"none",cursor:"pointer",fontSize:"14px",paddingRight:"0",paddingLeft:"0"},onClick:()=>i(!1),children:"✖"})]}),c("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"14px",color:"#6b7280",marginBottom:"10px"},children:[c("span",{style:{color:"#374151"},children:["Total: ",p]}),c("div",{style:{display:"flex",gap:"4px"},children:[c("span",{style:{color:"#00c951"},children:["✓ ",a.filter(o=>o.status==="pass").length]}),c("span",{style:{color:"#fb2c36"},children:["✗ ",a.filter(o=>o.status==="fail").length]})]})]}),c(kt,{})]}),c("div",{style:{padding:"8px"},children:c(ut,{tests:a.map(o=>({name:o.name,depth:o.depth,status:o.status,logs:o.logs,id:o.id,parent:o.parent,type:o.type,only:o.only,skip:o.skip})),runTest:u})})]})},Tt=t=>({render:e=>{Ke(e,t)}}),Et=(t,e)=>{const{open:n=!0,position:r="left",serviceWorker:s=!0,serviceWorkerUrl:i="/mock-sw.js"}=e||{};Xe(t,c(St,{open:n,position:r}),Tt),s&&yt(i).then(()=>{console.log("Request mocking initialized")}).catch(_=>{console.error("Error initializing request mocking:",_)})};W.initTWD=Et,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));