@moq/watch 0.2.17 → 0.2.19

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.
Files changed (57) hide show
  1. package/README.md +4 -3
  2. package/audio/backend.d.ts +11 -1
  3. package/audio/backend.d.ts.map +1 -1
  4. package/audio/buffer.d.ts +10 -1
  5. package/audio/buffer.d.ts.map +1 -1
  6. package/audio/decoder.d.ts +8 -1
  7. package/audio/decoder.d.ts.map +1 -1
  8. package/audio/emitter.d.ts.map +1 -1
  9. package/audio/mse.d.ts +1 -1
  10. package/audio/mse.d.ts.map +1 -1
  11. package/audio/render.d.ts +6 -1
  12. package/audio/render.d.ts.map +1 -1
  13. package/audio/ring-buffer.d.ts +2 -0
  14. package/audio/ring-buffer.d.ts.map +1 -1
  15. package/audio/shared-ring-buffer.d.ts +8 -1
  16. package/audio/shared-ring-buffer.d.ts.map +1 -1
  17. package/audio/source.d.ts.map +1 -1
  18. package/backend.d.ts +22 -18
  19. package/backend.d.ts.map +1 -1
  20. package/{broadcast-80k1hgfM.js → broadcast-Duw8w3D_.js} +446 -439
  21. package/broadcast-Duw8w3D_.js.map +1 -0
  22. package/broadcast.d.ts +15 -3
  23. package/broadcast.d.ts.map +1 -1
  24. package/buffered.d.ts +19 -0
  25. package/buffered.d.ts.map +1 -0
  26. package/element.d.ts +22 -4
  27. package/element.d.ts.map +1 -1
  28. package/element.js +65 -36
  29. package/element.js.map +1 -1
  30. package/index.d.ts +1 -0
  31. package/index.d.ts.map +1 -1
  32. package/index.js +7 -6
  33. package/mse.d.ts.map +1 -1
  34. package/package.json +6 -6
  35. package/support/element.d.ts.map +1 -1
  36. package/support/element.js.map +1 -1
  37. package/support/index.js.map +1 -1
  38. package/sync-D67IxmxJ.js +128 -0
  39. package/sync-D67IxmxJ.js.map +1 -0
  40. package/sync.d.ts +27 -5
  41. package/sync.d.ts.map +1 -1
  42. package/sync.test.d.ts +2 -0
  43. package/sync.test.d.ts.map +1 -0
  44. package/ui/components/latency.d.ts.map +1 -1
  45. package/ui/element.d.ts.map +1 -1
  46. package/ui/element.js +215 -178
  47. package/ui/element.js.map +1 -1
  48. package/video/backend.d.ts +10 -1
  49. package/video/backend.d.ts.map +1 -1
  50. package/video/decoder.d.ts +1 -1
  51. package/video/decoder.d.ts.map +1 -1
  52. package/video/mse.d.ts +3 -3
  53. package/video/mse.d.ts.map +1 -1
  54. package/video/renderer.d.ts +1 -1
  55. package/video/renderer.d.ts.map +1 -1
  56. package/video/source.d.ts.map +1 -1
  57. package/broadcast-80k1hgfM.js.map +0 -1
package/ui/element.js CHANGED
@@ -1,7 +1,8 @@
1
- import { Effect as e, Signal as t } from "@moq/signals";
2
- import * as n from "@moq/signals/dom";
1
+ import { n as e } from "../sync-D67IxmxJ.js";
2
+ import { Effect as t, Signal as n } from "@moq/signals";
3
+ import * as r from "@moq/signals/dom";
3
4
  //#region src/ui/components/buffering-indicator.ts
4
- function r(e, t) {
5
+ function i(e, t) {
5
6
  let n = document.createElement("div");
6
7
  n.className = "buffering";
7
8
  let r = document.createElement("div");
@@ -12,18 +13,18 @@ function r(e, t) {
12
13
  }
13
14
  //#endregion
14
15
  //#region src/ui/icons/audio.svg?raw
15
- var i = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M9 18V5l12-2v13\" />\n <circle cx=\"6\" cy=\"18\" r=\"3\" />\n <circle cx=\"18\" cy=\"16\" r=\"3\" />\n</svg>", a = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M20 6 9 17l-5-5\" />\n</svg>\n", o = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n</svg>\n", s = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M8 3H5a2 2 0 0 0-2 2v3\" />\n <path d=\"M21 8V5a2 2 0 0 0-2-2h-3\" />\n <path d=\"M3 16v3a2 2 0 0 0 2 2h3\" />\n <path d=\"M16 21h3a2 2 0 0 0 2-2v-3\" />\n</svg>", c = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M8 3v3a2 2 0 0 1-2 2H3\" />\n <path d=\"M21 8h-3a2 2 0 0 1-2-2V3\" />\n <path d=\"M3 16h3a2 2 0 0 1 2 2v3\" />\n <path d=\"M16 21v-3a2 2 0 0 1 2-2h3\" />\n</svg>", l = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"m12 14 4-4\" />\n <path d=\"M3.34 19a10 10 0 1 1 17.32 0\" />\n</svg>\n", u = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M16 9a5 5 0 0 1 .95 2.293\" />\n <path d=\"M19.364 5.636a9 9 0 0 1 1.889 9.96\" />\n <path d=\"m2 2 20 20\" />\n <path d=\"m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11\" />\n <path d=\"M9.828 4.172A.686.686 0 0 1 11 4.657v.686\" />\n</svg>", d = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M16.247 7.761a6 6 0 0 1 0 8.478\" />\n <path d=\"M19.075 4.933a10 10 0 0 1 0 14.134\" />\n <path d=\"M4.925 19.067a10 10 0 0 1 0-14.134\" />\n <path d=\"M7.753 16.239a6 6 0 0 1 0-8.478\" />\n <circle cx=\"12\" cy=\"12\" r=\"2\" />\n</svg>", f = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"14\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n <rect x=\"5\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n</svg>", p = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\" />\n</svg>", m = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"21\" x2=\"14\" y1=\"4\" y2=\"4\" />\n <line x1=\"10\" x2=\"3\" y1=\"4\" y2=\"4\" />\n <line x1=\"21\" x2=\"12\" y1=\"12\" y2=\"12\" />\n <line x1=\"8\" x2=\"3\" y1=\"12\" y2=\"12\" />\n <line x1=\"21\" x2=\"16\" y1=\"20\" y2=\"20\" />\n <line x1=\"12\" x2=\"3\" y1=\"20\" y2=\"20\" />\n <line x1=\"14\" x2=\"14\" y1=\"2\" y2=\"6\" />\n <line x1=\"8\" x2=\"8\" y1=\"10\" y2=\"14\" />\n <line x1=\"16\" x2=\"16\" y1=\"18\" y2=\"22\" />\n</svg>\n", h = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M5 21v-6\" />\n <path d=\"M12 21V3\" />\n <path d=\"M19 21V9\" />\n</svg>", g = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5\" />\n <rect x=\"2\" y=\"6\" width=\"14\" height=\"12\" rx=\"2\" />\n</svg>", _ = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n <path d=\"M16 9a5 5 0 0 1 0 6\" />\n <path d=\"M19.364 18.364a9 9 0 0 0 0-12.728\" />\n</svg>", v = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n</svg>", y = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n <path d=\"M16 9a5 5 0 0 1 0 6\" />\n</svg>";
16
+ var a = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M9 18V5l12-2v13\" />\n <circle cx=\"6\" cy=\"18\" r=\"3\" />\n <circle cx=\"18\" cy=\"16\" r=\"3\" />\n</svg>", o = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M20 6 9 17l-5-5\" />\n</svg>\n", s = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n</svg>\n", c = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M8 3H5a2 2 0 0 0-2 2v3\" />\n <path d=\"M21 8V5a2 2 0 0 0-2-2h-3\" />\n <path d=\"M3 16v3a2 2 0 0 0 2 2h3\" />\n <path d=\"M16 21h3a2 2 0 0 0 2-2v-3\" />\n</svg>", l = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M8 3v3a2 2 0 0 1-2 2H3\" />\n <path d=\"M21 8h-3a2 2 0 0 1-2-2V3\" />\n <path d=\"M3 16h3a2 2 0 0 1 2 2v3\" />\n <path d=\"M16 21v-3a2 2 0 0 1 2-2h3\" />\n</svg>", u = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"m12 14 4-4\" />\n <path d=\"M3.34 19a10 10 0 1 1 17.32 0\" />\n</svg>\n", d = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M16 9a5 5 0 0 1 .95 2.293\" />\n <path d=\"M19.364 5.636a9 9 0 0 1 1.889 9.96\" />\n <path d=\"m2 2 20 20\" />\n <path d=\"m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11\" />\n <path d=\"M9.828 4.172A.686.686 0 0 1 11 4.657v.686\" />\n</svg>", f = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M16.247 7.761a6 6 0 0 1 0 8.478\" />\n <path d=\"M19.075 4.933a10 10 0 0 1 0 14.134\" />\n <path d=\"M4.925 19.067a10 10 0 0 1 0-14.134\" />\n <path d=\"M7.753 16.239a6 6 0 0 1 0-8.478\" />\n <circle cx=\"12\" cy=\"12\" r=\"2\" />\n</svg>", p = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"14\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n <rect x=\"5\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n</svg>", m = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\" />\n</svg>", h = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"21\" x2=\"14\" y1=\"4\" y2=\"4\" />\n <line x1=\"10\" x2=\"3\" y1=\"4\" y2=\"4\" />\n <line x1=\"21\" x2=\"12\" y1=\"12\" y2=\"12\" />\n <line x1=\"8\" x2=\"3\" y1=\"12\" y2=\"12\" />\n <line x1=\"21\" x2=\"16\" y1=\"20\" y2=\"20\" />\n <line x1=\"12\" x2=\"3\" y1=\"20\" y2=\"20\" />\n <line x1=\"14\" x2=\"14\" y1=\"2\" y2=\"6\" />\n <line x1=\"8\" x2=\"8\" y1=\"10\" y2=\"14\" />\n <line x1=\"16\" x2=\"16\" y1=\"18\" y2=\"22\" />\n</svg>\n", g = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M5 21v-6\" />\n <path d=\"M12 21V3\" />\n <path d=\"M19 21V9\" />\n</svg>", _ = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5\" />\n <rect x=\"2\" y=\"6\" width=\"14\" height=\"12\" rx=\"2\" />\n</svg>", v = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n <path d=\"M16 9a5 5 0 0 1 0 6\" />\n <path d=\"M19.364 18.364a9 9 0 0 0 0-12.728\" />\n</svg>", y = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n</svg>", b = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n <path d=\"M16 9a5 5 0 0 1 0 6\" />\n</svg>";
16
17
  //#endregion
17
18
  //#region src/ui/icons.ts
18
- function b(e) {
19
+ function x(e) {
19
20
  let t = document.createElement("span");
20
21
  return t.className = "flex-center", t.setAttribute("role", "img"), t.setAttribute("aria-hidden", "true"), t.innerHTML = e, t;
21
22
  }
22
23
  //#endregion
23
24
  //#region src/ui/components/center-play.ts
24
- function x(e, t) {
25
+ function S(e, t) {
25
26
  let n = document.createElement("button");
26
- return n.type = "button", n.className = "center-play flex-center", n.title = "Play", n.setAttribute("aria-label", "Play"), n.replaceChildren(b(p)), e.run((e) => {
27
+ return n.type = "button", n.className = "center-play flex-center", n.title = "Play", n.setAttribute("aria-label", "Play"), n.replaceChildren(x(m)), e.run((e) => {
27
28
  let r = e.get(t.backend.paused);
28
29
  n.style.display = r ? "" : "none";
29
30
  }), e.event(n, "click", () => {
@@ -32,13 +33,13 @@ function x(e, t) {
32
33
  }
33
34
  //#endregion
34
35
  //#region src/ui/fullscreen.ts
35
- var S = "player--pseudo-fullscreen";
36
- function C(e, t, n) {
36
+ var C = "player--pseudo-fullscreen";
37
+ function w(e, t, n) {
37
38
  let r = document, i = /* @__PURE__ */ new Set(), a = () => {
38
39
  for (let e of i) e();
39
40
  };
40
41
  e.event(document, "fullscreenchange", a), e.event(document, "webkitfullscreenchange", a);
41
- let o, s = () => !!(document.fullscreenElement || r.webkitFullscreenElement || o?.webkitDisplayingFullscreen), c = () => t.classList.contains(S), l = () => s() || c(), u = () => {
42
+ let o, s = () => !!(document.fullscreenElement || r.webkitFullscreenElement || o?.webkitDisplayingFullscreen), c = () => t.classList.contains(C), l = () => s() || c(), u = () => {
42
43
  let r = t;
43
44
  if (r.requestFullscreen) {
44
45
  r.requestFullscreen().catch(() => f());
@@ -65,9 +66,9 @@ function C(e, t, n) {
65
66
  }
66
67
  r.webkitExitFullscreen?.();
67
68
  }, f = () => {
68
- t.classList.add(S), a();
69
+ t.classList.add(C), a();
69
70
  }, p = () => {
70
- t.classList.remove(S), a();
71
+ t.classList.remove(C), a();
71
72
  };
72
73
  return {
73
74
  active: l,
@@ -77,28 +78,28 @@ function C(e, t, n) {
77
78
  }
78
79
  //#endregion
79
80
  //#region src/ui/components/button.ts
80
- function w(e, t) {
81
+ function T(e, t) {
81
82
  let n = document.createElement("button");
82
- return n.type = "button", n.className = "control flex-center", n.title = t, n.setAttribute("aria-label", t), n.replaceChildren(b(e)), n;
83
+ return n.type = "button", n.className = "control flex-center", n.title = t, n.setAttribute("aria-label", t), n.replaceChildren(x(e)), n;
83
84
  }
84
85
  //#endregion
85
86
  //#region src/ui/components/fullscreen-button.ts
86
- function T(e, t, n) {
87
- let r = w(s, "Fullscreen"), i = C(e, t, () => n.querySelector("video") ?? n.querySelector("canvas")), a = () => {
87
+ function E(e, t, n) {
88
+ let r = T(c, "Fullscreen"), i = w(e, t, () => n.querySelector("video") ?? n.querySelector("canvas")), a = () => {
88
89
  let e = i.active();
89
- r.replaceChildren(b(e ? c : s)), r.title = e ? "Exit fullscreen" : "Fullscreen", r.setAttribute("aria-label", r.title);
90
+ r.replaceChildren(x(e ? l : c)), r.title = e ? "Exit fullscreen" : "Fullscreen", r.setAttribute("aria-label", r.title);
90
91
  };
91
92
  return a(), e.cleanup(i.onChange(a)), e.event(r, "click", () => i.toggle()), r;
92
93
  }
93
94
  //#endregion
94
95
  //#region src/ui/format.ts
95
- function E(e) {
96
+ function D(e) {
96
97
  return e >= 1e6 ? `${(e / 1e6).toFixed(1)} Mbps` : e >= 1e3 ? `${(e / 1e3).toFixed(0)} kbps` : `${Math.round(e)} bps`;
97
98
  }
98
- function D(e) {
99
+ function O(e) {
99
100
  return e < 1e3 ? `${Math.round(e)} ms` : `${(e / 1e3).toFixed(2)} s`;
100
101
  }
101
- function O(e) {
102
+ function ee(e) {
102
103
  return `${(e / 1e3).toFixed(1)} kHz`;
103
104
  }
104
105
  function k(e) {
@@ -106,7 +107,7 @@ function k(e) {
106
107
  }
107
108
  //#endregion
108
109
  //#region src/ui/components/live-badge.ts
109
- function A(e, t, n) {
110
+ function te(e, t, n) {
110
111
  return e ? t === "disconnected" ? {
111
112
  variant: "error",
112
113
  text: "Disconnected"
@@ -130,7 +131,7 @@ function A(e, t, n) {
130
131
  text: "No URL"
131
132
  };
132
133
  }
133
- function ee(e, t, n) {
134
+ function A(e, t, n) {
134
135
  let r = document.createElement("button");
135
136
  r.type = "button", r.className = "badge flex-align-center", r.title = "Latency settings";
136
137
  let i = document.createElement("span");
@@ -139,29 +140,29 @@ function ee(e, t, n) {
139
140
  a.className = "badge-text";
140
141
  let o = document.createElement("span");
141
142
  return o.className = "badge-latency", r.append(i, a, o), e.run((e) => {
142
- let n = e.get(t.connection.url), i = e.get(t.connection.status), o = e.get(t.broadcast.status), { variant: s, text: c } = A(n, i, o);
143
+ let n = e.get(t.connection.url), i = e.get(t.connection.status), o = e.get(t.broadcast.status), { variant: s, text: c } = te(n, i, o);
143
144
  r.style.display = o === "offline" ? "none" : "", r.dataset.variant = s, a.textContent = c.toUpperCase();
144
145
  }), e.run((e) => {
145
- o.textContent = `+${D(e.get(t.backend.sync.buffer))} latency`;
146
+ o.textContent = `+${O(e.get(t.backend.sync.buffer))} latency`;
146
147
  }), e.event(r, "click", () => {
147
148
  n.tab.set("latency"), n.panel.set(!0);
148
149
  }), r;
149
150
  }
150
151
  //#endregion
151
152
  //#region src/ui/components/play-pause.ts
152
- function te(e, t) {
153
- let n = w(p, "Play");
153
+ function j(e, t) {
154
+ let n = T(m, "Play");
154
155
  return e.run((e) => {
155
156
  let r = e.get(t.backend.paused);
156
- n.title = r ? "Play" : "Pause", n.setAttribute("aria-label", n.title), n.replaceChildren(b(r ? p : f));
157
+ n.title = r ? "Play" : "Pause", n.setAttribute("aria-label", n.title), n.replaceChildren(x(r ? m : p));
157
158
  }), e.event(n, "click", () => {
158
159
  t.paused = !t.paused;
159
160
  }), n;
160
161
  }
161
162
  //#endregion
162
163
  //#region src/ui/components/settings-button.ts
163
- function j(e, t) {
164
- let n = w(m, "Settings");
164
+ function M(e, t) {
165
+ let n = T(h, "Settings");
165
166
  return e.run((e) => {
166
167
  let r = e.get(t.panel);
167
168
  n.classList.toggle("control--active", r), n.title = r ? "Close settings" : "Settings", n.setAttribute("aria-label", n.title), n.setAttribute("aria-expanded", String(r));
@@ -171,10 +172,10 @@ function j(e, t) {
171
172
  }
172
173
  //#endregion
173
174
  //#region src/ui/components/volume-slider.ts
174
- function M(e, t) {
175
- return t || e === 0 ? u : e <= 33 ? v : e <= 66 ? y : _;
176
- }
177
175
  function N(e, t) {
176
+ return t || e === 0 ? d : e <= 33 ? y : e <= 66 ? b : v;
177
+ }
178
+ function P(e, t) {
178
179
  let n = document.createElement("div");
179
180
  n.className = "volume flex-align-center";
180
181
  let r = document.createElement("button");
@@ -182,7 +183,7 @@ function N(e, t) {
182
183
  let i = document.createElement("input");
183
184
  return i.type = "range", i.className = "volume-track", i.min = "0", i.max = "100", i.setAttribute("aria-label", "Volume"), n.append(r, i), e.run((e) => {
184
185
  let n = e.get(t.backend.audio.volume), a = e.get(t.backend.audio.muted), o = Math.round(n * 100), s = a ? 0 : o;
185
- i.value = s.toString(), i.style.setProperty("--fill", `${s}%`), r.title = a ? "Unmute" : "Mute", r.setAttribute("aria-label", r.title), r.replaceChildren(b(M(o, a)));
186
+ i.value = s.toString(), i.style.setProperty("--fill", `${s}%`), r.title = a ? "Unmute" : "Mute", r.setAttribute("aria-label", r.title), r.replaceChildren(x(N(o, a)));
186
187
  }), e.event(i, "input", () => {
187
188
  let e = Number.parseFloat(i.value) / 100;
188
189
  t.backend.audio.volume.set(e), e > 0 && t.backend.audio.muted.set(!1);
@@ -192,15 +193,15 @@ function N(e, t) {
192
193
  }
193
194
  //#endregion
194
195
  //#region src/ui/components/control-bar.ts
195
- function P(e, t, r, i) {
196
- let a = n.create("div", { className: "controls" }), o = n.create("div", { className: "controls-group" });
197
- o.append(te(e, t), N(e, t), ee(e, t, r));
198
- let s = n.create("div", { className: "controls-spacer" }), c = n.create("div", { className: "controls-group" });
199
- return c.append(j(e, r), T(e, i, t)), a.append(o, s, c), a;
196
+ function F(e, t, n, i) {
197
+ let a = r.create("div", { className: "controls" }), o = r.create("div", { className: "controls-group" });
198
+ o.append(j(e, t), P(e, t), A(e, t, n));
199
+ let s = r.create("div", { className: "controls-spacer" }), c = r.create("div", { className: "controls-group" });
200
+ return c.append(M(e, n), E(e, i, t)), a.append(o, s, c), a;
200
201
  }
201
202
  //#endregion
202
203
  //#region src/ui/components/offline-indicator.ts
203
- function F(e, t) {
204
+ function I(e, t) {
204
205
  let n = document.createElement("div");
205
206
  n.className = "watch-ui__offline-indicator", n.setAttribute("role", "status"), n.setAttribute("aria-live", "polite");
206
207
  let r = document.createElement("span");
@@ -211,8 +212,8 @@ function F(e, t) {
211
212
  }
212
213
  //#endregion
213
214
  //#region src/ui/graph.ts
214
- var I = 120;
215
- function L(e, t) {
215
+ var L = 120;
216
+ function R(e, t) {
216
217
  let n = document.createElement("canvas").getContext("2d");
217
218
  if (!n) return e;
218
219
  n.fillStyle = e;
@@ -224,8 +225,8 @@ function L(e, t) {
224
225
  let i = r.match(/[\d.]+/g);
225
226
  return i && i.length >= 3 ? `rgba(${i[0]}, ${i[1]}, ${i[2]}, ${t})` : e;
226
227
  }
227
- function R(e, t, n) {
228
- let r = n?.color ?? "#4ade80", i = L(r, .33), a = L(r, 0), o = Number.isFinite(n?.samples) ? Math.max(1, Math.floor(n?.samples)) : I, s = document.createElement("div");
228
+ function z(e, t, n) {
229
+ let r = n?.color ?? "#4ade80", i = R(r, .33), a = R(r, 0), o = Number.isFinite(n?.samples) ? Math.max(1, Math.floor(n?.samples)) : L, s = document.createElement("div");
229
230
  s.className = "graph";
230
231
  let c = document.createElement("div");
231
232
  c.className = "graph-header";
@@ -269,63 +270,63 @@ function R(e, t, n) {
269
270
  //#endregion
270
271
  //#region src/ui/stats.ts
271
272
  var ne = 250;
272
- function z(e, t, r) {
273
- let i = n.create("div", { className: `stat-card stat-card--${e}` }), a = n.create("div", { className: "stat-head" }), o = n.create("div", { className: "stat-icon" });
274
- o.appendChild(b(r));
275
- let s = n.create("span", {
273
+ function B(e, t, n) {
274
+ let i = r.create("div", { className: `stat-card stat-card--${e}` }), a = r.create("div", { className: "stat-head" }), o = r.create("div", { className: "stat-icon" });
275
+ o.appendChild(x(n));
276
+ let s = r.create("span", {
276
277
  className: "stat-status",
277
278
  style: { display: "none" }
278
279
  });
279
- a.append(o, n.create("span", { className: "stat-title" }, t), s);
280
- let c = n.create("div", { className: "stat-grid" });
280
+ a.append(o, r.create("span", { className: "stat-title" }, t), s);
281
+ let c = r.create("div", { className: "stat-grid" });
281
282
  return i.append(a, c), {
282
283
  el: i,
283
284
  grid: c,
284
285
  status: s
285
286
  };
286
287
  }
287
- function B(e, t) {
288
- let r = n.create("div", { className: "stat-line" }), i = n.create("span", { className: "stat-value" }, "—");
289
- return r.append(n.create("span", { className: "stat-key" }, t), i), e.appendChild(r), i;
288
+ function V(e, t) {
289
+ let n = r.create("div", { className: "stat-line" }), i = r.create("span", { className: "stat-value" }, "—");
290
+ return n.append(r.create("span", { className: "stat-key" }, t), i), e.appendChild(n), i;
290
291
  }
291
- function V(e, t, n) {
292
+ function H(e, t, n) {
292
293
  if (e.bytes <= 0) return;
293
294
  let r = n - e.when, i = t - e.bytes;
294
295
  if (!(i <= 0 || r <= 0)) return i * 8 * (1e3 / r);
295
296
  }
296
- function H(e) {
297
+ function U(e) {
297
298
  return Object.keys(e?.renditions ?? {}).length > 0;
298
299
  }
299
- function U(e, t, n) {
300
+ function W(e, t, n) {
300
301
  t.status.textContent = n.label, e.run((e) => {
301
- let r = H(e.get(n.catalog));
302
+ let r = U(e.get(n.catalog));
302
303
  t.el.style.display = r ? "" : "none", t.status.style.display = r && e.get(n.flag) ? "" : "none";
303
304
  });
304
305
  }
305
- function W(e, t) {
306
- let r = n.create("div", { className: "tab-body stats" }), a = z("video", "Video", g), o = B(a.grid, "Resolution"), s = B(a.grid, "Codec"), c = R(e, "Bitrate", {
306
+ function G(e, t) {
307
+ let n = r.create("div", { className: "tab-body stats" }), i = B("video", "Video", _), o = V(i.grid, "Resolution"), s = V(i.grid, "Codec"), c = z(e, "Bitrate", {
307
308
  color: "#a855f7",
308
- format: E
309
- }), l = R(e, "Frame rate", {
309
+ format: D
310
+ }), l = z(e, "Frame rate", {
310
311
  color: "#facc15",
311
312
  format: k
312
313
  });
313
- a.el.append(c.el, l.el), U(e, a, {
314
+ i.el.append(c.el, l.el), W(e, i, {
314
315
  catalog: t.backend.video.source.catalog,
315
316
  flag: t.backend.paused,
316
317
  label: "paused"
317
318
  });
318
- let u = z("audio", "Audio", i), f = B(u.grid, "Codec"), p = B(u.grid, "Sample rate"), m = B(u.grid, "Channels"), h = B(u.grid, "Bitrate");
319
- U(e, u, {
319
+ let u = B("audio", "Audio", a), d = V(u.grid, "Codec"), p = V(u.grid, "Sample rate"), m = V(u.grid, "Channels"), h = V(u.grid, "Bitrate");
320
+ W(e, u, {
320
321
  catalog: t.backend.audio.source.catalog,
321
322
  flag: t.backend.audio.muted,
322
323
  label: "muted"
323
324
  });
324
- let _ = z("network", "Network", d), v = B(_.grid, "Estimated max"), y = B(_.grid, "Actual"), b = R(e, "Round trip", {
325
+ let g = B("network", "Network", f), v = V(g.grid, "Estimated max"), y = V(g.grid, "Actual"), b = z(e, "Round trip", {
325
326
  color: "#00dfff",
326
- format: (e) => D(e)
327
+ format: (e) => O(e)
327
328
  });
328
- _.el.append(b.el), r.append(a.el, u.el, _.el);
329
+ g.el.append(b.el), n.append(i.el, u.el, g.el);
329
330
  let x = {
330
331
  frames: 0,
331
332
  bytes: 0,
@@ -337,36 +338,36 @@ function W(e, t) {
337
338
  return e.interval(() => {
338
339
  let e = performance.now(), n = t.backend.video.source.config.peek(), r = t.backend.video.source.catalog.peek(), i = t.backend.video.stats.peek(), a = n?.codedWidth ?? r?.display?.width, u = n?.codedHeight ?? r?.display?.height;
339
340
  o.textContent = a && u ? `${a}×${u}` : "—", s.textContent = n?.codec ?? "—";
340
- let d;
341
+ let f;
341
342
  if (i && x.frames > 0) {
342
343
  let t = e - x.when, n = i.frameCount - x.frames;
343
- n > 0 && t > 0 && (d = n / (t / 1e3));
344
+ n > 0 && t > 0 && (f = n / (t / 1e3));
344
345
  }
345
- let g = i ? V(x, i.bytesReceived, e) : void 0;
346
- c.push(g), l.push(d), i && (x = {
346
+ let g = i ? H(x, i.bytesReceived, e) : void 0;
347
+ c.push(g), l.push(f), i && (x = {
347
348
  frames: i.frameCount,
348
349
  bytes: i.bytesReceived,
349
350
  when: e
350
351
  });
351
352
  let _ = t.backend.audio.source.config.peek(), C = t.backend.audio.stats.peek();
352
- f.textContent = _?.codec ?? "—", p.textContent = _?.sampleRate ? O(_.sampleRate) : "—", m.textContent = _?.numberOfChannels ? `${_.numberOfChannels}` : "—";
353
- let w = C ? V(S, C.bytesReceived, e) : void 0;
354
- h.textContent = w === void 0 ? "—" : E(w), C && (S = {
353
+ d.textContent = _?.codec ?? "—", p.textContent = _?.sampleRate ? ee(_.sampleRate) : "—", m.textContent = _?.numberOfChannels ? `${_.numberOfChannels}` : "—";
354
+ let w = C ? H(S, C.bytesReceived, e) : void 0;
355
+ h.textContent = w === void 0 ? "—" : D(w), C && (S = {
355
356
  bytes: C.bytesReceived,
356
357
  when: e
357
358
  });
358
- let T = t.connection.established.peek(), D = T?.recvBandwidth?.peek();
359
- v.textContent = D ? E(D) : "—";
360
- let k = g !== void 0 || w !== void 0 ? (g ?? 0) + (w ?? 0) : void 0;
361
- y.textContent = k === void 0 ? "—" : E(k);
362
- let A = T?.rtt?.peek();
363
- b.push(A !== void 0 && A > 0 ? A : void 0);
364
- }, ne), r;
359
+ let T = t.connection.established.peek(), E = T?.recvBandwidth?.peek();
360
+ v.textContent = E ? D(E) : "—";
361
+ let O = g !== void 0 || w !== void 0 ? (g ?? 0) + (w ?? 0) : void 0;
362
+ y.textContent = O === void 0 ? "—" : D(O);
363
+ let k = T?.rtt?.peek();
364
+ b.push(k !== void 0 && k > 0 ? k : void 0);
365
+ }, ne), n;
365
366
  }
366
367
  //#endregion
367
368
  //#region src/ui/components/buffer-control.ts
368
- var G = 0, K = 10, q = 4e3, J = 48;
369
- function Y(e, t, n, r, i) {
369
+ var K = 0, q = 10, J = 4e3, Y = 48;
370
+ function X(e, t, n, r, i) {
370
371
  let a = e.getContext("2d");
371
372
  if (!a) return;
372
373
  let o = window.devicePixelRatio || 1, s = e.getBoundingClientRect(), c = s.width, l = s.height, u = Math.round(c * o), d = Math.round(l * o);
@@ -382,11 +383,11 @@ function Y(e, t, n, r, i) {
382
383
  }
383
384
  }
384
385
  }
385
- function X(e, t, n = q) {
386
+ function re(e, t, n = J) {
386
387
  let r = document.createElement("div");
387
388
  r.className = "buffer";
388
389
  let i = document.createElement("div");
389
- i.className = "buffer-visualization", i.setAttribute("role", "slider"), i.tabIndex = 0, i.setAttribute("aria-valuemin", G.toString()), i.setAttribute("aria-valuemax", n.toString()), i.setAttribute("aria-label", "Buffer jitter");
390
+ i.className = "buffer-visualization", i.setAttribute("role", "slider"), i.tabIndex = 0, i.setAttribute("aria-valuemin", K.toString()), i.setAttribute("aria-valuemax", n.toString()), i.setAttribute("aria-label", "Buffer jitter");
390
391
  let a = document.createElement("div");
391
392
  a.className = "buffer-playhead";
392
393
  let o = document.createElement("div");
@@ -415,8 +416,8 @@ function X(e, t, n = q) {
415
416
  p.style.left = `${a}%`, m.textContent = `${Math.round(r)}ms`, i.setAttribute("aria-valuenow", r.toString());
416
417
  });
417
418
  let v = (e) => {
418
- let r = i.getBoundingClientRect(), a = r.width - J, o = Math.max(0, Math.min(e - r.left - J, a)) / a * n, s = Math.round(o / K) * K, c = Math.max(G, Math.min(n, s));
419
- t.backend.latency.set(c);
419
+ let r = i.getBoundingClientRect(), a = r.width - Y, o = Math.max(0, Math.min(e - r.left - Y, a)) / a * n, s = Math.round(o / q) * q;
420
+ t.latencyMin = Math.max(K, Math.min(n, s));
420
421
  }, y = () => {
421
422
  _ || (_ = !0, h.style.display = "none");
422
423
  };
@@ -428,22 +429,22 @@ function X(e, t, n = q) {
428
429
  g && (g = !1, i.classList.remove("buffer-visualization--dragging"));
429
430
  }), e.event(i, "keydown", (e) => {
430
431
  let r = 0;
431
- if (e.key === "ArrowRight" || e.key === "ArrowUp") r = K;
432
+ if (e.key === "ArrowRight" || e.key === "ArrowUp") r = q;
432
433
  else if (e.key === "ArrowLeft" || e.key === "ArrowDown") r = -10;
433
434
  else return;
434
435
  e.preventDefault(), y();
435
- let i = t.backend.jitter.peek(), a = Math.max(G, Math.min(n, i + r));
436
- t.backend.latency.set(a);
436
+ let i = t.backend.jitter.peek();
437
+ t.latencyMin = Math.max(K, Math.min(n, i + r));
437
438
  });
438
439
  let b = () => {
439
440
  let r = t.backend.sync.now(), i = t.backend.video.stalled.peek();
440
- Y(c, t.backend.video.buffered.peek(), r, n, i), Y(d, t.backend.audio.buffered.peek(), r, n, i), e.animate(b);
441
+ X(c, t.backend.video.buffered.peek(), r, n, i), X(d, t.backend.audio.buffered.peek(), r, n, i), e.animate(b);
441
442
  };
442
443
  return e.animate(b), r;
443
444
  }
444
445
  //#endregion
445
446
  //#region src/ui/components/latency.ts
446
- var re = [
447
+ var ie = [
447
448
  {
448
449
  label: "Real-time",
449
450
  value: "real-time"
@@ -469,71 +470,71 @@ var re = [
469
470
  value: 2e3
470
471
  }
471
472
  ];
472
- function ie(e, t) {
473
- let r = n.create("div", { className: "tab-body latency" }), i = n.create("div", { className: "latency-presets" }), a = re.map((r) => {
474
- let a = n.create("button", {
473
+ function ae(t, n) {
474
+ let i = r.create("div", { className: "tab-body latency" }), a = r.create("div", { className: "latency-presets" }), o = ie.map((e) => {
475
+ let i = r.create("button", {
475
476
  className: "chip",
476
477
  type: "button"
477
- }, r.label);
478
- return e.event(a, "click", () => {
479
- t.backend.latency.set(r.value === "real-time" ? "real-time" : r.value);
480
- }), i.appendChild(a), {
481
- preset: r,
482
- chip: a
478
+ }, e.label);
479
+ return t.event(i, "click", () => {
480
+ n.latencyMin = e.value === "real-time" ? "real-time" : e.value;
481
+ }), a.appendChild(i), {
482
+ preset: e,
483
+ chip: i
483
484
  };
484
485
  });
485
- e.run((e) => {
486
- let n = e.get(t.backend.latency);
487
- for (let { preset: e, chip: t } of a) {
488
- let r = e.value === "real-time" ? n === "real-time" : n === e.value;
489
- t.classList.toggle("chip--active", r);
486
+ t.run((t) => {
487
+ let r = e(t.get(n.backend.latency)).min;
488
+ for (let { preset: e, chip: t } of o) {
489
+ let n = e.value === "real-time" ? r === "real-time" : r === e.value;
490
+ t.classList.toggle("chip--active", n);
490
491
  }
491
492
  });
492
- let o = X(e, t), s = n.create("div", { className: "latency-readout" }), c = n.create("div", { className: "latency-stat" }), l = n.create("span", { className: "latency-stat-value" }, "—");
493
- c.append(n.create("span", { className: "latency-stat-label" }, "Jitter buffer"), l);
494
- let u = n.create("div", { className: "latency-stat" }), d = n.create("span", { className: "latency-stat-value" }, "—");
495
- u.append(n.create("span", { className: "latency-stat-label" }, "Total buffer"), d), s.append(c, u), e.run((e) => {
496
- let n = e.get(t.backend.latency), r = e.get(t.backend.jitter), i = e.get(t.backend.sync.buffer);
497
- l.textContent = `${D(r)}${n === "real-time" ? " (auto)" : ""}`, d.textContent = D(i);
493
+ let s = re(t, n), c = r.create("div", { className: "latency-readout" }), l = r.create("div", { className: "latency-stat" }), u = r.create("span", { className: "latency-stat-value" }, "—");
494
+ l.append(r.create("span", { className: "latency-stat-label" }, "Jitter buffer"), u);
495
+ let d = r.create("div", { className: "latency-stat" }), f = r.create("span", { className: "latency-stat-value" }, "—");
496
+ d.append(r.create("span", { className: "latency-stat-label" }, "Total buffer"), f), c.append(l, d), t.run((t) => {
497
+ let r = e(t.get(n.backend.latency)).min, i = t.get(n.backend.jitter), a = t.get(n.backend.sync.buffer);
498
+ u.textContent = `${O(i)}${r === "real-time" ? " (auto)" : ""}`, f.textContent = O(a);
498
499
  });
499
- let f = n.create("div", { className: "tab-hint" }, "A larger buffer smooths over network jitter at the cost of latency. Real-time tracks the connection RTT automatically. Drag the timeline to fine-tune.");
500
- return r.append(i, o, s, f), r;
500
+ let p = r.create("div", { className: "tab-hint" }, "A larger buffer smooths over network jitter at the cost of latency. Real-time tracks the connection RTT automatically. Drag the timeline to fine-tune.");
501
+ return i.append(a, s, c, p), i;
501
502
  }
502
503
  //#endregion
503
504
  //#region src/ui/components/quality.ts
504
- function ae(e) {
505
+ function oe(e) {
505
506
  if (e.codedWidth && e.codedHeight) return `${e.codedWidth}×${e.codedHeight}`;
506
507
  }
507
- function oe(e) {
508
+ function se(e) {
508
509
  let t = [];
509
- return e.framerate && t.push(`${Math.round(e.framerate)}fps`), e.bitrate && t.push(E(e.bitrate)), e.codec && t.push(e.codec), t.join(" · ");
510
+ return e.framerate && t.push(`${Math.round(e.framerate)}fps`), e.bitrate && t.push(D(e.bitrate)), e.codec && t.push(e.codec), t.join(" · ");
510
511
  }
511
- function Z(e, t, r, i, o, s) {
512
- let c = n.create("button", {
512
+ function Z(e, t, n, i, a, s) {
513
+ let c = r.create("button", {
513
514
  className: "q-row",
514
515
  type: "button"
515
516
  });
516
517
  i && c.classList.add("q-row--selected");
517
- let l = n.create("span", { className: "q-row-check" });
518
- i && l.appendChild(b(a));
519
- let u = n.create("div", { className: "q-row-body" }), d = n.create("span", { className: "q-row-title" }, t);
520
- if (o) {
521
- let e = n.create("span", { className: "q-row-playing" }, "playing");
518
+ let l = r.create("span", { className: "q-row-check" });
519
+ i && l.appendChild(x(o));
520
+ let u = r.create("div", { className: "q-row-body" }), d = r.create("span", { className: "q-row-title" }, t);
521
+ if (a) {
522
+ let e = r.create("span", { className: "q-row-playing" }, "playing");
522
523
  d.appendChild(e);
523
524
  }
524
- let f = n.create("span", { className: "q-row-sub" }, r);
525
+ let f = r.create("span", { className: "q-row-sub" }, n);
525
526
  return u.append(d, f), c.append(l, u), e.event(c, "click", s), c;
526
527
  }
527
- function se(e, t) {
528
- let r = n.create("div", { className: "tab-body q-list" });
528
+ function Q(e, t) {
529
+ let n = r.create("div", { className: "tab-body q-list" });
529
530
  return e.run((e) => {
530
531
  let i = t.backend.video.source, a = e.get(i.catalog), o = e.get(i.target), s = e.get(i.track), c = a?.renditions ?? {}, l = Object.entries(c);
531
- if (r.replaceChildren(), l.length === 0) {
532
- r.appendChild(n.create("div", { className: "tab-empty" }, "No video renditions"));
532
+ if (n.replaceChildren(), l.length === 0) {
533
+ n.appendChild(r.create("div", { className: "tab-empty" }, "No video renditions"));
533
534
  return;
534
535
  }
535
536
  let u = o?.name, d = s && !u ? `auto · currently ${s}` : "adapts to bandwidth";
536
- r.appendChild(Z(e, "Auto", d, !u, !1, () => {
537
+ n.appendChild(Z(e, "Auto", d, !u, !1, () => {
537
538
  i.target.update((e) => ({
538
539
  ...e,
539
540
  name: void 0
@@ -542,94 +543,94 @@ function se(e, t) {
542
543
  let n = (e[1].codedWidth ?? 0) * (e[1].codedHeight ?? 0);
543
544
  return (t[1].codedWidth ?? 0) * (t[1].codedHeight ?? 0) - n;
544
545
  });
545
- for (let [t, n] of l) {
546
- let a = ae(n) ?? t;
547
- r.appendChild(Z(e, a, oe(n), u === t, s === t, () => {
546
+ for (let [t, r] of l) {
547
+ let a = oe(r) ?? t;
548
+ n.appendChild(Z(e, a, se(r), u === t, s === t, () => {
548
549
  i.target.update((e) => ({
549
550
  ...e,
550
551
  name: t
551
552
  }));
552
553
  }));
553
554
  }
554
- }), r;
555
+ }), n;
555
556
  }
556
557
  //#endregion
557
558
  //#region src/ui/components/settings-panel.ts
558
- var Q = [
559
+ var ce = [
559
560
  {
560
561
  id: "quality",
561
562
  label: "Quality",
562
- svg: g
563
+ svg: _
563
564
  },
564
565
  {
565
566
  id: "latency",
566
567
  label: "Latency",
567
- svg: l
568
+ svg: u
568
569
  },
569
570
  {
570
571
  id: "stats",
571
572
  label: "Stats",
572
- svg: h
573
+ svg: g
573
574
  }
574
575
  ];
575
- function ce(e, t, r) {
576
- let i = n.create("div", { className: "panel" });
576
+ function le(e, t, n) {
577
+ let i = r.create("div", { className: "panel" });
577
578
  i.setAttribute("role", "dialog"), i.setAttribute("aria-label", "Player settings");
578
- let a = n.create("div", { className: "panel-head" }), s = n.create("div", { className: "panel-head-title flex-align-center" });
579
- s.append(b(m), n.create("span", {}, "Settings"));
580
- let c = n.create("button", {
579
+ let a = r.create("div", { className: "panel-head" }), o = r.create("div", { className: "panel-head-title flex-align-center" });
580
+ o.append(x(h), r.create("span", {}, "Settings"));
581
+ let c = r.create("button", {
581
582
  className: "control flex-center",
582
583
  type: "button"
583
584
  });
584
- c.title = "Close", c.setAttribute("aria-label", "Close settings"), c.appendChild(b(o)), e.event(c, "click", () => r.panel.set(!1)), a.append(s, c);
585
- let l = "panel-body", u = n.create("div", { className: "panel-tabs" });
585
+ c.title = "Close", c.setAttribute("aria-label", "Close settings"), c.appendChild(x(s)), e.event(c, "click", () => n.panel.set(!1)), a.append(o, c);
586
+ let l = "panel-body", u = r.create("div", { className: "panel-tabs" });
586
587
  u.setAttribute("role", "tablist");
587
- let d = Q.map((t) => {
588
- let i = n.create("button", {
588
+ let d = ce.map((t) => {
589
+ let i = r.create("button", {
589
590
  className: "panel-tab",
590
591
  type: "button",
591
592
  id: `tab-${t.id}`
592
593
  });
593
- return i.setAttribute("role", "tab"), i.setAttribute("aria-controls", l), i.append(b(t.svg), n.create("span", {}, t.label)), e.event(i, "click", () => r.tab.set(t.id)), u.appendChild(i), {
594
+ return i.setAttribute("role", "tab"), i.setAttribute("aria-controls", l), i.append(x(t.svg), r.create("span", {}, t.label)), e.event(i, "click", () => n.tab.set(t.id)), u.appendChild(i), {
594
595
  tab: t,
595
596
  btn: i
596
597
  };
597
- }), f = n.create("div", {
598
+ }), f = r.create("div", {
598
599
  className: "panel-body",
599
600
  id: l
600
601
  });
601
602
  return f.setAttribute("role", "tabpanel"), e.run((e) => {
602
- let t = e.get(r.tab);
603
+ let t = e.get(n.tab);
603
604
  f.setAttribute("aria-labelledby", `tab-${t}`);
604
605
  for (let { tab: e, btn: n } of d) {
605
606
  let r = e.id === t;
606
607
  n.classList.toggle("panel-tab--active", r), n.setAttribute("aria-selected", String(r)), n.tabIndex = r ? 0 : -1;
607
608
  }
608
609
  }), e.run((e) => {
609
- if (!e.get(r.panel)) return;
610
- let i = e.get(r.tab), a = i === "quality" ? se(e, t) : i === "latency" ? ie(e, t) : W(e, t);
611
- n.render(e, f, a);
610
+ if (!e.get(n.panel)) return;
611
+ let i = e.get(n.tab), a = i === "quality" ? Q(e, t) : i === "latency" ? ae(e, t) : G(e, t);
612
+ r.render(e, f, a);
612
613
  }), i.append(a, u, f), e.run((e) => {
613
- let t = e.get(r.panel);
614
+ let t = e.get(n.panel);
614
615
  i.classList.toggle("panel--open", t), i.setAttribute("aria-hidden", String(!t));
615
616
  }), i;
616
617
  }
617
618
  //#endregion
618
619
  //#region src/ui/styles/index.css?inline
619
- var le = "*,:before,:after{box-sizing:border-box}:host{--color-white:#fff;--color-white-alpha-05:#ffffff0d;--color-white-alpha-10:#ffffff1a;--color-white-alpha-15:#ffffff26;--color-white-alpha-20:#fff3;--color-white-alpha-25:#ffffff40;--color-white-alpha-30:#ffffff4d;--color-white-alpha-40:#fff6;--color-white-alpha-60:#fff9;--color-white-alpha-70:#ffffffb3;--color-white-alpha-90:#ffffffe6;--color-gray-100:#9ca3af;--color-gray-400:#6b7280;--color-gray-950:#1a1a1a;--color-blue-400:#00dfff;--color-blue-500:#52a1ff;--color-blue-900:#1b3243;--color-purple-400:#a855f7;--color-purple-900:#31144a;--color-green-400:#65ee2e;--color-green-500:#22c55e;--color-green-900:#3d4928;--color-yellow-400:#facc15;--color-orange-400:#f90;--color-orange-450:#fb923c;--color-orange-500:#f97316;--color-orange-900:#4d301b;--color-red-400:#f87171;--color-amber-600:#d97706;--color-orange-500-alpha-60:#f9731699;--color-orange-500-alpha-80:#f97316cc;--color-black-alpha-08:#00000014;--color-black-alpha-10:#0000001a;--color-black-alpha-40:#0006;--color-black-alpha-60:#0009;--color-black-alpha-85:#000000d9;--color-panel:#121214eb;--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:.375rem;--border-radius-md:.5rem;--border-radius-lg:.75rem;--accent:var(--color-orange-400);--ease:cubic-bezier(.4, 0, .2, 1);font-family:system-ui,Segoe UI,Roboto,sans-serif}.flex-center{justify-content:center;align-items:center;display:flex}.flex-align-center{align-items:center;display:flex}.control{width:2.25rem;height:2.25rem;color:var(--color-white);cursor:pointer;transition:background-color .12s var(--ease), transform .12s var(--ease), color .12s var(--ease);background:0 0;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:inline-flex}.control svg{width:1.25rem;height:1.25rem}.control:hover:not(:disabled){background-color:var(--color-white-alpha-15)}.control:active:not(:disabled){transform:scale(.92)}.control--active{color:var(--accent)}.control:disabled{opacity:.4;cursor:default}.chip{padding:var(--spacing-4) var(--spacing-12);color:var(--color-white-alpha-70);background-color:var(--color-white-alpha-10);border:var(--spacing-1) solid transparent;cursor:pointer;transition:background-color .12s var(--ease), color .12s var(--ease), border-color .12s var(--ease);border-radius:999px;font-size:.75rem;font-weight:500}.chip:hover{background-color:var(--color-white-alpha-20);color:var(--color-white)}.chip--active{color:var(--color-gray-950);background-color:var(--accent);border-color:var(--accent)}:host{display:block;position:relative}.player{border-radius:var(--spacing-8);background:#000;width:100%;line-height:0;position:relative;overflow:hidden}.player ::slotted(moq-watch){width:100%;display:block}.player:not(.player--chrome){cursor:none}.player:fullscreen,.player--pseudo-fullscreen{border-radius:0;justify-content:center;align-items:center;display:flex}.player:-webkit-full-screen{border-radius:0;justify-content:center;align-items:center;display:flex}.player--pseudo-fullscreen{z-index:2147483647;width:100vw;height:100vh;position:fixed;inset:0}.player:fullscreen ::slotted(moq-watch),.player--pseudo-fullscreen ::slotted(moq-watch){max-height:100%}.player:-webkit-full-screen ::slotted(moq-watch){max-height:100%}.scrim{pointer-events:none;opacity:0;transition:opacity .2s var(--ease);position:absolute;left:0;right:0}.scrim--top{background:linear-gradient(to bottom, var(--color-black-alpha-40), transparent);height:25%;top:0}.scrim--bottom{background:linear-gradient(to top, var(--color-black-alpha-60), transparent 60%);height:100%;bottom:0}.player--chrome .scrim{opacity:1}.center{pointer-events:none;justify-content:center;align-items:center;line-height:1;display:flex;position:absolute;inset:0}.center-play{pointer-events:auto;width:4.5rem;height:4.5rem;color:var(--color-white);background:linear-gradient(to bottom right, var(--color-orange-400), var(--color-orange-500), var(--color-amber-600));cursor:pointer;box-shadow:0 var(--spacing-8) var(--spacing-24) var(--color-black-alpha-40);transition:transform .15s var(--ease), box-shadow .15s var(--ease);border:none;border-radius:50%}.center-play svg{width:2rem;height:2rem}.center-play:hover{box-shadow:0 var(--spacing-8) var(--spacing-32) var(--color-orange-500-alpha-60);transform:scale(1.06)}.center-play:active{transform:scale(.97)}.chrome{opacity:0;pointer-events:none;transition:opacity .2s var(--ease), transform .2s var(--ease);flex-direction:column;justify-content:flex-end;line-height:1.4;display:flex;position:absolute;bottom:0;left:0;right:0;transform:translateY(.5rem)}.player--chrome .chrome{opacity:1;pointer-events:auto;transform:translateY(0)}.controls{align-items:center;gap:var(--spacing-4);padding:var(--spacing-8) var(--spacing-12) var(--spacing-12);display:flex;position:relative}.controls-group{align-items:center;gap:var(--spacing-4);display:flex}.controls-spacer{flex:1}.volume{gap:var(--spacing-4)}.volume-track{appearance:none;background:linear-gradient(to right, var(--color-white) 0%, var(--color-white) var(--fill,50%), var(--color-white-alpha-30) var(--fill,50%));cursor:pointer;opacity:0;width:0;max-width:0;height:.25rem;transition:width .16s var(--ease), max-width .16s var(--ease), opacity .16s var(--ease);border-radius:999px;outline:none;margin:0}.volume:hover .volume-track,.volume:focus-within .volume-track{opacity:1;width:4.5rem;max-width:4.5rem}.volume-track::-webkit-slider-thumb{appearance:none;background:var(--color-white);cursor:pointer;border:none;border-radius:50%;width:.75rem;height:.75rem}.volume-track::-moz-range-thumb{background:var(--color-white);cursor:pointer;border:none;border-radius:50%;width:.75rem;height:.75rem}.badge{gap:var(--spacing-8);height:2.25rem;padding:0 var(--spacing-12);margin-left:var(--spacing-4);color:var(--color-white);border-radius:var(--border-radius-sm);cursor:pointer;transition:background-color .12s var(--ease);background:0 0;border:none;font-size:.8125rem}.badge:hover{background-color:var(--color-white-alpha-10)}.badge-dot{background:var(--color-gray-400);border-radius:50%;flex-shrink:0;width:.5rem;height:.5rem}.badge-text{letter-spacing:.04em;font-weight:600}.badge-latency{max-width:0;margin-left:calc(-1 * var(--spacing-8));opacity:0;white-space:nowrap;font-variant-numeric:tabular-nums;color:var(--color-white-alpha-60);transition:max-width .16s var(--ease), margin-left .16s var(--ease), opacity .16s var(--ease);overflow:hidden}.badge:hover .badge-latency,.badge:focus-visible .badge-latency{opacity:1;max-width:9rem;margin-left:0}.badge[data-variant=live] .badge-dot{background:var(--color-red-400);animation:badge-pulse 2s var(--ease) infinite;box-shadow:0 0 #f87171b3}.badge[data-variant=live] .badge-text{color:var(--color-red-400)}.badge[data-variant=loading] .badge-dot,.badge[data-variant=connecting] .badge-dot{background:var(--color-yellow-400)}.badge[data-variant=error] .badge-dot{background:var(--color-gray-400)}.badge[data-variant=error] .badge-text{color:var(--color-gray-100)}@keyframes badge-pulse{0%{box-shadow:0 0 #f8717199}70%{box-shadow:0 0 0 .4rem #f8717100}to{box-shadow:0 0 #f8717100}}.panel{top:var(--spacing-8);right:var(--spacing-8);bottom:var(--spacing-8);width:20rem;max-width:calc(100% - var(--spacing-16));background:var(--color-panel);backdrop-filter:blur(12px);border:var(--spacing-1) solid var(--color-white-alpha-15);border-radius:var(--border-radius-lg);box-shadow:0 var(--spacing-8) var(--spacing-32) var(--color-black-alpha-60);color:var(--color-white);z-index:4;opacity:0;pointer-events:none;transition:opacity .2s var(--ease), transform .2s var(--ease);flex-direction:column;line-height:1.4;display:flex;position:absolute;overflow:hidden;transform:translate(.75rem)}.panel--open{opacity:1;pointer-events:auto;transform:translate(0)}.panel-head{padding:var(--spacing-8) var(--spacing-8) var(--spacing-8) var(--spacing-16);border-bottom:var(--spacing-1) solid var(--color-white-alpha-10);justify-content:space-between;align-items:center;display:flex}.panel-head-title{gap:var(--spacing-8);font-size:.875rem;font-weight:600}.panel-head-title svg{width:1.125rem;height:1.125rem}.panel-head .control{width:2rem;height:2rem}.panel-tabs{padding:var(--spacing-8);gap:var(--spacing-4);display:flex}.panel-tab{align-items:center;gap:var(--spacing-4);padding:var(--spacing-8) var(--spacing-4);color:var(--color-white-alpha-60);border-radius:var(--border-radius-md);cursor:pointer;transition:background-color .12s var(--ease), color .12s var(--ease);background:0 0;border:none;flex-direction:column;flex:1;font-size:.6875rem;font-weight:500;display:flex}.panel-tab svg{width:1.125rem;height:1.125rem}.panel-tab:hover{background-color:var(--color-white-alpha-05);color:var(--color-white)}.panel-tab--active{background-color:var(--color-white-alpha-10);color:var(--color-white)}.panel-body{scrollbar-width:thin;scrollbar-color:var(--color-white-alpha-20) transparent;flex:1;min-height:0;overflow-y:auto}.panel-body::-webkit-scrollbar{width:.375rem}.panel-body::-webkit-scrollbar-thumb{background:var(--color-white-alpha-20);border-radius:999px}.tab-body{gap:var(--spacing-12);padding:var(--spacing-12) var(--spacing-16) var(--spacing-16);flex-direction:column;display:flex}.tab-empty{padding:var(--spacing-24) 0;text-align:center;color:var(--color-white-alpha-40);font-size:.8125rem}.tab-hint{color:var(--color-white-alpha-40);font-size:.6875rem;line-height:1.5}.q-list{gap:var(--spacing-2)}.q-row{align-items:center;gap:var(--spacing-8);width:100%;padding:var(--spacing-8);text-align:left;color:var(--color-white);border-radius:var(--border-radius-md);cursor:pointer;transition:background-color .12s var(--ease);background:0 0;border:none;display:flex}.q-row:hover{background-color:var(--color-white-alpha-05)}.q-row--selected{background-color:var(--color-white-alpha-10)}.q-row-check{width:1rem;color:var(--accent);flex-shrink:0;justify-content:center;align-items:center;display:flex}.q-row-check svg{width:1rem;height:1rem}.q-row-body{flex-direction:column;gap:.1rem;min-width:0;display:flex}.q-row-title{align-items:center;gap:var(--spacing-8);font-size:.8125rem;font-weight:600;display:flex}.q-row-playing{letter-spacing:.06em;text-transform:uppercase;color:var(--color-green-500);background:var(--color-green-900);padding:.05rem var(--spacing-4);border-radius:var(--border-radius-sm);font-size:.5625rem;font-weight:600}.q-row-sub{color:var(--color-white-alpha-60);text-overflow:ellipsis;white-space:nowrap;font-size:.6875rem;overflow:hidden}.latency-presets{gap:var(--spacing-4);flex-wrap:wrap;display:flex}.latency-readout{gap:var(--spacing-8);display:flex}.latency-stat{gap:var(--spacing-2);padding:var(--spacing-8) var(--spacing-12);background:var(--color-white-alpha-05);border-radius:var(--border-radius-md);flex-direction:column;flex:1;display:flex}.latency-stat-label{text-transform:uppercase;letter-spacing:.05em;color:var(--color-white-alpha-40);font-size:.625rem}.latency-stat-value{font-variant-numeric:tabular-nums;color:var(--accent);font-size:.9375rem;font-weight:600}.stat-card{gap:var(--spacing-8);padding:var(--spacing-12);background:var(--color-white-alpha-05);border-radius:var(--border-radius-md);flex-direction:column;display:flex}.stat-head{align-items:center;gap:var(--spacing-8);display:flex}.stat-icon{border-radius:var(--border-radius-sm);justify-content:center;align-items:center;width:1.5rem;height:1.5rem;display:flex}.stat-icon svg{width:.875rem;height:.875rem}.stat-title{text-transform:uppercase;letter-spacing:.05em;font-size:.75rem;font-weight:600}.stat-status{letter-spacing:.06em;text-transform:uppercase;color:var(--color-gray-100);background:var(--color-white-alpha-10);padding:.05rem var(--spacing-8);border-radius:var(--border-radius-sm);margin-left:auto;font-size:.5625rem;font-weight:600}.stat-card--video .stat-icon{background:var(--color-purple-900);color:var(--color-purple-400)}.stat-card--video .stat-title{color:var(--color-purple-400)}.stat-card--audio .stat-icon{background:var(--color-green-900);color:var(--color-green-400)}.stat-card--audio .stat-title{color:var(--color-green-400)}.stat-card--network .stat-icon{background:var(--color-blue-900);color:var(--color-blue-400)}.stat-card--network .stat-title{color:var(--color-blue-400)}.stat-grid{gap:var(--spacing-2) var(--spacing-12);grid-template-columns:auto 1fr;display:grid}.stat-line{display:contents}.stat-key{color:var(--color-white-alpha-60);font-size:.75rem}.stat-value{text-align:right;font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap;font-size:.75rem;font-weight:600;overflow:hidden}.graph{gap:var(--spacing-2);margin-top:var(--spacing-4);flex-direction:column;display:flex}.graph-header{justify-content:space-between;align-items:baseline;display:flex}.graph-label{text-transform:uppercase;letter-spacing:.05em;color:var(--color-white-alpha-40);font-size:.625rem}.graph-value{font-variant-numeric:tabular-nums;font-size:.6875rem;font-weight:600}.graph-canvas{width:100%;height:2.5rem;display:block}.buffer{width:100%}.buffer-visualization{background:var(--color-white-alpha-10);border-radius:var(--spacing-4);cursor:pointer;user-select:none;width:100%;height:3.75rem;padding-left:var(--spacing-48);box-sizing:border-box;position:relative}.buffer-playhead{left:var(--spacing-48);width:var(--spacing-2);background:var(--color-white);z-index:3;position:absolute;top:0;bottom:0}.buffer-track{left:var(--spacing-48);height:var(--spacing-24);align-items:center;display:flex;position:absolute;right:0}.buffer-track--video{top:var(--spacing-4)}.buffer-track--audio{top:var(--spacing-32)}.buffer-track-label{width:2.5rem;color:var(--color-white-alpha-70);text-align:right;padding-right:var(--spacing-4);pointer-events:none;box-sizing:border-box;font-size:.625rem;position:absolute;left:-2.875rem}.buffer-canvas{width:100%;height:100%;position:absolute;top:0;left:0}.buffer-target-area{top:0;bottom:0;left:var(--spacing-48);pointer-events:none;position:absolute;right:0}.buffer-target-line{background:var(--color-orange-400,var(--color-orange-450));z-index:2;cursor:ew-resize;border-radius:var(--spacing-1);pointer-events:auto;width:.1875rem;position:absolute;top:0;bottom:0}.buffer-target-label{color:var(--color-orange-400,var(--color-orange-450));white-space:nowrap;margin-bottom:var(--spacing-2);opacity:0;pointer-events:none;font-size:.6875rem;font-weight:500;transition:opacity .15s;position:absolute;bottom:100%;left:50%;transform:translate(-50%)}.buffer-visualization:hover .buffer-target-label,.buffer-visualization--dragging .buffer-target-label{opacity:1}.buffer-help{color:var(--color-white-alpha-30,#ffffff4d);pointer-events:none;white-space:nowrap;font-size:.75rem;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.buffering{z-index:1;background-color:var(--color-black-alpha-40);width:100%;height:100%;backdrop-filter:blur(var(--spacing-2));pointer-events:auto;justify-content:center;align-items:center;display:flex;position:absolute;top:0;left:0}.buffering-spinner{border:var(--spacing-4) solid var(--color-white-alpha-20);border-top:var(--spacing-4) solid var(--color-white);border-radius:50%;width:2.5rem;height:2.5rem;animation:1s linear infinite buffer-spin}@keyframes buffer-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.watch-ui__offline-indicator{z-index:4;pointer-events:auto;background-color:#000;border-radius:.25rem;justify-content:center;align-items:center;padding:.5rem 1rem;display:flex;position:absolute;bottom:1rem;right:1rem}.watch-ui__offline-text{color:#fff;letter-spacing:.08em;text-shadow:none;font-size:.875rem;font-weight:700}@media (width<=768px){.watch-ui__offline-indicator{padding:.375rem .75rem;bottom:.75rem;right:.75rem}.watch-ui__offline-text{font-size:.75rem}}@media (width<=480px){.watch-ui__offline-indicator{padding:.25rem .5rem;bottom:.5rem;right:.5rem}.watch-ui__offline-text{font-size:.75rem}}", ue = 2800, $ = class extends HTMLElement {
620
+ var ue = "*,:before,:after{box-sizing:border-box}:host{--color-white:#fff;--color-white-alpha-05:#ffffff0d;--color-white-alpha-10:#ffffff1a;--color-white-alpha-15:#ffffff26;--color-white-alpha-20:#fff3;--color-white-alpha-25:#ffffff40;--color-white-alpha-30:#ffffff4d;--color-white-alpha-40:#fff6;--color-white-alpha-60:#fff9;--color-white-alpha-70:#ffffffb3;--color-white-alpha-90:#ffffffe6;--color-gray-100:#9ca3af;--color-gray-400:#6b7280;--color-gray-950:#1a1a1a;--color-blue-400:#00dfff;--color-blue-500:#52a1ff;--color-blue-900:#1b3243;--color-purple-400:#a855f7;--color-purple-900:#31144a;--color-green-400:#65ee2e;--color-green-500:#22c55e;--color-green-900:#3d4928;--color-yellow-400:#facc15;--color-orange-400:#f90;--color-orange-450:#fb923c;--color-orange-500:#f97316;--color-orange-900:#4d301b;--color-red-400:#f87171;--color-amber-600:#d97706;--color-orange-500-alpha-60:#f9731699;--color-orange-500-alpha-80:#f97316cc;--color-black-alpha-08:#00000014;--color-black-alpha-10:#0000001a;--color-black-alpha-40:#0006;--color-black-alpha-60:#0009;--color-black-alpha-85:#000000d9;--color-panel:#121214eb;--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:.375rem;--border-radius-md:.5rem;--border-radius-lg:.75rem;--accent:var(--color-orange-400);--ease:cubic-bezier(.4, 0, .2, 1);font-family:system-ui,Segoe UI,Roboto,sans-serif}.flex-center{justify-content:center;align-items:center;display:flex}.flex-align-center{align-items:center;display:flex}.control{width:2.25rem;height:2.25rem;color:var(--color-white);cursor:pointer;transition:background-color .12s var(--ease), transform .12s var(--ease), color .12s var(--ease);background:0 0;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:inline-flex}.control svg{width:1.25rem;height:1.25rem}.control:hover:not(:disabled){background-color:var(--color-white-alpha-15)}.control:active:not(:disabled){transform:scale(.92)}.control--active{color:var(--accent)}.control:disabled{opacity:.4;cursor:default}.chip{padding:var(--spacing-4) var(--spacing-12);color:var(--color-white-alpha-70);background-color:var(--color-white-alpha-10);border:var(--spacing-1) solid transparent;cursor:pointer;transition:background-color .12s var(--ease), color .12s var(--ease), border-color .12s var(--ease);border-radius:999px;font-size:.75rem;font-weight:500}.chip:hover{background-color:var(--color-white-alpha-20);color:var(--color-white)}.chip--active{color:var(--color-gray-950);background-color:var(--accent);border-color:var(--accent)}:host{display:block;position:relative}.player{border-radius:var(--spacing-8);background:#000;justify-content:center;align-items:center;width:100%;line-height:0;display:flex;position:relative;overflow:hidden}.player ::slotted(moq-watch){width:100%;line-height:0;display:block}.player:not(.player--chrome){cursor:none}.player:fullscreen,.player--pseudo-fullscreen{border-radius:0;justify-content:center;align-items:center;display:flex}.player:-webkit-full-screen{border-radius:0;justify-content:center;align-items:center;display:flex}.player--pseudo-fullscreen{z-index:2147483647;width:100vw;height:100vh;position:fixed;inset:0}@supports (height:100dvh){.player--pseudo-fullscreen{height:100dvh}}.player:fullscreen ::slotted(moq-watch),.player--pseudo-fullscreen ::slotted(moq-watch){width:100%;height:100%;max-height:100%}.player:-webkit-full-screen ::slotted(moq-watch){width:100%;height:100%;max-height:100%}.scrim{pointer-events:none;opacity:0;transition:opacity .2s var(--ease);position:absolute;left:0;right:0}.scrim--top{background:linear-gradient(to bottom, var(--color-black-alpha-40), transparent);height:25%;top:0}.scrim--bottom{background:linear-gradient(to top, var(--color-black-alpha-60), transparent 60%);height:100%;bottom:0}.player--chrome .scrim{opacity:1}.center{pointer-events:none;justify-content:center;align-items:center;line-height:1;display:flex;position:absolute;inset:0}.center-play{pointer-events:auto;width:4.5rem;height:4.5rem;color:var(--color-white);background:linear-gradient(to bottom right, var(--color-orange-400), var(--color-orange-500), var(--color-amber-600));cursor:pointer;box-shadow:0 var(--spacing-8) var(--spacing-24) var(--color-black-alpha-40);transition:transform .15s var(--ease), box-shadow .15s var(--ease);border:none;border-radius:50%}.center-play svg{width:2rem;height:2rem}.center-play:hover{box-shadow:0 var(--spacing-8) var(--spacing-32) var(--color-orange-500-alpha-60);transform:scale(1.06)}.center-play:active{transform:scale(.97)}.chrome{opacity:0;pointer-events:none;transition:opacity .2s var(--ease), transform .2s var(--ease);flex-direction:column;justify-content:flex-end;line-height:1.4;display:flex;position:absolute;bottom:0;left:0;right:0;transform:translateY(.5rem)}.player--chrome .chrome{opacity:1;pointer-events:auto;transform:translateY(0)}.controls{align-items:center;gap:var(--spacing-4);padding:var(--spacing-8) var(--spacing-12) var(--spacing-12);display:flex;position:relative}.controls-group{align-items:center;gap:var(--spacing-4);display:flex}.controls-spacer{flex:1}.volume{gap:var(--spacing-4)}.volume-track{appearance:none;background:linear-gradient(to right, var(--color-white) 0%, var(--color-white) var(--fill,50%), var(--color-white-alpha-30) var(--fill,50%));cursor:pointer;opacity:0;width:0;max-width:0;height:.25rem;transition:width .16s var(--ease), max-width .16s var(--ease), opacity .16s var(--ease);border-radius:999px;outline:none;margin:0}.volume:hover .volume-track,.volume:focus-within .volume-track{opacity:1;width:4.5rem;max-width:4.5rem}.volume-track::-webkit-slider-thumb{appearance:none;background:var(--color-white);cursor:pointer;border:none;border-radius:50%;width:.75rem;height:.75rem}.volume-track::-moz-range-thumb{background:var(--color-white);cursor:pointer;border:none;border-radius:50%;width:.75rem;height:.75rem}.badge{gap:var(--spacing-8);height:2.25rem;padding:0 var(--spacing-12);margin-left:var(--spacing-4);color:var(--color-white);border-radius:var(--border-radius-sm);cursor:pointer;transition:background-color .12s var(--ease);background:0 0;border:none;font-size:.8125rem}.badge:hover{background-color:var(--color-white-alpha-10)}.badge-dot{background:var(--color-gray-400);border-radius:50%;flex-shrink:0;width:.5rem;height:.5rem}.badge-text{letter-spacing:.04em;font-weight:600}.badge-latency{max-width:0;margin-left:calc(-1 * var(--spacing-8));opacity:0;white-space:nowrap;font-variant-numeric:tabular-nums;color:var(--color-white-alpha-60);transition:max-width .16s var(--ease), margin-left .16s var(--ease), opacity .16s var(--ease);overflow:hidden}.badge:hover .badge-latency,.badge:focus-visible .badge-latency{opacity:1;max-width:9rem;margin-left:0}.badge[data-variant=live] .badge-dot{background:var(--color-red-400);animation:badge-pulse 2s var(--ease) infinite;box-shadow:0 0 #f87171b3}.badge[data-variant=live] .badge-text{color:var(--color-red-400)}.badge[data-variant=loading] .badge-dot,.badge[data-variant=connecting] .badge-dot{background:var(--color-yellow-400)}.badge[data-variant=error] .badge-dot{background:var(--color-gray-400)}.badge[data-variant=error] .badge-text{color:var(--color-gray-100)}@keyframes badge-pulse{0%{box-shadow:0 0 #f8717199}70%{box-shadow:0 0 0 .4rem #f8717100}to{box-shadow:0 0 #f8717100}}.panel{top:var(--spacing-8);right:var(--spacing-8);bottom:var(--spacing-8);width:20rem;max-width:calc(100% - var(--spacing-16));background:var(--color-panel);backdrop-filter:blur(12px);border:var(--spacing-1) solid var(--color-white-alpha-15);border-radius:var(--border-radius-lg);box-shadow:0 var(--spacing-8) var(--spacing-32) var(--color-black-alpha-60);color:var(--color-white);z-index:4;opacity:0;pointer-events:none;transition:opacity .2s var(--ease), transform .2s var(--ease);flex-direction:column;line-height:1.4;display:flex;position:absolute;overflow:hidden;transform:translate(.75rem)}.panel--open{opacity:1;pointer-events:auto;transform:translate(0)}.panel-head{padding:var(--spacing-8) var(--spacing-8) var(--spacing-8) var(--spacing-16);border-bottom:var(--spacing-1) solid var(--color-white-alpha-10);justify-content:space-between;align-items:center;display:flex}.panel-head-title{gap:var(--spacing-8);font-size:.875rem;font-weight:600}.panel-head-title svg{width:1.125rem;height:1.125rem}.panel-head .control{width:2rem;height:2rem}.panel-tabs{padding:var(--spacing-8);gap:var(--spacing-4);display:flex}.panel-tab{align-items:center;gap:var(--spacing-4);padding:var(--spacing-8) var(--spacing-4);color:var(--color-white-alpha-60);border-radius:var(--border-radius-md);cursor:pointer;transition:background-color .12s var(--ease), color .12s var(--ease);background:0 0;border:none;flex-direction:column;flex:1;font-size:.6875rem;font-weight:500;display:flex}.panel-tab svg{width:1.125rem;height:1.125rem}.panel-tab:hover{background-color:var(--color-white-alpha-05);color:var(--color-white)}.panel-tab--active{background-color:var(--color-white-alpha-10);color:var(--color-white)}.panel-body{scrollbar-width:thin;scrollbar-color:var(--color-white-alpha-20) transparent;flex:1;min-height:0;overflow-y:auto}.panel-body::-webkit-scrollbar{width:.375rem}.panel-body::-webkit-scrollbar-thumb{background:var(--color-white-alpha-20);border-radius:999px}.tab-body{gap:var(--spacing-12);padding:var(--spacing-12) var(--spacing-16) var(--spacing-16);flex-direction:column;display:flex}.tab-empty{padding:var(--spacing-24) 0;text-align:center;color:var(--color-white-alpha-40);font-size:.8125rem}.tab-hint{color:var(--color-white-alpha-40);font-size:.6875rem;line-height:1.5}.q-list{gap:var(--spacing-2)}.q-row{align-items:center;gap:var(--spacing-8);width:100%;padding:var(--spacing-8);text-align:left;color:var(--color-white);border-radius:var(--border-radius-md);cursor:pointer;transition:background-color .12s var(--ease);background:0 0;border:none;display:flex}.q-row:hover{background-color:var(--color-white-alpha-05)}.q-row--selected{background-color:var(--color-white-alpha-10)}.q-row-check{width:1rem;color:var(--accent);flex-shrink:0;justify-content:center;align-items:center;display:flex}.q-row-check svg{width:1rem;height:1rem}.q-row-body{flex-direction:column;gap:.1rem;min-width:0;display:flex}.q-row-title{align-items:center;gap:var(--spacing-8);font-size:.8125rem;font-weight:600;display:flex}.q-row-playing{letter-spacing:.06em;text-transform:uppercase;color:var(--color-green-500);background:var(--color-green-900);padding:.05rem var(--spacing-4);border-radius:var(--border-radius-sm);font-size:.5625rem;font-weight:600}.q-row-sub{color:var(--color-white-alpha-60);text-overflow:ellipsis;white-space:nowrap;font-size:.6875rem;overflow:hidden}.latency-presets{gap:var(--spacing-4);flex-wrap:wrap;display:flex}.latency-readout{gap:var(--spacing-8);display:flex}.latency-stat{gap:var(--spacing-2);padding:var(--spacing-8) var(--spacing-12);background:var(--color-white-alpha-05);border-radius:var(--border-radius-md);flex-direction:column;flex:1;display:flex}.latency-stat-label{text-transform:uppercase;letter-spacing:.05em;color:var(--color-white-alpha-40);font-size:.625rem}.latency-stat-value{font-variant-numeric:tabular-nums;color:var(--accent);font-size:.9375rem;font-weight:600}.stat-card{gap:var(--spacing-8);padding:var(--spacing-12);background:var(--color-white-alpha-05);border-radius:var(--border-radius-md);flex-direction:column;display:flex}.stat-head{align-items:center;gap:var(--spacing-8);display:flex}.stat-icon{border-radius:var(--border-radius-sm);justify-content:center;align-items:center;width:1.5rem;height:1.5rem;display:flex}.stat-icon svg{width:.875rem;height:.875rem}.stat-title{text-transform:uppercase;letter-spacing:.05em;font-size:.75rem;font-weight:600}.stat-status{letter-spacing:.06em;text-transform:uppercase;color:var(--color-gray-100);background:var(--color-white-alpha-10);padding:.05rem var(--spacing-8);border-radius:var(--border-radius-sm);margin-left:auto;font-size:.5625rem;font-weight:600}.stat-card--video .stat-icon{background:var(--color-purple-900);color:var(--color-purple-400)}.stat-card--video .stat-title{color:var(--color-purple-400)}.stat-card--audio .stat-icon{background:var(--color-green-900);color:var(--color-green-400)}.stat-card--audio .stat-title{color:var(--color-green-400)}.stat-card--network .stat-icon{background:var(--color-blue-900);color:var(--color-blue-400)}.stat-card--network .stat-title{color:var(--color-blue-400)}.stat-grid{gap:var(--spacing-2) var(--spacing-12);grid-template-columns:auto 1fr;display:grid}.stat-line{display:contents}.stat-key{color:var(--color-white-alpha-60);font-size:.75rem}.stat-value{text-align:right;font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap;font-size:.75rem;font-weight:600;overflow:hidden}.graph{gap:var(--spacing-2);margin-top:var(--spacing-4);flex-direction:column;display:flex}.graph-header{justify-content:space-between;align-items:baseline;display:flex}.graph-label{text-transform:uppercase;letter-spacing:.05em;color:var(--color-white-alpha-40);font-size:.625rem}.graph-value{font-variant-numeric:tabular-nums;font-size:.6875rem;font-weight:600}.graph-canvas{width:100%;height:2.5rem;display:block}.buffer{width:100%}.buffer-visualization{background:var(--color-white-alpha-10);border-radius:var(--spacing-4);cursor:pointer;user-select:none;width:100%;height:3.75rem;padding-left:var(--spacing-48);box-sizing:border-box;position:relative}.buffer-playhead{left:var(--spacing-48);width:var(--spacing-2);background:var(--color-white);z-index:3;position:absolute;top:0;bottom:0}.buffer-track{left:var(--spacing-48);height:var(--spacing-24);align-items:center;display:flex;position:absolute;right:0}.buffer-track--video{top:var(--spacing-4)}.buffer-track--audio{top:var(--spacing-32)}.buffer-track-label{width:2.5rem;color:var(--color-white-alpha-70);text-align:right;padding-right:var(--spacing-4);pointer-events:none;box-sizing:border-box;font-size:.625rem;position:absolute;left:-2.875rem}.buffer-canvas{width:100%;height:100%;position:absolute;top:0;left:0}.buffer-target-area{top:0;bottom:0;left:var(--spacing-48);pointer-events:none;position:absolute;right:0}.buffer-target-line{background:var(--color-orange-400,var(--color-orange-450));z-index:2;cursor:ew-resize;border-radius:var(--spacing-1);pointer-events:auto;width:.1875rem;position:absolute;top:0;bottom:0}.buffer-target-label{color:var(--color-orange-400,var(--color-orange-450));white-space:nowrap;margin-bottom:var(--spacing-2);opacity:0;pointer-events:none;font-size:.6875rem;font-weight:500;transition:opacity .15s;position:absolute;bottom:100%;left:50%;transform:translate(-50%)}.buffer-visualization:hover .buffer-target-label,.buffer-visualization--dragging .buffer-target-label{opacity:1}.buffer-help{color:var(--color-white-alpha-30,#ffffff4d);pointer-events:none;white-space:nowrap;font-size:.75rem;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.buffering{z-index:1;background-color:var(--color-black-alpha-40);width:100%;height:100%;backdrop-filter:blur(var(--spacing-2));pointer-events:auto;justify-content:center;align-items:center;display:flex;position:absolute;top:0;left:0}.buffering-spinner{border:var(--spacing-4) solid var(--color-white-alpha-20);border-top:var(--spacing-4) solid var(--color-white);border-radius:50%;width:2.5rem;height:2.5rem;animation:1s linear infinite buffer-spin}@keyframes buffer-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.watch-ui__offline-indicator{z-index:4;pointer-events:auto;background-color:#000;border-radius:.25rem;justify-content:center;align-items:center;padding:.5rem 1rem;display:flex;position:absolute;bottom:1rem;right:1rem}.watch-ui__offline-text{color:#fff;letter-spacing:.08em;text-shadow:none;font-size:.875rem;font-weight:700}@media (width<=768px){.watch-ui__offline-indicator{padding:.375rem .75rem;bottom:.75rem;right:.75rem}.watch-ui__offline-text{font-size:.75rem}}@media (width<=480px){.watch-ui__offline-indicator{padding:.25rem .5rem;bottom:.5rem;right:.5rem}.watch-ui__offline-text{font-size:.75rem}}", de = 2800, $ = class extends HTMLElement {
620
621
  #e;
621
622
  #t;
622
- #n = new t(void 0);
623
+ #n = new n(void 0);
623
624
  #r;
624
625
  constructor() {
625
626
  super(), this.#t = this.attachShadow({ mode: "open" });
626
627
  let e = document.createElement("style");
627
- e.textContent = le, this.#t.appendChild(e), this.#r = new MutationObserver(() => this.#i());
628
+ e.textContent = ue, this.#t.appendChild(e), this.#r = new MutationObserver(() => this.#i());
628
629
  }
629
630
  connectedCallback() {
630
631
  this.#i(), this.#r.observe(this, { childList: !0 });
631
- let t = new e();
632
- this.#e = t, t.run(this.#a.bind(this));
632
+ let e = new t();
633
+ this.#e = e, e.run(this.#a.bind(this));
633
634
  }
634
635
  disconnectedCallback() {
635
636
  this.#r.disconnect(), this.#e?.close(), this.#e = void 0;
@@ -639,34 +640,70 @@ var le = "*,:before,:after{box-sizing:border-box}:host{--color-white:#fff;--colo
639
640
  this.#n.set(e ?? void 0);
640
641
  }
641
642
  #a(e) {
642
- let i = e.get(this.#n);
643
- if (!i) return;
643
+ let t = e.get(this.#n);
644
+ if (!t) return;
644
645
  let a = {
645
- chrome: new t(!0),
646
- panel: new t(!1),
647
- tab: new t("quality")
648
- }, o = n.create("div", { className: "player" });
649
- o.appendChild(n.create("slot"));
650
- let s = n.create("div", { className: "center" });
651
- s.append(x(e, i), r(e, i), F(e, i));
652
- let c = n.create("div", { className: "scrim scrim--top" }), l = n.create("div", { className: "chrome" });
653
- l.append(n.create("div", { className: "scrim scrim--bottom" }), P(e, i, a, o));
654
- let u = ce(e, i, a);
655
- o.append(c, s, l, u), n.render(e, this.#t, o), this.#o(e, i, a, o);
646
+ chrome: new n(!0),
647
+ panel: new n(!1),
648
+ tab: new n("quality")
649
+ }, o = r.create("div", { className: "player" });
650
+ o.appendChild(r.create("slot"));
651
+ let s = r.create("div", { className: "center" });
652
+ s.append(S(e, t), i(e, t), I(e, t));
653
+ let c = r.create("div", { className: "scrim scrim--top" }), l = r.create("div", { className: "chrome" });
654
+ l.append(r.create("div", { className: "scrim scrim--bottom" }), F(e, t, a, o));
655
+ let u = le(e, t, a);
656
+ o.append(c, s, l, u), r.render(e, this.#t, o), this.#s(e, t, o), this.#c(e, t, a, o, l, u);
657
+ }
658
+ #o(e) {
659
+ let t = document;
660
+ return this.#t.fullscreenElement === e || document.fullscreenElement === e || t.webkitFullscreenElement === e || e.classList.contains("player--pseudo-fullscreen");
656
661
  }
657
- #o(e, n, r, i) {
658
- let a = new t(0), o = () => a.update((e) => e + 1);
659
- e.event(this, "pointermove", o), e.event(this, "pointerdown", o), e.event(this, "focusin", o);
660
- let s = () => n.backend.paused.peek() || r.panel.peek();
662
+ #s(e, t, n) {
663
+ let r = () => {
664
+ let e = t.querySelector("canvas, video");
665
+ if (!e) return;
666
+ let r = this.#o(n);
667
+ t.style.width = "100%", t.style.height = r ? "100%" : "", e.style.width = "100%", e.style.height = r ? "100%" : "auto", e.style.maxWidth = "100%", e.style.maxHeight = "100%", e.style.objectFit = "contain";
668
+ }, i = new MutationObserver(r);
669
+ i.observe(t, {
670
+ childList: !0,
671
+ subtree: !0
672
+ });
673
+ let a = new MutationObserver(r);
674
+ a.observe(n, {
675
+ attributes: !0,
676
+ attributeFilter: ["class"]
677
+ }), e.cleanup(() => i.disconnect()), e.cleanup(() => a.disconnect()), e.event(document, "fullscreenchange", r), e.event(document, "webkitfullscreenchange", r), e.event(this.#t, "fullscreenchange", r), r();
678
+ }
679
+ #c(e, t, r, i, a, o) {
680
+ if (window.matchMedia("(pointer: coarse)").matches || window.matchMedia("(hover: none)").matches) {
681
+ this.#l(e, r, i, a, o);
682
+ return;
683
+ }
684
+ let s = new n(0), c = () => s.update((e) => e + 1);
685
+ e.event(this, "pointermove", c), e.event(this, "pointerdown", c), e.event(this, "focusin", c);
686
+ let l = () => t.backend.paused.peek() || r.panel.peek();
661
687
  e.run((e) => {
662
- let t = e.get(n.backend.paused) || e.get(r.panel);
663
- e.get(a), r.chrome.set(!0), !t && e.timer(() => r.chrome.set(!1), ue);
688
+ let n = e.get(t.backend.paused) || e.get(r.panel);
689
+ e.get(s), r.chrome.set(!0), !n && e.timer(() => r.chrome.set(!1), de);
664
690
  }), e.event(this, "pointerleave", () => {
665
- s() || r.chrome.set(!1);
691
+ l() || r.chrome.set(!1);
666
692
  }), e.run((e) => {
667
693
  i.classList.toggle("player--chrome", e.get(r.chrome));
668
694
  });
669
695
  }
696
+ #l(e, t, n, r, i) {
697
+ t.chrome.set(!0);
698
+ let a = (e) => e.composedPath().some((e) => e === r || e === i);
699
+ e.event(n, "pointerdown", (e) => {
700
+ a(e) || (this.#o(n) ? t.chrome.update((e) => !e) : t.chrome.set(!0));
701
+ });
702
+ let o = () => t.chrome.set(!0);
703
+ e.event(document, "fullscreenchange", o), e.event(document, "webkitfullscreenchange", o), e.event(this.#t, "fullscreenchange", o), e.run((e) => {
704
+ n.classList.toggle("player--chrome", e.get(t.chrome));
705
+ });
706
+ }
670
707
  };
671
708
  customElements.define("moq-watch-ui", $);
672
709
  //#endregion