@hadoku/watchparty-ui 0.45.85 → 0.45.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { jsx as d, jsxs as k, Fragment as ye } from "react/jsx-runtime";
2
- import Ke, { useState as $, useRef as L, useEffect as F, useCallback as j, useMemo as Me, Component as vs, useContext as Zn, createContext as er, useId as Ss, useEffectEvent as ue } from "react";
3
- import { k as ws, M as Es, m as xs, f as Ms, a as ks, C as mt, g as rn, i as _s, S as As, b as Ts, r as At, d as E, e as ee, u as x, c as Is, h as Cs, A as vt, j as Rs, l as st, n as tr, o as nr, D as dt, w as I, p as Fs, q as Ns, s as rr, t as sr, v as ar, x as Ls, L as $s, y as Ps, z as sn, B as Ds, E as Bs, F as Os, G as ir, H as an, I as or, J as cr, K as Hs, N as Us, O as Fe, P as Sn, T as Lt, Q as js, R as lr, U as Gs, V as Ws, W as Ks, X as dr, Y as Vs, Z as Y, _ as zs, $ as ur, a0 as fr, a1 as tt, a2 as Js, a3 as Qs, a4 as qs, a5 as Ys, a6 as Xs, a7 as wn, a8 as Qe, a9 as Zs, aa as En, ab as ea, ac as ta, ad as xn, ae as na, af as ra, ag as sa, ah as aa, ai as ia, aj as Mn, ak as kn, al as oa, am as hr, an as _n, ao as ca, ap as xt, aq as la, ar as da, as as ua, at as fa, au as ha, av as pa, aw as ma, ax as ga, ay as ba, az as ya, aA as va } from "./index-DEctw6gT.js";
2
+ import Ke, { useState as $, useRef as L, useEffect as N, useCallback as j, useMemo as Me, Component as vs, useContext as Zn, createContext as er, useId as Ss, useEffectEvent as ue } from "react";
3
+ import { k as ws, M as Es, m as xs, f as Ms, a as ks, C as mt, g as rn, i as _s, S as As, b as Ts, r as At, d as E, e as ee, u as x, c as Is, h as Cs, A as vt, j as Rs, l as st, n as tr, o as nr, D as dt, w as I, p as Ns, q as Fs, s as rr, t as sr, v as ar, x as Ls, L as $s, y as Ps, z as sn, B as Ds, E as Bs, F as Os, G as ir, H as an, I as or, J as cr, K as Hs, N as Us, O as Ne, P as Sn, T as Lt, Q as js, R as lr, U as Gs, V as Ws, W as Ks, X as dr, Y as Vs, Z as Y, _ as zs, $ as ur, a0 as fr, a1 as tt, a2 as Js, a3 as Qs, a4 as qs, a5 as Ys, a6 as Xs, a7 as wn, a8 as Qe, a9 as Zs, aa as En, ab as ea, ac as ta, ad as xn, ae as na, af as ra, ag as sa, ah as aa, ai as ia, aj as Mn, ak as kn, al as oa, am as hr, an as _n, ao as ca, ap as xt, aq as la, ar as da, as as ua, at as fa, au as ha, av as pa, aw as ma, ax as ga, ay as ba, az as ya, aA as va } from "./index-CuuTdsvJ.js";
4
4
  import { createPortal as It } from "react-dom";
5
5
  import { Icon as gt, THEMES as Sa, useHadokuThemeOptional as wa } from "@wolffm/themes";
6
6
  import { HadokuThemePicker as Ea, ConnectedSettings as xa } from "@wolffm/task-ui-components";
@@ -56,7 +56,7 @@ async function Ra(t, e = {}) {
56
56
  throw new pr("Image upload returned an unusable key");
57
57
  return { key: n.key, deduplicated: n.deduplicated === !0 };
58
58
  }
59
- async function Fa(t, e = {}) {
59
+ async function Na(t, e = {}) {
60
60
  const n = [];
61
61
  for (const r of t) {
62
62
  if (r.kind === "remote") {
@@ -68,7 +68,7 @@ async function Fa(t, e = {}) {
68
68
  }
69
69
  return n;
70
70
  }
71
- function Na(t) {
71
+ function Fa(t) {
72
72
  return {
73
73
  error: t instanceof Error ? t.message : String(t),
74
74
  name: t instanceof Error ? t.name : typeof t,
@@ -78,15 +78,15 @@ function Na(t) {
78
78
  }
79
79
  function La(t) {
80
80
  const e = L(t);
81
- return F(() => {
81
+ return N(() => {
82
82
  e.current = t;
83
83
  }), [e, `${t.cdnBase}|${t.uploadPath}`];
84
84
  }
85
85
  function $a(t, e, n, r = {}) {
86
86
  const { limit: s, debounceMs: i = As } = r, [a, l] = La(t), [o, c] = $([]), [u, f] = $(null), [p, g] = $(!1), [b, h] = $(null), [v, S] = $(0), A = L(null);
87
- F(() => {
87
+ N(() => {
88
88
  S(0), f(null);
89
- }, [n, e]), F(() => {
89
+ }, [n, e]), N(() => {
90
90
  let _ = !1;
91
91
  const m = v === 0, T = async () => {
92
92
  A.current?.abort();
@@ -107,7 +107,7 @@ function $a(t, e, n, r = {}) {
107
107
  } finally {
108
108
  _ || g(!1);
109
109
  }
110
- }, N = setTimeout(
110
+ }, F = setTimeout(
111
111
  // A block body, not `() => void run()`: `no-void` is configured with
112
112
  // allowAsStatement, so the discard is fine as a statement and an
113
113
  // error as an expression body.
@@ -119,7 +119,7 @@ function $a(t, e, n, r = {}) {
119
119
  m ? i : 0
120
120
  );
121
121
  return () => {
122
- _ = !0, clearTimeout(N);
122
+ _ = !0, clearTimeout(F);
123
123
  };
124
124
  }, [a, l, e, n, s, i, v]);
125
125
  const R = j(() => {
@@ -216,11 +216,11 @@ function Ga({ onClose: t, onPick: e, onUnavailable: n }) {
216
216
  },
217
217
  [A]
218
218
  );
219
- F(() => () => A(), [A]), F(() => {
219
+ N(() => () => A(), [A]), N(() => {
220
220
  g === "unavailable" && n?.();
221
- }, [g, n]), F(() => {
221
+ }, [g, n]), N(() => {
222
222
  a.current?.focus();
223
- }, []), F(() => {
223
+ }, []), N(() => {
224
224
  const y = (C) => {
225
225
  Ve(C) && (C.stopPropagation(), t());
226
226
  }, w = (C) => {
@@ -232,7 +232,7 @@ function Ga({ onClose: t, onPick: e, onUnavailable: n }) {
232
232
  }, [t]);
233
233
  const T = j((y) => {
234
234
  e(y), t();
235
- }, [e, t]), N = !c && !u && b.length === 0;
235
+ }, [e, t]), F = !c && !u && b.length === 0;
236
236
  return /* @__PURE__ */ k(
237
237
  "div",
238
238
  {
@@ -274,7 +274,7 @@ function Ga({ onClose: t, onPick: e, onUnavailable: n }) {
274
274
  ] }) : g === "forbidden" ? "Your account can't browse the meme library" : "Meme library is unavailable"
275
275
  }
276
276
  ),
277
- N && /* @__PURE__ */ d("p", { className: "p-4 text-center text-sm text-text-secondary", children: r.trim() ? `No memes match "${r.trim()}"` : "The meme library is empty" }),
277
+ F && /* @__PURE__ */ d("p", { className: "p-4 text-center text-sm text-text-secondary", children: r.trim() ? `No memes match "${r.trim()}"` : "The meme library is empty" }),
278
278
  b.length > 0 && /* @__PURE__ */ d("div", { className: "grid grid-cols-3 gap-1.5 sm:grid-cols-4", children: b.map((y) => {
279
279
  const w = At(y.key);
280
280
  return w ? /* @__PURE__ */ d(
@@ -509,7 +509,7 @@ function St() {
509
509
  const [t, e] = $(
510
510
  () => typeof document < "u" && !!document.fullscreenElement
511
511
  );
512
- return F(() => {
512
+ return N(() => {
513
513
  const n = () => e(!!document.fullscreenElement);
514
514
  return n(), document.addEventListener("fullscreenchange", n), () => document.removeEventListener("fullscreenchange", n);
515
515
  }, []), t;
@@ -557,7 +557,7 @@ function _r(t, e) {
557
557
  const Za = er(!0);
558
558
  function Ar() {
559
559
  const t = Zn(Za);
560
- F(() => {
560
+ N(() => {
561
561
  t && Cs();
562
562
  }, [t]);
563
563
  }
@@ -571,7 +571,7 @@ const bt = Ke.memo(
571
571
  (t, e) => t.html === e.html && t.as === e.as && t.className === e.className && JSON.stringify(t.style) === JSON.stringify(e.style)
572
572
  );
573
573
  function ei(t, e) {
574
- F(() => {
574
+ N(() => {
575
575
  const n = t.current;
576
576
  if (!n || !e || typeof IntersectionObserver > "u") return;
577
577
  const r = new IntersectionObserver(([s]) => {
@@ -605,7 +605,7 @@ function ri() {
605
605
  return Zn(ni);
606
606
  }
607
607
  function si({ src: t, title: e, onClose: n }) {
608
- F(() => {
608
+ N(() => {
609
609
  const i = (a) => {
610
610
  Ve(a) && (a.stopPropagation(), n());
611
611
  };
@@ -737,9 +737,9 @@ function li() {
737
737
  const { scrollHeight: i, scrollTop: a, clientHeight: l } = s, o = i - a - l;
738
738
  n.current = o > 40;
739
739
  }, []);
740
- return F(() => {
740
+ return N(() => {
741
741
  const s = e.current;
742
- s && !n.current && s.scrollTo({ top: s.scrollHeight, behavior: "smooth" });
742
+ !s || n.current || (typeof s.scrollTo == "function" ? s.scrollTo({ top: s.scrollHeight, behavior: "smooth" }) : s.scrollTop = s.scrollHeight);
743
743
  }, [t.length]), /* @__PURE__ */ d(
744
744
  "div",
745
745
  {
@@ -881,9 +881,9 @@ function Rr({
881
881
  )
882
882
  ] }, r.id)) }) : null;
883
883
  }
884
- function Fr() {
884
+ function Nr() {
885
885
  const [t, e] = $([]), [n, r] = $(!1), s = x((h) => h.pushToast), i = L(/* @__PURE__ */ new Set());
886
- F(() => () => {
886
+ N(() => () => {
887
887
  for (const h of i.current) URL.revokeObjectURL(h);
888
888
  i.current.clear();
889
889
  }, []);
@@ -956,9 +956,9 @@ function Fr() {
956
956
  if (!t.length) return [];
957
957
  r(!0);
958
958
  try {
959
- return await Fa(t);
959
+ return await Na(t);
960
960
  } catch (h) {
961
- return I("chat", "Image upload failed", Na(h)), s("error", _a(h)), null;
961
+ return I("chat", "Image upload failed", Fa(h)), s("error", _a(h)), null;
962
962
  } finally {
963
963
  r(!1);
964
964
  }
@@ -978,10 +978,10 @@ function Fr() {
978
978
  }
979
979
  const An = ar, gi = sr;
980
980
  function bi({ commands: t = cn }) {
981
- const [e, n] = $(""), [r, s] = $(!1), [i, a] = $({ q: null, i: 0 }), [l, o] = $(!1), c = L(null), u = Ss(), [f, p] = $(!1), [g, b] = $(!1), h = Fr(), v = x((D) => D.snapshot.mediaId), S = x((D) => D.pushToast), A = x((D) => D.setTierlistOpen), R = !!v, _ = di(e), m = Me(
981
+ const [e, n] = $(""), [r, s] = $(!1), [i, a] = $({ q: null, i: 0 }), [l, o] = $(!1), c = L(null), u = Ss(), [f, p] = $(!1), [g, b] = $(!1), h = Nr(), v = x((D) => D.snapshot.mediaId), S = x((D) => D.pushToast), A = x((D) => D.setTierlistOpen), R = !!v, _ = di(e), m = Me(
982
982
  () => _ === null ? [] : ui(_, t),
983
983
  [_, t]
984
- ), T = _ !== null && !l && m.length > 0, N = i.q === _ ? Dt(i.i, m.length) : 0, y = j(
984
+ ), T = _ !== null && !l && m.length > 0, F = i.q === _ ? Dt(i.i, m.length) : 0, y = j(
985
985
  (D) => a({ q: _, i: D }),
986
986
  [_]
987
987
  ), w = j((D, W) => {
@@ -995,10 +995,10 @@ function bi({ commands: t = cn }) {
995
995
  S("info", t.map((U) => U.usage).join(" "));
996
996
  break;
997
997
  case "recap":
998
- Ns();
998
+ Fs();
999
999
  break;
1000
1000
  case "tierlist":
1001
- Fs(), A(!0);
1001
+ Ns(), A(!0);
1002
1002
  break;
1003
1003
  default:
1004
1004
  S("info", `${D.usage} is not implemented yet.`);
@@ -1026,27 +1026,27 @@ function bi({ commands: t = cn }) {
1026
1026
  }
1027
1027
  if (T) {
1028
1028
  if (D.key === "ArrowDown")
1029
- D.preventDefault(), y(Dt(N + 1, m.length));
1029
+ D.preventDefault(), y(Dt(F + 1, m.length));
1030
1030
  else if (D.key === "ArrowUp")
1031
- D.preventDefault(), y(Dt(N - 1, m.length));
1031
+ D.preventDefault(), y(Dt(F - 1, m.length));
1032
1032
  else if (D.key === "Tab") {
1033
1033
  D.preventDefault();
1034
- const W = m[N];
1034
+ const W = m[F];
1035
1035
  W && C(W);
1036
1036
  } else if (D.key === "Enter") {
1037
1037
  D.preventDefault();
1038
- const W = m[N];
1038
+ const W = m[F];
1039
1039
  W && C(W);
1040
1040
  }
1041
1041
  }
1042
- }, [T, m, N, C, y]);
1043
- F(() => {
1042
+ }, [T, m, F, C, y]);
1043
+ N(() => {
1044
1044
  const D = () => {
1045
1045
  document.hidden || !document.hasFocus() || (c.current?.focus(), c.current?.scrollIntoView({ block: "nearest" }));
1046
1046
  };
1047
1047
  return window.addEventListener("watchparty:focus-chat-input", D), () => window.removeEventListener("watchparty:focus-chat-input", D);
1048
1048
  }, []);
1049
- const H = An - e.length, G = H <= 100, J = T ? m[N] : void 0;
1049
+ const H = An - e.length, G = H <= 100, J = T ? m[F] : void 0;
1050
1050
  return /* @__PURE__ */ k(
1051
1051
  "form",
1052
1052
  {
@@ -1064,7 +1064,7 @@ function bi({ commands: t = cn }) {
1064
1064
  mi,
1065
1065
  {
1066
1066
  commands: m,
1067
- activeIndex: N,
1067
+ activeIndex: F,
1068
1068
  hasMedia: R,
1069
1069
  onPick: C,
1070
1070
  onHover: y,
@@ -1148,7 +1148,7 @@ function vi({ u: t }) {
1148
1148
  }
1149
1149
  function Si() {
1150
1150
  const t = x((i) => Object.keys(i.roster).length), [e, n] = $(!1), r = L(null), s = L(null);
1151
- return F(() => {
1151
+ return N(() => {
1152
1152
  if (!e) return;
1153
1153
  function i(l) {
1154
1154
  r.current && !r.current.contains(l.target) && n(!1);
@@ -1220,7 +1220,7 @@ function ln() {
1220
1220
  keyType: _i(ki(globalThis.location?.pathname), t.roomKeyType)
1221
1221
  }));
1222
1222
  }
1223
- function Nr() {
1223
+ function Fr() {
1224
1224
  return x((t) => t.readiness);
1225
1225
  }
1226
1226
  function Ai() {
@@ -1228,8 +1228,8 @@ function Ai() {
1228
1228
  }
1229
1229
  const Ti = 3e4;
1230
1230
  function Lr() {
1231
- const t = Nr(), [e, n] = $(!1), [r, s] = $({ mediaId: t.mediaId, ready: t.ready });
1232
- return (r.mediaId !== t.mediaId || r.ready !== t.ready) && (s({ mediaId: t.mediaId, ready: t.ready }), n(!1)), F(() => {
1231
+ const t = Fr(), [e, n] = $(!1), [r, s] = $({ mediaId: t.mediaId, ready: t.ready });
1232
+ return (r.mediaId !== t.mediaId || r.ready !== t.ready) && (s({ mediaId: t.mediaId, ready: t.ready }), n(!1)), N(() => {
1233
1233
  if (t.ready) return;
1234
1234
  const i = setTimeout(() => n(!0), Ti);
1235
1235
  return () => clearTimeout(i);
@@ -1237,14 +1237,14 @@ function Lr() {
1237
1237
  }
1238
1238
  function Ii({ draw: t }) {
1239
1239
  const e = L(null);
1240
- return F(() => {
1240
+ return N(() => {
1241
1241
  const n = e.current;
1242
1242
  if (n)
1243
1243
  return t(n) ?? void 0;
1244
1244
  }, [t]), /* @__PURE__ */ d("div", { ref: e, "data-testid": "game-settings" });
1245
1245
  }
1246
- const Ci = sn(() => import("./AdminPanel-C-uakHiU.js")), Ri = sn(() => import("./PlaylistPanel-D_UOoMki.js"));
1247
- function Fi() {
1246
+ const Ci = sn(() => import("./AdminPanel-DaNzsx9K.js")), Ri = sn(() => import("./PlaylistPanel-BbVs2gV8.js"));
1247
+ function Ni() {
1248
1248
  const t = x((p) => p.chatCollapsed), e = St(), n = x((p) => p.sidebarTab), r = x((p) => p.setSidebarTab), s = x((p) => p.healthSnapshot?.clients.length ?? 0), i = x((p) => !!p.playlist), a = ze(), l = ln(), o = x((p) => p.gameSettings), c = x((p) => p.snapshot.mediaId), u = Rt() !== null;
1249
1249
  if (Ct({ hasMedia: !!c, chatCollapsed: t, isFullscreen: e }))
1250
1250
  return null;
@@ -1320,11 +1320,11 @@ function Fi() {
1320
1320
  ] });
1321
1321
  }
1322
1322
  const Tn = (t) => typeof t == "string" && Sa.includes(t);
1323
- function Ni(t, e, n) {
1323
+ function Fi(t, e, n) {
1324
1324
  return Tn(e) ? e : Tn(n) ? n : "dark";
1325
1325
  }
1326
1326
  function In({ activity: t, roomKey: e, layer: n }) {
1327
- const r = L(null), s = L(null), [i, a] = $(null), [l, o] = $(!1), c = x((_) => _.snapshot.leaderId), u = x((_) => _.me.clientId), f = !!c && c === u, p = x((_) => _.name), g = wa()?.theme, b = Ni(void 0, g, Ds().theme), h = Me(() => ({
1327
+ const r = L(null), s = L(null), [i, a] = $(null), [l, o] = $(!1), c = x((_) => _.snapshot.leaderId), u = x((_) => _.me.clientId), f = !!c && c === u, p = x((_) => _.name), g = wa()?.theme, b = Fi(void 0, g, Ds().theme), h = Me(() => ({
1328
1328
  roomKey: e,
1329
1329
  identity: {
1330
1330
  // The registry userId — what RoomChrome's `userId` prop is.
@@ -1342,25 +1342,25 @@ function In({ activity: t, roomKey: e, layer: n }) {
1342
1342
  }), A = ue((_, m) => {
1343
1343
  I("game", "bundle settings failed", { gameId: t.id, message: _, cause: String(m) });
1344
1344
  });
1345
- if (F(() => {
1345
+ if (N(() => {
1346
1346
  const _ = r.current, m = t.load;
1347
1347
  if (!_ || !m || l) return;
1348
1348
  E("game", "bundle mount", { gameId: t.id });
1349
- const { setGameSettings: T } = x.getState(), N = (w) => y.mountSettings(w), y = Qa({
1349
+ const { setGameSettings: T } = x.getState(), F = (w) => y.mountSettings(w), y = Qa({
1350
1350
  load: m,
1351
1351
  el: _,
1352
1352
  ctx: v(),
1353
1353
  onError: S,
1354
1354
  onSettingsAvailable: n === "overlay" ? (w) => {
1355
1355
  const C = x.getState().gameSettings;
1356
- w ? T(N) : C === N && T(null);
1356
+ w ? T(F) : C === F && T(null);
1357
1357
  } : void 0,
1358
1358
  onSettingsError: A
1359
1359
  });
1360
1360
  return s.current = y, () => {
1361
1361
  y.dispose(), s.current = null;
1362
1362
  };
1363
- }, [t.id, t.load, l, n]), F(() => {
1363
+ }, [t.id, t.load, l, n]), N(() => {
1364
1364
  s.current?.update(h);
1365
1365
  }, [h]), l) return null;
1366
1366
  const R = t.load ? i : "This game is not served from this site.";
@@ -1387,13 +1387,13 @@ function In({ activity: t, roomKey: e, layer: n }) {
1387
1387
  const Li = "drawer-btn";
1388
1388
  function $i({ open: t, onClose: e, header: n, footer: r, children: s }) {
1389
1389
  const i = L(null);
1390
- return F(() => {
1390
+ return N(() => {
1391
1391
  if (!t) return;
1392
1392
  function a(l) {
1393
1393
  Ve(l) && e();
1394
1394
  }
1395
1395
  return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
1396
- }, [t, e]), F(() => {
1396
+ }, [t, e]), N(() => {
1397
1397
  if (!t) return;
1398
1398
  const a = document.activeElement instanceof HTMLElement ? document.activeElement : null;
1399
1399
  return i.current?.focus({ preventScroll: !0 }), () => {
@@ -1425,7 +1425,7 @@ const $r = 9e3, Cn = 1500, Di = {
1425
1425
  cinema: "drop-shadow-[0_2px_4px_rgba(0,0,0,0.9)]",
1426
1426
  minimal: "drop-shadow-[0_2px_4px_rgba(0,0,0,0.9)] drop-shadow-[0_0_8px_rgba(0,0,0,0.7)]",
1427
1427
  contrast: "bg-black/70 px-2 py-0.5 rounded"
1428
- }, Rn = { WebkitTextStroke: "0.5px black", paintOrder: "stroke fill" }, Fn = {
1428
+ }, Rn = { WebkitTextStroke: "0.5px black", paintOrder: "stroke fill" }, Nn = {
1429
1429
  textShadow: "none",
1430
1430
  filter: "drop-shadow(0 0 1px black) drop-shadow(0 0 1px black)"
1431
1431
  };
@@ -1447,8 +1447,8 @@ function Bi({ message: t, age: e, ccStyle: n }) {
1447
1447
  children: [
1448
1448
  /* @__PURE__ */ d(Ir, { sprite: a.sprite, url: a.pictureUrl, worn: o }),
1449
1449
  /* @__PURE__ */ k("div", { className: "min-w-0 flex-1", children: [
1450
- o ? /* @__PURE__ */ d(bt, { html: nr(a.name, o), className: "text-sm mr-2", style: { color: l, ...Fn } }) : /* @__PURE__ */ d("span", { className: "font-medium text-sm mr-2", style: { color: l, ...Rn }, children: a.name }),
1451
- c ? /* @__PURE__ */ d(bt, { html: c, className: "text-sm text-white break-words", style: Fn }) : /* @__PURE__ */ d("span", { className: "text-sm text-white break-words", style: Rn, children: t.text }),
1450
+ o ? /* @__PURE__ */ d(bt, { html: nr(a.name, o), className: "text-sm mr-2", style: { color: l, ...Nn } }) : /* @__PURE__ */ d("span", { className: "font-medium text-sm mr-2", style: { color: l, ...Rn }, children: a.name }),
1451
+ c ? /* @__PURE__ */ d(bt, { html: c, className: "text-sm text-white break-words", style: Nn }) : /* @__PURE__ */ d("span", { className: "text-sm text-white break-words", style: Rn, children: t.text }),
1452
1452
  /* @__PURE__ */ d(Cr, { images: t.images })
1453
1453
  ] })
1454
1454
  ]
@@ -1458,7 +1458,7 @@ function Bi({ message: t, age: e, ccStyle: n }) {
1458
1458
  function Oi({ shown: t, className: e }) {
1459
1459
  Ar();
1460
1460
  const n = x((o) => o.chat), r = x((o) => o.mediaPrefs.subtitleStyle), [s, i] = $(() => Date.now()), a = n.length > 0;
1461
- F(() => {
1461
+ N(() => {
1462
1462
  const o = setInterval(() => {
1463
1463
  a && i(Date.now());
1464
1464
  }, 200);
@@ -1552,25 +1552,25 @@ cr("__WP_SOUNDS__", {
1552
1552
  on: jr,
1553
1553
  off: Gr
1554
1554
  });
1555
- const Nn = { on: 0, off: 0 };
1555
+ const Fn = { on: 0, off: 0 };
1556
1556
  function Ui(t, e, n, r) {
1557
- if (!n || !r) return Nn;
1557
+ if (!n || !r) return Fn;
1558
1558
  const s = new Set(t), i = new Set(e);
1559
1559
  let a = 0;
1560
1560
  for (const o of i) s.has(o) || a++;
1561
1561
  let l = 0;
1562
1562
  for (const o of s) i.has(o) || l++;
1563
- return a === 0 && l === 0 ? Nn : { on: a, off: l };
1563
+ return a === 0 && l === 0 ? Fn : { on: a, off: l };
1564
1564
  }
1565
1565
  const ji = 1200, be = 52, Tt = 4, Xt = (be - Tt) / 2, Ln = 2 * Math.PI * Xt, De = be - Tt * 2 - 4;
1566
1566
  function Gi(t) {
1567
- return Pr(t) ? !0 : Dr(t) ? t.buffered_ahead_ms >= Fe : !1;
1567
+ return Pr(t) ? !0 : Dr(t) ? t.buffered_ahead_ms >= Ne : !1;
1568
1568
  }
1569
1569
  function Wi(t) {
1570
1570
  return `hsl(${Math.round(t * 120)}, 90%, 55%)`;
1571
1571
  }
1572
1572
  function Ki({ client: t, look: e, fading: n, onFadeEnd: r }) {
1573
- const s = Math.min(1, t.buffered_ahead_ms / Fe), i = Ln * (1 - s), a = Wi(s), l = st(e.sprite, e.pictureUrl);
1573
+ const s = Math.min(1, t.buffered_ahead_ms / Ne), i = Ln * (1 - s), a = Wi(s), l = st(e.sprite, e.pictureUrl);
1574
1574
  return /* @__PURE__ */ k(
1575
1575
  "div",
1576
1576
  {
@@ -1744,17 +1744,17 @@ function Ji() {
1744
1744
  a.status !== t && l($n(a, t));
1745
1745
  const o = a.entries, c = (m) => {
1746
1746
  l((T) => {
1747
- const N = new Set(T.completed), y = new Set(T.below);
1748
- return N.delete(m), y.delete(m), { ...T, completed: N, below: y, entries: T.entries.filter((w) => w.client.client_id !== m) };
1747
+ const F = new Set(T.completed), y = new Set(T.below);
1748
+ return F.delete(m), y.delete(m), { ...T, completed: F, below: y, entries: T.entries.filter((w) => w.client.client_id !== m) };
1749
1749
  });
1750
1750
  }, u = new Set(e.ready), f = Object.values(n), p = !!r && u.has(r), g = e.active && f.length > 0 && e.ready.length >= f.length, b = L(e.active), h = L(g);
1751
- F(() => {
1751
+ N(() => {
1752
1752
  !b.current && e.active && Ur(), b.current = e.active;
1753
- }, [e.active]), F(() => {
1753
+ }, [e.active]), N(() => {
1754
1754
  !h.current && g && Wr(), h.current = g;
1755
1755
  }, [g]);
1756
1756
  const v = L(e.ready), S = L(e.active);
1757
- F(() => {
1757
+ N(() => {
1758
1758
  const { on: m, off: T } = Ui(
1759
1759
  v.current,
1760
1760
  e.ready,
@@ -1911,7 +1911,7 @@ function qi({
1911
1911
  snap: n
1912
1912
  }) {
1913
1913
  const r = L(null), [s, i] = $(null), a = n.placed.find((o) => o.mediaId === e);
1914
- if (F(() => {
1914
+ if (N(() => {
1915
1915
  const o = r.current;
1916
1916
  if (!o) return;
1917
1917
  const c = o.getBoundingClientRect();
@@ -1951,11 +1951,11 @@ function qi({
1951
1951
  }
1952
1952
  function Yi() {
1953
1953
  const t = x((y) => y.tierlistOpen), e = x((y) => y.setTierlistOpen), n = x((y) => y.tierlist), r = x((y) => y.tierlistDraft), s = x((y) => y.tierlistSaving), i = x((y) => y.moveTierlistItem), [a, l] = $(null), [o, c] = $(null), [u, f] = $(null), [p, g] = $(null), [b, h] = $("mine");
1954
- F(() => {
1954
+ N(() => {
1955
1955
  Sn(!0);
1956
- }, []), F(() => {
1956
+ }, []), N(() => {
1957
1957
  t && Sn(!0);
1958
- }, [t]), F(() => {
1958
+ }, [t]), N(() => {
1959
1959
  if (!t) return;
1960
1960
  const y = (w) => {
1961
1961
  Ve(w) && e(!1);
@@ -1995,12 +1995,12 @@ function Yi() {
1995
1995
  }), _ = j(async () => {
1996
1996
  await js(x.getState().tierlistDraft) && g(Date.now());
1997
1997
  }, []);
1998
- if (F(() => {
1998
+ if (N(() => {
1999
1999
  if (p === null) return;
2000
2000
  const y = setTimeout(() => g(null), 2500);
2001
2001
  return () => clearTimeout(y);
2002
2002
  }, [p]), !t) return null;
2003
- const m = JSON.stringify(r) !== JSON.stringify(n?.myBoard ?? {}), T = Object.values(n?.myBoard ?? {}).some((y) => (y?.length ?? 0) > 0), N = T ? b : "mine";
2003
+ const m = JSON.stringify(r) !== JSON.stringify(n?.myBoard ?? {}), T = Object.values(n?.myBoard ?? {}).some((y) => (y?.length ?? 0) > 0), F = T ? b : "mine";
2004
2004
  return It(
2005
2005
  /* @__PURE__ */ k(
2006
2006
  "div",
@@ -2024,7 +2024,7 @@ function Yi() {
2024
2024
  "button",
2025
2025
  {
2026
2026
  role: "tab",
2027
- "aria-selected": N === y,
2027
+ "aria-selected": F === y,
2028
2028
  className: "tl-tab",
2029
2029
  onClick: () => h(y),
2030
2030
  children: w
@@ -2039,7 +2039,7 @@ function Yi() {
2039
2039
  /* @__PURE__ */ d("button", { className: "tl-close", onClick: () => e(!1), "aria-label": "Close tierlist", children: /* @__PURE__ */ d("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ d("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) })
2040
2040
  ] }),
2041
2041
  /* @__PURE__ */ k("div", { className: "flex-1 overflow-y-auto", children: [
2042
- N === "mine" && /* @__PURE__ */ k(ye, { children: [
2042
+ F === "mine" && /* @__PURE__ */ k(ye, { children: [
2043
2043
  Lt.map((y) => /* @__PURE__ */ k("div", { className: "grid grid-cols-[56px_1fr] border-b border-border/50 min-h-[86px]", children: [
2044
2044
  /* @__PURE__ */ d(
2045
2045
  "div",
@@ -2091,7 +2091,7 @@ function Yi() {
2091
2091
  }
2092
2092
  )
2093
2093
  ] }),
2094
- N === "everyone" && n && /* @__PURE__ */ d(ye, { children: Lt.map((y) => {
2094
+ F === "everyone" && n && /* @__PURE__ */ d(ye, { children: Lt.map((y) => {
2095
2095
  const w = n.placed.filter((C) => C.tier === y);
2096
2096
  return /* @__PURE__ */ k("div", { className: "grid grid-cols-[56px_1fr] border-b border-border/50 min-h-[86px]", children: [
2097
2097
  /* @__PURE__ */ d(
@@ -2157,7 +2157,7 @@ function Yi() {
2157
2157
  }
2158
2158
  function Xi({ children: t }) {
2159
2159
  const [e, n] = $(null);
2160
- return F(() => {
2160
+ return N(() => {
2161
2161
  const r = () => n(document.fullscreenElement);
2162
2162
  return r(), document.addEventListener("fullscreenchange", r), () => document.removeEventListener("fullscreenchange", r);
2163
2163
  }, []), e ? It(t, e) : /* @__PURE__ */ d(ye, { children: t });
@@ -2321,10 +2321,10 @@ function vo(t = typeof window > "u" ? void 0 : window, e = bo) {
2321
2321
  };
2322
2322
  }
2323
2323
  function So() {
2324
- F(() => {
2325
- const t = vo(), e = Gs((r) => {
2326
- const s = Ks(r);
2327
- E("avatar", "Avatar changed in the settings popout", { sprite: s, source: r.avatar?.source }), dr(s);
2324
+ N(() => {
2325
+ const t = vo(), e = Gs((r, s) => {
2326
+ const i = Ks(s);
2327
+ E("avatar", "Avatar changed in the settings popout", { sprite: i, source: s.avatar?.source }), dr(i);
2328
2328
  }), n = Ws((r) => {
2329
2329
  E("avatar", "Renamed in the settings popout", { name: r }), Vs(r);
2330
2330
  });
@@ -2392,18 +2392,18 @@ async function To(t) {
2392
2392
  I("room", "Room key type probe failed, falling back to socket truth", Y(n));
2393
2393
  }
2394
2394
  }
2395
- function Ne(t, e) {
2395
+ function Fe(t, e) {
2396
2396
  const r = x.getState().allocateClientSeq(), s = { kind: t, client_seq: r, ...e || {} };
2397
2397
  return ur().emit(fr.CONTROL, s), r;
2398
2398
  }
2399
2399
  function gl(t) {
2400
- return Ne("load", { media_id: t });
2400
+ return Fe("load", { media_id: t });
2401
2401
  }
2402
2402
  function Io() {
2403
- return Ne("home");
2403
+ return Fe("home");
2404
2404
  }
2405
2405
  function Co() {
2406
- const t = Ai(), e = Nr(), n = ze(), r = Lr(), s = n && r && !e.ready, i = !e.ready && !s;
2406
+ const t = Ai(), e = Fr(), n = ze(), r = Lr(), s = n && r && !e.ready, i = !e.ready && !s;
2407
2407
  return /* @__PURE__ */ d(
2408
2408
  "button",
2409
2409
  {
@@ -2419,7 +2419,7 @@ function Co() {
2419
2419
  I("controls", "Play/pause click blocked: not ready", { readyCount: e.readyCount, total: e.total });
2420
2420
  return;
2421
2421
  }
2422
- s && I("controls", "Play/pause: leader overriding stuck readiness gate", { readyCount: e.readyCount, total: e.total }), E("controls", "Play/pause clicked", { action: t.playing ? "pause" : "play" }), Ne(t.playing ? "pause" : "play");
2422
+ s && I("controls", "Play/pause: leader overriding stuck readiness gate", { readyCount: e.readyCount, total: e.total }), E("controls", "Play/pause clicked", { action: t.playing ? "pause" : "play" }), Fe(t.playing ? "pause" : "play");
2423
2423
  },
2424
2424
  className: "ctr-btn",
2425
2425
  title: s ? "Some viewers still loading — play anyway" : i ? "Waiting for sync..." : n ? t.playing ? "Pause" : "Play" : "Only the leader can control playback",
@@ -2444,10 +2444,10 @@ function Ro() {
2444
2444
  }
2445
2445
  );
2446
2446
  }
2447
- function Fo(t) {
2447
+ function No(t) {
2448
2448
  return !t.isLeader || t.durationMs === 0 ? !0 : !t.ready && !t.canOverride;
2449
2449
  }
2450
- function No(t) {
2450
+ function Fo(t) {
2451
2451
  return t.localValue !== null ? t.localValue : t.displayPlayheadMs ?? t.snapshotPlayheadMs;
2452
2452
  }
2453
2453
  function Lo(t, e) {
@@ -2491,8 +2491,8 @@ function Do({ durationMs: t, displayPlayheadMs: e }) {
2491
2491
  S !== n.mediaId && (A(n.mediaId), h(null), g(!1));
2492
2492
  const R = e ?? n.playheadMs;
2493
2493
  !p && b !== null && Math.abs(R - b) < or && h(null);
2494
- const _ = t || 0, m = No({ localValue: b, displayPlayheadMs: e, snapshotPlayheadMs: n.playheadMs }), T = L(0);
2495
- F(() => {
2494
+ const _ = t || 0, m = Fo({ localValue: b, displayPlayheadMs: e, snapshotPlayheadMs: n.playheadMs }), T = L(0);
2495
+ N(() => {
2496
2496
  if (p || b === null) return;
2497
2497
  const P = 1e4 - (Date.now() - T.current), O = setTimeout(() => {
2498
2498
  I("seek", "SeekBar local override timed out — seek never completed", {
@@ -2503,20 +2503,20 @@ function Do({ durationMs: t, displayPlayheadMs: e }) {
2503
2503
  }, Math.max(0, P));
2504
2504
  return () => clearTimeout(O);
2505
2505
  }, [R, p, b]);
2506
- const N = j((P) => {
2506
+ const F = j((P) => {
2507
2507
  const O = P.currentTarget.getBoundingClientRect(), H = P.clientX - O.left, G = H / O.width, J = Math.round(G * _);
2508
2508
  c(H), f(Math.max(0, Math.min(J, _)));
2509
2509
  }, [_]), y = j(() => {
2510
2510
  c(null);
2511
2511
  }, []), w = L(null);
2512
- F(() => () => {
2512
+ N(() => () => {
2513
2513
  w.current && clearTimeout(w.current);
2514
2514
  }, []);
2515
2515
  const C = j((P) => {
2516
2516
  if (P.defaultPrevented) return;
2517
2517
  const O = $o(P.key, m, _);
2518
2518
  O !== null && (P.preventDefault(), h(O), T.current = Date.now(), w.current && clearTimeout(w.current), w.current = setTimeout(() => {
2519
- w.current = null, E("seek", "Keyboard seek", { to_ms: O }), Ne("seek", { to_ms: O }), v.current = O;
2519
+ w.current = null, E("seek", "Keyboard seek", { to_ms: O }), Fe("seek", { to_ms: O }), v.current = O;
2520
2520
  }, Po));
2521
2521
  }, [m, _]);
2522
2522
  return /* @__PURE__ */ k("div", { className: "flex items-center gap-2 flex-1", children: [
@@ -2529,7 +2529,7 @@ function Do({ durationMs: t, displayPlayheadMs: e }) {
2529
2529
  min: 0,
2530
2530
  max: _,
2531
2531
  value: m,
2532
- disabled: Fo({ isLeader: s, ready: r.ready, canOverride: a, durationMs: _ }),
2532
+ disabled: No({ isLeader: s, ready: r.ready, canOverride: a, durationMs: _ }),
2533
2533
  style: { "--progress": `${Lo(m, _) * 100}%` },
2534
2534
  onChange: (P) => {
2535
2535
  const O = Number(P.target.value);
@@ -2539,12 +2539,12 @@ function Do({ durationMs: t, displayPlayheadMs: e }) {
2539
2539
  g(!0), v.current = e ?? n.playheadMs;
2540
2540
  },
2541
2541
  onMouseUp: () => {
2542
- g(!1), b !== null && b !== v.current && (E("seek", "Final seek on mouseup", { to_ms: b }), Ne("seek", { to_ms: b }), v.current = b);
2542
+ g(!1), b !== null && b !== v.current && (E("seek", "Final seek on mouseup", { to_ms: b }), Fe("seek", { to_ms: b }), v.current = b);
2543
2543
  },
2544
2544
  onKeyDown: C,
2545
- onMouseMove: N,
2545
+ onMouseMove: F,
2546
2546
  onMouseLeave: () => {
2547
- y(), p && b !== null && b !== v.current && (g(!1), E("seek", "Final seek on mouseleave-while-dragging", { to_ms: b }), Ne("seek", { to_ms: b }), v.current = b);
2547
+ y(), p && b !== null && b !== v.current && (g(!1), E("seek", "Final seek on mouseleave-while-dragging", { to_ms: b }), Fe("seek", { to_ms: b }), v.current = b);
2548
2548
  },
2549
2549
  className: "w-full range-fill",
2550
2550
  ref: l,
@@ -2565,7 +2565,7 @@ function Do({ durationMs: t, displayPlayheadMs: e }) {
2565
2565
  }
2566
2566
  function Bo({ videoRef: t }) {
2567
2567
  const e = x((u) => u.mediaPrefs.volume), n = x((u) => u.mediaPrefs.muted), r = x((u) => u.setVolume), s = x((u) => u.setMuted);
2568
- F(() => {
2568
+ N(() => {
2569
2569
  const u = t.current;
2570
2570
  u && (u.volume = e, u.muted = n);
2571
2571
  }, [e, n, t]);
@@ -2692,7 +2692,7 @@ function jo({ style: t, onStyleChange: e, enabled: n }) {
2692
2692
  }
2693
2693
  function Go({ videoRef: t }) {
2694
2694
  const [e, n] = $(!1);
2695
- F(() => {
2695
+ N(() => {
2696
2696
  const s = () => {
2697
2697
  n(!!document.fullscreenElement);
2698
2698
  };
@@ -2749,21 +2749,21 @@ function Wo({
2749
2749
  chatCollapsed: A,
2750
2750
  isFullscreen: R,
2751
2751
  gameOverlay: m
2752
- }) === "control-bar", N = Mr({ hasMedia: !0, isFullscreen: R, gameOverlay: m }) === "control-bar", y = x((z) => z.floatingChatEnabled), w = L(null), C = L(null), [P, O] = $(!1), [H, G] = $(!1), [J, D] = $(""), [W, X] = $(!1), U = Fr(), [he, ie] = $(!1), [ke, ve] = $(!1), at = j(async (z) => {
2752
+ }) === "control-bar", F = Mr({ hasMedia: !0, isFullscreen: R, gameOverlay: m }) === "control-bar", y = x((z) => z.floatingChatEnabled), w = L(null), C = L(null), [P, O] = $(!1), [H, G] = $(!1), [J, D] = $(""), [W, X] = $(!1), U = Nr(), [he, ie] = $(!1), [ke, ve] = $(!1), at = j(async (z) => {
2753
2753
  if (z.key !== "Enter") return;
2754
2754
  const te = J.trim();
2755
2755
  if (!te && !U.pending.length || W || U.uploading) return;
2756
2756
  const we = await U.uploadPending();
2757
2757
  we !== null && (rr(te, we), D(""), U.clear(), X(!0), setTimeout(() => X(!1), sr), !document.hidden && document.hasFocus() && C.current?.focus());
2758
2758
  }, [J, W, U]);
2759
- F(() => () => v?.(!1), [e, v]);
2759
+ N(() => () => v?.(!1), [e, v]);
2760
2760
  const Je = r ?? !0, _e = j(() => {
2761
2761
  const z = w.current;
2762
2762
  if (!z) return;
2763
2763
  const { scrollLeft: te, scrollWidth: we, clientWidth: ot } = z;
2764
2764
  O(te > 5), G(te + ot < we - 5);
2765
2765
  }, []);
2766
- F(() => {
2766
+ N(() => {
2767
2767
  const z = w.current;
2768
2768
  if (!z) return;
2769
2769
  _e(), z.addEventListener("scroll", _e);
@@ -2893,7 +2893,7 @@ function Wo({
2893
2893
  }
2894
2894
  ),
2895
2895
  /* @__PURE__ */ k("div", { className: "cluster cluster-tight", children: [
2896
- N && /* @__PURE__ */ d(zr, { className: "ctr-btn" }),
2896
+ F && /* @__PURE__ */ d(zr, { className: "ctr-btn" }),
2897
2897
  /* @__PURE__ */ d(Go, { videoRef: t })
2898
2898
  ] })
2899
2899
  ] }),
@@ -3094,12 +3094,12 @@ const lc = {
3094
3094
  };
3095
3095
  function dc({ subtitleUrl: t, videoRef: e, style: n, enabled: r }) {
3096
3096
  const [s, i] = $([]), [a, l] = $([]), o = L(null), [c, u] = $(40), [f, p] = $(18), [g, b] = $(t);
3097
- g !== t && (b(t), t || i([])), F(() => {
3097
+ g !== t && (b(t), t || i([])), N(() => {
3098
3098
  if (!t) return;
3099
3099
  let m = !1;
3100
3100
  const T = 2;
3101
3101
  return (async () => {
3102
- for (let N = 0; N <= T; N++) {
3102
+ for (let F = 0; F <= T; F++) {
3103
3103
  if (m) return;
3104
3104
  try {
3105
3105
  const y = await fetch(t);
@@ -3111,14 +3111,14 @@ function dc({ subtitleUrl: t, videoRef: e, style: n, enabled: r }) {
3111
3111
  return;
3112
3112
  } catch (y) {
3113
3113
  if (m) return;
3114
- if (N < T) {
3115
- const w = ht(N + 1, { baseMs: 1e3, capMs: 2e3, jitter: 0 });
3116
- I("subtitles", `Fetch failed, retrying in ${w}ms (attempt ${N + 1}/${T + 1})`, { error: y?.message }), await new Promise((C) => setTimeout(C, w));
3114
+ if (F < T) {
3115
+ const w = ht(F + 1, { baseMs: 1e3, capMs: 2e3, jitter: 0 });
3116
+ I("subtitles", `Fetch failed, retrying in ${w}ms (attempt ${F + 1}/${T + 1})`, { error: y?.message }), await new Promise((C) => setTimeout(C, w));
3117
3117
  } else
3118
3118
  I("subtitles", "All fetch attempts failed", { error: y?.message }), i([]);
3119
3119
  }
3120
3120
  }
3121
- })().catch((N) => ee("subtitles", "Subtitle load threw", Y(N))), () => {
3121
+ })().catch((F) => ee("subtitles", "Subtitle load threw", Y(F))), () => {
3122
3122
  m = !0;
3123
3123
  };
3124
3124
  }, [t]);
@@ -3128,12 +3128,12 @@ function dc({ subtitleUrl: t, videoRef: e, style: n, enabled: r }) {
3128
3128
  l([]);
3129
3129
  return;
3130
3130
  }
3131
- const T = m.currentTime, N = s.filter(
3131
+ const T = m.currentTime, F = s.filter(
3132
3132
  (y) => T >= y.startTime && T < y.endTime
3133
3133
  );
3134
- l(N);
3134
+ l(F);
3135
3135
  }, [e, r, s]);
3136
- F(() => {
3136
+ N(() => {
3137
3137
  const m = e.current;
3138
3138
  if (!m) return;
3139
3139
  const T = () => h();
@@ -3142,22 +3142,22 @@ function dc({ subtitleUrl: t, videoRef: e, style: n, enabled: r }) {
3142
3142
  };
3143
3143
  }, [e, h]);
3144
3144
  const v = a.length > 0;
3145
- if (F(() => {
3145
+ if (N(() => {
3146
3146
  const m = e.current, T = o.current?.parentElement;
3147
3147
  if (!m || !T) return;
3148
- const N = () => {
3148
+ const F = () => {
3149
3149
  const y = T.clientHeight, w = T.clientWidth, C = m.videoWidth || 1920, P = m.videoHeight || 1080, O = Math.min(w / C, y / P), H = P * O, G = (y - H) / 2, J = Math.max(16, H * 0.035), D = Math.max(J * 0.8, H * 0.055);
3150
3150
  u(Math.max(G + D, 40)), p(J);
3151
3151
  };
3152
- return N(), window.addEventListener("resize", N), m.addEventListener("loadedmetadata", N), () => {
3153
- window.removeEventListener("resize", N), m.removeEventListener("loadedmetadata", N);
3152
+ return F(), window.addEventListener("resize", F), m.addEventListener("loadedmetadata", F), () => {
3153
+ window.removeEventListener("resize", F), m.removeEventListener("loadedmetadata", F);
3154
3154
  };
3155
3155
  }, [e, v]), !r || a.length === 0)
3156
3156
  return null;
3157
3157
  function S(m) {
3158
3158
  const T = m.linePercent !== void 0 && m.linePercent <= 0.5;
3159
- let N = "c";
3160
- return m.align === "start" ? N = "l" : m.align === "end" ? N = "r" : m.positionPercent !== void 0 && (m.positionPercent < 0.3 ? N = "l" : m.positionPercent > 0.7 && (N = "r")), (T ? "t" : "b") + N;
3159
+ let F = "c";
3160
+ return m.align === "start" ? F = "l" : m.align === "end" ? F = "r" : m.positionPercent !== void 0 && (m.positionPercent < 0.3 ? F = "l" : m.positionPercent > 0.7 && (F = "r")), (T ? "t" : "b") + F;
3161
3161
  }
3162
3162
  const A = {
3163
3163
  tl: [],
@@ -3168,7 +3168,7 @@ function dc({ subtitleUrl: t, videoRef: e, style: n, enabled: r }) {
3168
3168
  br: []
3169
3169
  };
3170
3170
  for (const m of a) A[S(m)].push(m);
3171
- const R = (m, T, N) => m.map((y) => /* @__PURE__ */ d(
3171
+ const R = (m, T, F) => m.map((y) => /* @__PURE__ */ d(
3172
3172
  "div",
3173
3173
  {
3174
3174
  className: `flex flex-col ${T} w-full`,
@@ -3176,13 +3176,13 @@ function dc({ subtitleUrl: t, videoRef: e, style: n, enabled: r }) {
3176
3176
  children: /* @__PURE__ */ d(
3177
3177
  "div",
3178
3178
  {
3179
- className: `${N} font-medium max-w-[95%] inline-block antialiased ${lc[n]}`,
3179
+ className: `${F} font-medium max-w-[95%] inline-block antialiased ${lc[n]}`,
3180
3180
  children: cc(y.text)
3181
3181
  }
3182
3182
  )
3183
3183
  },
3184
3184
  y.id
3185
- )), _ = (m, T, N, y, w) => /* @__PURE__ */ k(ye, { children: [
3185
+ )), _ = (m, T, F, y, w) => /* @__PURE__ */ k(ye, { children: [
3186
3186
  m.length > 0 && /* @__PURE__ */ d(
3187
3187
  "div",
3188
3188
  {
@@ -3200,12 +3200,12 @@ function dc({ subtitleUrl: t, videoRef: e, style: n, enabled: r }) {
3200
3200
  children: R(T, "items-center", "text-center")
3201
3201
  }
3202
3202
  ),
3203
- N.length > 0 && /* @__PURE__ */ d(
3203
+ F.length > 0 && /* @__PURE__ */ d(
3204
3204
  "div",
3205
3205
  {
3206
3206
  className: "absolute right-0 flex flex-col items-end gap-2 pointer-events-none z-10 px-3 max-w-[35%]",
3207
3207
  style: y,
3208
- children: R(N, "items-end", "text-right")
3208
+ children: R(F, "items-end", "text-right")
3209
3209
  }
3210
3210
  )
3211
3211
  ] });
@@ -4232,7 +4232,7 @@ class nt {
4232
4232
  for (let v = l; v <= h; v++)
4233
4233
  this.discardCounts.delete(v), this.fetchErrorCycles.delete(v);
4234
4234
  }
4235
- const o = dn(this.fragments, e), c = this.fragments[o], u = c && this.sourceBuffer?.buffered && Kt(this.sourceBuffer.buffered, c.start_ms, c.end_ms), f = u ? l : o, p = s ? Math.min(this.fragments.length - 1, l + 1) : Re(this.fragments, e + Fe);
4235
+ const o = dn(this.fragments, e), c = this.fragments[o], u = c && this.sourceBuffer?.buffered && Kt(this.sourceBuffer.buffered, c.start_ms, c.end_ms), f = u ? l : o, p = s ? Math.min(this.fragments.length - 1, l + 1) : Re(this.fragments, e + Ne);
4236
4236
  this.initRange && this.initState !== "loaded" && await this.fetchInit();
4237
4237
  const g = [], b = [];
4238
4238
  for (let h = f; h <= p; h++) {
@@ -4526,7 +4526,7 @@ class nt {
4526
4526
  const a = this.fragments[i];
4527
4527
  a && a.start_ms > r && (r = a.start_ms, n = i);
4528
4528
  }
4529
- if (n < 0 || r - e < Fe) return;
4529
+ if (n < 0 || r - e < Ne) return;
4530
4530
  const s = this.currentJobs.get(n);
4531
4531
  s && (s.abortController.abort(), this.currentJobs.delete(n), this.fragmentStates.set(n, "pending"));
4532
4532
  }
@@ -5158,7 +5158,7 @@ function Cc(t) {
5158
5158
  };
5159
5159
  }
5160
5160
  const Rc = 3e3;
5161
- function Fc() {
5161
+ function Nc() {
5162
5162
  const [t, e] = $(!1), n = L(null), r = L(!1), s = () => {
5163
5163
  n.current && (clearTimeout(n.current), n.current = null);
5164
5164
  }, i = j((o = 3e3) => {
@@ -5170,7 +5170,7 @@ function Fc() {
5170
5170
  }, []), l = j((o) => {
5171
5171
  r.current !== o && (r.current = o, o ? (s(), e(!0)) : i(Rc));
5172
5172
  }, [i]);
5173
- return F(() => {
5173
+ return N(() => {
5174
5174
  const o = () => {
5175
5175
  i(4e3);
5176
5176
  };
@@ -5179,7 +5179,7 @@ function Fc() {
5179
5179
  };
5180
5180
  }, [i]), { controlsVisible: t, showControls: i, hideControls: a, setControlsHeld: l };
5181
5181
  }
5182
- const es = [], ts = [], Nc = {
5182
+ const es = [], ts = [], Fc = {
5183
5183
  fragments: es,
5184
5184
  durationMs: null,
5185
5185
  mseCodec: null,
@@ -5188,7 +5188,7 @@ const es = [], ts = [], Nc = {
5188
5188
  contentToken: null
5189
5189
  };
5190
5190
  function Lc(t, e) {
5191
- if (!t || t.url !== e) return Nc;
5191
+ if (!t || t.url !== e) return Fc;
5192
5192
  const n = t.data;
5193
5193
  return {
5194
5194
  fragments: n.fragments || es,
@@ -5219,7 +5219,7 @@ function Qn(t) {
5219
5219
  }
5220
5220
  function $c(t) {
5221
5221
  const [e, n] = $(null);
5222
- return F(() => {
5222
+ return N(() => {
5223
5223
  const r = new AbortController();
5224
5224
  async function s() {
5225
5225
  let i = 0;
@@ -5282,7 +5282,7 @@ function Pc(t) {
5282
5282
  const [e, n] = $(zt), r = aa(), s = x((u) => u.mediaPrefs.preferredAudioLang), [i, a] = $(t);
5283
5283
  i !== t && (a(t), t && n(zt));
5284
5284
  const l = ue(() => ({ origin: ia(r), preferredAudioLang: s }));
5285
- F(() => {
5285
+ N(() => {
5286
5286
  if (!t) return;
5287
5287
  const u = new AbortController(), { origin: f, preferredAudioLang: p } = l();
5288
5288
  let g;
@@ -5335,7 +5335,7 @@ function Hc(t, e, n, r, s, i) {
5335
5335
  });
5336
5336
  }));
5337
5337
  }), o = ue((S) => s(S)), c = L(null), u = L(!1), f = L(null), p = L(null), g = L(0), b = L(null), h = L(0), v = L(null);
5338
- F(() => {
5338
+ N(() => {
5339
5339
  const S = t.current;
5340
5340
  if (!S || !r) return;
5341
5341
  function A() {
@@ -5462,7 +5462,7 @@ function Hc(t, e, n, r, s, i) {
5462
5462
  O && P && !c.current && (c.current = setTimeout(() => {
5463
5463
  c.current = null;
5464
5464
  const W = x.getState(), X = !!W.snapshot.leaderId && W.snapshot.leaderId === W.me.clientId, U = !!n.current?.seekInFlight;
5465
- X && !S.paused && S.readyState < 3 && !U && (I("sync", "Leader stall threshold reached — pausing room", { stallMs: Mn }), u.current = !0, Ne("pause"));
5465
+ X && !S.paused && S.readyState < 3 && !U && (I("sync", "Leader stall threshold reached — pausing room", { stallMs: Mn }), u.current = !0, Fe("pause"));
5466
5466
  }, Mn)), P && !p.current && (g.current = S.currentTime, p.current = setTimeout(() => {
5467
5467
  p.current = null;
5468
5468
  const W = t.current;
@@ -5487,10 +5487,10 @@ function Hc(t, e, n, r, s, i) {
5487
5487
  });
5488
5488
  }, Jt));
5489
5489
  }
5490
- function N() {
5490
+ function F() {
5491
5491
  de.recordStallEnd(), c.current && (clearTimeout(c.current), c.current = null), p.current && (clearTimeout(p.current), p.current = null), v.current = null, R();
5492
5492
  const w = x.getState(), C = w.snapshot.playing, P = !!w.snapshot.leaderId && w.snapshot.leaderId === w.me.clientId;
5493
- !C && !S.paused && o(S), P && u.current && !C && (u.current = !1, I("sync", "Leader stall recovered — resuming room", { currentTime: S.currentTime.toFixed(2) }), Ne("play"));
5493
+ !C && !S.paused && o(S), P && u.current && !C && (u.current = !1, I("sync", "Leader stall recovered — resuming room", { currentTime: S.currentTime.toFixed(2) }), Fe("play"));
5494
5494
  const O = f.current !== null ? Date.now() - f.current : null;
5495
5495
  f.current = null;
5496
5496
  const H = x.getState(), G = H.snapshot.playheadMs + (H.snapshot.playing ? Date.now() - H.snapshotReceivedAt : 0), J = S.currentTime * 1e3;
@@ -5505,8 +5505,8 @@ function Hc(t, e, n, r, s, i) {
5505
5505
  function y() {
5506
5506
  v.current = null, A();
5507
5507
  }
5508
- return S.addEventListener("waiting", T), S.addEventListener("playing", N), S.addEventListener("timeupdate", m), S.addEventListener("pause", y), S.paused || R(), () => {
5509
- S.removeEventListener("waiting", T), S.removeEventListener("playing", N), S.removeEventListener("timeupdate", m), S.removeEventListener("pause", y), c.current && (clearTimeout(c.current), c.current = null), p.current && (clearTimeout(p.current), p.current = null), A(), v.current = null;
5508
+ return S.addEventListener("waiting", T), S.addEventListener("playing", F), S.addEventListener("timeupdate", m), S.addEventListener("pause", y), S.paused || R(), () => {
5509
+ S.removeEventListener("waiting", T), S.removeEventListener("playing", F), S.removeEventListener("timeupdate", m), S.removeEventListener("pause", y), c.current && (clearTimeout(c.current), c.current = null), p.current && (clearTimeout(p.current), p.current = null), A(), v.current = null;
5510
5510
  };
5511
5511
  }, [r, t, e, n]);
5512
5512
  }
@@ -5515,7 +5515,7 @@ function jc(t, e, n, r, s, i) {
5515
5515
  const a = L(null), l = L(null), o = j(() => {
5516
5516
  a.current && (clearInterval(a.current), a.current = null), l.current?.(), l.current = null;
5517
5517
  }, []);
5518
- return F(() => {
5518
+ return N(() => {
5519
5519
  const c = t.current, u = e.current;
5520
5520
  if (!r || !u) {
5521
5521
  o();
@@ -5552,7 +5552,7 @@ function jc(t, e, n, r, s, i) {
5552
5552
  }
5553
5553
  function Gc(t, e, n, r, s, i) {
5554
5554
  const a = x((f) => f.snapshot), l = x((f) => f.loadGeneration), o = L(l), c = ue((f) => s(f)), u = ue((f) => i(f));
5555
- F(() => {
5555
+ N(() => {
5556
5556
  const f = t.current;
5557
5557
  if (!f || !r) return;
5558
5558
  const p = a.playheadMs, g = n.current, b = l !== o.current;
@@ -5567,7 +5567,7 @@ function Gc(t, e, n, r, s, i) {
5567
5567
  caller: "seek-effect",
5568
5568
  pauseSeekResume: !0
5569
5569
  }).catch((h) => ee("buffer", "Seek effect submit threw", Y(h))));
5570
- }, [a.playheadMs, r, l, t, n]), F(() => {
5570
+ }, [a.playheadMs, r, l, t, n]), N(() => {
5571
5571
  const f = e.current;
5572
5572
  if (!f || !r || t.current?.seekInFlight) return;
5573
5573
  const p = a.playing, g = f.paused;
@@ -5584,7 +5584,7 @@ function qn(t, e) {
5584
5584
  }
5585
5585
  function Wc(t) {
5586
5586
  const e = x((a) => a.playlist), n = x((a) => a.activePlaylistIndex), r = x((a) => a.snapshot.mediaId), s = e?.id, i = ue(() => e);
5587
- F(() => {
5587
+ N(() => {
5588
5588
  const a = i();
5589
5589
  if (!a || !a.videos.some((o) => o.mediaId === r)) return;
5590
5590
  const l = new AbortController();
@@ -5623,7 +5623,7 @@ function Wc(t) {
5623
5623
  }
5624
5624
  const { fragments: h, init_segment: v } = b;
5625
5625
  if (!h?.length) continue;
5626
- const S = dn(h, 0), A = Re(h, Fe), R = Se.getInit(c.mediaId) !== void 0, _ = Se.getBufferedMs(c.mediaId, h) >= Fe;
5626
+ const S = dn(h, 0), A = Re(h, Ne), R = Se.getInit(c.mediaId) !== void 0, _ = Se.getBufferedMs(c.mediaId, h) >= Ne;
5627
5627
  if (R && _) {
5628
5628
  E("prebuffer", `${c.mediaId} already fully pre-buffered, skipping`);
5629
5629
  continue;
@@ -5654,20 +5654,20 @@ function Wc(t) {
5654
5654
  if (!await g()) return;
5655
5655
  const T = h[m];
5656
5656
  try {
5657
- const N = await fetch(u, {
5657
+ const F = await fetch(u, {
5658
5658
  headers: {
5659
5659
  Range: `bytes=${T.start_byte}-${T.end_byte}`,
5660
5660
  "X-Buffer-Ahead-Ms": String(_n)
5661
5661
  },
5662
5662
  signal: l.signal
5663
5663
  });
5664
- if (N.ok) {
5665
- const y = await N.arrayBuffer();
5664
+ if (F.ok) {
5665
+ const y = await F.arrayBuffer();
5666
5666
  Se.storeFragment(c.mediaId, m, y);
5667
5667
  }
5668
- } catch (N) {
5668
+ } catch (F) {
5669
5669
  if (l.signal.aborted) return;
5670
- I("prebuffer", `Fragment #${m} fetch failed for ${c.mediaId}`, Y(N));
5670
+ I("prebuffer", `Fragment #${m} fetch failed for ${c.mediaId}`, Y(F));
5671
5671
  }
5672
5672
  }
5673
5673
  E("prebuffer", `Pre-buffer complete for ${c.mediaId}`);
@@ -5713,7 +5713,7 @@ function zc(t, e, n, r, s, i) {
5713
5713
  }
5714
5714
  v.kind === "seek" ? I(Ce, "BG-RESYNC seek", { reason: u, driftMs: S, elementMs: Math.round(b) }) : E(Ce, "resync", { reason: u, plan: v.kind, driftMs: S }), v.kind === "resume" ? i(f) : p && p.submit({ targetMs: v.targetMs, priority: yt.SEEK_EFFECT, caller: `bg-resync:${u}` });
5715
5715
  });
5716
- F(() => {
5716
+ N(() => {
5717
5717
  const u = t.current;
5718
5718
  if (!u || !s) return;
5719
5719
  const f = () => {
@@ -5732,7 +5732,7 @@ function zc(t, e, n, r, s, i) {
5732
5732
  return u.addEventListener("pause", f), document.addEventListener("visibilitychange", p), () => {
5733
5733
  u.removeEventListener("pause", f), document.removeEventListener("visibilitychange", p);
5734
5734
  };
5735
- }, [s, t, e]), F(() => {
5735
+ }, [s, t, e]), N(() => {
5736
5736
  const u = t.current;
5737
5737
  if (!u || typeof navigator > "u" || !("mediaSession" in navigator)) return;
5738
5738
  const f = navigator.mediaSession;
@@ -5749,7 +5749,7 @@ function zc(t, e, n, r, s, i) {
5749
5749
  const m = x.getState(), T = zo(_, { isLeader: Kc(), roomPlaying: m.snapshot.playing });
5750
5750
  switch (E(Ce, "media session press", { action: _, result: T.kind }), _ === "pause" && (l.current = Date.now()), T.kind) {
5751
5751
  case "control":
5752
- Ne(T.control), T.control === "pause" && u.pause();
5752
+ Fe(T.control), T.control === "pause" && u.pause();
5753
5753
  break;
5754
5754
  case "local-pause":
5755
5755
  a.current = !0, u.pause();
@@ -5794,7 +5794,7 @@ function zc(t, e, n, r, s, i) {
5794
5794
  }
5795
5795
  f.metadata = null, f.playbackState = "none";
5796
5796
  };
5797
- }, [n, r, t]), F(() => {
5797
+ }, [n, r, t]), N(() => {
5798
5798
  const u = t.current;
5799
5799
  if (!u || typeof navigator > "u" || !("wakeLock" in navigator)) return;
5800
5800
  let f = null, p = !1, g = !1;
@@ -5855,7 +5855,7 @@ function Jc(t, e, n, r) {
5855
5855
  }
5856
5856
  a.preventDefault(), E("controls", `remote key ${f}`, { key: a.key }), f === "enter-bar" && o && br(o)?.focus({ preventScroll: !0 });
5857
5857
  });
5858
- F(() => {
5858
+ N(() => {
5859
5859
  const a = (l) => s(l);
5860
5860
  return window.addEventListener("keydown", a, !0), () => window.removeEventListener("keydown", a, !0);
5861
5861
  }, []);
@@ -5863,7 +5863,7 @@ function Jc(t, e, n, r) {
5863
5863
  const l = t.current?.querySelector(Yn);
5864
5864
  l && a.target instanceof Node && l.contains(a.target) && n(ft);
5865
5865
  });
5866
- F(() => {
5866
+ N(() => {
5867
5867
  const a = t.current;
5868
5868
  if (!a) return;
5869
5869
  const l = (c) => i(c), o = (c) => {
@@ -5886,8 +5886,8 @@ function Qt(t) {
5886
5886
  ee("buffer", "initializePlayback threw", Y(t));
5887
5887
  }
5888
5888
  function Xc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
5889
- const r = L(null), s = L(null), [i, a] = $(!1), [l, o] = $(!1), { controlsVisible: c, showControls: u, hideControls: f, setControlsHeld: p } = Fc();
5890
- Jc(s, c, u, f), F(() => {
5889
+ const r = L(null), s = L(null), [i, a] = $(!1), [l, o] = $(!1), { controlsVisible: c, showControls: u, hideControls: f, setControlsHeld: p } = Nc();
5890
+ Jc(s, c, u, f), N(() => {
5891
5891
  const M = () => o(!!document.fullscreenElement);
5892
5892
  return document.addEventListener("fullscreenchange", M), () => document.removeEventListener("fullscreenchange", M);
5893
5893
  }, []);
@@ -5902,15 +5902,15 @@ function Xc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
5902
5902
  if (!A) return null;
5903
5903
  const B = t.replace(new RegExp(`/${xt.replace(/\./g, "\\.")}$`), "");
5904
5904
  return B === t ? null : { baseUrl: B, token: A, trackId: M };
5905
- }, [A, t]), m = h !== null && S.length > 0, T = x((M) => M.readiness), N = la(), y = ze();
5906
- F(() => {
5905
+ }, [A, t]), m = h !== null && S.length > 0, T = x((M) => M.readiness), F = la(), y = ze();
5906
+ N(() => {
5907
5907
  const M = s.current;
5908
5908
  if (!M) return;
5909
5909
  const B = document.activeElement;
5910
5910
  if (B && B !== document.body && B !== M) return;
5911
- const oe = M.querySelector(".ctr-bar-wrapper"), V = oe?.querySelector("[data-remote-primary]"), ce = N && oe && !V?.disabled ? br(oe) : null;
5911
+ const oe = M.querySelector(".ctr-bar-wrapper"), V = oe?.querySelector("[data-remote-primary]"), ce = F && oe && !V?.disabled ? br(oe) : null;
5912
5912
  ce ? (u(ft), ce.focus({ preventScroll: !0 })) : B !== M && M.focus({ preventScroll: !0 });
5913
- }, [N, T.ready, y, u]);
5913
+ }, [F, T.ready, y, u]);
5914
5914
  const w = L(!1), C = L(!1), P = L(null), O = L(null), H = L(null), G = L(0), J = L(0), D = L(null), [W, X] = $(0), U = L([]), he = L([]), ie = L(-1), ke = L(!1), ve = L(null), at = L(0), Je = L(null), _e = L(0), wt = x((M) => M.bufferState), it = x((M) => M.setBufferState), {
5915
5915
  audioTracks: Be,
5916
5916
  subtitleTracks: z,
@@ -5918,7 +5918,7 @@ function Xc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
5918
5918
  setSelectedAudioIndex: we,
5919
5919
  selectedSubtitleIndex: ot,
5920
5920
  setSelectedSubtitleIndex: ns
5921
- } = Pc(n), fn = x((M) => M.mediaPrefs), rs = x((M) => M.mutedForAutoplay), ss = x((M) => M.setMutedForAutoplay), hn = x((M) => M.setSubtitlesEnabled), as = x((M) => M.setSubtitleStyle), Ft = x((M) => M.setPreferredAudioLang), is = fn.subtitlesEnabled, pn = fn.subtitleStyle, os = Be[te]?.lang, cs = z.some((M) => M.lang === "eng"), [ls, mn] = $(null), ct = Ec({
5921
+ } = Pc(n), fn = x((M) => M.mediaPrefs), rs = x((M) => M.mutedForAutoplay), ss = x((M) => M.setMutedForAutoplay), hn = x((M) => M.setSubtitlesEnabled), as = x((M) => M.setSubtitleStyle), Nt = x((M) => M.setPreferredAudioLang), is = fn.subtitlesEnabled, pn = fn.subtitleStyle, os = Be[te]?.lang, cs = z.some((M) => M.lang === "eng"), [ls, mn] = $(null), ct = Ec({
5922
5922
  override: ls,
5923
5923
  globalEnabled: is,
5924
5924
  selectedAudioLang: os,
@@ -5937,7 +5937,7 @@ function Xc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
5937
5937
  }, []), gn = j((M) => {
5938
5938
  M.pause();
5939
5939
  }, []), [us, bn] = $(0), [fs, hs] = $(n);
5940
- fs !== n && (hs(n), mn(null), bn(0)), F(() => {
5940
+ fs !== n && (hs(n), mn(null), bn(0)), N(() => {
5941
5941
  const M = r.current;
5942
5942
  if (!M) return;
5943
5943
  const B = () => {
@@ -5957,7 +5957,7 @@ function Xc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
5957
5957
  attempt: J.current
5958
5958
  }), X((B) => B + 1);
5959
5959
  }, [n]);
5960
- async function Nt() {
5960
+ async function Ft() {
5961
5961
  const M = H.current, B = r.current;
5962
5962
  if (!M || !g.length || C.current) return;
5963
5963
  const oe = x.getState().snapshot, V = oe.playheadMs || 0;
@@ -5975,12 +5975,12 @@ function Xc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
5975
5975
  const re = da;
5976
5976
  await Promise.allSettled(ne);
5977
5977
  const Q = le.map(
5978
- (K) => K.waitForBuffered(V + Fe, re)
5979
- ), Ee = await M.waitForBuffered(V + Fe, re);
5978
+ (K) => K.waitForBuffered(V + Ne, re)
5979
+ ), Ee = await M.waitForBuffered(V + Ne, re);
5980
5980
  if (await Promise.allSettled(Q), Ee || I("buffer", "Buffer gate timeout — proceeding with partial buffer", {
5981
5981
  startMs: V,
5982
5982
  aheadMs: Math.round(M.getBufferedAheadMs(V)),
5983
- targetMs: Fe
5983
+ targetMs: Ne
5984
5984
  }), M.isDisposed) return;
5985
5985
  if (M.getBufferedAheadMs(V) > Qc && M.getLoadedCount() === 0) {
5986
5986
  M.dumpBufferDiagnostics(V, "phantom-detected"), I("buffer", "PHANTOM-BUFFER detected at gate — recreating MediaSource", {
@@ -6084,7 +6084,7 @@ function Xc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6084
6084
  mediaId: n,
6085
6085
  attempt: G.current
6086
6086
  }), setTimeout(() => {
6087
- H.current && !M.isDisposed && !C.current && (E("buffer", "Retrying initializePlayback"), Nt().catch(Qt));
6087
+ H.current && !M.isDisposed && !C.current && (E("buffer", "Retrying initializePlayback"), Ft().catch(Qt));
6088
6088
  }, 3e3));
6089
6089
  }
6090
6090
  }
@@ -6095,9 +6095,9 @@ function Xc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6095
6095
  mseAudioTracks: S,
6096
6096
  fragments: g,
6097
6097
  deliveryFor: R,
6098
- initializePlayback: Nt
6098
+ initializePlayback: Ft
6099
6099
  }));
6100
- F(() => {
6100
+ N(() => {
6101
6101
  if (!h) return;
6102
6102
  const {
6103
6103
  useMseAudio: M,
@@ -6227,24 +6227,24 @@ function Xc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6227
6227
  ), ce.epoch = B;
6228
6228
  }
6229
6229
  }
6230
- C.current || Nt().catch(Qt);
6230
+ C.current || Ft().catch(Qt);
6231
6231
  }
6232
6232
  });
6233
- F(() => {
6233
+ N(() => {
6234
6234
  ms();
6235
- }, [g, t, v, S]), F(() => {
6235
+ }, [g, t, v, S]), N(() => {
6236
6236
  const M = () => {
6237
6237
  H.current?.abortStaleJobs("socket-reconnect");
6238
6238
  for (const B of U.current) B.abortStaleJobs("socket-reconnect");
6239
6239
  };
6240
6240
  return window.addEventListener("watchparty:socket-reconnect", M), () => window.removeEventListener("watchparty:socket-reconnect", M);
6241
- }, []), F(() => (window.__AUDIO_SELECT__ = (M) => {
6241
+ }, []), N(() => (window.__AUDIO_SELECT__ = (M) => {
6242
6242
  we(M);
6243
6243
  const B = Be[M];
6244
- B?.lang && Ft(B.lang);
6244
+ B?.lang && Nt(B.lang);
6245
6245
  }, () => {
6246
6246
  window.__AUDIO_SELECT__ = null;
6247
- }), [Be, we, Ft]), F(() => {
6247
+ }), [Be, we, Nt]), N(() => {
6248
6248
  if (!m || !i || te < 0 || te >= S.length || te === ie.current) return;
6249
6249
  if (ke.current) {
6250
6250
  E("audio", "MSE audio swap requested while another in flight — deferring");
@@ -6311,7 +6311,7 @@ function Xc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6311
6311
  })().catch((ne) => ee("audio", "MSE audio swap failed", Y(ne)));
6312
6312
  }, [m, i, te, S, n, t, lt, R]), Gc(ve, r, at, i, Et, gn), Hc(r, H, ve, i, gn, U), zc(r, ve, n, b ?? 0, i, Et);
6313
6313
  const { stopPrefetch: vn } = jc(r, H, ve, i, it, U);
6314
- Wc(H), F(() => {
6314
+ Wc(H), N(() => {
6315
6315
  Je.current = vn;
6316
6316
  }, [vn]);
6317
6317
  const gs = j(() => {
@@ -6364,7 +6364,7 @@ function Xc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6364
6364
  onAudioSelect: (M) => {
6365
6365
  we(M);
6366
6366
  const B = Be[M];
6367
- B?.lang && Ft(B.lang);
6367
+ B?.lang && Nt(B.lang);
6368
6368
  },
6369
6369
  subtitleTracks: z,
6370
6370
  selectedSubtitleIndex: ot,
@@ -6425,18 +6425,18 @@ const el = (t) => {
6425
6425
  id: "player",
6426
6426
  name: "Media player",
6427
6427
  load: () => Promise.resolve(tl)
6428
- }, rl = sn(() => import("./MediaDrawer-Dml5XUN3.js"));
6428
+ }, rl = sn(() => import("./MediaDrawer-DyRYA0AN.js"));
6429
6429
  function sl() {
6430
6430
  const t = x((u) => u.snapshot), e = x((u) => u.ensureAutoIdentity), n = Rt(), r = Me(
6431
6431
  () => n ? Ja(n, window.location.origin) : null,
6432
6432
  [n]
6433
6433
  ), s = ma(), i = L(!1), [a, l] = $(!1), o = s.roomKey || null;
6434
- So(), F(() => wo(), []), F(() => Mo(), []), F(() => {
6434
+ So(), N(() => wo(), []), N(() => Mo(), []), N(() => {
6435
6435
  o && To(o);
6436
- }, [o]), F(() => {
6436
+ }, [o]), N(() => {
6437
6437
  const u = () => l(!0);
6438
6438
  return window.addEventListener(Yt, u), () => window.removeEventListener(Yt, u);
6439
- }, []), F(() => {
6439
+ }, []), N(() => {
6440
6440
  if (!o || i.current) return;
6441
6441
  let u = !1;
6442
6442
  const f = 1500;
@@ -6480,7 +6480,7 @@ function sl() {
6480
6480
  /* @__PURE__ */ d(Yi, {})
6481
6481
  ] })
6482
6482
  ] }),
6483
- /* @__PURE__ */ d(Fi, {}),
6483
+ /* @__PURE__ */ d(Ni, {}),
6484
6484
  /* @__PURE__ */ d(Ke.Suspense, { fallback: /* @__PURE__ */ d(Pi, { open: a, onClose: c }), children: /* @__PURE__ */ d(rl, { open: a, onClose: c }) })
6485
6485
  ] }) : (I("room", "No room key provided"), /* @__PURE__ */ d("div", { className: "flex-1 flex items-center justify-center p-6", children: /* @__PURE__ */ k("div", { className: "text-text-secondary", children: [
6486
6486
  "No room key provided. Go to the ",
@@ -6516,4 +6516,4 @@ export {
6516
6516
  gl as s,
6517
6517
  ln as u
6518
6518
  };
6519
- //# sourceMappingURL=Room-BM4nddV8.js.map
6519
+ //# sourceMappingURL=Room-D30OEvyK.js.map