@validol4ik/uikit 0.15.0 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,175 +1,175 @@
1
- var te = (t) => {
1
+ var ae = (t) => {
2
2
  throw TypeError(t);
3
3
  };
4
- var G = (t, r, e) => r.has(t) || te("Cannot " + e);
5
- var k = (t, r, e) => (G(t, r, "read from private field"), e ? e.call(t) : r.get(t)), A = (t, r, e) => r.has(t) ? te("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, e), I = (t, r, e, n) => (G(t, r, "write to private field"), n ? n.call(t, e) : r.set(t, e), e), re = (t, r, e) => (G(t, r, "access private method"), e);
6
- import { ref as O, onBeforeUnmount as oe, defineComponent as ve, computed as ye, watch as se, onMounted as Ee, createElementBlock as S, openBlock as R, unref as w, createCommentVNode as L, createElementVNode as j, normalizeClass as ae, toDisplayString as be, nextTick as ke } from "vue";
7
- import { D as Se, p as Re, E as ge, a as we, b as _e, i as Te, B as Pe, c as ne, P as Le, d as Oe, V as K, e as Ce, r as De, f as Ae, t as Ve, s as ze, W as Ie, g as Ke } from "../playback-CTKx1SmL.js";
8
- import { _ as Ne } from "../_plugin-vue_export-helper-CHgC5LLL.js";
9
- var B, V, M, D, P, N, ie;
10
- class Be extends EventTarget {
11
- constructor(e, n, i) {
4
+ var U = (t, s, e) => s.has(t) || ae("Cannot " + e);
5
+ var R = (t, s, e) => (U(t, s, "read from private field"), e ? e.call(t) : s.get(t)), D = (t, s, e) => s.has(t) ? ae("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), N = (t, s, e, n) => (U(t, s, "write to private field"), n ? n.call(t, e) : s.set(t, e), e), ne = (t, s, e) => (U(t, s, "access private method"), e);
6
+ import { ref as P, onBeforeUnmount as le, defineComponent as be, computed as Se, watch as j, onMounted as Re, createElementBlock as b, openBlock as S, unref as _, createCommentVNode as L, createElementVNode as q, Fragment as ge, normalizeClass as oe, toDisplayString as we, nextTick as _e } from "vue";
7
+ import { D as Te, p as Le, E as Pe, a as Oe, i as Ce, b as Ae, B as De, c as ie, P as Ve, d as Ie, V as B, r as ze, e as Ke, t as Ne, f as Be, H as He, W as Fe, g as Me, s as Ge } from "../playback-C_bPLFTz.js";
8
+ import { _ as We } from "../_plugin-vue_export-helper-CHgC5LLL.js";
9
+ var F, V, M, A, O, H, ce;
10
+ class Ye extends EventTarget {
11
+ constructor(e, n, c) {
12
12
  super();
13
- A(this, P);
14
- A(this, B);
15
- A(this, V);
16
- A(this, M);
17
- A(this, D, -1);
18
- I(this, B, e), I(this, V, [...n].sort((l, o) => o.size - l.size)), I(this, M, i);
13
+ D(this, O);
14
+ D(this, F);
15
+ D(this, V);
16
+ D(this, M);
17
+ D(this, A, -1);
18
+ N(this, F, e), N(this, V, [...n].sort((l, o) => o.size - l.size)), N(this, M, c);
19
19
  }
20
20
  get selectedIndex() {
21
- return k(this, D);
21
+ return R(this, A);
22
22
  }
23
23
  set selectedIndex(e) {
24
- const n = k(this, P, N);
25
- I(this, D, e), k(this, P, N) !== n && re(this, P, ie).call(this), this.dispatchEvent(new Event("change"));
24
+ const n = R(this, O, H);
25
+ N(this, A, e), R(this, O, H) !== n && ne(this, O, ce).call(this), this.dispatchEvent(new Event("change"));
26
26
  }
27
27
  *[Symbol.iterator]() {
28
- for (const [e, n] of k(this, V).entries())
28
+ for (const [e, n] of R(this, V).entries())
29
29
  yield {
30
30
  id: String(n.size),
31
31
  height: n.size,
32
- selected: e === k(this, D),
33
- active: n === k(this, P, N)
32
+ selected: e === R(this, A),
33
+ active: n === R(this, O, H)
34
34
  };
35
35
  }
36
36
  }
37
- B = new WeakMap(), V = new WeakMap(), M = new WeakMap(), D = new WeakMap(), P = new WeakSet(), N = function() {
38
- return k(this, V)[k(this, D)] ?? k(this, M);
37
+ F = new WeakMap(), V = new WeakMap(), M = new WeakMap(), A = new WeakMap(), O = new WeakSet(), H = function() {
38
+ return R(this, V)[R(this, A)] ?? R(this, M);
39
39
  }, // Loading a new src resets the position and speed
40
- ie = function() {
41
- const e = k(this, B), n = e.currentTime, i = e.playbackRate, l = !e.paused;
40
+ ce = function() {
41
+ const e = R(this, F), n = e.currentTime, c = e.playbackRate, l = !e.paused;
42
42
  e.addEventListener(
43
43
  "loadedmetadata",
44
44
  () => {
45
- n && (e.currentTime = n), e.playbackRate = i, l && e.play();
45
+ n && (e.currentTime = n), e.playbackRate = c, l && e.play();
46
46
  },
47
47
  { once: !0 }
48
- ), n && (e.preload = "metadata"), e.src = k(this, P, N).src;
48
+ ), n && (e.preload = "metadata"), e.src = R(this, O, H).src;
49
49
  };
50
- const Me = (t, r) => {
50
+ const Ue = (t, s) => {
51
51
  t.preload = "metadata", t.addEventListener(
52
52
  "loadedmetadata",
53
53
  () => {
54
- r(), t.play().catch(() => {
54
+ s(), t.play().catch(() => {
55
55
  });
56
56
  },
57
57
  { once: !0 }
58
58
  );
59
- }, le = () => {
60
- let t = 0, r = 0;
59
+ }, ue = () => {
60
+ let t = 0, s = 0;
61
61
  return (e) => {
62
62
  const n = Date.now();
63
- if (n - r > _e && (t = 0), r = n, t >= ge) return !1;
64
- const i = t++;
65
- return setTimeout(() => e(i), we * 2 ** i), !0;
63
+ if (n - s > Ae && (t = 0), s = n, t >= Pe) return !1;
64
+ const c = t++;
65
+ return setTimeout(() => e(c), Oe * 2 ** c), !0;
66
66
  };
67
- }, ce = (t, r) => {
68
- const { currentTime: e, playbackRate: n, paused: i } = t;
67
+ }, de = (t, s) => {
68
+ const { currentTime: e, playbackRate: n, paused: c } = t;
69
69
  return () => {
70
70
  t.addEventListener(
71
71
  "loadedmetadata",
72
72
  () => {
73
- t.currentTime = e, t.playbackRate = n, i || t.play().catch(() => {
73
+ t.currentTime = e, t.playbackRate = n, c || t.play().catch(() => {
74
74
  });
75
75
  },
76
76
  { once: !0 }
77
- ), r(e);
77
+ ), s(e);
78
78
  };
79
- }, He = (t, r, e) => {
79
+ }, je = (t, s, e) => {
80
80
  let n = null;
81
- const i = le();
81
+ const c = ue();
82
82
  t.addEventListener("loadstart", () => {
83
83
  if (!t.engine || t.engine === n) return;
84
84
  const o = t.engine;
85
85
  n = o;
86
86
  const f = () => t.engine === o;
87
- o.on(r.Events.ERROR, async (u, d) => {
87
+ o.on(s.Events.ERROR, async (u, p) => {
88
88
  var T;
89
- if (!d.fatal) return;
90
- const p = (a) => {
91
- var m, E;
89
+ if (!p.fatal) return;
90
+ const d = (a) => {
91
+ var m, k;
92
92
  return e.report({
93
- type: d.type,
94
- details: d.details,
95
- status: (m = d.response) == null ? void 0 : m.code,
96
- url: ((E = d.frag) == null ? void 0 : E.url) ?? d.url,
93
+ type: p.type,
94
+ details: p.details,
95
+ status: (m = p.response) == null ? void 0 : m.code,
96
+ url: ((k = p.frag) == null ? void 0 : k.url) ?? p.url,
97
97
  recovering: a
98
98
  });
99
99
  }, y = () => {
100
- p(!0), e.dismissError();
100
+ d(!0), e.dismissError();
101
101
  };
102
- if (d.type === r.ErrorTypes.NETWORK_ERROR) {
103
- if (((T = d.response) == null ? void 0 : T.code) === 401 && await e.reauthorize()) {
102
+ if (p.type === s.ErrorTypes.NETWORK_ERROR) {
103
+ if (((T = p.response) == null ? void 0 : T.code) === 401 && await e.reauthorize()) {
104
104
  y(), o.startLoad(t.currentTime);
105
105
  return;
106
106
  }
107
- if (e.hasLoaded() && i(() => f() && o.startLoad(t.currentTime))) {
107
+ if (e.hasLoaded() && c(() => f() && o.startLoad(t.currentTime))) {
108
108
  y();
109
109
  return;
110
110
  }
111
- } else if (d.type === r.ErrorTypes.MEDIA_ERROR && e.hasLoaded() && i((a) => {
111
+ } else if (p.type === s.ErrorTypes.MEDIA_ERROR && e.hasLoaded() && c((a) => {
112
112
  f() && (a > 0 && o.swapAudioCodec(), o.recoverMediaError());
113
113
  })) {
114
114
  y();
115
115
  return;
116
116
  }
117
- p(!1), e.fail();
118
- }), o.on(r.Events.FRAG_LOADED, e.loaded);
117
+ d(!1), e.fail();
118
+ }), o.on(s.Events.FRAG_LOADED, e.loaded);
119
119
  }), t.addEventListener("error", async () => {
120
120
  if (t.engine) return;
121
- const o = ce(t, () => t.load()), f = (d) => {
122
- var p;
121
+ const o = de(t, () => t.load()), f = (p) => {
122
+ var d;
123
123
  return e.report({
124
124
  type: "nativeError",
125
- details: String(((p = t.error) == null ? void 0 : p.code) ?? ""),
126
- recovering: d
125
+ details: String(((d = t.error) == null ? void 0 : d.code) ?? ""),
126
+ recovering: p
127
127
  });
128
128
  };
129
- if ((await e.reauthorize() || e.hasLoaded()) && i(() => t.isConnected && o())) {
129
+ if ((await e.reauthorize() || e.hasLoaded()) && c(() => t.isConnected && o())) {
130
130
  f(!0), e.dismissError();
131
131
  return;
132
132
  }
133
133
  f(!1), e.fail();
134
134
  }), t.addEventListener("loadeddata", e.loaded);
135
- const l = Te();
135
+ const l = Ce();
136
136
  e.withCredentials && !l && (t.crossOrigin = "use-credentials"), t.source = {
137
137
  src: e.src,
138
138
  preferPlayback: l ? "native" : "mse"
139
139
  };
140
- }, Fe = (t, r) => {
140
+ }, qe = (t, s) => {
141
141
  const e = t.engine;
142
- e.setXHRWithCredentialsForType("default", r.withCredentials);
143
- const n = le(), i = () => ce(
142
+ e.setXHRWithCredentialsForType("default", s.withCredentials);
143
+ const n = ue(), c = () => de(
144
144
  t,
145
- (l) => e.attachSource(r.src, l)
145
+ (l) => e.attachSource(s.src, l)
146
146
  );
147
147
  e.on("error", async (l) => {
148
- var d, p;
149
- const o = l.error, f = (p = (d = o.data) == null ? void 0 : d.response) == null ? void 0 : p.status, u = (y) => r.report({
148
+ var p, d;
149
+ const o = l.error, f = (d = (p = o.data) == null ? void 0 : p.response) == null ? void 0 : d.status, u = (y) => s.report({
150
150
  type: "dashError",
151
151
  details: String(o.code ?? ""),
152
152
  status: f,
153
153
  recovering: y
154
154
  });
155
155
  if (f === 401) {
156
- if (await r.reauthorize()) {
157
- u(!0), i()();
156
+ if (await s.reauthorize()) {
157
+ u(!0), c()();
158
158
  return;
159
159
  }
160
- } else if (!Se.includes(o.code ?? -1))
160
+ } else if (!Te.includes(o.code ?? -1))
161
161
  return;
162
- u(!1), r.fail();
163
- }), e.on("fragmentLoadingCompleted", r.loaded), t.addEventListener("error", () => {
162
+ u(!1), s.fail();
163
+ }), e.on("fragmentLoadingCompleted", s.loaded), t.addEventListener("error", () => {
164
164
  var f;
165
- const l = i(), o = r.hasLoaded() && n(() => t.isConnected && l());
166
- r.report({
165
+ const l = c(), o = s.hasLoaded() && n(() => t.isConnected && l());
166
+ s.report({
167
167
  type: "mediaError",
168
168
  details: String(((f = t.error) == null ? void 0 : f.code) ?? ""),
169
169
  recovering: o
170
- }), o ? r.dismissError() : r.fail();
170
+ }), o ? s.dismissError() : s.fail();
171
171
  }), t.source = {
172
- src: r.src,
172
+ src: s.src,
173
173
  engine: {
174
174
  dashJs: {
175
175
  streaming: {
@@ -180,42 +180,42 @@ const Me = (t, r) => {
180
180
  }
181
181
  }
182
182
  };
183
- }, We = (t, r) => {
184
- const e = Re(r);
183
+ }, Je = (t, s) => {
184
+ const e = Le(s);
185
185
  e && (Object.assign(t, {
186
- videoRenditions: new Be(t, r, e)
186
+ videoRenditions: new Ye(t, s, e)
187
187
  }), t.src = e.src);
188
- }, Ye = "media-controls-content, .media-popup, media-error-dialog", Ge = (t) => t instanceof Element && t.matches(Ye), je = (t) => {
189
- const r = O(!1);
190
- let e, n = 1, i = !1, l = null;
188
+ }, Xe = "media-controls-content, .media-popup, media-error-dialog", $e = (t) => t instanceof Element && t.matches(Xe), Qe = (t) => {
189
+ const s = P(!1);
190
+ let e, n = 1, c = !1, l = null;
191
191
  const o = () => {
192
192
  var a;
193
193
  return (a = t.value) == null ? void 0 : a.store;
194
194
  }, f = () => {
195
- i = !0;
195
+ c = !0;
196
196
  const a = o();
197
- !a || a.paused || a.playbackRate >= ne || (n = a.playbackRate, a.setPlaybackRate(ne), r.value = !0);
197
+ !a || a.paused || a.playbackRate >= ie || (n = a.playbackRate, a.setPlaybackRate(ie), s.value = !0);
198
198
  }, u = () => {
199
199
  var m;
200
200
  clearTimeout(e), l == null || l(), l = null;
201
- const a = i;
202
- return i = !1, r.value && (r.value = !1, (m = o()) == null || m.setPlaybackRate(n)), a;
203
- }, d = (a, m, E) => {
204
- u(), m && (e = setTimeout(f, Pe));
201
+ const a = c;
202
+ return c = !1, s.value && (s.value = !1, (m = o()) == null || m.setPlaybackRate(n)), a;
203
+ }, p = (a, m, k) => {
204
+ u(), m && (e = setTimeout(f, De));
205
205
  const g = (h) => {
206
206
  if (h instanceof KeyboardEvent) {
207
207
  if (h.key !== " ") return;
208
208
  h.preventDefault(), h.stopPropagation();
209
209
  }
210
- const _ = u();
211
- E == null || E(_);
210
+ const w = u();
211
+ k == null || k(w);
212
212
  };
213
213
  a.forEach((h) => window.addEventListener(h, g, !0)), window.addEventListener("blur", u), l = () => {
214
214
  a.forEach(
215
215
  (h) => window.removeEventListener(h, g, !0)
216
216
  ), window.removeEventListener("blur", u);
217
217
  };
218
- }, p = (a) => {
218
+ }, d = (a) => {
219
219
  var h;
220
220
  if (a.key !== " " || a.altKey || a.ctrlKey || a.metaKey)
221
221
  return;
@@ -223,52 +223,55 @@ const Me = (t, r) => {
223
223
  l && (a.preventDefault(), a.stopPropagation());
224
224
  return;
225
225
  }
226
- const m = o(), E = document.activeElement;
227
- if (!m || !E || !((h = t.value) != null && h.contains(E))) return;
226
+ const m = o(), k = document.activeElement;
227
+ if (!m || !k || !((h = t.value) != null && h.contains(k))) return;
228
228
  a.preventDefault(), a.stopPropagation();
229
229
  const g = m.paused;
230
- g && m.play(), d(["keyup"], !g, (_) => {
231
- !g && !_ && m.pause();
230
+ g && m.play(), p(["keyup"], !g, (w) => {
231
+ !g && !w && m.pause();
232
232
  });
233
233
  }, y = (a) => {
234
234
  const m = o();
235
- !m || m.paused || a.button !== 0 || a.composedPath().some(Ge) || d(["pointerup", "pointercancel"], !0);
235
+ !m || m.paused || a.button !== 0 || a.composedPath().some($e) || p(["pointerup", "pointercancel"], !0);
236
236
  }, T = (a) => {
237
- r.value && a.preventDefault();
237
+ s.value && a.preventDefault();
238
238
  };
239
- return oe(u), { boosted: r, release: u, onKeyDown: p, onPointerDown: y, onContextMenu: T };
240
- }, U = "app-video-player", Ue = `linear-gradient(to top,
239
+ return le(u), { boosted: s, release: u, onKeyDown: d, onPointerDown: y, onContextMenu: T };
240
+ }, J = "app-video-player", pe = (t) => `linear-gradient(${t},
241
241
  color-mix(in oklab, var(--media-backdrop) 25%, transparent),
242
242
  color-mix(in oklab, var(--media-backdrop) 8%, transparent) 50%,
243
243
  color-mix(in oklab, var(--media-backdrop) 1%, transparent) 75%,
244
- transparent)`, qe = "rgb(0 0 0 / 0.4)", Je = async () => {
245
- if (customElements.get(U)) return;
246
- const [{ createPlayer: t, definePlayerFeature: r }, { videoFeatures: e }] = await Promise.all([
244
+ transparent)`, Ze = pe("to top"), xe = pe("to bottom"), et = "rgb(0 0 0 / 0.4)", tt = async () => {
245
+ if (customElements.get(J)) return;
246
+ const [{ createPlayer: t, definePlayerFeature: s }, { videoFeatures: e }] = await Promise.all([
247
247
  import("@videojs/html"),
248
248
  import("@videojs/html/video")
249
- ]), n = r({
249
+ ]), n = s({
250
250
  name: "idleControls",
251
251
  // the fields belong to the playback and controls features, this one only reads and sets them
252
252
  state: () => ({}),
253
- attach({ target: l, signal: o, store: f, get: u, set: d }) {
253
+ attach({ target: l, signal: o, store: f, get: u, set: p }) {
254
254
  var a;
255
- const p = (a = l.container) == null ? void 0 : a.style;
256
- p == null || p.setProperty("--media-controls-gradient", Ue), p == null || p.setProperty("--media-popover", qe);
255
+ const d = (a = l.container) == null ? void 0 : a.style;
256
+ d == null || d.setProperty("--media-controls-gradient", Ze), d == null || d.setProperty(
257
+ "--media-controls-top-gradient",
258
+ xe
259
+ ), d == null || d.setProperty("--media-popover", et);
257
260
  const y = () => {
258
- const { paused: m, started: E, ended: g, userActive: h, controlsVisible: _ } = u();
259
- return m && E && !g && !h && _;
261
+ const { paused: m, started: k, ended: g, userActive: h, controlsVisible: w } = u();
262
+ return m && k && !g && !h && w;
260
263
  }, T = f.subscribe(() => {
261
264
  y() && queueMicrotask(() => {
262
- !o.aborted && y() && d({ controlsVisible: !1 });
265
+ !o.aborted && y() && p({ controlsVisible: !1 });
263
266
  });
264
267
  });
265
268
  o.addEventListener("abort", T, { once: !0 });
266
269
  }
267
- }), { PlayerElement: i } = t({
270
+ }), { PlayerElement: c } = t({
268
271
  features: [...e, n]
269
272
  });
270
- customElements.get(U) || customElements.define(U, i);
271
- }, Xe = ["lang"], Qe = ["poster", "default-playback-rates"], Ze = { class: "app-video__skin" }, $e = ["crossorigin"], xe = ["src"], et = ["src"], tt = ["crossorigin"], rt = ["src"], st = ["src"], at = ["crossorigin"], nt = ["src"], ot = ["src"], it = /* @__PURE__ */ ve({
273
+ customElements.get(J) || customElements.define(J, c);
274
+ }, rt = ["lang"], st = ["poster", "default-playback-rates"], at = { class: "app-video__skin" }, nt = ["crossorigin"], ot = ["src"], it = ["src"], lt = ["crossorigin"], ct = ["src"], ut = ["src"], dt = ["crossorigin"], pt = ["src"], ft = ["src"], mt = /* @__PURE__ */ be({
272
275
  __name: "AppVideo",
273
276
  props: {
274
277
  hlsSrc: {},
@@ -280,215 +283,241 @@ const Me = (t, r) => {
280
283
  withCredentials: { type: Boolean, default: !0 },
281
284
  authorize: {},
282
285
  resumeKey: {},
286
+ suspended: { type: Boolean },
283
287
  watermark: {},
284
288
  color: {}
285
289
  },
286
290
  emits: ["error", "progress", "ended"],
287
- setup(t, { emit: r }) {
288
- const e = t, n = r, i = O(null), l = O(null), o = O(null), f = O([]), u = O(null), d = O(!0), p = O(!1), y = ye(() => {
291
+ setup(t, { emit: s }) {
292
+ const e = t, n = s, c = P(null), l = P(null), o = P(null), f = P([]), u = P(null), p = P(!0), d = P(!1), y = P(!1), T = Se(() => {
289
293
  if (!(!e.chaptersSrc && !e.thumbnailsSrc))
290
294
  return e.withCredentials ? "use-credentials" : "anonymous";
291
- }), { boosted: T, release: a, onKeyDown: m, onPointerDown: E, onContextMenu: g } = je(i);
292
- let h = null, _ = !1, H = !1, z, q, J, W = 0, b = null;
293
- const ue = (s) => {
294
- var c;
295
- if (u.value !== s) return;
296
- const v = H ? l.value : null;
297
- b = {
298
- time: v ? v.currentTime : (b == null ? void 0 : b.time) ?? 0,
299
- rate: v ? v.playbackRate : (b == null ? void 0 : b.rate) ?? 1,
300
- playing: !!(b != null && b.playing) || ((c = i.value) == null ? void 0 : c.store.paused) === !1
301
- }, f.value = [...f.value, s];
302
- }, X = async () => {
295
+ }), { boosted: a, release: m, onKeyDown: k, onPointerDown: g, onContextMenu: h } = Qe(c);
296
+ let w = null, G = !1, I = !1, z, X, $, W = 0, E = null;
297
+ const fe = (r) => {
298
+ var i;
299
+ if (u.value !== r) return;
300
+ const v = I ? l.value : null;
301
+ E = {
302
+ time: v ? v.currentTime : (E == null ? void 0 : E.time) ?? 0,
303
+ rate: v ? v.playbackRate : (E == null ? void 0 : E.rate) ?? 1,
304
+ playing: !!(E != null && E.playing) || ((i = c.value) == null ? void 0 : i.store.paused) === !1
305
+ }, f.value = [...f.value, r];
306
+ }, Q = async () => {
303
307
  if (!e.authorize) return !0;
304
308
  try {
305
309
  return await e.authorize(), !0;
306
- } catch (s) {
307
- return console.error("Video authorization failed", s), !1;
310
+ } catch (r) {
311
+ return console.error("Video authorization failed", r), !1;
308
312
  }
309
- }, Q = (s, v) => ({
310
- src: s ?? "",
313
+ }, Z = (r, v) => ({
314
+ src: r ?? "",
311
315
  withCredentials: e.withCredentials,
312
- reauthorize: async () => _ ? !1 : (_ = !0, X()),
316
+ reauthorize: async () => G ? !1 : (G = !0, Q()),
313
317
  loaded: () => {
314
- _ = !1, H = !0;
318
+ G = !1, I = !0;
315
319
  },
316
- hasLoaded: () => H,
317
- fail: () => ue(v),
318
- report: (c) => {
320
+ hasLoaded: () => I,
321
+ fail: () => fe(v),
322
+ report: (i) => {
319
323
  var C;
320
324
  return n("error", {
321
- ...c,
325
+ ...i,
322
326
  mode: v,
323
327
  time: ((C = l.value) == null ? void 0 : C.currentTime) ?? 0
324
328
  });
325
329
  },
326
330
  dismissError: () => queueMicrotask(() => {
327
- var c;
328
- return (c = i.value) == null ? void 0 : c.store.dismissError();
331
+ var i;
332
+ return (i = c.value) == null ? void 0 : i.store.dismissError();
329
333
  })
330
- }), de = () => {
331
- e.watermark && (q = setInterval(() => {
332
- var s;
333
- (((s = i.value) == null ? void 0 : s.store.paused) ?? !0) || (p.value = !0, J = setTimeout(() => {
334
- p.value = !1;
335
- }, Ie));
336
- }, Ke));
337
- }, pe = async (s) => {
338
- var x;
334
+ }), me = () => {
335
+ e.watermark && (X = setInterval(() => {
336
+ var r;
337
+ (((r = c.value) == null ? void 0 : r.store.paused) ?? !0) || (d.value = !0, $ = setTimeout(() => {
338
+ d.value = !1;
339
+ }, Fe));
340
+ }, Me));
341
+ }, ve = (r, v) => {
342
+ const i = () => {
343
+ v === W && (y.value = !0);
344
+ };
345
+ r.addEventListener(
346
+ "seeked",
347
+ () => {
348
+ r.readyState >= He ? i() : r.addEventListener("canplay", i, { once: !0 });
349
+ },
350
+ { once: !0 }
351
+ );
352
+ }, x = async (r) => {
353
+ var re;
339
354
  const v = ++W;
340
- await ke();
341
- const c = l.value, C = (x = i.value) == null ? void 0 : x.store;
342
- if (!(!c || !C) && (_ = !1, H = !1, s !== K.Progressive && await X(), v === W)) {
343
- if (e.resumeKey && De(c, e.resumeKey), Ae(c, () => T.value), Ve(
344
- c,
345
- (F) => n("progress", F),
355
+ await _e();
356
+ const i = l.value, C = (re = c.value) == null ? void 0 : re.store;
357
+ if (!(!i || !C) && (G = !1, I = !1, r !== B.Progressive && await Q(), v === W)) {
358
+ if (e.resumeKey && ze(i, e.resumeKey), Ke(i, () => a.value), Ne(
359
+ i,
360
+ (K) => n("progress", K),
346
361
  () => n("ended")
347
- ), b) {
348
- const { time: F, rate: me, playing: he } = b, ee = () => {
349
- b = null, F && (c.currentTime = F), c.playbackRate = me;
362
+ ), E) {
363
+ const { time: K, rate: Ee, playing: ke } = E, se = () => {
364
+ E = null, K && (i.currentTime = K), i.playbackRate = Ee;
350
365
  };
351
- he ? Me(c, ee) : c.addEventListener("loadedmetadata", ee, { once: !0 });
366
+ ke ? Ue(i, se) : (i.preload = "auto", i.addEventListener("loadedmetadata", se, { once: !0 }), K && ve(i, v));
352
367
  }
353
- s === K.Hls && h ? He(
354
- c,
355
- h,
356
- Q(e.hlsSrc, s)
357
- ) : s === K.Dash ? Fe(
358
- c,
359
- Q(e.dashSrc, s)
360
- ) : We(c, e.sources ?? []), d.value = C.controlsVisible, z = C.subscribe(() => {
361
- d.value = C.controlsVisible;
362
- }), de();
368
+ r === B.Hls && w ? je(
369
+ i,
370
+ w,
371
+ Z(e.hlsSrc, r)
372
+ ) : r === B.Dash ? qe(
373
+ i,
374
+ Z(e.dashSrc, r)
375
+ ) : Je(i, e.sources ?? []), p.value = C.controlsVisible, z = C.subscribe(() => {
376
+ p.value = C.controlsVisible;
377
+ }), me();
363
378
  }
364
379
  }, Y = () => {
365
- W++, a(), z == null || z(), z = void 0, clearInterval(q), clearTimeout(J), p.value = !1;
366
- }, Z = () => {
380
+ W++, m(), z == null || z(), z = void 0, clearInterval(X), clearTimeout($), d.value = !1;
381
+ }, he = () => {
382
+ const r = l.value;
383
+ r && I && (E = {
384
+ time: r.currentTime,
385
+ rate: r.playbackRate,
386
+ playing: !1
387
+ }), Y();
388
+ }, ee = () => {
367
389
  if (!o.value) return;
368
- const s = Ce(e, o.value, f.value);
369
- s !== u.value && (!s && u.value || (Y(), u.value = s, s && pe(s)));
370
- }, fe = async () => {
371
- const [s] = await Promise.all([
390
+ const r = Be(e, o.value, f.value);
391
+ r !== u.value && (!r && u.value || (Y(), u.value = r, r && x(r)));
392
+ }, ye = async () => {
393
+ const [r] = await Promise.all([
372
394
  e.hlsSrc ? import("@videojs/hlsjs-video") : null,
373
395
  e.hlsSrc ? import("@videojs/html/media/hlsjs-video") : null,
374
396
  e.dashSrc ? import("@videojs/html/media/dash-video") : null,
375
397
  import("@videojs/html/i18n"),
376
398
  import("@videojs/html/i18n/locales/uk/register"),
377
- Je(),
399
+ tt(),
378
400
  import("@videojs/html/video/skin")
379
401
  ]);
380
- return h = (s == null ? void 0 : s.Hls) ?? null, {
381
- hls: !!h && (h.isSupported() || !!document.createElement("video").canPlayType("application/vnd.apple.mpegurl")),
382
- dash: !!e.dashSrc && ze()
402
+ return w = (r == null ? void 0 : r.Hls) ?? null, {
403
+ hls: !!w && (w.isSupported() || !!document.createElement("video").canPlayType("application/vnd.apple.mpegurl")),
404
+ dash: !!e.dashSrc && Ge()
383
405
  };
384
- }, $ = async () => {
385
- o.value = await fe(), Z();
406
+ }, te = async () => {
407
+ o.value = await ye(), ee();
386
408
  };
387
- return se(f, Z), se(
409
+ return j(f, ee), j(
410
+ () => e.suspended,
411
+ (r) => {
412
+ u.value && (y.value = !1, r ? he() : x(u.value));
413
+ }
414
+ ), j(
388
415
  () => JSON.stringify([e.hlsSrc, e.dashSrc, e.sources]),
389
416
  () => {
390
- Y(), b = null, u.value = null, o.value = null, f.value = [], $();
417
+ Y(), E = null, y.value = !1, u.value = null, o.value = null, f.value = [], te();
391
418
  }
392
- ), Ee($), oe(Y), (s, v) => (R(), S("div", {
419
+ ), Re(te), le(Y), (r, v) => (S(), b("div", {
393
420
  class: "app-video",
394
421
  onKeydownCapture: v[0] || (v[0] = //@ts-ignore
395
- (...c) => w(m) && w(m)(...c)),
422
+ (...i) => _(k) && _(k)(...i)),
396
423
  onPointerdownCapture: v[1] || (v[1] = //@ts-ignore
397
- (...c) => w(E) && w(E)(...c)),
424
+ (...i) => _(g) && _(g)(...i)),
398
425
  onContextmenuCapture: v[2] || (v[2] = //@ts-ignore
399
- (...c) => w(g) && w(g)(...c))
426
+ (...i) => _(h) && _(h)(...i))
400
427
  }, [
401
- u.value ? (R(), S("media-i18n", {
428
+ u.value ? (S(), b("media-i18n", {
402
429
  key: u.value,
403
- lang: w(Le)
430
+ lang: _(Ve)
404
431
  }, [
405
- j("app-video-player", {
432
+ q("app-video-player", {
406
433
  ref_key: "playerEl",
407
- ref: i,
408
- poster: s.poster,
409
- "default-playback-rates": w(Oe)().join(" ")
434
+ ref: c,
435
+ poster: y.value ? void 0 : r.poster,
436
+ "default-playback-rates": _(Ie)().join(" ")
410
437
  }, [
411
- j("video-skin", Ze, [
412
- u.value === w(K).Hls ? (R(), S("hlsjs-video", {
413
- key: 0,
414
- ref_key: "mediaEl",
415
- ref: l,
416
- crossorigin: y.value,
417
- preload: "none",
418
- playsinline: ""
419
- }, [
420
- s.chaptersSrc ? (R(), S("track", {
421
- key: s.chaptersSrc,
422
- kind: "chapters",
423
- default: "",
424
- src: s.chaptersSrc
425
- }, null, 8, xe)) : L("", !0),
426
- s.thumbnailsSrc ? (R(), S("track", {
427
- key: s.thumbnailsSrc,
428
- kind: "metadata",
429
- label: "thumbnails",
430
- default: "",
431
- src: s.thumbnailsSrc
432
- }, null, 8, et)) : L("", !0)
433
- ], 8, $e)) : u.value === w(K).Dash ? (R(), S("dash-video", {
438
+ q("video-skin", at, [
439
+ r.suspended ? L("", !0) : (S(), b(ge, { key: 0 }, [
440
+ u.value === _(B).Hls ? (S(), b("hlsjs-video", {
441
+ key: 0,
442
+ ref_key: "mediaEl",
443
+ ref: l,
444
+ crossorigin: T.value,
445
+ preload: "none",
446
+ playsinline: ""
447
+ }, [
448
+ r.chaptersSrc ? (S(), b("track", {
449
+ key: r.chaptersSrc,
450
+ kind: "chapters",
451
+ default: "",
452
+ src: r.chaptersSrc
453
+ }, null, 8, ot)) : L("", !0),
454
+ r.thumbnailsSrc ? (S(), b("track", {
455
+ key: r.thumbnailsSrc,
456
+ kind: "metadata",
457
+ label: "thumbnails",
458
+ default: "",
459
+ src: r.thumbnailsSrc
460
+ }, null, 8, it)) : L("", !0)
461
+ ], 8, nt)) : u.value === _(B).Dash ? (S(), b("dash-video", {
462
+ key: 1,
463
+ ref_key: "mediaEl",
464
+ ref: l,
465
+ crossorigin: T.value,
466
+ preload: "none",
467
+ playsinline: ""
468
+ }, [
469
+ r.chaptersSrc ? (S(), b("track", {
470
+ key: r.chaptersSrc,
471
+ kind: "chapters",
472
+ default: "",
473
+ src: r.chaptersSrc
474
+ }, null, 8, ct)) : L("", !0),
475
+ r.thumbnailsSrc ? (S(), b("track", {
476
+ key: r.thumbnailsSrc,
477
+ kind: "metadata",
478
+ label: "thumbnails",
479
+ default: "",
480
+ src: r.thumbnailsSrc
481
+ }, null, 8, ut)) : L("", !0)
482
+ ], 8, lt)) : (S(), b("video", {
483
+ key: 2,
484
+ ref_key: "mediaEl",
485
+ ref: l,
486
+ crossorigin: T.value,
487
+ preload: "none",
488
+ playsinline: ""
489
+ }, [
490
+ r.chaptersSrc ? (S(), b("track", {
491
+ key: r.chaptersSrc,
492
+ kind: "chapters",
493
+ default: "",
494
+ src: r.chaptersSrc
495
+ }, null, 8, pt)) : L("", !0),
496
+ r.thumbnailsSrc ? (S(), b("track", {
497
+ key: r.thumbnailsSrc,
498
+ kind: "metadata",
499
+ label: "thumbnails",
500
+ default: "",
501
+ src: r.thumbnailsSrc
502
+ }, null, 8, ft)) : L("", !0)
503
+ ], 8, dt))
504
+ ], 64)),
505
+ r.watermark ? (S(), b("div", {
434
506
  key: 1,
435
- ref_key: "mediaEl",
436
- ref: l,
437
- crossorigin: y.value,
438
- preload: "none",
439
- playsinline: ""
440
- }, [
441
- s.chaptersSrc ? (R(), S("track", {
442
- key: s.chaptersSrc,
443
- kind: "chapters",
444
- default: "",
445
- src: s.chaptersSrc
446
- }, null, 8, rt)) : L("", !0),
447
- s.thumbnailsSrc ? (R(), S("track", {
448
- key: s.thumbnailsSrc,
449
- kind: "metadata",
450
- label: "thumbnails",
451
- default: "",
452
- src: s.thumbnailsSrc
453
- }, null, 8, st)) : L("", !0)
454
- ], 8, tt)) : (R(), S("video", {
455
- key: 2,
456
- ref_key: "mediaEl",
457
- ref: l,
458
- crossorigin: y.value,
459
- preload: "none",
460
- playsinline: ""
461
- }, [
462
- s.chaptersSrc ? (R(), S("track", {
463
- key: s.chaptersSrc,
464
- kind: "chapters",
465
- default: "",
466
- src: s.chaptersSrc
467
- }, null, 8, nt)) : L("", !0),
468
- s.thumbnailsSrc ? (R(), S("track", {
469
- key: s.thumbnailsSrc,
470
- kind: "metadata",
471
- label: "thumbnails",
472
- default: "",
473
- src: s.thumbnailsSrc
474
- }, null, 8, ot)) : L("", !0)
475
- ], 8, at)),
476
- s.watermark ? (R(), S("div", {
477
- key: 3,
478
- class: ae(["app-video__watermark", {
479
- "app-video__watermark_visible": p.value,
480
- "app-video__watermark_raised": d.value
507
+ class: oe(["app-video__watermark", {
508
+ "app-video__watermark_visible": d.value,
509
+ "app-video__watermark_raised": p.value
481
510
  }])
482
- }, be(s.watermark), 3)) : L("", !0),
483
- j("div", {
484
- class: ae(["app-video__boost", { "app-video__boost_visible": w(T) }])
511
+ }, we(r.watermark), 3)) : L("", !0),
512
+ q("div", {
513
+ class: oe(["app-video__boost", { "app-video__boost_visible": _(a) }])
485
514
  }, " 2× ", 2)
486
515
  ])
487
- ], 8, Qe)
488
- ], 8, Xe)) : L("", !0)
516
+ ], 8, st)
517
+ ], 8, rt)) : L("", !0)
489
518
  ], 32));
490
519
  }
491
- }), pt = /* @__PURE__ */ Ne(it, [["__scopeId", "data-v-db629255"]]);
520
+ }), kt = /* @__PURE__ */ We(mt, [["__scopeId", "data-v-2afe5d0a"]]);
492
521
  export {
493
- pt as AppVideo
522
+ kt as AppVideo
494
523
  };