@glitchlab/vue-video-player 1.5.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +112 -15
  2. package/dist/HLSPlayer.vue.d.ts +4 -0
  3. package/dist/HLSPlayer.vue.d.ts.map +1 -1
  4. package/dist/VideoPlayer.vue.d.ts +9 -0
  5. package/dist/VideoPlayer.vue.d.ts.map +1 -1
  6. package/dist/components/ControlBar.vue.d.ts +24 -0
  7. package/dist/components/ControlBar.vue.d.ts.map +1 -1
  8. package/dist/components/{IconQuality.vue.d.ts → IconAlert.vue.d.ts} +1 -1
  9. package/dist/components/IconAlert.vue.d.ts.map +1 -0
  10. package/dist/components/IconCheck.vue.d.ts +16 -0
  11. package/dist/components/IconCheck.vue.d.ts.map +1 -0
  12. package/dist/components/IconChevronRight.vue.d.ts +16 -0
  13. package/dist/components/IconChevronRight.vue.d.ts.map +1 -0
  14. package/dist/components/IconGear.vue.d.ts +16 -0
  15. package/dist/components/IconGear.vue.d.ts.map +1 -0
  16. package/dist/components/IconRefresh.vue.d.ts +16 -0
  17. package/dist/components/{IconQuality.vue.d.ts.map → IconRefresh.vue.d.ts.map} +1 -1
  18. package/dist/components/SettingsMenu.vue.d.ts +61 -0
  19. package/dist/components/SettingsMenu.vue.d.ts.map +1 -0
  20. package/dist/index.cjs +3 -3
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.ts +2 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.mjs +1772 -1287
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/style.css +1 -1
  27. package/dist/utils/caption-style.d.ts +17 -0
  28. package/dist/utils/caption-style.d.ts.map +1 -0
  29. package/dist/utils/preferences.d.ts +26 -0
  30. package/dist/utils/preferences.d.ts.map +1 -0
  31. package/dist/utils/theme.d.ts +15 -0
  32. package/dist/utils/theme.d.ts.map +1 -0
  33. package/dist/utils/types.d.ts +46 -0
  34. package/dist/utils/types.d.ts.map +1 -1
  35. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,27 +1,27 @@
1
- import { defineComponent as I, ref as y, onMounted as He, watch as R, onBeforeUnmount as ne, openBlock as d, createElementBlock as f, normalizeClass as w, renderSlot as Fe, createElementVNode as r, computed as T, createVNode as Z, toDisplayString as U, Fragment as ie, renderList as ue, createCommentVNode as M, createBlock as z, normalizeStyle as re, withDirectives as We, vShow as ze, unref as te, withCtx as Ye } from "vue";
2
- import ee from "hls.js";
3
- function Ve(t, a, n) {
4
- const e = t == null ? void 0 : t.trim();
5
- if (e) return e;
6
- if (a) {
1
+ import { defineComponent as N, ref as g, onMounted as Be, watch as H, onBeforeUnmount as oe, openBlock as r, createElementBlock as c, normalizeClass as L, renderSlot as Ue, createElementVNode as o, computed as I, createVNode as O, toDisplayString as Z, Fragment as ae, renderList as pe, createCommentVNode as x, createBlock as J, unref as se, normalizeStyle as ce, withDirectives as ot, vShow as rt, withCtx as it } from "vue";
2
+ import le from "hls.js";
3
+ function De(e, l, t) {
4
+ const n = e == null ? void 0 : e.trim();
5
+ if (n) return n;
6
+ if (l) {
7
7
  try {
8
- const o = new Intl.DisplayNames(void 0, { type: "language" }).of(a);
9
- if (o && o !== a) return o;
8
+ const v = new Intl.DisplayNames(void 0, { type: "language" }).of(l);
9
+ if (v && v !== l) return v;
10
10
  } catch {
11
11
  }
12
- return a;
12
+ return l;
13
13
  }
14
- return `Audio ${n + 1}`;
14
+ return `Audio ${t + 1}`;
15
15
  }
16
- const Ke = {
16
+ const ut = {
17
17
  index: -1,
18
18
  height: 0,
19
19
  label: "Auto"
20
20
  };
21
- function Xe(t, a) {
22
- return t > 0 ? `${t}p` : `Level ${a + 1}`;
21
+ function ct(e, l) {
22
+ return e > 0 ? `${e}p` : `Level ${l + 1}`;
23
23
  }
24
- const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "poster"], Ge = /* @__PURE__ */ I({
24
+ const dt = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "poster"], vt = /* @__PURE__ */ N({
25
25
  __name: "HLSPlayer",
26
26
  props: {
27
27
  src: {},
@@ -38,148 +38,153 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
38
38
  audioTrackIndex: { default: -1 },
39
39
  qualityLevelIndex: { default: -1 }
40
40
  },
41
- emits: ["play", "pause", "ended", "audio-tracks", "quality-levels", "current-level"],
42
- setup(t, { expose: a, emit: n }) {
43
- const e = t, c = n, o = y(null), h = y(null);
44
- let g, E;
45
- const _ = globalThis.window !== void 0 && ee.isSupported(), $ = (p) => !!e.isHls || _ && p.endsWith(".m3u8");
46
- function S() {
47
- E == null || E(), E = void 0, g == null || g(), g = void 0, h.value && (h.value.destroy(), h.value = null);
48
- const p = o.value;
49
- if (p) {
50
- for (p.pause(), p.removeAttribute("src"); p.firstChild; ) p.firstChild.remove();
51
- p.load(), c("audio-tracks", []), c("quality-levels", []), c("current-level", -1);
41
+ emits: ["play", "pause", "ended", "fatal-error", "live-change", "audio-tracks", "quality-levels", "current-level"],
42
+ setup(e, { expose: l, emit: t }) {
43
+ const n = e, a = t, v = g(null), d = g(null);
44
+ let h, E;
45
+ const S = globalThis.window !== void 0 && le.isSupported(), A = (f) => !!n.isHls || S && f.endsWith(".m3u8");
46
+ function P() {
47
+ E == null || E(), E = void 0, h == null || h(), h = void 0, d.value && (d.value.destroy(), d.value = null);
48
+ const f = v.value;
49
+ if (f) {
50
+ for (f.pause(), f.removeAttribute("src"); f.firstChild; ) f.firstChild.remove();
51
+ f.load(), a("audio-tracks", []), a("quality-levels", []), a("current-level", -1), a("live-change", !1);
52
52
  }
53
53
  }
54
- function b(p) {
55
- var Y, A, J;
56
- const x = o.value;
57
- if (!x || !p) return;
58
- S();
59
- const B = () => {
60
- e.autoPlay && x.play().catch(() => {
54
+ function w(f) {
55
+ var j, K, re;
56
+ const M = v.value;
57
+ if (!M || !f) return;
58
+ P();
59
+ const z = () => {
60
+ n.autoPlay && M.play().catch(() => {
61
61
  });
62
62
  };
63
- if ($(p)) {
64
- const k = new ee(e.hlsConfig);
65
- h.value = k;
66
- const N = () => {
67
- const H = k.audioTracks.map((V, O) => ({
68
- index: O,
69
- label: Ve(V.name, V.lang, O),
70
- lang: V.lang || void 0
63
+ if (A(f)) {
64
+ const C = new le(n.hlsConfig);
65
+ d.value = C;
66
+ const W = () => {
67
+ const F = C.audioTracks.map((B, R) => ({
68
+ index: R,
69
+ label: De(B.name, B.lang, R),
70
+ lang: B.lang || void 0
71
71
  }));
72
- c("audio-tracks", H);
73
- }, D = () => {
74
- const H = k.levels.map((V, O) => ({
75
- index: O,
76
- height: V.height || 0,
77
- label: Xe(V.height || 0, O)
72
+ a("audio-tracks", F);
73
+ }, V = () => {
74
+ const F = C.levels.map((B, R) => ({
75
+ index: R,
76
+ height: B.height || 0,
77
+ label: ct(B.height || 0, R)
78
78
  }));
79
- c("quality-levels", H);
79
+ a("quality-levels", F);
80
80
  };
81
- k.on(ee.Events.MANIFEST_PARSED, B), k.on(ee.Events.MANIFEST_PARSED, D), k.on(ee.Events.LEVELS_UPDATED, D), k.on(ee.Events.LEVEL_SWITCHED, (H, V) => {
82
- c("current-level", V.level);
83
- }), k.on(ee.Events.AUDIO_TRACKS_UPDATED, N), k.on(ee.Events.AUDIO_TRACK_SWITCHED, N), k.on(ee.Events.ERROR, (H, V) => {
84
- V.fatal && (k.destroy(), h.value = null);
85
- }), k.attachMedia(x), k.loadSource(p);
81
+ C.on(le.Events.MANIFEST_PARSED, z), C.on(le.Events.MANIFEST_PARSED, V), C.on(le.Events.LEVELS_UPDATED, V), C.on(le.Events.LEVEL_SWITCHED, (F, B) => {
82
+ a("current-level", B.level);
83
+ }), C.on(le.Events.AUDIO_TRACKS_UPDATED, W), C.on(le.Events.AUDIO_TRACK_SWITCHED, W), C.on(le.Events.LEVEL_LOADED, (F, B) => {
84
+ var R;
85
+ a("live-change", !!((R = B.details) != null && R.live));
86
+ });
87
+ let D = !1;
88
+ C.on(le.Events.ERROR, (F, B) => {
89
+ B.fatal && (B.type === le.ErrorTypes.NETWORK_ERROR && !D ? (D = !0, C.startLoad()) : B.type === le.ErrorTypes.MEDIA_ERROR && !D ? (D = !0, C.recoverMediaError()) : (C.destroy(), d.value = null, a("fatal-error")));
90
+ }), C.attachMedia(M), C.loadSource(f);
86
91
  } else {
87
- x.src = p, x.load(), x.addEventListener("loadedmetadata", B, { once: !0 }), E = () => {
88
- x.removeEventListener("loadedmetadata", B);
92
+ M.src = f, M.load(), M.addEventListener("loadedmetadata", z, { once: !0 }), E = () => {
93
+ M.removeEventListener("loadedmetadata", z);
89
94
  };
90
- const k = x.audioTracks;
91
- if (k) {
92
- const N = () => {
93
- const D = [];
94
- for (let H = 0; H < k.length; H++) {
95
- const V = k[H];
96
- D.push({
97
- index: H,
98
- label: Ve(V.label, V.language, H),
99
- lang: V.language || void 0
95
+ const C = M.audioTracks;
96
+ if (C) {
97
+ const W = () => {
98
+ const V = [];
99
+ for (let D = 0; D < C.length; D++) {
100
+ const F = C[D];
101
+ V.push({
102
+ index: D,
103
+ label: De(F.label, F.language, D),
104
+ lang: F.language || void 0
100
105
  });
101
106
  }
102
- c("audio-tracks", D);
107
+ a("audio-tracks", V);
103
108
  };
104
- (Y = k.addEventListener) == null || Y.call(k, "addtrack", N), (A = k.addEventListener) == null || A.call(k, "removetrack", N), (J = k.addEventListener) == null || J.call(k, "change", N), k.length > 0 && N(), g = () => {
105
- var D, H, V;
106
- (D = k.removeEventListener) == null || D.call(k, "addtrack", N), (H = k.removeEventListener) == null || H.call(k, "removetrack", N), (V = k.removeEventListener) == null || V.call(k, "change", N);
109
+ (j = C.addEventListener) == null || j.call(C, "addtrack", W), (K = C.addEventListener) == null || K.call(C, "removetrack", W), (re = C.addEventListener) == null || re.call(C, "change", W), C.length > 0 && W(), h = () => {
110
+ var V, D, F;
111
+ (V = C.removeEventListener) == null || V.call(C, "addtrack", W), (D = C.removeEventListener) == null || D.call(C, "removetrack", W), (F = C.removeEventListener) == null || F.call(C, "change", W);
107
112
  };
108
113
  }
109
114
  }
110
115
  }
111
- function m(p) {
112
- var Y;
113
- if (p == null || p < 0) return;
114
- const x = h.value;
115
- if (x) {
116
- x.audioTrack !== p && (x.audioTrack = p);
116
+ function $(f) {
117
+ var j;
118
+ if (f == null || f < 0) return;
119
+ const M = d.value;
120
+ if (M) {
121
+ M.audioTrack !== f && (M.audioTrack = f);
117
122
  return;
118
123
  }
119
- const B = (Y = o.value) == null ? void 0 : Y.audioTracks;
120
- if (B)
121
- for (let A = 0; A < B.length; A++)
122
- B[A].enabled = A === p;
123
- }
124
- function C(p) {
125
- if (p == null) return;
126
- const x = h.value;
127
- x && x.currentLevel !== p && (x.currentLevel = p);
128
- }
129
- return He(() => {
130
- e.src && b(e.src);
131
- }), R(
132
- () => e.src,
133
- (p) => {
134
- p && b(p);
124
+ const z = (j = v.value) == null ? void 0 : j.audioTracks;
125
+ if (z)
126
+ for (let K = 0; K < z.length; K++)
127
+ z[K].enabled = K === f;
128
+ }
129
+ function T(f) {
130
+ if (f == null) return;
131
+ const M = d.value;
132
+ M && M.currentLevel !== f && (M.currentLevel = f);
133
+ }
134
+ return Be(() => {
135
+ n.src && w(n.src);
136
+ }), H(
137
+ () => n.src,
138
+ (f) => {
139
+ f && w(f);
135
140
  }
136
- ), R(
137
- () => e.audioTrackIndex,
138
- (p) => m(p)
139
- ), R(
140
- () => e.qualityLevelIndex,
141
- (p) => C(p)
142
- ), ne(S), a({ videoEl: o }), (p, x) => (d(), f("video", {
141
+ ), H(
142
+ () => n.audioTrackIndex,
143
+ (f) => $(f)
144
+ ), H(
145
+ () => n.qualityLevelIndex,
146
+ (f) => T(f)
147
+ ), oe(P), l({ videoEl: v }), (f, M) => (r(), c("video", {
143
148
  ref_key: "videoEl",
144
- ref: o,
145
- muted: t.muted,
146
- loop: t.loop,
147
- controls: t.controls,
148
- autoplay: t.autoPlay,
149
- playsinline: t.playsInline,
150
- preload: t.preload,
151
- poster: t.poster,
152
- class: w(e.class),
153
- onPlay: x[0] || (x[0] = (B) => c("play")),
154
- onPause: x[1] || (x[1] = (B) => c("pause")),
155
- onEnded: x[2] || (x[2] = (B) => c("ended"))
149
+ ref: v,
150
+ muted: e.muted,
151
+ loop: e.loop,
152
+ controls: e.controls,
153
+ autoplay: e.autoPlay,
154
+ playsinline: e.playsInline,
155
+ preload: e.preload,
156
+ poster: e.poster,
157
+ class: L(n.class),
158
+ onPlay: M[0] || (M[0] = (z) => a("play")),
159
+ onPause: M[1] || (M[1] = (z) => a("pause")),
160
+ onEnded: M[2] || (M[2] = (z) => a("ended"))
156
161
  }, [
157
- Fe(p.$slots, "default")
158
- ], 42, Je));
162
+ Ue(f.$slots, "default")
163
+ ], 42, dt));
159
164
  }
160
- }), et = { name: "IconAudio" }, tt = /* @__PURE__ */ I({
161
- ...et,
165
+ }), pt = { name: "IconAudio" }, ft = /* @__PURE__ */ N({
166
+ ...pt,
162
167
  props: {
163
168
  class: {}
164
169
  },
165
- setup(t) {
166
- const a = t;
167
- return (n, e) => (d(), f("svg", {
168
- class: w(["gvp-icon", a.class]),
170
+ setup(e) {
171
+ const l = e;
172
+ return (t, n) => (r(), c("svg", {
173
+ class: L(["gvp-icon", l.class]),
169
174
  width: "16",
170
175
  height: "16",
171
176
  viewBox: "0 0 24 24",
172
177
  fill: "none",
173
178
  xmlns: "http://www.w3.org/2000/svg",
174
179
  "aria-hidden": "true"
175
- }, [...e[0] || (e[0] = [
176
- r("path", {
180
+ }, [...n[0] || (n[0] = [
181
+ o("path", {
177
182
  d: "M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",
178
183
  stroke: "currentColor",
179
184
  "stroke-width": "1.5",
180
185
  "stroke-linejoin": "round"
181
186
  }, null, -1),
182
- r("path", {
187
+ o("path", {
183
188
  d: "M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",
184
189
  stroke: "currentColor",
185
190
  "stroke-width": "1.5",
@@ -187,23 +192,23 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
187
192
  }, null, -1)
188
193
  ])], 2));
189
194
  }
190
- }), nt = { name: "IconChevron" }, Re = /* @__PURE__ */ I({
191
- ...nt,
195
+ }), mt = { name: "IconChevron" }, Ze = /* @__PURE__ */ N({
196
+ ...mt,
192
197
  props: {
193
198
  class: {}
194
199
  },
195
- setup(t) {
196
- const a = t;
197
- return (n, e) => (d(), f("svg", {
198
- class: w(["gvp-icon", a.class]),
200
+ setup(e) {
201
+ const l = e;
202
+ return (t, n) => (r(), c("svg", {
203
+ class: L(["gvp-icon", l.class]),
199
204
  width: "12",
200
205
  height: "12",
201
206
  viewBox: "0 0 24 24",
202
207
  fill: "none",
203
208
  xmlns: "http://www.w3.org/2000/svg",
204
209
  "aria-hidden": "true"
205
- }, [...e[0] || (e[0] = [
206
- r("path", {
210
+ }, [...n[0] || (n[0] = [
211
+ o("path", {
207
212
  d: "M6 9L12 15L18 9",
208
213
  stroke: "currentColor",
209
214
  "stroke-width": "2",
@@ -212,93 +217,93 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
212
217
  }, null, -1)
213
218
  ])], 2));
214
219
  }
215
- }), lt = ["aria-expanded"], at = { class: "gvp-audio-label" }, ot = {
220
+ }), gt = ["aria-expanded"], ht = { class: "gvp-audio-label" }, kt = {
216
221
  key: 0,
217
222
  class: "gvp-audio-menu",
218
223
  role: "listbox",
219
224
  "aria-label": "Audio tracks"
220
- }, st = ["aria-selected", "onClick"], rt = /* @__PURE__ */ I({
225
+ }, yt = ["aria-selected", "onClick"], bt = /* @__PURE__ */ N({
221
226
  __name: "AudioTrackSwitcher",
222
227
  props: {
223
228
  tracks: {},
224
229
  activeIndex: {}
225
230
  },
226
231
  emits: ["select"],
227
- setup(t, { emit: a }) {
228
- const n = t, e = a, c = y(!1), o = y(null), h = T(
229
- () => n.tracks.find(($) => $.index === n.activeIndex) ?? n.tracks[0]
232
+ setup(e, { emit: l }) {
233
+ const t = e, n = l, a = g(!1), v = g(null), d = I(
234
+ () => t.tracks.find((A) => A.index === t.activeIndex) ?? t.tracks[0]
230
235
  );
231
- function g($) {
232
- o.value && !o.value.contains($.target) && (c.value = !1);
236
+ function h(A) {
237
+ v.value && !v.value.contains(A.target) && (a.value = !1);
233
238
  }
234
- function E($) {
235
- $.key === "Escape" && (c.value = !1);
239
+ function E(A) {
240
+ A.key === "Escape" && (a.value = !1);
236
241
  }
237
- R(c, ($) => {
238
- $ ? (document.addEventListener("mousedown", g), document.addEventListener("keydown", E)) : (document.removeEventListener("mousedown", g), document.removeEventListener("keydown", E));
239
- }), ne(() => {
240
- document.removeEventListener("mousedown", g), document.removeEventListener("keydown", E);
242
+ H(a, (A) => {
243
+ A ? (document.addEventListener("mousedown", h), document.addEventListener("keydown", E)) : (document.removeEventListener("mousedown", h), document.removeEventListener("keydown", E));
244
+ }), oe(() => {
245
+ document.removeEventListener("mousedown", h), document.removeEventListener("keydown", E);
241
246
  });
242
- function _($) {
243
- e("select", $), c.value = !1;
247
+ function S(A) {
248
+ n("select", A), a.value = !1;
244
249
  }
245
- return ($, S) => {
246
- var b;
247
- return d(), f("div", {
250
+ return (A, P) => {
251
+ var w;
252
+ return r(), c("div", {
248
253
  ref_key: "rootEl",
249
- ref: o,
254
+ ref: v,
250
255
  class: "gvp-audio"
251
256
  }, [
252
- r("button", {
257
+ o("button", {
253
258
  type: "button",
254
259
  class: "gvp-audio-btn",
255
260
  "aria-haspopup": "listbox",
256
- "aria-expanded": c.value,
261
+ "aria-expanded": a.value,
257
262
  "aria-label": "Audio track",
258
- onClick: S[0] || (S[0] = (m) => c.value = !c.value)
263
+ onClick: P[0] || (P[0] = ($) => a.value = !a.value)
259
264
  }, [
260
- Z(tt),
261
- r("span", at, U((b = h.value) == null ? void 0 : b.label), 1),
262
- Z(Re)
263
- ], 8, lt),
264
- c.value ? (d(), f("ul", ot, [
265
- (d(!0), f(ie, null, ue(t.tracks, (m) => (d(), f("li", {
266
- key: m.index
265
+ O(ft),
266
+ o("span", ht, Z((w = d.value) == null ? void 0 : w.label), 1),
267
+ O(Ze)
268
+ ], 8, gt),
269
+ a.value ? (r(), c("ul", kt, [
270
+ (r(!0), c(ae, null, pe(e.tracks, ($) => (r(), c("li", {
271
+ key: $.index
267
272
  }, [
268
- r("button", {
273
+ o("button", {
269
274
  type: "button",
270
275
  role: "option",
271
- "aria-selected": m.index === t.activeIndex,
272
- class: w(["gvp-audio-menu-item", { "is-active": m.index === t.activeIndex }]),
273
- onClick: (C) => _(m.index)
274
- }, U(m.label), 11, st)
276
+ "aria-selected": $.index === e.activeIndex,
277
+ class: L(["gvp-audio-menu-item", { "is-active": $.index === e.activeIndex }]),
278
+ onClick: (T) => S($.index)
279
+ }, Z($.label), 11, yt)
275
280
  ]))), 128))
276
- ])) : M("", !0)
281
+ ])) : x("", !0)
277
282
  ], 512);
278
283
  };
279
284
  }
280
- }), it = { name: "IconSpeed" }, Oe = /* @__PURE__ */ I({
281
- ...it,
285
+ }), wt = { name: "IconSpeed" }, xt = /* @__PURE__ */ N({
286
+ ...wt,
282
287
  props: {
283
288
  class: {}
284
289
  },
285
- setup(t) {
286
- const a = t;
287
- return (n, e) => (d(), f("svg", {
288
- class: w(["gvp-icon", a.class]),
290
+ setup(e) {
291
+ const l = e;
292
+ return (t, n) => (r(), c("svg", {
293
+ class: L(["gvp-icon", l.class]),
289
294
  width: "16",
290
295
  height: "16",
291
296
  viewBox: "0 0 24 24",
292
297
  fill: "none",
293
298
  xmlns: "http://www.w3.org/2000/svg",
294
299
  "aria-hidden": "true"
295
- }, [...e[0] || (e[0] = [
296
- r("path", {
300
+ }, [...n[0] || (n[0] = [
301
+ o("path", {
297
302
  d: "M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z",
298
303
  stroke: "currentColor",
299
304
  "stroke-width": "1.5"
300
305
  }, null, -1),
301
- r("path", {
306
+ o("path", {
302
307
  d: "M12 8V12L14.5 14.5",
303
308
  stroke: "currentColor",
304
309
  "stroke-width": "1.5",
@@ -307,80 +312,80 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
307
312
  }, null, -1)
308
313
  ])], 2));
309
314
  }
310
- }), ut = ["aria-expanded"], ct = { class: "gvp-speed-label" }, dt = {
315
+ }), Ct = ["aria-expanded"], Lt = { class: "gvp-speed-label" }, $t = {
311
316
  key: 0,
312
317
  class: "gvp-speed-menu",
313
318
  role: "listbox",
314
319
  "aria-label": "Playback speed"
315
- }, vt = ["aria-selected", "onClick"], pt = /* @__PURE__ */ I({
320
+ }, Et = ["aria-selected", "onClick"], _t = /* @__PURE__ */ N({
316
321
  __name: "SpeedSwitcher",
317
322
  props: {
318
323
  speed: {}
319
324
  },
320
325
  emits: ["select"],
321
- setup(t, { emit: a }) {
322
- const n = [0.5, 0.75, 1, 1.25, 1.5, 2], e = a, c = y(!1), o = y(null);
323
- function h(_) {
324
- o.value && !o.value.contains(_.target) && (c.value = !1);
325
- }
326
- function g(_) {
327
- _.key === "Escape" && (c.value = !1);
328
- }
329
- R(c, (_) => {
330
- _ ? (document.addEventListener("mousedown", h), document.addEventListener("keydown", g)) : (document.removeEventListener("mousedown", h), document.removeEventListener("keydown", g));
331
- }), ne(() => {
332
- document.removeEventListener("mousedown", h), document.removeEventListener("keydown", g);
326
+ setup(e, { emit: l }) {
327
+ const t = [0.5, 0.75, 1, 1.25, 1.5, 2], n = l, a = g(!1), v = g(null);
328
+ function d(S) {
329
+ v.value && !v.value.contains(S.target) && (a.value = !1);
330
+ }
331
+ function h(S) {
332
+ S.key === "Escape" && (a.value = !1);
333
+ }
334
+ H(a, (S) => {
335
+ S ? (document.addEventListener("mousedown", d), document.addEventListener("keydown", h)) : (document.removeEventListener("mousedown", d), document.removeEventListener("keydown", h));
336
+ }), oe(() => {
337
+ document.removeEventListener("mousedown", d), document.removeEventListener("keydown", h);
333
338
  });
334
- function E(_) {
335
- e("select", _), c.value = !1;
339
+ function E(S) {
340
+ n("select", S), a.value = !1;
336
341
  }
337
- return (_, $) => (d(), f("div", {
342
+ return (S, A) => (r(), c("div", {
338
343
  ref_key: "rootEl",
339
- ref: o,
344
+ ref: v,
340
345
  class: "gvp-speed"
341
346
  }, [
342
- r("button", {
347
+ o("button", {
343
348
  type: "button",
344
349
  class: "gvp-speed-btn",
345
350
  "aria-haspopup": "listbox",
346
- "aria-expanded": c.value,
351
+ "aria-expanded": a.value,
347
352
  "aria-label": "`Playback speed: ${speed === 1 ? '1×' : speed + '×'}`",
348
- onClick: $[0] || ($[0] = (S) => c.value = !c.value)
353
+ onClick: A[0] || (A[0] = (P) => a.value = !a.value)
349
354
  }, [
350
- Z(Oe),
351
- r("span", ct, U(t.speed === 1 ? "1×" : `${t.speed}×`), 1),
352
- Z(Re)
353
- ], 8, ut),
354
- c.value ? (d(), f("ul", dt, [
355
- (d(), f(ie, null, ue(n, (S) => r("li", { key: S }, [
356
- r("button", {
355
+ O(xt),
356
+ o("span", Lt, Z(e.speed === 1 ? "1×" : `${e.speed}×`), 1),
357
+ O(Ze)
358
+ ], 8, Ct),
359
+ a.value ? (r(), c("ul", $t, [
360
+ (r(), c(ae, null, pe(t, (P) => o("li", { key: P }, [
361
+ o("button", {
357
362
  type: "button",
358
363
  role: "option",
359
- "aria-selected": S === t.speed,
360
- class: w(["gvp-speed-menu-item", { "is-active": S === t.speed }]),
361
- onClick: (b) => E(S)
362
- }, U(S === 1 ? "Normal" : `${S}×`), 11, vt)
364
+ "aria-selected": P === e.speed,
365
+ class: L(["gvp-speed-menu-item", { "is-active": P === e.speed }]),
366
+ onClick: (w) => E(P)
367
+ }, Z(P === 1 ? "Normal" : `${P}×`), 11, Et)
363
368
  ])), 64))
364
- ])) : M("", !0)
369
+ ])) : x("", !0)
365
370
  ], 512));
366
371
  }
367
- }), ft = { name: "IconCaptions" }, Ue = /* @__PURE__ */ I({
368
- ...ft,
372
+ }), Pt = { name: "IconCaptions" }, Tt = /* @__PURE__ */ N({
373
+ ...Pt,
369
374
  props: {
370
375
  class: {}
371
376
  },
372
- setup(t) {
373
- const a = t;
374
- return (n, e) => (d(), f("svg", {
375
- class: w(["gvp-icon", a.class]),
377
+ setup(e) {
378
+ const l = e;
379
+ return (t, n) => (r(), c("svg", {
380
+ class: L(["gvp-icon", l.class]),
376
381
  width: "18",
377
382
  height: "18",
378
383
  viewBox: "0 0 24 24",
379
384
  fill: "none",
380
385
  xmlns: "http://www.w3.org/2000/svg",
381
386
  "aria-hidden": "true"
382
- }, [...e[0] || (e[0] = [
383
- r("rect", {
387
+ }, [...n[0] || (n[0] = [
388
+ o("rect", {
384
389
  x: "2",
385
390
  y: "5",
386
391
  width: "20",
@@ -389,7 +394,7 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
389
394
  stroke: "currentColor",
390
395
  "stroke-width": "1.5"
391
396
  }, null, -1),
392
- r("path", {
397
+ o("path", {
393
398
  d: "M7 12H11M13 12H17M7 15H9M11 15H13M15 15H17",
394
399
  stroke: "currentColor",
395
400
  "stroke-width": "1.5",
@@ -397,128 +402,128 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
397
402
  }, null, -1)
398
403
  ])], 2));
399
404
  }
400
- }), mt = ["aria-expanded", "aria-pressed"], ht = {
405
+ }), Mt = ["aria-expanded", "aria-pressed"], It = {
401
406
  key: 0,
402
407
  class: "gvp-captions-menu",
403
408
  role: "listbox",
404
409
  "aria-label": "Captions"
405
- }, gt = ["aria-selected"], kt = ["aria-selected", "onClick"], yt = /* @__PURE__ */ I({
410
+ }, St = ["aria-selected"], At = ["aria-selected", "onClick"], Nt = /* @__PURE__ */ N({
406
411
  __name: "CaptionsSwitcher",
407
412
  props: {
408
413
  video: {}
409
414
  },
410
- setup(t) {
411
- const a = t, n = y([]), e = y(-1), c = y(!1), o = y(null);
412
- function h(b) {
413
- const m = [];
414
- for (let p = 0; p < b.length; p++) {
415
- const x = b[p];
416
- (x.kind === "subtitles" || x.kind === "captions") && m.push({ index: p, label: x.label || x.language || `Track ${p + 1}` });
415
+ setup(e) {
416
+ const l = e, t = g([]), n = g(-1), a = g(!1), v = g(null);
417
+ function d(w) {
418
+ const $ = [];
419
+ for (let f = 0; f < w.length; f++) {
420
+ const M = w[f];
421
+ (M.kind === "subtitles" || M.kind === "captions") && $.push({ index: f, label: M.label || M.language || `Track ${f + 1}` });
417
422
  }
418
- n.value = m;
419
- let C = -1;
420
- for (let p = 0; p < b.length; p++)
421
- if (b[p].mode === "showing") {
422
- C = p;
423
+ t.value = $;
424
+ let T = -1;
425
+ for (let f = 0; f < w.length; f++)
426
+ if (w[f].mode === "showing") {
427
+ T = f;
423
428
  break;
424
429
  }
425
- e.value = C;
430
+ n.value = T;
426
431
  }
427
- let g = null;
428
- R(() => a.video, (b) => {
429
- if (g == null || g(), g = null, !b) {
430
- n.value = [], e.value = -1;
432
+ let h = null;
433
+ H(() => l.video, (w) => {
434
+ if (h == null || h(), h = null, !w) {
435
+ t.value = [], n.value = -1;
431
436
  return;
432
437
  }
433
- const m = b.textTracks;
434
- h(m);
435
- const C = () => h(m);
436
- typeof m.addEventListener == "function" && (m.addEventListener("addtrack", C), m.addEventListener("removetrack", C), m.addEventListener("change", C), g = () => {
437
- m.removeEventListener("addtrack", C), m.removeEventListener("removetrack", C), m.removeEventListener("change", C);
438
+ const $ = w.textTracks;
439
+ d($);
440
+ const T = () => d($);
441
+ typeof $.addEventListener == "function" && ($.addEventListener("addtrack", T), $.addEventListener("removetrack", T), $.addEventListener("change", T), h = () => {
442
+ $.removeEventListener("addtrack", T), $.removeEventListener("removetrack", T), $.removeEventListener("change", T);
438
443
  });
439
- }, { immediate: !0 }), ne(() => {
440
- g == null || g(), document.removeEventListener("mousedown", E), document.removeEventListener("keydown", _);
444
+ }, { immediate: !0 }), oe(() => {
445
+ h == null || h(), document.removeEventListener("mousedown", E), document.removeEventListener("keydown", S);
441
446
  });
442
- function E(b) {
443
- o.value && !o.value.contains(b.target) && (c.value = !1);
447
+ function E(w) {
448
+ v.value && !v.value.contains(w.target) && (a.value = !1);
444
449
  }
445
- function _(b) {
446
- b.key === "Escape" && (c.value = !1);
450
+ function S(w) {
451
+ w.key === "Escape" && (a.value = !1);
447
452
  }
448
- R(c, (b) => {
449
- b ? (document.addEventListener("mousedown", E), document.addEventListener("keydown", _)) : (document.removeEventListener("mousedown", E), document.removeEventListener("keydown", _));
453
+ H(a, (w) => {
454
+ w ? (document.addEventListener("mousedown", E), document.addEventListener("keydown", S)) : (document.removeEventListener("mousedown", E), document.removeEventListener("keydown", S));
450
455
  });
451
- function $() {
452
- if (!a.video) return;
453
- const b = a.video.textTracks;
454
- for (let m = 0; m < b.length; m++) b[m].mode = "hidden";
455
- e.value = -1, c.value = !1;
456
- }
457
- function S(b) {
458
- if (!a.video) return;
459
- const m = a.video.textTracks;
460
- for (let C = 0; C < m.length; C++)
461
- m[C].mode = C === b ? "showing" : "hidden";
462
- e.value = b, c.value = !1;
463
- }
464
- return (b, m) => n.value.length > 0 ? (d(), f("div", {
456
+ function A() {
457
+ if (!l.video) return;
458
+ const w = l.video.textTracks;
459
+ for (let $ = 0; $ < w.length; $++) w[$].mode = "hidden";
460
+ n.value = -1, a.value = !1;
461
+ }
462
+ function P(w) {
463
+ if (!l.video) return;
464
+ const $ = l.video.textTracks;
465
+ for (let T = 0; T < $.length; T++)
466
+ $[T].mode = T === w ? "showing" : "hidden";
467
+ n.value = w, a.value = !1;
468
+ }
469
+ return (w, $) => t.value.length > 0 ? (r(), c("div", {
465
470
  key: 0,
466
471
  ref_key: "rootEl",
467
- ref: o,
472
+ ref: v,
468
473
  class: "gvp-captions"
469
474
  }, [
470
- r("button", {
475
+ o("button", {
471
476
  type: "button",
472
- class: w(["gvp-captions-btn", { "is-active": e.value >= 0 }]),
477
+ class: L(["gvp-captions-btn", { "is-active": n.value >= 0 }]),
473
478
  "aria-haspopup": "listbox",
474
- "aria-expanded": c.value,
475
- "aria-pressed": e.value >= 0,
479
+ "aria-expanded": a.value,
480
+ "aria-pressed": n.value >= 0,
476
481
  "aria-label": "Captions",
477
- onClick: m[0] || (m[0] = (C) => c.value = !c.value)
482
+ onClick: $[0] || ($[0] = (T) => a.value = !a.value)
478
483
  }, [
479
- Z(Ue)
480
- ], 10, mt),
481
- c.value ? (d(), f("ul", ht, [
482
- r("li", null, [
483
- r("button", {
484
+ O(Tt)
485
+ ], 10, Mt),
486
+ a.value ? (r(), c("ul", It, [
487
+ o("li", null, [
488
+ o("button", {
484
489
  type: "button",
485
490
  role: "option",
486
- "aria-selected": e.value === -1,
487
- class: w(["gvp-captions-menu-item", { "is-active": e.value === -1 }]),
488
- onClick: $
489
- }, " Off ", 10, gt)
491
+ "aria-selected": n.value === -1,
492
+ class: L(["gvp-captions-menu-item", { "is-active": n.value === -1 }]),
493
+ onClick: A
494
+ }, " Off ", 10, St)
490
495
  ]),
491
- (d(!0), f(ie, null, ue(n.value, (C) => (d(), f("li", {
492
- key: C.index
496
+ (r(!0), c(ae, null, pe(t.value, (T) => (r(), c("li", {
497
+ key: T.index
493
498
  }, [
494
- r("button", {
499
+ o("button", {
495
500
  type: "button",
496
501
  role: "option",
497
- "aria-selected": C.index === e.value,
498
- class: w(["gvp-captions-menu-item", { "is-active": C.index === e.value }]),
499
- onClick: (p) => S(C.index)
500
- }, U(C.label), 11, kt)
502
+ "aria-selected": T.index === n.value,
503
+ class: L(["gvp-captions-menu-item", { "is-active": T.index === n.value }]),
504
+ onClick: (f) => P(T.index)
505
+ }, Z(T.label), 11, At)
501
506
  ]))), 128))
502
- ])) : M("", !0)
503
- ], 512)) : M("", !0);
507
+ ])) : x("", !0)
508
+ ], 512)) : x("", !0);
504
509
  }
505
- }), wt = { name: "IconPause" }, bt = /* @__PURE__ */ I({
506
- ...wt,
510
+ }), Bt = { name: "IconPause" }, Ht = /* @__PURE__ */ N({
511
+ ...Bt,
507
512
  props: {
508
513
  class: {}
509
514
  },
510
- setup(t) {
511
- const a = t;
512
- return (n, e) => (d(), f("svg", {
513
- class: w(["gvp-icon", a.class]),
515
+ setup(e) {
516
+ const l = e;
517
+ return (t, n) => (r(), c("svg", {
518
+ class: L(["gvp-icon", l.class]),
514
519
  width: "16",
515
520
  height: "16",
516
521
  viewBox: "0 0 24 24",
517
522
  fill: "none",
518
523
  xmlns: "http://www.w3.org/2000/svg",
519
524
  "aria-hidden": "true"
520
- }, [...e[0] || (e[0] = [
521
- r("rect", {
525
+ }, [...n[0] || (n[0] = [
526
+ o("rect", {
522
527
  x: "6",
523
528
  y: "5",
524
529
  width: "4",
@@ -526,7 +531,7 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
526
531
  rx: "1",
527
532
  fill: "currentColor"
528
533
  }, null, -1),
529
- r("rect", {
534
+ o("rect", {
530
535
  x: "14",
531
536
  y: "5",
532
537
  width: "4",
@@ -536,49 +541,49 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
536
541
  }, null, -1)
537
542
  ])], 2));
538
543
  }
539
- }), Ct = { name: "IconPlaySolid" }, xt = /* @__PURE__ */ I({
540
- ...Ct,
544
+ }), Vt = { name: "IconPlaySolid" }, Rt = /* @__PURE__ */ N({
545
+ ...Vt,
541
546
  props: {
542
547
  class: {}
543
548
  },
544
- setup(t) {
545
- const a = t;
546
- return (n, e) => (d(), f("svg", {
547
- class: w(["gvp-icon", a.class]),
549
+ setup(e) {
550
+ const l = e;
551
+ return (t, n) => (r(), c("svg", {
552
+ class: L(["gvp-icon", l.class]),
548
553
  width: "16",
549
554
  height: "16",
550
555
  viewBox: "0 0 24 24",
551
556
  fill: "none",
552
557
  xmlns: "http://www.w3.org/2000/svg",
553
558
  "aria-hidden": "true"
554
- }, [...e[0] || (e[0] = [
555
- r("path", {
559
+ }, [...n[0] || (n[0] = [
560
+ o("path", {
556
561
  d: "M7 5.5V18.5C7 19.2659 7.84856 19.7261 8.4899 19.3071L19.0801 12.4014C19.6644 12.0204 19.6644 11.9796 19.0801 11.5986L8.4899 4.69288C7.84856 4.27388 7 4.73408 7 5.5Z",
557
562
  fill: "currentColor"
558
563
  }, null, -1)
559
564
  ])], 2));
560
565
  }
561
- }), Lt = { name: "IconPrev" }, Et = /* @__PURE__ */ I({
562
- ...Lt,
566
+ }), Dt = { name: "IconPrev" }, Ft = /* @__PURE__ */ N({
567
+ ...Dt,
563
568
  props: {
564
569
  class: {}
565
570
  },
566
- setup(t) {
567
- const a = t;
568
- return (n, e) => (d(), f("svg", {
569
- class: w(["gvp-icon", a.class]),
571
+ setup(e) {
572
+ const l = e;
573
+ return (t, n) => (r(), c("svg", {
574
+ class: L(["gvp-icon", l.class]),
570
575
  width: "16",
571
576
  height: "16",
572
577
  viewBox: "0 0 24 24",
573
578
  fill: "none",
574
579
  xmlns: "http://www.w3.org/2000/svg",
575
580
  "aria-hidden": "true"
576
- }, [...e[0] || (e[0] = [
577
- r("path", {
581
+ }, [...n[0] || (n[0] = [
582
+ o("path", {
578
583
  d: "M16.5 18.5V5.5C16.5 4.73408 15.6514 4.27388 15.0101 4.69288L6.91993 9.98432C6.33563 10.3653 6.33563 11.0347 6.91993 11.4157L15.0101 16.7071C15.6514 17.1261 16.5 16.6659 16.5 15.9V18.5Z",
579
584
  fill: "currentColor"
580
585
  }, null, -1),
581
- r("path", {
586
+ o("path", {
582
587
  d: "M6 5V19",
583
588
  stroke: "currentColor",
584
589
  "stroke-width": "2",
@@ -586,27 +591,27 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
586
591
  }, null, -1)
587
592
  ])], 2));
588
593
  }
589
- }), _t = { name: "IconNext" }, $t = /* @__PURE__ */ I({
590
- ..._t,
594
+ }), qt = { name: "IconNext" }, Ot = /* @__PURE__ */ N({
595
+ ...qt,
591
596
  props: {
592
597
  class: {}
593
598
  },
594
- setup(t) {
595
- const a = t;
596
- return (n, e) => (d(), f("svg", {
597
- class: w(["gvp-icon", a.class]),
599
+ setup(e) {
600
+ const l = e;
601
+ return (t, n) => (r(), c("svg", {
602
+ class: L(["gvp-icon", l.class]),
598
603
  width: "16",
599
604
  height: "16",
600
605
  viewBox: "0 0 24 24",
601
606
  fill: "none",
602
607
  xmlns: "http://www.w3.org/2000/svg",
603
608
  "aria-hidden": "true"
604
- }, [...e[0] || (e[0] = [
605
- r("path", {
609
+ }, [...n[0] || (n[0] = [
610
+ o("path", {
606
611
  d: "M7.5 5.5V18.5C7.5 19.2659 8.34856 19.7261 8.98990 19.3071L17.0801 14.0157C17.6644 13.6347 17.6644 12.9653 17.0801 12.5843L8.98990 7.29288C8.34856 6.87388 7.5 7.33408 7.5 8.1V5.5Z",
607
612
  fill: "currentColor"
608
613
  }, null, -1),
609
- r("path", {
614
+ o("path", {
610
615
  d: "M18 5V19",
611
616
  stroke: "currentColor",
612
617
  "stroke-width": "2",
@@ -614,29 +619,29 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
614
619
  }, null, -1)
615
620
  ])], 2));
616
621
  }
617
- }), Pt = { name: "IconVolumeHigh" }, Mt = /* @__PURE__ */ I({
618
- ...Pt,
622
+ }), jt = { name: "IconVolumeHigh" }, Ut = /* @__PURE__ */ N({
623
+ ...jt,
619
624
  props: {
620
625
  class: {}
621
626
  },
622
- setup(t) {
623
- const a = t;
624
- return (n, e) => (d(), f("svg", {
625
- class: w(["gvp-icon", a.class]),
627
+ setup(e) {
628
+ const l = e;
629
+ return (t, n) => (r(), c("svg", {
630
+ class: L(["gvp-icon", l.class]),
626
631
  width: "18",
627
632
  height: "18",
628
633
  viewBox: "0 0 24 24",
629
634
  fill: "none",
630
635
  xmlns: "http://www.w3.org/2000/svg",
631
636
  "aria-hidden": "true"
632
- }, [...e[0] || (e[0] = [
633
- r("path", {
637
+ }, [...n[0] || (n[0] = [
638
+ o("path", {
634
639
  d: "M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",
635
640
  stroke: "currentColor",
636
641
  "stroke-width": "1.5",
637
642
  "stroke-linejoin": "round"
638
643
  }, null, -1),
639
- r("path", {
644
+ o("path", {
640
645
  d: "M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",
641
646
  stroke: "currentColor",
642
647
  "stroke-width": "1.5",
@@ -644,29 +649,29 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
644
649
  }, null, -1)
645
650
  ])], 2));
646
651
  }
647
- }), Tt = { name: "IconVolumeLow" }, It = /* @__PURE__ */ I({
648
- ...Tt,
652
+ }), Zt = { name: "IconVolumeLow" }, zt = /* @__PURE__ */ N({
653
+ ...Zt,
649
654
  props: {
650
655
  class: {}
651
656
  },
652
- setup(t) {
653
- const a = t;
654
- return (n, e) => (d(), f("svg", {
655
- class: w(["gvp-icon", a.class]),
657
+ setup(e) {
658
+ const l = e;
659
+ return (t, n) => (r(), c("svg", {
660
+ class: L(["gvp-icon", l.class]),
656
661
  width: "18",
657
662
  height: "18",
658
663
  viewBox: "0 0 24 24",
659
664
  fill: "none",
660
665
  xmlns: "http://www.w3.org/2000/svg",
661
666
  "aria-hidden": "true"
662
- }, [...e[0] || (e[0] = [
663
- r("path", {
667
+ }, [...n[0] || (n[0] = [
668
+ o("path", {
664
669
  d: "M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",
665
670
  stroke: "currentColor",
666
671
  "stroke-width": "1.5",
667
672
  "stroke-linejoin": "round"
668
673
  }, null, -1),
669
- r("path", {
674
+ o("path", {
670
675
  d: "M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16",
671
676
  stroke: "currentColor",
672
677
  "stroke-width": "1.5",
@@ -674,29 +679,29 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
674
679
  }, null, -1)
675
680
  ])], 2));
676
681
  }
677
- }), St = { name: "IconVolumeMuted" }, Nt = /* @__PURE__ */ I({
678
- ...St,
682
+ }), Wt = { name: "IconVolumeMuted" }, Kt = /* @__PURE__ */ N({
683
+ ...Wt,
679
684
  props: {
680
685
  class: {}
681
686
  },
682
- setup(t) {
683
- const a = t;
684
- return (n, e) => (d(), f("svg", {
685
- class: w(["gvp-icon", a.class]),
687
+ setup(e) {
688
+ const l = e;
689
+ return (t, n) => (r(), c("svg", {
690
+ class: L(["gvp-icon", l.class]),
686
691
  width: "18",
687
692
  height: "18",
688
693
  viewBox: "0 0 24 24",
689
694
  fill: "none",
690
695
  xmlns: "http://www.w3.org/2000/svg",
691
696
  "aria-hidden": "true"
692
- }, [...e[0] || (e[0] = [
693
- r("path", {
697
+ }, [...n[0] || (n[0] = [
698
+ o("path", {
694
699
  d: "M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",
695
700
  stroke: "currentColor",
696
701
  "stroke-width": "1.5",
697
702
  "stroke-linejoin": "round"
698
703
  }, null, -1),
699
- r("path", {
704
+ o("path", {
700
705
  d: "M16 9L22 15M22 9L16 15",
701
706
  stroke: "currentColor",
702
707
  "stroke-width": "1.5",
@@ -704,52 +709,23 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
704
709
  }, null, -1)
705
710
  ])], 2));
706
711
  }
707
- }), At = { name: "IconQuality" }, Ht = /* @__PURE__ */ I({
708
- ...At,
712
+ }), Qt = { name: "IconPiP" }, ze = /* @__PURE__ */ N({
713
+ ...Qt,
709
714
  props: {
710
715
  class: {}
711
716
  },
712
- setup(t) {
713
- const a = t;
714
- return (n, e) => (d(), f("svg", {
715
- class: w(["gvp-icon", a.class]),
716
- width: "16",
717
- height: "16",
718
- viewBox: "0 0 24 24",
719
- fill: "none",
720
- xmlns: "http://www.w3.org/2000/svg",
721
- "aria-hidden": "true"
722
- }, [...e[0] || (e[0] = [
723
- r("path", {
724
- d: "M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z",
725
- stroke: "currentColor",
726
- "stroke-width": "1.5"
727
- }, null, -1),
728
- r("path", {
729
- d: "M3 12C3 12.6 3.08 13.18 3.23 13.73L4.6 14.5C4.86 14.65 5.02 14.94 5 15.24C4.98 15.58 4.96 15.92 5.07 16.24C5.18 16.56 5.39 16.83 5.62 17.08C5.83 17.3 6.13 17.4 6.42 17.36L7.99 17.13C8.28 17.09 8.57 17.21 8.74 17.45C9.07 17.93 9.49 18.34 9.97 18.66C10.21 18.83 10.34 19.11 10.31 19.4L10.13 20.97C10.1 21.26 10.21 21.55 10.43 21.74C10.91 22.16 11.45 22 12 22C12.55 22 13.09 22.16 13.57 21.74C13.79 21.55 13.9 21.26 13.87 20.97L13.69 19.4C13.66 19.11 13.79 18.83 14.03 18.66",
730
- stroke: "currentColor",
731
- "stroke-width": "1.5",
732
- "stroke-linecap": "round"
733
- }, null, -1)
734
- ])], 2));
735
- }
736
- }), Bt = { name: "IconPiP" }, Ze = /* @__PURE__ */ I({
737
- ...Bt,
738
- props: {
739
- class: {}
740
- },
741
- setup(t) {
742
- const a = t;
743
- return (n, e) => (d(), f("svg", {
744
- class: w(["gvp-icon", a.class]),
717
+ setup(e) {
718
+ const l = e;
719
+ return (t, n) => (r(), c("svg", {
720
+ class: L(["gvp-icon", l.class]),
745
721
  width: "18",
746
722
  height: "18",
747
723
  viewBox: "0 0 24 24",
748
724
  fill: "none",
749
725
  xmlns: "http://www.w3.org/2000/svg",
750
726
  "aria-hidden": "true"
751
- }, [...e[0] || (e[0] = [
752
- r("rect", {
727
+ }, [...n[0] || (n[0] = [
728
+ o("rect", {
753
729
  x: "2",
754
730
  y: "4",
755
731
  width: "20",
@@ -758,7 +734,7 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
758
734
  stroke: "currentColor",
759
735
  "stroke-width": "1.5"
760
736
  }, null, -1),
761
- r("rect", {
737
+ o("rect", {
762
738
  x: "12",
763
739
  y: "12",
764
740
  width: "8",
@@ -768,23 +744,23 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
768
744
  }, null, -1)
769
745
  ])], 2));
770
746
  }
771
- }), Vt = { name: "IconFullscreen" }, qt = /* @__PURE__ */ I({
772
- ...Vt,
747
+ }), Yt = { name: "IconFullscreen" }, Gt = /* @__PURE__ */ N({
748
+ ...Yt,
773
749
  props: {
774
750
  class: {}
775
751
  },
776
- setup(t) {
777
- const a = t;
778
- return (n, e) => (d(), f("svg", {
779
- class: w(["gvp-icon", a.class]),
752
+ setup(e) {
753
+ const l = e;
754
+ return (t, n) => (r(), c("svg", {
755
+ class: L(["gvp-icon", l.class]),
780
756
  width: "18",
781
757
  height: "18",
782
758
  viewBox: "0 0 24 24",
783
759
  fill: "none",
784
760
  xmlns: "http://www.w3.org/2000/svg",
785
761
  "aria-hidden": "true"
786
- }, [...e[0] || (e[0] = [
787
- r("path", {
762
+ }, [...n[0] || (n[0] = [
763
+ o("path", {
788
764
  d: "M4 9V4H9M15 4H20V9M20 15V20H15M9 20H4V15",
789
765
  stroke: "currentColor",
790
766
  "stroke-width": "1.75",
@@ -793,154 +769,477 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
793
769
  }, null, -1)
794
770
  ])], 2));
795
771
  }
796
- }), Dt = { name: "IconFullscreenExit" }, Ft = /* @__PURE__ */ I({
797
- ...Dt,
772
+ }), Jt = { name: "IconFullscreenExit" }, Xt = /* @__PURE__ */ N({
773
+ ...Jt,
798
774
  props: {
799
775
  class: {}
800
776
  },
801
- setup(t) {
802
- const a = t;
803
- return (n, e) => (d(), f("svg", {
804
- class: w(["gvp-icon", a.class]),
777
+ setup(e) {
778
+ const l = e;
779
+ return (t, n) => (r(), c("svg", {
780
+ class: L(["gvp-icon", l.class]),
805
781
  width: "18",
806
782
  height: "18",
807
783
  viewBox: "0 0 24 24",
808
784
  fill: "none",
809
785
  xmlns: "http://www.w3.org/2000/svg",
810
786
  "aria-hidden": "true"
811
- }, [...e[0] || (e[0] = [
812
- r("path", {
813
- d: "M9 4V9H4M15 9V4H20M15 20V15H20M9 15H4V20",
787
+ }, [...n[0] || (n[0] = [
788
+ o("path", {
789
+ d: "M9 4V7A2 2 0 0 1 7 9H4M15 4V7A2 2 0 0 0 17 9H20M15 20V17A2 2 0 0 1 17 15H20M9 20V17A2 2 0 0 0 7 15H4",
814
790
  stroke: "currentColor",
815
- "stroke-width": "1.75",
791
+ "stroke-width": "2",
816
792
  "stroke-linecap": "round",
817
793
  "stroke-linejoin": "round"
818
794
  }, null, -1)
819
795
  ])], 2));
820
796
  }
797
+ }), en = { name: "IconGear" }, tn = /* @__PURE__ */ N({
798
+ ...en,
799
+ props: {
800
+ class: {}
801
+ },
802
+ setup(e) {
803
+ const l = e;
804
+ return (t, n) => (r(), c("svg", {
805
+ class: L(["gvp-icon", l.class]),
806
+ width: "18",
807
+ height: "18",
808
+ viewBox: "0 0 24 24",
809
+ fill: "none",
810
+ xmlns: "http://www.w3.org/2000/svg",
811
+ "aria-hidden": "true"
812
+ }, [...n[0] || (n[0] = [
813
+ o("path", {
814
+ "fill-rule": "evenodd",
815
+ "clip-rule": "evenodd",
816
+ d: "M10.5 2.25a1 1 0 0 0-.98.804l-.39 1.93a7.5 7.5 0 0 0-1.62.94l-1.86-.64a1 1 0 0 0-1.2.46l-1.5 2.6a1 1 0 0 0 .22 1.26l1.47 1.29a7.6 7.6 0 0 0 0 1.88l-1.47 1.29a1 1 0 0 0-.22 1.26l1.5 2.6a1 1 0 0 0 1.2.46l1.86-.64c.5.38 1.04.7 1.62.94l.39 1.93a1 1 0 0 0 .98.804h3a1 1 0 0 0 .98-.804l.39-1.93c.58-.24 1.12-.56 1.62-.94l1.86.64a1 1 0 0 0 1.2-.46l1.5-2.6a1 1 0 0 0-.22-1.26l-1.47-1.29a7.6 7.6 0 0 0 0-1.88l1.47-1.29a1 1 0 0 0 .22-1.26l-1.5-2.6a1 1 0 0 0-1.2-.46l-1.86.64a7.5 7.5 0 0 0-1.62-.94l-.39-1.93a1 1 0 0 0-.98-.804h-3ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z",
817
+ fill: "currentColor"
818
+ }, null, -1)
819
+ ])], 2));
820
+ }
821
+ }), nn = { name: "IconChevronRight" }, Ee = /* @__PURE__ */ N({
822
+ ...nn,
823
+ props: {
824
+ class: {}
825
+ },
826
+ setup(e) {
827
+ const l = e;
828
+ return (t, n) => (r(), c("svg", {
829
+ class: L(["gvp-icon", l.class]),
830
+ width: "14",
831
+ height: "14",
832
+ viewBox: "0 0 24 24",
833
+ fill: "none",
834
+ xmlns: "http://www.w3.org/2000/svg",
835
+ "aria-hidden": "true"
836
+ }, [...n[0] || (n[0] = [
837
+ o("path", {
838
+ d: "M9 6L15 12L9 18",
839
+ stroke: "currentColor",
840
+ "stroke-width": "2",
841
+ "stroke-linecap": "round",
842
+ "stroke-linejoin": "round"
843
+ }, null, -1)
844
+ ])], 2));
845
+ }
846
+ }), ln = { name: "IconCheck" }, we = /* @__PURE__ */ N({
847
+ ...ln,
848
+ props: {
849
+ class: {}
850
+ },
851
+ setup(e) {
852
+ const l = e;
853
+ return (t, n) => (r(), c("svg", {
854
+ class: L(["gvp-icon", l.class]),
855
+ width: "14",
856
+ height: "14",
857
+ viewBox: "0 0 24 24",
858
+ fill: "none",
859
+ xmlns: "http://www.w3.org/2000/svg",
860
+ "aria-hidden": "true"
861
+ }, [...n[0] || (n[0] = [
862
+ o("path", {
863
+ d: "M5 12L10 17L19 7",
864
+ stroke: "currentColor",
865
+ "stroke-width": "2.5",
866
+ "stroke-linecap": "round",
867
+ "stroke-linejoin": "round"
868
+ }, null, -1)
869
+ ])], 2));
870
+ }
871
+ }), sn = ["aria-expanded"], an = {
872
+ key: 0,
873
+ class: "gvp-settings-menu",
874
+ role: "menu"
875
+ }, on = { class: "gvp-settings-row-value" }, rn = { class: "gvp-settings-row-value" }, un = { class: "gvp-settings-row-value" }, cn = { class: "gvp-settings-row-value" }, dn = ["aria-checked", "onClick"], vn = { class: "gvp-settings-check" }, pn = ["aria-checked"], fn = { class: "gvp-settings-check" }, mn = ["aria-checked", "onClick"], gn = { class: "gvp-settings-check" }, hn = ["aria-checked"], kn = { class: "gvp-settings-check" }, yn = ["aria-checked", "onClick"], bn = { class: "gvp-settings-check" }, wn = ["aria-checked", "onClick"], xn = { class: "gvp-settings-check" }, Cn = { name: "SettingsMenu" }, Ln = /* @__PURE__ */ N({
876
+ ...Cn,
877
+ props: {
878
+ video: {},
879
+ qualityLevels: { default: () => [] },
880
+ currentLevel: { default: -1 },
881
+ selectedLevel: { default: -1 },
882
+ audioTracks: { default: () => [] },
883
+ audioTrackIndex: { default: -1 }
884
+ },
885
+ emits: ["select-level", "select-audio-track"],
886
+ setup(e, { emit: l }) {
887
+ const t = e, n = l, a = [0.5, 0.75, 1, 1.25, 1.5, 2], v = g(!1), d = g("root"), h = g(null), E = g(1);
888
+ H(() => t.video, (y) => {
889
+ if (!y) return;
890
+ const p = () => {
891
+ E.value = y.playbackRate;
892
+ };
893
+ p(), y.addEventListener("ratechange", p);
894
+ }, { immediate: !0 });
895
+ function S(y) {
896
+ t.video && (t.video.playbackRate = y), E.value = y, d.value = "root";
897
+ }
898
+ const A = g([]), P = g(-1);
899
+ function w(y) {
900
+ const p = [];
901
+ for (let m = 0; m < y.length; m++) {
902
+ const Q = y[m];
903
+ (Q.kind === "subtitles" || Q.kind === "captions") && p.push({ index: m, label: Q.label || Q.language || `Track ${m + 1}` });
904
+ }
905
+ A.value = p;
906
+ let ee = -1;
907
+ for (let m = 0; m < y.length; m++)
908
+ if (y[m].mode === "showing") {
909
+ ee = m;
910
+ break;
911
+ }
912
+ P.value = ee;
913
+ }
914
+ H(() => t.video, (y) => {
915
+ if (!y) {
916
+ A.value = [], P.value = -1;
917
+ return;
918
+ }
919
+ const p = y.textTracks;
920
+ w(p);
921
+ const ee = () => w(p);
922
+ typeof p.addEventListener == "function" && (p.addEventListener("addtrack", ee), p.addEventListener("removetrack", ee), p.addEventListener("change", ee));
923
+ }, { immediate: !0 });
924
+ function $(y) {
925
+ var ee;
926
+ const p = (ee = t.video) == null ? void 0 : ee.textTracks;
927
+ if (p)
928
+ for (let m = 0; m < p.length; m++)
929
+ p[m].mode = m === y ? "showing" : "hidden";
930
+ P.value = y, d.value = "root";
931
+ }
932
+ const T = I(
933
+ () => [...t.qualityLevels].sort((y, p) => p.height - y.height)
934
+ ), f = I(
935
+ () => t.qualityLevels.find((y) => y.index === t.currentLevel)
936
+ ), M = I(() => {
937
+ var y;
938
+ return t.selectedLevel < 0 ? f.value ? `Auto (${f.value.label})` : "Auto" : ((y = t.qualityLevels.find((p) => p.index === t.selectedLevel)) == null ? void 0 : y.label) ?? "Auto";
939
+ });
940
+ function z(y) {
941
+ n("select-level", y), d.value = "root";
942
+ }
943
+ const j = I(
944
+ () => t.audioTracks.find((y) => y.index === t.audioTrackIndex) ?? t.audioTracks[0]
945
+ );
946
+ function K(y) {
947
+ n("select-audio-track", y), d.value = "root";
948
+ }
949
+ const re = I(() => t.qualityLevels.length >= 2), C = I(() => A.value.length > 0), W = I(() => t.audioTracks.length > 1), V = I(() => E.value === 1 ? "Normal" : `${E.value}×`), D = I(
950
+ () => {
951
+ var y;
952
+ return P.value < 0 ? "Off" : ((y = A.value.find((p) => p.index === P.value)) == null ? void 0 : y.label) ?? "Off";
953
+ }
954
+ );
955
+ function F() {
956
+ v.value = !1, d.value = "root";
957
+ }
958
+ function B(y) {
959
+ h.value && !h.value.contains(y.target) && F();
960
+ }
961
+ function R(y) {
962
+ y.key === "Escape" && F();
963
+ }
964
+ H(v, (y) => {
965
+ y ? (document.addEventListener("mousedown", B), document.addEventListener("keydown", R)) : (document.removeEventListener("mousedown", B), document.removeEventListener("keydown", R));
966
+ }), oe(() => {
967
+ document.removeEventListener("mousedown", B), document.removeEventListener("keydown", R);
968
+ });
969
+ function fe() {
970
+ v.value = !v.value, d.value = "root";
971
+ }
972
+ return (y, p) => {
973
+ var ee;
974
+ return r(), c("div", {
975
+ ref_key: "rootEl",
976
+ ref: h,
977
+ class: "gvp-settings"
978
+ }, [
979
+ o("button", {
980
+ type: "button",
981
+ class: L(["gvp-ctrl-btn", { "is-active": v.value }]),
982
+ "aria-haspopup": "menu",
983
+ "aria-expanded": v.value,
984
+ "aria-label": "Settings",
985
+ onClick: fe
986
+ }, [
987
+ O(tn)
988
+ ], 10, sn),
989
+ v.value ? (r(), c("div", an, [
990
+ d.value === "root" ? (r(), c(ae, { key: 0 }, [
991
+ o("button", {
992
+ type: "button",
993
+ role: "menuitem",
994
+ class: "gvp-settings-row",
995
+ onClick: p[0] || (p[0] = (m) => d.value = "speed")
996
+ }, [
997
+ p[7] || (p[7] = o("span", { class: "gvp-settings-row-label" }, "Speed", -1)),
998
+ o("span", on, Z(V.value), 1),
999
+ O(Ee, { class: "gvp-settings-chevron" })
1000
+ ]),
1001
+ re.value ? (r(), c("button", {
1002
+ key: 0,
1003
+ type: "button",
1004
+ role: "menuitem",
1005
+ class: "gvp-settings-row",
1006
+ onClick: p[1] || (p[1] = (m) => d.value = "quality")
1007
+ }, [
1008
+ p[8] || (p[8] = o("span", { class: "gvp-settings-row-label" }, "Quality", -1)),
1009
+ o("span", rn, Z(M.value), 1),
1010
+ O(Ee, { class: "gvp-settings-chevron" })
1011
+ ])) : x("", !0),
1012
+ C.value ? (r(), c("button", {
1013
+ key: 1,
1014
+ type: "button",
1015
+ role: "menuitem",
1016
+ class: "gvp-settings-row",
1017
+ onClick: p[2] || (p[2] = (m) => d.value = "captions")
1018
+ }, [
1019
+ p[9] || (p[9] = o("span", { class: "gvp-settings-row-label" }, "Subtitles", -1)),
1020
+ o("span", un, Z(D.value), 1),
1021
+ O(Ee, { class: "gvp-settings-chevron" })
1022
+ ])) : x("", !0),
1023
+ W.value ? (r(), c("button", {
1024
+ key: 2,
1025
+ type: "button",
1026
+ role: "menuitem",
1027
+ class: "gvp-settings-row",
1028
+ onClick: p[3] || (p[3] = (m) => d.value = "audio")
1029
+ }, [
1030
+ p[10] || (p[10] = o("span", { class: "gvp-settings-row-label" }, "Audio", -1)),
1031
+ o("span", cn, Z((ee = j.value) == null ? void 0 : ee.label), 1),
1032
+ O(Ee, { class: "gvp-settings-chevron" })
1033
+ ])) : x("", !0)
1034
+ ], 64)) : x("", !0),
1035
+ d.value !== "root" ? (r(), c("button", {
1036
+ key: 1,
1037
+ type: "button",
1038
+ class: "gvp-settings-back",
1039
+ onClick: p[4] || (p[4] = (m) => d.value = "root")
1040
+ }, [
1041
+ O(Ee, { class: "gvp-settings-back-icon" }),
1042
+ o("span", null, Z(d.value === "speed" ? "Speed" : d.value === "quality" ? "Quality" : d.value === "captions" ? "Subtitles" : "Audio"), 1)
1043
+ ])) : x("", !0),
1044
+ d.value === "speed" ? (r(), c(ae, { key: 2 }, pe(a, (m) => o("button", {
1045
+ key: m,
1046
+ type: "button",
1047
+ role: "menuitemradio",
1048
+ "aria-checked": m === E.value,
1049
+ class: L(["gvp-settings-option", { "is-active": m === E.value }]),
1050
+ onClick: (Q) => S(m)
1051
+ }, [
1052
+ o("span", vn, [
1053
+ m === E.value ? (r(), J(we, { key: 0 })) : x("", !0)
1054
+ ]),
1055
+ o("span", null, Z(m === 1 ? "Normal" : `${m}×`), 1)
1056
+ ], 10, dn)), 64)) : x("", !0),
1057
+ d.value === "quality" ? (r(), c(ae, { key: 3 }, [
1058
+ o("button", {
1059
+ type: "button",
1060
+ role: "menuitemradio",
1061
+ "aria-checked": e.selectedLevel < 0,
1062
+ class: L(["gvp-settings-option", { "is-active": e.selectedLevel < 0 }]),
1063
+ onClick: p[5] || (p[5] = (m) => z(se(ut).index))
1064
+ }, [
1065
+ o("span", fn, [
1066
+ e.selectedLevel < 0 ? (r(), J(we, { key: 0 })) : x("", !0)
1067
+ ]),
1068
+ o("span", null, Z(f.value ? `Auto (${f.value.label})` : "Auto"), 1)
1069
+ ], 10, pn),
1070
+ (r(!0), c(ae, null, pe(T.value, (m) => (r(), c("button", {
1071
+ key: m.index,
1072
+ type: "button",
1073
+ role: "menuitemradio",
1074
+ "aria-checked": m.index === e.selectedLevel,
1075
+ class: L(["gvp-settings-option", { "is-active": m.index === e.selectedLevel }]),
1076
+ onClick: (Q) => z(m.index)
1077
+ }, [
1078
+ o("span", gn, [
1079
+ m.index === e.selectedLevel ? (r(), J(we, { key: 0 })) : x("", !0)
1080
+ ]),
1081
+ o("span", null, Z(m.label), 1)
1082
+ ], 10, mn))), 128))
1083
+ ], 64)) : x("", !0),
1084
+ d.value === "captions" ? (r(), c(ae, { key: 4 }, [
1085
+ o("button", {
1086
+ type: "button",
1087
+ role: "menuitemradio",
1088
+ "aria-checked": P.value === -1,
1089
+ class: L(["gvp-settings-option", { "is-active": P.value === -1 }]),
1090
+ onClick: p[6] || (p[6] = (m) => $(-1))
1091
+ }, [
1092
+ o("span", kn, [
1093
+ P.value === -1 ? (r(), J(we, { key: 0 })) : x("", !0)
1094
+ ]),
1095
+ p[11] || (p[11] = o("span", null, "Off", -1))
1096
+ ], 10, hn),
1097
+ (r(!0), c(ae, null, pe(A.value, (m) => (r(), c("button", {
1098
+ key: m.index,
1099
+ type: "button",
1100
+ role: "menuitemradio",
1101
+ "aria-checked": m.index === P.value,
1102
+ class: L(["gvp-settings-option", { "is-active": m.index === P.value }]),
1103
+ onClick: (Q) => $(m.index)
1104
+ }, [
1105
+ o("span", bn, [
1106
+ m.index === P.value ? (r(), J(we, { key: 0 })) : x("", !0)
1107
+ ]),
1108
+ o("span", null, Z(m.label), 1)
1109
+ ], 10, yn))), 128))
1110
+ ], 64)) : x("", !0),
1111
+ d.value === "audio" ? (r(!0), c(ae, { key: 5 }, pe(e.audioTracks, (m) => {
1112
+ var Q, Y, X;
1113
+ return r(), c("button", {
1114
+ key: m.index,
1115
+ type: "button",
1116
+ role: "menuitemradio",
1117
+ "aria-checked": m.index === (((Q = j.value) == null ? void 0 : Q.index) ?? -1),
1118
+ class: L([
1119
+ "gvp-settings-option",
1120
+ { "is-active": m.index === (((Y = j.value) == null ? void 0 : Y.index) ?? -1) }
1121
+ ]),
1122
+ onClick: (G) => K(m.index)
1123
+ }, [
1124
+ o("span", xn, [
1125
+ m.index === (((X = j.value) == null ? void 0 : X.index) ?? -1) ? (r(), J(we, { key: 0 })) : x("", !0)
1126
+ ]),
1127
+ o("span", null, Z(m.label), 1)
1128
+ ], 10, wn);
1129
+ }), 128)) : x("", !0)
1130
+ ])) : x("", !0)
1131
+ ], 512);
1132
+ };
1133
+ }
821
1134
  });
822
- function Ae(t) {
823
- if (!Number.isFinite(t) || t < 0) return "--:--";
824
- const a = Math.floor(t), n = Math.floor(a / 3600), e = Math.floor(a % 3600 / 60), o = (a % 60).toString().padStart(2, "0");
825
- if (n > 0) {
826
- const h = e.toString().padStart(2, "0");
827
- return `${n}:${h}:${o}`;
1135
+ function _e(e) {
1136
+ if (!Number.isFinite(e) || e < 0) return "--:--";
1137
+ const l = Math.floor(e), t = Math.floor(l / 3600), n = Math.floor(l % 3600 / 60), v = (l % 60).toString().padStart(2, "0");
1138
+ if (t > 0) {
1139
+ const d = n.toString().padStart(2, "0");
1140
+ return `${t}:${d}:${v}`;
828
1141
  }
829
- return `${e}:${o}`;
1142
+ return `${n}:${v}`;
830
1143
  }
831
- function qe(t) {
832
- const a = t.trim().split(":");
833
- if (a.length < 2 || a.length > 3) return NaN;
834
- const n = a.map(Number);
835
- return n.some((e) => !Number.isFinite(e)) ? NaN : n.length === 3 ? n[0] * 3600 + n[1] * 60 + n[2] : n[0] * 60 + n[1];
1144
+ function Fe(e) {
1145
+ const l = e.trim().split(":");
1146
+ if (l.length < 2 || l.length > 3) return NaN;
1147
+ const t = l.map(Number);
1148
+ return t.some((n) => !Number.isFinite(n)) ? NaN : t.length === 3 ? t[0] * 3600 + t[1] * 60 + t[2] : t[0] * 60 + t[1];
836
1149
  }
837
- function Rt(t, a) {
1150
+ function $n(e, l) {
838
1151
  try {
839
- return new URL(t, a).href;
1152
+ return new URL(e, l).href;
840
1153
  } catch {
841
- return t;
1154
+ return e;
842
1155
  }
843
1156
  }
844
- function Ot(t, a) {
845
- const n = [], e = t.replace(/\r/g, "").split(`
1157
+ function En(e, l) {
1158
+ const t = [], n = e.replace(/\r/g, "").split(`
846
1159
  `);
847
- for (let c = 0; c < e.length; c++) {
848
- const o = e[c].indexOf("-->");
849
- if (o === -1) continue;
850
- const h = qe(e[c].slice(0, o)), g = qe(e[c].slice(o + 3));
851
- if (!Number.isFinite(h) || !Number.isFinite(g)) continue;
852
- const E = (e[c + 1] ?? "").trim();
1160
+ for (let a = 0; a < n.length; a++) {
1161
+ const v = n[a].indexOf("-->");
1162
+ if (v === -1) continue;
1163
+ const d = Fe(n[a].slice(0, v)), h = Fe(n[a].slice(v + 3));
1164
+ if (!Number.isFinite(d) || !Number.isFinite(h)) continue;
1165
+ const E = (n[a + 1] ?? "").trim();
853
1166
  if (!E) continue;
854
- const _ = E.indexOf("#xywh=");
855
- let $ = E, S = 0, b = 0, m = 0, C = 0;
856
- if (_ !== -1) {
857
- $ = E.slice(0, _);
858
- const p = E.slice(_ + 6).split(",").map(Number);
859
- p.length === 4 && p.every(Number.isFinite) && ([S, b, m, C] = p);
860
- }
861
- n.push({ start: h, end: g, url: Rt($, a), x: S, y: b, w: m, h: C });
1167
+ const S = E.indexOf("#xywh=");
1168
+ let A = E, P = 0, w = 0, $ = 0, T = 0;
1169
+ if (S !== -1) {
1170
+ A = E.slice(0, S);
1171
+ const f = E.slice(S + 6).split(",").map(Number);
1172
+ f.length === 4 && f.every(Number.isFinite) && ([P, w, $, T] = f);
1173
+ }
1174
+ t.push({ start: d, end: h, url: $n(A, l), x: P, y: w, w: $, h: T });
862
1175
  }
863
- return n.sort((c, o) => c.start - o.start), n;
1176
+ return t.sort((a, v) => a.start - v.start), t;
864
1177
  }
865
- function Ut(t) {
1178
+ function _n(e) {
866
1179
  return {
867
- cues: t,
868
- cueAt(a) {
869
- if (t.length === 0) return null;
870
- let n = 0, e = t.length - 1, c = t[0];
871
- for (; n <= e; ) {
872
- const o = n + e >> 1, h = t[o];
873
- if (a < h.start)
874
- e = o - 1;
875
- else if (a > h.end)
876
- c = h, n = o + 1;
1180
+ cues: e,
1181
+ cueAt(l) {
1182
+ if (e.length === 0) return null;
1183
+ let t = 0, n = e.length - 1, a = e[0];
1184
+ for (; t <= n; ) {
1185
+ const v = t + n >> 1, d = e[v];
1186
+ if (l < d.start)
1187
+ n = v - 1;
1188
+ else if (l > d.end)
1189
+ a = d, t = v + 1;
877
1190
  else
878
- return h;
1191
+ return d;
879
1192
  }
880
- return c;
1193
+ return a;
881
1194
  }
882
1195
  };
883
1196
  }
884
- function De(t) {
885
- const a = t.trim().split(":");
886
- if (a.length < 2 || a.length > 3) return NaN;
887
- const n = a.map(Number);
888
- return n.some((e) => !Number.isFinite(e)) ? NaN : n.length === 3 ? n[0] * 3600 + n[1] * 60 + n[2] : n[0] * 60 + n[1];
1197
+ function qe(e) {
1198
+ const l = e.trim().split(":");
1199
+ if (l.length < 2 || l.length > 3) return NaN;
1200
+ const t = l.map(Number);
1201
+ return t.some((n) => !Number.isFinite(n)) ? NaN : t.length === 3 ? t[0] * 3600 + t[1] * 60 + t[2] : t[0] * 60 + t[1];
889
1202
  }
890
- function Zt(t) {
891
- const a = [], n = t.replace(/\r/g, "").split(`
1203
+ function Pn(e) {
1204
+ const l = [], t = e.replace(/\r/g, "").split(`
892
1205
  `);
893
- for (let e = 0; e < n.length; e++) {
894
- const c = n[e].indexOf("-->");
895
- if (c === -1) continue;
896
- const o = De(n[e].slice(0, c)), h = De(n[e].slice(c + 3));
897
- if (!Number.isFinite(o) || !Number.isFinite(h)) continue;
898
- const g = (n[e + 1] ?? "").trim();
899
- g && a.push({ start: o, end: h, title: g });
1206
+ for (let n = 0; n < t.length; n++) {
1207
+ const a = t[n].indexOf("-->");
1208
+ if (a === -1) continue;
1209
+ const v = qe(t[n].slice(0, a)), d = qe(t[n].slice(a + 3));
1210
+ if (!Number.isFinite(v) || !Number.isFinite(d)) continue;
1211
+ const h = (t[n + 1] ?? "").trim();
1212
+ h && l.push({ start: v, end: d, title: h });
900
1213
  }
901
- return a.sort((e, c) => e.start - c.start), a;
1214
+ return l.sort((n, a) => n.start - a.start), l;
902
1215
  }
903
- function jt(t, a) {
904
- const n = t.filter((e) => Number.isFinite(e.start) && e.start >= 0 && e.title).sort((e, c) => e.start - c.start);
905
- return n.map((e, c) => {
906
- var o;
1216
+ function Tn(e, l) {
1217
+ const t = e.filter((n) => Number.isFinite(n.start) && n.start >= 0 && n.title).sort((n, a) => n.start - a.start);
1218
+ return t.map((n, a) => {
1219
+ var v;
907
1220
  return {
908
- start: e.start,
909
- end: Number.isFinite(e.end) ? e.end : ((o = n[c + 1]) == null ? void 0 : o.start) ?? a,
910
- title: e.title
1221
+ start: n.start,
1222
+ end: Number.isFinite(n.end) ? n.end : ((v = t[a + 1]) == null ? void 0 : v.start) ?? l,
1223
+ title: n.title
911
1224
  };
912
1225
  });
913
1226
  }
914
- function Qt(t, a) {
915
- for (const n of t)
916
- if (a >= n.start && a < n.end) return n;
1227
+ function Mn(e, l) {
1228
+ for (const t of e)
1229
+ if (l >= t.start && l < t.end) return t;
917
1230
  return null;
918
1231
  }
919
- const Wt = { class: "gvp-controls-row" }, zt = ["disabled"], Yt = ["aria-label", "aria-pressed"], Kt = ["disabled"], Xt = {
1232
+ const In = { class: "gvp-controls-seek" }, Sn = {
920
1233
  key: 1,
921
1234
  class: "gvp-seek-preview-chapter"
922
- }, Jt = { class: "gvp-seek-preview-time" }, Gt = ["value", "disabled", "aria-valuemax", "aria-valuenow"], en = {
923
- class: "gvp-time",
924
- "aria-live": "off"
925
- }, tn = ["aria-expanded", "aria-label"], nn = { class: "gvp-speed-label" }, ln = {
926
- key: 0,
927
- class: "gvp-speed-menu",
928
- role: "listbox",
929
- "aria-label": "Playback speed"
930
- }, an = ["aria-selected", "onClick"], on = ["aria-expanded", "aria-label"], sn = { class: "gvp-quality-label" }, rn = {
931
- key: 0,
932
- class: "gvp-quality-menu",
933
- role: "listbox",
934
- "aria-label": "Quality"
935
- }, un = ["aria-selected"], cn = ["aria-selected", "onClick"], dn = ["aria-expanded", "aria-pressed"], vn = {
936
- key: 0,
937
- class: "gvp-captions-menu",
938
- role: "listbox",
939
- "aria-label": "Captions"
940
- }, pn = ["aria-selected"], fn = ["aria-selected", "onClick"], mn = ["aria-label", "aria-pressed"], hn = {
1235
+ }, An = { class: "gvp-seek-preview-time" }, Nn = ["value", "disabled", "aria-valuemax", "aria-valuenow", "aria-valuetext"], Bn = { class: "gvp-controls-row" }, Hn = { class: "gvp-controls-left" }, Vn = ["aria-label", "aria-pressed"], Rn = ["disabled"], Dn = ["disabled"], Fn = ["aria-label", "aria-pressed"], qn = {
941
1236
  key: 0,
942
1237
  class: "gvp-volume-slider-wrap"
943
- }, gn = { class: "gvp-volume-track" }, kn = ["value", "aria-valuenow"], yn = ["aria-label", "aria-pressed"], wn = ["aria-label", "aria-pressed"], bn = 3e3, Cn = /* @__PURE__ */ I({
1238
+ }, On = { class: "gvp-volume-track" }, jn = ["value", "aria-valuenow", "aria-valuetext"], Un = {
1239
+ key: 2,
1240
+ class: "gvp-time",
1241
+ "aria-live": "off"
1242
+ }, Zn = ["disabled", "aria-label"], zn = { class: "gvp-controls-right" }, Wn = ["aria-label", "aria-pressed"], Kn = ["aria-label", "aria-pressed"], Qn = 3e3, Yn = 10, Gn = /* @__PURE__ */ N({
944
1243
  __name: "ControlBar",
945
1244
  props: {
946
1245
  video: {},
@@ -953,554 +1252,408 @@ const Wt = { class: "gvp-controls-row" }, zt = ["disabled"], Yt = ["aria-label",
953
1252
  thumbnails: {},
954
1253
  chapters: {},
955
1254
  hasPrev: { type: Boolean, default: !1 },
956
- hasNext: { type: Boolean, default: !1 }
1255
+ hasNext: { type: Boolean, default: !1 },
1256
+ isLive: { type: Boolean, default: !1 },
1257
+ audioTracks: { default: () => [] },
1258
+ audioTrackIndex: { default: -1 }
957
1259
  },
958
- emits: ["select-level", "prev", "next"],
959
- setup(t, { emit: a }) {
960
- const n = (() => {
1260
+ emits: ["select-level", "select-audio-track", "prev", "next"],
1261
+ setup(e, { emit: l }) {
1262
+ const t = (() => {
961
1263
  if (typeof navigator > "u") return !1;
962
- const l = navigator.userAgent;
963
- return /iPad|iPhone|iPod/.test(l) || l.includes("Mac") && navigator.maxTouchPoints > 1;
964
- })(), e = typeof navigator > "u" ? !1 : /iPhone|iPod/.test(navigator.userAgent), c = [0.5, 0.75, 1, 1.25, 1.5, 2], o = t, h = a, g = y(!0);
965
- let E = null;
966
- function _() {
967
- E !== null && (clearTimeout(E), E = null);
968
- }
969
- function $() {
970
- _(), o.isPlaying && (E = setTimeout(() => {
971
- g.value = !1;
972
- }, bn));
1264
+ const u = navigator.userAgent;
1265
+ return /iPad|iPhone|iPod/.test(u) || u.includes("Mac") && navigator.maxTouchPoints > 1;
1266
+ })(), n = typeof navigator > "u" ? !1 : /iPhone|iPod/.test(navigator.userAgent), a = e, v = l, d = g(!0);
1267
+ let h = null;
1268
+ function E() {
1269
+ h !== null && (clearTimeout(h), h = null);
973
1270
  }
974
1271
  function S() {
975
- g.value = !0, $();
976
- }
977
- R(() => o.isPlaying, (l) => {
978
- l ? $() : (_(), g.value = !0);
979
- }, { immediate: !0 }), R(() => o.container, (l) => {
980
- if (!l) return;
981
- const s = () => S();
982
- l.addEventListener("mousemove", s), l.addEventListener("touchstart", s), l.addEventListener("focusin", s);
1272
+ E(), a.isPlaying && (h = setTimeout(() => {
1273
+ d.value = !1;
1274
+ }, Qn));
1275
+ }
1276
+ function A() {
1277
+ d.value = !0, S();
1278
+ }
1279
+ H(() => a.isPlaying, (u) => {
1280
+ u ? S() : (E(), d.value = !0);
1281
+ }, { immediate: !0 }), H(() => a.container, (u) => {
1282
+ if (!u) return;
1283
+ const b = () => A();
1284
+ u.addEventListener("mousemove", b), u.addEventListener("touchstart", b), u.addEventListener("focusin", b);
983
1285
  }, { immediate: !0 });
984
- const b = y(0), m = y(0), C = y(0);
985
- R(() => o.video, (l) => {
986
- if (!l) return;
987
- const s = () => {
988
- b.value = l.currentTime;
989
- }, i = () => {
990
- m.value = Number.isFinite(l.duration) ? l.duration : 0;
991
- }, L = () => {
992
- const F = l.buffered;
993
- if (!F || F.length === 0) {
994
- C.value = 0;
1286
+ const P = g(0), w = g(0), $ = g(0), T = g(!1), f = g(!0), M = I(() => a.isLive || T.value);
1287
+ H(() => a.video, (u) => {
1288
+ if (!u) return;
1289
+ const b = () => {
1290
+ P.value = u.currentTime;
1291
+ }, _ = () => {
1292
+ w.value = Number.isFinite(u.duration) ? u.duration : 0;
1293
+ }, te = () => {
1294
+ const q = u.buffered;
1295
+ if (!q || q.length === 0) {
1296
+ $.value = 0;
995
1297
  return;
996
1298
  }
997
- let Be = F.end(F.length - 1);
998
- for (let ye = 0; ye < F.length; ye++)
999
- if (F.start(ye) <= l.currentTime && l.currentTime <= F.end(ye)) {
1000
- Be = F.end(ye);
1299
+ let ke = q.end(q.length - 1);
1300
+ for (let ve = 0; ve < q.length; ve++)
1301
+ if (q.start(ve) <= u.currentTime && u.currentTime <= q.end(ve)) {
1302
+ ke = q.end(ve);
1001
1303
  break;
1002
1304
  }
1003
- C.value = Be;
1305
+ $.value = ke;
1306
+ }, he = () => {
1307
+ if (T.value = !Number.isFinite(u.duration) && u.duration > 0, M.value && u.seekable.length > 0) {
1308
+ const q = u.seekable.end(u.seekable.length - 1);
1309
+ f.value = q - u.currentTime <= Yn;
1310
+ }
1004
1311
  };
1005
- s(), i(), L(), l.addEventListener("timeupdate", s), l.addEventListener("durationchange", i), l.addEventListener("loadedmetadata", i), l.addEventListener("progress", L), l.addEventListener("timeupdate", L);
1312
+ b(), _(), te(), he(), u.addEventListener("timeupdate", b), u.addEventListener("durationchange", _), u.addEventListener("loadedmetadata", _), u.addEventListener("progress", te), u.addEventListener("timeupdate", te), u.addEventListener("durationchange", he), u.addEventListener("loadedmetadata", he), u.addEventListener("timeupdate", he);
1006
1313
  }, { immediate: !0 });
1007
- const p = () => m.value > 0, x = () => p() ? b.value / m.value * 100 : 0, B = () => p() ? C.value / m.value * 100 : 0;
1008
- function Y(l) {
1009
- const s = o.video;
1010
- if (!s || !p()) return;
1011
- const i = Number(l.target.value) / 100 * m.value;
1012
- s.currentTime = i, b.value = i;
1013
- }
1014
- const A = y(null), J = y(null), k = y(0), N = y(0), D = y(!1);
1015
- R(() => o.thumbnails, (l) => {
1016
- if (A.value = null, !l) return;
1017
- let s = !1;
1018
- fetch(l).then((i) => i.ok ? i.text() : Promise.reject(new Error("fetch failed"))).then((i) => {
1019
- if (s) return;
1020
- const L = Ot(i, new URL(l, location.href).href);
1021
- A.value = L.length > 0 ? Ut(L) : null;
1314
+ function z() {
1315
+ const u = a.video;
1316
+ !u || u.seekable.length === 0 || (u.currentTime = u.seekable.end(u.seekable.length - 1));
1317
+ }
1318
+ const j = () => w.value > 0, K = () => j() ? P.value / w.value * 100 : 0, re = () => j() ? $.value / w.value * 100 : 0;
1319
+ function C(u) {
1320
+ const b = a.video;
1321
+ if (!b || !j()) return;
1322
+ const _ = Number(u.target.value) / 100 * w.value;
1323
+ b.currentTime = _, P.value = _;
1324
+ }
1325
+ const W = g(null), V = g(null), D = g(0), F = g(0), B = g(!1);
1326
+ H(() => a.thumbnails, (u) => {
1327
+ if (W.value = null, !u) return;
1328
+ let b = !1;
1329
+ fetch(u).then((_) => _.ok ? _.text() : Promise.reject(new Error("fetch failed"))).then((_) => {
1330
+ if (b) return;
1331
+ const te = En(_, new URL(u, location.href).href);
1332
+ W.value = te.length > 0 ? _n(te) : null;
1022
1333
  }).catch(() => {
1023
- s || (A.value = null);
1024
- }), ne(() => {
1025
- s = !0;
1334
+ b || (W.value = null);
1335
+ }), oe(() => {
1336
+ b = !0;
1026
1337
  });
1027
1338
  }, { immediate: !0 });
1028
- function H(l) {
1029
- const s = J.value;
1030
- if (!s || !p()) return;
1031
- const i = s.getBoundingClientRect(), L = Math.min(Math.max(l.clientX - i.left, 0), i.width);
1032
- N.value = L, k.value = L / i.width * m.value, D.value = !0;
1339
+ function R(u) {
1340
+ const b = V.value;
1341
+ if (!b || !j()) return;
1342
+ const _ = b.getBoundingClientRect(), te = Math.min(Math.max(u.clientX - _.left, 0), _.width);
1343
+ F.value = te, D.value = te / _.width * w.value, B.value = !0;
1033
1344
  }
1034
- function V() {
1035
- D.value = !1;
1345
+ function fe() {
1346
+ B.value = !1;
1036
1347
  }
1037
- const O = T(
1348
+ const y = I(
1038
1349
  () => {
1039
- var l;
1040
- return D.value ? ((l = A.value) == null ? void 0 : l.cueAt(k.value)) ?? null : null;
1350
+ var u;
1351
+ return B.value ? ((u = W.value) == null ? void 0 : u.cueAt(D.value)) ?? null : null;
1041
1352
  }
1042
- ), me = T(() => {
1043
- const l = O.value;
1044
- return l !== null && l.w > 0 && l.h > 0;
1045
- }), Pe = T(() => {
1046
- var L;
1047
- const l = O.value, s = ((L = J.value) == null ? void 0 : L.clientWidth) ?? 0;
1048
- if (!me.value || !l || s === 0) return N.value;
1049
- const i = l.w / 2;
1050
- return Math.min(Math.max(N.value, i), s - i);
1051
- }), oe = y([]);
1052
- R(() => o.chapters, (l) => {
1053
- if (oe.value = [], typeof l != "string" || !l) return;
1054
- let s = !1;
1055
- fetch(l).then((i) => i.ok ? i.text() : Promise.reject(new Error("fetch failed"))).then((i) => {
1056
- s || (oe.value = Zt(i));
1353
+ ), p = I(() => {
1354
+ const u = y.value;
1355
+ return u !== null && u.w > 0 && u.h > 0;
1356
+ }), ee = I(() => {
1357
+ var te;
1358
+ const u = y.value, b = ((te = V.value) == null ? void 0 : te.clientWidth) ?? 0;
1359
+ if (!p.value || !u || b === 0) return F.value;
1360
+ const _ = u.w / 2;
1361
+ return Math.min(Math.max(F.value, _), b - _);
1362
+ }), m = g([]);
1363
+ H(() => a.chapters, (u) => {
1364
+ if (m.value = [], typeof u != "string" || !u) return;
1365
+ let b = !1;
1366
+ fetch(u).then((_) => _.ok ? _.text() : Promise.reject(new Error("fetch failed"))).then((_) => {
1367
+ b || (m.value = Pn(_));
1057
1368
  }).catch(() => {
1058
- s || (oe.value = []);
1059
- }), ne(() => {
1060
- s = !0;
1369
+ b || (m.value = []);
1370
+ }), oe(() => {
1371
+ b = !0;
1061
1372
  });
1062
1373
  }, { immediate: !0 });
1063
- const ce = T(() => typeof o.chapters == "string" ? oe.value : Array.isArray(o.chapters) ? jt(o.chapters, m.value) : []), de = T(
1064
- () => D.value ? Qt(ce.value, k.value) : null
1065
- ), K = y(1), q = y(!1);
1066
- R(() => o.video, (l) => {
1067
- if (!l) return;
1068
- const s = () => {
1069
- K.value = l.volume, q.value = l.muted;
1070
- };
1071
- s(), l.addEventListener("volumechange", s);
1072
- }, { immediate: !0 });
1073
- function Me() {
1074
- o.video && (o.video.muted = !o.video.muted);
1075
- }
1076
- function Te(l) {
1077
- const s = o.video;
1078
- if (!s) return;
1079
- const i = Number(l.target.value) / 100;
1080
- s.volume = i, i > 0 && s.muted && (s.muted = !1);
1081
- }
1082
- const X = y(1), le = y(!1), we = y(null);
1083
- R(() => o.video, (l) => {
1084
- if (!l) return;
1085
- const s = () => {
1086
- X.value = l.playbackRate;
1374
+ const Q = I(() => typeof a.chapters == "string" ? m.value : Array.isArray(a.chapters) ? Tn(a.chapters, w.value) : []), Y = I(
1375
+ () => B.value ? Mn(Q.value, D.value) : null
1376
+ ), X = g(1), G = g(!1);
1377
+ H(() => a.video, (u) => {
1378
+ if (!u) return;
1379
+ const b = () => {
1380
+ X.value = u.volume, G.value = u.muted;
1087
1381
  };
1088
- s(), l.addEventListener("ratechange", s);
1089
- }, { immediate: !0 });
1090
- function Ie(l) {
1091
- o.video && (o.video.playbackRate = l), X.value = l, le.value = !1;
1092
- }
1093
- const ae = y(!1), Q = y(null), he = T(() => o.qualityLevels.length >= 2), be = T(
1094
- () => [...o.qualityLevels].sort((l, s) => s.height - l.height)
1095
- ), ve = T(
1096
- () => o.qualityLevels.find((l) => l.index === o.currentLevel)
1097
- ), Ce = T(() => {
1098
- if (o.selectedLevel < 0)
1099
- return ve.value ? `Auto (${ve.value.label})` : "Auto";
1100
- const l = o.qualityLevels.find((s) => s.index === o.selectedLevel);
1101
- return (l == null ? void 0 : l.label) ?? "Auto";
1102
- });
1103
- function se(l) {
1104
- h("select-level", l), ae.value = !1;
1105
- }
1106
- const pe = y([]), W = y(-1), G = y(!1), xe = y(null);
1107
- function ge(l) {
1108
- const s = [];
1109
- for (let L = 0; L < l.length; L++) {
1110
- const F = l[L];
1111
- (F.kind === "subtitles" || F.kind === "captions") && s.push({ index: L, label: F.label || F.language || `Track ${L + 1}` });
1112
- }
1113
- pe.value = s;
1114
- let i = -1;
1115
- for (let L = 0; L < l.length; L++)
1116
- if (l[L].mode === "showing") {
1117
- i = L;
1118
- break;
1119
- }
1120
- W.value = i;
1121
- }
1122
- R(() => o.video, (l) => {
1123
- if (!l) {
1124
- pe.value = [], W.value = -1;
1125
- return;
1126
- }
1127
- const s = l.textTracks;
1128
- ge(s);
1129
- const i = () => ge(s);
1130
- typeof s.addEventListener == "function" && (s.addEventListener("addtrack", i), s.addEventListener("removetrack", i), s.addEventListener("change", i));
1382
+ b(), u.addEventListener("volumechange", b);
1131
1383
  }, { immediate: !0 });
1132
- function Le(l) {
1133
- var i;
1134
- const s = (i = o.video) == null ? void 0 : i.textTracks;
1135
- if (s) {
1136
- for (let L = 0; L < s.length; L++) s[L].mode = L === l ? "showing" : "hidden";
1137
- W.value = l, G.value = !1;
1138
- }
1384
+ function ge() {
1385
+ a.video && (a.video.muted = !a.video.muted);
1139
1386
  }
1140
- function u() {
1141
- var s;
1142
- const l = (s = o.video) == null ? void 0 : s.textTracks;
1143
- if (l) {
1144
- for (let i = 0; i < l.length; i++) l[i].mode = "hidden";
1145
- W.value = -1, G.value = !1;
1146
- }
1387
+ function ue(u) {
1388
+ const b = a.video;
1389
+ if (!b) return;
1390
+ const _ = Number(u.target.value) / 100;
1391
+ b.volume = _, _ > 0 && b.muted && (b.muted = !1);
1147
1392
  }
1148
- const v = y(!1), P = typeof document < "u" && !!document.pictureInPictureEnabled;
1149
- R(() => o.video, (l) => {
1150
- l && (l.addEventListener("enterpictureinpicture", () => {
1151
- v.value = !0;
1152
- }), l.addEventListener("leavepictureinpicture", () => {
1153
- v.value = !1;
1393
+ const me = g(!1), Ie = typeof document < "u" && !!document.pictureInPictureEnabled;
1394
+ H(() => a.video, (u) => {
1395
+ u && (u.addEventListener("enterpictureinpicture", () => {
1396
+ me.value = !0;
1397
+ }), u.addEventListener("leavepictureinpicture", () => {
1398
+ me.value = !1;
1154
1399
  }));
1155
1400
  }, { immediate: !0 });
1156
- function fe() {
1157
- o.video && (document.pictureInPictureElement ? document.exitPictureInPicture().catch(() => {
1158
- }) : o.video.requestPictureInPicture().catch(() => {
1401
+ function Se() {
1402
+ a.video && (document.pictureInPictureElement ? document.exitPictureInPicture().catch(() => {
1403
+ }) : a.video.requestPictureInPicture().catch(() => {
1159
1404
  }));
1160
1405
  }
1161
- const j = y(!1), Ee = typeof document > "u" ? !1 : !!(document.fullscreenEnabled || document.webkitFullscreenEnabled);
1162
- function Se() {
1406
+ const de = g(!1), Pe = typeof document > "u" ? !1 : !!(document.fullscreenEnabled || document.webkitFullscreenEnabled);
1407
+ function xe() {
1163
1408
  return document.fullscreenElement ?? document.webkitFullscreenElement ?? null;
1164
1409
  }
1165
- function _e(l) {
1166
- const s = l.requestFullscreen ?? l.webkitRequestFullscreen;
1167
- return s ? s.call(l) : Promise.reject(new Error("unsupported"));
1410
+ function Ce(u) {
1411
+ const b = u.requestFullscreen ?? u.webkitRequestFullscreen;
1412
+ return b ? b.call(u) : Promise.reject(new Error("unsupported"));
1168
1413
  }
1169
- function ke() {
1170
- const l = document.exitFullscreen ?? document.webkitExitFullscreen;
1171
- return l ? l.call(document) : Promise.reject(new Error("unsupported"));
1414
+ function Le() {
1415
+ const u = document.exitFullscreen ?? document.webkitExitFullscreen;
1416
+ return u ? u.call(document) : Promise.reject(new Error("unsupported"));
1172
1417
  }
1173
- function $e() {
1174
- j.value = Se() === o.container;
1418
+ function U() {
1419
+ de.value = xe() === a.container;
1175
1420
  }
1176
- He(() => {
1177
- document.addEventListener("fullscreenchange", $e), document.addEventListener("webkitfullscreenchange", $e);
1178
- }), ne(() => {
1179
- _(), document.removeEventListener("fullscreenchange", $e), document.removeEventListener("webkitfullscreenchange", $e);
1421
+ Be(() => {
1422
+ document.addEventListener("fullscreenchange", U), document.addEventListener("webkitfullscreenchange", U);
1423
+ }), oe(() => {
1424
+ E(), document.removeEventListener("fullscreenchange", U), document.removeEventListener("webkitfullscreenchange", U);
1180
1425
  });
1181
- function je() {
1182
- var l, s;
1183
- if (e) {
1184
- (s = (l = o.video) == null ? void 0 : l.webkitEnterFullscreen) == null || s.call(l);
1426
+ function Ae() {
1427
+ var u, b;
1428
+ if (n) {
1429
+ (b = (u = a.video) == null ? void 0 : u.webkitEnterFullscreen) == null || b.call(u);
1185
1430
  return;
1186
1431
  }
1187
- j.value ? ke().catch(() => {
1188
- }) : o.container && _e(o.container).catch(() => {
1432
+ de.value ? Le().catch(() => {
1433
+ }) : a.container && Ce(a.container).catch(() => {
1189
1434
  });
1190
1435
  }
1191
- const Qe = Ee || e && o.video !== null && typeof o.video.webkitEnterFullscreen == "function";
1192
- function Ne(l, s) {
1193
- function i(F) {
1194
- s.value && !s.value.contains(F.target) && (l.value = !1);
1195
- }
1196
- function L(F) {
1197
- F.key === "Escape" && (l.value = !1);
1198
- }
1199
- R(l, (F) => {
1200
- F ? (document.addEventListener("mousedown", i), document.addEventListener("keydown", L)) : (document.removeEventListener("mousedown", i), document.removeEventListener("keydown", L));
1201
- }), ne(() => {
1202
- document.removeEventListener("mousedown", i), document.removeEventListener("keydown", L);
1203
- });
1204
- }
1205
- return Ne(le, we), Ne(G, xe), Ne(ae, Q), (l, s) => (d(), f("div", {
1436
+ const Ne = Pe || n && a.video !== null && typeof a.video.webkitEnterFullscreen == "function";
1437
+ return (u, b) => (r(), c("div", {
1206
1438
  role: "toolbar",
1207
1439
  "aria-label": "Video controls",
1208
- class: w(["gvp-controls", !g.value && "is-hidden"]),
1209
- onMouseenter: _,
1210
- onMouseleave: $
1440
+ class: L(["gvp-controls", !d.value && "is-hidden"]),
1441
+ onMouseenter: E,
1442
+ onMouseleave: S
1211
1443
  }, [
1212
- r("div", Wt, [
1213
- t.hasPrev || t.hasNext ? (d(), f("button", {
1214
- key: 0,
1215
- type: "button",
1216
- class: "gvp-ctrl-btn",
1217
- "aria-label": "Previous video",
1218
- disabled: !t.hasPrev,
1219
- onClick: s[0] || (s[0] = (i) => h("prev"))
1220
- }, [
1221
- Z(Et)
1222
- ], 8, zt)) : M("", !0),
1223
- r("button", {
1224
- type: "button",
1225
- class: "gvp-ctrl-btn",
1226
- "aria-label": t.isPlaying ? "Pause" : "Play",
1227
- "aria-pressed": t.isPlaying,
1228
- onClick: s[1] || (s[1] = //@ts-ignore
1229
- (...i) => t.onTogglePlay && t.onTogglePlay(...i))
1230
- }, [
1231
- t.isPlaying ? (d(), z(bt, { key: 0 })) : (d(), z(xt, { key: 1 }))
1232
- ], 8, Yt),
1233
- t.hasPrev || t.hasNext ? (d(), f("button", {
1234
- key: 1,
1235
- type: "button",
1236
- class: "gvp-ctrl-btn",
1237
- "aria-label": "Next video",
1238
- disabled: !t.hasNext,
1239
- onClick: s[2] || (s[2] = (i) => h("next"))
1240
- }, [
1241
- Z($t)
1242
- ], 8, Kt)) : M("", !0),
1243
- r("div", {
1444
+ o("div", In, [
1445
+ o("div", {
1244
1446
  class: "gvp-seek",
1245
- onPointermove: H,
1246
- onPointerleave: V
1447
+ onPointermove: R,
1448
+ onPointerleave: fe
1247
1449
  }, [
1248
- r("div", {
1450
+ o("div", {
1249
1451
  ref_key: "seekTrackEl",
1250
- ref: J,
1452
+ ref: V,
1251
1453
  class: "gvp-seek-track"
1252
1454
  }, [
1253
- r("div", {
1455
+ o("div", {
1254
1456
  class: "gvp-seek-buffered",
1255
- style: re({ width: `${B()}%` })
1457
+ style: ce({ width: `${re()}%` })
1256
1458
  }, null, 4),
1257
- r("div", {
1459
+ o("div", {
1258
1460
  class: "gvp-seek-progress",
1259
- style: re({ width: `${x()}%` })
1461
+ style: ce({ width: `${K()}%` })
1260
1462
  }, null, 4),
1261
- p() ? (d(!0), f(ie, { key: 0 }, ue(ce.value, (i) => We((d(), f("div", {
1262
- key: `${i.start}-${i.title}`,
1463
+ j() ? (r(!0), c(ae, { key: 0 }, pe(Q.value, (_) => ot((r(), c("div", {
1464
+ key: `${_.start}-${_.title}`,
1263
1465
  class: "gvp-seek-chapter-tick",
1264
- style: re({ left: `${i.start / m.value * 100}%` })
1466
+ style: ce({ left: `${_.start / w.value * 100}%` })
1265
1467
  }, null, 4)), [
1266
- [ze, i.start > 0 && i.start < m.value]
1267
- ])), 128)) : M("", !0)
1468
+ [rt, _.start > 0 && _.start < w.value]
1469
+ ])), 128)) : x("", !0)
1268
1470
  ], 512),
1269
- D.value && p() ? (d(), f("div", {
1471
+ B.value && j() ? (r(), c("div", {
1270
1472
  key: 0,
1271
- class: w(["gvp-seek-preview", { "has-thumb": me.value }]),
1272
- style: re({ left: `${Pe.value}px` })
1473
+ class: L(["gvp-seek-preview", { "has-thumb": p.value }]),
1474
+ style: ce({ left: `${ee.value}px` })
1273
1475
  }, [
1274
- me.value && O.value ? (d(), f("div", {
1476
+ p.value && y.value ? (r(), c("div", {
1275
1477
  key: 0,
1276
1478
  class: "gvp-seek-preview-thumb",
1277
- style: re({
1278
- width: `${O.value.w}px`,
1279
- height: `${O.value.h}px`,
1280
- backgroundImage: `url(${JSON.stringify(O.value.url)})`,
1281
- backgroundPosition: `-${O.value.x}px -${O.value.y}px`
1479
+ style: ce({
1480
+ width: `${y.value.w}px`,
1481
+ height: `${y.value.h}px`,
1482
+ backgroundImage: `url(${JSON.stringify(y.value.url)})`,
1483
+ backgroundPosition: `-${y.value.x}px -${y.value.y}px`
1282
1484
  })
1283
- }, null, 4)) : M("", !0),
1284
- de.value ? (d(), f("span", Xt, U(de.value.title), 1)) : M("", !0),
1285
- r("span", Jt, U(te(Ae)(k.value)), 1)
1286
- ], 6)) : M("", !0),
1287
- r("input", {
1485
+ }, null, 4)) : x("", !0),
1486
+ Y.value ? (r(), c("span", Sn, Z(Y.value.title), 1)) : x("", !0),
1487
+ o("span", An, Z(se(_e)(D.value)), 1)
1488
+ ], 6)) : x("", !0),
1489
+ o("input", {
1288
1490
  type: "range",
1289
1491
  class: "gvp-seek-input",
1290
1492
  min: 0,
1291
1493
  max: 100,
1292
1494
  step: 0.1,
1293
- value: x(),
1294
- disabled: !p(),
1495
+ value: K(),
1496
+ disabled: !j(),
1295
1497
  "aria-label": "Seek",
1296
1498
  "aria-valuemin": 0,
1297
- "aria-valuemax": Math.floor(m.value),
1298
- "aria-valuenow": Math.floor(b.value),
1299
- onInput: Y
1300
- }, null, 40, Gt)
1301
- ], 32),
1302
- r("span", en, U(te(Ae)(b.value)) + " / " + U(te(Ae)(m.value)), 1),
1303
- r("div", {
1304
- ref_key: "speedRootEl",
1305
- ref: we,
1306
- class: "gvp-speed"
1307
- }, [
1308
- r("button", {
1499
+ "aria-valuemax": Math.floor(w.value),
1500
+ "aria-valuenow": Math.floor(P.value),
1501
+ "aria-valuetext": `${se(_e)(P.value)} of ${se(_e)(w.value)}`,
1502
+ onInput: C
1503
+ }, null, 40, Nn)
1504
+ ], 32)
1505
+ ]),
1506
+ o("div", Bn, [
1507
+ o("div", Hn, [
1508
+ o("button", {
1309
1509
  type: "button",
1310
- class: "gvp-ctrl-btn gvp-speed-btn",
1311
- "aria-haspopup": "listbox",
1312
- "aria-expanded": le.value,
1313
- "aria-label": `Playback speed: ${X.value === 1 ? "1×" : X.value + "×"}`,
1314
- onClick: s[3] || (s[3] = (i) => le.value = !le.value)
1510
+ class: "gvp-ctrl-btn",
1511
+ "aria-label": e.isPlaying ? "Pause" : "Play",
1512
+ "aria-pressed": e.isPlaying,
1513
+ onClick: b[0] || (b[0] = //@ts-ignore
1514
+ (..._) => e.onTogglePlay && e.onTogglePlay(..._))
1315
1515
  }, [
1316
- Z(Oe),
1317
- r("span", nn, U(X.value === 1 ? "1×" : `${X.value}×`), 1)
1318
- ], 8, tn),
1319
- le.value ? (d(), f("ul", ln, [
1320
- (d(), f(ie, null, ue(c, (i) => r("li", { key: i }, [
1321
- r("button", {
1322
- type: "button",
1323
- role: "option",
1324
- "aria-selected": i === X.value,
1325
- class: w(["gvp-speed-menu-item", { "is-active": i === X.value }]),
1326
- onClick: (L) => Ie(i)
1327
- }, U(i === 1 ? "Normal" : `${i}×`), 11, an)
1328
- ])), 64))
1329
- ])) : M("", !0)
1330
- ], 512),
1331
- he.value ? (d(), f("div", {
1332
- key: 2,
1333
- ref_key: "qualityRootEl",
1334
- ref: Q,
1335
- class: "gvp-quality"
1336
- }, [
1337
- r("button", {
1516
+ e.isPlaying ? (r(), J(Ht, { key: 0 })) : (r(), J(Rt, { key: 1 }))
1517
+ ], 8, Vn),
1518
+ e.hasPrev || e.hasNext ? (r(), c("button", {
1519
+ key: 0,
1338
1520
  type: "button",
1339
- class: "gvp-ctrl-btn gvp-quality-btn",
1340
- "aria-haspopup": "listbox",
1341
- "aria-expanded": ae.value,
1342
- "aria-label": `Quality: ${Ce.value}`,
1343
- onClick: s[4] || (s[4] = (i) => ae.value = !ae.value)
1521
+ class: "gvp-ctrl-btn",
1522
+ "aria-label": "Previous video",
1523
+ disabled: !e.hasPrev,
1524
+ onClick: b[1] || (b[1] = (_) => v("prev"))
1344
1525
  }, [
1345
- Z(Ht),
1346
- r("span", sn, U(Ce.value), 1)
1347
- ], 8, on),
1348
- ae.value ? (d(), f("ul", rn, [
1349
- r("li", null, [
1350
- r("button", {
1351
- type: "button",
1352
- role: "option",
1353
- "aria-selected": t.selectedLevel < 0,
1354
- class: w(["gvp-quality-menu-item", { "is-active": t.selectedLevel < 0 }]),
1355
- onClick: s[5] || (s[5] = (i) => se(te(Ke).index))
1356
- }, U(ve.value ? `Auto (${ve.value.label})` : "Auto"), 11, un)
1357
- ]),
1358
- (d(!0), f(ie, null, ue(be.value, (i) => (d(), f("li", {
1359
- key: i.index
1360
- }, [
1361
- r("button", {
1362
- type: "button",
1363
- role: "option",
1364
- "aria-selected": i.index === t.selectedLevel,
1365
- class: w(["gvp-quality-menu-item", { "is-active": i.index === t.selectedLevel }]),
1366
- onClick: (L) => se(i.index)
1367
- }, U(i.label), 11, cn)
1368
- ]))), 128))
1369
- ])) : M("", !0)
1370
- ], 512)) : M("", !0),
1371
- pe.value.length > 0 ? (d(), f("div", {
1372
- key: 3,
1373
- ref_key: "captionsRootEl",
1374
- ref: xe,
1375
- class: "gvp-captions"
1376
- }, [
1377
- r("button", {
1526
+ O(Ft)
1527
+ ], 8, Rn)) : x("", !0),
1528
+ e.hasPrev || e.hasNext ? (r(), c("button", {
1529
+ key: 1,
1378
1530
  type: "button",
1379
- class: w(["gvp-ctrl-btn", W.value >= 0 && "is-active"]),
1380
- "aria-haspopup": "listbox",
1381
- "aria-expanded": G.value,
1382
- "aria-label": "Captions",
1383
- "aria-pressed": W.value >= 0,
1384
- onClick: s[6] || (s[6] = (i) => G.value = !G.value)
1531
+ class: "gvp-ctrl-btn",
1532
+ "aria-label": "Next video",
1533
+ disabled: !e.hasNext,
1534
+ onClick: b[2] || (b[2] = (_) => v("next"))
1385
1535
  }, [
1386
- Z(Ue)
1387
- ], 10, dn),
1388
- G.value ? (d(), f("ul", vn, [
1389
- r("li", null, [
1390
- r("button", {
1391
- type: "button",
1392
- role: "option",
1393
- "aria-selected": W.value === -1,
1394
- class: w(["gvp-captions-menu-item", { "is-active": W.value === -1 }]),
1395
- onClick: u
1396
- }, "Off", 10, pn)
1397
- ]),
1398
- (d(!0), f(ie, null, ue(pe.value, (i) => (d(), f("li", {
1399
- key: i.index
1536
+ O(Ot)
1537
+ ], 8, Dn)) : x("", !0),
1538
+ o("div", {
1539
+ class: L(["gvp-volume", !se(t) && "is-expandable"])
1540
+ }, [
1541
+ o("button", {
1542
+ type: "button",
1543
+ class: "gvp-ctrl-btn",
1544
+ "aria-label": G.value ? "Unmute" : "Mute",
1545
+ "aria-pressed": G.value,
1546
+ onClick: ge
1400
1547
  }, [
1401
- r("button", {
1402
- type: "button",
1403
- role: "option",
1404
- "aria-selected": i.index === W.value,
1405
- class: w(["gvp-captions-menu-item", { "is-active": i.index === W.value }]),
1406
- onClick: (L) => Le(i.index)
1407
- }, U(i.label), 11, fn)
1408
- ]))), 128))
1409
- ])) : M("", !0)
1410
- ], 512)) : M("", !0),
1411
- r("div", {
1412
- class: w(["gvp-volume", !te(n) && "is-expandable"])
1413
- }, [
1414
- r("button", {
1548
+ G.value || X.value === 0 ? (r(), J(Kt, { key: 0 })) : X.value < 0.5 ? (r(), J(zt, { key: 1 })) : (r(), J(Ut, { key: 2 }))
1549
+ ], 8, Fn),
1550
+ se(t) ? x("", !0) : (r(), c("div", qn, [
1551
+ o("div", On, [
1552
+ o("div", {
1553
+ class: "gvp-volume-fill",
1554
+ style: ce({ width: `${G.value ? 0 : Math.round(X.value * 100)}%` })
1555
+ }, null, 4)
1556
+ ]),
1557
+ o("input", {
1558
+ type: "range",
1559
+ class: "gvp-volume-input",
1560
+ min: 0,
1561
+ max: 100,
1562
+ step: 1,
1563
+ value: G.value ? 0 : Math.round(X.value * 100),
1564
+ "aria-label": "Volume",
1565
+ "aria-valuemin": 0,
1566
+ "aria-valuemax": 100,
1567
+ "aria-valuenow": G.value ? 0 : Math.round(X.value * 100),
1568
+ "aria-valuetext": `${G.value ? 0 : Math.round(X.value * 100)}%`,
1569
+ onInput: ue
1570
+ }, null, 40, jn)
1571
+ ]))
1572
+ ], 2),
1573
+ M.value ? x("", !0) : (r(), c("span", Un, Z(se(_e)(P.value)) + " / " + Z(se(_e)(w.value)), 1)),
1574
+ M.value ? (r(), c("button", {
1575
+ key: 3,
1415
1576
  type: "button",
1416
- class: "gvp-ctrl-btn",
1417
- "aria-label": q.value ? "Unmute" : "Mute",
1418
- "aria-pressed": q.value,
1419
- onClick: Me
1577
+ class: L(["gvp-live", { "is-at-edge": f.value }]),
1578
+ disabled: f.value,
1579
+ "aria-label": f.value ? "Live" : "Go to live edge",
1580
+ onClick: z
1581
+ }, [...b[5] || (b[5] = [
1582
+ o("span", { class: "gvp-live-dot" }, null, -1),
1583
+ o("span", null, "LIVE", -1)
1584
+ ])], 10, Zn)) : x("", !0)
1585
+ ]),
1586
+ o("div", zn, [
1587
+ O(Ln, {
1588
+ video: e.video,
1589
+ "quality-levels": e.qualityLevels,
1590
+ "current-level": e.currentLevel,
1591
+ "selected-level": e.selectedLevel,
1592
+ "audio-tracks": e.audioTracks,
1593
+ "audio-track-index": e.audioTrackIndex,
1594
+ onSelectLevel: b[3] || (b[3] = (_) => v("select-level", _)),
1595
+ onSelectAudioTrack: b[4] || (b[4] = (_) => v("select-audio-track", _))
1596
+ }, null, 8, ["video", "quality-levels", "current-level", "selected-level", "audio-tracks", "audio-track-index"]),
1597
+ se(Ie) ? (r(), c("button", {
1598
+ key: 0,
1599
+ type: "button",
1600
+ class: L(["gvp-ctrl-btn", me.value && "is-active"]),
1601
+ "aria-label": me.value ? "Exit picture-in-picture" : "Picture-in-picture",
1602
+ "aria-pressed": me.value,
1603
+ onClick: Se
1420
1604
  }, [
1421
- q.value || K.value === 0 ? (d(), z(Nt, { key: 0 })) : K.value < 0.5 ? (d(), z(It, { key: 1 })) : (d(), z(Mt, { key: 2 }))
1422
- ], 8, mn),
1423
- te(n) ? M("", !0) : (d(), f("div", hn, [
1424
- r("div", gn, [
1425
- r("div", {
1426
- class: "gvp-volume-fill",
1427
- style: re({ width: `${q.value ? 0 : Math.round(K.value * 100)}%` })
1428
- }, null, 4)
1429
- ]),
1430
- r("input", {
1431
- type: "range",
1432
- class: "gvp-volume-input",
1433
- min: 0,
1434
- max: 100,
1435
- step: 1,
1436
- value: q.value ? 0 : Math.round(K.value * 100),
1437
- "aria-label": "Volume",
1438
- "aria-valuemin": 0,
1439
- "aria-valuemax": 100,
1440
- "aria-valuenow": q.value ? 0 : Math.round(K.value * 100),
1441
- onInput: Te
1442
- }, null, 40, kn)
1443
- ]))
1444
- ], 2),
1445
- te(P) ? (d(), f("button", {
1446
- key: 4,
1447
- type: "button",
1448
- class: w(["gvp-ctrl-btn", v.value && "is-active"]),
1449
- "aria-label": v.value ? "Exit picture-in-picture" : "Picture-in-picture",
1450
- "aria-pressed": v.value,
1451
- onClick: fe
1452
- }, [
1453
- Z(Ze)
1454
- ], 10, yn)) : M("", !0),
1455
- te(Qe) ? (d(), f("button", {
1456
- key: 5,
1457
- type: "button",
1458
- class: w(["gvp-ctrl-btn", j.value && "is-active"]),
1459
- "aria-label": j.value ? "Exit fullscreen" : "Enter fullscreen",
1460
- "aria-pressed": j.value,
1461
- onClick: je
1462
- }, [
1463
- j.value ? (d(), z(Ft, { key: 0 })) : (d(), z(qt, { key: 1 }))
1464
- ], 10, wn)) : M("", !0)
1605
+ O(ze)
1606
+ ], 10, Wn)) : x("", !0),
1607
+ se(Ne) ? (r(), c("button", {
1608
+ key: 1,
1609
+ type: "button",
1610
+ class: L(["gvp-ctrl-btn", de.value && "is-active"]),
1611
+ "aria-label": de.value ? "Exit fullscreen" : "Enter fullscreen",
1612
+ "aria-pressed": de.value,
1613
+ onClick: Ae
1614
+ }, [
1615
+ de.value ? (r(), J(Xt, { key: 0 })) : (r(), J(Gt, { key: 1 }))
1616
+ ], 10, Kn)) : x("", !0)
1617
+ ])
1465
1618
  ])
1466
1619
  ], 34));
1467
1620
  }
1468
- }), xn = { name: "IconDesktop" }, Ln = /* @__PURE__ */ I({
1469
- ...xn,
1621
+ }), Jn = { name: "IconDesktop" }, Xn = /* @__PURE__ */ N({
1622
+ ...Jn,
1470
1623
  props: {
1471
1624
  class: {}
1472
1625
  },
1473
- setup(t) {
1474
- const a = t;
1475
- return (n, e) => (d(), f("svg", {
1476
- class: w(["gvp-icon", a.class]),
1626
+ setup(e) {
1627
+ const l = e;
1628
+ return (t, n) => (r(), c("svg", {
1629
+ class: L(["gvp-icon", l.class]),
1477
1630
  width: "20",
1478
1631
  height: "20",
1479
1632
  viewBox: "0 0 24 24",
1480
1633
  fill: "none",
1481
1634
  xmlns: "http://www.w3.org/2000/svg",
1482
1635
  "aria-hidden": "true"
1483
- }, [...e[0] || (e[0] = [
1484
- r("path", {
1636
+ }, [...n[0] || (n[0] = [
1637
+ o("path", {
1485
1638
  d: "M14 2H10C6.72077 2 5.08116 2 3.91891 2.81382C3.48891 3.1149 3.1149 3.48891 2.81382 3.91891C2 5.08116 2 6.72077 2 10C2 13.2792 2 14.9188 2.81382 16.0811C3.1149 16.5111 3.48891 16.8851 3.91891 17.1862C5.08116 18 6.72077 18 10 18H14C17.2792 18 18.9188 18 20.0811 17.1862C20.5111 16.8851 20.8851 16.5111 21.1862 16.0811C22 14.9188 22 13.2792 22 10C22 6.72077 22 5.08116 21.1862 3.91891C20.8851 3.48891 20.5111 3.1149 20.0811 2.81382C18.9188 2 17.2792 2 14 2Z",
1486
1639
  stroke: "currentColor",
1487
1640
  "stroke-width": "1.5",
1488
1641
  "stroke-linecap": "round"
1489
1642
  }, null, -1),
1490
- r("path", {
1643
+ o("path", {
1491
1644
  d: "M11 15H13",
1492
1645
  stroke: "currentColor",
1493
1646
  "stroke-width": "1.5",
1494
1647
  "stroke-linecap": "round",
1495
1648
  "stroke-linejoin": "round"
1496
1649
  }, null, -1),
1497
- r("path", {
1650
+ o("path", {
1498
1651
  d: "M14.5 22L14.1845 21.5811C13.4733 20.6369 13.2969 19.1944 13.7468 18M9.5 22L9.8155 21.5811C10.5267 20.6369 10.7031 19.1944 10.2532 18",
1499
1652
  stroke: "currentColor",
1500
1653
  "stroke-width": "1.5",
1501
1654
  "stroke-linecap": "round"
1502
1655
  }, null, -1),
1503
- r("path", {
1656
+ o("path", {
1504
1657
  d: "M7 22H17",
1505
1658
  stroke: "currentColor",
1506
1659
  "stroke-width": "1.5",
@@ -1508,36 +1661,36 @@ const Wt = { class: "gvp-controls-row" }, zt = ["disabled"], Yt = ["aria-label",
1508
1661
  }, null, -1)
1509
1662
  ])], 2));
1510
1663
  }
1511
- }), En = { name: "IconMobile" }, _n = /* @__PURE__ */ I({
1512
- ...En,
1664
+ }), el = { name: "IconMobile" }, tl = /* @__PURE__ */ N({
1665
+ ...el,
1513
1666
  props: {
1514
1667
  class: {}
1515
1668
  },
1516
- setup(t) {
1517
- const a = t;
1518
- return (n, e) => (d(), f("svg", {
1519
- class: w(["gvp-icon", a.class]),
1669
+ setup(e) {
1670
+ const l = e;
1671
+ return (t, n) => (r(), c("svg", {
1672
+ class: L(["gvp-icon", l.class]),
1520
1673
  width: "20",
1521
1674
  height: "20",
1522
1675
  viewBox: "0 0 24 24",
1523
1676
  fill: "none",
1524
1677
  xmlns: "http://www.w3.org/2000/svg",
1525
1678
  "aria-hidden": "true"
1526
- }, [...e[0] || (e[0] = [
1527
- r("path", {
1679
+ }, [...n[0] || (n[0] = [
1680
+ o("path", {
1528
1681
  d: "M5 9C5 5.70017 5 4.05025 6.02513 3.02513C7.05025 2 8.70017 2 12 2C15.2998 2 16.9497 2 17.9749 3.02513C19 4.05025 19 5.70017 19 9V15C19 18.2998 19 19.9497 17.9749 20.9749C16.9497 22 15.2998 22 12 22C8.70017 22 7.05025 22 6.02513 20.9749C5 19.9497 5 18.2998 5 15V9Z",
1529
1682
  stroke: "currentColor",
1530
1683
  "stroke-width": "2",
1531
1684
  "stroke-linecap": "round"
1532
1685
  }, null, -1),
1533
- r("path", {
1686
+ o("path", {
1534
1687
  d: "M11 19H13",
1535
1688
  stroke: "currentColor",
1536
1689
  "stroke-width": "2",
1537
1690
  "stroke-linecap": "round",
1538
1691
  "stroke-linejoin": "round"
1539
1692
  }, null, -1),
1540
- r("path", {
1693
+ o("path", {
1541
1694
  d: "M9 2L9.089 2.53402C9.28188 3.69129 9.37832 4.26993 9.77519 4.62204C10.1892 4.98934 10.7761 5 12 5C13.2239 5 13.8108 4.98934 14.2248 4.62204C14.6217 4.26993 14.7181 3.69129 14.911 2.53402L15 2",
1542
1695
  stroke: "currentColor",
1543
1696
  "stroke-width": "2",
@@ -1545,121 +1698,270 @@ const Wt = { class: "gvp-controls-row" }, zt = ["disabled"], Yt = ["aria-label",
1545
1698
  }, null, -1)
1546
1699
  ])], 2));
1547
1700
  }
1548
- }), $n = { name: "IconPlay" }, Pn = /* @__PURE__ */ I({
1549
- ...$n,
1701
+ }), nl = { name: "IconPlay" }, ll = /* @__PURE__ */ N({
1702
+ ...nl,
1550
1703
  props: {
1551
1704
  class: {}
1552
1705
  },
1553
- setup(t) {
1554
- const a = t;
1555
- return (n, e) => (d(), f("svg", {
1556
- class: w(["gvp-icon", a.class]),
1706
+ setup(e) {
1707
+ const l = e;
1708
+ return (t, n) => (r(), c("svg", {
1709
+ class: L(["gvp-icon", l.class]),
1557
1710
  width: "22",
1558
1711
  height: "22",
1559
1712
  viewBox: "0 0 16 16",
1560
1713
  fill: "none",
1561
1714
  xmlns: "http://www.w3.org/2000/svg",
1562
1715
  "aria-hidden": "true"
1563
- }, [...e[0] || (e[0] = [
1564
- r("path", {
1716
+ }, [...n[0] || (n[0] = [
1717
+ o("path", {
1565
1718
  d: "M5.3335 11.45V4.54997C5.3335 4.36108 5.40016 4.20275 5.5335 4.07497C5.66683 3.94719 5.82238 3.8833 6.00016 3.8833C6.05572 3.8833 6.11405 3.89163 6.17516 3.9083C6.23627 3.92497 6.29461 3.94997 6.35016 3.9833L11.7835 7.4333C11.8835 7.49997 11.9585 7.5833 12.0085 7.6833C12.0585 7.7833 12.0835 7.88886 12.0835 7.99997C12.0835 8.11108 12.0585 8.21663 12.0085 8.31663C11.9585 8.41663 11.8835 8.49997 11.7835 8.56663L6.35016 12.0166C6.29461 12.05 6.23627 12.075 6.17516 12.0916C6.11405 12.1083 6.05572 12.1166 6.00016 12.1166C5.82238 12.1166 5.66683 12.0527 5.5335 11.925C5.40016 11.7972 5.3335 11.6389 5.3335 11.45Z",
1566
1719
  fill: "currentColor"
1567
1720
  }, null, -1)
1568
1721
  ])], 2));
1569
1722
  }
1570
- }), Mn = { name: "IconX" }, Tn = /* @__PURE__ */ I({
1571
- ...Mn,
1723
+ }), sl = { name: "IconX" }, Oe = /* @__PURE__ */ N({
1724
+ ...sl,
1572
1725
  props: {
1573
1726
  class: {}
1574
1727
  },
1575
- setup(t) {
1576
- const a = t;
1577
- return (n, e) => (d(), f("svg", {
1578
- class: w(["gvp-icon", a.class]),
1728
+ setup(e) {
1729
+ const l = e;
1730
+ return (t, n) => (r(), c("svg", {
1731
+ class: L(["gvp-icon", l.class]),
1579
1732
  width: "14",
1580
1733
  height: "14",
1581
1734
  viewBox: "0 0 14 14",
1582
1735
  fill: "none",
1583
1736
  xmlns: "http://www.w3.org/2000/svg",
1584
1737
  "aria-hidden": "true"
1585
- }, [...e[0] || (e[0] = [
1586
- r("path", {
1738
+ }, [...n[0] || (n[0] = [
1739
+ o("path", {
1587
1740
  d: "M6.94994 5.53594L12.1929 0.292938C12.5834 -0.0975275 13.2165 -0.0975279 13.6069 0.292938C13.9974 0.683403 13.9974 1.31647 13.6069 1.70694L8.36394 6.94994L13.6069 12.1929C13.9974 12.5834 13.9974 13.2165 13.6069 13.6069C13.2165 13.9974 12.5834 13.9974 12.1929 13.6069L6.94994 8.36394L1.70694 13.6069C1.31647 13.9974 0.683403 13.9974 0.292938 13.6069C-0.0975279 13.2165 -0.0975277 12.5834 0.292938 12.1929L5.53594 6.94994L0.292938 1.70694C-0.0975279 1.31647 -0.0975279 0.683403 0.292938 0.292938C0.683403 -0.0975279 1.31647 -0.0975277 1.70694 0.292938L6.94994 5.53594Z",
1588
1741
  fill: "currentColor"
1589
1742
  }, null, -1)
1590
1743
  ])], 2));
1591
1744
  }
1745
+ }), al = { name: "IconAlert" }, ol = /* @__PURE__ */ N({
1746
+ ...al,
1747
+ props: {
1748
+ class: {}
1749
+ },
1750
+ setup(e) {
1751
+ const l = e;
1752
+ return (t, n) => (r(), c("svg", {
1753
+ class: L(["gvp-icon", l.class]),
1754
+ width: "32",
1755
+ height: "32",
1756
+ viewBox: "0 0 24 24",
1757
+ fill: "none",
1758
+ xmlns: "http://www.w3.org/2000/svg",
1759
+ "aria-hidden": "true"
1760
+ }, [...n[0] || (n[0] = [
1761
+ o("path", {
1762
+ d: "M12 9V13M12 17H12.01M10.29 3.86L1.82 18A2 2 0 0 0 3.53 21H20.47A2 2 0 0 0 22.18 18L13.71 3.86A2 2 0 0 0 10.29 3.86Z",
1763
+ stroke: "currentColor",
1764
+ "stroke-width": "2",
1765
+ "stroke-linecap": "round",
1766
+ "stroke-linejoin": "round"
1767
+ }, null, -1)
1768
+ ])], 2));
1769
+ }
1770
+ }), rl = { name: "IconRefresh" }, il = /* @__PURE__ */ N({
1771
+ ...rl,
1772
+ props: {
1773
+ class: {}
1774
+ },
1775
+ setup(e) {
1776
+ const l = e;
1777
+ return (t, n) => (r(), c("svg", {
1778
+ class: L(["gvp-icon", l.class]),
1779
+ width: "16",
1780
+ height: "16",
1781
+ viewBox: "0 0 24 24",
1782
+ fill: "none",
1783
+ xmlns: "http://www.w3.org/2000/svg",
1784
+ "aria-hidden": "true"
1785
+ }, [...n[0] || (n[0] = [
1786
+ o("path", {
1787
+ d: "M21 12A9 9 0 1 1 18.36 5.64M21 3V9H15",
1788
+ stroke: "currentColor",
1789
+ "stroke-width": "2",
1790
+ "stroke-linecap": "round",
1791
+ "stroke-linejoin": "round"
1792
+ }, null, -1)
1793
+ ])], 2));
1794
+ }
1592
1795
  });
1593
- function In(t) {
1594
- if (!t) return null;
1595
- if (/^[A-Za-z0-9_-]{11}$/.test(t)) return t;
1596
- let a;
1796
+ function ul(e) {
1797
+ if (!e) return null;
1798
+ if (/^[A-Za-z0-9_-]{11}$/.test(e)) return e;
1799
+ let l;
1597
1800
  try {
1598
- a = new URL(t);
1801
+ l = new URL(e);
1599
1802
  } catch {
1600
1803
  return null;
1601
1804
  }
1602
- const n = a.hostname.replace(/^www\./, "");
1603
- if (n === "youtu.be") {
1604
- const e = a.pathname.slice(1).split("/")[0];
1605
- return /^[A-Za-z0-9_-]{11}$/.test(e) ? e : null;
1805
+ const t = l.hostname.replace(/^www\./, "");
1806
+ if (t === "youtu.be") {
1807
+ const n = l.pathname.slice(1).split("/")[0];
1808
+ return /^[A-Za-z0-9_-]{11}$/.test(n) ? n : null;
1606
1809
  }
1607
- if (n === "youtube.com" || n === "m.youtube.com" || n === "music.youtube.com" || n === "youtube-nocookie.com") {
1608
- const e = a.searchParams.get("v");
1609
- if (e && /^[A-Za-z0-9_-]{11}$/.test(e)) return e;
1610
- const c = /^\/(?:embed|shorts|v|live)\/([A-Za-z0-9_-]{11})/.exec(
1611
- a.pathname
1810
+ if (t === "youtube.com" || t === "m.youtube.com" || t === "music.youtube.com" || t === "youtube-nocookie.com") {
1811
+ const n = l.searchParams.get("v");
1812
+ if (n && /^[A-Za-z0-9_-]{11}$/.test(n)) return n;
1813
+ const a = /^\/(?:embed|shorts|v|live)\/([A-Za-z0-9_-]{11})/.exec(
1814
+ l.pathname
1612
1815
  );
1613
- if (c) return c[1];
1816
+ if (a) return a[1];
1614
1817
  }
1615
1818
  return null;
1616
1819
  }
1617
- function Sn(t) {
1820
+ function cl(e) {
1618
1821
  try {
1619
- const a = new URL(t), n = a.searchParams.get("t") ?? a.searchParams.get("start");
1620
- if (!n) return null;
1621
- if (/^\d+s?$/.test(n)) return Number.parseInt(n, 10);
1622
- const e = /^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/.exec(n);
1623
- if (e) {
1624
- const c = Number.parseInt(e[1] ?? "0", 10), o = Number.parseInt(e[2] ?? "0", 10), h = Number.parseInt(e[3] ?? "0", 10), g = c * 3600 + o * 60 + h;
1625
- return g > 0 ? g : null;
1822
+ const l = new URL(e), t = l.searchParams.get("t") ?? l.searchParams.get("start");
1823
+ if (!t) return null;
1824
+ if (/^\d+s?$/.test(t)) return Number.parseInt(t, 10);
1825
+ const n = /^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/.exec(t);
1826
+ if (n) {
1827
+ const a = Number.parseInt(n[1] ?? "0", 10), v = Number.parseInt(n[2] ?? "0", 10), d = Number.parseInt(n[3] ?? "0", 10), h = a * 3600 + v * 60 + d;
1828
+ return h > 0 ? h : null;
1626
1829
  }
1627
1830
  } catch {
1628
1831
  }
1629
1832
  return null;
1630
1833
  }
1631
- function Nn(t, a = {}) {
1834
+ function dl(e, l = {}) {
1632
1835
  const {
1633
- autoPlay: n = !1,
1634
- muted: e = !0,
1635
- loop: c = !1,
1636
- controls: o = !0,
1637
- startSeconds: h
1638
- } = a, g = new URLSearchParams({
1836
+ autoPlay: t = !1,
1837
+ muted: n = !0,
1838
+ loop: a = !1,
1839
+ controls: v = !0,
1840
+ startSeconds: d
1841
+ } = l, h = new URLSearchParams({
1639
1842
  rel: "0",
1640
1843
  modestbranding: "1",
1641
1844
  playsinline: "1",
1642
- controls: o ? "1" : "0"
1845
+ controls: v ? "1" : "0"
1643
1846
  });
1644
- return n ? (g.set("autoplay", "1"), g.set("mute", "1")) : e && g.set("mute", "1"), c && (g.set("loop", "1"), g.set("playlist", t)), h && h > 0 && g.set("start", String(h)), `https://www.youtube-nocookie.com/embed/${t}?${g.toString()}`;
1847
+ return t ? (h.set("autoplay", "1"), h.set("mute", "1")) : n && h.set("mute", "1"), a && (h.set("loop", "1"), h.set("playlist", e)), d && d > 0 && h.set("start", String(d)), `https://www.youtube-nocookie.com/embed/${e}?${h.toString()}`;
1645
1848
  }
1646
- const An = ["src"], Hn = {
1647
- key: 2,
1648
- class: "gvp-vignette"
1649
- }, Bn = {
1849
+ const vl = "gvp:prefs:";
1850
+ function We(e) {
1851
+ return vl + e;
1852
+ }
1853
+ function Me(e) {
1854
+ if (typeof localStorage > "u") return {};
1855
+ try {
1856
+ const l = localStorage.getItem(We(e));
1857
+ if (!l) return {};
1858
+ const t = JSON.parse(l);
1859
+ return typeof t == "object" && t !== null ? t : {};
1860
+ } catch {
1861
+ return {};
1862
+ }
1863
+ }
1864
+ function Ke(e, l) {
1865
+ if (!(typeof localStorage > "u"))
1866
+ try {
1867
+ const n = { ...Me(e), ...l };
1868
+ localStorage.setItem(We(e), JSON.stringify(n));
1869
+ } catch {
1870
+ }
1871
+ }
1872
+ function je(e, l, t) {
1873
+ if (typeof localStorage > "u" || !l) return;
1874
+ const a = { ...Me(e).positions };
1875
+ t > 0 ? a[l] = t : delete a[l], Ke(e, { positions: a });
1876
+ }
1877
+ function pl(e, l) {
1878
+ var a;
1879
+ const n = (a = Me(e).positions) == null ? void 0 : a[l];
1880
+ return typeof n == "number" && n > 0 ? n : 0;
1881
+ }
1882
+ function fl(e) {
1883
+ const l = e.trim().replace(/^#/, "");
1884
+ if (/^[0-9a-f]{3}$/i.test(l))
1885
+ return [
1886
+ parseInt(l[0] + l[0], 16),
1887
+ parseInt(l[1] + l[1], 16),
1888
+ parseInt(l[2] + l[2], 16)
1889
+ ];
1890
+ if (/^[0-9a-f]{6}$/i.test(l))
1891
+ return [
1892
+ parseInt(l.slice(0, 2), 16),
1893
+ parseInt(l.slice(2, 4), 16),
1894
+ parseInt(l.slice(4, 6), 16)
1895
+ ];
1896
+ const t = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e);
1897
+ return t ? [Number(t[1]), Number(t[2]), Number(t[3])] : null;
1898
+ }
1899
+ function ml(e, l) {
1900
+ const t = fl(e);
1901
+ return t ? `rgba(${t[0]}, ${t[1]}, ${t[2]}, ${l})` : e;
1902
+ }
1903
+ function gl(e, l) {
1904
+ if (!l) return "";
1905
+ const t = [];
1906
+ if (l.fontSize && t.push(`font-size: ${l.fontSize};`), l.textColor && t.push(`color: ${l.textColor};`), l.backgroundColor) {
1907
+ const n = typeof l.backgroundOpacity == "number" ? ml(l.backgroundColor, l.backgroundOpacity) : l.backgroundColor;
1908
+ t.push(`background-color: ${n};`);
1909
+ } else typeof l.backgroundOpacity == "number" && t.push(`background-color: rgba(0, 0, 0, ${l.backgroundOpacity});`);
1910
+ return t.length === 0 ? "" : `.${e}::cue { ${t.join(" ")} }`;
1911
+ }
1912
+ function hl(e) {
1913
+ const l = e.trim().replace(/^#/, "");
1914
+ if (/^[0-9a-f]{3}$/i.test(l)) {
1915
+ const n = parseInt(l[0] + l[0], 16), a = parseInt(l[1] + l[1], 16), v = parseInt(l[2] + l[2], 16);
1916
+ return `${n} ${a} ${v}`;
1917
+ }
1918
+ if (/^[0-9a-f]{6}$/i.test(l)) {
1919
+ const n = parseInt(l.slice(0, 2), 16), a = parseInt(l.slice(2, 4), 16), v = parseInt(l.slice(4, 6), 16);
1920
+ return `${n} ${a} ${v}`;
1921
+ }
1922
+ const t = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e);
1923
+ return t ? `${t[1]} ${t[2]} ${t[3]}` : null;
1924
+ }
1925
+ function kl(e) {
1926
+ if (!e) return {};
1927
+ const l = {};
1928
+ if (e.accent) {
1929
+ const t = hl(e.accent);
1930
+ t ? l["--gvp-accent-rgb"] = t : l["--gvp-accent"] = e.accent;
1931
+ }
1932
+ return e.radius && (l["--gvp-radius"] = e.radius), l;
1933
+ }
1934
+ const yl = ["src"], bl = {
1650
1935
  key: 3,
1936
+ class: "gvp-vignette"
1937
+ }, wl = {
1938
+ key: 4,
1939
+ class: "gvp-sr-only",
1940
+ role: "status",
1941
+ "aria-live": "polite"
1942
+ }, xl = {
1943
+ key: 5,
1944
+ class: "gvp-loading",
1945
+ role: "status",
1946
+ "aria-live": "polite"
1947
+ }, Cl = {
1948
+ key: 6,
1949
+ class: "gvp-error",
1950
+ role: "alert"
1951
+ }, Ll = {
1952
+ key: 7,
1651
1953
  class: "gvp-toggle"
1652
- }, Vn = { class: "gvp-toggle-pill" }, qn = ["aria-pressed"], Dn = ["aria-pressed"], Fn = ["aria-label", "aria-pressed"], Rn = ["aria-label"], On = {
1653
- key: 10,
1954
+ }, $l = { class: "gvp-toggle-pill" }, El = ["aria-pressed"], _l = ["aria-pressed"], Pl = ["aria-label", "aria-pressed"], Tl = ["aria-label"], Ml = {
1955
+ key: 14,
1654
1956
  class: "gvp-play-wrap"
1655
- }, Un = {
1957
+ }, Il = {
1656
1958
  key: 0,
1657
1959
  class: "gvp-tooltip",
1658
1960
  role: "tooltip"
1659
- }, Zn = {
1660
- key: 12,
1961
+ }, Sl = {
1962
+ key: 16,
1661
1963
  class: "gvp-bottom-fade"
1662
- }, Wn = /* @__PURE__ */ I({
1964
+ }, Bl = /* @__PURE__ */ N({
1663
1965
  __name: "VideoPlayer",
1664
1966
  props: {
1665
1967
  src: {},
@@ -1681,358 +1983,541 @@ const An = ["src"], Hn = {
1681
1983
  isHls: { type: Boolean },
1682
1984
  thumbnails: {},
1683
1985
  chapters: {},
1986
+ persistKey: {},
1987
+ captionStyle: {},
1988
+ theme: {},
1989
+ miniPlayer: { type: Boolean, default: !1 },
1990
+ miniPlayerPosition: { default: "bottom-right" },
1991
+ ambientMode: { type: Boolean, default: !1 },
1684
1992
  class: { default: "" },
1685
1993
  closable: { type: Boolean, default: !1 }
1686
1994
  },
1687
1995
  emits: ["close", "play", "pause", "ended", "time-update", "seeked", "volume-change", "milestone", "error", "playlist-change"],
1688
- setup(t, { emit: a }) {
1689
- const n = t, e = a, c = y(null), o = y(n.defaultDevice), h = y(!1), g = y(!1), E = y(null), _ = y([]), $ = y(-1), S = y([]), b = y(-1), m = y(-1), C = y(1), p = y(!1), x = y(!1), B = y(null), Y = typeof document < "u" && !!document.pictureInPictureEnabled, A = T(
1690
- () => n.controls === !0 || n.controls === "custom"
1691
- ), J = T(() => n.controls === "native"), k = T(
1692
- () => Array.isArray(n.playlist) && n.playlist.length > 0
1693
- ), N = y(
1694
- k.value ? Math.min(Math.max(n.defaultIndex, 0), n.playlist.length - 1) : 0
1695
- ), D = T(
1696
- () => k.value ? n.playlist[Math.min(N.value, n.playlist.length - 1)] : null
1697
- ), H = T(() => {
1698
- var u;
1699
- return ((u = D.value) == null ? void 0 : u.src) ?? n.src ?? "";
1700
- }), V = T(() => {
1701
- var u;
1702
- return ((u = D.value) == null ? void 0 : u.poster) ?? n.poster;
1703
- }), O = T(
1996
+ setup(e, { emit: l }) {
1997
+ const t = e, n = l, a = g(null), v = g(t.defaultDevice), d = g(!1), h = g(!1), E = g(!1), S = g(!1), A = g(!1), P = g(0), w = g(null), $ = g([]), T = g(-1), f = g([]), M = g(-1), z = g(-1), j = g(1), K = g(!1), re = g(!1), C = g(null), W = typeof document < "u" && !!document.pictureInPictureEnabled, V = I(
1998
+ () => t.controls === !0 || t.controls === "custom"
1999
+ ), D = I(() => t.controls === "native"), F = `gvp-video-${Math.random().toString(36).slice(2, 10)}`, B = I(() => kl(t.theme)), R = g(!1), fe = g(!1), y = g(null);
2000
+ let p = null;
2001
+ H(y, (s) => {
2002
+ p == null || p.disconnect(), p = null, !(!t.miniPlayer || !s || typeof IntersectionObserver > "u") && (p = new IntersectionObserver(
2003
+ ([i]) => {
2004
+ i.isIntersecting ? (R.value = !1, fe.value = !1) : d.value && !fe.value && (R.value = !0);
2005
+ },
2006
+ { threshold: 0 }
2007
+ ), p.observe(s));
2008
+ }), H(d, (s) => {
2009
+ s || (R.value = !1);
2010
+ });
2011
+ function ee() {
2012
+ R.value = !1, fe.value = !0;
2013
+ }
2014
+ const m = g(null);
2015
+ let Q = 0;
2016
+ oe(() => {
2017
+ p == null || p.disconnect(), p = null, cancelAnimationFrame(Q);
2018
+ });
2019
+ let Y = null;
2020
+ H(
2021
+ () => t.captionStyle,
2022
+ (s) => {
2023
+ if (typeof document > "u") return;
2024
+ const i = gl(F, s);
2025
+ if (!i) {
2026
+ Y == null || Y.remove(), Y = null;
2027
+ return;
2028
+ }
2029
+ Y || (Y = document.createElement("style"), document.head.appendChild(Y)), Y.textContent = i;
2030
+ },
2031
+ { immediate: !0, deep: !0 }
2032
+ ), oe(() => {
2033
+ Y == null || Y.remove(), Y = null;
2034
+ });
2035
+ const X = I(
2036
+ () => Array.isArray(t.playlist) && t.playlist.length > 0
2037
+ ), G = g(
2038
+ X.value ? Math.min(Math.max(t.defaultIndex, 0), t.playlist.length - 1) : 0
2039
+ ), ge = I(
2040
+ () => X.value ? t.playlist[Math.min(G.value, t.playlist.length - 1)] : null
2041
+ ), ue = I(() => {
2042
+ var s;
2043
+ return ((s = ge.value) == null ? void 0 : s.src) ?? t.src ?? "";
2044
+ }), me = I(() => {
2045
+ var s;
2046
+ return ((s = ge.value) == null ? void 0 : s.poster) ?? t.poster;
2047
+ }), Ie = I(
1704
2048
  () => {
1705
- var u;
1706
- return ((u = D.value) == null ? void 0 : u.thumbnails) ?? n.thumbnails;
2049
+ var s;
2050
+ return ((s = ge.value) == null ? void 0 : s.thumbnails) ?? t.thumbnails;
1707
2051
  }
1708
- ), me = T(
2052
+ ), Se = I(
1709
2053
  () => {
1710
- var u;
1711
- return ((u = D.value) == null ? void 0 : u.chapters) ?? n.chapters;
2054
+ var s;
2055
+ return ((s = ge.value) == null ? void 0 : s.chapters) ?? t.chapters;
1712
2056
  }
1713
- ), Pe = T(() => k.value && N.value > 0), oe = T(
1714
- () => k.value && N.value < n.playlist.length - 1
2057
+ ), de = I(() => X.value && G.value > 0), Pe = I(
2058
+ () => X.value && G.value < t.playlist.length - 1
1715
2059
  );
1716
- let ce = !1;
1717
- function de(u, v = !1) {
1718
- if (!k.value) return;
1719
- const P = Math.min(Math.max(u, 0), n.playlist.length - 1);
1720
- P !== N.value && (ce = v, N.value = P, e("playlist-change", P, n.playlist[P]));
1721
- }
1722
- const K = T(() => In(H.value)), q = T(() => K.value !== null), Me = T(
1723
- () => K.value ? Nn(K.value, {
1724
- autoPlay: n.autoPlay,
1725
- muted: n.muted,
1726
- loop: n.loop,
1727
- controls: A.value ? !0 : J.value,
1728
- startSeconds: Sn(H.value)
2060
+ let xe = !1;
2061
+ function Ce(s, i = !1) {
2062
+ if (!X.value) return;
2063
+ const k = Math.min(Math.max(s, 0), t.playlist.length - 1);
2064
+ k !== G.value && (xe = i, G.value = k, n("playlist-change", k, t.playlist[k]));
2065
+ }
2066
+ const Le = I(() => ul(ue.value)), U = I(() => Le.value !== null), Ae = I(
2067
+ () => Le.value ? dl(Le.value, {
2068
+ autoPlay: t.autoPlay,
2069
+ muted: t.muted,
2070
+ loop: t.loop,
2071
+ controls: V.value ? !0 : D.value,
2072
+ startSeconds: cl(ue.value)
1729
2073
  }) : null
1730
2074
  );
1731
- function Te(u) {
1732
- _.value = u, $.value = -1;
2075
+ function Ne(s) {
2076
+ $.value = s, T.value = -1;
1733
2077
  }
1734
- function X(u) {
1735
- S.value = u, m.value = -1;
2078
+ function u(s) {
2079
+ f.value = s, z.value = -1;
1736
2080
  }
1737
- const le = T(
1738
- () => !q.value && _.value.length > 1
1739
- ), we = T(
2081
+ const b = I(
2082
+ () => !U.value && $.value.length > 1
2083
+ ), _ = I(
1740
2084
  () => {
1741
- var u;
1742
- return $.value >= 0 ? $.value : ((u = _.value[0]) == null ? void 0 : u.index) ?? -1;
2085
+ var s;
2086
+ return T.value >= 0 ? T.value : ((s = $.value[0]) == null ? void 0 : s.index) ?? -1;
1743
2087
  }
1744
- ), Ie = T(
2088
+ ), te = I(
1745
2089
  () => {
1746
- var u, v;
1747
- return o.value === "mobile" ? ((u = n.aspectRatio) == null ? void 0 : u.mobile) ?? "9/16" : ((v = n.aspectRatio) == null ? void 0 : v.desktop) ?? "16/9";
2090
+ var s, i;
2091
+ return v.value === "mobile" ? ((s = t.aspectRatio) == null ? void 0 : s.mobile) ?? "9/16" : ((i = t.aspectRatio) == null ? void 0 : i.desktop) ?? "16/9";
1748
2092
  }
1749
- ), ae = T(
2093
+ ), he = I(
1750
2094
  () => {
1751
- var u, v;
1752
- return o.value === "mobile" ? ((u = n.frameMaxWidth) == null ? void 0 : u.mobile) ?? "420px" : ((v = n.frameMaxWidth) == null ? void 0 : v.desktop) ?? "960px";
2095
+ var s, i;
2096
+ return v.value === "mobile" ? ((s = t.frameMaxWidth) == null ? void 0 : s.mobile) ?? "420px" : ((i = t.frameMaxWidth) == null ? void 0 : i.desktop) ?? "960px";
1753
2097
  }
1754
- ), Q = T(() => {
1755
- var u;
1756
- return ((u = c.value) == null ? void 0 : u.videoEl) ?? null;
2098
+ ), q = I(() => {
2099
+ var s;
2100
+ return ((s = a.value) == null ? void 0 : s.videoEl) ?? null;
2101
+ });
2102
+ H([m, q], ([s, i]) => {
2103
+ if (cancelAnimationFrame(Q), !t.ambientMode || !s || !i || U.value) return;
2104
+ const k = s.getContext("2d");
2105
+ if (!k) return;
2106
+ let ne = 0;
2107
+ const ie = ($e) => {
2108
+ if (Q = requestAnimationFrame(ie), !($e - ne < 250) && (ne = $e, !(i.readyState < 2 || i.paused)))
2109
+ try {
2110
+ k.drawImage(i, 0, 0, s.width, s.height);
2111
+ } catch {
2112
+ }
2113
+ };
2114
+ Q = requestAnimationFrame(ie);
1757
2115
  });
1758
- async function he() {
1759
- const u = Q.value;
1760
- if (u)
2116
+ async function ke() {
2117
+ const s = q.value;
2118
+ if (s)
1761
2119
  try {
1762
- u.readyState < 2 && u.load();
1763
- const v = u.play();
1764
- E.value = v, await v, h.value = !0;
2120
+ s.readyState < 2 && s.load();
2121
+ const i = s.play();
2122
+ w.value = i, await i, d.value = !0;
1765
2123
  } catch {
1766
- h.value = !1;
2124
+ d.value = !1;
1767
2125
  } finally {
1768
- E.value = null;
2126
+ w.value = null;
1769
2127
  }
1770
2128
  }
1771
- async function be() {
1772
- const u = Q.value;
1773
- if (u) {
1774
- if (E.value)
2129
+ async function ve() {
2130
+ const s = q.value;
2131
+ if (s) {
2132
+ if (w.value)
1775
2133
  try {
1776
- await E.value;
2134
+ await w.value;
1777
2135
  } catch {
1778
2136
  }
1779
- u.pause();
2137
+ s.pause();
1780
2138
  }
1781
2139
  }
1782
- async function ve() {
1783
- !n.hoverPlay || q.value || await he();
2140
+ async function Qe() {
2141
+ !t.hoverPlay || U.value || await ke();
1784
2142
  }
1785
- async function Ce() {
1786
- !n.hoverPlay || q.value || (await be(), h.value = !1);
2143
+ async function Ye() {
2144
+ !t.hoverPlay || U.value || (await ve(), d.value = !1);
1787
2145
  }
1788
- async function se() {
1789
- const u = Q.value;
1790
- u && (u.paused ? await he() : (await be(), h.value = !1));
2146
+ async function Te() {
2147
+ const s = q.value;
2148
+ s && (s.paused ? await ke() : (await ve(), d.value = !1));
1791
2149
  }
1792
- function pe() {
1793
- h.value = !1, e("ended"), k.value && n.autoAdvance && oe.value && de(N.value + 1, !0);
2150
+ function He() {
2151
+ const s = C.value;
2152
+ if (!s) return;
2153
+ if ((document.fullscreenElement ?? document.webkitFullscreenElement ?? null) === s) {
2154
+ const k = document.exitFullscreen ?? document.webkitExitFullscreen;
2155
+ k == null || k.call(document).catch(() => {
2156
+ });
2157
+ } else {
2158
+ const k = s.requestFullscreen ?? s.webkitRequestFullscreen;
2159
+ k == null || k.call(s).catch(() => {
2160
+ });
2161
+ }
1794
2162
  }
1795
- R(H, () => {
1796
- ce && (ce = !1, he());
2163
+ let ye = null;
2164
+ function Ge() {
2165
+ ye === null && (ye = setTimeout(() => {
2166
+ ye = null, Te();
2167
+ }, 250));
2168
+ }
2169
+ function Je() {
2170
+ ye !== null && (clearTimeout(ye), ye = null), He();
2171
+ }
2172
+ function Xe() {
2173
+ d.value = !1, n("ended"), X.value && t.autoAdvance && Pe.value && Ce(G.value + 1, !0);
2174
+ }
2175
+ H(ue, () => {
2176
+ xe && (xe = !1, ke());
1797
2177
  });
1798
- function W() {
1799
- g.value = !0, ve();
2178
+ function et() {
2179
+ h.value = !0, Qe();
1800
2180
  }
1801
- function G() {
1802
- g.value = !1, Ce();
2181
+ function tt() {
2182
+ h.value = !1, Ye();
1803
2183
  }
1804
- function xe(u) {
1805
- C.value = u;
1806
- const v = Q.value;
1807
- v && (v.playbackRate = u);
2184
+ function nt(s) {
2185
+ j.value = s;
2186
+ const i = q.value;
2187
+ i && (i.playbackRate = s);
1808
2188
  }
1809
- R(Q, (u) => {
1810
- if (!u) return;
1811
- u.addEventListener("ratechange", () => {
1812
- C.value = u.playbackRate;
1813
- }), u.addEventListener("enterpictureinpicture", () => {
1814
- p.value = !0;
1815
- }), u.addEventListener("leavepictureinpicture", () => {
1816
- p.value = !1;
2189
+ H(q, (s) => {
2190
+ if (!s) return;
2191
+ s.addEventListener("ratechange", () => {
2192
+ j.value = s.playbackRate;
2193
+ }), s.addEventListener("enterpictureinpicture", () => {
2194
+ K.value = !0;
2195
+ }), s.addEventListener("leavepictureinpicture", () => {
2196
+ K.value = !1;
1817
2197
  });
1818
- const v = /* @__PURE__ */ new Set();
1819
- u.addEventListener("timeupdate", () => {
1820
- const P = u.duration;
1821
- if (e("time-update", u.currentTime, Number.isFinite(P) ? P : 0), !Number.isFinite(P) || P <= 0) return;
1822
- const fe = u.currentTime / P * 100;
1823
- for (const j of [25, 50, 75, 100])
1824
- fe >= j && !v.has(j) && (v.add(j), e("milestone", j));
1825
- }), u.addEventListener("seeked", () => {
1826
- e("seeked", u.currentTime);
1827
- }), u.addEventListener("volumechange", () => {
1828
- e("volume-change", u.volume, u.muted);
1829
- }), u.addEventListener("error", () => {
1830
- e("error");
2198
+ const i = /* @__PURE__ */ new Set();
2199
+ s.addEventListener("timeupdate", () => {
2200
+ const k = s.duration;
2201
+ if (n("time-update", s.currentTime, Number.isFinite(k) ? k : 0), !Number.isFinite(k) || k <= 0) return;
2202
+ const ne = s.currentTime / k * 100;
2203
+ for (const ie of [25, 50, 75, 100])
2204
+ ne >= ie && !i.has(ie) && (i.add(ie), n("milestone", ie));
2205
+ }), s.addEventListener("seeked", () => {
2206
+ n("seeked", s.currentTime);
2207
+ }), s.addEventListener("volumechange", () => {
2208
+ n("volume-change", s.volume, s.muted);
2209
+ }), s.addEventListener("error", () => {
2210
+ S.value = !0, E.value = !1, n("error");
2211
+ }), s.addEventListener("waiting", () => {
2212
+ E.value = !0;
2213
+ }), s.addEventListener("stalled", () => {
2214
+ E.value = !0;
2215
+ }), s.addEventListener("playing", () => {
2216
+ E.value = !1;
2217
+ }), s.addEventListener("canplay", () => {
2218
+ E.value = !1;
2219
+ }), s.addEventListener("seeked", () => {
2220
+ E.value = !1;
1831
2221
  });
2222
+ }), H(ue, () => {
2223
+ S.value = !1, E.value = !1;
1832
2224
  });
1833
- function ge() {
1834
- const u = Q.value;
1835
- u && (document.pictureInPictureElement ? document.exitPictureInPicture().catch(() => {
1836
- }) : u.requestPictureInPicture().catch(() => {
2225
+ function lt() {
2226
+ S.value = !0, E.value = !1, n("error");
2227
+ }
2228
+ const st = I(() => S.value ? "Video failed to load" : E.value ? "Loading" : d.value ? "Playing" : "Paused");
2229
+ function at() {
2230
+ S.value = !1, E.value = !1, P.value += 1;
2231
+ }
2232
+ H(q, (s) => {
2233
+ if (!s || !t.persistKey) return;
2234
+ const i = t.persistKey, k = Me(i);
2235
+ typeof k.volume == "number" && (s.volume = k.volume), typeof k.muted == "boolean" && (s.muted = k.muted), typeof k.speed == "number" && (s.playbackRate = k.speed);
2236
+ const ne = () => {
2237
+ Ke(i, {
2238
+ volume: s.volume,
2239
+ muted: s.muted,
2240
+ speed: s.playbackRate
2241
+ });
2242
+ };
2243
+ s.addEventListener("volumechange", ne), s.addEventListener("ratechange", ne);
2244
+ }), H([q, ue], ([s, i]) => {
2245
+ if (!s || !t.persistKey || !i) return;
2246
+ const k = t.persistKey, ne = () => {
2247
+ const be = pl(k, i);
2248
+ be > 0 && (!Number.isFinite(s.duration) || be < s.duration - 1) && (s.currentTime = be);
2249
+ };
2250
+ s.readyState >= 1 ? ne() : s.addEventListener("loadedmetadata", ne, { once: !0 });
2251
+ let ie = 0;
2252
+ const $e = () => {
2253
+ const be = Date.now();
2254
+ be - ie < 1e3 || (ie = be, je(k, i, s.currentTime));
2255
+ };
2256
+ s.addEventListener("timeupdate", $e), s.addEventListener("pause", $e), s.addEventListener("ended", () => je(k, i, 0));
2257
+ }, { immediate: !0 });
2258
+ function Ve() {
2259
+ const s = q.value;
2260
+ s && (document.pictureInPictureElement ? document.exitPictureInPicture().catch(() => {
2261
+ }) : s.requestPictureInPicture().catch(() => {
1837
2262
  }));
1838
2263
  }
1839
- function Le(u) {
1840
- var fe, j, Ee;
1841
- const v = Q.value;
1842
- if (!(!v || !x.value && !((fe = B.value) != null && fe.contains(document.activeElement)) || u.target.tagName === "INPUT" && u.key !== " "))
1843
- switch (u.key) {
2264
+ function Re(s) {
2265
+ var ne;
2266
+ const i = q.value;
2267
+ if (!(!i || !re.value && !((ne = C.value) != null && ne.contains(document.activeElement)) || s.target.tagName === "INPUT" && s.key !== " "))
2268
+ switch (s.key) {
1844
2269
  case " ":
1845
2270
  case "k":
1846
- u.preventDefault(), se();
2271
+ s.preventDefault(), Te();
1847
2272
  break;
1848
2273
  case "ArrowLeft":
1849
- u.preventDefault(), v.currentTime = Math.max(0, v.currentTime - 5);
2274
+ s.preventDefault(), i.currentTime = Math.max(0, i.currentTime - 5);
1850
2275
  break;
1851
2276
  case "ArrowRight":
1852
- u.preventDefault(), v.currentTime = Math.min(v.duration || 0, v.currentTime + 5);
2277
+ s.preventDefault(), i.currentTime = Math.min(i.duration || 0, i.currentTime + 5);
1853
2278
  break;
1854
2279
  case "ArrowUp":
1855
- u.preventDefault(), v.volume = Math.min(1, v.volume + 0.1), v.muted && (v.muted = !1);
2280
+ s.preventDefault(), i.volume = Math.min(1, i.volume + 0.1), i.muted && (i.muted = !1);
1856
2281
  break;
1857
2282
  case "ArrowDown":
1858
- u.preventDefault(), v.volume = Math.max(0, v.volume - 0.1);
2283
+ s.preventDefault(), i.volume = Math.max(0, i.volume - 0.1);
1859
2284
  break;
1860
2285
  case "m":
1861
- v.muted = !v.muted;
2286
+ i.muted = !i.muted;
1862
2287
  break;
1863
- case "f": {
1864
- const Se = document.fullscreenElement ?? document.webkitFullscreenElement ?? null, _e = ((j = B.value) == null ? void 0 : j.requestFullscreen) ?? ((Ee = B.value) == null ? void 0 : Ee.webkitRequestFullscreen), ke = document.exitFullscreen ?? document.webkitExitFullscreen;
1865
- Se === B.value ? ke == null || ke.call(document).catch(() => {
1866
- }) : _e && B.value && _e.call(B.value).catch(() => {
1867
- });
2288
+ case "f":
2289
+ He();
1868
2290
  break;
1869
- }
1870
2291
  case "p":
1871
- Y && ge();
2292
+ W && Ve();
1872
2293
  break;
1873
2294
  }
1874
2295
  }
1875
- return He(() => {
1876
- document.addEventListener("keydown", Le);
1877
- }), ne(() => {
1878
- document.removeEventListener("keydown", Le);
1879
- }), (u, v) => (d(), f("div", {
1880
- ref_key: "rootEl",
1881
- ref: B,
1882
- class: w(["gvp-root", n.class]),
1883
- style: re({ width: ae.value, aspectRatio: Ie.value }),
1884
- onMouseenter: v[12] || (v[12] = (P) => {
1885
- x.value = !0, W();
1886
- }),
1887
- onMouseleave: v[13] || (v[13] = (P) => {
1888
- x.value = !1, G();
1889
- })
2296
+ return Be(() => {
2297
+ document.addEventListener("keydown", Re);
2298
+ }), oe(() => {
2299
+ document.removeEventListener("keydown", Re);
2300
+ }), (s, i) => (r(), c("div", {
2301
+ class: L(["gvp-ambient-wrap", { "is-ambient": e.ambientMode }]),
2302
+ style: ce({ width: he.value })
1890
2303
  }, [
1891
- q.value ? (d(), f("iframe", {
2304
+ e.miniPlayer ? (r(), c("div", {
1892
2305
  key: 0,
1893
- class: "gvp-video gvp-youtube",
1894
- src: Me.value ?? void 0,
1895
- title: "YouTube video player",
1896
- allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
1897
- allowfullscreen: "",
1898
- referrerpolicy: "strict-origin-when-cross-origin"
1899
- }, null, 8, An)) : (d(), z(Ge, {
1900
- ref_key: "hlsPlayerRef",
1901
- ref: c,
1902
- key: H.value,
1903
- controls: J.value,
1904
- "hls-config": t.hlsConfig,
1905
- "is-hls": t.isHls,
1906
- loop: t.loop,
1907
- muted: t.muted,
1908
- "auto-play": t.autoPlay,
1909
- "audio-track-index": $.value,
1910
- "quality-level-index": m.value,
1911
- "plays-inline": !0,
1912
- poster: V.value,
1913
- src: H.value,
1914
- class: "gvp-video",
1915
- preload: "metadata",
1916
- onAudioTracks: Te,
1917
- onQualityLevels: X,
1918
- onCurrentLevel: v[0] || (v[0] = (P) => b.value = P),
1919
- onEnded: pe,
1920
- onPause: v[1] || (v[1] = (P) => {
1921
- h.value = !1, e("pause");
2306
+ ref_key: "miniSentinelEl",
2307
+ ref: y,
2308
+ class: "gvp-mini-sentinel",
2309
+ "aria-hidden": "true"
2310
+ }, null, 512)) : x("", !0),
2311
+ e.ambientMode && !U.value && !R.value ? (r(), c("canvas", {
2312
+ key: 1,
2313
+ ref_key: "ambientCanvasEl",
2314
+ ref: m,
2315
+ class: "gvp-ambient-canvas",
2316
+ width: "32",
2317
+ height: "18"
2318
+ }, null, 512)) : x("", !0),
2319
+ R.value ? (r(), c("div", {
2320
+ key: 2,
2321
+ class: "gvp-mini-placeholder",
2322
+ style: ce({ width: "100%", aspectRatio: te.value }),
2323
+ "aria-hidden": "true"
2324
+ }, null, 4)) : x("", !0),
2325
+ o("div", {
2326
+ ref_key: "rootEl",
2327
+ ref: C,
2328
+ class: L([
2329
+ "gvp-root",
2330
+ t.class,
2331
+ { "gvp-mini": R.value },
2332
+ R.value ? `gvp-mini-${e.miniPlayerPosition}` : ""
2333
+ ]),
2334
+ style: ce({ width: "100%", aspectRatio: te.value, ...B.value }),
2335
+ onMouseenter: i[14] || (i[14] = (k) => {
2336
+ re.value = !0, et();
1922
2337
  }),
1923
- onPlay: v[2] || (v[2] = (P) => {
1924
- h.value = !0, e("play");
2338
+ onMouseleave: i[15] || (i[15] = (k) => {
2339
+ re.value = !1, tt();
1925
2340
  })
1926
- }, {
1927
- default: Ye(() => [
1928
- Fe(u.$slots, "default")
1929
- ]),
1930
- _: 3
1931
- }, 8, ["controls", "hls-config", "is-hls", "loop", "muted", "auto-play", "audio-track-index", "quality-level-index", "poster", "src"])),
1932
- q.value ? M("", !0) : (d(), f("div", Hn)),
1933
- t.showDeviceToggle ? (d(), f("div", Bn, [
1934
- r("div", Vn, [
1935
- r("button", {
1936
- "aria-pressed": o.value === "desktop",
1937
- class: w(["gvp-toggle-btn", { "is-active": o.value === "desktop" }]),
1938
- "aria-label": "Desktop view",
1939
- type: "button",
1940
- onClick: v[3] || (v[3] = (P) => o.value = "desktop")
1941
- }, [
1942
- Z(Ln)
1943
- ], 10, qn),
1944
- v[14] || (v[14] = r("div", { class: "gvp-toggle-divider" }, null, -1)),
1945
- r("button", {
1946
- "aria-pressed": o.value === "mobile",
1947
- class: w(["gvp-toggle-btn", { "is-active": o.value === "mobile" }]),
1948
- "aria-label": "Mobile view",
2341
+ }, [
2342
+ R.value ? (r(), c("button", {
2343
+ key: 0,
2344
+ type: "button",
2345
+ class: "gvp-mini-close",
2346
+ "aria-label": "Close mini player",
2347
+ onClick: ee
2348
+ }, [
2349
+ O(Oe)
2350
+ ])) : x("", !0),
2351
+ U.value ? (r(), c("iframe", {
2352
+ key: 1,
2353
+ class: "gvp-video gvp-youtube",
2354
+ src: Ae.value ?? void 0,
2355
+ title: "YouTube video player",
2356
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
2357
+ allowfullscreen: "",
2358
+ referrerpolicy: "strict-origin-when-cross-origin"
2359
+ }, null, 8, yl)) : (r(), J(vt, {
2360
+ ref_key: "hlsPlayerRef",
2361
+ ref: a,
2362
+ key: `${ue.value}#${P.value}`,
2363
+ controls: D.value,
2364
+ "hls-config": e.hlsConfig,
2365
+ "is-hls": e.isHls,
2366
+ loop: e.loop,
2367
+ muted: e.muted,
2368
+ "auto-play": e.autoPlay,
2369
+ "audio-track-index": T.value,
2370
+ "quality-level-index": z.value,
2371
+ "plays-inline": !0,
2372
+ poster: me.value,
2373
+ src: ue.value,
2374
+ class: L(["gvp-video", F]),
2375
+ preload: "metadata",
2376
+ onAudioTracks: Ne,
2377
+ onQualityLevels: u,
2378
+ onCurrentLevel: i[0] || (i[0] = (k) => M.value = k),
2379
+ onEnded: Xe,
2380
+ onFatalError: lt,
2381
+ onLiveChange: i[1] || (i[1] = (k) => A.value = k),
2382
+ onPause: i[2] || (i[2] = (k) => {
2383
+ d.value = !1, n("pause");
2384
+ }),
2385
+ onPlay: i[3] || (i[3] = (k) => {
2386
+ d.value = !0, n("play");
2387
+ })
2388
+ }, {
2389
+ default: it(() => [
2390
+ Ue(s.$slots, "default")
2391
+ ]),
2392
+ _: 3
2393
+ }, 8, ["controls", "hls-config", "is-hls", "loop", "muted", "auto-play", "audio-track-index", "quality-level-index", "poster", "src", "class"])),
2394
+ U.value ? x("", !0) : (r(), c("div", bl)),
2395
+ U.value ? x("", !0) : (r(), c("span", wl, Z(st.value), 1)),
2396
+ !U.value && E.value && !S.value ? (r(), c("div", xl, [...i[16] || (i[16] = [
2397
+ o("div", { class: "gvp-spinner" }, null, -1),
2398
+ o("span", { class: "gvp-sr-only" }, "Loading…", -1)
2399
+ ])])) : x("", !0),
2400
+ !U.value && S.value ? (r(), c("div", Cl, [
2401
+ O(ol, { class: "gvp-error-icon" }),
2402
+ i[18] || (i[18] = o("p", { class: "gvp-error-text" }, "This video couldn't be played.", -1)),
2403
+ o("button", {
1949
2404
  type: "button",
1950
- onClick: v[4] || (v[4] = (P) => o.value = "mobile")
2405
+ class: "gvp-error-retry",
2406
+ onClick: at
1951
2407
  }, [
1952
- Z(_n)
1953
- ], 10, Dn)
1954
- ])
1955
- ])) : M("", !0),
1956
- t.closable ? (d(), f("button", {
1957
- key: 4,
1958
- "aria-label": "Close",
1959
- class: "gvp-close",
1960
- type: "button",
1961
- onClick: v[5] || (v[5] = (P) => e("close"))
1962
- }, [
1963
- Z(Tn)
1964
- ])) : M("", !0),
1965
- le.value && !A.value ? (d(), z(rt, {
1966
- key: 5,
1967
- tracks: _.value,
1968
- "active-index": we.value,
1969
- onSelect: v[6] || (v[6] = (P) => $.value = P)
1970
- }, null, 8, ["tracks", "active-index"])) : M("", !0),
1971
- !q.value && !A.value ? (d(), z(pt, {
1972
- key: 6,
1973
- speed: C.value,
1974
- onSelect: xe
1975
- }, null, 8, ["speed"])) : M("", !0),
1976
- !q.value && !A.value ? (d(), z(yt, {
1977
- key: 7,
1978
- video: Q.value
1979
- }, null, 8, ["video"])) : M("", !0),
1980
- !q.value && te(Y) && !A.value ? (d(), f("button", {
1981
- key: 8,
1982
- type: "button",
1983
- class: w(["gvp-pip-btn", { "is-active": p.value }]),
1984
- "aria-label": p.value ? "Exit picture-in-picture" : "Picture-in-picture",
1985
- "aria-pressed": p.value,
1986
- onClick: ge
1987
- }, [
1988
- Z(Ze)
1989
- ], 10, Fn)) : M("", !0),
1990
- !q.value && A.value ? (d(), f("button", {
1991
- key: 9,
1992
- type: "button",
1993
- class: "gvp-click-layer",
1994
- "aria-label": h.value ? "Pause" : "Play",
1995
- onClick: se
1996
- }, null, 8, Rn)) : M("", !0),
1997
- !q.value && !A.value && !h.value ? (d(), f("div", On, [
1998
- r("button", {
1999
- "aria-label": "Play",
2000
- class: "gvp-play",
2408
+ O(il),
2409
+ i[17] || (i[17] = o("span", null, "Retry", -1))
2410
+ ])
2411
+ ])) : x("", !0),
2412
+ e.showDeviceToggle ? (r(), c("div", Ll, [
2413
+ o("div", $l, [
2414
+ o("button", {
2415
+ "aria-pressed": v.value === "desktop",
2416
+ class: L(["gvp-toggle-btn", { "is-active": v.value === "desktop" }]),
2417
+ "aria-label": "Desktop view",
2418
+ type: "button",
2419
+ onClick: i[4] || (i[4] = (k) => v.value = "desktop")
2420
+ }, [
2421
+ O(Xn)
2422
+ ], 10, El),
2423
+ i[19] || (i[19] = o("div", { class: "gvp-toggle-divider" }, null, -1)),
2424
+ o("button", {
2425
+ "aria-pressed": v.value === "mobile",
2426
+ class: L(["gvp-toggle-btn", { "is-active": v.value === "mobile" }]),
2427
+ "aria-label": "Mobile view",
2428
+ type: "button",
2429
+ onClick: i[5] || (i[5] = (k) => v.value = "mobile")
2430
+ }, [
2431
+ O(tl)
2432
+ ], 10, _l)
2433
+ ])
2434
+ ])) : x("", !0),
2435
+ e.closable ? (r(), c("button", {
2436
+ key: 8,
2437
+ "aria-label": "Close",
2438
+ class: "gvp-close",
2001
2439
  type: "button",
2002
- onClick: se,
2003
- onMouseenter: v[7] || (v[7] = (P) => g.value = !0),
2004
- onMouseleave: v[8] || (v[8] = (P) => g.value = !1)
2440
+ onClick: i[6] || (i[6] = (k) => n("close"))
2005
2441
  }, [
2006
- Z(Pn),
2007
- t.tooltipText && g.value ? (d(), f("span", Un, U(t.tooltipText), 1)) : M("", !0)
2008
- ], 32)
2009
- ])) : M("", !0),
2010
- !q.value && A.value ? (d(), z(Cn, {
2011
- key: 11,
2012
- video: Q.value,
2013
- "is-playing": h.value,
2014
- container: B.value,
2015
- "on-toggle-play": se,
2016
- "quality-levels": S.value,
2017
- "current-level": b.value,
2018
- "selected-level": m.value,
2019
- thumbnails: O.value,
2020
- chapters: me.value,
2021
- "has-prev": Pe.value,
2022
- "has-next": oe.value,
2023
- onSelectLevel: v[9] || (v[9] = (P) => m.value = P),
2024
- onPrev: v[10] || (v[10] = (P) => de(N.value - 1, !0)),
2025
- onNext: v[11] || (v[11] = (P) => de(N.value + 1, !0))
2026
- }, null, 8, ["video", "is-playing", "container", "quality-levels", "current-level", "selected-level", "thumbnails", "chapters", "has-prev", "has-next"])) : M("", !0),
2027
- !q.value && !A.value ? (d(), f("div", Zn)) : M("", !0)
2028
- ], 38));
2442
+ O(Oe)
2443
+ ])) : x("", !0),
2444
+ b.value && !V.value ? (r(), J(bt, {
2445
+ key: 9,
2446
+ tracks: $.value,
2447
+ "active-index": _.value,
2448
+ onSelect: i[7] || (i[7] = (k) => T.value = k)
2449
+ }, null, 8, ["tracks", "active-index"])) : x("", !0),
2450
+ !U.value && !V.value ? (r(), J(_t, {
2451
+ key: 10,
2452
+ speed: j.value,
2453
+ onSelect: nt
2454
+ }, null, 8, ["speed"])) : x("", !0),
2455
+ !U.value && !V.value ? (r(), J(Nt, {
2456
+ key: 11,
2457
+ video: q.value
2458
+ }, null, 8, ["video"])) : x("", !0),
2459
+ !U.value && se(W) && !V.value ? (r(), c("button", {
2460
+ key: 12,
2461
+ type: "button",
2462
+ class: L(["gvp-pip-btn", { "is-active": K.value }]),
2463
+ "aria-label": K.value ? "Exit picture-in-picture" : "Picture-in-picture",
2464
+ "aria-pressed": K.value,
2465
+ onClick: Ve
2466
+ }, [
2467
+ O(ze)
2468
+ ], 10, Pl)) : x("", !0),
2469
+ !U.value && V.value ? (r(), c("button", {
2470
+ key: 13,
2471
+ type: "button",
2472
+ class: "gvp-click-layer",
2473
+ "aria-label": d.value ? "Pause" : "Play",
2474
+ onClick: Ge,
2475
+ onDblclick: Je
2476
+ }, null, 40, Tl)) : x("", !0),
2477
+ !U.value && !V.value && !d.value ? (r(), c("div", Ml, [
2478
+ o("button", {
2479
+ "aria-label": "Play",
2480
+ class: "gvp-play",
2481
+ type: "button",
2482
+ onClick: Te,
2483
+ onMouseenter: i[8] || (i[8] = (k) => h.value = !0),
2484
+ onMouseleave: i[9] || (i[9] = (k) => h.value = !1)
2485
+ }, [
2486
+ O(ll),
2487
+ e.tooltipText && h.value ? (r(), c("span", Il, Z(e.tooltipText), 1)) : x("", !0)
2488
+ ], 32)
2489
+ ])) : x("", !0),
2490
+ !U.value && V.value ? (r(), J(Gn, {
2491
+ key: 15,
2492
+ video: q.value,
2493
+ "is-playing": d.value,
2494
+ container: C.value,
2495
+ "on-toggle-play": Te,
2496
+ "quality-levels": f.value,
2497
+ "current-level": M.value,
2498
+ "selected-level": z.value,
2499
+ thumbnails: Ie.value,
2500
+ chapters: Se.value,
2501
+ "has-prev": de.value,
2502
+ "has-next": Pe.value,
2503
+ "is-live": A.value,
2504
+ "audio-tracks": $.value,
2505
+ "audio-track-index": _.value,
2506
+ onSelectLevel: i[10] || (i[10] = (k) => z.value = k),
2507
+ onSelectAudioTrack: i[11] || (i[11] = (k) => T.value = k),
2508
+ onPrev: i[12] || (i[12] = (k) => Ce(G.value - 1, !0)),
2509
+ onNext: i[13] || (i[13] = (k) => Ce(G.value + 1, !0))
2510
+ }, null, 8, ["video", "is-playing", "container", "quality-levels", "current-level", "selected-level", "thumbnails", "chapters", "has-prev", "has-next", "is-live", "audio-tracks", "audio-track-index"])) : x("", !0),
2511
+ !U.value && !V.value ? (r(), c("div", Sl)) : x("", !0)
2512
+ ], 38)
2513
+ ], 6));
2029
2514
  }
2030
2515
  });
2031
2516
  export {
2032
- Ge as HLSPlayer,
2033
- Wn as VueVideoPlayer,
2034
- In as parseYouTubeId,
2035
- Sn as parseYouTubeStart,
2036
- Nn as youTubeEmbedUrl
2517
+ vt as HLSPlayer,
2518
+ Bl as VueVideoPlayer,
2519
+ ul as parseYouTubeId,
2520
+ cl as parseYouTubeStart,
2521
+ dl as youTubeEmbedUrl
2037
2522
  };
2038
2523
  //# sourceMappingURL=index.mjs.map