@validol4ik/uikit 0.14.4 → 0.14.6

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