@banou/media-player 0.10.8 → 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,10 +4,10 @@ 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 ee } 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 B = {
10
+ var H = {
11
11
  indexes: [],
12
12
  chapters: [],
13
13
  thumbnails: [],
@@ -30,19 +30,19 @@ var B = {
30
30
  playbackErrors: [],
31
31
  ready: !1,
32
32
  setSourceState: () => {}
33
- }, V = x({
33
+ }, te = x({
34
34
  name: "source",
35
- state: () => ({ ...B }),
35
+ state: () => ({ ...H }),
36
36
  attach({ set: e }) {
37
37
  e({
38
38
  setSourceState: (t) => e(t),
39
39
  setHideUI: (t) => e({ hideUI: t })
40
40
  });
41
41
  }
42
- }), H = v({
43
- features: [...S, V],
42
+ }), U = v({
43
+ features: [...S, te],
44
44
  displayName: "MediaPlayer"
45
- }), U = H.usePlayer, te = (e) => {
45
+ }), W = U.usePlayer, G = (e) => {
46
46
  if (e && e !== "und") try {
47
47
  return new Intl.DisplayNames([navigator.language || "en"], {
48
48
  type: "language",
@@ -51,39 +51,39 @@ var B = {
51
51
  } catch {
52
52
  return;
53
53
  }
54
- }, ne = (e) => e?.replace(/_/g, " ").trim() || void 0, W = (e) => {
55
- let t = e.map((e) => te(e.language) ?? ne(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) => ({
56
56
  ...e,
57
57
  [t]: (e[t] ?? 0) + 1
58
58
  }), {});
59
59
  return e.map((e, r) => {
60
- let i = t[r], a = ne(e.title);
60
+ let i = t[r], a = K(e.title);
61
61
  return {
62
62
  track: e,
63
63
  label: (n[i] ?? 0) > 1 && a && a !== i ? `${i} (${a})` : i
64
64
  };
65
65
  });
66
- }, G = (e) => W(e).map(({ track: e, label: t }) => ({
66
+ }, ne = (e) => q(e).map(({ track: e, label: t }) => ({
67
67
  id: e.streamIndex,
68
68
  label: t
69
- })), K = [
69
+ })), J = [
70
70
  0,
71
71
  250,
72
72
  1e3,
73
73
  3e3,
74
74
  1e4
75
- ], re = 6e4, ie = 500, q = 15e3, J = (e) => e instanceof Error ? e.message : String(e), ae = (e) => {
75
+ ], Y = 6e4, re = 500, ie = 15e3, ae = (e) => e instanceof Error ? e.message : String(e), oe = (e) => {
76
76
  let t = [], n = e?.cause;
77
77
  for (let e = 0; n != null && e < 8; e++) {
78
78
  if (typeof MediaError < "u" && n instanceof MediaError) {
79
79
  t.push(`MediaError code ${n.code}${n.message ? `: ${n.message}` : ""}`);
80
80
  break;
81
81
  }
82
- t.push(J(n)), n = n?.cause;
82
+ t.push(ae(n)), n = n?.cause;
83
83
  }
84
84
  return t.length ? t.join("\n") : void 0;
85
- }, oe = (e, t, r) => {
86
- let a = U(), { read: o, size: s, publicPath: c = "", libavWorkerUrl: l = "", jassubWorkerUrl: f = "", jassubWasmUrl: h = "", jassubLegacyWasmUrl: g, defaultFontUrl: _, bufferSize: v, autoplay: y = !1, chapters: b, seekPrepareBudgetMs: x = ie } = r ?? {}, S = p(b);
85
+ }, se = (e, t, r) => {
86
+ let a = W(), { read: o, size: s, publicPath: c = "", libavWorkerUrl: l = "", jassubWorkerUrl: f = "", jassubWasmUrl: h = "", jassubLegacyWasmUrl: g, defaultFontUrl: _, bufferSize: v, autoplay: y = !1, chapters: b, seekPrepareBudgetMs: x = re } = r ?? {}, S = p(b);
87
87
  S.current = b;
88
88
  let [C, w] = m(void 0), [T, E] = m(0), D = p({
89
89
  count: 0,
@@ -120,7 +120,7 @@ var B = {
120
120
  a.setSourceState({ seekingTo: e });
121
121
  let c = t.videoElement, l = () => {
122
122
  c?.removeEventListener("seeked", l), clearTimeout(u), a.setSourceState({ seekingTo: void 0 });
123
- }, u = setTimeout(l, q);
123
+ }, u = setTimeout(l, ie);
124
124
  c?.addEventListener("seeked", l);
125
125
  let d = setTimeout(() => {
126
126
  o = "deadline", s();
@@ -130,7 +130,7 @@ var B = {
130
130
  });
131
131
  }, [a, x]), L = u((e) => {
132
132
  typeof e == "number" && (a.setSourceState({ selectedAudioTrack: e }), w(e));
133
- }, [a]), R = U((e) => e.setSourceState);
133
+ }, [a]), R = W((e) => e.setSourceState);
134
134
  d(() => {
135
135
  R({
136
136
  selectSubtitleTrack: F,
@@ -150,7 +150,7 @@ var B = {
150
150
  ready: !1
151
151
  });
152
152
  let u = (t, n) => {
153
- let r = Date.now(), i = J(t), o = ae(t), s = a.playbackErrors, c = s[s.length - 1];
153
+ let r = Date.now(), i = ae(t), o = oe(t), s = a.playbackErrors, c = s[s.length - 1];
154
154
  if (c && c.message === i && c.detail === o && c.recovered === n) {
155
155
  let e = {
156
156
  ...c,
@@ -175,11 +175,11 @@ var B = {
175
175
  let t = n(e);
176
176
  if (u(e, t), t) {
177
177
  let t = performance.now();
178
- t - D.current.at > re && (D.current = {
178
+ t - D.current.at > Y && (D.current = {
179
179
  count: 0,
180
180
  at: t
181
181
  });
182
- let n = K[Math.min(D.current.count, K.length - 1)];
182
+ let n = J[Math.min(D.current.count, J.length - 1)];
183
183
  D.current = {
184
184
  count: D.current.count + 1,
185
185
  at: t
@@ -216,13 +216,13 @@ var B = {
216
216
  onSeek: (e) => N.current?.(e),
217
217
  onSubtitleStreams: (e) => {
218
218
  r || a.setSourceState({
219
- subtitleTracks: G(e),
219
+ subtitleTracks: ne(e),
220
220
  ...j.current ? {} : { selectedSubtitleTrack: e[0]?.streamIndex }
221
221
  });
222
222
  },
223
223
  onAudioStreams: (e, t) => {
224
224
  r || a.setSourceState({
225
- audioTracks: G(e),
225
+ audioTracks: ne(e),
226
226
  selectedAudioTrack: t
227
227
  });
228
228
  }
@@ -262,13 +262,13 @@ var B = {
262
262
  y,
263
263
  T
264
264
  ]);
265
- }, se = 5e3, ce = 6e4, le = ({ publicPath: e, workerUrl: t, length: n, read: i, downloadedRanges: a }) => {
265
+ }, ce = 5e3, le = 6e4, ue = ({ publicPath: e, workerUrl: t, length: n, read: i, downloadedRanges: a }) => {
266
266
  let [o, s] = m([]), c = p(null), l = p(i);
267
267
  l.current = i;
268
268
  let h = f(() => a?.map(({ startByteOffset: e, endByteOffset: t }) => [e, t]), [a?.map(({ startByteOffset: e, endByteOffset: t }) => `${e}-${t}`).join(",")]), g = p(h);
269
269
  return g.current = h, d(() => {
270
270
  if (!n || !i || !e || !t) return;
271
- let a = !1, o = null, u, d = se, f = () => {
271
+ let a = !1, o = null, u, d = ce, f = () => {
272
272
  r({
273
273
  publicPath: e,
274
274
  workerUrl: t,
@@ -284,7 +284,7 @@ var B = {
284
284
  }
285
285
  o = e, c.current = e, e.update(g.current);
286
286
  }, () => {
287
- a || (u = setTimeout(f, d), d = Math.min(d * 2, ce));
287
+ a || (u = setTimeout(f, d), d = Math.min(d * 2, le));
288
288
  });
289
289
  };
290
290
  return f(), () => {
@@ -302,7 +302,7 @@ var B = {
302
302
  c.current?.prioritize(e);
303
303
  }, [])
304
304
  };
305
- }, ue = (e, n) => {
305
+ }, de = (e, n) => {
306
306
  let r = p(null), [i, o] = m(!1), [s] = m(() => t());
307
307
  d(() => {
308
308
  if (!e || !n || !s) return;
@@ -330,10 +330,10 @@ var B = {
330
330
  mode: s,
331
331
  burnedIn: i
332
332
  };
333
- }, de = "(hover: hover) and (pointer: fine)", fe = () => typeof matchMedia == "function" ? matchMedia(de) : void 0, pe = (e) => {
334
- let t = fe();
333
+ }, fe = "(hover: hover) and (pointer: fine)", pe = () => typeof matchMedia == "function" ? matchMedia(fe) : void 0, me = (e) => {
334
+ let t = pe();
335
335
  return t?.addEventListener("change", e), () => t?.removeEventListener("change", e);
336
- }, me = () => !!fe()?.matches, he = () => !1, ge = (e, t) => {
336
+ }, he = () => !!pe()?.matches, ge = () => !1, _e = (e, t) => {
337
337
  let [n, r] = m(!1), [i, a] = m(), o = p(t);
338
338
  t && (o.current = t);
339
339
  let s = p(!1), c = u((e) => {
@@ -356,7 +356,7 @@ var B = {
356
356
  _,
357
357
  g
358
358
  ]);
359
- let v = h(pe, me, he), [y, b] = m(!1);
359
+ let v = h(me, he, ge), [y, b] = m(!1);
360
360
  d(() => {
361
361
  if (!_) return;
362
362
  let e = (e) => {
@@ -397,7 +397,7 @@ var B = {
397
397
  g,
398
398
  S
399
399
  ]);
400
- }, Y = {
400
+ }, X = {
401
401
  headings: {
402
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 ",
403
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 ",
@@ -424,7 +424,7 @@ var B = {
424
424
  medium: "\n font-weight: 500;\n font-size: calc(0.8 * var(--mp-unit));\n line-height: calc(1.1 * var(--mp-unit));\n @media (min-width: 960px) {\n font-size: calc(1 * var(--mp-unit));\n line-height: calc(1.4 * var(--mp-unit));\n }\n ",
425
425
  regular: "\n font-weight: 400;\n font-size: calc(0.8 * var(--mp-unit));\n line-height: calc(1.1 * var(--mp-unit));\n @media (min-width: 960px) {\n font-size: calc(1 * var(--mp-unit));\n line-height: calc(1.4 * var(--mp-unit));\n }\n "
426
426
  }
427
- }, _e = g`
427
+ }, ve = g`
428
428
  display: flex;
429
429
  justify-content: center;
430
430
  align-items: center;
@@ -437,7 +437,7 @@ var B = {
437
437
  margin: auto;
438
438
  pointer-events: none;
439
439
  }
440
- `, ve = g`
440
+ `, ye = g`
441
441
  position: absolute;
442
442
  top: 0;
443
443
  left: 0;
@@ -445,7 +445,7 @@ var B = {
445
445
  padding: calc(1.2 * var(--mp-unit)) calc(1.6 * var(--mp-unit));
446
446
  /* clears a notch once the player is fullscreen; resolves to zero everywhere else */
447
447
  padding-top: calc(calc(1.2 * var(--mp-unit)) + env(safe-area-inset-top, 0px));
448
- ${Y.headings.small}
448
+ ${X.headings.small}
449
449
  color: white;
450
450
  text-shadow: 0 0 4px rgba(0, 0, 0, 1);
451
451
  z-index: 2;
@@ -466,9 +466,9 @@ var B = {
466
466
 
467
467
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.3) 30%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0.1) 80%, transparent 100%);
468
468
  transition: opacity 0.1s cubic-bezier(.4,0,1,1);
469
- `, ye = _`
469
+ `, be = _`
470
470
  to { transform: rotate(360deg); }
471
- `, be = g`
471
+ `, xe = g`
472
472
  position: absolute;
473
473
  inset: 0;
474
474
  z-index: 2;
@@ -484,46 +484,46 @@ var B = {
484
484
  border-radius: 50%;
485
485
  border: 3px solid rgba(255, 255, 255, 0.25);
486
486
  border-top-color: #fff;
487
- animation: ${ye} 0.8s linear infinite;
487
+ animation: ${be} 0.8s linear infinite;
488
488
  }
489
- `, xe = g`
489
+ `, Se = g`
490
490
  position: absolute;
491
491
  inset: auto 0 20%;
492
492
  z-index: 3;
493
493
  padding: 0 calc(2 * var(--mp-unit));
494
494
  text-align: center;
495
495
  color: #fff;
496
- ${Y.bLarge.regular}
496
+ ${X.bLarge.regular}
497
497
  text-shadow: 0 0 4px rgba(0, 0, 0, 1);
498
498
  pointer-events: none;
499
- `, Se = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : "Playback failed", Ce = ({ onSubtitleRef: e }) => {
500
- let t = U((e) => e.title), n = U((e) => e.hideUI), r = U((e) => e.playbackError), i = U((e) => e.ready), a = U((e) => e.size), o = U((e) => e.waiting), s = U((e) => e.seekingTo);
499
+ `, Ce = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : "Playback failed", we = ({ onSubtitleRef: e }) => {
500
+ let t = W((e) => e.title), n = W((e) => e.hideUI), r = W((e) => e.playbackError), i = W((e) => e.ready), a = W((e) => e.size), o = W((e) => e.waiting), s = W((e) => e.seekingTo);
501
501
  return /* @__PURE__ */ T(C, { children: [
502
502
  t ? /* @__PURE__ */ w("div", {
503
503
  className: "title",
504
- css: ve,
504
+ css: ye,
505
505
  style: { ...n ? {
506
506
  opacity: "0",
507
507
  pointerEvents: "none"
508
508
  } : {} },
509
509
  children: t
510
510
  }) : void 0,
511
- ((a ? !i : o) || s !== void 0) && !r ? /* @__PURE__ */ w("div", { css: be }) : void 0,
511
+ ((a ? !i : o) || s !== void 0) && !r ? /* @__PURE__ */ w("div", { css: xe }) : void 0,
512
512
  r ? /* @__PURE__ */ w("div", {
513
- css: xe,
514
- children: Se(r)
513
+ css: Se,
514
+ children: Ce(r)
515
515
  }) : void 0,
516
516
  /* @__PURE__ */ w("div", {
517
517
  className: "subtitles",
518
518
  ref: e,
519
- css: _e
519
+ css: ve
520
520
  })
521
521
  ] });
522
- }, we = 1e-4, Te = 1, Ee = (e) => Math.max(we, Math.min(Te, e)) ** 2, De = (e) => Math.max(we, Math.min(Te, e)) ** (Te / 2), X = (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) => {
523
523
  if (e === void 0) return "0:00";
524
524
  let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), r = Math.floor(e % 60);
525
525
  return t > 0 ? `${t}:${n < 10 ? "0" : ""}${n}:${r < 10 ? "0" : ""}${r}` : `${n}:${r < 10 ? "0" : ""}${r}`;
526
- }, Oe = (e, t) => `${X(e)} / ${X(t)}`, ke = (e) => g`
526
+ }, ke = (e, t) => `${Z(e)} / ${Z(t)}`, Ae = (e) => g`
527
527
  display: flex;
528
528
  justify-content: flex-start;
529
529
 
@@ -555,7 +555,7 @@ var B = {
555
555
  z-index: 3;
556
556
 
557
557
  * {
558
- ${Y.bMedium.regular}
558
+ ${X.bMedium.regular}
559
559
  }
560
560
 
561
561
  ${e === "sm" && g`
@@ -567,25 +567,25 @@ var B = {
567
567
  ${e === "lg" && g`
568
568
  padding: calc(1.2 * var(--mp-unit))!important;
569
569
  `}
570
- `, Z = {
570
+ `, Q = {
571
571
  x: -1,
572
572
  y: -1,
573
573
  anchors: 0
574
- }, Ae = (e) => {
575
- Z.x = e.clientX, Z.y = e.clientY;
576
- }, je = () => (Z.anchors++ === 0 && window.addEventListener("pointermove", Ae, {
574
+ }, je = (e) => {
575
+ Q.x = e.clientX, Q.y = e.clientY;
576
+ }, Me = () => (Q.anchors++ === 0 && window.addEventListener("pointermove", je, {
577
577
  capture: !0,
578
578
  passive: !0
579
579
  }), () => {
580
- --Z.anchors === 0 && window.removeEventListener("pointermove", Ae, { capture: !0 });
581
- }), Q = ({ 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" }) => {
582
582
  let l = p(null), u = p(null);
583
583
  return d(() => {
584
- let e = je(), t = () => {
584
+ let e = Me(), t = () => {
585
585
  let e = l.current;
586
586
  if (!e) return;
587
587
  let { left: t, right: n, top: r, bottom: i } = e.getBoundingClientRect();
588
- Z.x >= t && Z.x < n && Z.y >= r && Z.y < i || u.current?.close();
588
+ Q.x >= t && Q.x < n && Q.y >= r && Q.y < i || u.current?.close();
589
589
  }, n = ["fullscreenchange", "webkitfullscreenchange"];
590
590
  for (let e of n) document.addEventListener(e, t);
591
591
  return () => {
@@ -601,14 +601,14 @@ var B = {
601
601
  "data-tooltip-delay-hide": i,
602
602
  "data-tooltip-place": o,
603
603
  children: n
604
- }), !s && /* @__PURE__ */ w(ee, {
604
+ }), !s && /* @__PURE__ */ w(V, {
605
605
  ref: u,
606
- css: ke(c),
606
+ css: Ae(c),
607
607
  id: e,
608
608
  noArrow: !0,
609
609
  children: t
610
610
  })] });
611
- }, Me = ({ ref: e, onChange: t, orientation: n = "horizontal", disabled: r = !1 }) => {
611
+ }, Ne = ({ ref: e, onChange: t, orientation: n = "horizontal", disabled: r = !1 }) => {
612
612
  let [i, a] = m(!1), o = p(t);
613
613
  o.current = t;
614
614
  let s = p(null), c = u((t, r) => {
@@ -647,26 +647,26 @@ var B = {
647
647
  style: { touchAction: "none" }
648
648
  }
649
649
  };
650
- }, Ne = 2, Pe = .005, Fe = "#000", Ie = "#0000", Le = (e, t) => {
650
+ }, Pe = 2, Fe = .005, Ie = "#000", Le = "#0000", Re = (e, t) => {
651
651
  if (!t) return [];
652
652
  let n = /* @__PURE__ */ new Set();
653
653
  for (let { start: r, end: i } of e) for (let e of [r, i]) {
654
654
  let r = e / t;
655
- r <= Pe || r >= .995 || n.add(Number((r * 100).toFixed(4)));
655
+ r <= Fe || r >= .995 || n.add(Number((r * 100).toFixed(4)));
656
656
  }
657
657
  return n.size ? [
658
658
  0,
659
659
  ...[...n].sort((e, t) => e - t),
660
660
  100
661
661
  ] : [];
662
- }, Re = (e, t) => {
663
- let n = Ne / 2, r = e.length - 2, i = [];
662
+ }, ze = (e, t) => {
663
+ let n = Pe / 2, r = e.length - 2, i = [];
664
664
  for (let a = 0; a <= r; a += 1) {
665
665
  let o = e[a], s = e[a + 1], c = a === 0 ? "0%" : `calc(${o}% + ${n}px)`, l = a === r ? "100%" : `calc(${s}% - ${n}px)`;
666
- i.push(`${t(a) ? Fe : Ie} ${c} ${l}`), a !== r && i.push(`${Ie} calc(${s}% - ${n}px) calc(${s}% + ${n}px)`);
666
+ i.push(`${t(a) ? Ie : Le} ${c} ${l}`), a !== r && i.push(`${Le} calc(${s}% - ${n}px) calc(${s}% + ${n}px)`);
667
667
  }
668
668
  return `linear-gradient(90deg, ${i.join(", ")})`;
669
- }, ze = /* @__PURE__ */ new Set([
669
+ }, Be = /* @__PURE__ */ new Set([
670
670
  "op",
671
671
  "ops",
672
672
  "opening",
@@ -674,7 +674,7 @@ var B = {
674
674
  "ncop",
675
675
  "オープニング",
676
676
  "op主題歌"
677
- ]), Be = /* @__PURE__ */ new Set([
677
+ ]), Ve = /* @__PURE__ */ new Set([
678
678
  "ed",
679
679
  "eds",
680
680
  "ending",
@@ -687,13 +687,13 @@ var B = {
687
687
  "エンドカード",
688
688
  "エンドロール",
689
689
  "ed主題歌"
690
- ]), Ve = /* @__PURE__ */ new Set(["intro", "イントロ"]), He = /* @__PURE__ */ new Set(["outro", "アウトロ"]), Ue = {
690
+ ]), He = /* @__PURE__ */ new Set(["intro", "イントロ"]), Ue = /* @__PURE__ */ new Set(["outro", "アウトロ"]), We = {
691
691
  "credits start": "ending",
692
692
  "credits end": null,
693
693
  "preview end": null,
694
694
  "end credits": "ending",
695
695
  "closing credits": "ending"
696
- }, We = /* @__PURE__ */ new Set([
696
+ }, Ge = /* @__PURE__ */ new Set([
697
697
  "theme",
698
698
  "themes",
699
699
  "song",
@@ -712,53 +712,53 @@ var B = {
712
712
  "the",
713
713
  "主題歌",
714
714
  "ノンクレジット"
715
- ]), Ge = /* @__PURE__ */ new Set([
715
+ ]), Ke = /* @__PURE__ */ new Set([
716
716
  "post",
717
717
  "pre",
718
718
  "after",
719
719
  "before",
720
720
  "non"
721
- ]), Ke = /[-:|~/\\[\]()「」『』【】,.!?"'’]|\s+by\s+/u, qe = (e) => !e.trim() || /^chapter\s*\d+$/i.test(e.trim()) || /^\d{1,2}:\d{2}:\d{2}([.,]\d+)?$/.test(e.trim()), Je = (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) && !We.has(e)), Ye = (e, t) => {
722
- if (ze.has(e)) return "opening";
723
- if (Be.has(e)) return "ending";
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) => {
722
+ if (Be.has(e)) return "opening";
723
+ if (Ve.has(e)) return "ending";
724
724
  if (t) {
725
- if (Ve.has(e)) return "opening";
726
- if (He.has(e)) return "ending";
725
+ if (He.has(e)) return "opening";
726
+ if (Ue.has(e)) return "ending";
727
727
  }
728
- }, Xe = (e, t) => {
729
- if (qe(e)) return;
728
+ }, Ze = (e, t) => {
729
+ if (Je(e)) return;
730
730
  let n = e.trim().toLowerCase().replace(/\s+/gu, " ");
731
- if (n in Ue) return Ue[n] ?? void 0;
732
- let r = n.split(Ke).map((e) => e.trim()).filter(Boolean);
733
- if (r.some((e) => e.split(/[\s_]+/u).some((e) => Ge.has(e)))) return;
731
+ if (n in We) return We[n] ?? void 0;
732
+ let r = n.split(qe).map((e) => e.trim()).filter(Boolean);
733
+ if (r.some((e) => e.split(/[\s_]+/u).some((e) => Ke.has(e)))) return;
734
734
  let i = r.length > 1 ? [r[0], r.at(-1)] : r;
735
735
  for (let e of i) {
736
- let n = Je(e);
736
+ let n = Ye(e);
737
737
  if (n.length !== 1) continue;
738
- let r = Ye(n[0], t);
738
+ let r = Xe(n[0], t);
739
739
  if (r) return r;
740
740
  }
741
- }, Ze = 15, Qe = 87, $e = 93, et = (e) => {
741
+ }, Qe = 15, $e = 87, et = 93, tt = (e) => {
742
742
  let t = e.map(() => void 0), n = e.at(-1)?.end ?? 0;
743
743
  if (!n) return t;
744
744
  let r = e.map((e, t) => ({
745
745
  index: t,
746
746
  start: e.start,
747
747
  length: e.end - e.start
748
- })).filter(({ length: e }) => e >= Qe && e <= $e), i = n / 2, a = r.filter(({ start: e }) => e < i), o = r.filter(({ start: e }) => e >= i);
748
+ })).filter(({ length: e }) => e >= $e && e <= et), i = n / 2, a = r.filter(({ start: e }) => e < i), o = r.filter(({ start: e }) => e >= i);
749
749
  return a.length === 1 && (t[a[0].index] = "opening"), o.length === 1 && (t[o[0].index] = "ending"), t;
750
- }, tt = (e) => {
751
- let t = e.map(({ title: e }) => Xe(e, !1)), n = e.reduce((e, n, r) => e + (t[r] ? n.end - n.start : 0), 0), r = e.reduce((e, t) => e + (t.end - t.start), 0);
750
+ }, nt = (e) => {
751
+ let t = e.map(({ title: e }) => Ze(e, !1)), n = e.reduce((e, n, r) => e + (t[r] ? n.end - n.start : 0), 0), r = e.reduce((e, t) => e + (t.end - t.start), 0);
752
752
  if (r > 0 && n * 2 > r) return e.map(() => void 0);
753
753
  let i = e.map((e, n) => {
754
- if (e.end - e.start < Ze) return;
754
+ if (e.end - e.start < Qe) return;
755
755
  let r = t[n];
756
756
  if (r) return r;
757
- let i = Xe(e.title, !0);
757
+ let i = Ze(e.title, !0);
758
758
  return i && !t.includes(i) ? i : void 0;
759
759
  });
760
- return e.every(({ title: e }) => qe(e)) ? et(e) : i;
761
- }, nt = g`
760
+ return e.every(({ title: e }) => Je(e)) ? tt(e) : i;
761
+ }, rt = g`
762
762
  position: relative;
763
763
  height: calc(.4 * var(--mp-unit));
764
764
 
@@ -843,7 +843,7 @@ var B = {
843
843
  box-shadow: 0 0 calc(1 * var(--mp-unit)) rgba(0, 0, 0, .5);
844
844
 
845
845
  text-shadow: 0 0 4px rgba(0, 0, 0, 1);
846
- ${Y.bMedium.bold}
846
+ ${X.bMedium.bold}
847
847
 
848
848
  gap: calc(.6 * var(--mp-unit));
849
849
 
@@ -977,8 +977,8 @@ var B = {
977
977
  --thumbnail-width: calc(18 * var(--mp-unit));
978
978
  --thumbnail-half: calc(9 * var(--mp-unit));
979
979
  }
980
- `, rt = 4, it = () => {
981
- let e = U(), t = U((e) => e.currentTime), n = U((e) => e.requestSeek), r = U((e) => e.duration), i = U((e) => e.size), a = U((e) => e.downloadedRanges), o = U((e) => e.buffered), s = U((e) => e.indexes), c = U((e) => e.thumbnails), l = U((e) => e.thumbnailAt), u = U((e) => e.requestThumbnail), h = U((e) => e.chapters), g = U((e) => e.seekingTo), _ = U((e) => e.setSourceState), v = U((e) => e.hideUI), y = p(null), [b, x] = m(void 0), [S, C] = m(void 0), E = (e) => {
980
+ `, it = 4, at = () => {
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
982
  C(e), u(e);
983
983
  }, D = !!S;
984
984
  d(() => {
@@ -986,13 +986,13 @@ var B = {
986
986
  }, [_, D]), d(() => {
987
987
  v && E(void 0);
988
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 } = Me({
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
990
  ref: y,
991
991
  onChange: (e) => {
992
992
  if (k.current += 1, A.current = e, j.current === void 0) j.current = e;
993
993
  else if (!M.current) {
994
994
  let t = y.current?.getBoundingClientRect().width ?? 0;
995
- Math.abs(e - j.current) * t > rt && (M.current = !0);
995
+ Math.abs(e - j.current) * t > it && (M.current = !0);
996
996
  }
997
997
  x(e), O.current !== "mouse" && E(e * r);
998
998
  }
@@ -1012,9 +1012,9 @@ var B = {
1012
1012
  return Math.min(Math.max((e - t) / (n - t), 0), 1) * r;
1013
1013
  }, R = p("mouse"), z = (e) => {
1014
1014
  R.current = e.pointerType;
1015
- }, ee = (e) => {
1015
+ }, B = (e) => {
1016
1016
  R.current !== "touch" && E(L(e.clientX));
1017
- }, B = () => {
1017
+ }, ee = () => {
1018
1018
  y.current && E(void 0);
1019
1019
  }, V = (e) => r ? e / r * 100 : 0, H = (e, t, n) => {
1020
1020
  let r = Number((n - t).toFixed(4)), i = t * 100;
@@ -1044,7 +1044,7 @@ var B = {
1044
1044
  b,
1045
1045
  r
1046
1046
  ]);
1047
- let ne = f(() => {
1047
+ let U = f(() => {
1048
1048
  if (!r) return 0;
1049
1049
  if (N && b !== void 0) return b;
1050
1050
  let e = g ?? t;
@@ -1055,22 +1055,22 @@ var B = {
1055
1055
  N,
1056
1056
  b,
1057
1057
  g
1058
- ]), W = f(() => Le(h, r), [h, r]), G = W.length > 0, K = f(() => {
1059
- if (!G || S === void 0 || !r) return -1;
1060
- let e = S / r * 100, t = W.findIndex((t, n) => n < W.length - 1 && e >= t && e < W[n + 1]);
1061
- return t >= 0 ? t : W.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;
1062
1062
  }, [
1063
+ K,
1063
1064
  G,
1064
- W,
1065
1065
  S,
1066
1066
  r
1067
- ]), re = f(() => G ? Re(W, (e) => e !== K) : void 0, [
1067
+ ]), ne = f(() => K ? ze(G, (e) => e !== q) : void 0, [
1068
+ K,
1068
1069
  G,
1069
- W,
1070
- K
1071
- ]), ie = f(() => K >= 0 ? Re(W, (e) => e === K) : void 0, [W, K]), q = f(() => {
1070
+ q
1071
+ ]), J = f(() => q >= 0 ? ze(G, (e) => e === q) : void 0, [G, q]), Y = f(() => {
1072
1072
  if (S !== void 0) return h.find(({ start: e, end: t }) => e <= S && S < t);
1073
- }, [h, S]), J = f(() => {
1073
+ }, [h, S]), re = f(() => {
1074
1074
  if (S) {
1075
1075
  if (l) return l(S);
1076
1076
  if (c.length) return c.find(({ startTime: e, endTime: t }) => e <= S && S < t);
@@ -1079,7 +1079,7 @@ var B = {
1079
1079
  c,
1080
1080
  l,
1081
1081
  S
1082
- ]), ae = (e, t) => /* @__PURE__ */ T("div", {
1082
+ ]), ie = (e, t) => /* @__PURE__ */ T("div", {
1083
1083
  className: e ? `track ${e}` : "track",
1084
1084
  style: t ? { maskImage: t } : void 0,
1085
1085
  children: [
@@ -1092,42 +1092,42 @@ var B = {
1092
1092
  className: "play-container",
1093
1093
  children: /* @__PURE__ */ w("div", {
1094
1094
  className: "play",
1095
- style: { transform: `scaleX(${ne})` }
1095
+ style: { transform: `scaleX(${U})` }
1096
1096
  })
1097
1097
  })
1098
1098
  ]
1099
1099
  });
1100
1100
  return /* @__PURE__ */ T("div", {
1101
- css: nt,
1101
+ css: rt,
1102
1102
  ref: y,
1103
1103
  className: [
1104
1104
  "progress-bar",
1105
1105
  N ? "dragging" : "",
1106
- G ? "segmented" : ""
1106
+ K ? "segmented" : ""
1107
1107
  ].filter(Boolean).join(" "),
1108
1108
  onPointerDown: z,
1109
1109
  onPointerMove: z,
1110
- onMouseMove: ee,
1111
- onMouseOut: B,
1110
+ onMouseMove: B,
1111
+ onMouseOut: ee,
1112
1112
  children: [
1113
- ae(void 0, re),
1113
+ ie(void 0, ne),
1114
1114
  S ? /* @__PURE__ */ T("div", {
1115
1115
  className: "cursor-time",
1116
1116
  style: {
1117
- left: q ? `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: q ? "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
1119
1119
  },
1120
1120
  children: [/* @__PURE__ */ w("span", {
1121
1121
  className: "cursor-time-value",
1122
- children: X(S)
1123
- }), q ? /* @__PURE__ */ w("span", {
1122
+ children: Z(S)
1123
+ }), Y ? /* @__PURE__ */ w("span", {
1124
1124
  className: "chapter-title",
1125
- children: q.title
1125
+ children: Y.title
1126
1126
  }) : void 0]
1127
1127
  }) : void 0,
1128
1128
  /* @__PURE__ */ w("div", { className: "progress" }),
1129
1129
  /* @__PURE__ */ w("div", { className: "hover" }),
1130
- ie ? ae("focus", ie) : void 0,
1130
+ J ? ie("focus", J) : void 0,
1131
1131
  /* @__PURE__ */ w("div", { className: "scrubber" }),
1132
1132
  /* @__PURE__ */ w("div", {
1133
1133
  className: "padding",
@@ -1139,11 +1139,11 @@ var B = {
1139
1139
  /* @__PURE__ */ w("div", {
1140
1140
  className: "thumbnail",
1141
1141
  style: { left: `clamp(var(--thumbnail-half), ${V(S ?? 1)}%, calc(100% - var(--thumbnail-half)))` },
1142
- children: J?.url ? /* @__PURE__ */ w("img", { src: J.url }) : void 0
1142
+ children: re?.url ? /* @__PURE__ */ w("img", { src: re.url }) : void 0
1143
1143
  })
1144
1144
  ]
1145
1145
  });
1146
- }, at = "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", $ = {
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 = {
1147
1147
  xmlns: "http://www.w3.org/2000/svg",
1148
1148
  width: 24,
1149
1149
  height: 24,
@@ -1153,39 +1153,8 @@ var B = {
1153
1153
  strokeWidth: 2,
1154
1154
  strokeLinecap: "round",
1155
1155
  strokeLinejoin: "round"
1156
- }, ot = (e) => /* @__PURE__ */ T("svg", {
1157
- ...$,
1158
- ...e,
1159
- children: [/* @__PURE__ */ w("rect", {
1160
- x: "3",
1161
- y: "5",
1162
- width: "18",
1163
- height: "14",
1164
- rx: "2",
1165
- ry: "2"
1166
- }), /* @__PURE__ */ w("path", { d: "M7 15h4m4 0h2M7 11h2m4 0h4" })]
1167
- }), st = (e) => /* @__PURE__ */ T("svg", {
1168
- ...$,
1169
- ...e,
1170
- children: [
1171
- /* @__PURE__ */ w("rect", {
1172
- x: "3",
1173
- y: "5",
1174
- width: "18",
1175
- height: "14",
1176
- rx: "2",
1177
- ry: "2"
1178
- }),
1179
- /* @__PURE__ */ w("path", { d: "M7 15h4m4 0h2M7 11h2m4 0h4" }),
1180
- /* @__PURE__ */ w("line", {
1181
- x1: "2",
1182
- y1: "2",
1183
- x2: "22",
1184
- y2: "22"
1185
- })
1186
- ]
1187
- }), ct = (e) => /* @__PURE__ */ T("svg", {
1188
- ...$,
1156
+ }, ct = (e) => /* @__PURE__ */ T("svg", {
1157
+ ...st,
1189
1158
  ...e,
1190
1159
  children: [
1191
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" }),
@@ -1200,7 +1169,7 @@ var B = {
1200
1169
  /* @__PURE__ */ w("path", { d: "M14.5 18.5h2m2 0h1" })
1201
1170
  ]
1202
1171
  }), lt = (e) => /* @__PURE__ */ T("svg", {
1203
- ...$,
1172
+ ...st,
1204
1173
  ...e,
1205
1174
  children: [
1206
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" }),
@@ -1253,7 +1222,7 @@ var B = {
1253
1222
 
1254
1223
  border-radius: 8px;
1255
1224
  background-color: rgba(28,28,28,0.95);
1256
- ${Y.bMedium.regular}
1225
+ ${X.bMedium.regular}
1257
1226
 
1258
1227
  z-index: 4;
1259
1228
 
@@ -1296,7 +1265,7 @@ var B = {
1296
1265
 
1297
1266
  .secondary {
1298
1267
  color: #eee;
1299
- ${Y.bSmall.regular}
1268
+ ${X.bSmall.regular}
1300
1269
  }
1301
1270
  }
1302
1271
  }
@@ -1338,7 +1307,7 @@ var B = {
1338
1307
  .failed {
1339
1308
  border-bottom: 1px solid #4D4D4E;
1340
1309
  color: #f66;
1341
- ${Y.bSmall.regular}
1310
+ ${X.bSmall.regular}
1342
1311
  }
1343
1312
  }
1344
1313
  `, dt = ({ title: e, tracks: t, selected: n, onSelect: r, onBack: i, offLabel: a, pending: o, failed: s }) => {
@@ -1358,7 +1327,7 @@ var B = {
1358
1327
  /* @__PURE__ */ T("div", {
1359
1328
  className: i ? "back" : "back no-hover",
1360
1329
  onClick: i,
1361
- children: [i ? /* @__PURE__ */ w(O, {}) : null, /* @__PURE__ */ w("span", { children: e })]
1330
+ children: [i ? /* @__PURE__ */ w(k, {}) : null, /* @__PURE__ */ w("span", { children: e })]
1362
1331
  }),
1363
1332
  s ? /* @__PURE__ */ w("div", {
1364
1333
  className: "no-hover failed",
@@ -1453,7 +1422,7 @@ ${ut}
1453
1422
 
1454
1423
  color: #fff;
1455
1424
  cursor: pointer;
1456
- ${Y.bSmall.regular}
1425
+ ${X.bSmall.regular}
1457
1426
 
1458
1427
  &:hover {
1459
1428
  background-color: rgba(255,255,255,.1);
@@ -1474,7 +1443,7 @@ ${ut}
1474
1443
 
1475
1444
  .when {
1476
1445
  color: #bbb;
1477
- ${Y.bSmall.regular}
1446
+ ${X.bSmall.regular}
1478
1447
 
1479
1448
  /* the one part of the line worth scanning for, so it is the one part at full brightness */
1480
1449
  .count {
@@ -1493,11 +1462,11 @@ ${ut}
1493
1462
  color: #ddd;
1494
1463
  overflow-wrap: anywhere;
1495
1464
  white-space: pre-wrap;
1496
- ${Y.bSmall.regular}
1465
+ ${X.bSmall.regular}
1497
1466
  }
1498
1467
  }
1499
1468
  }
1500
- `, mt = (e) => new Date(e).toLocaleTimeString(), ht = (e) => e === void 0 || !Number.isFinite(e) ? void 0 : X(Math.max(0, e)), gt = (e) => e.reduce((e, t) => e + t.count, 0), _t = (e) => e.map((e, t) => {
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) => {
1501
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();
1502
1471
  return [
1503
1472
  `${t + 1}. ${r}${n ? ` (at ${n})` : ""}${e.recovered ? " [recovered]" : ""}`,
@@ -1505,7 +1474,7 @@ ${ut}
1505
1474
  e.detail
1506
1475
  ].filter(Boolean).join("\n");
1507
1476
  }).join("\n\n"), vt = () => {
1508
- let e = U((e) => e.playbackErrors), { open: t, toggle: n, containerRef: r } = ft(), [i, a] = m(!1);
1477
+ let e = W((e) => e.playbackErrors), { open: t, toggle: n, containerRef: r } = ft(), [i, a] = m(!1);
1509
1478
  if (e.length === 0) return null;
1510
1479
  let o = () => {
1511
1480
  navigator.clipboard?.writeText(_t(e)).then(() => {
@@ -1515,7 +1484,7 @@ ${ut}
1515
1484
  return /* @__PURE__ */ T("div", {
1516
1485
  css: pt,
1517
1486
  ref: r,
1518
- children: [/* @__PURE__ */ w(Q, {
1487
+ children: [/* @__PURE__ */ w($, {
1519
1488
  id: "errors",
1520
1489
  disabled: t,
1521
1490
  text: /* @__PURE__ */ w("button", {
@@ -1524,7 +1493,7 @@ ${ut}
1524
1493
  onClick: n,
1525
1494
  "aria-label": s,
1526
1495
  "aria-expanded": t,
1527
- children: /* @__PURE__ */ w(E, { className: "alert-triangle" })
1496
+ children: /* @__PURE__ */ w(R, { className: "alert-triangle" })
1528
1497
  }),
1529
1498
  toolTipText: /* @__PURE__ */ w("span", { children: s })
1530
1499
  }), t && /* @__PURE__ */ T("div", {
@@ -1536,7 +1505,7 @@ ${ut}
1536
1505
  type: "button",
1537
1506
  onClick: o,
1538
1507
  "aria-label": "Copy the errors",
1539
- 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" })]
1540
1509
  })]
1541
1510
  }), e.map((e, t) => /* @__PURE__ */ T("div", {
1542
1511
  className: "entry no-hover",
@@ -1620,7 +1589,7 @@ width: 100%;
1620
1589
  }
1621
1590
  }
1622
1591
  `, bt = () => {
1623
- let e = U(), t = U((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 } = Me({
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({
1624
1593
  ref: r,
1625
1594
  onChange: (t) => e.setPlaybackRate(l(t))
1626
1595
  }), f = (t) => {
@@ -1714,7 +1683,7 @@ ${ut}
1714
1683
  }
1715
1684
 
1716
1685
  `, St = () => {
1717
- let e = U(), t = U((e) => e.playbackRate), n = U((e) => e.audioTracks), r = U((e) => e.selectedAudioTrack), i = U((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) => {
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) => {
1718
1687
  e.setPlaybackRate(t), o(0);
1719
1688
  }, h = (e) => {
1720
1689
  e !== void 0 && f(e, () => i(e));
@@ -1725,7 +1694,7 @@ ${ut}
1725
1694
  css: xt,
1726
1695
  ref: l,
1727
1696
  children: [
1728
- /* @__PURE__ */ w(Q, {
1697
+ /* @__PURE__ */ w($, {
1729
1698
  id: "settings",
1730
1699
  disabled: s,
1731
1700
  text: /* @__PURE__ */ w("button", {
@@ -1734,7 +1703,7 @@ ${ut}
1734
1703
  onClick: c,
1735
1704
  "aria-label": "Settings",
1736
1705
  "aria-expanded": s,
1737
- children: /* @__PURE__ */ w(I, {})
1706
+ children: /* @__PURE__ */ w(L, {})
1738
1707
  }),
1739
1708
  toolTipText: /* @__PURE__ */ w("span", { children: "Settings" })
1740
1709
  }),
@@ -1742,13 +1711,13 @@ ${ut}
1742
1711
  className: "popover menu",
1743
1712
  children: [n.length > 1 ? /* @__PURE__ */ T("div", {
1744
1713
  onClick: g(2),
1745
- 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, {}) })]
1746
1715
  }) : null, /* @__PURE__ */ T("div", {
1747
1716
  onClick: g(1),
1748
1717
  children: [/* @__PURE__ */ w("div", { children: "Playback speed" }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("span", {
1749
1718
  className: "secondary",
1750
1719
  children: t === 1 ? "(Default)" : t.toFixed(2)
1751
- }), /* @__PURE__ */ w(k, {})] })]
1720
+ }), /* @__PURE__ */ w(A, {})] })]
1752
1721
  })]
1753
1722
  }),
1754
1723
  s && a === 1 && /* @__PURE__ */ T("div", {
@@ -1757,7 +1726,7 @@ ${ut}
1757
1726
  /* @__PURE__ */ T("div", {
1758
1727
  className: "back",
1759
1728
  onClick: g(0),
1760
- children: [/* @__PURE__ */ w(O, {}), /* @__PURE__ */ w("span", { children: "Playback speed" })]
1729
+ children: [/* @__PURE__ */ w(k, {}), /* @__PURE__ */ w("span", { children: "Playback speed" })]
1761
1730
  }),
1762
1731
  /* @__PURE__ */ w("div", {
1763
1732
  className: "slider no-hover",
@@ -1815,13 +1784,13 @@ position: static;
1815
1784
 
1816
1785
  ${ut}
1817
1786
  `, wt = () => {
1818
- let e = U((e) => e.subtitleTracks), t = U((e) => e.selectedSubtitleTrack), n = U((e) => e.selectSubtitleTrack), r = U((e) => e.subtitleOffLabel), { open: i, toggle: a, containerRef: o, pending: s, failed: c, runSelect: l } = ft();
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();
1819
1788
  if (e.length === 0) return null;
1820
1789
  let u = t !== void 0;
1821
1790
  return /* @__PURE__ */ T("div", {
1822
1791
  css: Ct,
1823
1792
  ref: o,
1824
- children: [/* @__PURE__ */ w(Q, {
1793
+ children: [/* @__PURE__ */ w($, {
1825
1794
  id: "subtitles",
1826
1795
  disabled: i,
1827
1796
  text: /* @__PURE__ */ w("button", {
@@ -1831,7 +1800,7 @@ ${ut}
1831
1800
  "aria-label": "Subtitles",
1832
1801
  "aria-expanded": i,
1833
1802
  "aria-pressed": u,
1834
- children: u ? /* @__PURE__ */ w(ot, { className: "captions" }) : /* @__PURE__ */ w(st, { className: "captions-off" })
1803
+ children: u ? /* @__PURE__ */ w(E, { className: "captions" }) : /* @__PURE__ */ w(D, { className: "captions-off" })
1835
1804
  }),
1836
1805
  toolTipText: /* @__PURE__ */ w("span", { children: "Subtitles" })
1837
1806
  }), i && /* @__PURE__ */ w(dt, {
@@ -1894,7 +1863,7 @@ ${ut}
1894
1863
  height: 10px;
1895
1864
  }
1896
1865
  `, Dt = ({ value: e, onChange: t }) => {
1897
- let n = U((e) => e.volume), r = U((e) => e.muted), i = p(null), a = p(null), { handlers: o } = Me({
1866
+ let n = W((e) => e.volume), r = W((e) => e.muted), i = p(null), a = p(null), { handlers: o } = Ne({
1898
1867
  ref: a,
1899
1868
  onChange: t
1900
1869
  }), s = (n) => {
@@ -1908,8 +1877,8 @@ ${ut}
1908
1877
  e && e.removeEventListener("wheel", s);
1909
1878
  };
1910
1879
  }, [e]);
1911
- let c = e * 100, l = f(() => Math.round(r ? 0 : De(n) * 100), [n, r]);
1912
- return /* @__PURE__ */ w(Q, {
1880
+ let c = e * 100, l = f(() => Math.round(r ? 0 : Oe(n) * 100), [n, r]);
1881
+ return /* @__PURE__ */ w($, {
1913
1882
  id: "volume-slider",
1914
1883
  text: /* @__PURE__ */ w("div", {
1915
1884
  ref: i,
@@ -1957,7 +1926,7 @@ ${ut}
1957
1926
  border-radius: 4px;
1958
1927
 
1959
1928
  .volume-value {
1960
- ${Y.bMedium.regular};
1929
+ ${X.bMedium.regular};
1961
1930
  color: #ffffff;
1962
1931
  }
1963
1932
  }
@@ -1996,10 +1965,10 @@ ${ut}
1996
1965
  }
1997
1966
 
1998
1967
  `, kt = ({ ref: e }) => {
1999
- let t = U(), n = U((e) => e.volume), r = U((e) => e.muted), i = f(() => De(n), [n]);
1968
+ let t = W(), n = W((e) => e.volume), r = W((e) => e.muted), i = f(() => Oe(n), [n]);
2000
1969
  return /* @__PURE__ */ T("div", {
2001
1970
  css: Ot,
2002
- children: [/* @__PURE__ */ w(Q, {
1971
+ children: [/* @__PURE__ */ w($, {
2003
1972
  id: "sound",
2004
1973
  text: /* @__PURE__ */ w("button", {
2005
1974
  className: "sound",
@@ -2008,7 +1977,7 @@ ${ut}
2008
1977
  ref: e,
2009
1978
  "aria-label": "Mute",
2010
1979
  "aria-pressed": r || n === 0,
2011
- children: w(r || n === 0 ? z : n <= .5 ? L : R, {
1980
+ children: w(r || n === 0 ? ee : n <= .5 ? z : B, {
2012
1981
  size: 18,
2013
1982
  color: "#fff"
2014
1983
  })
@@ -2021,7 +1990,7 @@ ${ut}
2021
1990
  children: /* @__PURE__ */ w(Dt, {
2022
1991
  value: r ? 0 : i,
2023
1992
  onChange: (e) => {
2024
- t.setVolume(Ee(e));
1993
+ t.setVolume(De(e));
2025
1994
  }
2026
1995
  })
2027
1996
  })
@@ -2145,7 +2114,7 @@ ${ut}
2145
2114
 
2146
2115
  .left {
2147
2116
  .time {
2148
- ${Y.bMedium.regular}
2117
+ ${X.bMedium.regular}
2149
2118
  text-shadow: 0 0 4px rgba(0, 0, 0, 1);
2150
2119
  }
2151
2120
  }
@@ -2167,9 +2136,9 @@ ${ut}
2167
2136
  }
2168
2137
  }
2169
2138
  `, It = () => {
2170
- let e = U(), t = U((e) => e.paused), n = U((e) => e.currentTime), r = U((e) => e.duration), i = U((e) => e.seekingTo), a = U((e) => e.fullscreen), o = U((e) => e.hideUI), s = U((e) => e.togglePictureInPicture), c = U((e) => e.pictureInPictureMode), l = U((e) => e.burnedInSubtitles), f = U((e) => e.passThroughPictureInPicture), h = U((e) => e.subtitleTracks), g = U((e) => e.requestSeek), [_, v] = m(null), y = p(null), b = p(void 0), x = c === "burn-in", S = h.length > 0, C = r > 0 && n === r, E = u(({ direction: t, stepSize: n }) => {
2171
- let r = De(e.volume), i = t === "up" ? n : -n, a = Math.max(0, Math.min(1, r + i)), o = e.muted;
2172
- e.setVolume(Ee(a)), o && !e.muted && e.toggleMuted();
2139
+ let e = W(), t = W((e) => e.paused), n = W((e) => e.currentTime), r = W((e) => e.duration), i = W((e) => e.seekingTo), a = W((e) => e.fullscreen), o = W((e) => e.hideUI), s = W((e) => e.togglePictureInPicture), c = W((e) => e.pictureInPictureMode), l = W((e) => e.burnedInSubtitles), f = W((e) => e.passThroughPictureInPicture), h = W((e) => e.subtitleTracks), g = W((e) => e.requestSeek), [_, v] = m(null), y = p(null), b = p(void 0), x = c === "burn-in", S = h.length > 0, C = r > 0 && n === r, E = u(({ direction: t, stepSize: n }) => {
2140
+ let r = Oe(e.volume), i = t === "up" ? n : -n, a = Math.max(0, Math.min(1, r + i)), o = e.muted;
2141
+ e.setVolume(De(a)), o && !e.muted && e.toggleMuted();
2173
2142
  }, [e]);
2174
2143
  d(() => {
2175
2144
  let t = (t) => g ? g(t) : e.seek(t), n = (n) => {
@@ -2242,12 +2211,12 @@ ${ut}
2242
2211
  opacity: "0",
2243
2212
  pointerEvents: "none"
2244
2213
  } : k ? { pointerEvents: "none" } : {} },
2245
- children: [/* @__PURE__ */ w(it, {}), /* @__PURE__ */ T("div", {
2214
+ children: [/* @__PURE__ */ w(at, {}), /* @__PURE__ */ T("div", {
2246
2215
  className: "actions",
2247
2216
  children: [/* @__PURE__ */ T("div", {
2248
2217
  className: "left",
2249
2218
  children: [
2250
- /* @__PURE__ */ w(Q, {
2219
+ /* @__PURE__ */ w($, {
2251
2220
  id: "play",
2252
2221
  tooltipPlace: "top-start",
2253
2222
  text: /* @__PURE__ */ w("button", {
@@ -2255,14 +2224,14 @@ ${ut}
2255
2224
  type: "button",
2256
2225
  onClick: () => e.togglePaused(),
2257
2226
  "aria-label": C ? "Replay" : t ? "Play" : "Pause",
2258
- children: w(C ? F : t ? P : N, {})
2227
+ children: w(C ? I : t ? F : P, {})
2259
2228
  }),
2260
2229
  toolTipText: /* @__PURE__ */ w("span", { children: C ? "Replay (k)" : t ? "Play (k)" : "Pause (k)" })
2261
2230
  }),
2262
2231
  /* @__PURE__ */ w(kt, { ref: v }),
2263
2232
  /* @__PURE__ */ w("div", {
2264
2233
  className: "time",
2265
- children: Oe(i ?? n, r)
2234
+ children: ke(i ?? n, r)
2266
2235
  })
2267
2236
  ]
2268
2237
  }), /* @__PURE__ */ T("div", {
@@ -2271,7 +2240,7 @@ ${ut}
2271
2240
  /* @__PURE__ */ w(vt, {}),
2272
2241
  /* @__PURE__ */ w(wt, {}),
2273
2242
  /* @__PURE__ */ w(St, {}),
2274
- f ? /* @__PURE__ */ w(Q, {
2243
+ f ? /* @__PURE__ */ w($, {
2275
2244
  id: "picture-in-picture",
2276
2245
  tooltipPlace: "top-end",
2277
2246
  text: /* @__PURE__ */ w("button", {
@@ -2284,12 +2253,12 @@ ${ut}
2284
2253
  "aria-label": "Picture in picture",
2285
2254
  "aria-pressed": f.active,
2286
2255
  children: /* @__PURE__ */ w("img", {
2287
- src: at,
2256
+ src: ot,
2288
2257
  alt: ""
2289
2258
  })
2290
2259
  }),
2291
2260
  toolTipText: /* @__PURE__ */ w("span", { children: f.active ? "Exit picture in picture" : "Picture in picture" })
2292
- }) : s ? /* @__PURE__ */ w(Q, {
2261
+ }) : s ? /* @__PURE__ */ w($, {
2293
2262
  id: "picture-in-picture",
2294
2263
  tooltipPlace: "top-end",
2295
2264
  text: /* @__PURE__ */ w("button", {
@@ -2300,7 +2269,7 @@ ${ut}
2300
2269
  "aria-label": x ? "Put the subtitles in the video" : "Picture in picture",
2301
2270
  "aria-pressed": x ? l : void 0,
2302
2271
  children: x ? w(l ? ct : lt, {}) : /* @__PURE__ */ w("img", {
2303
- src: at,
2272
+ src: ot,
2304
2273
  alt: ""
2305
2274
  })
2306
2275
  }),
@@ -2315,7 +2284,7 @@ ${ut}
2315
2284
  }) : null]
2316
2285
  })
2317
2286
  }) : null,
2318
- /* @__PURE__ */ w(Q, {
2287
+ /* @__PURE__ */ w($, {
2319
2288
  id: "full-screen",
2320
2289
  tooltipPlace: "top-end",
2321
2290
  text: /* @__PURE__ */ w("button", {
@@ -2324,7 +2293,7 @@ ${ut}
2324
2293
  onClick: () => e.toggleFullscreen(),
2325
2294
  "aria-label": "Full screen",
2326
2295
  "aria-pressed": a,
2327
- children: w(a ? M : j, {})
2296
+ children: w(a ? N : M, {})
2328
2297
  }),
2329
2298
  toolTipText: /* @__PURE__ */ w("span", { children: a ? "Exit full screen (f)" : "Full screen (f)" })
2330
2299
  })
@@ -2370,12 +2339,12 @@ ${ut}
2370
2339
  }
2371
2340
 
2372
2341
  .title {
2373
- ${Y.bMedium.bold}
2342
+ ${X.bMedium.bold}
2374
2343
  color: #fff;
2375
2344
  }
2376
2345
 
2377
2346
  .body {
2378
- ${Y.bSmall.regular}
2347
+ ${X.bSmall.regular}
2379
2348
  color: rgba(255, 255, 255, 0.75);
2380
2349
  }
2381
2350
 
@@ -2387,7 +2356,7 @@ ${ut}
2387
2356
  color: #fff;
2388
2357
  }
2389
2358
  `, zt = () => {
2390
- let e = U((e) => e.burnedInSubtitles), t = U((e) => e.pictureInPictureMode), [n, r] = m(!1);
2359
+ let e = W((e) => e.burnedInSubtitles), t = W((e) => e.pictureInPictureMode), [n, r] = m(!1);
2391
2360
  return d(() => {
2392
2361
  if (t !== "burn-in" || !e) {
2393
2362
  r(!1);
@@ -2438,7 +2407,7 @@ ${ut}
2438
2407
  pointer-events: auto;
2439
2408
  cursor: pointer;
2440
2409
 
2441
- ${Y.bMedium.bold}
2410
+ ${X.bMedium.bold}
2442
2411
  color: #fff;
2443
2412
  padding: calc(1 * var(--mp-unit)) calc(1.8 * var(--mp-unit));
2444
2413
  border: 1px solid rgba(255, 255, 255, .55);
@@ -2473,7 +2442,7 @@ ${ut}
2473
2442
  }
2474
2443
  }
2475
2444
  `, Gt = () => {
2476
- let e = U((e) => e.chapters), t = U((e) => e.currentTime), n = U((e) => e.requestSeek), r = U((e) => e.seekPreview), i = U(), a = f(() => tt(e), [e]), o = 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(() => {
2477
2446
  if (typeof t != "number") return;
2478
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;
2479
2448
  return r ? {
@@ -2587,7 +2556,7 @@ ${ut}
2587
2556
  item: e
2588
2557
  }];
2589
2558
  }), Zt = ({ ref: e, onVideoRef: t, onSubtitleRef: n, overlay: r, controls: i, children: a }) => {
2590
- let o = U(), s = U((e) => e.hideUI), c = U((e) => e.setHideUI), l = U((e) => e.hasMedia), u = U((e) => e.passThroughPictureInPicture), f = p(void 0), m = p("mouse"), h = p({
2559
+ let o = W(), s = W((e) => e.hideUI), c = W((e) => e.setHideUI), l = W((e) => e.hasMedia), u = W((e) => e.passThroughPictureInPicture), f = p(void 0), m = p("mouse"), h = p({
2591
2560
  x: -1,
2592
2561
  y: -1
2593
2562
  }), g = p(null);
@@ -2634,7 +2603,7 @@ ${ut}
2634
2603
  },
2635
2604
  className: s ? "hide" : "",
2636
2605
  children: [
2637
- /* @__PURE__ */ w(Ce, { onSubtitleRef: n }),
2606
+ /* @__PURE__ */ w(we, { onSubtitleRef: n }),
2638
2607
  Xt(r).map(({ key: e, item: t }) => /* @__PURE__ */ w("div", {
2639
2608
  css: qt,
2640
2609
  style: { ...s ? {
@@ -2688,33 +2657,33 @@ ${ut}
2688
2657
  k,
2689
2658
  A,
2690
2659
  j
2691
- ]), oe(v, S, r);
2692
- let { thumbnails: M, requestThumbnail: N } = le({
2660
+ ]), se(v, S, r);
2661
+ let { thumbnails: M, requestThumbnail: N } = ue({
2693
2662
  publicPath: c,
2694
2663
  workerUrl: l,
2695
2664
  length: h === !1 ? void 0 : o,
2696
2665
  read: f ?? u,
2697
2666
  downloadedRanges: s
2698
- }), P = n?.thumbnails?.all ?? M, { toggle: F, mode: I, burnedIn: L } = ue(v, S), R = ge(n?.media ?? null, n?.pictureInPicture), z = U((e) => e.setSourceState), ee = n ? !!n.media : o !== void 0;
2667
+ }), P = n?.thumbnails?.all ?? M, { toggle: F, mode: I, burnedIn: L } = de(v, S), R = _e(n?.media ?? null, n?.pictureInPicture), z = W((e) => e.setSourceState), B = n ? !!n.media : o !== void 0;
2699
2668
  d(() => {
2700
2669
  z({
2701
2670
  title: i,
2702
2671
  size: o,
2703
2672
  downloadedRanges: s,
2704
- hasMedia: ee
2673
+ hasMedia: B
2705
2674
  });
2706
2675
  }, [
2707
2676
  z,
2708
2677
  i,
2709
2678
  o,
2710
2679
  s,
2711
- ee
2680
+ B
2712
2681
  ]);
2713
- let B = n?.thumbnails?.at;
2682
+ let ee = n?.thumbnails?.at;
2714
2683
  d(() => {
2715
2684
  z({
2716
2685
  thumbnails: P,
2717
- thumbnailAt: B,
2686
+ thumbnailAt: ee,
2718
2687
  requestThumbnail: N,
2719
2688
  togglePictureInPicture: F,
2720
2689
  pictureInPictureMode: I,
@@ -2723,7 +2692,7 @@ ${ut}
2723
2692
  }, [
2724
2693
  z,
2725
2694
  P,
2726
- B,
2695
+ ee,
2727
2696
  N,
2728
2697
  F,
2729
2698
  I,
@@ -2835,7 +2804,7 @@ ${ut}
2835
2804
  overflow: hidden;
2836
2805
  `, en = (e) => /* @__PURE__ */ w("div", {
2837
2806
  css: $t,
2838
- children: /* @__PURE__ */ w(H.Provider, { children: /* @__PURE__ */ w(Qt, {
2807
+ children: /* @__PURE__ */ w(U.Provider, { children: /* @__PURE__ */ w(Qt, {
2839
2808
  options: e,
2840
2809
  children: e.children
2841
2810
  }) })
@@ -2880,4 +2849,4 @@ ${ut}
2880
2849
  throw Error(`Unknown source type: ${e}`);
2881
2850
  };
2882
2851
  //#endregion
2883
- export { en as MediaPlayer, en as default, H as Player, e as SUBTITLES_OFF, a as createPictureInPicture, o as createSubtitleRenderer, r as createThumbnailGenerator, sn as inputToRemuxerInput, nn as isDelegatedTracks, tn as isExternalThumbnails, V as sourceFeature, i as startPlayback, ue as usePictureInPicture, U as usePlayer, le 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 };