@webitel/ui-sdk 26.2.70 → 26.2.72

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 (97) hide show
  1. package/dist/{errors-DCJKAXTz.js → errors-CTL-RV3B.js} +1 -1
  2. package/dist/{index-B71drQtj.js → index-DWA4o3XJ.js} +4 -4
  3. package/dist/{index-cVwBpL1P.js → index-pMfSnCae.js} +1 -1
  4. package/dist/{install-BEn6vjFW.js → install-UIKG1ERr.js} +9496 -8874
  5. package/dist/{isObject-DB0eH0MA.js → isObject-B3V85Sws.js} +1 -1
  6. package/dist/prod-BoQuiIB3.js +973 -0
  7. package/dist/srt-parser-CsN7bp5E.js +26 -0
  8. package/dist/ssa-parser-BJOOPeQF.js +200 -0
  9. package/dist/ui-sdk.css +1 -1
  10. package/dist/ui-sdk.js +1 -1
  11. package/dist/ui-sdk.umd.cjs +464 -482
  12. package/dist/vidstack-Bq6c3Bam-pb8Xltql.js +425 -0
  13. package/dist/vidstack-D2pY00kU-DiDeMWBZ.js +135 -0
  14. package/dist/vidstack-DDXt6fpN-BJpO5v6W.js +50 -0
  15. package/dist/vidstack-D_-9AA6_-D9IZ6RtF.js +20 -0
  16. package/dist/{vidstack-Dm1xEU9Q-qSXq3AI-.js → vidstack-Dm1xEU9Q-CXHNvShT.js} +10 -11
  17. package/dist/vidstack-DqAw8m9J-R8izgrMK.js +22 -0
  18. package/dist/vidstack-audio-RReC5vyt.js +28 -0
  19. package/dist/vidstack-dash-DW7Ue8Mf.js +392 -0
  20. package/dist/vidstack-google-cast-C0U2wzqB.js +382 -0
  21. package/dist/vidstack-hls-BZgfDsGk.js +309 -0
  22. package/dist/vidstack-krOAtKMi-C50BTxmn.js +28 -0
  23. package/dist/vidstack-video-CI2rq89j.js +163 -0
  24. package/dist/vidstack-vimeo-CgwZpCSk.js +451 -0
  25. package/dist/vidstack-youtube-BYXk8CK9.js +232 -0
  26. package/dist/{wt-action-bar-ColV1kXE.js → wt-action-bar-DR8FqGoN.js} +1 -1
  27. package/dist/{wt-button-select-CfoSEYMj.js → wt-button-select-DZ_mMZr7.js} +1 -1
  28. package/dist/{wt-chat-emoji-Bgv9Viz-.js → wt-chat-emoji-Bx7YenHF.js} +6 -11
  29. package/dist/{wt-confirm-dialog-bVhuyR-Q.js → wt-confirm-dialog-Bmt7hVhO.js} +1 -1
  30. package/dist/{wt-context-menu-Cd8pgBRV.js → wt-context-menu-DEonPBI7.js} +1 -1
  31. package/dist/{wt-copy-action-jjp1mO2h.js → wt-copy-action-DQZ5qUUm.js} +1 -1
  32. package/dist/wt-datepicker-DRUiK--W.js +5660 -0
  33. package/dist/wt-display-chip-items-x25aFJxY.js +46 -0
  34. package/dist/{wt-dual-panel-DJsiR6RF.js → wt-dual-panel-0fDOCrlS.js} +1 -1
  35. package/dist/{wt-dummy-O94iGdZS.js → wt-dummy-CFcLvVwn.js} +1 -1
  36. package/dist/{wt-error-page-xgSWJ65z.js → wt-error-page-CebFt3Gg.js} +1 -1
  37. package/dist/{wt-expansion-panel-vzG02b62.js → wt-expansion-panel-cJWQaqAc.js} +1 -1
  38. package/dist/{wt-filters-panel-wrapper-h-UaAMuF.js → wt-filters-panel-wrapper-4-k7czbS.js} +1 -1
  39. package/dist/wt-galleria-Ds-HZvJq.js +322 -0
  40. package/dist/{wt-navigation-menu-Cu5Y9kua.js → wt-navigation-menu-DqnvQB3G.js} +2 -5
  41. package/dist/wt-notifications-bar-Bmww4vJb.js +79 -0
  42. package/dist/{wt-page-header-DlRrRzG7.js → wt-page-header-6lJKDnEs.js} +1 -1
  43. package/dist/{wt-pagination-CW46I4u2.js → wt-pagination-D7BhUkrI.js} +1 -1
  44. package/dist/{wt-player-3qh_Jzm2.js → wt-player-Bx_9-9R6.js} +1 -1
  45. package/dist/{wt-popover-BTG5bUP0.js → wt-popover-U7JE0uoX.js} +19 -22
  46. package/dist/{wt-search-bar-CTsNf7bp.js → wt-search-bar-BfHsofcU.js} +25 -28
  47. package/dist/{wt-selection-popup-DvaUvY4O.js → wt-selection-popup-B5Wt1WQk.js} +1 -1
  48. package/dist/{wt-start-page-CcN7JC_u.js → wt-start-page-8ywFCoUJ.js} +7 -7
  49. package/dist/{wt-status-select-C8t0cgTg.js → wt-status-select-CFdNgbIP.js} +1 -1
  50. package/dist/{wt-stepper-BLb42q2I.js → wt-stepper-59a_rP7o.js} +1 -1
  51. package/dist/{wt-table-9gmsV0Y9.js → wt-table-DuxjiiFi.js} +111 -114
  52. package/dist/{wt-table-actions-BB7AH7sR.js → wt-table-actions-CsrvF6d8.js} +1 -1
  53. package/dist/{wt-table-column-select-B3lrCEaV.js → wt-table-column-select-Zga4Zyfd.js} +28 -31
  54. package/dist/{wt-tabs-CCHi_E1a.js → wt-tabs-CMMlNgqE.js} +1 -1
  55. package/dist/{wt-tags-input-DLicKjv3.js → wt-tags-input-O1wer3-w.js} +56 -57
  56. package/dist/{wt-timepicker-B9ONDzNQ.js → wt-timepicker-BscP21YM.js} +1 -1
  57. package/dist/{wt-tree-cQlvJmh5.js → wt-tree-BRPd5QbE.js} +4 -5
  58. package/dist/{wt-tree-table-B89YKiMf.js → wt-tree-table-CZQ7xmja.js} +5 -5
  59. package/dist/{wt-type-extension-value-input-Da8FXLDs.js → wt-type-extension-value-input-DZqeSLGx.js} +214 -218
  60. package/dist/wt-vidstack-player-CA18U-L9.js +10229 -0
  61. package/package.json +5 -5
  62. package/src/components/wt-button/wt-button.vue +9 -13
  63. package/src/install.ts +0 -1
  64. package/src/locale/i18n.js +1 -1
  65. package/src/modules/Notifications/store/NotificationsStoreModule.js +1 -1
  66. package/src/modules/Userinfo/classes/ApplicationsAccess.ts +36 -3
  67. package/src/modules/Userinfo/scripts/utils.ts +2 -22
  68. package/src/modules/Userinfo/stores/accessStore.ts +20 -5
  69. package/src/modules/Userinfo/types/UserAccess.d.ts +11 -3
  70. package/types/locale/i18n.d.ts +1 -1
  71. package/types/modules/Notifications/store/NotificationsStoreModule.d.ts +1 -1
  72. package/types/modules/Userinfo/classes/ApplicationsAccess.d.ts +34 -243
  73. package/types/modules/Userinfo/scripts/utils.d.ts +1 -2
  74. package/types/modules/Userinfo/stores/accessStore.d.ts +1 -1
  75. package/types/modules/Userinfo/stores/userinfoStore.d.ts +21 -9
  76. package/dist/prod-DTLJXtPo.js +0 -994
  77. package/dist/srt-parser-CWqahKwO.js +0 -27
  78. package/dist/ssa-parser-BqjjKy4M.js +0 -209
  79. package/dist/vidstack-Bq6c3Bam-w5y-QQDX.js +0 -413
  80. package/dist/vidstack-D2pY00kU-BI5rYx7p.js +0 -138
  81. package/dist/vidstack-DDXt6fpN-QZPrP2dy.js +0 -60
  82. package/dist/vidstack-D_-9AA6_-Bo1xPN-G.js +0 -20
  83. package/dist/vidstack-DqAw8m9J-DL7LzrFt.js +0 -29
  84. package/dist/vidstack-audio-lX1O0fza.js +0 -32
  85. package/dist/vidstack-dash-BQkRGWe_.js +0 -403
  86. package/dist/vidstack-google-cast-C39n-PU1.js +0 -377
  87. package/dist/vidstack-hls-BCLhCuNJ.js +0 -324
  88. package/dist/vidstack-krOAtKMi-B4IZWKdc.js +0 -29
  89. package/dist/vidstack-video-BgayrEIC.js +0 -181
  90. package/dist/vidstack-vimeo-Lpe7iySs.js +0 -437
  91. package/dist/vidstack-youtube-Dmcz0xVm.js +0 -236
  92. package/dist/vuex.esm-bundler-tZVctzTj.js +0 -950
  93. package/dist/wt-datepicker-Cs3xDzVq.js +0 -5789
  94. package/dist/wt-display-chip-items-IqNMxa_X.js +0 -52
  95. package/dist/wt-galleria-cDjsiOcp.js +0 -324
  96. package/dist/wt-notifications-bar-KNH47kZ7.js +0 -80
  97. package/dist/wt-vidstack-player-BzFbIwCa.js +0 -10250
@@ -1,27 +0,0 @@
1
- import { V as c, a as i, b as a } from "./prod-DTLJXtPo.js";
2
- const n = /,/g, u = "-->";
3
- class o extends c {
4
- parse(s, e) {
5
- var h, r;
6
- if (s === "")
7
- this.c && (this.l.push(this.c), (r = (h = this.h).onCue) == null || r.call(h, this.c), this.c = null), this.e = i.None;
8
- else if (this.e === i.Cue)
9
- this.c.text += (this.c.text ? `
10
- ` : "") + s;
11
- else if (s.includes(u)) {
12
- const t = this.q(s, e);
13
- t && (this.c = new a(t[0], t[1], t[2].join(" ")), this.c.id = this.n, this.e = i.Cue);
14
- }
15
- this.n = s;
16
- }
17
- q(s, e) {
18
- return super.q(s.replace(n, "."), e);
19
- }
20
- }
21
- function l() {
22
- return new o();
23
- }
24
- export {
25
- o as SRTParser,
26
- l as default
27
- };
@@ -1,209 +0,0 @@
1
- var F = Object.defineProperty;
2
- var A = (c, t, s) => t in c ? F(c, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : c[t] = s;
3
- var u = (c, t, s) => A(c, typeof t != "symbol" ? t + "" : t, s);
4
- import { b as L, p as y } from "./prod-DTLJXtPo.js";
5
- const S = /^Format:[\s\t]*/, O = /^Style:[\s\t]*/, _ = /^Dialogue:[\s\t]*/, d = /[\s\t]*,[\s\t]*/, w = /\{[^}]+\}/g, I = /\\N/g, x = /^\[(.*)[\s\t]?Styles\]$/, k = /^\[(.*)[\s\t]?Events\]$/;
6
- class $ {
7
- constructor() {
8
- u(this, "h");
9
- u(this, "O", 0);
10
- u(this, "c", null);
11
- u(this, "l", []);
12
- u(this, "m", []);
13
- u(this, "N", null);
14
- u(this, "f");
15
- u(this, "P", {});
16
- }
17
- async init(t) {
18
- this.h = t, t.errors && (this.f = (await import("./errors-DCJKAXTz.js")).ParseErrorBuilder);
19
- }
20
- parse(t, s) {
21
- var e, a;
22
- if (this.O)
23
- switch (this.O) {
24
- case 1:
25
- if (t === "")
26
- this.O = 0;
27
- else if (O.test(t))
28
- if (this.N) {
29
- const i = t.replace(O, "").split(d);
30
- this.S(i);
31
- } else
32
- this.g((e = this.f) == null ? void 0 : e.T("Style", s));
33
- else S.test(t) ? this.N = t.replace(S, "").split(d) : k.test(t) && (this.N = null, this.O = 2);
34
- break;
35
- case 2:
36
- if (t === "")
37
- this.Q();
38
- else if (_.test(t))
39
- if (this.Q(), this.N) {
40
- const i = t.replace(_, "").split(d), r = this.U(i, s);
41
- r && (this.c = r);
42
- } else
43
- this.g((a = this.f) == null ? void 0 : a.T("Dialogue", s));
44
- else this.c ? this.c.text += `
45
- ` + t.replace(w, "").replace(I, `
46
- `) : S.test(t) ? this.N = t.replace(S, "").split(d) : x.test(t) ? (this.N = null, this.O = 1) : k.test(t) && (this.N = null);
47
- }
48
- else t === "" || (x.test(t) ? (this.N = null, this.O = 1) : k.test(t) && (this.N = null, this.O = 2));
49
- }
50
- done() {
51
- return {
52
- metadata: {},
53
- cues: this.l,
54
- regions: [],
55
- errors: this.m
56
- };
57
- }
58
- Q() {
59
- var t, s;
60
- this.c && (this.l.push(this.c), (s = (t = this.h).onCue) == null || s.call(t, this.c), this.c = null);
61
- }
62
- S(t) {
63
- let s = "Default", e = {}, a, i = "center", r = "bottom", f, n = 1.2, o, p, h = 3, b = [];
64
- for (let g = 0; g < this.N.length; g++) {
65
- const M = this.N[g], l = t[g];
66
- switch (M) {
67
- case "Name":
68
- s = l;
69
- break;
70
- case "Fontname":
71
- e["font-family"] = l;
72
- break;
73
- case "Fontsize":
74
- e["font-size"] = `calc(${l} / var(--overlay-height))`;
75
- break;
76
- case "PrimaryColour":
77
- const E = N(l);
78
- E && (e["--cue-color"] = E);
79
- break;
80
- case "BorderStyle":
81
- h = parseInt(l, 10);
82
- break;
83
- case "BackColour":
84
- p = N(l);
85
- break;
86
- case "OutlineColour":
87
- const R = N(l);
88
- R && (o = R);
89
- break;
90
- case "Bold":
91
- parseInt(l) && (e["font-weight"] = "bold");
92
- break;
93
- case "Italic":
94
- parseInt(l) && (e["font-style"] = "italic");
95
- break;
96
- case "Underline":
97
- parseInt(l) && (e["text-decoration"] = "underline");
98
- break;
99
- case "StrikeOut":
100
- parseInt(l) && (e["text-decoration"] = "line-through");
101
- break;
102
- case "Spacing":
103
- e["letter-spacing"] = l + "px";
104
- break;
105
- case "AlphaLevel":
106
- e.opacity = parseFloat(l);
107
- break;
108
- case "ScaleX":
109
- b.push(`scaleX(${parseFloat(l) / 100})`);
110
- break;
111
- case "ScaleY":
112
- b.push(`scaleY(${parseFloat(l) / 100})`);
113
- break;
114
- case "Angle":
115
- b.push(`rotate(${l}deg)`);
116
- break;
117
- case "Shadow":
118
- n = parseInt(l, 10) * 1.2;
119
- break;
120
- case "MarginL":
121
- e["--cue-width"] = "auto", e["--cue-left"] = parseFloat(l) + "px";
122
- break;
123
- case "MarginR":
124
- e["--cue-width"] = "auto", e["--cue-right"] = parseFloat(l) + "px";
125
- break;
126
- case "MarginV":
127
- f = parseFloat(l);
128
- break;
129
- case "Outline":
130
- a = parseInt(l, 10);
131
- break;
132
- case "Alignment":
133
- const m = parseInt(l, 10);
134
- switch (m >= 4 && (r = m >= 7 ? "top" : "center"), m % 3) {
135
- case 1:
136
- i = "start";
137
- break;
138
- case 2:
139
- i = "center";
140
- break;
141
- case 3:
142
- i = "end";
143
- break;
144
- }
145
- }
146
- }
147
- if (e.R = r, e["--cue-white-space"] = "normal", e["--cue-line-height"] = "normal", e["--cue-text-align"] = i, r === "center" ? (e["--cue-top"] = "50%", b.push("translateY(-50%)")) : e[`--cue-${r}`] = (f || 0) + "px", h === 1 && (e["--cue-padding-y"] = "0"), (h === 1 || p) && (e["--cue-bg-color"] = h === 1 ? "none" : p), h === 3 && o && (e["--cue-outline"] = `${a}px solid ${o}`), h === 1 && typeof a == "number") {
148
- const g = p ?? "#000";
149
- e["--cue-text-shadow"] = [
150
- o && T(a * 1.2, n * 1.2, o),
151
- o ? T(a * (a / 2), n * (a / 2), g) : T(a, n, g)
152
- ].filter(Boolean).join(", ");
153
- }
154
- b.length && (e["--cue-transform"] = b.join(" ")), this.P[s] = e;
155
- }
156
- U(t, s) {
157
- const e = this.V(t), a = this.q(e.Start, e.End, s);
158
- if (!a)
159
- return;
160
- const i = new L(a[0], a[1], ""), r = { ...this.P[e.Style] || {} }, f = e.Name ? `<v ${e.Name}>` : "", n = r.R, o = e.MarginL && parseFloat(e.MarginL), p = e.MarginR && parseFloat(e.MarginR), h = e.MarginV && parseFloat(e.MarginV);
161
- return o && (r["--cue-width"] = "auto", r["--cue-left"] = o + "px"), p && (r["--cue-width"] = "auto", r["--cue-right"] = p + "px"), h && n !== "center" && (r[`--cue-${n}`] = h + "px"), i.text = f + t.slice(this.N.length - 1).join(", ").replace(w, "").replace(I, `
162
- `), delete r.R, Object.keys(r).length && (i.style = r), i;
163
- }
164
- V(t) {
165
- const s = {};
166
- for (let e = 0; e < this.N.length; e++)
167
- s[this.N[e]] = t[e];
168
- return s;
169
- }
170
- q(t, s, e) {
171
- var r, f, n;
172
- const a = y(t), i = y(s);
173
- if (a !== null && i !== null && i > a)
174
- return [a, i];
175
- a === null && this.g((r = this.f) == null ? void 0 : r.s(t, e)), i === null && this.g((f = this.f) == null ? void 0 : f.t(s, e)), a != null && i !== null && i > a && this.g((n = this.f) == null ? void 0 : n.u(a, i, e));
176
- }
177
- g(t) {
178
- var s, e;
179
- if (t) {
180
- if (this.m.push(t), this.h.strict)
181
- throw this.h.cancel(), t;
182
- (e = (s = this.h).onError) == null || e.call(s, t);
183
- }
184
- }
185
- }
186
- function N(c) {
187
- const t = parseInt(c.replace("&H", ""), 16);
188
- if (t >= 0) {
189
- const e = (t >> 24 & 255 ^ 255) / 255, a = t >> 16 & 255, i = t >> 8 & 255;
190
- return "rgba(" + [t & 255, i, a, e].join(",") + ")";
191
- }
192
- return null;
193
- }
194
- function T(c, t, s) {
195
- const e = Math.ceil(2 * Math.PI * c);
196
- let a = "";
197
- for (let i = 0; i < e; i++) {
198
- const r = 2 * Math.PI * i / e;
199
- a += c * Math.cos(r) + "px " + t * Math.sin(r) + "px 0 " + s + (i == e - 1 ? "" : ",");
200
- }
201
- return a;
202
- }
203
- function v() {
204
- return new $();
205
- }
206
- export {
207
- $ as SSAParser,
208
- v as default
209
- };
@@ -1,413 +0,0 @@
1
- var Qt = Object.defineProperty;
2
- var ot = (n) => {
3
- throw TypeError(n);
4
- };
5
- var Xt = (n, t, s) => t in n ? Qt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[t] = s;
6
- var M = (n, t, s) => Xt(n, typeof t != "symbol" ? t + "" : t, s), X = (n, t, s) => t.has(n) || ot("Cannot " + s);
7
- var i = (n, t, s) => (X(n, t, "read from private field"), s ? s.call(n) : t.get(n)), d = (n, t, s) => t.has(n) ? ot("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, s), c = (n, t, s, r) => (X(n, t, "write to private field"), r ? r.call(n, s) : t.set(n, s), s), a = (n, t, s) => (X(n, t, "access private method"), s);
8
- import { b as Yt, o as ut, d as q, i as Zt, f as ti, E as nt, e as lt, g as _, h as ii, j as ei, p as si, k as ai, l as rt, m as dt, D as ni, L as Y, n as Z } from "./wt-vidstack-player-BzFbIwCa.js";
9
- import { R as ri } from "./vidstack-DqAw8m9J-DL7LzrFt.js";
10
- let B = null, K = [], z = [];
11
- function ht() {
12
- return B ?? (B = new AudioContext());
13
- }
14
- function hi() {
15
- const n = ht(), t = n.createGain();
16
- return t.connect(n.destination), K.push(t), t;
17
- }
18
- function oi(n, t) {
19
- const s = ht(), r = s.createMediaElementSource(n);
20
- return t && r.connect(t), z.push(r), r;
21
- }
22
- function di(n) {
23
- const t = K.indexOf(n);
24
- t !== -1 && (K.splice(t, 1), n.disconnect(), ft());
25
- }
26
- function ci(n) {
27
- const t = z.indexOf(n);
28
- t !== -1 && (z.splice(t, 1), n.disconnect(), ft());
29
- }
30
- function ft() {
31
- B && K.length === 0 && z.length === 0 && B.close().then(() => {
32
- B = null;
33
- });
34
- }
35
- var R, E, m, p, P, mt, tt;
36
- class ui {
37
- constructor(t, s) {
38
- d(this, P);
39
- d(this, R);
40
- d(this, E);
41
- d(this, m, null);
42
- d(this, p, null);
43
- c(this, R, t), c(this, E, s);
44
- }
45
- get currentGain() {
46
- var t, s;
47
- return ((s = (t = i(this, m)) == null ? void 0 : t.gain) == null ? void 0 : s.value) ?? null;
48
- }
49
- get supported() {
50
- return !0;
51
- }
52
- setGain(t) {
53
- const s = this.currentGain;
54
- if (t !== this.currentGain) {
55
- if (t === 1 && s !== 1) {
56
- this.removeGain();
57
- return;
58
- }
59
- i(this, m) || (c(this, m, hi()), i(this, p) && i(this, p).connect(i(this, m))), i(this, p) || c(this, p, oi(i(this, R), i(this, m))), i(this, m).gain.value = t, i(this, E).call(this, t);
60
- }
61
- }
62
- removeGain() {
63
- i(this, m) && (i(this, p) && i(this, p).connect(ht().destination), a(this, P, tt).call(this), i(this, E).call(this, null));
64
- }
65
- destroy() {
66
- a(this, P, mt).call(this), a(this, P, tt).call(this);
67
- }
68
- }
69
- R = new WeakMap(), E = new WeakMap(), m = new WeakMap(), p = new WeakMap(), P = new WeakSet(), mt = function() {
70
- if (i(this, p))
71
- try {
72
- ci(i(this, p));
73
- } catch {
74
- } finally {
75
- c(this, p, null);
76
- }
77
- }, tt = function() {
78
- if (i(this, m))
79
- try {
80
- di(i(this, m));
81
- } catch {
82
- } finally {
83
- c(this, m, null);
84
- }
85
- };
86
- const li = ["focus", "blur", "visibilitychange", "pageshow", "pagehide"];
87
- var k, A, D, J, pt;
88
- class fi {
89
- constructor() {
90
- d(this, J);
91
- d(this, k, Z(ct()));
92
- d(this, A, Z(document.visibilityState));
93
- d(this, D);
94
- }
95
- connect() {
96
- const t = new nt(window), s = a(this, J, pt).bind(this);
97
- for (const r of li)
98
- t.add(r, s);
99
- _ && t.add("beforeunload", (r) => {
100
- c(this, D, setTimeout(() => {
101
- r.defaultPrevented || r.returnValue.length > 0 || (i(this, k).set("hidden"), i(this, A).set("hidden"));
102
- }, 0));
103
- });
104
- }
105
- /**
106
- * The current page state. Important to note we only account for a subset of page states, as
107
- * the rest aren't valuable to the player at the moment.
108
- *
109
- * - **active:** A page is in the active state if it is visible and has input focus.
110
- * - **passive:** A page is in the passive state if it is visible and does not have input focus.
111
- * - **hidden:** A page is in the hidden state if it is not visible.
112
- *
113
- * @see https://developers.google.com/web/updates/2018/07/page-lifecycle-api#states
114
- */
115
- get pageState() {
116
- return i(this, k).call(this);
117
- }
118
- /**
119
- * The current document visibility state.
120
- *
121
- * - **visible:** The page content may be at least partially visible. In practice, this means that
122
- * the page is the foreground tab of a non-minimized window.
123
- * - **hidden:** The page content is not visible to the user. In practice this means that the
124
- * document is either a background tab or part of a minimized window, or the OS screen lock is
125
- * active.
126
- *
127
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState
128
- */
129
- get visibility() {
130
- return i(this, A).call(this);
131
- }
132
- }
133
- k = new WeakMap(), A = new WeakMap(), D = new WeakMap(), J = new WeakSet(), pt = function(t) {
134
- _ && window.clearTimeout(i(this, D)), (t.type !== "blur" || i(this, k).call(this) === "active") && (i(this, k).set(ct(t)), i(this, A).set(document.visibilityState == "hidden" ? "hidden" : "visible"));
135
- };
136
- function ct(n) {
137
- return (n == null ? void 0 : n.type) === "blur" || document.visibilityState === "hidden" ? "hidden" : document.hasFocus() ? "active" : "passive";
138
- }
139
- var O, h, b, L, x, S, I, $, e, o, yt, G, N, gt, bt, vt, Tt, Q, at, u, pi, T, kt, it, St, wt, Pt, W, Ct, Et, At, Lt, xt, $t, Gt, Nt, Mt, Rt, Dt, Ot, It, Ht, Ft, Ut, Vt, jt;
140
- class mi {
141
- constructor(t, s) {
142
- d(this, e);
143
- d(this, O);
144
- d(this, h);
145
- d(this, b, !1);
146
- d(this, L, !1);
147
- d(this, x, !1);
148
- d(this, S, new ri(a(this, e, gt).bind(this)));
149
- d(this, I, new fi());
150
- d(this, $);
151
- /**
152
- * The `timeupdate` event fires surprisingly infrequently during playback, meaning your progress
153
- * bar (or whatever else is synced to the currentTime) moves in a choppy fashion. This helps
154
- * resolve that by retrieving time updates in a request animation frame loop.
155
- */
156
- d(this, G, 0);
157
- d(this, N, -1);
158
- d(this, Q);
159
- d(this, at);
160
- c(this, O, t), c(this, h, s), c(this, $, new nt(t.media)), a(this, e, bt).call(this), i(this, I).connect(), lt(a(this, e, Mt).bind(this)), ut(a(this, e, yt).bind(this));
161
- }
162
- }
163
- O = new WeakMap(), h = new WeakMap(), b = new WeakMap(), L = new WeakMap(), x = new WeakMap(), S = new WeakMap(), I = new WeakMap(), $ = new WeakMap(), e = new WeakSet(), o = function() {
164
- return i(this, O).media;
165
- }, yt = function() {
166
- var t;
167
- c(this, L, !1), c(this, x, !1), i(this, S).stop(), i(this, $).abort(), (t = i(this, Q)) == null || t.clear();
168
- }, G = new WeakMap(), N = new WeakMap(), gt = function() {
169
- const t = i(this, e, o).currentTime;
170
- !(_ && t - i(this, N) < 0.35) && i(this, G) !== t && (a(this, e, T).call(this, t), c(this, G, t));
171
- }, bt = function() {
172
- a(this, e, u).call(this, "loadstart", a(this, e, kt)), a(this, e, u).call(this, "abort", a(this, e, it)), a(this, e, u).call(this, "emptied", a(this, e, St)), a(this, e, u).call(this, "error", a(this, e, jt)), a(this, e, u).call(this, "volumechange", a(this, e, Ot));
173
- }, vt = function() {
174
- i(this, L) || (a(this, e, u).call(this, "loadeddata", a(this, e, wt)), a(this, e, u).call(this, "loadedmetadata", a(this, e, Pt)), a(this, e, u).call(this, "canplay", a(this, e, At)), a(this, e, u).call(this, "canplaythrough", a(this, e, Lt)), a(this, e, u).call(this, "durationchange", a(this, e, Dt)), a(this, e, u).call(this, "play", a(this, e, Ct)), a(this, e, u).call(this, "progress", a(this, e, Ft)), a(this, e, u).call(this, "stalled", a(this, e, $t)), a(this, e, u).call(this, "suspend", a(this, e, Ut)), a(this, e, u).call(this, "ratechange", a(this, e, Vt)), c(this, L, !0));
175
- }, Tt = function() {
176
- i(this, x) || (a(this, e, u).call(this, "pause", a(this, e, Et)), a(this, e, u).call(this, "playing", a(this, e, xt)), a(this, e, u).call(this, "seeked", a(this, e, It)), a(this, e, u).call(this, "seeking", a(this, e, Ht)), a(this, e, u).call(this, "ended", a(this, e, Nt)), a(this, e, u).call(this, "waiting", a(this, e, Gt)), c(this, x, !0));
177
- }, Q = new WeakMap(), at = new WeakMap(), u = function(t, s) {
178
- i(this, $).add(t, s.bind(this));
179
- }, pi = function(t) {
180
- }, T = function(t, s) {
181
- const r = Math.min(t, i(this, h).$state.seekableEnd());
182
- i(this, h).notify("time-change", r, s);
183
- }, kt = function(t) {
184
- if (i(this, e, o).networkState === 3) {
185
- a(this, e, it).call(this, t);
186
- return;
187
- }
188
- a(this, e, vt).call(this), i(this, h).notify("load-start", void 0, t);
189
- }, it = function(t) {
190
- i(this, h).notify("abort", void 0, t);
191
- }, St = function() {
192
- i(this, h).notify("emptied", void 0, event);
193
- }, wt = function(t) {
194
- i(this, h).notify("loaded-data", void 0, t);
195
- }, Pt = function(t) {
196
- c(this, G, 0), c(this, N, -1), a(this, e, Tt).call(this), i(this, h).notify("loaded-metadata", void 0, t), (ii || _ && ei(i(this, h).$state.source())) && i(this, h).delegate.ready(a(this, e, W).call(this), t);
197
- }, W = function() {
198
- return {
199
- provider: si(i(this, h).$provider),
200
- duration: i(this, e, o).duration,
201
- buffered: i(this, e, o).buffered,
202
- seekable: i(this, e, o).seekable
203
- };
204
- }, Ct = function(t) {
205
- i(this, h).$state.canPlay && i(this, h).notify("play", void 0, t);
206
- }, Et = function(t) {
207
- i(this, e, o).readyState === 1 && !i(this, b) || (c(this, b, !1), i(this, S).stop(), i(this, h).notify("pause", void 0, t));
208
- }, At = function(t) {
209
- i(this, h).delegate.ready(a(this, e, W).call(this), t);
210
- }, Lt = function(t) {
211
- i(this, h).$state.started() || i(this, h).notify("can-play-through", a(this, e, W).call(this), t);
212
- }, xt = function(t) {
213
- i(this, e, o).paused || (c(this, b, !1), i(this, h).notify("playing", void 0, t), i(this, S).start());
214
- }, $t = function(t) {
215
- i(this, h).notify("stalled", void 0, t), i(this, e, o).readyState < 3 && (c(this, b, !0), i(this, h).notify("waiting", void 0, t));
216
- }, Gt = function(t) {
217
- i(this, e, o).readyState < 3 && (c(this, b, !0), i(this, h).notify("waiting", void 0, t));
218
- }, Nt = function(t) {
219
- i(this, S).stop(), a(this, e, T).call(this, i(this, e, o).duration, t), i(this, h).notify("end", void 0, t), i(this, h).$state.loop() && ai(i(this, e, o).controls) && (i(this, e, o).controls = !1);
220
- }, Mt = function() {
221
- const t = i(this, h).$state.paused(), s = i(this, I).visibility === "hidden";
222
- (t || s) && rt(i(this, e, o), "timeupdate", a(this, e, Rt).bind(this));
223
- }, Rt = function(t) {
224
- a(this, e, T).call(this, i(this, e, o).currentTime, t);
225
- }, Dt = function(t) {
226
- i(this, h).$state.ended() && a(this, e, T).call(this, i(this, e, o).duration, t), i(this, h).notify("duration-change", i(this, e, o).duration, t);
227
- }, Ot = function(t) {
228
- const s = {
229
- volume: i(this, e, o).volume,
230
- muted: i(this, e, o).muted
231
- };
232
- i(this, h).notify("volume-change", s, t);
233
- }, It = function(t) {
234
- c(this, N, i(this, e, o).currentTime), a(this, e, T).call(this, i(this, e, o).currentTime, t), i(this, h).notify("seeked", i(this, e, o).currentTime, t), Math.trunc(i(this, e, o).currentTime) === Math.trunc(i(this, e, o).duration) && dt(i(this, e, o).duration) > dt(i(this, e, o).currentTime) && (a(this, e, T).call(this, i(this, e, o).duration, t), i(this, e, o).ended || i(this, h).player.dispatch(
235
- new ni("media-play-request", {
236
- trigger: t
237
- })
238
- ));
239
- }, Ht = function(t) {
240
- i(this, h).notify("seeking", i(this, e, o).currentTime, t);
241
- }, Ft = function(t) {
242
- const s = {
243
- buffered: i(this, e, o).buffered,
244
- seekable: i(this, e, o).seekable
245
- };
246
- i(this, h).notify("progress", s, t);
247
- }, Ut = function(t) {
248
- i(this, h).notify("suspend", void 0, t);
249
- }, Vt = function(t) {
250
- i(this, h).notify("rate-change", i(this, e, o).playbackRate, t);
251
- }, jt = function(t) {
252
- const s = i(this, e, o).error;
253
- if (!s) return;
254
- const r = {
255
- message: s.message,
256
- code: s.code,
257
- mediaError: s
258
- };
259
- i(this, h).notify("error", r, t);
260
- };
261
- var H, g, l, C, qt, Bt, Wt, et, _t;
262
- class yi {
263
- constructor(t, s) {
264
- d(this, l);
265
- d(this, H);
266
- d(this, g);
267
- c(this, H, t), c(this, g, s), i(this, l, C).onaddtrack = a(this, l, qt).bind(this), i(this, l, C).onremovetrack = a(this, l, Bt).bind(this), i(this, l, C).onchange = a(this, l, Wt).bind(this), rt(i(this, g).audioTracks, "change", a(this, l, _t).bind(this));
268
- }
269
- }
270
- H = new WeakMap(), g = new WeakMap(), l = new WeakSet(), C = function() {
271
- return i(this, H).media.audioTracks;
272
- }, qt = function(t) {
273
- const s = t.track;
274
- if (s.label === "") return;
275
- const r = s.id.toString() || `native-audio-${i(this, g).audioTracks.length}`, f = {
276
- id: r,
277
- label: s.label,
278
- language: s.language,
279
- kind: s.kind,
280
- selected: !1
281
- };
282
- i(this, g).audioTracks[Y.add](f, t), s.enabled && (f.selected = !0);
283
- }, Bt = function(t) {
284
- const s = i(this, g).audioTracks.getById(t.track.id);
285
- s && i(this, g).audioTracks[Y.remove](s, t);
286
- }, Wt = function(t) {
287
- let s = a(this, l, et).call(this);
288
- if (!s) return;
289
- const r = i(this, g).audioTracks.getById(s.id);
290
- r && i(this, g).audioTracks[Y.select](r, !0, t);
291
- }, et = function() {
292
- return Array.from(i(this, l, C)).find((t) => t.enabled);
293
- }, _t = function(t) {
294
- const { current: s } = t.detail;
295
- if (!s) return;
296
- const r = i(this, l, C).getTrackById(s.id);
297
- if (r) {
298
- const f = a(this, l, et).call(this);
299
- f && (f.enabled = !1), r.enabled = !0;
300
- }
301
- };
302
- var F, st;
303
- class ki {
304
- constructor(t, s) {
305
- d(this, F);
306
- M(this, "scope", Yt());
307
- M(this, "currentSrc", null);
308
- M(this, "audioGain");
309
- this.media = t, this.ctx = s, this.audioGain = new ui(t, (r) => {
310
- this.ctx.notify("audio-gain-change", r);
311
- });
312
- }
313
- setup() {
314
- new mi(this, this.ctx), "audioTracks" in this.media && new yi(this, this.ctx), ut(() => {
315
- this.audioGain.destroy(), this.media.srcObject = null, this.media.removeAttribute("src");
316
- for (const t of this.media.querySelectorAll("source")) t.remove();
317
- this.media.load();
318
- });
319
- }
320
- get type() {
321
- return "";
322
- }
323
- setPlaybackRate(t) {
324
- this.media.playbackRate = t;
325
- }
326
- async play() {
327
- return this.media.play();
328
- }
329
- async pause() {
330
- return this.media.pause();
331
- }
332
- setMuted(t) {
333
- this.media.muted = t;
334
- }
335
- setVolume(t) {
336
- this.media.volume = t;
337
- }
338
- setCurrentTime(t) {
339
- this.media.currentTime = t;
340
- }
341
- setPlaysInline(t) {
342
- q(this.media, "playsinline", t);
343
- }
344
- async loadSource({ src: t, type: s }, r) {
345
- this.media.preload = r || "", Zt(t) ? (this.removeSource(), this.media.srcObject = t) : (this.media.srcObject = null, ti(t) ? s !== "?" ? this.appendSource({ src: t, type: s }) : (this.removeSource(), this.media.src = a(this, F, st).call(this, t)) : (this.removeSource(), this.media.src = window.URL.createObjectURL(t))), this.media.load(), this.currentSrc = { src: t, type: s };
346
- }
347
- /**
348
- * Append source so it works when requesting AirPlay since hls.js will remove it.
349
- */
350
- appendSource(t, s) {
351
- const r = this.media.querySelector("source[data-vds]"), f = r ?? document.createElement("source");
352
- q(f, "src", a(this, F, st).call(this, t.src)), q(f, "type", t.type !== "?" ? t.type : s), q(f, "data-vds", ""), r || this.media.append(f);
353
- }
354
- removeSource() {
355
- var t;
356
- (t = this.media.querySelector("source[data-vds]")) == null || t.remove();
357
- }
358
- }
359
- F = new WeakSet(), st = function(t) {
360
- const { clipStartTime: s, clipEndTime: r } = this.ctx.$state, f = s(), j = r();
361
- return f > 0 && j > 0 ? `${t}#t=${f},${j}` : f > 0 ? `${t}#t=${f}` : j > 0 ? `${t}#t=0,${j}` : t;
362
- };
363
- var y, U, V, w, v, Kt, zt, Jt;
364
- class gi {
365
- constructor(t, s) {
366
- d(this, v);
367
- d(this, y);
368
- d(this, U);
369
- d(this, V);
370
- d(this, w, Z(!1));
371
- c(this, y, t), c(this, U, s), a(this, v, Kt).call(this);
372
- }
373
- get supported() {
374
- return i(this, w).call(this);
375
- }
376
- async prompt() {
377
- if (!this.supported) throw Error("Not supported on this platform.");
378
- return this.type === "airplay" && i(this, y).webkitShowPlaybackTargetPicker ? i(this, y).webkitShowPlaybackTargetPicker() : i(this, y).remote.prompt();
379
- }
380
- }
381
- y = new WeakMap(), U = new WeakMap(), V = new WeakMap(), w = new WeakMap(), v = new WeakSet(), Kt = function() {
382
- var t;
383
- !((t = i(this, y)) != null && t.remote) || !this.canPrompt || (i(this, y).remote.watchAvailability((s) => {
384
- i(this, w).set(s);
385
- }).catch(() => {
386
- i(this, w).set(!1);
387
- }), lt(a(this, v, zt).bind(this)));
388
- }, zt = function() {
389
- if (!i(this, w).call(this)) return;
390
- const t = ["connecting", "connect", "disconnect"], s = a(this, v, Jt).bind(this);
391
- s(), rt(i(this, y), "playing", s);
392
- const r = new nt(i(this, y).remote);
393
- for (const f of t)
394
- r.add(f, s);
395
- }, Jt = function(t) {
396
- const s = i(this, y).remote.state;
397
- if (s === i(this, V)) return;
398
- const r = { type: this.type, state: s };
399
- i(this, U).notify("remote-playback-change", r, t), c(this, V, s);
400
- };
401
- class Si extends gi {
402
- constructor() {
403
- super(...arguments);
404
- M(this, "type", "airplay");
405
- }
406
- get canPrompt() {
407
- return "WebKitPlaybackTargetAvailabilityEvent" in window;
408
- }
409
- }
410
- export {
411
- ki as H,
412
- Si as a
413
- };