@banou/media-player 0.10.7 → 0.10.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4,14 +4,15 @@ import { css as g, keyframes as _ } from "@emotion/react";
4
4
  import { createPlayer as v, useContainerAttach as y, useMediaAttach as b } from "@videojs/react";
5
5
  import { definePlayerFeature as x, videoFeatures as S } from "@videojs/core/dom";
6
6
  import { Fragment as C, jsx as w, jsxs as T } from "@emotion/react/jsx-runtime";
7
- import { AlertTriangle as E, Check as D, ChevronLeft as O, ChevronRight as k, Copy as A, Maximize as j, Minimize as M, Pause as N, Play as P, RotateCcw as F, Settings as I, Volume1 as L, Volume2 as R, VolumeX as z } from "react-feather";
8
- import { Tooltip as B } from "react-tooltip";
7
+ import { Captions as E, CaptionsOff as D, Check as O, ChevronLeft as k, ChevronRight as A, Copy as j, Maximize as M, Minimize as N, Pause as P, Play as F, RotateCcw as I, Settings as L, TriangleAlert as R, Volume1 as z, Volume2 as B, VolumeX as ee } from "lucide-react";
8
+ import { Tooltip as V } from "react-tooltip";
9
9
  //#region src/lib/react/source-feature.ts
10
- var V = {
10
+ var H = {
11
11
  indexes: [],
12
12
  chapters: [],
13
13
  thumbnails: [],
14
14
  requestThumbnail: () => {},
15
+ seekPreview: !1,
15
16
  subtitleTracks: [],
16
17
  selectedSubtitleTrack: void 0,
17
18
  selectSubtitleTrack: () => {},
@@ -29,9 +30,9 @@ var V = {
29
30
  playbackErrors: [],
30
31
  ready: !1,
31
32
  setSourceState: () => {}
32
- }, H = x({
33
+ }, te = x({
33
34
  name: "source",
34
- state: () => ({ ...V }),
35
+ state: () => ({ ...H }),
35
36
  attach({ set: e }) {
36
37
  e({
37
38
  setSourceState: (t) => e(t),
@@ -39,9 +40,9 @@ var V = {
39
40
  });
40
41
  }
41
42
  }), U = v({
42
- features: [...S, H],
43
+ features: [...S, te],
43
44
  displayName: "MediaPlayer"
44
- }), W = U.usePlayer, ee = (e) => {
45
+ }), W = U.usePlayer, G = (e) => {
45
46
  if (e && e !== "und") try {
46
47
  return new Intl.DisplayNames([navigator.language || "en"], {
47
48
  type: "language",
@@ -50,28 +51,28 @@ var V = {
50
51
  } catch {
51
52
  return;
52
53
  }
53
- }, G = (e) => e?.replace(/_/g, " ").trim() || void 0, K = (e) => {
54
- let t = e.map((e) => ee(e.language) ?? G(e.title) ?? `Track ${e.streamIndex}`), n = t.reduce((e, t) => ({
54
+ }, K = (e) => e?.replace(/_/g, " ").trim() || void 0, q = (e) => {
55
+ let t = e.map((e) => G(e.language) ?? K(e.title) ?? `Track ${e.streamIndex}`), n = t.reduce((e, t) => ({
55
56
  ...e,
56
57
  [t]: (e[t] ?? 0) + 1
57
58
  }), {});
58
59
  return e.map((e, r) => {
59
- let i = t[r], a = G(e.title);
60
+ let i = t[r], a = K(e.title);
60
61
  return {
61
62
  track: e,
62
63
  label: (n[i] ?? 0) > 1 && a && a !== i ? `${i} (${a})` : i
63
64
  };
64
65
  });
65
- }, q = (e) => K(e).map(({ track: e, label: t }) => ({
66
+ }, ne = (e) => q(e).map(({ track: e, label: t }) => ({
66
67
  id: e.streamIndex,
67
68
  label: t
68
- })), te = [
69
+ })), J = [
69
70
  0,
70
71
  250,
71
72
  1e3,
72
73
  3e3,
73
74
  1e4
74
- ], ne = 6e4, re = 500, ie = 15e3, ae = (e) => e instanceof Error ? e.message : String(e), oe = (e) => {
75
+ ], Y = 6e4, re = 500, ie = 15e3, ae = (e) => e instanceof Error ? e.message : String(e), oe = (e) => {
75
76
  let t = [], n = e?.cause;
76
77
  for (let e = 0; n != null && e < 8; e++) {
77
78
  if (typeof MediaError < "u" && n instanceof MediaError) {
@@ -174,11 +175,11 @@ var V = {
174
175
  let t = n(e);
175
176
  if (u(e, t), t) {
176
177
  let t = performance.now();
177
- t - D.current.at > ne && (D.current = {
178
+ t - D.current.at > Y && (D.current = {
178
179
  count: 0,
179
180
  at: t
180
181
  });
181
- let n = te[Math.min(D.current.count, te.length - 1)];
182
+ let n = J[Math.min(D.current.count, J.length - 1)];
182
183
  D.current = {
183
184
  count: D.current.count + 1,
184
185
  at: t
@@ -215,13 +216,13 @@ var V = {
215
216
  onSeek: (e) => N.current?.(e),
216
217
  onSubtitleStreams: (e) => {
217
218
  r || a.setSourceState({
218
- subtitleTracks: q(e),
219
+ subtitleTracks: ne(e),
219
220
  ...j.current ? {} : { selectedSubtitleTrack: e[0]?.streamIndex }
220
221
  });
221
222
  },
222
223
  onAudioStreams: (e, t) => {
223
224
  r || a.setSourceState({
224
- audioTracks: q(e),
225
+ audioTracks: ne(e),
225
226
  selectedAudioTrack: t
226
227
  });
227
228
  }
@@ -396,7 +397,7 @@ var V = {
396
397
  g,
397
398
  S
398
399
  ]);
399
- }, J = {
400
+ }, X = {
400
401
  headings: {
401
402
  large: "\n font-weight: 600;\n font-size: calc(2.8 * var(--mp-unit));\n line-height: calc(3.4 * var(--mp-unit));\n @media (min-width: 960px) {\n font-size: calc(3.4 * var(--mp-unit));\n line-height: calc(4.1 * var(--mp-unit));\n }\n ",
402
403
  medium: "\n font-weight: 600;\n font-size: calc(2.4 * var(--mp-unit));\n line-height: calc(2.9 * var(--mp-unit));\n @media (min-width: 960px) {\n font-size: calc(2.8 * var(--mp-unit));\n line-height: calc(3.4 * var(--mp-unit));\n }\n ",
@@ -444,7 +445,7 @@ var V = {
444
445
  padding: calc(1.2 * var(--mp-unit)) calc(1.6 * var(--mp-unit));
445
446
  /* clears a notch once the player is fullscreen; resolves to zero everywhere else */
446
447
  padding-top: calc(calc(1.2 * var(--mp-unit)) + env(safe-area-inset-top, 0px));
447
- ${J.headings.small}
448
+ ${X.headings.small}
448
449
  color: white;
449
450
  text-shadow: 0 0 4px rgba(0, 0, 0, 1);
450
451
  z-index: 2;
@@ -492,7 +493,7 @@ var V = {
492
493
  padding: 0 calc(2 * var(--mp-unit));
493
494
  text-align: center;
494
495
  color: #fff;
495
- ${J.bLarge.regular}
496
+ ${X.bLarge.regular}
496
497
  text-shadow: 0 0 4px rgba(0, 0, 0, 1);
497
498
  pointer-events: none;
498
499
  `, Ce = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : "Playback failed", we = ({ onSubtitleRef: e }) => {
@@ -518,11 +519,11 @@ var V = {
518
519
  css: ve
519
520
  })
520
521
  ] });
521
- }, Te = 1e-4, Ee = 1, De = (e) => Math.max(Te, Math.min(Ee, e)) ** 2, Oe = (e) => Math.max(Te, Math.min(Ee, e)) ** (Ee / 2), Y = (e) => {
522
+ }, Te = 1e-4, Ee = 1, De = (e) => Math.max(Te, Math.min(Ee, e)) ** 2, Oe = (e) => Math.max(Te, Math.min(Ee, e)) ** (Ee / 2), Z = (e) => {
522
523
  if (e === void 0) return "0:00";
523
524
  let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), r = Math.floor(e % 60);
524
525
  return t > 0 ? `${t}:${n < 10 ? "0" : ""}${n}:${r < 10 ? "0" : ""}${r}` : `${n}:${r < 10 ? "0" : ""}${r}`;
525
- }, ke = (e, t) => `${Y(e)} / ${Y(t)}`, Ae = (e) => g`
526
+ }, ke = (e, t) => `${Z(e)} / ${Z(t)}`, Ae = (e) => g`
526
527
  display: flex;
527
528
  justify-content: flex-start;
528
529
 
@@ -554,7 +555,7 @@ var V = {
554
555
  z-index: 3;
555
556
 
556
557
  * {
557
- ${J.bMedium.regular}
558
+ ${X.bMedium.regular}
558
559
  }
559
560
 
560
561
  ${e === "sm" && g`
@@ -566,25 +567,25 @@ var V = {
566
567
  ${e === "lg" && g`
567
568
  padding: calc(1.2 * var(--mp-unit))!important;
568
569
  `}
569
- `, X = {
570
+ `, Q = {
570
571
  x: -1,
571
572
  y: -1,
572
573
  anchors: 0
573
574
  }, je = (e) => {
574
- X.x = e.clientX, X.y = e.clientY;
575
- }, Me = () => (X.anchors++ === 0 && window.addEventListener("pointermove", je, {
575
+ Q.x = e.clientX, Q.y = e.clientY;
576
+ }, Me = () => (Q.anchors++ === 0 && window.addEventListener("pointermove", je, {
576
577
  capture: !0,
577
578
  passive: !0
578
579
  }), () => {
579
- --X.anchors === 0 && window.removeEventListener("pointermove", je, { capture: !0 });
580
- }), Z = ({ id: e, toolTipText: t, text: n, delayShow: r = 0, closeDelay: i = 0, offset: a = 20, tooltipPlace: o = "top", disabled: s = !1, size: c = "md" }) => {
580
+ --Q.anchors === 0 && window.removeEventListener("pointermove", je, { capture: !0 });
581
+ }), $ = ({ id: e, toolTipText: t, text: n, delayShow: r = 0, closeDelay: i = 0, offset: a = 20, tooltipPlace: o = "top", disabled: s = !1, size: c = "md" }) => {
581
582
  let l = p(null), u = p(null);
582
583
  return d(() => {
583
584
  let e = Me(), t = () => {
584
585
  let e = l.current;
585
586
  if (!e) return;
586
587
  let { left: t, right: n, top: r, bottom: i } = e.getBoundingClientRect();
587
- X.x >= t && X.x < n && X.y >= r && X.y < i || u.current?.close();
588
+ Q.x >= t && Q.x < n && Q.y >= r && Q.y < i || u.current?.close();
588
589
  }, n = ["fullscreenchange", "webkitfullscreenchange"];
589
590
  for (let e of n) document.addEventListener(e, t);
590
591
  return () => {
@@ -600,7 +601,7 @@ var V = {
600
601
  "data-tooltip-delay-hide": i,
601
602
  "data-tooltip-place": o,
602
603
  children: n
603
- }), !s && /* @__PURE__ */ w(B, {
604
+ }), !s && /* @__PURE__ */ w(V, {
604
605
  ref: u,
605
606
  css: Ae(c),
606
607
  id: e,
@@ -717,7 +718,7 @@ var V = {
717
718
  "after",
718
719
  "before",
719
720
  "non"
720
- ]), qe = /[-:|~/\\[\]()「」『』【】,.!?"'’]|\s+by\s+/u, Je = (e) => /^chapter\s*\d+$/i.test(e.trim()) || /^\d{1,2}:\d{2}:\d{2}([.,]\d+)?$/.test(e.trim()), Ye = (e) => e.replace(/([a-z぀-ヿ一-鿿])\s*\d+\s*$/u, "$1").split(/[\s_]+/u).map((e) => e.replace(/^[^\w぀-ヿ一-鿿]+|[^\w぀-ヿ一-鿿]+$/gu, "")).filter((e) => e && !/^\d+$/.test(e) && !Ge.has(e)), Xe = (e, t) => {
721
+ ]), qe = /[-:|~/\\[\]()「」『』【】,.!?"'’]|\s+by\s+/u, Je = (e) => !e.trim() || /^chapter\s*\d+$/i.test(e.trim()) || /^\d{1,2}:\d{2}:\d{2}([.,]\d+)?$/.test(e.trim()), Ye = (e) => e.replace(/([a-z぀-ヿ一-鿿])\s*\d+\s*$/u, "$1").split(/[\s_]+/u).map((e) => e.replace(/^[^\w぀-ヿ一-鿿]+|[^\w぀-ヿ一-鿿]+$/gu, "")).filter((e) => e && !/^\d+$/.test(e) && !Ge.has(e)), Xe = (e, t) => {
721
722
  if (Be.has(e)) return "opening";
722
723
  if (Ve.has(e)) return "ending";
723
724
  if (t) {
@@ -756,7 +757,7 @@ var V = {
756
757
  let i = Ze(e.title, !0);
757
758
  return i && !t.includes(i) ? i : void 0;
758
759
  });
759
- return i.some(Boolean) ? i : tt(e);
760
+ return e.every(({ title: e }) => Je(e)) ? tt(e) : i;
760
761
  }, rt = g`
761
762
  position: relative;
762
763
  height: calc(.4 * var(--mp-unit));
@@ -842,7 +843,7 @@ var V = {
842
843
  box-shadow: 0 0 calc(1 * var(--mp-unit)) rgba(0, 0, 0, .5);
843
844
 
844
845
  text-shadow: 0 0 4px rgba(0, 0, 0, 1);
845
- ${J.bMedium.bold}
846
+ ${X.bMedium.bold}
846
847
 
847
848
  gap: calc(.6 * var(--mp-unit));
848
849
 
@@ -977,37 +978,45 @@ var V = {
977
978
  --thumbnail-half: calc(9 * var(--mp-unit));
978
979
  }
979
980
  `, it = 4, at = () => {
980
- let e = W(), t = W((e) => e.currentTime), n = W((e) => e.requestSeek), r = W((e) => e.duration), i = W((e) => e.size), a = W((e) => e.downloadedRanges), o = W((e) => e.buffered), s = W((e) => e.indexes), c = W((e) => e.thumbnails), l = W((e) => e.thumbnailAt), u = W((e) => e.requestThumbnail), h = W((e) => e.chapters), g = W((e) => e.seekingTo), _ = p(null), [v, y] = m(void 0), [b, x] = m(void 0), S = (e) => {
981
- x(e), u(e);
982
- }, C = p(void 0), E = p(0), D = p(void 0), O = p(void 0), k = p(!1), { dragging: A, handlers: j } = Ne({
983
- ref: _,
981
+ let e = W(), t = W((e) => e.currentTime), n = W((e) => e.requestSeek), r = W((e) => e.duration), i = W((e) => e.size), a = W((e) => e.downloadedRanges), o = W((e) => e.buffered), s = W((e) => e.indexes), c = W((e) => e.thumbnails), l = W((e) => e.thumbnailAt), u = W((e) => e.requestThumbnail), h = W((e) => e.chapters), g = W((e) => e.seekingTo), _ = W((e) => e.setSourceState), v = W((e) => e.hideUI), y = p(null), [b, x] = m(void 0), [S, C] = m(void 0), E = (e) => {
982
+ C(e), u(e);
983
+ }, D = !!S;
984
+ d(() => {
985
+ if (D) return _({ seekPreview: !0 }), () => _({ seekPreview: !1 });
986
+ }, [_, D]), d(() => {
987
+ v && E(void 0);
988
+ }, [v]);
989
+ let O = p(void 0), k = p(0), A = p(void 0), j = p(void 0), M = p(!1), { dragging: N, handlers: P } = Ne({
990
+ ref: y,
984
991
  onChange: (e) => {
985
- if (E.current += 1, D.current = e, O.current === void 0) O.current = e;
986
- else if (!k.current) {
987
- let t = _.current?.getBoundingClientRect().width ?? 0;
988
- Math.abs(e - O.current) * t > it && (k.current = !0);
992
+ if (k.current += 1, A.current = e, j.current === void 0) j.current = e;
993
+ else if (!M.current) {
994
+ let t = y.current?.getBoundingClientRect().width ?? 0;
995
+ Math.abs(e - j.current) * t > it && (M.current = !0);
989
996
  }
990
- y(e), C.current !== "mouse" && S(e * r);
997
+ x(e), O.current !== "mouse" && E(e * r);
991
998
  }
992
- }), M = (e) => {
993
- C.current = e.pointerType, E.current = 0, O.current = void 0, k.current = !1, j.onPointerDown(e);
994
- }, N = (t) => {
995
- j.onPointerUp(t);
996
- let i = E.current > 0 ? D.current : void 0;
999
+ }), F = (e) => {
1000
+ O.current = e.pointerType, k.current = 0, j.current = void 0, M.current = !1, P.onPointerDown(e);
1001
+ }, I = (t) => {
1002
+ P.onPointerUp(t);
1003
+ let i = k.current > 0 ? A.current : void 0;
997
1004
  if (i !== void 0 && r) {
998
1005
  let t = i * r;
999
1006
  n ? n(t) : e.seek(t);
1000
1007
  }
1001
- E.current = 0, k.current = !1, O.current = void 0, t.pointerType !== "mouse" && S(void 0);
1002
- }, P = (e) => {
1003
- if (!_.current) return;
1004
- let { left: t, right: n } = _.current.getBoundingClientRect();
1008
+ k.current = 0, M.current = !1, j.current = void 0, t.pointerType !== "mouse" && E(void 0);
1009
+ }, L = (e) => {
1010
+ if (!y.current) return;
1011
+ let { left: t, right: n } = y.current.getBoundingClientRect();
1005
1012
  return Math.min(Math.max((e - t) / (n - t), 0), 1) * r;
1006
- }, F = (e) => {
1007
- S(P(e.clientX));
1008
- }, I = () => {
1009
- _.current && S(void 0);
1010
- }, L = (e) => r ? e / r * 100 : 0, R = (e, t, n) => {
1013
+ }, R = p("mouse"), z = (e) => {
1014
+ R.current = e.pointerType;
1015
+ }, B = (e) => {
1016
+ R.current !== "touch" && E(L(e.clientX));
1017
+ }, ee = () => {
1018
+ y.current && E(void 0);
1019
+ }, V = (e) => r ? e / r * 100 : 0, H = (e, t, n) => {
1011
1020
  let r = Number((n - t).toFixed(4)), i = t * 100;
1012
1021
  return /* @__PURE__ */ w("div", {
1013
1022
  className: "loaded-part",
@@ -1016,10 +1025,10 @@ var V = {
1016
1025
  marginLeft: `${i}%`
1017
1026
  }
1018
1027
  }, e);
1019
- }, z = f(() => i === void 0 ? r ? o.map(([e, t], n) => R(n, e / r, t / r)) : [] : a?.map((e, t) => {
1028
+ }, te = f(() => i === void 0 ? r ? o.map(([e, t], n) => H(n, e / r, t / r)) : [] : a?.map((e, t) => {
1020
1029
  if (!i || !r) return null;
1021
1030
  let n = s.filter((t) => e.startByteOffset <= t.pos && t.pos <= e.endByteOffset), a = n.at(0), o = n.at(-1);
1022
- return !a || !o ? null : R(t, a.timestamp / r, o.timestamp / r);
1031
+ return !a || !o ? null : H(t, a.timestamp / r, o.timestamp / r);
1023
1032
  }) ?? [], [
1024
1033
  r,
1025
1034
  i,
@@ -1028,111 +1037,113 @@ var V = {
1028
1037
  a?.map(({ startByteOffset: e, endByteOffset: t }) => `${e}/${t}`).join(",")
1029
1038
  ]);
1030
1039
  d(() => {
1031
- v !== void 0 && r && A && k.current && e.seek(v * r);
1040
+ b !== void 0 && r && N && M.current && e.seek(b * r);
1032
1041
  }, [
1033
1042
  e,
1034
- A,
1035
- v,
1043
+ N,
1044
+ b,
1036
1045
  r
1037
1046
  ]);
1038
- let B = f(() => {
1047
+ let U = f(() => {
1039
1048
  if (!r) return 0;
1040
- if (A && v !== void 0) return v;
1049
+ if (N && b !== void 0) return b;
1041
1050
  let e = g ?? t;
1042
1051
  return typeof e == "number" ? e / r : 0;
1043
1052
  }, [
1044
1053
  r,
1045
1054
  t,
1046
- A,
1047
- v,
1055
+ N,
1056
+ b,
1048
1057
  g
1049
- ]), V = f(() => Re(h, r), [h, r]), H = V.length > 0, U = f(() => {
1050
- if (!H || b === void 0 || !r) return -1;
1051
- let e = b / r * 100, t = V.findIndex((t, n) => n < V.length - 1 && e >= t && e < V[n + 1]);
1052
- return t >= 0 ? t : V.length - 2;
1058
+ ]), G = f(() => Re(h, r), [h, r]), K = G.length > 0, q = f(() => {
1059
+ if (!K || S === void 0 || !r) return -1;
1060
+ let e = S / r * 100, t = G.findIndex((t, n) => n < G.length - 1 && e >= t && e < G[n + 1]);
1061
+ return t >= 0 ? t : G.length - 2;
1053
1062
  }, [
1054
- H,
1055
- V,
1056
- b,
1063
+ K,
1064
+ G,
1065
+ S,
1057
1066
  r
1058
- ]), ee = f(() => H ? ze(V, (e) => e !== U) : void 0, [
1059
- H,
1060
- V,
1061
- U
1062
- ]), G = f(() => U >= 0 ? ze(V, (e) => e === U) : void 0, [V, U]), K = f(() => {
1063
- if (b !== void 0) return h.find(({ start: e, end: t }) => e <= b && b < t);
1064
- }, [h, b]), q = f(() => {
1065
- if (b) {
1066
- if (l) return l(b);
1067
- if (c.length) return c.find(({ startTime: e, endTime: t }) => e <= b && b < t);
1067
+ ]), ne = f(() => K ? ze(G, (e) => e !== q) : void 0, [
1068
+ K,
1069
+ G,
1070
+ q
1071
+ ]), J = f(() => q >= 0 ? ze(G, (e) => e === q) : void 0, [G, q]), Y = f(() => {
1072
+ if (S !== void 0) return h.find(({ start: e, end: t }) => e <= S && S < t);
1073
+ }, [h, S]), re = f(() => {
1074
+ if (S) {
1075
+ if (l) return l(S);
1076
+ if (c.length) return c.find(({ startTime: e, endTime: t }) => e <= S && S < t);
1068
1077
  }
1069
1078
  }, [
1070
1079
  c,
1071
1080
  l,
1072
- b
1073
- ]), te = (e, t) => /* @__PURE__ */ T("div", {
1081
+ S
1082
+ ]), ie = (e, t) => /* @__PURE__ */ T("div", {
1074
1083
  className: e ? `track ${e}` : "track",
1075
1084
  style: t ? { maskImage: t } : void 0,
1076
1085
  children: [
1077
1086
  /* @__PURE__ */ w("div", { className: "background-bar" }),
1078
1087
  /* @__PURE__ */ w("div", {
1079
1088
  className: "loaded",
1080
- children: z
1089
+ children: te
1081
1090
  }),
1082
1091
  /* @__PURE__ */ w("div", {
1083
1092
  className: "play-container",
1084
1093
  children: /* @__PURE__ */ w("div", {
1085
1094
  className: "play",
1086
- style: { transform: `scaleX(${B})` }
1095
+ style: { transform: `scaleX(${U})` }
1087
1096
  })
1088
1097
  })
1089
1098
  ]
1090
1099
  });
1091
1100
  return /* @__PURE__ */ T("div", {
1092
1101
  css: rt,
1093
- ref: _,
1102
+ ref: y,
1094
1103
  className: [
1095
1104
  "progress-bar",
1096
- A ? "dragging" : "",
1097
- H ? "segmented" : ""
1105
+ N ? "dragging" : "",
1106
+ K ? "segmented" : ""
1098
1107
  ].filter(Boolean).join(" "),
1099
- onMouseMove: F,
1100
- onMouseOut: I,
1108
+ onPointerDown: z,
1109
+ onPointerMove: z,
1110
+ onMouseMove: B,
1111
+ onMouseOut: ee,
1101
1112
  children: [
1102
- te(void 0, ee),
1103
- b ? /* @__PURE__ */ T("div", {
1113
+ ie(void 0, ne),
1114
+ S ? /* @__PURE__ */ T("div", {
1104
1115
  className: "cursor-time",
1105
1116
  style: {
1106
- left: K ? `clamp(var(--thumbnail-half), ${L(b)}%, calc(100% - var(--thumbnail-half)))` : `clamp(calc(3 * var(--mp-unit)), ${L(b)}%, calc(100% - calc(3 * var(--mp-unit))))`,
1107
- maxWidth: K ? "var(--thumbnail-width)" : void 0
1117
+ left: Y ? `clamp(var(--thumbnail-half), ${V(S)}%, calc(100% - var(--thumbnail-half)))` : `clamp(calc(3 * var(--mp-unit)), ${V(S)}%, calc(100% - calc(3 * var(--mp-unit))))`,
1118
+ maxWidth: Y ? "var(--thumbnail-width)" : void 0
1108
1119
  },
1109
1120
  children: [/* @__PURE__ */ w("span", {
1110
1121
  className: "cursor-time-value",
1111
- children: Y(b)
1112
- }), K ? /* @__PURE__ */ w("span", {
1122
+ children: Z(S)
1123
+ }), Y ? /* @__PURE__ */ w("span", {
1113
1124
  className: "chapter-title",
1114
- children: K.title
1125
+ children: Y.title
1115
1126
  }) : void 0]
1116
1127
  }) : void 0,
1117
1128
  /* @__PURE__ */ w("div", { className: "progress" }),
1118
1129
  /* @__PURE__ */ w("div", { className: "hover" }),
1119
- G ? te("focus", G) : void 0,
1130
+ J ? ie("focus", J) : void 0,
1120
1131
  /* @__PURE__ */ w("div", { className: "scrubber" }),
1121
1132
  /* @__PURE__ */ w("div", {
1122
1133
  className: "padding",
1123
- ...j,
1124
- onPointerDown: M,
1125
- onPointerUp: N,
1126
- onPointerCancel: N
1134
+ ...P,
1135
+ onPointerDown: F,
1136
+ onPointerUp: I,
1137
+ onPointerCancel: I
1127
1138
  }),
1128
1139
  /* @__PURE__ */ w("div", {
1129
1140
  className: "thumbnail",
1130
- style: { left: `clamp(var(--thumbnail-half), ${L(b ?? 1)}%, calc(100% - var(--thumbnail-half)))` },
1131
- children: q?.url ? /* @__PURE__ */ w("img", { src: q.url }) : void 0
1141
+ style: { left: `clamp(var(--thumbnail-half), ${V(S ?? 1)}%, calc(100% - var(--thumbnail-half)))` },
1142
+ children: re?.url ? /* @__PURE__ */ w("img", { src: re.url }) : void 0
1132
1143
  })
1133
1144
  ]
1134
1145
  });
1135
- }, ot = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23fff'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20class='icon%20icon-tabler%20icons-tabler-outline%20icon-tabler-picture-in-picture'%3e%3cpath%20stroke='none'%20d='M0%200h24v24H0z'%20fill='none'%20/%3e%3cpath%20d='M11%2019h-6a2%202%200%200%201%20-2%20-2v-10a2%202%200%200%201%202%20-2h14a2%202%200%200%201%202%202v4'%20/%3e%3cpath%20d='M14%2014m0%201a1%201%200%200%201%201%20-1h5a1%201%200%200%201%201%201v3a1%201%200%200%201%20-1%201h-5a1%201%200%200%201%20-1%20-1z'%20/%3e%3c/svg%3e", Q = {
1146
+ }, ot = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23fff'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20class='icon%20icon-tabler%20icons-tabler-outline%20icon-tabler-picture-in-picture'%3e%3cpath%20stroke='none'%20d='M0%200h24v24H0z'%20fill='none'%20/%3e%3cpath%20d='M11%2019h-6a2%202%200%200%201%20-2%20-2v-10a2%202%200%200%201%202%20-2h14a2%202%200%200%201%202%202v4'%20/%3e%3cpath%20d='M14%2014m0%201a1%201%200%200%201%201%20-1h5a1%201%200%200%201%201%201v3a1%201%200%200%201%20-1%201h-5a1%201%200%200%201%20-1%20-1z'%20/%3e%3c/svg%3e", st = {
1136
1147
  xmlns: "http://www.w3.org/2000/svg",
1137
1148
  width: 24,
1138
1149
  height: 24,
@@ -1142,39 +1153,8 @@ var V = {
1142
1153
  strokeWidth: 2,
1143
1154
  strokeLinecap: "round",
1144
1155
  strokeLinejoin: "round"
1145
- }, st = (e) => /* @__PURE__ */ T("svg", {
1146
- ...Q,
1147
- ...e,
1148
- children: [/* @__PURE__ */ w("rect", {
1149
- x: "3",
1150
- y: "5",
1151
- width: "18",
1152
- height: "14",
1153
- rx: "2",
1154
- ry: "2"
1155
- }), /* @__PURE__ */ w("path", { d: "M7 15h4m4 0h2M7 11h2m4 0h4" })]
1156
- }), ct = (e) => /* @__PURE__ */ T("svg", {
1157
- ...Q,
1158
- ...e,
1159
- children: [
1160
- /* @__PURE__ */ w("rect", {
1161
- x: "3",
1162
- y: "5",
1163
- width: "18",
1164
- height: "14",
1165
- rx: "2",
1166
- ry: "2"
1167
- }),
1168
- /* @__PURE__ */ w("path", { d: "M7 15h4m4 0h2M7 11h2m4 0h4" }),
1169
- /* @__PURE__ */ w("line", {
1170
- x1: "2",
1171
- y1: "2",
1172
- x2: "22",
1173
- y2: "22"
1174
- })
1175
- ]
1176
- }), lt = (e) => /* @__PURE__ */ T("svg", {
1177
- ...Q,
1156
+ }, ct = (e) => /* @__PURE__ */ T("svg", {
1157
+ ...st,
1178
1158
  ...e,
1179
1159
  children: [
1180
1160
  /* @__PURE__ */ w("path", { d: "M21 11V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h5" }),
@@ -1188,8 +1168,8 @@ var V = {
1188
1168
  }),
1189
1169
  /* @__PURE__ */ w("path", { d: "M14.5 18.5h2m2 0h1" })
1190
1170
  ]
1191
- }), ut = (e) => /* @__PURE__ */ T("svg", {
1192
- ...Q,
1171
+ }), lt = (e) => /* @__PURE__ */ T("svg", {
1172
+ ...st,
1193
1173
  ...e,
1194
1174
  children: [
1195
1175
  /* @__PURE__ */ w("path", { d: "M21 11V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h5" }),
@@ -1203,7 +1183,7 @@ var V = {
1203
1183
  }),
1204
1184
  /* @__PURE__ */ w("path", { d: "M6 9h3m2 0h2" })
1205
1185
  ]
1206
- }), dt = g`
1186
+ }), ut = g`
1207
1187
  .popover {
1208
1188
  position: absolute;
1209
1189
  /* Anchored to the PLAYER's right edge, never to the gear. The gear is not the last control in the
@@ -1242,7 +1222,7 @@ var V = {
1242
1222
 
1243
1223
  border-radius: 8px;
1244
1224
  background-color: rgba(28,28,28,0.95);
1245
- ${J.bMedium.regular}
1225
+ ${X.bMedium.regular}
1246
1226
 
1247
1227
  z-index: 4;
1248
1228
 
@@ -1285,7 +1265,7 @@ var V = {
1285
1265
 
1286
1266
  .secondary {
1287
1267
  color: #eee;
1288
- ${J.bSmall.regular}
1268
+ ${X.bSmall.regular}
1289
1269
  }
1290
1270
  }
1291
1271
  }
@@ -1327,10 +1307,10 @@ var V = {
1327
1307
  .failed {
1328
1308
  border-bottom: 1px solid #4D4D4E;
1329
1309
  color: #f66;
1330
- ${J.bSmall.regular}
1310
+ ${X.bSmall.regular}
1331
1311
  }
1332
1312
  }
1333
- `, ft = ({ title: e, tracks: t, selected: n, onSelect: r, onBack: i, offLabel: a, pending: o, failed: s }) => {
1313
+ `, dt = ({ title: e, tracks: t, selected: n, onSelect: r, onBack: i, offLabel: a, pending: o, failed: s }) => {
1334
1314
  let c = o !== void 0, l = (e, i, a) => {
1335
1315
  let s = c && o === e, l = c || t.find((t) => t.id === e)?.disabled;
1336
1316
  return /* @__PURE__ */ T("div", {
@@ -1347,7 +1327,7 @@ var V = {
1347
1327
  /* @__PURE__ */ T("div", {
1348
1328
  className: i ? "back" : "back no-hover",
1349
1329
  onClick: i,
1350
- children: [i ? /* @__PURE__ */ w(O, {}) : null, /* @__PURE__ */ w("span", { children: e })]
1330
+ children: [i ? /* @__PURE__ */ w(k, {}) : null, /* @__PURE__ */ w("span", { children: e })]
1351
1331
  }),
1352
1332
  s ? /* @__PURE__ */ w("div", {
1353
1333
  className: "no-hover failed",
@@ -1357,7 +1337,7 @@ var V = {
1357
1337
  t.map(({ id: e, label: t }) => l(e, t, "description"))
1358
1338
  ]
1359
1339
  });
1360
- }, pt = ({ onReset: e } = {}) => {
1340
+ }, ft = ({ onReset: e } = {}) => {
1361
1341
  let t = p(null), [n, r] = m(!1), [i, a] = m(void 0), [o, s] = m(!1), c = p(e);
1362
1342
  c.current = e;
1363
1343
  let l = () => {
@@ -1398,7 +1378,7 @@ var V = {
1398
1378
  });
1399
1379
  }
1400
1380
  };
1401
- }, mt = g`
1381
+ }, pt = g`
1402
1382
  /* Not a containing block, for the reason given on popoverStyle: the menu anchors to the control bar,
1403
1383
  which is the width of the player box, so it can be clamped to it. */
1404
1384
  position: static;
@@ -1414,7 +1394,7 @@ position: static;
1414
1394
  }
1415
1395
  }
1416
1396
 
1417
- ${dt}
1397
+ ${ut}
1418
1398
 
1419
1399
  .popover.error-list {
1420
1400
  /* Wider than a track menu and taller, because these rows are sentences rather than labels, and a
@@ -1442,7 +1422,7 @@ ${dt}
1442
1422
 
1443
1423
  color: #fff;
1444
1424
  cursor: pointer;
1445
- ${J.bSmall.regular}
1425
+ ${X.bSmall.regular}
1446
1426
 
1447
1427
  &:hover {
1448
1428
  background-color: rgba(255,255,255,.1);
@@ -1463,7 +1443,7 @@ ${dt}
1463
1443
 
1464
1444
  .when {
1465
1445
  color: #bbb;
1466
- ${J.bSmall.regular}
1446
+ ${X.bSmall.regular}
1467
1447
 
1468
1448
  /* the one part of the line worth scanning for, so it is the one part at full brightness */
1469
1449
  .count {
@@ -1482,29 +1462,29 @@ ${dt}
1482
1462
  color: #ddd;
1483
1463
  overflow-wrap: anywhere;
1484
1464
  white-space: pre-wrap;
1485
- ${J.bSmall.regular}
1465
+ ${X.bSmall.regular}
1486
1466
  }
1487
1467
  }
1488
1468
  }
1489
- `, ht = (e) => new Date(e).toLocaleTimeString(), gt = (e) => e === void 0 || !Number.isFinite(e) ? void 0 : Y(Math.max(0, e)), _t = (e) => e.reduce((e, t) => e + t.count, 0), vt = (e) => e.map((e, t) => {
1490
- let n = gt(e.atMediaTime), r = e.count > 1 ? `${new Date(e.at).toISOString()} to ${new Date(e.lastAt).toISOString()} ×${e.count}` : new Date(e.at).toISOString();
1469
+ `, mt = (e) => new Date(e).toLocaleTimeString(), ht = (e) => e === void 0 || !Number.isFinite(e) ? void 0 : Z(Math.max(0, e)), gt = (e) => e.reduce((e, t) => e + t.count, 0), _t = (e) => e.map((e, t) => {
1470
+ let n = ht(e.atMediaTime), r = e.count > 1 ? `${new Date(e.at).toISOString()} to ${new Date(e.lastAt).toISOString()} ×${e.count}` : new Date(e.at).toISOString();
1491
1471
  return [
1492
1472
  `${t + 1}. ${r}${n ? ` (at ${n})` : ""}${e.recovered ? " [recovered]" : ""}`,
1493
1473
  e.message,
1494
1474
  e.detail
1495
1475
  ].filter(Boolean).join("\n");
1496
- }).join("\n\n"), yt = () => {
1497
- let e = W((e) => e.playbackErrors), { open: t, toggle: n, containerRef: r } = pt(), [i, a] = m(!1);
1476
+ }).join("\n\n"), vt = () => {
1477
+ let e = W((e) => e.playbackErrors), { open: t, toggle: n, containerRef: r } = ft(), [i, a] = m(!1);
1498
1478
  if (e.length === 0) return null;
1499
1479
  let o = () => {
1500
- navigator.clipboard?.writeText(vt(e)).then(() => {
1480
+ navigator.clipboard?.writeText(_t(e)).then(() => {
1501
1481
  a(!0), setTimeout(() => a(!1), 2e3);
1502
1482
  }, (e) => console.warn("[media-player] could not copy the errors:", e));
1503
- }, s = `Playback errors (${_t(e)})`;
1483
+ }, s = `Playback errors (${gt(e)})`;
1504
1484
  return /* @__PURE__ */ T("div", {
1505
- css: mt,
1485
+ css: pt,
1506
1486
  ref: r,
1507
- children: [/* @__PURE__ */ w(Z, {
1487
+ children: [/* @__PURE__ */ w($, {
1508
1488
  id: "errors",
1509
1489
  disabled: t,
1510
1490
  text: /* @__PURE__ */ w("button", {
@@ -1513,7 +1493,7 @@ ${dt}
1513
1493
  onClick: n,
1514
1494
  "aria-label": s,
1515
1495
  "aria-expanded": t,
1516
- children: /* @__PURE__ */ w(E, { className: "alert-triangle" })
1496
+ children: /* @__PURE__ */ w(R, { className: "alert-triangle" })
1517
1497
  }),
1518
1498
  toolTipText: /* @__PURE__ */ w("span", { children: s })
1519
1499
  }), t && /* @__PURE__ */ T("div", {
@@ -1525,7 +1505,7 @@ ${dt}
1525
1505
  type: "button",
1526
1506
  onClick: o,
1527
1507
  "aria-label": "Copy the errors",
1528
- children: [w(i ? D : A, {}), /* @__PURE__ */ w("span", { children: i ? "Copied" : "Copy" })]
1508
+ children: [w(i ? O : j, {}), /* @__PURE__ */ w("span", { children: i ? "Copied" : "Copy" })]
1529
1509
  })]
1530
1510
  }), e.map((e, t) => /* @__PURE__ */ T("div", {
1531
1511
  className: "entry no-hover",
@@ -1533,9 +1513,9 @@ ${dt}
1533
1513
  /* @__PURE__ */ T("span", {
1534
1514
  className: "when",
1535
1515
  children: [
1536
- ht(e.at),
1537
- e.count > 1 ? ` to ${ht(e.lastAt)}` : "",
1538
- gt(e.atMediaTime) ? ` at ${gt(e.atMediaTime)}` : "",
1516
+ mt(e.at),
1517
+ e.count > 1 ? ` to ${mt(e.lastAt)}` : "",
1518
+ ht(e.atMediaTime) ? ` at ${ht(e.atMediaTime)}` : "",
1539
1519
  e.recovered ? " recovered" : "",
1540
1520
  e.count > 1 ? /* @__PURE__ */ w("span", {
1541
1521
  className: "count",
@@ -1555,7 +1535,7 @@ ${dt}
1555
1535
  }, `${e.at}-${t}`))]
1556
1536
  })]
1557
1537
  });
1558
- }, bt = g`
1538
+ }, yt = g`
1559
1539
  display: flex;
1560
1540
  align-items: center;
1561
1541
  justify-content: center;
@@ -1608,7 +1588,7 @@ width: 100%;
1608
1588
  }
1609
1589
  }
1610
1590
  }
1611
- `, xt = () => {
1591
+ `, bt = () => {
1612
1592
  let e = W(), t = W((e) => e.playbackRate), n = p(null), r = p(null), i = .25, a = 2.75, o = (e, t = .05) => Math.round(e / t) * t, s = o(t || 1), c = (e) => (e - i) / a * 100, l = (e) => o(i + e * a), { handlers: u } = Ne({
1613
1593
  ref: r,
1614
1594
  onChange: (t) => e.setPlaybackRate(l(t))
@@ -1625,7 +1605,7 @@ width: 100%;
1625
1605
  }, [t]);
1626
1606
  let m = c(s);
1627
1607
  return /* @__PURE__ */ T("div", {
1628
- css: bt,
1608
+ css: yt,
1629
1609
  children: [/* @__PURE__ */ T("div", { children: [s.toFixed(2), "x"] }), /* @__PURE__ */ w("div", {
1630
1610
  className: "playback-slider",
1631
1611
  ref: n,
@@ -1643,7 +1623,7 @@ width: 100%;
1643
1623
  })
1644
1624
  })]
1645
1625
  });
1646
- }, St = g`
1626
+ }, xt = g`
1647
1627
  /* Deliberately NOT a containing block. The menu anchors to the control bar instead, which is exactly
1648
1628
  as wide as the player box and can therefore be clamped to it. The outside-click check uses
1649
1629
  \`contains\` on the ref, which is DOM containment and needs no position, and the bar's other
@@ -1661,7 +1641,7 @@ position: static;
1661
1641
  }
1662
1642
  }
1663
1643
 
1664
- ${dt}
1644
+ ${ut}
1665
1645
 
1666
1646
  .playback-rate {
1667
1647
  .slider {
@@ -1702,8 +1682,8 @@ ${dt}
1702
1682
  }
1703
1683
  }
1704
1684
 
1705
- `, Ct = () => {
1706
- let e = W(), t = W((e) => e.playbackRate), n = W((e) => e.audioTracks), r = W((e) => e.selectedAudioTrack), i = W((e) => e.selectAudioTrack), [a, o] = m(0), { open: s, toggle: c, containerRef: l, pending: u, failed: d, runSelect: f } = pt({ onReset: () => o(0) }), p = (t) => {
1685
+ `, St = () => {
1686
+ let e = W(), t = W((e) => e.playbackRate), n = W((e) => e.audioTracks), r = W((e) => e.selectedAudioTrack), i = W((e) => e.selectAudioTrack), [a, o] = m(0), { open: s, toggle: c, containerRef: l, pending: u, failed: d, runSelect: f } = ft({ onReset: () => o(0) }), p = (t) => {
1707
1687
  e.setPlaybackRate(t), o(0);
1708
1688
  }, h = (e) => {
1709
1689
  e !== void 0 && f(e, () => i(e));
@@ -1711,10 +1691,10 @@ ${dt}
1711
1691
  o(e);
1712
1692
  };
1713
1693
  return /* @__PURE__ */ T("div", {
1714
- css: St,
1694
+ css: xt,
1715
1695
  ref: l,
1716
1696
  children: [
1717
- /* @__PURE__ */ w(Z, {
1697
+ /* @__PURE__ */ w($, {
1718
1698
  id: "settings",
1719
1699
  disabled: s,
1720
1700
  text: /* @__PURE__ */ w("button", {
@@ -1723,7 +1703,7 @@ ${dt}
1723
1703
  onClick: c,
1724
1704
  "aria-label": "Settings",
1725
1705
  "aria-expanded": s,
1726
- children: /* @__PURE__ */ w(I, {})
1706
+ children: /* @__PURE__ */ w(L, {})
1727
1707
  }),
1728
1708
  toolTipText: /* @__PURE__ */ w("span", { children: "Settings" })
1729
1709
  }),
@@ -1731,13 +1711,13 @@ ${dt}
1731
1711
  className: "popover menu",
1732
1712
  children: [n.length > 1 ? /* @__PURE__ */ T("div", {
1733
1713
  onClick: g(2),
1734
- children: [/* @__PURE__ */ w("div", { children: "Audio" }), /* @__PURE__ */ w("div", { children: /* @__PURE__ */ w(k, {}) })]
1714
+ children: [/* @__PURE__ */ w("div", { children: "Audio" }), /* @__PURE__ */ w("div", { children: /* @__PURE__ */ w(A, {}) })]
1735
1715
  }) : null, /* @__PURE__ */ T("div", {
1736
1716
  onClick: g(1),
1737
1717
  children: [/* @__PURE__ */ w("div", { children: "Playback speed" }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("span", {
1738
1718
  className: "secondary",
1739
1719
  children: t === 1 ? "(Default)" : t.toFixed(2)
1740
- }), /* @__PURE__ */ w(k, {})] })]
1720
+ }), /* @__PURE__ */ w(A, {})] })]
1741
1721
  })]
1742
1722
  }),
1743
1723
  s && a === 1 && /* @__PURE__ */ T("div", {
@@ -1746,11 +1726,11 @@ ${dt}
1746
1726
  /* @__PURE__ */ T("div", {
1747
1727
  className: "back",
1748
1728
  onClick: g(0),
1749
- children: [/* @__PURE__ */ w(O, {}), /* @__PURE__ */ w("span", { children: "Playback speed" })]
1729
+ children: [/* @__PURE__ */ w(k, {}), /* @__PURE__ */ w("span", { children: "Playback speed" })]
1750
1730
  }),
1751
1731
  /* @__PURE__ */ w("div", {
1752
1732
  className: "slider no-hover",
1753
- children: /* @__PURE__ */ w(xt, {})
1733
+ children: /* @__PURE__ */ w(bt, {})
1754
1734
  }),
1755
1735
  /* @__PURE__ */ T("div", {
1756
1736
  className: "options no-hover",
@@ -1775,7 +1755,7 @@ ${dt}
1775
1755
  })
1776
1756
  ]
1777
1757
  }),
1778
- s && a === 2 && /* @__PURE__ */ w(ft, {
1758
+ s && a === 2 && /* @__PURE__ */ w(dt, {
1779
1759
  title: "Audio",
1780
1760
  tracks: n,
1781
1761
  selected: r,
@@ -1786,7 +1766,7 @@ ${dt}
1786
1766
  })
1787
1767
  ]
1788
1768
  });
1789
- }, wt = g`
1769
+ }, Ct = g`
1790
1770
  /* Not a containing block, for the reason given on popoverStyle: the menu anchors to the control bar,
1791
1771
  which is the width of the player box, so it can be clamped to it. */
1792
1772
  position: static;
@@ -1802,15 +1782,15 @@ position: static;
1802
1782
  }
1803
1783
  }
1804
1784
 
1805
- ${dt}
1806
- `, Tt = () => {
1807
- let e = W((e) => e.subtitleTracks), t = W((e) => e.selectedSubtitleTrack), n = W((e) => e.selectSubtitleTrack), r = W((e) => e.subtitleOffLabel), { open: i, toggle: a, containerRef: o, pending: s, failed: c, runSelect: l } = pt();
1785
+ ${ut}
1786
+ `, wt = () => {
1787
+ let e = W((e) => e.subtitleTracks), t = W((e) => e.selectedSubtitleTrack), n = W((e) => e.selectSubtitleTrack), r = W((e) => e.subtitleOffLabel), { open: i, toggle: a, containerRef: o, pending: s, failed: c, runSelect: l } = ft();
1808
1788
  if (e.length === 0) return null;
1809
1789
  let u = t !== void 0;
1810
1790
  return /* @__PURE__ */ T("div", {
1811
- css: wt,
1791
+ css: Ct,
1812
1792
  ref: o,
1813
- children: [/* @__PURE__ */ w(Z, {
1793
+ children: [/* @__PURE__ */ w($, {
1814
1794
  id: "subtitles",
1815
1795
  disabled: i,
1816
1796
  text: /* @__PURE__ */ w("button", {
@@ -1820,10 +1800,10 @@ ${dt}
1820
1800
  "aria-label": "Subtitles",
1821
1801
  "aria-expanded": i,
1822
1802
  "aria-pressed": u,
1823
- children: u ? /* @__PURE__ */ w(st, { className: "captions" }) : /* @__PURE__ */ w(ct, { className: "captions-off" })
1803
+ children: u ? /* @__PURE__ */ w(E, { className: "captions" }) : /* @__PURE__ */ w(D, { className: "captions-off" })
1824
1804
  }),
1825
1805
  toolTipText: /* @__PURE__ */ w("span", { children: "Subtitles" })
1826
- }), i && /* @__PURE__ */ w(ft, {
1806
+ }), i && /* @__PURE__ */ w(dt, {
1827
1807
  title: "Subtitles",
1828
1808
  tracks: e,
1829
1809
  selected: t,
@@ -1833,13 +1813,13 @@ ${dt}
1833
1813
  failed: c
1834
1814
  })]
1835
1815
  });
1836
- }, Et = {
1816
+ }, Tt = {
1837
1817
  primary: "#EAEBEE",
1838
1818
  secondary: "#D0D0D9",
1839
1819
  hover: "rgba(255, 255, 255, 0.13)",
1840
1820
  borderPrimary: "#384F70",
1841
1821
  backgroundTooltip: "#222222"
1842
- }, Dt = g`
1822
+ }, Et = g`
1843
1823
  display: flex;
1844
1824
  align-items: center;
1845
1825
 
@@ -1882,7 +1862,7 @@ ${dt}
1882
1862
  width: 10px;
1883
1863
  height: 10px;
1884
1864
  }
1885
- `, Ot = ({ value: e, onChange: t }) => {
1865
+ `, Dt = ({ value: e, onChange: t }) => {
1886
1866
  let n = W((e) => e.volume), r = W((e) => e.muted), i = p(null), a = p(null), { handlers: o } = Ne({
1887
1867
  ref: a,
1888
1868
  onChange: t
@@ -1898,11 +1878,11 @@ ${dt}
1898
1878
  };
1899
1879
  }, [e]);
1900
1880
  let c = e * 100, l = f(() => Math.round(r ? 0 : Oe(n) * 100), [n, r]);
1901
- return /* @__PURE__ */ w(Z, {
1881
+ return /* @__PURE__ */ w($, {
1902
1882
  id: "volume-slider",
1903
1883
  text: /* @__PURE__ */ w("div", {
1904
1884
  ref: i,
1905
- css: Dt,
1885
+ css: Et,
1906
1886
  ...o,
1907
1887
  children: /* @__PURE__ */ w("div", {
1908
1888
  ref: a,
@@ -1921,7 +1901,7 @@ ${dt}
1921
1901
  children: [l, "%"]
1922
1902
  })
1923
1903
  });
1924
- }, kt = g`
1904
+ }, Ot = g`
1925
1905
  position: relative;
1926
1906
  display: flex;
1927
1907
  align-items: center;
@@ -1946,7 +1926,7 @@ ${dt}
1946
1926
  border-radius: 4px;
1947
1927
 
1948
1928
  .volume-value {
1949
- ${J.bMedium.regular};
1929
+ ${X.bMedium.regular};
1950
1930
  color: #ffffff;
1951
1931
  }
1952
1932
  }
@@ -1984,11 +1964,11 @@ ${dt}
1984
1964
  }
1985
1965
  }
1986
1966
 
1987
- `, At = ({ ref: e }) => {
1967
+ `, kt = ({ ref: e }) => {
1988
1968
  let t = W(), n = W((e) => e.volume), r = W((e) => e.muted), i = f(() => Oe(n), [n]);
1989
1969
  return /* @__PURE__ */ T("div", {
1990
- css: kt,
1991
- children: [/* @__PURE__ */ w(Z, {
1970
+ css: Ot,
1971
+ children: [/* @__PURE__ */ w($, {
1992
1972
  id: "sound",
1993
1973
  text: /* @__PURE__ */ w("button", {
1994
1974
  className: "sound",
@@ -1997,7 +1977,7 @@ ${dt}
1997
1977
  ref: e,
1998
1978
  "aria-label": "Mute",
1999
1979
  "aria-pressed": r || n === 0,
2000
- children: w(r || n === 0 ? z : n <= .5 ? L : R, {
1980
+ children: w(r || n === 0 ? ee : n <= .5 ? z : B, {
2001
1981
  size: 18,
2002
1982
  color: "#fff"
2003
1983
  })
@@ -2007,7 +1987,7 @@ ${dt}
2007
1987
  className: "volume-slider-container",
2008
1988
  children: /* @__PURE__ */ w("div", {
2009
1989
  className: "volume-slider-background",
2010
- children: /* @__PURE__ */ w(Ot, {
1990
+ children: /* @__PURE__ */ w(Dt, {
2011
1991
  value: r ? 0 : i,
2012
1992
  onChange: (e) => {
2013
1993
  t.setVolume(De(e));
@@ -2016,7 +1996,7 @@ ${dt}
2016
1996
  })
2017
1997
  })]
2018
1998
  });
2019
- }, $ = .05, jt = 5, Mt = 50, Nt = 1e3, Pt = g`
1999
+ }, At = .05, jt = 5, Mt = 50, Nt = 1e3, Pt = g`
2020
2000
  display: flex;
2021
2001
  flex-direction: column;
2022
2002
  gap: calc(0.4 * var(--mp-unit));
@@ -2117,7 +2097,7 @@ ${dt}
2117
2097
  /* .armed is the hover of a control letting its click through, which takes no pointer events
2118
2098
  of its own and so is never :hover */
2119
2099
  :hover, &.armed {
2120
- background-color: ${Et.hover};
2100
+ background-color: ${Tt.hover};
2121
2101
  }
2122
2102
 
2123
2103
  /* the hit area grows, the icon does not, keyed on the pointer because a narrow desktop
@@ -2134,7 +2114,7 @@ ${dt}
2134
2114
 
2135
2115
  .left {
2136
2116
  .time {
2137
- ${J.bMedium.regular}
2117
+ ${X.bMedium.regular}
2138
2118
  text-shadow: 0 0 4px rgba(0, 0, 0, 1);
2139
2119
  }
2140
2120
  }
@@ -2171,11 +2151,11 @@ ${dt}
2171
2151
  else if (n.key === "m") e.toggleMuted();
2172
2152
  else if (n.key === "ArrowUp") E({
2173
2153
  direction: "up",
2174
- stepSize: $
2154
+ stepSize: At
2175
2155
  });
2176
2156
  else if (n.key === "ArrowDown") E({
2177
2157
  direction: "down",
2178
- stepSize: $
2158
+ stepSize: At
2179
2159
  });
2180
2160
  else if (n.key === "ArrowRight") {
2181
2161
  if (!e.duration) return;
@@ -2192,10 +2172,10 @@ ${dt}
2192
2172
  let D = u((e) => {
2193
2173
  e.preventDefault(), e.deltaY < 0 ? E({
2194
2174
  direction: "up",
2195
- stepSize: $
2175
+ stepSize: At
2196
2176
  }) : E({
2197
2177
  direction: "down",
2198
- stepSize: $
2178
+ stepSize: At
2199
2179
  });
2200
2180
  }, [E]);
2201
2181
  d(() => {
@@ -2236,7 +2216,7 @@ ${dt}
2236
2216
  children: [/* @__PURE__ */ T("div", {
2237
2217
  className: "left",
2238
2218
  children: [
2239
- /* @__PURE__ */ w(Z, {
2219
+ /* @__PURE__ */ w($, {
2240
2220
  id: "play",
2241
2221
  tooltipPlace: "top-start",
2242
2222
  text: /* @__PURE__ */ w("button", {
@@ -2244,11 +2224,11 @@ ${dt}
2244
2224
  type: "button",
2245
2225
  onClick: () => e.togglePaused(),
2246
2226
  "aria-label": C ? "Replay" : t ? "Play" : "Pause",
2247
- children: w(C ? F : t ? P : N, {})
2227
+ children: w(C ? I : t ? F : P, {})
2248
2228
  }),
2249
2229
  toolTipText: /* @__PURE__ */ w("span", { children: C ? "Replay (k)" : t ? "Play (k)" : "Pause (k)" })
2250
2230
  }),
2251
- /* @__PURE__ */ w(At, { ref: v }),
2231
+ /* @__PURE__ */ w(kt, { ref: v }),
2252
2232
  /* @__PURE__ */ w("div", {
2253
2233
  className: "time",
2254
2234
  children: ke(i ?? n, r)
@@ -2257,10 +2237,10 @@ ${dt}
2257
2237
  }), /* @__PURE__ */ T("div", {
2258
2238
  className: "right",
2259
2239
  children: [
2260
- /* @__PURE__ */ w(yt, {}),
2261
- /* @__PURE__ */ w(Tt, {}),
2262
- /* @__PURE__ */ w(Ct, {}),
2263
- f ? /* @__PURE__ */ w(Z, {
2240
+ /* @__PURE__ */ w(vt, {}),
2241
+ /* @__PURE__ */ w(wt, {}),
2242
+ /* @__PURE__ */ w(St, {}),
2243
+ f ? /* @__PURE__ */ w($, {
2264
2244
  id: "picture-in-picture",
2265
2245
  tooltipPlace: "top-end",
2266
2246
  text: /* @__PURE__ */ w("button", {
@@ -2278,7 +2258,7 @@ ${dt}
2278
2258
  })
2279
2259
  }),
2280
2260
  toolTipText: /* @__PURE__ */ w("span", { children: f.active ? "Exit picture in picture" : "Picture in picture" })
2281
- }) : s ? /* @__PURE__ */ w(Z, {
2261
+ }) : s ? /* @__PURE__ */ w($, {
2282
2262
  id: "picture-in-picture",
2283
2263
  tooltipPlace: "top-end",
2284
2264
  text: /* @__PURE__ */ w("button", {
@@ -2288,7 +2268,7 @@ ${dt}
2288
2268
  disabled: x && !S,
2289
2269
  "aria-label": x ? "Put the subtitles in the video" : "Picture in picture",
2290
2270
  "aria-pressed": x ? l : void 0,
2291
- children: x ? w(l ? lt : ut, {}) : /* @__PURE__ */ w("img", {
2271
+ children: x ? w(l ? ct : lt, {}) : /* @__PURE__ */ w("img", {
2292
2272
  src: ot,
2293
2273
  alt: ""
2294
2274
  })
@@ -2304,7 +2284,7 @@ ${dt}
2304
2284
  }) : null]
2305
2285
  })
2306
2286
  }) : null,
2307
- /* @__PURE__ */ w(Z, {
2287
+ /* @__PURE__ */ w($, {
2308
2288
  id: "full-screen",
2309
2289
  tooltipPlace: "top-end",
2310
2290
  text: /* @__PURE__ */ w("button", {
@@ -2313,7 +2293,7 @@ ${dt}
2313
2293
  onClick: () => e.toggleFullscreen(),
2314
2294
  "aria-label": "Full screen",
2315
2295
  "aria-pressed": a,
2316
- children: w(a ? M : j, {})
2296
+ children: w(a ? N : M, {})
2317
2297
  }),
2318
2298
  toolTipText: /* @__PURE__ */ w("span", { children: a ? "Exit full screen (f)" : "Full screen (f)" })
2319
2299
  })
@@ -2359,12 +2339,12 @@ ${dt}
2359
2339
  }
2360
2340
 
2361
2341
  .title {
2362
- ${J.bMedium.bold}
2342
+ ${X.bMedium.bold}
2363
2343
  color: #fff;
2364
2344
  }
2365
2345
 
2366
2346
  .body {
2367
- ${J.bSmall.regular}
2347
+ ${X.bSmall.regular}
2368
2348
  color: rgba(255, 255, 255, 0.75);
2369
2349
  }
2370
2350
 
@@ -2427,7 +2407,7 @@ ${dt}
2427
2407
  pointer-events: auto;
2428
2408
  cursor: pointer;
2429
2409
 
2430
- ${J.bMedium.bold}
2410
+ ${X.bMedium.bold}
2431
2411
  color: #fff;
2432
2412
  padding: calc(1 * var(--mp-unit)) calc(1.8 * var(--mp-unit));
2433
2413
  border: 1px solid rgba(255, 255, 255, .55);
@@ -2462,43 +2442,43 @@ ${dt}
2462
2442
  }
2463
2443
  }
2464
2444
  `, Gt = () => {
2465
- let e = W((e) => e.chapters), t = W((e) => e.currentTime), n = W((e) => e.requestSeek), r = W(), i = f(() => nt(e), [e]), a = f(() => {
2445
+ let e = W((e) => e.chapters), t = W((e) => e.currentTime), n = W((e) => e.requestSeek), r = W((e) => e.seekPreview), i = W(), a = f(() => nt(e), [e]), o = f(() => {
2466
2446
  if (typeof t != "number") return;
2467
- let n = e.findIndex((e, n) => i[n] !== void 0 && e.start - Bt <= t && t < e.end), r = n >= 0 ? i[n] : void 0;
2447
+ let n = e.findIndex((e, n) => a[n] !== void 0 && e.start - Bt <= t && t < e.end), r = n >= 0 ? a[n] : void 0;
2468
2448
  return r ? {
2469
2449
  kind: r,
2470
2450
  end: e[n].end
2471
2451
  } : void 0;
2472
2452
  }, [
2473
2453
  e,
2474
- i,
2454
+ a,
2475
2455
  t
2476
- ]), o = p(0), [s, c] = m(0);
2456
+ ]), s = p(0), [c, l] = m(0);
2477
2457
  d(() => {
2478
- let e = typeof t == "number" ? t : 0, n = o.current;
2479
- o.current = e, e < n - Ht && c((e) => e + 1);
2458
+ let e = typeof t == "number" ? t : 0, n = s.current;
2459
+ s.current = e, e < n - Ht && l((e) => e + 1);
2480
2460
  }, [t]);
2481
- let [l, u] = m(!1), h = a ? `${a.kind}@${a.end}` : "";
2461
+ let [u, h] = m(!1), g = o ? `${o.kind}@${o.end}` : "";
2482
2462
  return d(() => {
2483
- if (!h) {
2484
- u(!1);
2463
+ if (!g) {
2464
+ h(!1);
2485
2465
  return;
2486
2466
  }
2487
- u(!0);
2488
- let e = setTimeout(() => u(!1), Vt);
2467
+ h(!0);
2468
+ let e = setTimeout(() => h(!1), Vt);
2489
2469
  return () => clearTimeout(e);
2490
- }, [h, s]), d(() => {
2491
- a || u(!1);
2492
- }, [a]), a ? /* @__PURE__ */ w("div", {
2470
+ }, [g, c]), d(() => {
2471
+ o || h(!1);
2472
+ }, [o]), o ? /* @__PURE__ */ w("div", {
2493
2473
  css: Wt,
2494
- className: l ? "show" : "",
2474
+ className: u && !r ? "show" : "",
2495
2475
  children: /* @__PURE__ */ w("button", {
2496
2476
  type: "button",
2497
2477
  className: "skip-chapter",
2498
2478
  onClick: () => {
2499
- u(!1), n ? n(a.end) : r.seek(a.end);
2479
+ h(!1), n ? n(o.end) : i.seek(o.end);
2500
2480
  },
2501
- children: Ut[a.kind]
2481
+ children: Ut[o.kind]
2502
2482
  })
2503
2483
  }) : null;
2504
2484
  }, Kt = 3e3, qt = g`
@@ -2699,11 +2679,11 @@ ${dt}
2699
2679
  s,
2700
2680
  B
2701
2681
  ]);
2702
- let V = n?.thumbnails?.at;
2682
+ let ee = n?.thumbnails?.at;
2703
2683
  d(() => {
2704
2684
  z({
2705
2685
  thumbnails: P,
2706
- thumbnailAt: V,
2686
+ thumbnailAt: ee,
2707
2687
  requestThumbnail: N,
2708
2688
  togglePictureInPicture: F,
2709
2689
  pictureInPictureMode: I,
@@ -2712,7 +2692,7 @@ ${dt}
2712
2692
  }, [
2713
2693
  z,
2714
2694
  P,
2715
- V,
2695
+ ee,
2716
2696
  N,
2717
2697
  F,
2718
2698
  I,
@@ -2720,29 +2700,29 @@ ${dt}
2720
2700
  ]), d(() => {
2721
2701
  z({ passThroughPictureInPicture: R });
2722
2702
  }, [z, R]);
2723
- let H = n?.subtitles?.selection, U = n?.audioTracks?.selection;
2703
+ let V = n?.subtitles?.selection, H = n?.audioTracks?.selection;
2724
2704
  return d(() => {
2725
- H && z({
2726
- subtitleTracks: H.options.map(({ id: e, label: t, disabled: n }) => ({
2705
+ V && z({
2706
+ subtitleTracks: V.options.map(({ id: e, label: t, disabled: n }) => ({
2727
2707
  id: e,
2728
2708
  label: t,
2729
2709
  disabled: n
2730
2710
  })),
2731
- selectedSubtitleTrack: H.selectedId ?? void 0,
2732
- selectSubtitleTrack: (e) => H.select(e == null ? null : String(e)),
2733
- subtitleOffLabel: H.offLabel
2711
+ selectedSubtitleTrack: V.selectedId ?? void 0,
2712
+ selectSubtitleTrack: (e) => V.select(e == null ? null : String(e)),
2713
+ subtitleOffLabel: V.offLabel
2734
2714
  });
2735
- }, [z, H]), d(() => {
2736
- U && z({
2737
- audioTracks: U.options.map(({ id: e, label: t, disabled: n }) => ({
2715
+ }, [z, V]), d(() => {
2716
+ H && z({
2717
+ audioTracks: H.options.map(({ id: e, label: t, disabled: n }) => ({
2738
2718
  id: e,
2739
2719
  label: t,
2740
2720
  disabled: n
2741
2721
  })),
2742
- selectedAudioTrack: U.selectedId ?? void 0,
2743
- selectAudioTrack: (e) => U.select(String(e))
2722
+ selectedAudioTrack: H.selectedId ?? void 0,
2723
+ selectAudioTrack: (e) => H.select(String(e))
2744
2724
  });
2745
- }, [z, U]), d(() => {
2725
+ }, [z, H]), d(() => {
2746
2726
  a && z({ chapters: a });
2747
2727
  }, [z, a]), /* @__PURE__ */ w(Zt, {
2748
2728
  ref: _,
@@ -2869,4 +2849,4 @@ ${dt}
2869
2849
  throw Error(`Unknown source type: ${e}`);
2870
2850
  };
2871
2851
  //#endregion
2872
- export { en as MediaPlayer, en as default, U as Player, e as SUBTITLES_OFF, a as createPictureInPicture, o as createSubtitleRenderer, r as createThumbnailGenerator, sn as inputToRemuxerInput, nn as isDelegatedTracks, tn as isExternalThumbnails, H as sourceFeature, i as startPlayback, de as usePictureInPicture, W as usePlayer, ue as useSeekThumbnails };
2852
+ export { en as MediaPlayer, en as default, U as Player, e as SUBTITLES_OFF, a as createPictureInPicture, o as createSubtitleRenderer, r as createThumbnailGenerator, sn as inputToRemuxerInput, nn as isDelegatedTracks, tn as isExternalThumbnails, te as sourceFeature, i as startPlayback, de as usePictureInPicture, W as usePlayer, ue as useSeekThumbnails };