@moq/ui-core 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,55 +1,55 @@
1
1
  import { Effect as kt } from "@moq/signals";
2
- const yt = !1, xt = (t, e) => t === e, mt = /* @__PURE__ */ Symbol("solid-track"), O = {
3
- equals: xt
2
+ const mt = !1, yt = (t, e) => t === e, bt = /* @__PURE__ */ Symbol("solid-track"), O = {
3
+ equals: yt
4
4
  };
5
- let nt = at;
6
- const b = 1, R = 2, st = {
5
+ let st = ct;
6
+ const b = 1, F = 2, it = {
7
7
  owned: null,
8
8
  cleanups: null,
9
9
  context: null,
10
10
  owner: null
11
11
  };
12
12
  var d = null;
13
- let z = null, bt = null, f = null, w = null, x = null, G = 0;
14
- function K(t, e) {
15
- const n = f, s = d, i = t.length === 0, o = s, r = i ? st : {
13
+ let z = null, At = null, f = null, w = null, m = null, U = 0;
14
+ function Z(t, e) {
15
+ const n = f, s = d, i = t.length === 0, o = s, r = i ? it : {
16
16
  owned: null,
17
17
  cleanups: null,
18
18
  context: o ? o.context : null,
19
19
  owner: o
20
- }, l = i ? t : () => t(() => E(() => L(r)));
20
+ }, l = i ? t : () => t(() => B(() => N(r)));
21
21
  d = r, f = null;
22
22
  try {
23
- return N(l, !0);
23
+ return _(l, !0);
24
24
  } finally {
25
25
  f = n, d = s;
26
26
  }
27
27
  }
28
- function it(t, e) {
28
+ function ot(t, e) {
29
29
  e = e ? Object.assign({}, O, e) : O;
30
30
  const n = {
31
31
  value: t,
32
32
  observers: null,
33
33
  observerSlots: null,
34
34
  comparator: e.equals || void 0
35
- }, s = (i) => (typeof i == "function" && (i = i(n.value)), lt(n, i));
36
- return [rt.bind(n), s];
35
+ }, s = (i) => (typeof i == "function" && (i = i(n.value)), at(n, i));
36
+ return [lt.bind(n), s];
37
37
  }
38
- function $(t, e, n) {
39
- const s = q(t, e, !1, b);
40
- B(s);
38
+ function E(t, e, n) {
39
+ const s = K(t, e, !1, b);
40
+ L(s);
41
41
  }
42
- function At(t, e, n) {
43
- nt = Mt;
44
- const s = q(t, e, !1, b);
45
- s.user = !0, x ? x.push(s) : B(s);
42
+ function Mt(t, e, n) {
43
+ st = St;
44
+ const s = K(t, e, !1, b);
45
+ s.user = !0, m ? m.push(s) : L(s);
46
46
  }
47
- function V(t, e, n) {
47
+ function R(t, e, n) {
48
48
  n = n ? Object.assign({}, O, n) : O;
49
- const s = q(t, e, !0, 0);
50
- return s.observers = null, s.observerSlots = null, s.comparator = n.equals || void 0, B(s), rt.bind(s);
49
+ const s = K(t, e, !0, 0);
50
+ return s.observers = null, s.observerSlots = null, s.comparator = n.equals || void 0, L(s), lt.bind(s);
51
51
  }
52
- function E(t) {
52
+ function B(t) {
53
53
  if (f === null) return t();
54
54
  const e = f;
55
55
  f = null;
@@ -59,19 +59,19 @@ function E(t) {
59
59
  f = e;
60
60
  }
61
61
  }
62
- function ot(t) {
62
+ function rt(t) {
63
63
  return d === null || (d.cleanups === null ? d.cleanups = [t] : d.cleanups.push(t)), t;
64
64
  }
65
- function Dt(t) {
65
+ function $t(t) {
66
66
  let e;
67
67
  return d && d.context && (e = d.context[t.id]) !== void 0 ? e : t.defaultValue;
68
68
  }
69
- function rt() {
69
+ function lt() {
70
70
  if (this.sources && this.state)
71
- if (this.state === b) B(this);
71
+ if (this.state === b) L(this);
72
72
  else {
73
73
  const t = w;
74
- w = null, N(() => U(this), !1), w = t;
74
+ w = null, _(() => H(this), !1), w = t;
75
75
  }
76
76
  if (f) {
77
77
  const t = this.observers ? this.observers.length : 0;
@@ -79,37 +79,37 @@ function rt() {
79
79
  }
80
80
  return this.value;
81
81
  }
82
- function lt(t, e, n) {
82
+ function at(t, e, n) {
83
83
  let s = t.value;
84
- return (!t.comparator || !t.comparator(s, e)) && (t.value = e, t.observers && t.observers.length && N(() => {
84
+ return (!t.comparator || !t.comparator(s, e)) && (t.value = e, t.observers && t.observers.length && _(() => {
85
85
  for (let i = 0; i < t.observers.length; i += 1) {
86
86
  const o = t.observers[i], r = z && z.running;
87
- r && z.disposed.has(o), (r ? !o.tState : !o.state) && (o.pure ? w.push(o) : x.push(o), o.observers && ct(o)), r || (o.state = b);
87
+ r && z.disposed.has(o), (r ? !o.tState : !o.state) && (o.pure ? w.push(o) : m.push(o), o.observers && ut(o)), r || (o.state = b);
88
88
  }
89
89
  if (w.length > 1e6)
90
90
  throw w = [], new Error();
91
91
  }, !1)), e;
92
92
  }
93
- function B(t) {
93
+ function L(t) {
94
94
  if (!t.fn) return;
95
- L(t);
96
- const e = G;
97
- St(t, t.value, e);
95
+ N(t);
96
+ const e = U;
97
+ Ct(t, t.value, e);
98
98
  }
99
- function St(t, e, n) {
99
+ function Ct(t, e, n) {
100
100
  let s;
101
101
  const i = d, o = f;
102
102
  f = d = t;
103
103
  try {
104
104
  s = t.fn(e);
105
105
  } catch (r) {
106
- return t.pure && (t.state = b, t.owned && t.owned.forEach(L), t.owned = null), t.updatedAt = n + 1, ut(r);
106
+ return t.pure && (t.state = b, t.owned && t.owned.forEach(N), t.owned = null), t.updatedAt = n + 1, ht(r);
107
107
  } finally {
108
108
  f = o, d = i;
109
109
  }
110
- (!t.updatedAt || t.updatedAt <= n) && (t.updatedAt != null && "observers" in t ? lt(t, s) : t.value = s, t.updatedAt = n);
110
+ (!t.updatedAt || t.updatedAt <= n) && (t.updatedAt != null && "observers" in t ? at(t, s) : t.value = s, t.updatedAt = n);
111
111
  }
112
- function q(t, e, n, s = b, i) {
112
+ function K(t, e, n, s = b, i) {
113
113
  const o = {
114
114
  fn: t,
115
115
  state: s,
@@ -123,67 +123,67 @@ function q(t, e, n, s = b, i) {
123
123
  context: d ? d.context : null,
124
124
  pure: n
125
125
  };
126
- return d === null || d !== st && (d.owned ? d.owned.push(o) : d.owned = [o]), o;
126
+ return d === null || d !== it && (d.owned ? d.owned.push(o) : d.owned = [o]), o;
127
127
  }
128
- function F(t) {
128
+ function P(t) {
129
129
  if (t.state === 0) return;
130
- if (t.state === R) return U(t);
131
- if (t.suspense && E(t.suspense.inFallback)) return t.suspense.effects.push(t);
130
+ if (t.state === F) return H(t);
131
+ if (t.suspense && B(t.suspense.inFallback)) return t.suspense.effects.push(t);
132
132
  const e = [t];
133
- for (; (t = t.owner) && (!t.updatedAt || t.updatedAt < G); )
133
+ for (; (t = t.owner) && (!t.updatedAt || t.updatedAt < U); )
134
134
  t.state && e.push(t);
135
135
  for (let n = e.length - 1; n >= 0; n--)
136
136
  if (t = e[n], t.state === b)
137
- B(t);
138
- else if (t.state === R) {
137
+ L(t);
138
+ else if (t.state === F) {
139
139
  const s = w;
140
- w = null, N(() => U(t, e[0]), !1), w = s;
140
+ w = null, _(() => H(t, e[0]), !1), w = s;
141
141
  }
142
142
  }
143
- function N(t, e) {
143
+ function _(t, e) {
144
144
  if (w) return t();
145
145
  let n = !1;
146
- e || (w = []), x ? n = !0 : x = [], G++;
146
+ e || (w = []), m ? n = !0 : m = [], U++;
147
147
  try {
148
148
  const s = t();
149
- return Ct(n), s;
149
+ return Dt(n), s;
150
150
  } catch (s) {
151
- n || (x = null), w = null, ut(s);
151
+ n || (m = null), w = null, ht(s);
152
152
  }
153
153
  }
154
- function Ct(t) {
155
- if (w && (at(w), w = null), t) return;
156
- const e = x;
157
- x = null, e.length && N(() => nt(e), !1);
154
+ function Dt(t) {
155
+ if (w && (ct(w), w = null), t) return;
156
+ const e = m;
157
+ m = null, e.length && _(() => st(e), !1);
158
158
  }
159
- function at(t) {
160
- for (let e = 0; e < t.length; e++) F(t[e]);
159
+ function ct(t) {
160
+ for (let e = 0; e < t.length; e++) P(t[e]);
161
161
  }
162
- function Mt(t) {
162
+ function St(t) {
163
163
  let e, n = 0;
164
164
  for (e = 0; e < t.length; e++) {
165
165
  const s = t[e];
166
- s.user ? t[n++] = s : F(s);
166
+ s.user ? t[n++] = s : P(s);
167
167
  }
168
- for (e = 0; e < n; e++) F(t[e]);
168
+ for (e = 0; e < n; e++) P(t[e]);
169
169
  }
170
- function U(t, e) {
170
+ function H(t, e) {
171
171
  t.state = 0;
172
172
  for (let n = 0; n < t.sources.length; n += 1) {
173
173
  const s = t.sources[n];
174
174
  if (s.sources) {
175
175
  const i = s.state;
176
- i === b ? s !== e && (!s.updatedAt || s.updatedAt < G) && F(s) : i === R && U(s, e);
176
+ i === b ? s !== e && (!s.updatedAt || s.updatedAt < U) && P(s) : i === F && H(s, e);
177
177
  }
178
178
  }
179
179
  }
180
- function ct(t) {
180
+ function ut(t) {
181
181
  for (let e = 0; e < t.observers.length; e += 1) {
182
182
  const n = t.observers[e];
183
- n.state || (n.state = R, n.pure ? w.push(n) : x.push(n), n.observers && ct(n));
183
+ n.state || (n.state = F, n.pure ? w.push(n) : m.push(n), n.observers && ut(n));
184
184
  }
185
185
  }
186
- function L(t) {
186
+ function N(t) {
187
187
  let e;
188
188
  if (t.sources)
189
189
  for (; t.sources.length; ) {
@@ -194,11 +194,11 @@ function L(t) {
194
194
  }
195
195
  }
196
196
  if (t.tOwned) {
197
- for (e = t.tOwned.length - 1; e >= 0; e--) L(t.tOwned[e]);
197
+ for (e = t.tOwned.length - 1; e >= 0; e--) N(t.tOwned[e]);
198
198
  delete t.tOwned;
199
199
  }
200
200
  if (t.owned) {
201
- for (e = t.owned.length - 1; e >= 0; e--) L(t.owned[e]);
201
+ for (e = t.owned.length - 1; e >= 0; e--) N(t.owned[e]);
202
202
  t.owned = null;
203
203
  }
204
204
  if (t.cleanups) {
@@ -207,80 +207,80 @@ function L(t) {
207
207
  }
208
208
  t.state = 0;
209
209
  }
210
- function It(t) {
210
+ function Bt(t) {
211
211
  return t instanceof Error ? t : new Error(typeof t == "string" ? t : "Unknown error", {
212
212
  cause: t
213
213
  });
214
214
  }
215
- function ut(t, e = d) {
216
- throw It(t);
215
+ function ht(t, e = d) {
216
+ throw Bt(t);
217
217
  }
218
218
  const Et = /* @__PURE__ */ Symbol("fallback");
219
219
  function Y(t) {
220
220
  for (let e = 0; e < t.length; e++) t[e]();
221
221
  }
222
- function $t(t, e, n = {}) {
222
+ function Nt(t, e, n = {}) {
223
223
  let s = [], i = [], o = [], r = 0, l = e.length > 1 ? [] : null;
224
- return ot(() => Y(o)), () => {
224
+ return rt(() => Y(o)), () => {
225
225
  let c = t() || [], u = c.length, h, a;
226
- return c[mt], E(() => {
227
- let v, A, D, j, T, g, k, y, C;
226
+ return c[bt], B(() => {
227
+ let v, A, M, j, T, g, x, k, C;
228
228
  if (u === 0)
229
- r !== 0 && (Y(o), o = [], s = [], i = [], r = 0, l && (l = [])), n.fallback && (s = [Et], i[0] = K((gt) => (o[0] = gt, n.fallback())), r = 1);
229
+ r !== 0 && (Y(o), o = [], s = [], i = [], r = 0, l && (l = [])), n.fallback && (s = [Et], i[0] = Z((xt) => (o[0] = xt, n.fallback())), r = 1);
230
230
  else if (r === 0) {
231
231
  for (i = new Array(u), a = 0; a < u; a++)
232
- s[a] = c[a], i[a] = K(S);
232
+ s[a] = c[a], i[a] = Z($);
233
233
  r = u;
234
234
  } else {
235
- for (D = new Array(u), j = new Array(u), l && (T = new Array(u)), g = 0, k = Math.min(r, u); g < k && s[g] === c[g]; g++) ;
236
- for (k = r - 1, y = u - 1; k >= g && y >= g && s[k] === c[y]; k--, y--)
237
- D[y] = i[k], j[y] = o[k], l && (T[y] = l[k]);
238
- for (v = /* @__PURE__ */ new Map(), A = new Array(y + 1), a = y; a >= g; a--)
235
+ for (M = new Array(u), j = new Array(u), l && (T = new Array(u)), g = 0, x = Math.min(r, u); g < x && s[g] === c[g]; g++) ;
236
+ for (x = r - 1, k = u - 1; x >= g && k >= g && s[x] === c[k]; x--, k--)
237
+ M[k] = i[x], j[k] = o[x], l && (T[k] = l[x]);
238
+ for (v = /* @__PURE__ */ new Map(), A = new Array(k + 1), a = k; a >= g; a--)
239
239
  C = c[a], h = v.get(C), A[a] = h === void 0 ? -1 : h, v.set(C, a);
240
- for (h = g; h <= k; h++)
241
- C = s[h], a = v.get(C), a !== void 0 && a !== -1 ? (D[a] = i[h], j[a] = o[h], l && (T[a] = l[h]), a = A[a], v.set(C, a)) : o[h]();
240
+ for (h = g; h <= x; h++)
241
+ C = s[h], a = v.get(C), a !== void 0 && a !== -1 ? (M[a] = i[h], j[a] = o[h], l && (T[a] = l[h]), a = A[a], v.set(C, a)) : o[h]();
242
242
  for (a = g; a < u; a++)
243
- a in D ? (i[a] = D[a], o[a] = j[a], l && (l[a] = T[a], l[a](a))) : i[a] = K(S);
243
+ a in M ? (i[a] = M[a], o[a] = j[a], l && (l[a] = T[a], l[a](a))) : i[a] = Z($);
244
244
  i = i.slice(0, r = u), s = c.slice(0);
245
245
  }
246
246
  return i;
247
247
  });
248
- function S(v) {
248
+ function $(v) {
249
249
  if (o[a] = v, l) {
250
- const [A, D] = it(a);
251
- return l[a] = D, e(c[a], A);
250
+ const [A, M] = ot(a);
251
+ return l[a] = M, e(c[a], A);
252
252
  }
253
253
  return e(c[a]);
254
254
  }
255
255
  };
256
256
  }
257
- function m(t, e) {
258
- return E(() => t(e || {}));
257
+ function y(t, e) {
258
+ return B(() => t(e || {}));
259
259
  }
260
260
  const Lt = (t) => `Stale read from <${t}>.`;
261
- function Bt(t) {
261
+ function _t(t) {
262
262
  const e = "fallback" in t && {
263
263
  fallback: () => t.fallback
264
264
  };
265
- return V($t(() => t.each, t.children, e || void 0));
265
+ return R(Nt(() => t.each, t.children, e || void 0));
266
266
  }
267
- function Nt(t) {
268
- const e = t.keyed, n = V(() => t.when, void 0, void 0), s = e ? n : V(n, void 0, {
267
+ function It(t) {
268
+ const e = t.keyed, n = R(() => t.when, void 0, void 0), s = e ? n : R(n, void 0, {
269
269
  equals: (i, o) => !i == !o
270
270
  });
271
- return V(() => {
271
+ return R(() => {
272
272
  const i = s();
273
273
  if (i) {
274
274
  const o = t.children;
275
- return typeof o == "function" && o.length > 0 ? E(() => o(e ? i : () => {
276
- if (!E(s)) throw Lt("Show");
275
+ return typeof o == "function" && o.length > 0 ? B(() => o(e ? i : () => {
276
+ if (!B(s)) throw Lt("Show");
277
277
  return n();
278
278
  })) : o;
279
279
  }
280
280
  return t.fallback;
281
281
  }, void 0, void 0);
282
282
  }
283
- function _t(t, e, n) {
283
+ function jt(t, e, n) {
284
284
  let s = n.length, i = e.length, o = s, r = 0, l = 0, c = e[i - 1].nextSibling, u = null;
285
285
  for (; r < i || l < o; ) {
286
286
  if (e[r] === n[l]) {
@@ -307,10 +307,10 @@ function _t(t, e, n) {
307
307
  const h = u.get(e[r]);
308
308
  if (h != null)
309
309
  if (l < h && h < o) {
310
- let a = r, S = 1, v;
311
- for (; ++a < i && a < o && !((v = u.get(e[a])) == null || v !== h + S); )
312
- S++;
313
- if (S > h - l) {
310
+ let a = r, $ = 1, v;
311
+ for (; ++a < i && a < o && !((v = u.get(e[a])) == null || v !== h + $); )
312
+ $++;
313
+ if ($ > h - l) {
314
314
  const A = e[r];
315
315
  for (; l < h; ) t.insertBefore(n[l++], A);
316
316
  } else t.replaceChild(n[l++], e[r++]);
@@ -320,7 +320,7 @@ function _t(t, e, n) {
320
320
  }
321
321
  }
322
322
  const tt = "_$DX_DELEGATE";
323
- function _(t, e, n, s) {
323
+ function I(t, e, n, s) {
324
324
  let i;
325
325
  const o = () => {
326
326
  const l = document.createElement("template");
@@ -328,27 +328,27 @@ function _(t, e, n, s) {
328
328
  }, r = () => (i || (i = o())).cloneNode(!0);
329
329
  return r.cloneNode = r, r;
330
330
  }
331
- function jt(t, e = window.document) {
331
+ function Tt(t, e = window.document) {
332
332
  const n = e[tt] || (e[tt] = /* @__PURE__ */ new Set());
333
333
  for (let s = 0, i = t.length; s < i; s++) {
334
334
  const o = t[s];
335
- n.has(o) || (n.add(o), e.addEventListener(o, Pt));
335
+ n.has(o) || (n.add(o), e.addEventListener(o, Rt));
336
336
  }
337
337
  }
338
- function M(t, e, n) {
338
+ function D(t, e, n) {
339
339
  n == null ? t.removeAttribute(e) : t.setAttribute(e, n);
340
340
  }
341
- function ht(t, e) {
341
+ function dt(t, e) {
342
342
  e == null ? t.removeAttribute("class") : t.className = e;
343
343
  }
344
- function Tt(t, e, n, s) {
344
+ function Vt(t, e, n, s) {
345
345
  Array.isArray(n) ? (t[`$$${e}`] = n[0], t[`$$${e}Data`] = n[1]) : t[`$$${e}`] = n;
346
346
  }
347
- function I(t, e, n, s) {
348
- if (typeof e != "function") return H(t, e, s, n);
349
- $((i) => H(t, e(), i, n), s);
347
+ function S(t, e, n, s) {
348
+ if (typeof e != "function") return G(t, e, s, n);
349
+ E((i) => G(t, e(), i, n), s);
350
350
  }
351
- function Pt(t) {
351
+ function Rt(t) {
352
352
  let e = t.target;
353
353
  const n = `$$${t.type}`, s = t.target, i = t.currentTarget, o = (c) => Object.defineProperty(t, "target", {
354
354
  configurable: !0,
@@ -382,7 +382,7 @@ function Pt(t) {
382
382
  } else l();
383
383
  o(s);
384
384
  }
385
- function H(t, e, n, s, i) {
385
+ function G(t, e, n, s, i) {
386
386
  for (; typeof n == "function"; ) n = n();
387
387
  if (e === n) return n;
388
388
  const o = typeof e;
@@ -391,35 +391,35 @@ function H(t, e, n, s, i) {
391
391
  return n;
392
392
  n !== "" && typeof n == "string" ? n = t.firstChild.data = e : n = t.textContent = e;
393
393
  } else if (e == null || o === "boolean")
394
- n = P(t, n, s);
394
+ n = V(t, n, s);
395
395
  else {
396
396
  if (o === "function")
397
- return $(() => {
397
+ return E(() => {
398
398
  let r = e();
399
399
  for (; typeof r == "function"; ) r = r();
400
- n = H(t, r, n, s);
400
+ n = G(t, r, n, s);
401
401
  }), () => n;
402
402
  if (Array.isArray(e)) {
403
403
  const r = [], l = n && Array.isArray(n);
404
- if (Z(r, e, n, i))
405
- return $(() => n = H(t, r, n, s, !0)), () => n;
406
- r.length === 0 ? n = P(t, n, s) : l ? n.length === 0 ? et(t, r, s) : _t(t, n, r) : (n && P(t), et(t, r)), n = r;
407
- } else e.nodeType && (Array.isArray(n) ? P(t, n, null, e) : n == null || n === "" || !t.firstChild ? t.appendChild(e) : t.replaceChild(e, t.firstChild), n = e);
404
+ if (q(r, e, n, i))
405
+ return E(() => n = G(t, r, n, s, !0)), () => n;
406
+ r.length === 0 ? n = V(t, n, s) : l ? n.length === 0 ? et(t, r, s) : jt(t, n, r) : (n && V(t), et(t, r)), n = r;
407
+ } else e.nodeType && (Array.isArray(n) ? V(t, n, null, e) : n == null || n === "" || !t.firstChild ? t.appendChild(e) : t.replaceChild(e, t.firstChild), n = e);
408
408
  }
409
409
  return n;
410
410
  }
411
- function Z(t, e, n, s) {
411
+ function q(t, e, n, s) {
412
412
  let i = !1;
413
413
  for (let o = 0, r = e.length; o < r; o++) {
414
414
  let l = e[o], c = n && n[t.length], u;
415
415
  if (!(l == null || l === !0 || l === !1)) if ((u = typeof l) == "object" && l.nodeType)
416
416
  t.push(l);
417
417
  else if (Array.isArray(l))
418
- i = Z(t, l, c) || i;
418
+ i = q(t, l, c) || i;
419
419
  else if (u === "function")
420
420
  if (s) {
421
421
  for (; typeof l == "function"; ) l = l();
422
- i = Z(t, Array.isArray(l) ? l : [l], Array.isArray(c) ? c : [c]) || i;
422
+ i = q(t, Array.isArray(l) ? l : [l], Array.isArray(c) ? c : [c]) || i;
423
423
  } else
424
424
  t.push(l), i = !0;
425
425
  else {
@@ -432,7 +432,7 @@ function Z(t, e, n, s) {
432
432
  function et(t, e, n = null) {
433
433
  for (let s = 0, i = e.length; s < i; s++) t.insertBefore(e[s], n);
434
434
  }
435
- function P(t, e, n, s) {
435
+ function V(t, e, n, s) {
436
436
  if (n === void 0) return t.textContent = "";
437
437
  const i = s || document.createTextNode("");
438
438
  if (e.length) {
@@ -447,13 +447,13 @@ function P(t, e, n, s) {
447
447
  } else t.insertBefore(i, n);
448
448
  return [i];
449
449
  }
450
- var Vt = /* @__PURE__ */ _("<button>");
451
- function Be(t) {
450
+ var Ot = /* @__PURE__ */ I("<button>");
451
+ function Ie(t) {
452
452
  return (() => {
453
- var e = Vt();
454
- return Tt(e, "click", t.onClick), I(e, () => t.children), $((n) => {
453
+ var e = Ot();
454
+ return Vt(e, "click", t.onClick), S(e, () => t.children), E((n) => {
455
455
  var s = t.type ?? "button", i = t.title ?? "Simple button", o = `flex--center button ${t.class ? `${t.class}` : ""}`.trimEnd(), r = t.ariaLabel ?? t.title ?? (typeof t.children == "string" ? t.children : void 0), l = t.ariaDisabled ?? t.disabled, c = t.disabled, u = t.tabIndex;
456
- return s !== n.e && M(e, "type", n.e = s), i !== n.t && M(e, "title", n.t = i), o !== n.a && ht(e, n.a = o), r !== n.o && M(e, "aria-label", n.o = r), l !== n.i && M(e, "aria-disabled", n.i = l), c !== n.n && (e.disabled = n.n = c), u !== n.s && M(e, "tabindex", n.s = u), n;
456
+ return s !== n.e && D(e, "type", n.e = s), i !== n.t && D(e, "title", n.t = i), o !== n.a && dt(e, n.a = o), r !== n.o && D(e, "aria-label", n.o = r), l !== n.i && D(e, "aria-disabled", n.i = l), c !== n.n && (e.disabled = n.n = c), u !== n.s && D(e, "tabindex", n.s = u), n;
457
457
  }, {
458
458
  e: void 0,
459
459
  t: void 0,
@@ -465,109 +465,109 @@ function Be(t) {
465
465
  }), e;
466
466
  })();
467
467
  }
468
- jt(["click"]);
469
- const Ot = `<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
468
+ Tt(["click"]);
469
+ const Ft = `<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
470
470
  <g transform="rotate(180 12 12)">
471
471
  <path d="M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" />
472
472
  </g>
473
- </svg>`, Rt = `<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
473
+ </svg>`, Pt = `<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
474
474
  <path d="M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" />
475
- </svg>`, Ft = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
475
+ </svg>`, Ht = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
476
476
  <path d="M9 18V5l12-2v13" />
477
477
  <circle cx="6" cy="18" r="3" />
478
478
  <circle cx="18" cy="16" r="3" />
479
- </svg>`, Ut = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="var(--color-red)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
479
+ </svg>`, Gt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="var(--color-red)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
480
480
  <path d="M4.929 4.929 19.07 19.071" />
481
481
  <circle cx="12" cy="12" r="10" />
482
- </svg>`, Ht = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
482
+ </svg>`, Ut = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
483
483
  <path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2" />
484
- </svg>`, Gt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
484
+ </svg>`, Wt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
485
485
  <path d="M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z" />
486
486
  <circle cx="12" cy="13" r="3" />
487
- </svg>`, Wt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
488
- <path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" />
489
487
  </svg>`, zt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
488
+ <path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" />
489
+ </svg>`, Zt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
490
490
  <path d="M8 3H5a2 2 0 0 0-2 2v3" />
491
491
  <path d="M21 8V5a2 2 0 0 0-2-2h-3" />
492
492
  <path d="M3 16v3a2 2 0 0 0 2 2h3" />
493
493
  <path d="M16 21h3a2 2 0 0 0 2-2v-3" />
494
- </svg>`, Kt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
494
+ </svg>`, qt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
495
495
  <path d="M8 3v3a2 2 0 0 1-2 2H3" />
496
496
  <path d="M21 8h-3a2 2 0 0 1-2-2V3" />
497
497
  <path d="M3 16h3a2 2 0 0 1 2 2v3" />
498
498
  <path d="M16 21v-3a2 2 0 0 1 2-2h3" />
499
- </svg>`, Zt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
499
+ </svg>`, Kt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
500
500
  <path d="M12 19v3" />
501
501
  <path d="M19 10v2a7 7 0 0 1-14 0v-2" />
502
502
  <rect x="9" y="2" width="6" height="13" rx="3" />
503
- </svg>`, qt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
503
+ </svg>`, Qt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
504
504
  <path d="M16 9a5 5 0 0 1 .95 2.293" />
505
505
  <path d="M19.364 5.636a9 9 0 0 1 1.889 9.96" />
506
506
  <path d="m2 2 20 20" />
507
507
  <path d="m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11" />
508
508
  <path d="M9.828 4.172A.686.686 0 0 1 11 4.657v.686" />
509
- </svg>`, Qt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
509
+ </svg>`, Xt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
510
510
  <path d="M16.247 7.761a6 6 0 0 1 0 8.478" />
511
511
  <path d="M19.075 4.933a10 10 0 0 1 0 14.134" />
512
512
  <path d="M4.925 19.067a10 10 0 0 1 0-14.134" />
513
513
  <path d="M7.753 16.239a6 6 0 0 1 0-8.478" />
514
514
  <circle cx="12" cy="12" r="2" />
515
- </svg>`, Xt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
515
+ </svg>`, Jt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
516
516
  <rect x="14" y="3" width="5" height="18" rx="1" />
517
517
  <rect x="5" y="3" width="5" height="18" rx="1" />
518
- </svg>`, Jt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
518
+ </svg>`, Yt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
519
519
  <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" />
520
- </svg>`, Yt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
520
+ </svg>`, te = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
521
521
  <rect width="20" height="14" x="2" y="3" rx="2" />
522
522
  <line x1="8" x2="16" y1="21" y2="21" />
523
523
  <line x1="12" x2="12" y1="17" y2="21" />
524
- </svg>`, te = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
524
+ </svg>`, ee = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
525
525
  <path d="M5 21v-6" />
526
526
  <path d="M12 21V3" />
527
527
  <path d="M19 21V9" />
528
- </svg>`, ee = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
528
+ </svg>`, ne = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
529
529
  <path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5" />
530
530
  <rect x="2" y="6" width="14" height="12" rx="2" />
531
- </svg>`, ne = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
531
+ </svg>`, se = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
532
532
  <path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z" />
533
533
  <path d="M16 9a5 5 0 0 1 0 6" />
534
534
  <path d="M19.364 18.364a9 9 0 0 0 0-12.728" />
535
- </svg>`, se = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
536
- <path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z" />
537
535
  </svg>`, ie = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
536
+ <path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z" />
537
+ </svg>`, oe = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
538
538
  <path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z" />
539
539
  <path d="M16 9a5 5 0 0 1 0 6" />
540
540
  </svg>`;
541
- var oe = /* @__PURE__ */ _("<span class=flex--center role=img>");
542
- function dt(t) {
541
+ var re = /* @__PURE__ */ I("<span class=flex--center role=img>");
542
+ function ft(t) {
543
543
  return (() => {
544
- var e = oe();
545
- return M(e, "aria-hidden", !0), e.innerHTML = t, e;
544
+ var e = re();
545
+ return D(e, "aria-hidden", !0), e.innerHTML = t, e;
546
546
  })();
547
547
  }
548
- const p = (t) => () => dt(t), re = p(Ot), le = p(Rt), ft = p(Ft), ae = p(Ut), pt = p(Ht), ce = p(Gt), ue = p(Wt), he = p(zt), de = p(Kt), fe = p(Zt), pe = p(qt), wt = p(Qt), we = p(Xt), ve = p(Jt), ge = p(Yt), ke = p(te), vt = p(ee), ye = p(ne), xe = p(se), me = p(ie), Ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
548
+ const p = (t) => () => ft(t), le = p(Ft), ae = p(Pt), pt = p(Ht), ce = p(Gt), wt = p(Ut), ue = p(Wt), he = p(zt), de = p(Zt), fe = p(qt), pe = p(Kt), we = p(Qt), vt = p(Xt), ve = p(Jt), ge = p(Yt), xe = p(te), ke = p(ee), gt = p(ne), me = p(se), ye = p(ie), be = p(oe), je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
549
549
  __proto__: null,
550
- ArrowDown: re,
551
- ArrowUp: le,
552
- Audio: ft,
553
- Ban: ae,
554
- Buffer: pt,
555
- Camera: ce,
556
- Element: dt,
557
- File: ue,
558
- FullscreenEnter: he,
559
- FullscreenExit: de,
560
- Microphone: fe,
561
- Mute: pe,
562
- Network: wt,
563
- Pause: we,
564
- Play: ve,
565
- Screen: ge,
550
+ ArrowDown: le,
551
+ ArrowUp: ae,
552
+ Audio: pt,
553
+ Ban: ce,
554
+ Buffer: wt,
555
+ Camera: ue,
556
+ Element: ft,
557
+ File: he,
558
+ FullscreenEnter: de,
559
+ FullscreenExit: fe,
560
+ Microphone: pe,
561
+ Mute: we,
562
+ Network: vt,
563
+ Pause: ve,
564
+ Play: ge,
565
+ Screen: xe,
566
566
  Stats: ke,
567
- Video: vt,
568
- VolumeHigh: ye,
569
- VolumeLow: xe,
570
- VolumeMedium: me
567
+ Video: gt,
568
+ VolumeHigh: me,
569
+ VolumeLow: ye,
570
+ VolumeMedium: be
571
571
  }, Symbol.toStringTag, { value: "Module" }));
572
572
  class W {
573
573
  /** Manages subscriptions lifecycle */
@@ -648,7 +648,7 @@ class Q extends W {
648
648
  this.updateInterval !== void 0 && window.clearInterval(this.updateInterval), super.cleanup();
649
649
  }
650
650
  }
651
- class be extends W {
651
+ class Ae extends W {
652
652
  /**
653
653
  * Initialize buffer provider with signal subscriptions
654
654
  */
@@ -661,91 +661,33 @@ class be extends W {
661
661
  }
662
662
  }
663
663
  class X extends W {
664
- /** Polling interval in milliseconds */
665
- static POLLING_INTERVAL_MS = 100;
666
- /** Display context for updating metrics */
664
+ static POLLING_INTERVAL_MS = 250;
667
665
  context;
668
- /** Network information from navigator.connection */
669
- networkInfo;
670
- /** Polling interval ID */
671
- updateInterval;
672
- boundUpdateDisplayData = this.updateDisplayData.bind(this);
673
- /**
674
- * Initialize network provider with connection listeners
675
- */
676
666
  setup(e) {
677
- this.context = e;
678
- const n = navigator;
679
- if (this.networkInfo = n.connection ?? n.mozConnection ?? n.webkitConnection, !this.networkInfo) {
667
+ if (this.context = e, !this.props.connection) {
680
668
  e.setDisplayData("N/A");
681
669
  return;
682
670
  }
683
- this.networkInfo.addEventListener?.("change", this.boundUpdateDisplayData), window.addEventListener("online", this.boundUpdateDisplayData), window.addEventListener("offline", this.boundUpdateDisplayData), this.updateInterval = window.setInterval(this.boundUpdateDisplayData, X.POLLING_INTERVAL_MS), this.updateDisplayData();
684
- }
685
- /**
686
- * Clean up event listeners and polling interval
687
- */
688
- cleanup() {
689
- this.networkInfo?.removeEventListener && this.networkInfo.removeEventListener("change", this.boundUpdateDisplayData), window.removeEventListener("online", this.boundUpdateDisplayData), window.removeEventListener("offline", this.boundUpdateDisplayData), this.updateInterval !== void 0 && clearInterval(this.updateInterval), super.cleanup();
671
+ this.signals.interval(this.updateDisplayData.bind(this), X.POLLING_INTERVAL_MS), this.updateDisplayData();
690
672
  }
691
- /**
692
- * Calculate and display current network metrics
693
- */
694
673
  updateDisplayData() {
695
- if (!this.context)
696
- return;
697
- const e = [
698
- this.getConnectionType(),
699
- this.getEffectiveBandwidth(),
700
- this.getLatency(),
701
- this.getSaveDataStatus()
702
- ].filter((n) => n !== null);
703
- this.context.setDisplayData(e.length > 0 ? e.join(`
674
+ if (!this.context) return;
675
+ const e = this.props.connection?.peek(), n = e ? [
676
+ nt(e.recvBandwidth?.peek(), "down"),
677
+ nt(e.sendBandwidth?.peek(), "up"),
678
+ Me(e.rtt?.peek())
679
+ ].filter((s) => s !== null) : [];
680
+ this.context.setDisplayData(n.length > 0 ? n.join(`
704
681
  `) : "N/A");
705
682
  }
706
- /**
707
- * Get formatted connection type
708
- * @returns Connection type or null if unavailable
709
- */
710
- getConnectionType() {
711
- if (!navigator.onLine)
712
- return "offline";
713
- if (!this.networkInfo)
714
- return null;
715
- const e = this.networkInfo.effectiveType;
716
- if (e)
717
- return {
718
- "slow-2g": "Slow-2G",
719
- "2g": "2G",
720
- "3g": "3G",
721
- "4g": "4G"
722
- }[e];
723
- const n = this.networkInfo.type;
724
- return n ? n.charAt(0).toUpperCase() + n.slice(1) : null;
725
- }
726
- /**
727
- * Get formatted bandwidth in Mbps or Gbps
728
- * @returns Bandwidth string or null if unavailable
729
- */
730
- getEffectiveBandwidth() {
731
- const e = this.networkInfo?.downlink;
732
- return !e || e <= 0 ? null : e >= 1e3 ? `${(e / 1e3).toFixed(1)}Gbps` : e >= 1 ? `${e.toFixed(1)}Mbps` : `${(e * 1e3).toFixed(0)}Kbps`;
733
- }
734
- /**
735
- * Get formatted round-trip latency
736
- * @returns Latency string or null if unavailable
737
- */
738
- getLatency() {
739
- const e = this.networkInfo?.rtt;
740
- return e && e > 0 ? `${e}ms` : null;
741
- }
742
- /**
743
- * Get data saver mode status
744
- * @returns Data saver indicator or null if disabled
745
- */
746
- getSaveDataStatus() {
747
- return this.networkInfo?.saveData ? "Save-Data" : null;
748
- }
683
+ }
684
+ function nt(t, e) {
685
+ if (t === void 0 || t <= 0) return null;
686
+ const n = e === "down" ? "↓" : "↑";
687
+ return t >= 1e9 ? `${n} ${(t / 1e9).toFixed(1)}Gbps` : t >= 1e6 ? `${n} ${(t / 1e6).toFixed(1)}Mbps` : t >= 1e3 ? `${n} ${(t / 1e3).toFixed(0)}kbps` : `${n} ${t.toFixed(0)}bps`;
688
+ }
689
+ function Me(t) {
690
+ return t === void 0 || t <= 0 ? null : `${t.toFixed(0)}ms`;
749
691
  }
750
692
  class J extends W {
751
693
  /** Polling interval in milliseconds */
@@ -810,64 +752,65 @@ class J extends W {
810
752
  this.updateInterval !== void 0 && clearInterval(this.updateInterval), super.cleanup();
811
753
  }
812
754
  }
813
- const Ae = {
755
+ const $e = {
814
756
  video: J,
815
757
  audio: Q,
816
- buffer: be,
758
+ buffer: Ae,
817
759
  network: X
818
760
  };
819
- function De(t) {
820
- return Ae[t];
821
- }
822
- var Se = /* @__PURE__ */ _("<div><div class=stats__icon-wrapper></div><div class=stats__item-detail><span class=stats__item-title></span><span class=stats__item-data>");
823
- const Ce = (t) => {
824
- const [e, n] = it("N/A");
825
- return At(() => {
826
- const s = De(t.statProvider);
761
+ function Ce(t) {
762
+ return $e[t];
763
+ }
764
+ var De = /* @__PURE__ */ I("<div><div class=stats__icon-wrapper></div><div class=stats__item-detail><span class=stats__item-title></span><span class=stats__item-data>");
765
+ const Se = (t) => {
766
+ const [e, n] = ot("N/A");
767
+ return Mt(() => {
768
+ const s = Ce(t.statProvider);
827
769
  if (!s) {
828
770
  n("N/A");
829
771
  return;
830
772
  }
831
773
  const i = new s({
832
774
  audio: t.audio,
833
- video: t.video
775
+ video: t.video,
776
+ connection: t.connection
834
777
  });
835
778
  i.setup({
836
779
  setDisplayData: n
837
- }), ot(() => {
780
+ }), rt(() => {
838
781
  i.cleanup();
839
782
  });
840
783
  }), (() => {
841
- var s = Se(), i = s.firstChild, o = i.nextSibling, r = o.firstChild, l = r.nextSibling;
842
- return I(i, () => t.svg), I(r, () => t.statProvider), I(l, e), $(() => ht(s, `stats__item stats__item--${t.statProvider}`)), s;
784
+ var s = De(), i = s.firstChild, o = i.nextSibling, r = o.firstChild, l = r.nextSibling;
785
+ return S(i, () => t.svg), S(r, () => t.statProvider), S(l, e), E(() => dt(s, `stats__item stats__item--${t.statProvider}`)), s;
843
786
  })();
844
787
  };
845
- var Me = /* @__PURE__ */ _("<div class=stats__panel>");
846
- const Ie = [{
788
+ var Be = /* @__PURE__ */ I("<div class=stats__panel>");
789
+ const Ee = [{
847
790
  name: "Network",
848
791
  statProvider: "network",
849
- icon: () => m(wt, {})
792
+ icon: () => y(vt, {})
850
793
  }, {
851
794
  name: "Video",
852
795
  statProvider: "video",
853
- icon: () => m(vt, {})
796
+ icon: () => y(gt, {})
854
797
  }, {
855
798
  name: "Audio",
856
799
  statProvider: "audio",
857
- icon: () => m(ft, {})
800
+ icon: () => y(pt, {})
858
801
  }, {
859
802
  name: "Buffer",
860
803
  statProvider: "buffer",
861
- icon: () => m(pt, {})
862
- }], Ee = (t) => (() => {
863
- var e = Me();
864
- return I(e, m(Bt, {
865
- each: Ie,
804
+ icon: () => y(wt, {})
805
+ }], Ne = (t) => (() => {
806
+ var e = Be();
807
+ return S(e, y(_t, {
808
+ each: Ee,
866
809
  children: ({
867
810
  name: n,
868
811
  statProvider: s,
869
812
  icon: i
870
- }) => m(Ce, {
813
+ }) => y(Se, {
871
814
  name: n,
872
815
  statProvider: s,
873
816
  get svg() {
@@ -878,33 +821,39 @@ const Ie = [{
878
821
  },
879
822
  get video() {
880
823
  return t.video;
824
+ },
825
+ get connection() {
826
+ return t.connection;
881
827
  }
882
828
  })
883
829
  })), e;
884
830
  })();
885
- var $e = /* @__PURE__ */ _("<div class=stats>");
886
- const _e = (t) => {
887
- const e = Dt(t.context);
888
- return m(Nt, {
831
+ var Le = /* @__PURE__ */ I("<div class=stats>");
832
+ const Te = (t) => {
833
+ const e = $t(t.context);
834
+ return y(It, {
889
835
  get when() {
890
836
  return t.getElement(e);
891
837
  },
892
838
  children: (n) => (() => {
893
- var s = $e();
894
- return I(s, m(Ee, {
839
+ var s = Le();
840
+ return S(s, y(Ne, {
895
841
  get audio() {
896
842
  return n().audio;
897
843
  },
898
844
  get video() {
899
845
  return n().video;
846
+ },
847
+ get connection() {
848
+ return n().connection;
900
849
  }
901
850
  })), s;
902
851
  })()
903
852
  });
904
853
  };
905
854
  export {
906
- Be as Button,
907
- Ne as Icon,
908
- _e as Stats
855
+ Ie as Button,
856
+ je as Icon,
857
+ Te as Stats
909
858
  };
910
859
  //# sourceMappingURL=index.js.map