@moq/watch 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ui/index.js CHANGED
@@ -1,578 +1,552 @@
1
- import { Button as fe, Icon as I, Stats as Ke } from "@moq/ui-core";
2
- import { Signals as De, Moq as He } from "@moq/hang";
3
- const Ge = !1, Je = (e, t) => e === t, Qe = /* @__PURE__ */ Symbol("solid-track"), se = {
4
- equals: Je
1
+ import { Button as lt, Icon as V, Stats as Bt } from "@moq/ui-core";
2
+ import { Signals as It, Moq as Nt } from "@moq/hang";
3
+ const Ut = !1, Ft = (t, e) => t === e, Kt = /* @__PURE__ */ Symbol("solid-track"), nt = {
4
+ equals: Ft
5
5
  };
6
- let Me = Te;
7
- const D = 1, ie = 2, je = {
6
+ let Et = Wt;
7
+ const F = 1, rt = 2, Pt = {
8
8
  owned: null,
9
9
  cleanups: null,
10
10
  context: null,
11
11
  owner: null
12
12
  };
13
13
  var g = null;
14
- let he = null, Xe = null, v = null, $ = null, F = null, de = 0;
15
- function re(e, t) {
16
- const n = v, o = g, r = e.length === 0, s = t === void 0 ? o : t, a = r ? je : {
14
+ let ft = null, Dt = null, w = null, A = null, z = null, ct = 0;
15
+ function tt(t, e) {
16
+ const n = w, a = g, r = t.length === 0, o = e === void 0 ? a : e, s = r ? Pt : {
17
17
  owned: null,
18
18
  cleanups: null,
19
- context: s ? s.context : null,
20
- owner: s
21
- }, i = r ? e : () => e(() => O(() => Y(a)));
22
- g = a, v = null;
19
+ context: o ? o.context : null,
20
+ owner: o
21
+ }, i = r ? t : () => t(() => R(() => X(s)));
22
+ g = s, w = null;
23
23
  try {
24
- return te(i, !0);
24
+ return Y(i, !0);
25
25
  } finally {
26
- v = n, g = o;
26
+ w = n, g = a;
27
27
  }
28
28
  }
29
- function A(e, t) {
30
- t = t ? Object.assign({}, se, t) : se;
29
+ function j(t, e) {
30
+ e = e ? Object.assign({}, nt, e) : nt;
31
31
  const n = {
32
- value: e,
32
+ value: t,
33
33
  observers: null,
34
34
  observerSlots: null,
35
- comparator: t.equals || void 0
36
- }, o = (r) => (typeof r == "function" && (r = r(n.value)), Oe(n, r));
37
- return [Re.bind(n), o];
38
- }
39
- function B(e, t, n) {
40
- const o = we(e, t, !1, D);
41
- ee(o);
42
- }
43
- function qe(e, t, n) {
44
- Me = rt;
45
- const o = we(e, t, !1, D);
46
- o.user = !0, F ? F.push(o) : ee(o);
47
- }
48
- function L(e, t, n) {
49
- n = n ? Object.assign({}, se, n) : se;
50
- const o = we(e, t, !0, 0);
51
- return o.observers = null, o.observerSlots = null, o.comparator = n.equals || void 0, ee(o), Re.bind(o);
52
- }
53
- function O(e) {
54
- if (v === null) return e();
55
- const t = v;
56
- v = null;
35
+ comparator: e.equals || void 0
36
+ }, a = (r) => (typeof r == "function" && (r = r(n.value)), Tt(n, r));
37
+ return [jt.bind(n), a];
38
+ }
39
+ function T(t, e, n) {
40
+ const a = bt(t, e, !1, F);
41
+ Z(a);
42
+ }
43
+ function Mt(t, e, n) {
44
+ Et = Yt;
45
+ const a = bt(t, e, !1, F);
46
+ a.user = !0, z ? z.push(a) : Z(a);
47
+ }
48
+ function U(t, e, n) {
49
+ n = n ? Object.assign({}, nt, n) : nt;
50
+ const a = bt(t, e, !0, 0);
51
+ return a.observers = null, a.observerSlots = null, a.comparator = n.equals || void 0, Z(a), jt.bind(a);
52
+ }
53
+ function R(t) {
54
+ if (w === null) return t();
55
+ const e = w;
56
+ w = null;
57
57
  try {
58
- return e();
58
+ return t();
59
59
  } finally {
60
- v = t;
60
+ w = e;
61
61
  }
62
62
  }
63
- function Ze(e) {
64
- qe(() => O(e));
63
+ function Ht(t) {
64
+ Mt(() => R(t));
65
65
  }
66
- function pe(e) {
67
- return g === null || (g.cleanups === null ? g.cleanups = [e] : g.cleanups.push(e)), e;
66
+ function ut(t) {
67
+ return g === null || (g.cleanups === null ? g.cleanups = [t] : g.cleanups.push(t)), t;
68
68
  }
69
- function Ye() {
69
+ function Gt() {
70
70
  return g;
71
71
  }
72
- function et(e, t) {
72
+ function Jt(t, e) {
73
73
  const n = /* @__PURE__ */ Symbol("context");
74
74
  return {
75
75
  id: n,
76
- Provider: st(n),
77
- defaultValue: e
76
+ Provider: ee(n),
77
+ defaultValue: t
78
78
  };
79
79
  }
80
- function Ve(e) {
81
- let t;
82
- return g && g.context && (t = g.context[e.id]) !== void 0 ? t : e.defaultValue;
80
+ function qt(t) {
81
+ let e;
82
+ return g && g.context && (e = g.context[t.id]) !== void 0 ? e : t.defaultValue;
83
83
  }
84
- function Le(e) {
85
- const t = L(e), n = L(() => be(t()));
84
+ function Qt(t) {
85
+ const e = U(t), n = U(() => ht(e()));
86
86
  return n.toArray = () => {
87
- const o = n();
88
- return Array.isArray(o) ? o : o != null ? [o] : [];
87
+ const a = n();
88
+ return Array.isArray(a) ? a : a != null ? [a] : [];
89
89
  }, n;
90
90
  }
91
- function Re() {
91
+ function jt() {
92
92
  if (this.sources && this.state)
93
- if (this.state === D) ee(this);
93
+ if (this.state === F) Z(this);
94
94
  else {
95
- const e = $;
96
- $ = null, te(() => le(this), !1), $ = e;
95
+ const t = A;
96
+ A = null, Y(() => ot(this), !1), A = t;
97
97
  }
98
- if (v) {
99
- const e = this.observers ? this.observers.length : 0;
100
- v.sources ? (v.sources.push(this), v.sourceSlots.push(e)) : (v.sources = [this], v.sourceSlots = [e]), this.observers ? (this.observers.push(v), this.observerSlots.push(v.sources.length - 1)) : (this.observers = [v], this.observerSlots = [v.sources.length - 1]);
98
+ if (w) {
99
+ const t = this.observers ? this.observers.length : 0;
100
+ w.sources ? (w.sources.push(this), w.sourceSlots.push(t)) : (w.sources = [this], w.sourceSlots = [t]), this.observers ? (this.observers.push(w), this.observerSlots.push(w.sources.length - 1)) : (this.observers = [w], this.observerSlots = [w.sources.length - 1]);
101
101
  }
102
102
  return this.value;
103
103
  }
104
- function Oe(e, t, n) {
105
- let o = e.value;
106
- return (!e.comparator || !e.comparator(o, t)) && (e.value = t, e.observers && e.observers.length && te(() => {
107
- for (let r = 0; r < e.observers.length; r += 1) {
108
- const s = e.observers[r], a = he && he.running;
109
- a && he.disposed.has(s), (a ? !s.tState : !s.state) && (s.pure ? $.push(s) : F.push(s), s.observers && We(s)), a || (s.state = D);
104
+ function Tt(t, e, n) {
105
+ let a = t.value;
106
+ return (!t.comparator || !t.comparator(a, e)) && (t.value = e, t.observers && t.observers.length && Y(() => {
107
+ for (let r = 0; r < t.observers.length; r += 1) {
108
+ const o = t.observers[r], s = ft && ft.running;
109
+ s && ft.disposed.has(o), (s ? !o.tState : !o.state) && (o.pure ? A.push(o) : z.push(o), o.observers && Ot(o)), s || (o.state = F);
110
110
  }
111
- if ($.length > 1e6)
112
- throw $ = [], new Error();
113
- }, !1)), t;
114
- }
115
- function ee(e) {
116
- if (!e.fn) return;
117
- Y(e);
118
- const t = de;
119
- tt(e, e.value, t);
120
- }
121
- function tt(e, t, n) {
122
- let o;
123
- const r = g, s = v;
124
- v = g = e;
111
+ if (A.length > 1e6)
112
+ throw A = [], new Error();
113
+ }, !1)), e;
114
+ }
115
+ function Z(t) {
116
+ if (!t.fn) return;
117
+ X(t);
118
+ const e = ct;
119
+ Xt(t, t.value, e);
120
+ }
121
+ function Xt(t, e, n) {
122
+ let a;
123
+ const r = g, o = w;
124
+ w = g = t;
125
125
  try {
126
- o = e.fn(t);
127
- } catch (a) {
128
- return e.pure && (e.state = D, e.owned && e.owned.forEach(Y), e.owned = null), e.updatedAt = n + 1, ze(a);
126
+ a = t.fn(e);
127
+ } catch (s) {
128
+ return t.pure && (t.state = F, t.owned && t.owned.forEach(X), t.owned = null), t.updatedAt = n + 1, Vt(s);
129
129
  } finally {
130
- v = s, g = r;
130
+ w = o, g = r;
131
131
  }
132
- (!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? Oe(e, o) : e.value = o, e.updatedAt = n);
132
+ (!t.updatedAt || t.updatedAt <= n) && (t.updatedAt != null && "observers" in t ? Tt(t, a) : t.value = a, t.updatedAt = n);
133
133
  }
134
- function we(e, t, n, o = D, r) {
135
- const s = {
136
- fn: e,
137
- state: o,
134
+ function bt(t, e, n, a = F, r) {
135
+ const o = {
136
+ fn: t,
137
+ state: a,
138
138
  updatedAt: null,
139
139
  owned: null,
140
140
  sources: null,
141
141
  sourceSlots: null,
142
142
  cleanups: null,
143
- value: t,
143
+ value: e,
144
144
  owner: g,
145
145
  context: g ? g.context : null,
146
146
  pure: n
147
147
  };
148
- return g === null || g !== je && (g.owned ? g.owned.push(s) : g.owned = [s]), s;
149
- }
150
- function ae(e) {
151
- if (e.state === 0) return;
152
- if (e.state === ie) return le(e);
153
- if (e.suspense && O(e.suspense.inFallback)) return e.suspense.effects.push(e);
154
- const t = [e];
155
- for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < de); )
156
- e.state && t.push(e);
157
- for (let n = t.length - 1; n >= 0; n--)
158
- if (e = t[n], e.state === D)
159
- ee(e);
160
- else if (e.state === ie) {
161
- const o = $;
162
- $ = null, te(() => le(e, t[0]), !1), $ = o;
148
+ return g === null || g !== Pt && (g.owned ? g.owned.push(o) : g.owned = [o]), o;
149
+ }
150
+ function at(t) {
151
+ if (t.state === 0) return;
152
+ if (t.state === rt) return ot(t);
153
+ if (t.suspense && R(t.suspense.inFallback)) return t.suspense.effects.push(t);
154
+ const e = [t];
155
+ for (; (t = t.owner) && (!t.updatedAt || t.updatedAt < ct); )
156
+ t.state && e.push(t);
157
+ for (let n = e.length - 1; n >= 0; n--)
158
+ if (t = e[n], t.state === F)
159
+ Z(t);
160
+ else if (t.state === rt) {
161
+ const a = A;
162
+ A = null, Y(() => ot(t, e[0]), !1), A = a;
163
163
  }
164
164
  }
165
- function te(e, t) {
166
- if ($) return e();
165
+ function Y(t, e) {
166
+ if (A) return t();
167
167
  let n = !1;
168
- t || ($ = []), F ? n = !0 : F = [], de++;
168
+ e || (A = []), z ? n = !0 : z = [], ct++;
169
169
  try {
170
- const o = e();
171
- return nt(n), o;
172
- } catch (o) {
173
- n || (F = null), $ = null, ze(o);
170
+ const a = t();
171
+ return Zt(n), a;
172
+ } catch (a) {
173
+ n || (z = null), A = null, Vt(a);
174
174
  }
175
175
  }
176
- function nt(e) {
177
- if ($ && (Te($), $ = null), e) return;
178
- const t = F;
179
- F = null, t.length && te(() => Me(t), !1);
176
+ function Zt(t) {
177
+ if (A && (Wt(A), A = null), t) return;
178
+ const e = z;
179
+ z = null, e.length && Y(() => Et(e), !1);
180
180
  }
181
- function Te(e) {
182
- for (let t = 0; t < e.length; t++) ae(e[t]);
181
+ function Wt(t) {
182
+ for (let e = 0; e < t.length; e++) at(t[e]);
183
183
  }
184
- function rt(e) {
185
- let t, n = 0;
186
- for (t = 0; t < e.length; t++) {
187
- const o = e[t];
188
- o.user ? e[n++] = o : ae(o);
184
+ function Yt(t) {
185
+ let e, n = 0;
186
+ for (e = 0; e < t.length; e++) {
187
+ const a = t[e];
188
+ a.user ? t[n++] = a : at(a);
189
189
  }
190
- for (t = 0; t < n; t++) ae(e[t]);
191
- }
192
- function le(e, t) {
193
- e.state = 0;
194
- for (let n = 0; n < e.sources.length; n += 1) {
195
- const o = e.sources[n];
196
- if (o.sources) {
197
- const r = o.state;
198
- r === D ? o !== t && (!o.updatedAt || o.updatedAt < de) && ae(o) : r === ie && le(o, t);
190
+ for (e = 0; e < n; e++) at(t[e]);
191
+ }
192
+ function ot(t, e) {
193
+ t.state = 0;
194
+ for (let n = 0; n < t.sources.length; n += 1) {
195
+ const a = t.sources[n];
196
+ if (a.sources) {
197
+ const r = a.state;
198
+ r === F ? a !== e && (!a.updatedAt || a.updatedAt < ct) && at(a) : r === rt && ot(a, e);
199
199
  }
200
200
  }
201
201
  }
202
- function We(e) {
203
- for (let t = 0; t < e.observers.length; t += 1) {
204
- const n = e.observers[t];
205
- n.state || (n.state = ie, n.pure ? $.push(n) : F.push(n), n.observers && We(n));
202
+ function Ot(t) {
203
+ for (let e = 0; e < t.observers.length; e += 1) {
204
+ const n = t.observers[e];
205
+ n.state || (n.state = rt, n.pure ? A.push(n) : z.push(n), n.observers && Ot(n));
206
206
  }
207
207
  }
208
- function Y(e) {
209
- let t;
210
- if (e.sources)
211
- for (; e.sources.length; ) {
212
- const n = e.sources.pop(), o = e.sourceSlots.pop(), r = n.observers;
208
+ function X(t) {
209
+ let e;
210
+ if (t.sources)
211
+ for (; t.sources.length; ) {
212
+ const n = t.sources.pop(), a = t.sourceSlots.pop(), r = n.observers;
213
213
  if (r && r.length) {
214
- const s = r.pop(), a = n.observerSlots.pop();
215
- o < r.length && (s.sourceSlots[a] = o, r[o] = s, n.observerSlots[o] = a);
214
+ const o = r.pop(), s = n.observerSlots.pop();
215
+ a < r.length && (o.sourceSlots[s] = a, r[a] = o, n.observerSlots[a] = s);
216
216
  }
217
217
  }
218
- if (e.tOwned) {
219
- for (t = e.tOwned.length - 1; t >= 0; t--) Y(e.tOwned[t]);
220
- delete e.tOwned;
218
+ if (t.tOwned) {
219
+ for (e = t.tOwned.length - 1; e >= 0; e--) X(t.tOwned[e]);
220
+ delete t.tOwned;
221
221
  }
222
- if (e.owned) {
223
- for (t = e.owned.length - 1; t >= 0; t--) Y(e.owned[t]);
224
- e.owned = null;
222
+ if (t.owned) {
223
+ for (e = t.owned.length - 1; e >= 0; e--) X(t.owned[e]);
224
+ t.owned = null;
225
225
  }
226
- if (e.cleanups) {
227
- for (t = e.cleanups.length - 1; t >= 0; t--) e.cleanups[t]();
228
- e.cleanups = null;
226
+ if (t.cleanups) {
227
+ for (e = t.cleanups.length - 1; e >= 0; e--) t.cleanups[e]();
228
+ t.cleanups = null;
229
229
  }
230
- e.state = 0;
230
+ t.state = 0;
231
231
  }
232
- function ot(e) {
233
- return e instanceof Error ? e : new Error(typeof e == "string" ? e : "Unknown error", {
234
- cause: e
232
+ function te(t) {
233
+ return t instanceof Error ? t : new Error(typeof t == "string" ? t : "Unknown error", {
234
+ cause: t
235
235
  });
236
236
  }
237
- function ze(e, t = g) {
238
- throw ot(e);
237
+ function Vt(t, e = g) {
238
+ throw te(t);
239
239
  }
240
- function be(e) {
241
- if (typeof e == "function" && !e.length) return be(e());
242
- if (Array.isArray(e)) {
243
- const t = [];
244
- for (let n = 0; n < e.length; n++) {
245
- const o = be(e[n]);
246
- Array.isArray(o) ? t.push.apply(t, o) : t.push(o);
240
+ function ht(t) {
241
+ if (typeof t == "function" && !t.length) return ht(t());
242
+ if (Array.isArray(t)) {
243
+ const e = [];
244
+ for (let n = 0; n < t.length; n++) {
245
+ const a = ht(t[n]);
246
+ Array.isArray(a) ? e.push.apply(e, a) : e.push(a);
247
247
  }
248
- return t;
248
+ return e;
249
249
  }
250
- return e;
250
+ return t;
251
251
  }
252
- function st(e, t) {
253
- return function(o) {
252
+ function ee(t, e) {
253
+ return function(a) {
254
254
  let r;
255
- return B(() => r = O(() => (g.context = {
255
+ return T(() => r = R(() => (g.context = {
256
256
  ...g.context,
257
- [e]: o.value
258
- }, Le(() => o.children))), void 0), r;
257
+ [t]: a.value
258
+ }, Qt(() => a.children))), void 0), r;
259
259
  };
260
260
  }
261
- const it = /* @__PURE__ */ Symbol("fallback");
262
- function ye(e) {
263
- for (let t = 0; t < e.length; t++) e[t]();
261
+ const ne = /* @__PURE__ */ Symbol("fallback");
262
+ function wt(t) {
263
+ for (let e = 0; e < t.length; e++) t[e]();
264
264
  }
265
- function at(e, t, n = {}) {
266
- let o = [], r = [], s = [], a = 0, i = t.length > 1 ? [] : null;
267
- return pe(() => ye(s)), () => {
268
- let c = e() || [], f = c.length, d, l;
269
- return c[Qe], O(() => {
270
- let y, _, p, P, M, m, w, x, q;
265
+ function re(t, e, n = {}) {
266
+ let a = [], r = [], o = [], s = 0, i = e.length > 1 ? [] : null;
267
+ return ut(() => wt(o)), () => {
268
+ let c = t() || [], f = c.length, d, l;
269
+ return c[Kt], R(() => {
270
+ let $, _, h, E, P, b, v, m, q;
271
271
  if (f === 0)
272
- a !== 0 && (ye(s), s = [], o = [], r = [], a = 0, i && (i = [])), n.fallback && (o = [it], r[0] = re((U) => (s[0] = U, n.fallback())), a = 1);
273
- else if (a === 0) {
272
+ s !== 0 && (wt(o), o = [], a = [], r = [], s = 0, i && (i = [])), n.fallback && (a = [ne], r[0] = tt((B) => (o[0] = B, n.fallback())), s = 1);
273
+ else if (s === 0) {
274
274
  for (r = new Array(f), l = 0; l < f; l++)
275
- o[l] = c[l], r[l] = re(E);
276
- a = f;
275
+ a[l] = c[l], r[l] = tt(M);
276
+ s = f;
277
277
  } else {
278
- for (p = new Array(f), P = new Array(f), i && (M = new Array(f)), m = 0, w = Math.min(a, f); m < w && o[m] === c[m]; m++) ;
279
- for (w = a - 1, x = f - 1; w >= m && x >= m && o[w] === c[x]; w--, x--)
280
- p[x] = r[w], P[x] = s[w], i && (M[x] = i[w]);
281
- for (y = /* @__PURE__ */ new Map(), _ = new Array(x + 1), l = x; l >= m; l--)
282
- q = c[l], d = y.get(q), _[l] = d === void 0 ? -1 : d, y.set(q, l);
283
- for (d = m; d <= w; d++)
284
- q = o[d], l = y.get(q), l !== void 0 && l !== -1 ? (p[l] = r[d], P[l] = s[d], i && (M[l] = i[d]), l = _[l], y.set(q, l)) : s[d]();
285
- for (l = m; l < f; l++)
286
- l in p ? (r[l] = p[l], s[l] = P[l], i && (i[l] = M[l], i[l](l))) : r[l] = re(E);
287
- r = r.slice(0, a = f), o = c.slice(0);
278
+ for (h = new Array(f), E = new Array(f), i && (P = new Array(f)), b = 0, v = Math.min(s, f); b < v && a[b] === c[b]; b++) ;
279
+ for (v = s - 1, m = f - 1; v >= b && m >= b && a[v] === c[m]; v--, m--)
280
+ h[m] = r[v], E[m] = o[v], i && (P[m] = i[v]);
281
+ for ($ = /* @__PURE__ */ new Map(), _ = new Array(m + 1), l = m; l >= b; l--)
282
+ q = c[l], d = $.get(q), _[l] = d === void 0 ? -1 : d, $.set(q, l);
283
+ for (d = b; d <= v; d++)
284
+ q = a[d], l = $.get(q), l !== void 0 && l !== -1 ? (h[l] = r[d], E[l] = o[d], i && (P[l] = i[d]), l = _[l], $.set(q, l)) : o[d]();
285
+ for (l = b; l < f; l++)
286
+ l in h ? (r[l] = h[l], o[l] = E[l], i && (i[l] = P[l], i[l](l))) : r[l] = tt(M);
287
+ r = r.slice(0, s = f), a = c.slice(0);
288
288
  }
289
289
  return r;
290
290
  });
291
- function E(y) {
292
- if (s[l] = y, i) {
293
- const [_, p] = A(l);
294
- return i[l] = p, t(c[l], _);
291
+ function M($) {
292
+ if (o[l] = $, i) {
293
+ const [_, h] = j(l);
294
+ return i[l] = h, e(c[l], _);
295
295
  }
296
- return t(c[l]);
296
+ return e(c[l]);
297
297
  }
298
298
  };
299
299
  }
300
- function u(e, t) {
301
- return O(() => e(t || {}));
300
+ function u(t, e) {
301
+ return R(() => t(e || {}));
302
302
  }
303
- const Be = (e) => `Stale read from <${e}>.`;
304
- function _e(e) {
305
- const t = "fallback" in e && {
306
- fallback: () => e.fallback
303
+ const ae = (t) => `Stale read from <${t}>.`;
304
+ function gt(t) {
305
+ const e = "fallback" in t && {
306
+ fallback: () => t.fallback
307
307
  };
308
- return L(at(() => e.each, e.children, t || void 0));
308
+ return U(re(() => t.each, t.children, e || void 0));
309
309
  }
310
- function N(e) {
311
- const t = e.keyed, n = L(() => e.when, void 0, void 0), o = t ? n : L(n, void 0, {
312
- equals: (r, s) => !r == !s
310
+ function L(t) {
311
+ const e = t.keyed, n = U(() => t.when, void 0, void 0), a = e ? n : U(n, void 0, {
312
+ equals: (r, o) => !r == !o
313
313
  });
314
- return L(() => {
315
- const r = o();
314
+ return U(() => {
315
+ const r = a();
316
316
  if (r) {
317
- const s = e.children;
318
- return typeof s == "function" && s.length > 0 ? O(() => s(t ? r : () => {
319
- if (!O(o)) throw Be("Show");
317
+ const o = t.children;
318
+ return typeof o == "function" && o.length > 0 ? R(() => o(e ? r : () => {
319
+ if (!R(a)) throw ae("Show");
320
320
  return n();
321
- })) : s;
322
- }
323
- return e.fallback;
324
- }, void 0, void 0);
325
- }
326
- function lt(e) {
327
- const t = Le(() => e.children), n = L(() => {
328
- const o = t(), r = Array.isArray(o) ? o : [o];
329
- let s = () => {
330
- };
331
- for (let a = 0; a < r.length; a++) {
332
- const i = a, c = r[a], f = s, d = L(() => f() ? void 0 : c.when, void 0, void 0), l = c.keyed ? d : L(d, void 0, {
333
- equals: (E, y) => !E == !y
334
- });
335
- s = () => f() || (l() ? [i, d, c] : void 0);
321
+ })) : o;
336
322
  }
337
- return s;
338
- });
339
- return L(() => {
340
- const o = n()();
341
- if (!o) return e.fallback;
342
- const [r, s, a] = o, i = a.children;
343
- return typeof i == "function" && i.length > 0 ? O(() => i(a.keyed ? s() : () => {
344
- if (O(n)()?.[0] !== r) throw Be("Match");
345
- return s();
346
- })) : i;
323
+ return t.fallback;
347
324
  }, void 0, void 0);
348
325
  }
349
- function G(e) {
350
- return e;
351
- }
352
- const ct = (e) => L(() => e());
353
- function ut(e, t, n) {
354
- let o = n.length, r = t.length, s = o, a = 0, i = 0, c = t[r - 1].nextSibling, f = null;
355
- for (; a < r || i < s; ) {
356
- if (t[a] === n[i]) {
357
- a++, i++;
326
+ const oe = (t) => U(() => t());
327
+ function ie(t, e, n) {
328
+ let a = n.length, r = e.length, o = a, s = 0, i = 0, c = e[r - 1].nextSibling, f = null;
329
+ for (; s < r || i < o; ) {
330
+ if (e[s] === n[i]) {
331
+ s++, i++;
358
332
  continue;
359
333
  }
360
- for (; t[r - 1] === n[s - 1]; )
361
- r--, s--;
362
- if (r === a) {
363
- const d = s < o ? i ? n[i - 1].nextSibling : n[s - i] : c;
364
- for (; i < s; ) e.insertBefore(n[i++], d);
365
- } else if (s === i)
366
- for (; a < r; )
367
- (!f || !f.has(t[a])) && t[a].remove(), a++;
368
- else if (t[a] === n[s - 1] && n[i] === t[r - 1]) {
369
- const d = t[--r].nextSibling;
370
- e.insertBefore(n[i++], t[a++].nextSibling), e.insertBefore(n[--s], d), t[r] = n[s];
334
+ for (; e[r - 1] === n[o - 1]; )
335
+ r--, o--;
336
+ if (r === s) {
337
+ const d = o < a ? i ? n[i - 1].nextSibling : n[o - i] : c;
338
+ for (; i < o; ) t.insertBefore(n[i++], d);
339
+ } else if (o === i)
340
+ for (; s < r; )
341
+ (!f || !f.has(e[s])) && e[s].remove(), s++;
342
+ else if (e[s] === n[o - 1] && n[i] === e[r - 1]) {
343
+ const d = e[--r].nextSibling;
344
+ t.insertBefore(n[i++], e[s++].nextSibling), t.insertBefore(n[--o], d), e[r] = n[o];
371
345
  } else {
372
346
  if (!f) {
373
347
  f = /* @__PURE__ */ new Map();
374
348
  let l = i;
375
- for (; l < s; ) f.set(n[l], l++);
349
+ for (; l < o; ) f.set(n[l], l++);
376
350
  }
377
- const d = f.get(t[a]);
351
+ const d = f.get(e[s]);
378
352
  if (d != null)
379
- if (i < d && d < s) {
380
- let l = a, E = 1, y;
381
- for (; ++l < r && l < s && !((y = f.get(t[l])) == null || y !== d + E); )
382
- E++;
383
- if (E > d - i) {
384
- const _ = t[a];
385
- for (; i < d; ) e.insertBefore(n[i++], _);
386
- } else e.replaceChild(n[i++], t[a++]);
387
- } else a++;
388
- else t[a++].remove();
353
+ if (i < d && d < o) {
354
+ let l = s, M = 1, $;
355
+ for (; ++l < r && l < o && !(($ = f.get(e[l])) == null || $ !== d + M); )
356
+ M++;
357
+ if (M > d - i) {
358
+ const _ = e[s];
359
+ for (; i < d; ) t.insertBefore(n[i++], _);
360
+ } else t.replaceChild(n[i++], e[s++]);
361
+ } else s++;
362
+ else e[s++].remove();
389
363
  }
390
364
  }
391
365
  }
392
- const xe = "_$DX_DELEGATE";
393
- function T(e, t, n, o) {
366
+ const mt = "_$DX_DELEGATE";
367
+ function W(t, e, n, a) {
394
368
  let r;
395
- const s = () => {
369
+ const o = () => {
396
370
  const i = document.createElement("template");
397
- return i.innerHTML = e, i.content.firstChild;
398
- }, a = () => (r || (r = s())).cloneNode(!0);
399
- return a.cloneNode = a, a;
400
- }
401
- function ft(e, t = window.document) {
402
- const n = t[xe] || (t[xe] = /* @__PURE__ */ new Set());
403
- for (let o = 0, r = e.length; o < r; o++) {
404
- const s = e[o];
405
- n.has(s) || (n.add(s), t.addEventListener(s, gt));
371
+ return i.innerHTML = t, i.content.firstChild;
372
+ }, s = () => (r || (r = o())).cloneNode(!0);
373
+ return s.cloneNode = s, s;
374
+ }
375
+ function se(t, e = window.document) {
376
+ const n = e[mt] || (e[mt] = /* @__PURE__ */ new Set());
377
+ for (let a = 0, r = t.length; a < r; a++) {
378
+ const o = t[a];
379
+ n.has(o) || (n.add(o), e.addEventListener(o, ue));
406
380
  }
407
381
  }
408
- function oe(e, t, n) {
409
- n == null ? e.removeAttribute(t) : e.setAttribute(t, n);
410
- }
411
- function dt(e, t) {
412
- t == null ? e.removeAttribute("class") : e.className = t;
413
- }
414
- function Ce(e, t, n) {
415
- if (!t) return n ? oe(e, "style") : t;
416
- const o = e.style;
417
- if (typeof t == "string") return o.cssText = t;
418
- typeof n == "string" && (o.cssText = n = void 0), n || (n = {}), t || (t = {});
419
- let r, s;
420
- for (s in n)
421
- t[s] == null && o.removeProperty(s), delete n[s];
422
- for (s in t)
423
- r = t[s], r !== n[s] && (o.setProperty(s, r), n[s] = r);
382
+ function et(t, e, n) {
383
+ n == null ? t.removeAttribute(e) : t.setAttribute(e, n);
384
+ }
385
+ function pt(t, e) {
386
+ e == null ? t.removeAttribute("class") : t.className = e;
387
+ }
388
+ function yt(t, e, n) {
389
+ if (!e) return n ? et(t, "style") : e;
390
+ const a = t.style;
391
+ if (typeof e == "string") return a.cssText = e;
392
+ typeof n == "string" && (a.cssText = n = void 0), n || (n = {}), e || (e = {});
393
+ let r, o;
394
+ for (o in n)
395
+ e[o] == null && a.removeProperty(o), delete n[o];
396
+ for (o in e)
397
+ r = e[o], r !== n[o] && (a.setProperty(o, r), n[o] = r);
424
398
  return n;
425
399
  }
426
- function pt(e, t, n) {
427
- n != null ? e.style.setProperty(t, n) : e.style.removeProperty(t);
400
+ function le(t, e, n) {
401
+ n != null ? t.style.setProperty(e, n) : t.style.removeProperty(e);
428
402
  }
429
- function ht(e, t, n) {
430
- return O(() => e(t, n));
403
+ function ce(t, e, n) {
404
+ return R(() => t(e, n));
431
405
  }
432
- function b(e, t, n, o) {
433
- if (n !== void 0 && !o && (o = []), typeof t != "function") return ce(e, t, o, n);
434
- B((r) => ce(e, t(), r, n), o);
406
+ function p(t, e, n, a) {
407
+ if (n !== void 0 && !a && (a = []), typeof e != "function") return it(t, e, a, n);
408
+ T((r) => it(t, e(), r, n), a);
435
409
  }
436
- function gt(e) {
437
- let t = e.target;
438
- const n = `$$${e.type}`, o = e.target, r = e.currentTarget, s = (c) => Object.defineProperty(e, "target", {
410
+ function ue(t) {
411
+ let e = t.target;
412
+ const n = `$$${t.type}`, a = t.target, r = t.currentTarget, o = (c) => Object.defineProperty(t, "target", {
439
413
  configurable: !0,
440
414
  value: c
441
- }), a = () => {
442
- const c = t[n];
443
- if (c && !t.disabled) {
444
- const f = t[`${n}Data`];
445
- if (f !== void 0 ? c.call(t, f, e) : c.call(t, e), e.cancelBubble) return;
415
+ }), s = () => {
416
+ const c = e[n];
417
+ if (c && !e.disabled) {
418
+ const f = e[`${n}Data`];
419
+ if (f !== void 0 ? c.call(e, f, t) : c.call(e, t), t.cancelBubble) return;
446
420
  }
447
- return t.host && typeof t.host != "string" && !t.host._$host && t.contains(e.target) && s(t.host), !0;
421
+ return e.host && typeof e.host != "string" && !e.host._$host && e.contains(t.target) && o(e.host), !0;
448
422
  }, i = () => {
449
- for (; a() && (t = t._$host || t.parentNode || t.host); ) ;
423
+ for (; s() && (e = e._$host || e.parentNode || e.host); ) ;
450
424
  };
451
- if (Object.defineProperty(e, "currentTarget", {
425
+ if (Object.defineProperty(t, "currentTarget", {
452
426
  configurable: !0,
453
427
  get() {
454
- return t || document;
428
+ return e || document;
455
429
  }
456
- }), e.composedPath) {
457
- const c = e.composedPath();
458
- s(c[0]);
459
- for (let f = 0; f < c.length - 2 && (t = c[f], !!a()); f++) {
460
- if (t._$host) {
461
- t = t._$host, i();
430
+ }), t.composedPath) {
431
+ const c = t.composedPath();
432
+ o(c[0]);
433
+ for (let f = 0; f < c.length - 2 && (e = c[f], !!s()); f++) {
434
+ if (e._$host) {
435
+ e = e._$host, i();
462
436
  break;
463
437
  }
464
- if (t.parentNode === r)
438
+ if (e.parentNode === r)
465
439
  break;
466
440
  }
467
441
  } else i();
468
- s(o);
442
+ o(a);
469
443
  }
470
- function ce(e, t, n, o, r) {
444
+ function it(t, e, n, a, r) {
471
445
  for (; typeof n == "function"; ) n = n();
472
- if (t === n) return n;
473
- const s = typeof t, a = o !== void 0;
474
- if (e = a && n[0] && n[0].parentNode || e, s === "string" || s === "number") {
475
- if (s === "number" && (t = t.toString(), t === n))
446
+ if (e === n) return n;
447
+ const o = typeof e, s = a !== void 0;
448
+ if (t = s && n[0] && n[0].parentNode || t, o === "string" || o === "number") {
449
+ if (o === "number" && (e = e.toString(), e === n))
476
450
  return n;
477
- if (a) {
451
+ if (s) {
478
452
  let i = n[0];
479
- i && i.nodeType === 3 ? i.data !== t && (i.data = t) : i = document.createTextNode(t), n = J(e, n, o, i);
453
+ i && i.nodeType === 3 ? i.data !== e && (i.data = e) : i = document.createTextNode(e), n = H(t, n, a, i);
480
454
  } else
481
- n !== "" && typeof n == "string" ? n = e.firstChild.data = t : n = e.textContent = t;
482
- } else if (t == null || s === "boolean")
483
- n = J(e, n, o);
455
+ n !== "" && typeof n == "string" ? n = t.firstChild.data = e : n = t.textContent = e;
456
+ } else if (e == null || o === "boolean")
457
+ n = H(t, n, a);
484
458
  else {
485
- if (s === "function")
486
- return B(() => {
487
- let i = t();
459
+ if (o === "function")
460
+ return T(() => {
461
+ let i = e();
488
462
  for (; typeof i == "function"; ) i = i();
489
- n = ce(e, i, n, o);
463
+ n = it(t, i, n, a);
490
464
  }), () => n;
491
- if (Array.isArray(t)) {
465
+ if (Array.isArray(e)) {
492
466
  const i = [], c = n && Array.isArray(n);
493
- if (me(i, t, n, r))
494
- return B(() => n = ce(e, i, n, o, !0)), () => n;
467
+ if (_t(i, e, n, r))
468
+ return T(() => n = it(t, i, n, a, !0)), () => n;
495
469
  if (i.length === 0) {
496
- if (n = J(e, n, o), a) return n;
497
- } else c ? n.length === 0 ? Se(e, i, o) : ut(e, n, i) : (n && J(e), Se(e, i));
470
+ if (n = H(t, n, a), s) return n;
471
+ } else c ? n.length === 0 ? xt(t, i, a) : ie(t, n, i) : (n && H(t), xt(t, i));
498
472
  n = i;
499
- } else if (t.nodeType) {
473
+ } else if (e.nodeType) {
500
474
  if (Array.isArray(n)) {
501
- if (a) return n = J(e, n, o, t);
502
- J(e, n, null, t);
503
- } else n == null || n === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
504
- n = t;
475
+ if (s) return n = H(t, n, a, e);
476
+ H(t, n, null, e);
477
+ } else n == null || n === "" || !t.firstChild ? t.appendChild(e) : t.replaceChild(e, t.firstChild);
478
+ n = e;
505
479
  }
506
480
  }
507
481
  return n;
508
482
  }
509
- function me(e, t, n, o) {
483
+ function _t(t, e, n, a) {
510
484
  let r = !1;
511
- for (let s = 0, a = t.length; s < a; s++) {
512
- let i = t[s], c = n && n[e.length], f;
485
+ for (let o = 0, s = e.length; o < s; o++) {
486
+ let i = e[o], c = n && n[t.length], f;
513
487
  if (!(i == null || i === !0 || i === !1)) if ((f = typeof i) == "object" && i.nodeType)
514
- e.push(i);
488
+ t.push(i);
515
489
  else if (Array.isArray(i))
516
- r = me(e, i, c) || r;
490
+ r = _t(t, i, c) || r;
517
491
  else if (f === "function")
518
- if (o) {
492
+ if (a) {
519
493
  for (; typeof i == "function"; ) i = i();
520
- r = me(e, Array.isArray(i) ? i : [i], Array.isArray(c) ? c : [c]) || r;
494
+ r = _t(t, Array.isArray(i) ? i : [i], Array.isArray(c) ? c : [c]) || r;
521
495
  } else
522
- e.push(i), r = !0;
496
+ t.push(i), r = !0;
523
497
  else {
524
498
  const d = String(i);
525
- c && c.nodeType === 3 && c.data === d ? e.push(c) : e.push(document.createTextNode(d));
499
+ c && c.nodeType === 3 && c.data === d ? t.push(c) : t.push(document.createTextNode(d));
526
500
  }
527
501
  }
528
502
  return r;
529
503
  }
530
- function Se(e, t, n = null) {
531
- for (let o = 0, r = t.length; o < r; o++) e.insertBefore(t[o], n);
504
+ function xt(t, e, n = null) {
505
+ for (let a = 0, r = e.length; a < r; a++) t.insertBefore(e[a], n);
532
506
  }
533
- function J(e, t, n, o) {
534
- if (n === void 0) return e.textContent = "";
535
- const r = o || document.createTextNode("");
536
- if (t.length) {
537
- let s = !1;
538
- for (let a = t.length - 1; a >= 0; a--) {
539
- const i = t[a];
507
+ function H(t, e, n, a) {
508
+ if (n === void 0) return t.textContent = "";
509
+ const r = a || document.createTextNode("");
510
+ if (e.length) {
511
+ let o = !1;
512
+ for (let s = e.length - 1; s >= 0; s--) {
513
+ const i = e[s];
540
514
  if (r !== i) {
541
- const c = i.parentNode === e;
542
- !s && !a ? c ? e.replaceChild(r, i) : e.insertBefore(r, n) : c && i.remove();
543
- } else s = !0;
515
+ const c = i.parentNode === t;
516
+ !o && !s ? c ? t.replaceChild(r, i) : t.insertBefore(r, n) : c && i.remove();
517
+ } else o = !0;
544
518
  }
545
- } else e.insertBefore(r, n);
519
+ } else t.insertBefore(r, n);
546
520
  return [r];
547
521
  }
548
- function bt(e) {
549
- return Object.keys(e).reduce((n, o) => {
550
- const r = e[o];
551
- return n[o] = Object.assign({}, r), Ne(r.value) && !yt(r.value) && !Array.isArray(r.value) && (n[o].value = Object.assign({}, r.value)), Array.isArray(r.value) && (n[o].value = r.value.slice(0)), n;
522
+ function fe(t) {
523
+ return Object.keys(t).reduce((n, a) => {
524
+ const r = t[a];
525
+ return n[a] = Object.assign({}, r), zt(r.value) && !_e(r.value) && !Array.isArray(r.value) && (n[a].value = Object.assign({}, r.value)), Array.isArray(r.value) && (n[a].value = r.value.slice(0)), n;
552
526
  }, {});
553
527
  }
554
- function _t(e) {
555
- return e ? Object.keys(e).reduce((n, o) => {
556
- const r = e[o];
557
- return n[o] = Ne(r) && "value" in r ? r : {
528
+ function de(t) {
529
+ return t ? Object.keys(t).reduce((n, a) => {
530
+ const r = t[a];
531
+ return n[a] = zt(r) && "value" in r ? r : {
558
532
  value: r
559
- }, n[o].attribute || (n[o].attribute = vt(o)), n[o].parse = "parse" in n[o] ? n[o].parse : typeof n[o].value != "string", n;
533
+ }, n[a].attribute || (n[a].attribute = pe(a)), n[a].parse = "parse" in n[a] ? n[a].parse : typeof n[a].value != "string", n;
560
534
  }, {}) : {};
561
535
  }
562
- function mt(e) {
563
- return Object.keys(e).reduce((n, o) => (n[o] = e[o].value, n), {});
536
+ function he(t) {
537
+ return Object.keys(t).reduce((n, a) => (n[a] = t[a].value, n), {});
564
538
  }
565
- function wt(e, t) {
566
- const n = bt(t);
567
- return Object.keys(t).forEach((r) => {
568
- const s = n[r], a = e.getAttribute(s.attribute), i = e[r];
569
- a != null && (s.value = s.parse ? Ie(a) : a), i != null && (s.value = Array.isArray(i) ? i.slice(0) : i), s.reflect && ke(e, s.attribute, s.value, !!s.parse), Object.defineProperty(e, r, {
539
+ function ge(t, e) {
540
+ const n = fe(e);
541
+ return Object.keys(e).forEach((r) => {
542
+ const o = n[r], s = t.getAttribute(o.attribute), i = t[r];
543
+ s != null && (o.value = o.parse ? Lt(s) : s), i != null && (o.value = Array.isArray(i) ? i.slice(0) : i), o.reflect && kt(t, o.attribute, o.value, !!o.parse), Object.defineProperty(t, r, {
570
544
  get() {
571
- return s.value;
545
+ return o.value;
572
546
  },
573
547
  set(c) {
574
- const f = s.value;
575
- s.value = c, s.reflect && ke(this, s.attribute, s.value, !!s.parse);
548
+ const f = o.value;
549
+ o.value = c, o.reflect && kt(this, o.attribute, o.value, !!o.parse);
576
550
  for (let d = 0, l = this.__propertyChangedCallbacks.length; d < l; d++)
577
551
  this.__propertyChangedCallbacks[d](r, c, f);
578
552
  },
@@ -581,37 +555,37 @@ function wt(e, t) {
581
555
  });
582
556
  }), n;
583
557
  }
584
- function Ie(e) {
585
- if (e)
558
+ function Lt(t) {
559
+ if (t)
586
560
  try {
587
- return JSON.parse(e);
561
+ return JSON.parse(t);
588
562
  } catch {
589
- return e;
563
+ return t;
590
564
  }
591
565
  }
592
- function ke(e, t, n, o) {
593
- if (n == null || n === !1) return e.removeAttribute(t);
594
- let r = o ? JSON.stringify(n) : n;
595
- e.__updating[t] = !0, r === "true" && (r = ""), e.setAttribute(t, r), Promise.resolve().then(() => delete e.__updating[t]);
566
+ function kt(t, e, n, a) {
567
+ if (n == null || n === !1) return t.removeAttribute(e);
568
+ let r = a ? JSON.stringify(n) : n;
569
+ t.__updating[e] = !0, r === "true" && (r = ""), t.setAttribute(e, r), Promise.resolve().then(() => delete t.__updating[e]);
596
570
  }
597
- function vt(e) {
598
- return e.replace(/\.?([A-Z]+)/g, (t, n) => "-" + n.toLowerCase()).replace("_", "-").replace(/^-/, "");
571
+ function pe(t) {
572
+ return t.replace(/\.?([A-Z]+)/g, (e, n) => "-" + n.toLowerCase()).replace("_", "-").replace(/^-/, "");
599
573
  }
600
- function Ne(e) {
601
- return e != null && (typeof e == "object" || typeof e == "function");
574
+ function zt(t) {
575
+ return t != null && (typeof t == "object" || typeof t == "function");
602
576
  }
603
- function yt(e) {
604
- return Object.prototype.toString.call(e) === "[object Function]";
577
+ function _e(t) {
578
+ return Object.prototype.toString.call(t) === "[object Function]";
605
579
  }
606
- function xt(e) {
607
- return typeof e == "function" && e.toString().indexOf("class") === 0;
580
+ function be(t) {
581
+ return typeof t == "function" && t.toString().indexOf("class") === 0;
608
582
  }
609
- let ge;
610
- function Ct(e, t) {
611
- const n = Object.keys(t);
612
- return class extends e {
583
+ let dt;
584
+ function ve(t, e) {
585
+ const n = Object.keys(e);
586
+ return class extends t {
613
587
  static get observedAttributes() {
614
- return n.map((r) => t[r].attribute);
588
+ return n.map((r) => e[r].attribute);
615
589
  }
616
590
  constructor() {
617
591
  super(), this.__initialized = !1, this.__released = !1, this.__releaseCallbacks = [], this.__propertyChangedCallbacks = [], this.__updating = {}, this.props = {};
@@ -620,16 +594,16 @@ function Ct(e, t) {
620
594
  }
621
595
  connectedCallback() {
622
596
  if (this.__initialized) return;
623
- this.__releaseCallbacks = [], this.__propertyChangedCallbacks = [], this.__updating = {}, this.props = wt(this, t);
624
- const r = mt(this.props), s = this.Component, a = ge;
597
+ this.__releaseCallbacks = [], this.__propertyChangedCallbacks = [], this.__updating = {}, this.props = ge(this, e);
598
+ const r = he(this.props), o = this.Component, s = dt;
625
599
  try {
626
- ge = this, this.__initialized = !0, xt(s) ? new s(r, {
600
+ dt = this, this.__initialized = !0, be(o) ? new o(r, {
627
601
  element: this
628
- }) : s(r, {
602
+ }) : o(r, {
629
603
  element: this
630
604
  });
631
605
  } finally {
632
- ge = a;
606
+ dt = s;
633
607
  }
634
608
  }
635
609
  async disconnectedCallback() {
@@ -639,15 +613,15 @@ function Ct(e, t) {
639
613
  for (; r = this.__releaseCallbacks.pop(); ) r(this);
640
614
  delete this.__initialized, this.__released = !0;
641
615
  }
642
- attributeChangedCallback(r, s, a) {
643
- if (this.__initialized && !this.__updating[r] && (r = this.lookupProp(r), r in t)) {
644
- if (a == null && !this[r]) return;
645
- this[r] = t[r].parse ? Ie(a) : a;
616
+ attributeChangedCallback(r, o, s) {
617
+ if (this.__initialized && !this.__updating[r] && (r = this.lookupProp(r), r in e)) {
618
+ if (s == null && !this[r]) return;
619
+ this[r] = e[r].parse ? Lt(s) : s;
646
620
  }
647
621
  }
648
622
  lookupProp(r) {
649
- if (t)
650
- return n.find((s) => r === s || r === t[s].attribute);
623
+ if (e)
624
+ return n.find((o) => r === o || r === e[o].attribute);
651
625
  }
652
626
  get renderRoot() {
653
627
  return this.shadowRoot || this.attachShadow({
@@ -662,244 +636,232 @@ function Ct(e, t) {
662
636
  }
663
637
  };
664
638
  }
665
- function St(e, t = {}, n = {}) {
639
+ function we(t, e = {}, n = {}) {
666
640
  const {
667
- BaseElement: o = HTMLElement,
641
+ BaseElement: a = HTMLElement,
668
642
  extension: r,
669
- customElements: s = window.customElements
643
+ customElements: o = window.customElements
670
644
  } = n;
671
- return (a) => {
672
- let i = s.get(e);
673
- return i ? (i.prototype.Component = a, i) : (i = Ct(o, _t(t)), i.prototype.Component = a, i.prototype.registeredTag = e, s.define(e, i, r), i);
645
+ return (s) => {
646
+ let i = o.get(t);
647
+ return i ? (i.prototype.Component = s, i) : (i = ve(a, de(e)), i.prototype.Component = s, i.prototype.registeredTag = t, o.define(t, i, r), i);
674
648
  };
675
649
  }
676
- function kt(e) {
677
- const t = Object.keys(e), n = {};
678
- for (let o = 0; o < t.length; o++) {
679
- const [r, s] = A(e[t[o]]);
680
- Object.defineProperty(n, t[o], {
650
+ function me(t) {
651
+ const e = Object.keys(t), n = {};
652
+ for (let a = 0; a < e.length; a++) {
653
+ const [r, o] = j(t[e[a]]);
654
+ Object.defineProperty(n, e[a], {
681
655
  get: r,
682
- set(a) {
683
- s(() => a);
656
+ set(s) {
657
+ o(() => s);
684
658
  }
685
659
  });
686
660
  }
687
661
  return n;
688
662
  }
689
- function $t(e) {
690
- if (e.assignedSlot && e.assignedSlot._$owner) return e.assignedSlot._$owner;
691
- let t = e.parentNode;
692
- for (; t && !t._$owner && !(t.assignedSlot && t.assignedSlot._$owner); )
693
- t = t.parentNode;
694
- return t && t.assignedSlot ? t.assignedSlot._$owner : e._$owner;
695
- }
696
- function At(e) {
697
- return (t, n) => {
698
- const { element: o } = n;
699
- return re((r) => {
700
- const s = kt(t);
701
- o.addPropertyChangedCallback((i, c) => s[i] = c), o.addReleaseCallback(() => {
702
- o.renderRoot.textContent = "", r();
663
+ function ye(t) {
664
+ if (t.assignedSlot && t.assignedSlot._$owner) return t.assignedSlot._$owner;
665
+ let e = t.parentNode;
666
+ for (; e && !e._$owner && !(e.assignedSlot && e.assignedSlot._$owner); )
667
+ e = e.parentNode;
668
+ return e && e.assignedSlot ? e.assignedSlot._$owner : t._$owner;
669
+ }
670
+ function xe(t) {
671
+ return (e, n) => {
672
+ const { element: a } = n;
673
+ return tt((r) => {
674
+ const o = me(e);
675
+ a.addPropertyChangedCallback((i, c) => o[i] = c), a.addReleaseCallback(() => {
676
+ a.renderRoot.textContent = "", r();
703
677
  });
704
- const a = e(s, n);
705
- return b(o.renderRoot, a);
706
- }, $t(o));
678
+ const s = t(o, n);
679
+ return p(a.renderRoot, s);
680
+ }, ye(a));
707
681
  };
708
682
  }
709
- function Et(e, t, n) {
710
- return arguments.length === 2 && (n = t, t = {}), St(e, t)(At(n));
711
- }
712
- function ne(e) {
713
- const [t, n] = A(e.peek(), { equals: !1 }), o = e.subscribe((r) => n(() => r));
714
- return pe(() => o()), t;
715
- }
716
- const ue = et();
717
- function Pt(e) {
718
- const [t, n] = A("no-url"), [o, r] = A(!1), [s, a] = A(!1), [i, c] = A(0), [f, d] = A(!1), l = ne(e.moqWatch.jitter), [E, y] = A([]), [_, p] = A(void 0), [P, M] = A(!1), [m, w] = A(!!document.fullscreenElement), x = () => {
719
- e.moqWatch.paused.set(!e.moqWatch.paused.get());
720
- }, q = () => {
721
- document.fullscreenElement ? document.exitFullscreen() : e.moqWatch.requestFullscreen();
722
- }, U = (h) => {
723
- e.moqWatch.audio.volume.set(h / 100);
724
- }, C = () => {
725
- e.moqWatch.audio.muted.update((h) => !h);
726
- }, R = (h) => {
727
- e.moqWatch.jitter.set(h);
728
- }, K = (h) => {
729
- e.moqWatch.video.source.target.update((k) => ({
730
- ...k,
731
- name: h
683
+ function ke(t, e, n) {
684
+ return arguments.length === 2 && (n = e, e = {}), we(t, e)(xe(n));
685
+ }
686
+ function D(t) {
687
+ const [e, n] = j(t.peek(), { equals: !1 }), a = t.subscribe((r) => n(() => r));
688
+ return ut(() => a()), e;
689
+ }
690
+ const st = Jt();
691
+ function Ce(t) {
692
+ const [e, n] = j("no-url"), [a, r] = j(!1), o = D(t.moqWatch.backend.audio.muted), [s, i] = j(0), c = D(t.moqWatch.backend.video.stalled), f = D(t.moqWatch.backend.jitter), [d, l] = j([]), M = D(t.moqWatch.backend.video.source.track), [$, _] = j(!1), [h, E] = j(!!document.fullscreenElement), P = () => {
693
+ t.moqWatch.paused = !t.moqWatch.paused;
694
+ }, b = () => {
695
+ document.fullscreenElement ? document.exitFullscreen() : t.moqWatch.requestFullscreen();
696
+ }, v = (S) => {
697
+ t.moqWatch.backend.audio.volume.set(S / 100);
698
+ }, m = () => {
699
+ t.moqWatch.backend.audio.muted.update((S) => !S);
700
+ }, q = (S) => {
701
+ t.moqWatch.jitter = S;
702
+ }, B = (S) => {
703
+ t.moqWatch.backend.video.source.target.update((N) => ({
704
+ ...N,
705
+ name: S
732
706
  }));
733
- }, S = ne(e.moqWatch.video.timestamp), V = ne(e.moqWatch.video.buffered), j = ne(e.moqWatch.audio.buffered), Q = {
734
- moqWatch: e.moqWatch,
735
- watchStatus: t,
736
- togglePlayback: x,
737
- isPlaying: o,
738
- setVolume: U,
739
- isMuted: s,
740
- currentVolume: i,
741
- toggleMuted: C,
742
- buffering: f,
743
- jitter: l,
744
- setJitter: R,
745
- availableRenditions: E,
746
- activeRendition: _,
747
- setActiveRendition: K,
748
- isStatsPanelVisible: P,
749
- setIsStatsPanelVisible: M,
750
- isFullscreen: m,
751
- toggleFullscreen: q,
752
- timestamp: S,
753
- videoBuffered: V,
754
- audioBuffered: j
755
- }, W = e.moqWatch, z = new De.Effect();
756
- z.effect((h) => {
757
- const k = h.get(W.connection.url), X = h.get(W.connection.status), Z = h.get(W.broadcast.status);
758
- k ? X === "disconnected" ? n("disconnected") : X === "connecting" ? n("connecting") : Z === "offline" ? n("offline") : Z === "loading" ? n("loading") : Z === "live" ? n("live") : X === "connected" && n("connected") : n("no-url");
759
- }), z.effect((h) => {
760
- const k = h.get(W.paused);
761
- r(!k);
762
- }), z.effect((h) => {
763
- const k = h.get(W.audio.volume);
764
- c(k * 100);
765
- }), z.effect((h) => {
766
- const k = h.get(W.audio.muted);
767
- a(k);
768
- }), z.effect((h) => {
769
- const k = h.get(W.video.stalled);
770
- d(k);
771
- }), z.effect((h) => {
772
- const k = h.get(W.jitter);
773
- R(k);
774
- }), z.effect((h) => {
775
- const X = h.get(W.video.source.catalog)?.renditions ?? {}, Z = Object.entries(X).map(([Ue, ve]) => ({
776
- name: Ue,
777
- width: ve.codedWidth,
778
- height: ve.codedHeight
707
+ }, y = D(t.moqWatch.backend.video.timestamp), O = D(t.moqWatch.backend.video.buffered), I = D(t.moqWatch.backend.audio.buffered), x = {
708
+ moqWatch: t.moqWatch,
709
+ watchStatus: e,
710
+ togglePlayback: P,
711
+ isPlaying: a,
712
+ setVolume: v,
713
+ isMuted: o,
714
+ currentVolume: s,
715
+ toggleMuted: m,
716
+ buffering: c,
717
+ jitter: f,
718
+ setJitter: q,
719
+ availableRenditions: d,
720
+ activeRendition: M,
721
+ setActiveRendition: B,
722
+ isStatsPanelVisible: $,
723
+ setIsStatsPanelVisible: _,
724
+ isFullscreen: h,
725
+ toggleFullscreen: b,
726
+ timestamp: y,
727
+ videoBuffered: O,
728
+ audioBuffered: I
729
+ }, C = t.moqWatch, k = new It.Effect();
730
+ k.run((S) => {
731
+ const N = S.get(C.connection.url), J = S.get(C.connection.status), Q = S.get(C.broadcast.status);
732
+ N ? J === "disconnected" ? n("disconnected") : J === "connecting" ? n("connecting") : Q === "offline" ? n("offline") : Q === "loading" ? n("loading") : Q === "live" ? n("live") : J === "connected" && n("connected") : n("no-url");
733
+ }), k.run((S) => {
734
+ const N = S.get(C.backend.paused);
735
+ r(!N);
736
+ }), k.run((S) => {
737
+ const N = S.get(C.backend.audio.volume);
738
+ i(N * 100);
739
+ }), k.run((S) => {
740
+ const J = S.get(C.backend.video.source.catalog)?.renditions ?? {}, Q = Object.entries(J).map(([Rt, vt]) => ({
741
+ name: Rt,
742
+ width: vt.codedWidth,
743
+ height: vt.codedHeight
779
744
  }));
780
- y(Z);
781
- }), z.effect((h) => {
782
- const k = h.get(W.video.source.track);
783
- p(k);
745
+ l(Q);
784
746
  });
785
- const Fe = () => {
786
- w(!!document.fullscreenElement);
747
+ const G = () => {
748
+ E(!!document.fullscreenElement);
787
749
  };
788
- return z.event(document, "fullscreenchange", Fe), pe(() => z.close()), u(ue.Provider, {
789
- value: Q,
750
+ return k.event(document, "fullscreenchange", G), ut(() => k.close()), u(st.Provider, {
751
+ value: x,
790
752
  get children() {
791
- return e.children;
753
+ return t.children;
792
754
  }
793
755
  });
794
756
  }
795
- function H() {
796
- const e = Ve(ue);
797
- if (!e)
757
+ function K() {
758
+ const t = qt(st);
759
+ if (!t)
798
760
  throw new Error("useWatchUIContext must be used within a WatchUIContextProvider");
799
- return e;
761
+ return t;
800
762
  }
801
- var Mt = /* @__PURE__ */ T("<div class=bufferingContainer><div class=bufferingSpinner>");
802
- function jt() {
803
- const e = H();
804
- return u(N, {
763
+ var Se = /* @__PURE__ */ W('<div class="watch-ui__buffering flex--center"><div class=watch-ui__buffering-spinner>');
764
+ function $e() {
765
+ const t = K();
766
+ return u(L, {
805
767
  get when() {
806
- return e.buffering();
768
+ return t.buffering();
807
769
  },
808
770
  get children() {
809
- return Mt();
771
+ return Se();
810
772
  }
811
773
  });
812
774
  }
813
- var qt = /* @__PURE__ */ T('<div class=buffer__container><div role=slider tabindex=0 aria-label="Buffer jitter"><div class=buffer__playhead></div><div class="buffer__track buffer__track--video"><span class=buffer__track-label>Video</span></div><div class="buffer__track buffer__track--audio"><span class=buffer__track-label>Audio</span></div><div class=buffer__target-area><div class=buffer__target-line><span class=buffer__target-label>'), $e = /* @__PURE__ */ T("<span class=buffer__overflow-label>s"), Ae = /* @__PURE__ */ T("<div class=buffer__range>");
814
- const Ee = 0, Pe = 100;
815
- function Vt(e) {
816
- const t = H(), n = () => e.max ?? 5e3, [o, r] = A(!1), s = (_, p, P) => {
817
- const M = _.start - p, m = _.end - p, w = Math.max(0, M), x = Math.min(m, n()), q = w / n() * 100, U = Math.max(0.5, (x - w) / n() * 100), C = m > n(), R = C ? He.Time.Milli.toSecond(m - w).toFixed(1) : null;
775
+ var Ae = /* @__PURE__ */ W('<div class=watch-ui__buffer><div role=slider tabindex=0 aria-label="Buffer jitter"><div class=watch-ui__buffer-playhead></div><div class="watch-ui__buffer-track watch-ui__buffer-track--video"><span class=watch-ui__buffer-track-label>Video</span></div><div class="watch-ui__buffer-track watch-ui__buffer-track--audio"><span class=watch-ui__buffer-track-label>Audio</span></div><div class=watch-ui__buffer-target-area><div class=watch-ui__buffer-target-line><span class=watch-ui__buffer-target-label>'), Ct = /* @__PURE__ */ W("<span class=watch-ui__buffer-overflow-label>s"), St = /* @__PURE__ */ W("<div class=watch-ui__buffer-range>");
776
+ const $t = 0, At = 100;
777
+ function Ee(t) {
778
+ const e = K(), n = () => t.max ?? 5e3, [a, r] = j(!1), o = (_, h, E) => {
779
+ const P = _.start - h, b = _.end - h, v = Math.max(0, P), m = Math.min(b, n()), q = v / n() * 100, B = Math.max(0.5, (m - v) / n() * 100), y = b > n(), O = y ? Nt.Time.Milli.toSecond(b - v).toFixed(1) : null;
818
780
  return {
819
- style: `left: ${q}%; width: ${U}%; background: ${P};`,
820
- isOverflow: C,
821
- overflowSec: R
781
+ style: `left: ${q}%; width: ${B}%; background: ${E};`,
782
+ isOverflow: y,
783
+ overflowSec: O
822
784
  };
823
- }, a = (_, p) => p ? "#f87171" : _ > 0 ? "#facc15" : "#4ade80", i = L(() => t.jitter() / n() * 100);
785
+ }, s = (_, h) => h ? "#f87171" : _ > 0 ? "#facc15" : "#4ade80", i = U(() => e.jitter() / n() * 100);
824
786
  let c;
825
787
  const f = 48, d = (_) => {
826
788
  if (!c) return;
827
- const p = c.getBoundingClientRect(), P = p.width - f, m = Math.max(0, Math.min(_ - p.left - f, P)) / P * n(), w = Math.round(m / Pe) * Pe, x = Math.max(Ee, Math.min(n(), w));
828
- t.setJitter(x);
789
+ const h = c.getBoundingClientRect(), E = h.width - f, b = Math.max(0, Math.min(_ - h.left - f, E)) / E * n(), v = Math.round(b / At) * At, m = Math.max($t, Math.min(n(), v));
790
+ e.setJitter(m);
829
791
  }, l = (_) => {
830
- r(!0), d(_.clientX), document.addEventListener("mousemove", E), document.addEventListener("mouseup", y);
831
- }, E = (_) => {
832
- o() && d(_.clientX);
833
- }, y = () => {
834
- r(!1), document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", y);
792
+ r(!0), d(_.clientX), document.addEventListener("mousemove", M), document.addEventListener("mouseup", $);
793
+ }, M = (_) => {
794
+ a() && d(_.clientX);
795
+ }, $ = () => {
796
+ r(!1), document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", $);
835
797
  };
836
- return pe(() => {
837
- document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", y);
798
+ return ut(() => {
799
+ document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", $);
838
800
  }), (() => {
839
- var _ = qt(), p = _.firstChild, P = p.firstChild, M = P.nextSibling;
840
- M.firstChild;
841
- var m = M.nextSibling;
842
- m.firstChild;
843
- var w = m.nextSibling, x = w.firstChild, q = x.firstChild;
844
- p.$$mousedown = l;
845
- var U = c;
846
- return typeof U == "function" ? ht(U, p) : c = p, oe(p, "aria-valuemin", Ee), b(M, u(_e, {
801
+ var _ = Ae(), h = _.firstChild, E = h.firstChild, P = E.nextSibling;
802
+ P.firstChild;
803
+ var b = P.nextSibling;
804
+ b.firstChild;
805
+ var v = b.nextSibling, m = v.firstChild, q = m.firstChild;
806
+ h.$$mousedown = l;
807
+ var B = c;
808
+ return typeof B == "function" ? ce(B, h) : c = h, et(h, "aria-valuemin", $t), p(P, u(gt, {
847
809
  get each() {
848
- return t.videoBuffered();
810
+ return e.videoBuffered();
849
811
  },
850
- children: (C, R) => {
851
- const K = () => {
852
- const S = t.timestamp();
853
- return S === void 0 ? null : s(C, S, a(R(), t.buffering()));
812
+ children: (y, O) => {
813
+ const I = () => {
814
+ const x = e.timestamp();
815
+ return x === void 0 ? null : o(y, x, s(O(), e.buffering()));
854
816
  };
855
- return u(N, {
817
+ return u(L, {
856
818
  get when() {
857
- return K();
819
+ return I();
858
820
  },
859
- children: (S) => (() => {
860
- var V = Ae();
861
- return b(V, u(N, {
821
+ children: (x) => (() => {
822
+ var C = St();
823
+ return p(C, u(L, {
862
824
  get when() {
863
- return S().isOverflow;
825
+ return x().isOverflow;
864
826
  },
865
827
  get children() {
866
- var j = $e(), Q = j.firstChild;
867
- return b(j, () => S().overflowSec, Q), j;
828
+ var k = Ct(), G = k.firstChild;
829
+ return p(k, () => x().overflowSec, G), k;
868
830
  }
869
- })), B((j) => Ce(V, S().style, j)), V;
831
+ })), T((k) => yt(C, x().style, k)), C;
870
832
  })()
871
833
  });
872
834
  }
873
- }), null), b(m, u(_e, {
835
+ }), null), p(b, u(gt, {
874
836
  get each() {
875
- return t.audioBuffered();
837
+ return e.audioBuffered();
876
838
  },
877
- children: (C, R) => {
878
- const K = () => {
879
- const S = t.timestamp();
880
- return S === void 0 ? null : s(C, S, a(R(), t.buffering()));
839
+ children: (y, O) => {
840
+ const I = () => {
841
+ const x = e.timestamp();
842
+ return x === void 0 ? null : o(y, x, s(O(), e.buffering()));
881
843
  };
882
- return u(N, {
844
+ return u(L, {
883
845
  get when() {
884
- return K();
846
+ return I();
885
847
  },
886
- children: (S) => (() => {
887
- var V = Ae();
888
- return b(V, u(N, {
848
+ children: (x) => (() => {
849
+ var C = St();
850
+ return p(C, u(L, {
889
851
  get when() {
890
- return S().isOverflow;
852
+ return x().isOverflow;
891
853
  },
892
854
  get children() {
893
- var j = $e(), Q = j.firstChild;
894
- return b(j, () => S().overflowSec, Q), j;
855
+ var k = Ct(), G = k.firstChild;
856
+ return p(k, () => x().overflowSec, G), k;
895
857
  }
896
- })), B((j) => Ce(V, S().style, j)), V;
858
+ })), T((k) => yt(C, x().style, k)), C;
897
859
  })()
898
860
  });
899
861
  }
900
- }), null), b(q, () => `${Math.round(t.jitter())}ms`), B((C) => {
901
- var R = `buffer__visualization ${o() ? "buffer__visualization--dragging" : ""}`, K = t.jitter(), S = n(), V = `${i()}%`;
902
- return R !== C.e && dt(p, C.e = R), K !== C.t && oe(p, "aria-valuenow", C.t = K), S !== C.a && oe(p, "aria-valuemax", C.a = S), V !== C.o && pt(x, "left", C.o = V), C;
862
+ }), null), p(q, () => `${Math.round(e.jitter())}ms`), T((y) => {
863
+ var O = `watch-ui__buffer-visualization ${a() ? "watch-ui__buffer-visualization--dragging" : ""}`, I = e.jitter(), x = n(), C = `${i()}%`;
864
+ return O !== y.e && pt(h, y.e = O), I !== y.t && et(h, "aria-valuenow", y.t = I), x !== y.a && et(h, "aria-valuemax", y.a = x), C !== y.o && le(m, "left", y.o = C), y;
903
865
  }, {
904
866
  e: void 0,
905
867
  t: void 0,
@@ -908,212 +870,215 @@ function Vt(e) {
908
870
  }), _;
909
871
  })();
910
872
  }
911
- ft(["mousedown"]);
912
- function Lt() {
913
- const e = H();
914
- return u(fe, {
873
+ se(["mousedown"]);
874
+ function Pe() {
875
+ const t = K();
876
+ return u(lt, {
915
877
  title: "Fullscreen",
916
878
  onClick: () => {
917
- e.toggleFullscreen();
879
+ t.toggleFullscreen();
918
880
  },
919
881
  get children() {
920
- return u(N, {
882
+ return u(L, {
921
883
  get when() {
922
- return e.isFullscreen();
884
+ return t.isFullscreen();
923
885
  },
924
886
  get fallback() {
925
- return u(I.FullscreenEnter, {});
887
+ return u(V.FullscreenEnter, {});
926
888
  },
927
889
  get children() {
928
- return u(I.FullscreenExit, {});
890
+ return u(V.FullscreenExit, {});
929
891
  }
930
892
  });
931
893
  }
932
894
  });
933
895
  }
934
- function Rt() {
935
- const e = H();
936
- return u(fe, {
896
+ function Me() {
897
+ const t = K();
898
+ return u(lt, {
937
899
  get title() {
938
- return e.isPlaying() ? "Pause" : "Play";
900
+ return t.isPlaying() ? "Pause" : "Play";
939
901
  },
940
902
  class: "button--playback",
941
903
  onClick: () => {
942
- e.togglePlayback();
904
+ t.togglePlayback();
943
905
  },
944
906
  get children() {
945
- return u(N, {
907
+ return u(L, {
946
908
  get when() {
947
- return e.isPlaying();
909
+ return t.isPlaying();
948
910
  },
949
911
  get fallback() {
950
- return u(I.Play, {});
912
+ return u(V.Play, {});
951
913
  },
952
914
  get children() {
953
- return u(I.Pause, {});
915
+ return u(V.Pause, {});
954
916
  }
955
917
  });
956
918
  }
957
919
  });
958
920
  }
959
- var Ot = /* @__PURE__ */ T("<div class=qualitySelectorContainer><label for=quality-select class=qualityLabel>Quality: </label><select id=quality-select class=qualitySelect><option value>Auto"), Tt = /* @__PURE__ */ T("<option>");
960
- function Wt() {
961
- const e = H(), t = (n) => {
962
- const o = n.currentTarget.value || void 0;
963
- e.setActiveRendition(o);
921
+ var qe = /* @__PURE__ */ W("<div class=watch-ui__quality-selector><label for=quality-select class=watch-ui__quality-label>Quality: </label><select id=quality-select class=watch-ui__quality-select><option value>Auto"), je = /* @__PURE__ */ W("<option>");
922
+ function Te() {
923
+ const t = K(), e = (n) => {
924
+ const a = n.currentTarget.value || void 0;
925
+ t.setActiveRendition(a);
964
926
  };
965
927
  return (() => {
966
- var n = Ot(), o = n.firstChild, r = o.nextSibling;
967
- return r.firstChild, r.addEventListener("change", t), b(r, u(_e, {
928
+ var n = qe(), a = n.firstChild, r = a.nextSibling;
929
+ return r.firstChild, r.addEventListener("change", e), p(r, u(gt, {
968
930
  get each() {
969
- return e.availableRenditions() ?? [];
931
+ return t.availableRenditions() ?? [];
970
932
  },
971
- children: (s) => (() => {
972
- var a = Tt();
973
- return b(a, () => s.name, null), b(a, (() => {
974
- var i = ct(() => !!(s.width && s.height));
975
- return () => i() ? ` (${s.width}x${s.height})` : "";
976
- })(), null), B(() => a.value = s.name), a;
933
+ children: (o) => (() => {
934
+ var s = je();
935
+ return p(s, () => o.name, null), p(s, (() => {
936
+ var i = oe(() => !!(o.width && o.height));
937
+ return () => i() ? ` (${o.width}x${o.height})` : "";
938
+ })(), null), T(() => s.value = o.name), s;
977
939
  })()
978
- }), null), B(() => r.value = e.activeRendition() ?? ""), n;
940
+ }), null), T(() => r.value = t.activeRendition() ?? ""), n;
979
941
  })();
980
942
  }
981
- function zt() {
982
- const e = H();
983
- return u(fe, {
943
+ function We() {
944
+ const t = K();
945
+ return u(lt, {
984
946
  get title() {
985
- return e.isStatsPanelVisible() ? "Hide stats" : "Show stats";
947
+ return t.isStatsPanelVisible() ? "Hide stats" : "Show stats";
986
948
  },
987
949
  onClick: () => {
988
- e.setIsStatsPanelVisible(!e.isStatsPanelVisible());
950
+ t.setIsStatsPanelVisible(!t.isStatsPanelVisible());
989
951
  },
990
952
  get children() {
991
- return u(I.Stats, {});
953
+ return u(V.Stats, {});
992
954
  }
993
955
  });
994
956
  }
995
- var Bt = /* @__PURE__ */ T("<div class=volumeSliderContainer><input type=range min=0 max=100><span class=volumeLabel>");
996
- const It = (e, t) => t || e === 0 ? u(I.Mute, {}) : e > 0 && e <= 33 ? u(I.VolumeLow, {}) : e > 33 && e <= 66 ? u(I.VolumeMedium, {}) : u(I.VolumeHigh, {});
997
- function Nt() {
998
- const [e, t] = A(0), n = H(), o = (r) => {
999
- const s = r.currentTarget, a = parseFloat(s.value);
1000
- n.setVolume(a);
957
+ var Oe = /* @__PURE__ */ W('<div class="watch-ui__volume-slider flex--center"><input type=range min=0 max=100><span class=watch-ui__volume-label>');
958
+ const Ve = (t, e) => e || t === 0 ? u(V.Mute, {}) : t > 0 && t <= 33 ? u(V.VolumeLow, {}) : t > 33 && t <= 66 ? u(V.VolumeMedium, {}) : u(V.VolumeHigh, {});
959
+ function Le() {
960
+ const [t, e] = j(0), n = K(), a = (r) => {
961
+ const o = r.currentTarget, s = parseFloat(o.value);
962
+ n.setVolume(s);
1001
963
  };
1002
- return qe(() => {
964
+ return Mt(() => {
1003
965
  const r = n.currentVolume() || 0;
1004
- t(Math.round(r));
966
+ e(Math.round(r));
1005
967
  }), (() => {
1006
- var r = Bt(), s = r.firstChild, a = s.nextSibling;
1007
- return b(r, u(fe, {
968
+ var r = Oe(), o = r.firstChild, s = o.nextSibling;
969
+ return p(r, u(lt, {
1008
970
  get title() {
1009
971
  return n.isMuted() ? "Unmute" : "Mute";
1010
972
  },
1011
973
  onClick: () => n.toggleMuted(),
1012
974
  get children() {
1013
- return It(n.currentVolume(), n.isMuted());
975
+ return Ve(n.currentVolume(), n.isMuted());
1014
976
  }
1015
- }), s), s.addEventListener("change", o), b(a, e), B(() => s.value = n.currentVolume()), r;
977
+ }), o), o.addEventListener("change", a), p(s, t), T(() => o.value = n.currentVolume()), r;
1016
978
  })();
1017
979
  }
1018
- var Ft = /* @__PURE__ */ T("<output>");
1019
- function Ut() {
1020
- const e = H();
980
+ var ze = /* @__PURE__ */ W('<div class="watch-ui__status-indicator flex--center"><span></span><span>');
981
+ const Re = {
982
+ "no-url": {
983
+ variant: "error",
984
+ text: "No URL"
985
+ },
986
+ disconnected: {
987
+ variant: "error",
988
+ text: "Disconnected"
989
+ },
990
+ connecting: {
991
+ variant: "connecting",
992
+ text: "Connecting..."
993
+ },
994
+ offline: {
995
+ variant: "error",
996
+ text: "Offline"
997
+ },
998
+ loading: {
999
+ variant: "loading",
1000
+ text: "Loading..."
1001
+ },
1002
+ live: {
1003
+ variant: "live",
1004
+ text: "Live"
1005
+ },
1006
+ connected: {
1007
+ variant: "connected",
1008
+ text: "Connected"
1009
+ }
1010
+ }, Be = {
1011
+ variant: "error",
1012
+ text: "Unknown"
1013
+ };
1014
+ function Ie() {
1015
+ const t = K(), e = () => {
1016
+ const n = t.watchStatus();
1017
+ return Re[n] || Be;
1018
+ };
1021
1019
  return (() => {
1022
- var t = Ft();
1023
- return b(t, u(lt, {
1024
- get children() {
1025
- return [u(G, {
1026
- get when() {
1027
- return e.watchStatus() === "no-url";
1028
- },
1029
- children: "🔴 No URL"
1030
- }), u(G, {
1031
- get when() {
1032
- return e.watchStatus() === "disconnected";
1033
- },
1034
- children: "🔴 Disconnected"
1035
- }), u(G, {
1036
- get when() {
1037
- return e.watchStatus() === "connecting";
1038
- },
1039
- children: "🟡 Connecting..."
1040
- }), u(G, {
1041
- get when() {
1042
- return e.watchStatus() === "offline";
1043
- },
1044
- children: "🔴 Offline"
1045
- }), u(G, {
1046
- get when() {
1047
- return e.watchStatus() === "loading";
1048
- },
1049
- children: "🟡 Loading..."
1050
- }), u(G, {
1051
- get when() {
1052
- return e.watchStatus() === "live";
1053
- },
1054
- children: "🟢 Live"
1055
- }), u(G, {
1056
- get when() {
1057
- return e.watchStatus() === "connected";
1058
- },
1059
- children: "🟢 Connected"
1060
- })];
1061
- }
1062
- })), t;
1020
+ var n = ze(), a = n.firstChild, r = a.nextSibling;
1021
+ return p(r, () => e().text), T((o) => {
1022
+ var s = `watch-ui__status-indicator-dot watch-ui__status-indicator-dot--${e().variant}`, i = `watch-ui__status-indicator-text watch-ui__status-indicator-text--${e().variant}`;
1023
+ return s !== o.e && pt(a, o.e = s), i !== o.t && pt(r, o.t = i), o;
1024
+ }, {
1025
+ e: void 0,
1026
+ t: void 0
1027
+ }), n;
1063
1028
  })();
1064
1029
  }
1065
- var Kt = /* @__PURE__ */ T('<div class=watchControlsContainer><div class="playbackControlsRow flex--align-center"></div><div class=latencyControlsRow>');
1066
- function Dt() {
1030
+ var Ne = /* @__PURE__ */ W('<div class=watch-ui__controls><div class="watch-ui__playback-controls flex--align-center"></div><div class=watch-ui__latency-controls>');
1031
+ function Ue() {
1067
1032
  return (() => {
1068
- var e = Kt(), t = e.firstChild, n = t.nextSibling;
1069
- return b(t, u(Rt, {}), null), b(t, u(Nt, {}), null), b(t, u(Ut, {}), null), b(t, u(zt, {}), null), b(t, u(Lt, {}), null), b(n, u(Vt, {}), null), b(n, u(Wt, {}), null), e;
1033
+ var t = Ne(), e = t.firstChild, n = e.nextSibling;
1034
+ return p(e, u(Me, {}), null), p(e, u(Le, {}), null), p(e, u(Ie, {}), null), p(e, u(We, {}), null), p(e, u(Pe, {}), null), p(n, u(Ee, {}), null), p(n, u(Te, {}), null), t;
1070
1035
  })();
1071
1036
  }
1072
- const Ht = ':host{--color-white: #ffffff;--color-white-alpha-05: rgba(255, 255, 255, .05);--color-white-alpha-10: rgba(255, 255, 255, .1);--color-white-alpha-20: rgba(255, 255, 255, .2);--color-white-alpha-25: rgba(255, 255, 255, .25);--color-white-alpha-30: rgba(255, 255, 255, .3);--color-white-alpha-70: rgba(255, 255, 255, .7);--color-white-alpha-90: rgba(255, 255, 255, .9);--color-gray-100: #9ca3af;--color-blue-400: #00dfff;--color-blue-500: #52a1ff;--color-blue-900: #1b3243;--color-purple-400: #a855f7;--color-purple-500: #c27bff;--color-purple-900: #31144a;--color-green-400: #65ee2e;--color-green-900: #3d4928;--color-yellow-400: #facc15;--color-orange-300: rgb(253, 186, 116);--color-orange-400: #ff9900;--color-orange-500: #f97316;--color-orange-900: #4d301b;--color-amber-600: #d97706;--color-amber-600-alpha-20: rgba(217, 119, 6, .2);--color-amber-600-alpha-30: rgba(217, 119, 6, .3);--color-orange-400-alpha-20: rgba(255, 153, 0, .2);--color-orange-500-alpha-30: rgba(249, 115, 22, .3);--color-orange-500-alpha-40: rgba(249, 115, 22, .4);--color-orange-500-alpha-50: rgba(249, 115, 22, .5);--color-orange-500-alpha-60: rgba(249, 115, 22, .6);--color-orange-500-alpha-80: rgba(249, 115, 22, .8);--color-red-300: rgb(252, 165, 165);--color-red-400-alpha-25: rgba(248, 113, 113, .25);--color-red-500-alpha-25: rgba(239, 68, 68, .25);--color-red-500-alpha-45: rgba(239, 68, 68, .45);--color-red-500-alpha-60: rgba(239, 68, 68, .6);--color-red-600-alpha-25: rgba(220, 38, 38, .25);--color-red-900-alpha-35: rgba(127, 29, 29, .35);--color-red: #e60000;--color-black-alpha-8: rgba(0, 0, 0, .08);--color-black-alpha-10: rgba(0, 0, 0, .1);--color-black-alpha-60: rgba(0, 0, 0, .6);--color-black-alpha-85: rgba(0, 0, 0, .85);--color-black: #000000;--spacing-1: .0625rem;--spacing-2: .125rem;--spacing-4: .25rem;--spacing-8: .5rem;--spacing-12: .75rem;--spacing-16: 1rem;--spacing-24: 1.5rem;--spacing-48: 3rem;--border-radius-sm: .5rem;--border-radius-md: .75rem;--border-radius-lg: 1rem}:is(.flex--center){display:flex;justify-content:center;align-items:center}:is(.flex--align-center){align-items:center}:is(.flex--space-between){justify-content:space-between}.button{color:var(--color-white);cursor:pointer;background-color:var(--color-white-alpha-10);border:var(--spacing-1) solid var(--color-white-alpha-20);border-radius:50%;width:2.25rem;height:2.25rem;transform-origin:center;transition:transform .1s cubic-bezier(.4,0,.2,1)}.button:hover:not(:disabled){transform:scale(1.02);color:var(--color-white);background-color:var(--color-white-alpha-20);box-shadow:0 var(--spacing-2) var(--spacing-8) var(--color-black-alpha-10)}.button:active:not(:disabled){transform:scale(.98);box-shadow:0 var(--spacing-1) var(--spacing-4) var(--color-black-alpha-8)}.button:disabled{opacity:.5;cursor:default;color:var(--color-gray-100)}.stats{display:flex;align-items:center;justify-content:center;position:absolute;inset:0;pointer-events:none;z-index:2;width:100%;height:inherit;container-type:inline-size}.stats .stats__panel{position:absolute;display:flex;align-items:flex-start;justify-content:center;flex-direction:row;flex-wrap:wrap;gap:var(--spacing-12);max-width:240px;width:100%;background-color:var(--color-black-alpha-85);border:1px solid var(--color-white-alpha-25);border-radius:8px;padding:var(--spacing-12);pointer-events:auto;top:8px}@container (width > 480px) and (width <= 768px){.stats .stats__panel{max-width:360px;padding:var(--spacing-24)}}@container (width > 768px){.stats .stats__panel{max-width:600px;padding:var(--spacing-24)}}.stats .stats__panel .stats__item{display:flex;align-items:flex-start;justify-content:flex-start;flex-direction:row;height:auto;column-gap:var(--spacing-8);flex-basis:calc(50% - var(--spacing-12));flex-grow:1;flex-shrink:1}@container (width > 480px){.stats .stats__panel .stats__item{flex-basis:calc(25% - var(--spacing-12))}}.stats .stats__panel .stats__item .stats__icon-wrapper{display:none;padding:var(--spacing-8);border-radius:8px;width:fit-content;height:fit-content;flex-shrink:0}@container (width > 480px){.stats .stats__panel .stats__item .stats__icon-wrapper{width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-direction:row}}.stats .stats__panel .stats__item .stats__icon-wrapper svg{width:100%;height:100%}.stats .stats__panel .stats__item.stats__item--network .stats__icon-wrapper{background-color:var(--color-blue-900)}.stats .stats__panel .stats__item.stats__item--network,.stats .stats__panel .stats__item.stats__item--network .stats__item-data{color:var(--color-blue-400)}.stats .stats__panel .stats__item.stats__item--video .stats__icon-wrapper{background-color:var(--color-purple-900)}.stats .stats__panel .stats__item.stats__item--video,.stats .stats__panel .stats__item.stats__item--video .stats__item-data{color:var(--color-purple-400)}.stats .stats__panel .stats__item.stats__item--audio .stats__icon-wrapper{background-color:var(--color-green-900)}.stats .stats__panel .stats__item.stats__item--audio,.stats .stats__panel .stats__item.stats__item--audio .stats__item-data{color:var(--color-green-400)}.stats .stats__panel .stats__item.stats__item--buffer .stats__icon-wrapper{background-color:var(--color-orange-900)}.stats .stats__panel .stats__item.stats__item--buffer,.stats .stats__panel .stats__item.stats__item--buffer .stats__item-data{color:var(--color-orange-400)}.stats .stats__panel .stats__item .stats__item-detail{display:flex;align-items:flex-start;justify-content:space-evenly;flex-direction:column;gap:var(--spacing-4)}.stats .stats__panel .stats__item .stats__item-detail .stats__item-title{font-size:12px;font-weight:500;text-transform:capitalize;color:var(--color-gray-100);font-family:Segoe UI,Roboto,sans-serif;letter-spacing:1px;line-height:12px}.stats .stats__panel .stats__item .stats__item-detail .stats__item-data{font-size:16px;font-weight:700;font-family:Segoe UI,Roboto,sans-serif;white-space:pre-wrap;line-height:1.5}:root{--buffer-green: #4ade80;--buffer-yellow: #facc15;--buffer-red: #f87171}.watchVideoContainer{display:block;position:relative;width:100%;height:auto;border-radius:4px;margin:0 auto;pointer-events:none}.watchControlsContainer{display:flex;flex-direction:column}.button.button--playback{width:3rem;height:3rem;background:linear-gradient(to bottom right,var(--color-orange-400),var(--color-orange-500),var(--color-amber-600));box-shadow:0 0 var(--spacing-16) var(--color-orange-500-alpha-60);transition:box-shadow .15s cubic-bezier(.4,0,.2,1);position:relative;overflow:hidden}.button.button--playback:hover:not(:disabled){box-shadow:0 0 var(--spacing-24) var(--color-orange-500-alpha-80);transform:scale(1.02)}.button.button--playback:active:not(:disabled){transform:scale(.98)}.button.button--playback:before{content:"";position:absolute;inset:0;background:linear-gradient(to bottom right,var(--color-white-alpha-30),transparent);opacity:0;transition:opacity .15s cubic-bezier(.4,0,.2,1);pointer-events:none}.button.button--playback:hover:before{opacity:1}.button.button--playback:after{content:"";position:absolute;inset:0;background-color:var(--color-white-alpha-20);border-radius:50%;filter:blur(var(--spacing-24));pointer-events:none}.volumeSliderContainer{display:flex;align-items:center;gap:.25rem}.volumeLabel{display:inline-block;width:2em;text-align:right}@keyframes buffer-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.bufferingContainer{position:absolute;display:flex;justify-content:center;align-items:center;width:100%;height:100%;top:0;left:0;z-index:1;background-color:#0006;backdrop-filter:blur(2px);pointer-events:auto}.bufferingSpinner{width:40px;height:40px;border:4px solid rgba(255,255,255,.2);border-top:4px solid #fff;border-radius:50%;animation:buffer-spin 1s linear infinite}.latencySliderContainer{display:flex;align-items:center;gap:8px;padding:8px 12px;background:transparent;border-radius:8px;margin:8px 0}.latencyLabel{font-size:20px;font-weight:500;color:#fff;white-space:nowrap}.latencySlider{flex:1 1 0%;height:6px;border-radius:3px;background:transparent;cursor:pointer}.latencyValueDisplay{font-size:20px;min-width:60px;text-align:right;color:#fff}.playbackControlsRow{display:flex;place-content:center space-around;gap:8px;padding:.5rem 0}.lantencyControlsRow,.qualitySelectorContainer{display:flex;align-items:center;gap:8px;padding:8px 12px;background:transparent;border-radius:8px;margin:8px 0}.qualityLabel{font-size:20px;font-weight:500;color:#fff;white-space:nowrap}.qualitySelect{flex:0 1 auto;font-size:16px;padding:4px 8px;border-radius:4px;background:#ffffff1a;color:#fff;border:1px solid rgba(255,255,255,.2);cursor:pointer;transition:background .2s ease}.qualitySelect:hover{background:#ffffff26}.qualitySelect:focus{outline:2px solid rgba(255,255,255,.3);outline-offset:2px}.qualitySelect option{background:#1a1a1a;color:#fff}.buffer__container{display:flex;flex-direction:column;gap:8px;padding:8px 12px}.buffer__visualization{position:relative;width:100%;height:52px;background:#ffffff1a;border-radius:4px;cursor:pointer;user-select:none;padding-left:48px;box-sizing:border-box}.buffer__playhead{position:absolute;left:48px;top:0;bottom:0;width:2px;background:#fff;z-index:3}.buffer__track{position:absolute;left:48px;right:0;height:20px;display:flex;align-items:center}.buffer__track--video{top:4px}.buffer__track--audio{top:28px}.buffer__track-label{position:absolute;left:-46px;width:40px;font-size:10px;color:#fff9;text-align:right;padding-right:4px;pointer-events:none;box-sizing:border-box}.buffer__range{position:absolute;top:2px;height:calc(100% - 4px);border-radius:2px;min-width:2px;opacity:.85;display:flex;align-items:center;justify-content:flex-end;overflow:hidden}.buffer__overflow-label{font-size:9px;color:#000000b3;padding-right:4px;font-weight:500}.buffer__target-area{position:absolute;inset:0 0 0 48px;pointer-events:none}.buffer__target-line{position:absolute;top:0;bottom:0;width:3px;background:var(--color-orange-400, #fb923c);z-index:2;cursor:ew-resize;border-radius:1px;pointer-events:auto}.buffer__target-label{position:absolute;bottom:100%;left:50%;transform:translate(-50%);font-size:11px;font-weight:500;color:var(--color-orange-400, #fb923c);white-space:nowrap;margin-bottom:2px;opacity:0;transition:opacity .15s ease;pointer-events:none}.buffer__visualization:hover .buffer__target-label,.buffer__visualization--dragging .buffer__target-label{opacity:1}';
1073
- var Gt = /* @__PURE__ */ T("<style>"), Jt = /* @__PURE__ */ T("<div class=watchVideoContainer><slot>");
1074
- function Qt(e) {
1075
- return u(Pt, {
1037
+ const Fe = ':host{--color-white: #ffffff;--color-white-alpha-05: rgba(255, 255, 255, .05);--color-white-alpha-10: rgba(255, 255, 255, .1);--color-white-alpha-15: rgba(255, 255, 255, .15);--color-white-alpha-20: rgba(255, 255, 255, .2);--color-white-alpha-25: rgba(255, 255, 255, .25);--color-white-alpha-30: rgba(255, 255, 255, .3);--color-white-alpha-70: rgba(255, 255, 255, .7);--color-white-alpha-90: rgba(255, 255, 255, .9);--color-gray-100: #9ca3af;--color-gray-950: #1a1a1a;--color-blue-400: #00dfff;--color-blue-500: #52a1ff;--color-blue-900: #1b3243;--color-purple-400: #a855f7;--color-purple-500: #c27bff;--color-purple-900: #31144a;--color-green-400: #65ee2e;--color-green-900: #3d4928;--color-yellow-400: #facc15;--color-orange-300: rgb(253, 186, 116);--color-orange-400: #ff9900;--color-orange-450: #fb923c;--color-orange-500: #f97316;--color-orange-900: #4d301b;--color-amber-600: #d97706;--color-amber-600-alpha-20: rgba(217, 119, 6, .2);--color-amber-600-alpha-30: rgba(217, 119, 6, .3);--color-orange-400-alpha-20: rgba(255, 153, 0, .2);--color-orange-500-alpha-30: rgba(249, 115, 22, .3);--color-orange-500-alpha-40: rgba(249, 115, 22, .4);--color-orange-500-alpha-50: rgba(249, 115, 22, .5);--color-orange-500-alpha-60: rgba(249, 115, 22, .6);--color-orange-500-alpha-80: rgba(249, 115, 22, .8);--color-red-300: rgb(252, 165, 165);--color-red-400-alpha-25: rgba(248, 113, 113, .25);--color-red-500-alpha-25: rgba(239, 68, 68, .25);--color-red-500-alpha-45: rgba(239, 68, 68, .45);--color-red-500-alpha-60: rgba(239, 68, 68, .6);--color-red-600-alpha-25: rgba(220, 38, 38, .25);--color-red-900-alpha-35: rgba(127, 29, 29, .35);--color-red: #e60000;--color-black-alpha-8: rgba(0, 0, 0, .08);--color-black-alpha-10: rgba(0, 0, 0, .1);--color-black-alpha-60: rgba(0, 0, 0, .6);--color-black-alpha-70: rgba(0, 0, 0, .7);--color-black-alpha-85: rgba(0, 0, 0, .85);--color-black: #000000;--spacing-1: .0625rem;--spacing-2: .125rem;--spacing-4: .25rem;--spacing-8: .5rem;--spacing-12: .75rem;--spacing-16: 1rem;--spacing-24: 1.5rem;--spacing-32: 2rem;--spacing-48: 3rem;--border-radius-sm: .5rem;--border-radius-md: .75rem;--border-radius-lg: 1rem}:is(.flex--center){display:flex;justify-content:center;align-items:center}:is(.flex--align-center){align-items:center}:is(.flex--space-between){justify-content:space-between}.button{color:var(--color-white);cursor:pointer;background-color:var(--color-white-alpha-10);border:var(--spacing-1) solid var(--color-white-alpha-20);border-radius:50%;width:2.25rem;height:2.25rem;transform-origin:center;transition:transform .1s cubic-bezier(.4,0,.2,1)}.button:hover:not(:disabled){transform:scale(1.02);color:var(--color-white);background-color:var(--color-white-alpha-20);box-shadow:0 var(--spacing-2) var(--spacing-8) var(--color-black-alpha-10)}.button:active:not(:disabled){transform:scale(.98);box-shadow:0 var(--spacing-1) var(--spacing-4) var(--color-black-alpha-8)}.button:disabled{opacity:.5;cursor:default;color:var(--color-gray-100)}.stats{display:flex;align-items:center;justify-content:center;position:absolute;inset:0;pointer-events:none;z-index:2;width:100%;height:inherit;container-type:inline-size}.stats .stats__panel{position:absolute;display:flex;align-items:flex-start;justify-content:center;flex-direction:row;flex-wrap:wrap;gap:var(--spacing-12);max-width:240px;width:100%;background-color:var(--color-black-alpha-85);border:1px solid var(--color-white-alpha-25);border-radius:8px;padding:var(--spacing-12);pointer-events:auto;top:8px}@container (width > 480px) and (width <= 768px){.stats .stats__panel{max-width:360px;padding:var(--spacing-24)}}@container (width > 768px){.stats .stats__panel{max-width:600px;padding:var(--spacing-24)}}.stats .stats__panel .stats__item{display:flex;align-items:flex-start;justify-content:flex-start;flex-direction:row;height:auto;column-gap:var(--spacing-8);flex-basis:calc(50% - var(--spacing-12));flex-grow:1;flex-shrink:1}@container (width > 480px){.stats .stats__panel .stats__item{flex-basis:calc(25% - var(--spacing-12))}}.stats .stats__panel .stats__item .stats__icon-wrapper{display:none;padding:var(--spacing-8);border-radius:8px;width:fit-content;height:fit-content;flex-shrink:0}@container (width > 480px){.stats .stats__panel .stats__item .stats__icon-wrapper{width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-direction:row}}.stats .stats__panel .stats__item .stats__icon-wrapper svg{width:100%;height:100%}.stats .stats__panel .stats__item.stats__item--network .stats__icon-wrapper{background-color:var(--color-blue-900)}.stats .stats__panel .stats__item.stats__item--network,.stats .stats__panel .stats__item.stats__item--network .stats__item-data{color:var(--color-blue-400)}.stats .stats__panel .stats__item.stats__item--video .stats__icon-wrapper{background-color:var(--color-purple-900)}.stats .stats__panel .stats__item.stats__item--video,.stats .stats__panel .stats__item.stats__item--video .stats__item-data{color:var(--color-purple-400)}.stats .stats__panel .stats__item.stats__item--audio .stats__icon-wrapper{background-color:var(--color-green-900)}.stats .stats__panel .stats__item.stats__item--audio,.stats .stats__panel .stats__item.stats__item--audio .stats__item-data{color:var(--color-green-400)}.stats .stats__panel .stats__item.stats__item--buffer .stats__icon-wrapper{background-color:var(--color-orange-900)}.stats .stats__panel .stats__item.stats__item--buffer,.stats .stats__panel .stats__item.stats__item--buffer .stats__item-data{color:var(--color-orange-400)}.stats .stats__panel .stats__item .stats__item-detail{display:flex;align-items:flex-start;justify-content:space-evenly;flex-direction:column;gap:var(--spacing-4)}.stats .stats__panel .stats__item .stats__item-detail .stats__item-title{font-size:12px;font-weight:500;text-transform:capitalize;color:var(--color-gray-100);font-family:Segoe UI,Roboto,sans-serif;letter-spacing:1px;line-height:12px}.stats .stats__panel .stats__item .stats__item-detail .stats__item-data{font-size:16px;font-weight:700;font-family:Segoe UI,Roboto,sans-serif;white-space:pre-wrap;line-height:1.5}.watch-ui__video-container{display:block;position:relative;width:100%;height:auto;border-radius:var(--spacing-4);margin:0 auto;pointer-events:none}.watch-ui__controls{display:flex;flex-direction:column;gap:var(--spacing-24)}.button.button--playback{width:3rem;height:3rem;background:linear-gradient(to bottom right,var(--color-orange-400),var(--color-orange-500),var(--color-amber-600));box-shadow:0 0 var(--spacing-16) var(--color-orange-500-alpha-60);transition:box-shadow .15s cubic-bezier(.4,0,.2,1);position:relative;overflow:hidden}.button.button--playback:hover:not(:disabled){box-shadow:0 0 var(--spacing-24) var(--color-orange-500-alpha-80);transform:scale(1.02)}.button.button--playback:active:not(:disabled){transform:scale(.98)}.button.button--playback:before{content:"";position:absolute;inset:0;background:linear-gradient(to bottom right,var(--color-white-alpha-30),transparent);opacity:0;transition:opacity .15s cubic-bezier(.4,0,.2,1);pointer-events:none}.button.button--playback:hover:before{opacity:1}.button.button--playback:after{content:"";position:absolute;inset:0;background-color:var(--color-white-alpha-20);border-radius:50%;filter:blur(var(--spacing-24));pointer-events:none}.watch-ui__playback-controls{display:flex;place-content:center space-around;gap:var(--spacing-8);padding:var(--spacing-8) 0}.watch-ui__latency-controls{display:flex;flex-direction:column;gap:var(--spacing-16)}.watch-ui__volume-slider{gap:var(--spacing-4)}.watch-ui__volume-label{width:var(--spacing-16);text-align:right}.watch-ui__quality-selector{display:flex;align-items:center;gap:var(--spacing-8);background:transparent;border-radius:var(--spacing-8)}.watch-ui__quality-label{font-size:1.25rem;font-weight:500;color:var(--color-white);white-space:nowrap}.watch-ui__quality-select{flex:0 1 auto;font-size:1rem;padding:var(--spacing-8);border-radius:var(--spacing-4);background:var(--color-white-alpha-10);color:var(--color-white);border:var(--spacing-1) solid var(--color-white-alpha-20);cursor:pointer;transition:background .2s ease}.watch-ui__quality-select:hover{background:var(--color-white-alpha-15)}.watch-ui__quality-select:focus{outline:var(--spacing-2) solid var(--color-white-alpha-30);outline-offset:var(--spacing-2)}.watch-ui__quality-select option{background:var(--color-gray-950);color:var(--color-white)}.watch-ui__buffer{width:100%}.watch-ui__buffer-visualization{position:relative;width:100%;height:3.75rem;background:var(--color-white-alpha-10);border-radius:var(--spacing-4);cursor:pointer;user-select:none;padding-left:var(--spacing-48);box-sizing:border-box}.watch-ui__buffer-playhead{position:absolute;left:var(--spacing-48);top:0;bottom:0;width:var(--spacing-2);background:var(--color-white);z-index:3}.watch-ui__buffer-track{display:flex;align-items:center;position:absolute;left:var(--spacing-48);right:0;height:var(--spacing-24)}.watch-ui__buffer-track--video{top:var(--spacing-4)}.watch-ui__buffer-track--audio{top:var(--spacing-32)}.watch-ui__buffer-track-label{position:absolute;left:-2.875rem;width:2.5rem;font-size:.625rem;color:var(--color-white-alpha-70);text-align:right;padding-right:var(--spacing-4);pointer-events:none;box-sizing:border-box}.watch-ui__buffer-range{position:absolute;display:flex;align-items:center;justify-content:flex-end;top:var(--spacing-2);height:calc(100% - var(--spacing-4));border-radius:var(--spacing-2);min-width:var(--spacing-2);opacity:.85;overflow:hidden}.watch-ui__buffer-overflow-label{font-size:.5625rem;font-weight:500;color:var(--color-black-alpha-70);padding-right:var(--spacing-4)}.watch-ui__buffer-target-area{position:absolute;top:0;bottom:0;left:var(--spacing-48);right:0;pointer-events:none}.watch-ui__buffer-target-line{position:absolute;top:0;bottom:0;width:.1875rem;background:var(--color-orange-400, var(--color-orange-450));z-index:2;cursor:ew-resize;border-radius:var(--spacing-1);pointer-events:auto}.watch-ui__buffer-target-label{position:absolute;bottom:100%;left:50%;transform:translate(-50%);font-size:.6875rem;font-weight:500;color:var(--color-orange-400, var(--color-orange-450));white-space:nowrap;margin-bottom:var(--spacing-2);opacity:0;transition:opacity .15s ease;pointer-events:none}.watch-ui__buffer-visualization:hover .watch-ui__buffer-target-label,.watch-ui__buffer-visualization--dragging .watch-ui__buffer-target-label{opacity:1}.watch-ui__buffering{position:absolute;width:100%;height:100%;top:0;left:0;z-index:1;background-color:var(--color-black-alpha-40);backdrop-filter:blur(var(--spacing-2));pointer-events:auto}.watch-ui__buffering-spinner{width:2.5rem;height:2.5rem;border:var(--spacing-4) solid var(--color-white-alpha-20);border-top:var(--spacing-4) solid var(--color-white);border-radius:50%;animation:buffer-spin 1s linear infinite}@keyframes buffer-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.watch-ui__status-indicator{gap:var(--spacing-12);backdrop-filter:blur(var(--spacing-16))}.watch-ui__status-indicator-dot{position:relative;width:.75rem;height:.75rem;border-radius:50%;flex-shrink:0;z-index:1}.watch-ui__status-indicator-dot:after{content:"";position:absolute;inset:0;border-radius:50%;background:currentcolor;transform:scale(1);opacity:.5;animation:status-pulse 1.5s ease-out infinite;z-index:-1}.watch-ui__status-indicator-dot:after{display:none}.watch-ui__status-indicator-dot--live:after,.watch-ui__status-indicator-dot--connected:after,.watch-ui__status-indicator-dot--loading:after,.watch-ui__status-indicator-dot--connecting:after{display:block}.watch-ui__status-indicator-dot--error{background:var(--color-gray-100);color:var(--color-gray-100)}.watch-ui__status-indicator-text--error{color:var(--color-gray-100)}.watch-ui__status-indicator-dot--connecting{background:var(--color-yellow-400);color:var(--color-yellow-400)}.watch-ui__status-indicator-text--connecting{color:var(--color-yellow-400)}.watch-ui__status-indicator-dot--loading{background:var(--color-yellow-400);color:var(--color-yellow-400)}.watch-ui__status-indicator-text--loading{color:var(--color-yellow-400)}.watch-ui__status-indicator-dot--live{background:var(--color-green-400);color:var(--color-green-400)}.watch-ui__status-indicator-text--live{color:var(--color-green-400)}.watch-ui__status-indicator-dot--connected{background:var(--color-blue-500);color:var(--color-blue-500)}.watch-ui__status-indicator-text--connected{color:var(--color-blue-500)}.watch-ui__status-indicator-text{font-size:1rem;letter-spacing:.1rem}@keyframes status-pulse{0%{transform:scale(1);opacity:.5}70%{opacity:.25}to{transform:scale(2.5);opacity:0}}';
1038
+ var Ke = /* @__PURE__ */ W("<style>"), De = /* @__PURE__ */ W("<div class=watch-ui__video-container><slot>");
1039
+ function He(t) {
1040
+ return u(Ce, {
1076
1041
  get moqWatch() {
1077
- return e.watch;
1042
+ return t.watch;
1078
1043
  },
1079
1044
  get children() {
1080
1045
  return [(() => {
1081
- var t = Gt();
1082
- return b(t, Ht), t;
1046
+ var e = Ke();
1047
+ return p(e, Fe), e;
1083
1048
  })(), (() => {
1084
- var t = Jt(), n = t.firstChild;
1085
- return n._$owner = Ye(), b(t, () => {
1086
- const o = Ve(ue);
1087
- return o ? u(N, {
1049
+ var e = De(), n = e.firstChild;
1050
+ return n._$owner = Gt(), p(e, () => {
1051
+ const a = qt(st);
1052
+ return a ? u(L, {
1088
1053
  get when() {
1089
- return o.isStatsPanelVisible();
1054
+ return a.isStatsPanelVisible();
1090
1055
  },
1091
1056
  get children() {
1092
- return u(Ke, {
1093
- context: ue,
1094
- getElement: (r) => r?.moqWatch
1057
+ return u(Bt, {
1058
+ context: st,
1059
+ getElement: (r) => r?.moqWatch.backend
1095
1060
  });
1096
1061
  }
1097
1062
  }) : null;
1098
- }, null), b(t, u(jt, {}), null), t;
1099
- })(), u(Dt, {})];
1063
+ }, null), p(e, u($e, {}), null), e;
1064
+ })(), u(Ue, {})];
1100
1065
  }
1101
1066
  });
1102
1067
  }
1103
- Et("moq-watch-ui", (e, {
1104
- element: t
1068
+ ke("moq-watch-ui", (t, {
1069
+ element: e
1105
1070
  }) => {
1106
- const [n, o] = A();
1107
- return Ze(async () => {
1071
+ const [n, a] = j();
1072
+ return Ht(async () => {
1108
1073
  await customElements.whenDefined("moq-watch");
1109
- const r = t.querySelector("moq-watch");
1110
- o(r || void 0);
1111
- }), u(N, {
1074
+ const r = e.querySelector("moq-watch");
1075
+ a(r || void 0);
1076
+ }), u(L, {
1112
1077
  get when() {
1113
1078
  return n();
1114
1079
  },
1115
1080
  keyed: !0,
1116
- children: (r) => u(Qt, {
1081
+ children: (r) => u(He, {
1117
1082
  watch: r
1118
1083
  })
1119
1084
  });