@webitel/ui-sdk 26.2.69 → 26.2.71

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 (92) hide show
  1. package/dist/{errors-DCJKAXTz.js → errors-CTL-RV3B.js} +1 -1
  2. package/dist/{index-cVwBpL1P.js → index-CLhoKzki.js} +1 -1
  3. package/dist/{index-B71drQtj.js → index-x2Djqp3W.js} +4 -4
  4. package/dist/{install-BEn6vjFW.js → install-Cp4KnSCI.js} +1102 -1220
  5. package/dist/{isObject-DB0eH0MA.js → isObject-C_1aA257.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-CeA9TvJ4.js +425 -0
  13. package/dist/vidstack-D2pY00kU-hPWR401d.js +135 -0
  14. package/dist/vidstack-DDXt6fpN-DEjXPjHx.js +50 -0
  15. package/dist/vidstack-D_-9AA6_-Bh2Pn0IA.js +20 -0
  16. package/dist/{vidstack-Dm1xEU9Q-qSXq3AI-.js → vidstack-Dm1xEU9Q-CXHNvShT.js} +10 -11
  17. package/dist/vidstack-DqAw8m9J-BSNVCj3S.js +22 -0
  18. package/dist/vidstack-audio-C3of4Q-I.js +28 -0
  19. package/dist/vidstack-dash-BD3CNy0Z.js +392 -0
  20. package/dist/vidstack-google-cast-DXLqBW30.js +382 -0
  21. package/dist/vidstack-hls-C6Az6tgn.js +309 -0
  22. package/dist/vidstack-krOAtKMi-C50BTxmn.js +28 -0
  23. package/dist/vidstack-video-CtScgimr.js +163 -0
  24. package/dist/vidstack-vimeo-dFXp7_Vx.js +451 -0
  25. package/dist/vidstack-youtube-BF0J2izd.js +232 -0
  26. package/dist/{vuex.esm-bundler-tZVctzTj.js → vuex.esm-bundler-D5BkZi23.js} +1 -1
  27. package/dist/{wt-action-bar-ColV1kXE.js → wt-action-bar-BrFf9y4i.js} +1 -1
  28. package/dist/{wt-button-select-CfoSEYMj.js → wt-button-select-BQOYl5Z5.js} +1 -1
  29. package/dist/{wt-chat-emoji-Bgv9Viz-.js → wt-chat-emoji-D9rZ4xfn.js} +6 -11
  30. package/dist/{wt-confirm-dialog-bVhuyR-Q.js → wt-confirm-dialog-DdRFwuNQ.js} +1 -1
  31. package/dist/{wt-context-menu-Cd8pgBRV.js → wt-context-menu-Dx-K-ACK.js} +1 -1
  32. package/dist/{wt-copy-action-jjp1mO2h.js → wt-copy-action-BPMZsUtG.js} +1 -1
  33. package/dist/wt-datepicker-PK3BgSmp.js +5660 -0
  34. package/dist/wt-display-chip-items-CAO8OLhX.js +46 -0
  35. package/dist/{wt-dual-panel-DJsiR6RF.js → wt-dual-panel-CAh5CMKO.js} +1 -1
  36. package/dist/{wt-dummy-O94iGdZS.js → wt-dummy-DMXuDlcb.js} +1 -1
  37. package/dist/{wt-error-page-xgSWJ65z.js → wt-error-page-UoX8GV8V.js} +1 -1
  38. package/dist/{wt-expansion-panel-vzG02b62.js → wt-expansion-panel-G7G1803j.js} +1 -1
  39. package/dist/{wt-filters-panel-wrapper-h-UaAMuF.js → wt-filters-panel-wrapper-GI9X-SaD.js} +1 -1
  40. package/dist/wt-galleria-DtJgf7Db.js +322 -0
  41. package/dist/{wt-navigation-menu-Cu5Y9kua.js → wt-navigation-menu-CrDo7Vpq.js} +2 -5
  42. package/dist/wt-notifications-bar-CmUZpffK.js +79 -0
  43. package/dist/{wt-page-header-DlRrRzG7.js → wt-page-header-C7JiNmsy.js} +1 -1
  44. package/dist/{wt-pagination-CW46I4u2.js → wt-pagination-CaOk680t.js} +1 -1
  45. package/dist/{wt-player-3qh_Jzm2.js → wt-player-Cs2dAT3H.js} +1 -1
  46. package/dist/{wt-popover-BTG5bUP0.js → wt-popover-U7JE0uoX.js} +19 -22
  47. package/dist/{wt-search-bar-CTsNf7bp.js → wt-search-bar-f1yQguL2.js} +25 -28
  48. package/dist/{wt-selection-popup-DvaUvY4O.js → wt-selection-popup-CwjvQZ77.js} +1 -1
  49. package/dist/{wt-start-page-CcN7JC_u.js → wt-start-page-CMGnK33r.js} +7 -7
  50. package/dist/{wt-status-select-C8t0cgTg.js → wt-status-select-C5RigMIl.js} +1 -1
  51. package/dist/{wt-stepper-BLb42q2I.js → wt-stepper-1gbY9rv5.js} +1 -1
  52. package/dist/{wt-table-9gmsV0Y9.js → wt-table-D6d0dRYQ.js} +111 -114
  53. package/dist/{wt-table-actions-BB7AH7sR.js → wt-table-actions-BsjrniPP.js} +1 -1
  54. package/dist/{wt-table-column-select-B3lrCEaV.js → wt-table-column-select-JiD5kd7i.js} +28 -31
  55. package/dist/{wt-tabs-CCHi_E1a.js → wt-tabs-DpxPfuRj.js} +1 -1
  56. package/dist/{wt-tags-input-DLicKjv3.js → wt-tags-input-CJpT_4mw.js} +56 -57
  57. package/dist/{wt-timepicker-B9ONDzNQ.js → wt-timepicker-CtH8MdN-.js} +1 -1
  58. package/dist/{wt-tree-cQlvJmh5.js → wt-tree-C99Qwdwn.js} +4 -5
  59. package/dist/{wt-tree-table-B89YKiMf.js → wt-tree-table-3qAoEJ7m.js} +5 -5
  60. package/dist/{wt-type-extension-value-input-Da8FXLDs.js → wt-type-extension-value-input-CfiVBG5u.js} +214 -218
  61. package/dist/wt-vidstack-player-B8Ilx2ml.js +10229 -0
  62. package/package.json +5 -5
  63. package/src/modules/Userinfo/classes/ApplicationsAccess.ts +36 -3
  64. package/src/modules/Userinfo/scripts/utils.ts +2 -22
  65. package/src/modules/Userinfo/stores/accessStore.ts +20 -5
  66. package/src/modules/Userinfo/stores/userinfoStore.ts +1 -0
  67. package/src/modules/Userinfo/types/UserAccess.d.ts +11 -3
  68. package/types/modules/Userinfo/classes/ApplicationsAccess.d.ts +34 -243
  69. package/types/modules/Userinfo/scripts/utils.d.ts +1 -2
  70. package/types/modules/Userinfo/stores/accessStore.d.ts +1 -1
  71. package/types/modules/Userinfo/stores/userinfoStore.d.ts +21 -9
  72. package/dist/prod-DTLJXtPo.js +0 -994
  73. package/dist/srt-parser-CWqahKwO.js +0 -27
  74. package/dist/ssa-parser-BqjjKy4M.js +0 -209
  75. package/dist/vidstack-Bq6c3Bam-w5y-QQDX.js +0 -413
  76. package/dist/vidstack-D2pY00kU-BI5rYx7p.js +0 -138
  77. package/dist/vidstack-DDXt6fpN-QZPrP2dy.js +0 -60
  78. package/dist/vidstack-D_-9AA6_-Bo1xPN-G.js +0 -20
  79. package/dist/vidstack-DqAw8m9J-DL7LzrFt.js +0 -29
  80. package/dist/vidstack-audio-lX1O0fza.js +0 -32
  81. package/dist/vidstack-dash-BQkRGWe_.js +0 -403
  82. package/dist/vidstack-google-cast-C39n-PU1.js +0 -377
  83. package/dist/vidstack-hls-BCLhCuNJ.js +0 -324
  84. package/dist/vidstack-krOAtKMi-B4IZWKdc.js +0 -29
  85. package/dist/vidstack-video-BgayrEIC.js +0 -181
  86. package/dist/vidstack-vimeo-Lpe7iySs.js +0 -437
  87. package/dist/vidstack-youtube-Dmcz0xVm.js +0 -236
  88. package/dist/wt-datepicker-Cs3xDzVq.js +0 -5789
  89. package/dist/wt-display-chip-items-IqNMxa_X.js +0 -52
  90. package/dist/wt-galleria-cDjsiOcp.js +0 -324
  91. package/dist/wt-notifications-bar-KNH47kZ7.js +0 -80
  92. package/dist/wt-vidstack-player-BzFbIwCa.js +0 -10250
@@ -0,0 +1,425 @@
1
+ import { b as k, o as v, d as r, i as S, f as w, E as f, e as b, g as o, h as P, j as C, p as E, k as A, l as m, m as y, D as L, L as u, n as l } from "./wt-vidstack-player-B8Ilx2ml.js";
2
+ import { R as x } from "./vidstack-DqAw8m9J-BSNVCj3S.js";
3
+ let h = null, d = [], c = [];
4
+ function p() {
5
+ return h ??= new AudioContext();
6
+ }
7
+ function $() {
8
+ const s = p(), t = s.createGain();
9
+ return t.connect(s.destination), d.push(t), t;
10
+ }
11
+ function G(s, t) {
12
+ const i = p(), e = i.createMediaElementSource(s);
13
+ return t && e.connect(t), c.push(e), e;
14
+ }
15
+ function N(s) {
16
+ const t = d.indexOf(s);
17
+ t !== -1 && (d.splice(t, 1), s.disconnect(), T());
18
+ }
19
+ function M(s) {
20
+ const t = c.indexOf(s);
21
+ t !== -1 && (c.splice(t, 1), s.disconnect(), T());
22
+ }
23
+ function T() {
24
+ h && d.length === 0 && c.length === 0 && h.close().then(() => {
25
+ h = null;
26
+ });
27
+ }
28
+ class R {
29
+ #s;
30
+ #t;
31
+ #e = null;
32
+ #a = null;
33
+ get currentGain() {
34
+ return this.#e?.gain?.value ?? null;
35
+ }
36
+ get supported() {
37
+ return !0;
38
+ }
39
+ constructor(t, i) {
40
+ this.#s = t, this.#t = i;
41
+ }
42
+ setGain(t) {
43
+ const i = this.currentGain;
44
+ if (t !== this.currentGain) {
45
+ if (t === 1 && i !== 1) {
46
+ this.removeGain();
47
+ return;
48
+ }
49
+ this.#e || (this.#e = $(), this.#a && this.#a.connect(this.#e)), this.#a || (this.#a = G(this.#s, this.#e)), this.#e.gain.value = t, this.#t(t);
50
+ }
51
+ }
52
+ removeGain() {
53
+ this.#e && (this.#a && this.#a.connect(p().destination), this.#r(), this.#t(null));
54
+ }
55
+ destroy() {
56
+ this.#h(), this.#r();
57
+ }
58
+ #h() {
59
+ if (this.#a)
60
+ try {
61
+ M(this.#a);
62
+ } catch {
63
+ } finally {
64
+ this.#a = null;
65
+ }
66
+ }
67
+ #r() {
68
+ if (this.#e)
69
+ try {
70
+ N(this.#e);
71
+ } catch {
72
+ } finally {
73
+ this.#e = null;
74
+ }
75
+ }
76
+ }
77
+ const D = ["focus", "blur", "visibilitychange", "pageshow", "pagehide"];
78
+ class O {
79
+ #s = l(g());
80
+ #t = l(document.visibilityState);
81
+ #e;
82
+ connect() {
83
+ const t = new f(window), i = this.#a.bind(this);
84
+ for (const e of D)
85
+ t.add(e, i);
86
+ o && t.add("beforeunload", (e) => {
87
+ this.#e = setTimeout(() => {
88
+ e.defaultPrevented || e.returnValue.length > 0 || (this.#s.set("hidden"), this.#t.set("hidden"));
89
+ }, 0);
90
+ });
91
+ }
92
+ /**
93
+ * The current page state. Important to note we only account for a subset of page states, as
94
+ * the rest aren't valuable to the player at the moment.
95
+ *
96
+ * - **active:** A page is in the active state if it is visible and has input focus.
97
+ * - **passive:** A page is in the passive state if it is visible and does not have input focus.
98
+ * - **hidden:** A page is in the hidden state if it is not visible.
99
+ *
100
+ * @see https://developers.google.com/web/updates/2018/07/page-lifecycle-api#states
101
+ */
102
+ get pageState() {
103
+ return this.#s();
104
+ }
105
+ /**
106
+ * The current document visibility state.
107
+ *
108
+ * - **visible:** The page content may be at least partially visible. In practice, this means that
109
+ * the page is the foreground tab of a non-minimized window.
110
+ * - **hidden:** The page content is not visible to the user. In practice this means that the
111
+ * document is either a background tab or part of a minimized window, or the OS screen lock is
112
+ * active.
113
+ *
114
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState
115
+ */
116
+ get visibility() {
117
+ return this.#t();
118
+ }
119
+ #a(t) {
120
+ o && window.clearTimeout(this.#e), (t.type !== "blur" || this.#s() === "active") && (this.#s.set(g(t)), this.#t.set(document.visibilityState == "hidden" ? "hidden" : "visible"));
121
+ }
122
+ }
123
+ function g(s) {
124
+ return s?.type === "blur" || document.visibilityState === "hidden" ? "hidden" : document.hasFocus() ? "active" : "passive";
125
+ }
126
+ class I {
127
+ #s;
128
+ #t;
129
+ #e = !1;
130
+ #a = !1;
131
+ #h = !1;
132
+ #r = new x(this.#y.bind(this));
133
+ #o = new O();
134
+ #c;
135
+ get #i() {
136
+ return this.#s.media;
137
+ }
138
+ constructor(t, i) {
139
+ this.#s = t, this.#t = i, this.#c = new f(t.media), this.#g(), this.#o.connect(), b(this.#M.bind(this)), v(this.#p.bind(this));
140
+ }
141
+ #p() {
142
+ this.#a = !1, this.#h = !1, this.#r.stop(), this.#c.abort(), this.#T?.clear();
143
+ }
144
+ /**
145
+ * The `timeupdate` event fires surprisingly infrequently during playback, meaning your progress
146
+ * bar (or whatever else is synced to the currentTime) moves in a choppy fashion. This helps
147
+ * resolve that by retrieving time updates in a request animation frame loop.
148
+ */
149
+ #u = 0;
150
+ #l = -1;
151
+ #y() {
152
+ const t = this.#i.currentTime;
153
+ !(o && t - this.#l < 0.35) && this.#u !== t && (this.#d(t), this.#u = t);
154
+ }
155
+ #g() {
156
+ this.#n("loadstart", this.#k), this.#n("abort", this.#m), this.#n("emptied", this.#S), this.#n("error", this.#j), this.#n("volumechange", this.#O);
157
+ }
158
+ #v() {
159
+ this.#a || (this.#n("loadeddata", this.#w), this.#n("loadedmetadata", this.#P), this.#n("canplay", this.#A), this.#n("canplaythrough", this.#L), this.#n("durationchange", this.#D), this.#n("play", this.#C), this.#n("progress", this.#F), this.#n("stalled", this.#$), this.#n("suspend", this.#U), this.#n("ratechange", this.#V), this.#a = !0);
160
+ }
161
+ #b() {
162
+ this.#h || (this.#n("pause", this.#E), this.#n("playing", this.#x), this.#n("seeked", this.#I), this.#n("seeking", this.#H), this.#n("ended", this.#N), this.#n("waiting", this.#G), this.#h = !0);
163
+ }
164
+ #T = void 0;
165
+ #q = void 0;
166
+ #n(t, i) {
167
+ this.#c.add(t, i.bind(this));
168
+ }
169
+ #B(t) {
170
+ }
171
+ #d(t, i) {
172
+ const e = Math.min(t, this.#t.$state.seekableEnd());
173
+ this.#t.notify("time-change", e, i);
174
+ }
175
+ #k(t) {
176
+ if (this.#i.networkState === 3) {
177
+ this.#m(t);
178
+ return;
179
+ }
180
+ this.#v(), this.#t.notify("load-start", void 0, t);
181
+ }
182
+ #m(t) {
183
+ this.#t.notify("abort", void 0, t);
184
+ }
185
+ #S() {
186
+ this.#t.notify("emptied", void 0, event);
187
+ }
188
+ #w(t) {
189
+ this.#t.notify("loaded-data", void 0, t);
190
+ }
191
+ #P(t) {
192
+ this.#u = 0, this.#l = -1, this.#b(), this.#t.notify("loaded-metadata", void 0, t), (P || o && C(this.#t.$state.source())) && this.#t.delegate.ready(this.#f(), t);
193
+ }
194
+ #f() {
195
+ return {
196
+ provider: E(this.#t.$provider),
197
+ duration: this.#i.duration,
198
+ buffered: this.#i.buffered,
199
+ seekable: this.#i.seekable
200
+ };
201
+ }
202
+ #C(t) {
203
+ this.#t.$state.canPlay && this.#t.notify("play", void 0, t);
204
+ }
205
+ #E(t) {
206
+ this.#i.readyState === 1 && !this.#e || (this.#e = !1, this.#r.stop(), this.#t.notify("pause", void 0, t));
207
+ }
208
+ #A(t) {
209
+ this.#t.delegate.ready(this.#f(), t);
210
+ }
211
+ #L(t) {
212
+ this.#t.$state.started() || this.#t.notify("can-play-through", this.#f(), t);
213
+ }
214
+ #x(t) {
215
+ this.#i.paused || (this.#e = !1, this.#t.notify("playing", void 0, t), this.#r.start());
216
+ }
217
+ #$(t) {
218
+ this.#t.notify("stalled", void 0, t), this.#i.readyState < 3 && (this.#e = !0, this.#t.notify("waiting", void 0, t));
219
+ }
220
+ #G(t) {
221
+ this.#i.readyState < 3 && (this.#e = !0, this.#t.notify("waiting", void 0, t));
222
+ }
223
+ #N(t) {
224
+ this.#r.stop(), this.#d(this.#i.duration, t), this.#t.notify("end", void 0, t), this.#t.$state.loop() && A(this.#i.controls) && (this.#i.controls = !1);
225
+ }
226
+ #M() {
227
+ const t = this.#t.$state.paused(), i = this.#o.visibility === "hidden";
228
+ (t || i) && m(this.#i, "timeupdate", this.#R.bind(this));
229
+ }
230
+ #R(t) {
231
+ this.#d(this.#i.currentTime, t);
232
+ }
233
+ #D(t) {
234
+ this.#t.$state.ended() && this.#d(this.#i.duration, t), this.#t.notify("duration-change", this.#i.duration, t);
235
+ }
236
+ #O(t) {
237
+ const i = {
238
+ volume: this.#i.volume,
239
+ muted: this.#i.muted
240
+ };
241
+ this.#t.notify("volume-change", i, t);
242
+ }
243
+ #I(t) {
244
+ this.#l = this.#i.currentTime, this.#d(this.#i.currentTime, t), this.#t.notify("seeked", this.#i.currentTime, t), Math.trunc(this.#i.currentTime) === Math.trunc(this.#i.duration) && y(this.#i.duration) > y(this.#i.currentTime) && (this.#d(this.#i.duration, t), this.#i.ended || this.#t.player.dispatch(
245
+ new L("media-play-request", {
246
+ trigger: t
247
+ })
248
+ ));
249
+ }
250
+ #H(t) {
251
+ this.#t.notify("seeking", this.#i.currentTime, t);
252
+ }
253
+ #F(t) {
254
+ const i = {
255
+ buffered: this.#i.buffered,
256
+ seekable: this.#i.seekable
257
+ };
258
+ this.#t.notify("progress", i, t);
259
+ }
260
+ #U(t) {
261
+ this.#t.notify("suspend", void 0, t);
262
+ }
263
+ #V(t) {
264
+ this.#t.notify("rate-change", this.#i.playbackRate, t);
265
+ }
266
+ #j(t) {
267
+ const i = this.#i.error;
268
+ if (!i) return;
269
+ const e = {
270
+ message: i.message,
271
+ code: i.code,
272
+ mediaError: i
273
+ };
274
+ this.#t.notify("error", e, t);
275
+ }
276
+ }
277
+ class H {
278
+ #s;
279
+ #t;
280
+ get #e() {
281
+ return this.#s.media.audioTracks;
282
+ }
283
+ constructor(t, i) {
284
+ this.#s = t, this.#t = i, this.#e.onaddtrack = this.#a.bind(this), this.#e.onremovetrack = this.#h.bind(this), this.#e.onchange = this.#r.bind(this), m(this.#t.audioTracks, "change", this.#c.bind(this));
285
+ }
286
+ #a(t) {
287
+ const i = t.track;
288
+ if (i.label === "") return;
289
+ const e = i.id.toString() || `native-audio-${this.#t.audioTracks.length}`, a = {
290
+ id: e,
291
+ label: i.label,
292
+ language: i.language,
293
+ kind: i.kind,
294
+ selected: !1
295
+ };
296
+ this.#t.audioTracks[u.add](a, t), i.enabled && (a.selected = !0);
297
+ }
298
+ #h(t) {
299
+ const i = this.#t.audioTracks.getById(t.track.id);
300
+ i && this.#t.audioTracks[u.remove](i, t);
301
+ }
302
+ #r(t) {
303
+ let i = this.#o();
304
+ if (!i) return;
305
+ const e = this.#t.audioTracks.getById(i.id);
306
+ e && this.#t.audioTracks[u.select](e, !0, t);
307
+ }
308
+ #o() {
309
+ return Array.from(this.#e).find((t) => t.enabled);
310
+ }
311
+ #c(t) {
312
+ const { current: i } = t.detail;
313
+ if (!i) return;
314
+ const e = this.#e.getTrackById(i.id);
315
+ if (e) {
316
+ const a = this.#o();
317
+ a && (a.enabled = !1), e.enabled = !0;
318
+ }
319
+ }
320
+ }
321
+ class j {
322
+ constructor(t, i) {
323
+ this.media = t, this.ctx = i, this.audioGain = new R(t, (e) => {
324
+ this.ctx.notify("audio-gain-change", e);
325
+ });
326
+ }
327
+ scope = k();
328
+ currentSrc = null;
329
+ audioGain;
330
+ setup() {
331
+ new I(this, this.ctx), "audioTracks" in this.media && new H(this, this.ctx), v(() => {
332
+ this.audioGain.destroy(), this.media.srcObject = null, this.media.removeAttribute("src");
333
+ for (const t of this.media.querySelectorAll("source")) t.remove();
334
+ this.media.load();
335
+ });
336
+ }
337
+ get type() {
338
+ return "";
339
+ }
340
+ setPlaybackRate(t) {
341
+ this.media.playbackRate = t;
342
+ }
343
+ async play() {
344
+ return this.media.play();
345
+ }
346
+ async pause() {
347
+ return this.media.pause();
348
+ }
349
+ setMuted(t) {
350
+ this.media.muted = t;
351
+ }
352
+ setVolume(t) {
353
+ this.media.volume = t;
354
+ }
355
+ setCurrentTime(t) {
356
+ this.media.currentTime = t;
357
+ }
358
+ setPlaysInline(t) {
359
+ r(this.media, "playsinline", t);
360
+ }
361
+ async loadSource({ src: t, type: i }, e) {
362
+ this.media.preload = e || "", S(t) ? (this.removeSource(), this.media.srcObject = t) : (this.media.srcObject = null, w(t) ? i !== "?" ? this.appendSource({ src: t, type: i }) : (this.removeSource(), this.media.src = this.#s(t)) : (this.removeSource(), this.media.src = window.URL.createObjectURL(t))), this.media.load(), this.currentSrc = { src: t, type: i };
363
+ }
364
+ /**
365
+ * Append source so it works when requesting AirPlay since hls.js will remove it.
366
+ */
367
+ appendSource(t, i) {
368
+ const e = this.media.querySelector("source[data-vds]"), a = e ?? document.createElement("source");
369
+ r(a, "src", this.#s(t.src)), r(a, "type", t.type !== "?" ? t.type : i), r(a, "data-vds", ""), e || this.media.append(a);
370
+ }
371
+ removeSource() {
372
+ this.media.querySelector("source[data-vds]")?.remove();
373
+ }
374
+ #s(t) {
375
+ const { clipStartTime: i, clipEndTime: e } = this.ctx.$state, a = i(), n = e();
376
+ return a > 0 && n > 0 ? `${t}#t=${a},${n}` : a > 0 ? `${t}#t=${a}` : n > 0 ? `${t}#t=0,${n}` : t;
377
+ }
378
+ }
379
+ class F {
380
+ #s;
381
+ #t;
382
+ #e;
383
+ #a = l(!1);
384
+ get supported() {
385
+ return this.#a();
386
+ }
387
+ constructor(t, i) {
388
+ this.#s = t, this.#t = i, this.#h();
389
+ }
390
+ #h() {
391
+ !this.#s?.remote || !this.canPrompt || (this.#s.remote.watchAvailability((t) => {
392
+ this.#a.set(t);
393
+ }).catch(() => {
394
+ this.#a.set(!1);
395
+ }), b(this.#r.bind(this)));
396
+ }
397
+ #r() {
398
+ if (!this.#a()) return;
399
+ const t = ["connecting", "connect", "disconnect"], i = this.#o.bind(this);
400
+ i(), m(this.#s, "playing", i);
401
+ const e = new f(this.#s.remote);
402
+ for (const a of t)
403
+ e.add(a, i);
404
+ }
405
+ async prompt() {
406
+ if (!this.supported) throw Error("Not supported on this platform.");
407
+ return this.type === "airplay" && this.#s.webkitShowPlaybackTargetPicker ? this.#s.webkitShowPlaybackTargetPicker() : this.#s.remote.prompt();
408
+ }
409
+ #o(t) {
410
+ const i = this.#s.remote.state;
411
+ if (i === this.#e) return;
412
+ const e = { type: this.type, state: i };
413
+ this.#t.notify("remote-playback-change", e, t), this.#e = i;
414
+ }
415
+ }
416
+ class q extends F {
417
+ type = "airplay";
418
+ get canPrompt() {
419
+ return "WebKitPlaybackTargetAvailabilityEvent" in window;
420
+ }
421
+ }
422
+ export {
423
+ j as H,
424
+ q as a
425
+ };
@@ -0,0 +1,135 @@
1
+ import { l as d, A as g, S as p, h as u, p as C, C as h } from "./wt-vidstack-player-B8Ilx2ml.js";
2
+ function m() {
3
+ return "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";
4
+ }
5
+ function f() {
6
+ return !!window.cast?.framework;
7
+ }
8
+ function w() {
9
+ return !!window.chrome?.cast?.isAvailable;
10
+ }
11
+ function c() {
12
+ return s().getCastState() === cast.framework.CastState.CONNECTED;
13
+ }
14
+ function s() {
15
+ return window.cast.framework.CastContext.getInstance();
16
+ }
17
+ function l() {
18
+ return s().getCurrentSession();
19
+ }
20
+ function y() {
21
+ return l()?.getSessionObj().media[0];
22
+ }
23
+ function I(r) {
24
+ return y()?.media.contentId === r?.src;
25
+ }
26
+ function v() {
27
+ return {
28
+ language: "en-US",
29
+ autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,
30
+ receiverApplicationId: chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,
31
+ resumeSavedSession: !0,
32
+ androidReceiverCompatible: !0
33
+ };
34
+ }
35
+ function E(r) {
36
+ return `Google Cast Error Code: ${r}`;
37
+ }
38
+ function _(r, e) {
39
+ return d(s(), r, e);
40
+ }
41
+ class S {
42
+ name = "google-cast";
43
+ target;
44
+ #e;
45
+ /**
46
+ * @see {@link https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastContext}
47
+ */
48
+ get cast() {
49
+ return s();
50
+ }
51
+ mediaType() {
52
+ return "video";
53
+ }
54
+ canPlay(e) {
55
+ return g && !u && p(e);
56
+ }
57
+ async prompt(e) {
58
+ let t, a, o;
59
+ try {
60
+ t = await this.#r(e), this.#e || (this.#e = new cast.framework.RemotePlayer(), new cast.framework.RemotePlayerController(this.#e)), a = e.player.createEvent("google-cast-prompt-open", {
61
+ trigger: t
62
+ }), e.player.dispatchEvent(a), this.#t(e, "connecting", a), await this.#o(C(e.$props.googleCast)), e.$state.remotePlaybackInfo.set({
63
+ deviceName: l()?.getCastDevice().friendlyName
64
+ }), c() && this.#t(e, "connected", a);
65
+ } catch (n) {
66
+ const i = n instanceof Error ? n : this.#a(
67
+ (n + "").toUpperCase(),
68
+ "Prompt failed."
69
+ );
70
+ throw o = e.player.createEvent("google-cast-prompt-error", {
71
+ detail: i,
72
+ trigger: a ?? t,
73
+ cancelable: !0
74
+ }), e.player.dispatch(o), this.#t(
75
+ e,
76
+ c() ? "connected" : "disconnected",
77
+ o
78
+ ), i;
79
+ } finally {
80
+ e.player.dispatch("google-cast-prompt-close", {
81
+ trigger: o ?? a ?? t
82
+ });
83
+ }
84
+ }
85
+ async load(e) {
86
+ if (!this.#e)
87
+ throw Error("[vidstack] google cast player was not initialized");
88
+ return new (await import("./vidstack-google-cast-DXLqBW30.js")).GoogleCastProvider(this.#e, e);
89
+ }
90
+ async #r(e) {
91
+ if (f()) return;
92
+ const t = e.player.createEvent("google-cast-load-start");
93
+ e.player.dispatch(t), await h(m()), await customElements.whenDefined("google-cast-launcher");
94
+ const a = e.player.createEvent("google-cast-loaded", { trigger: t });
95
+ if (e.player.dispatch(a), !w())
96
+ throw this.#a("CAST_NOT_AVAILABLE", "Google Cast not available on this platform.");
97
+ return a;
98
+ }
99
+ async #o(e) {
100
+ this.#s(e);
101
+ const t = await this.cast.requestSession();
102
+ if (t)
103
+ throw this.#a(
104
+ t.toUpperCase(),
105
+ E(t)
106
+ );
107
+ }
108
+ #s(e) {
109
+ this.cast?.setOptions({
110
+ ...v(),
111
+ ...e
112
+ });
113
+ }
114
+ #t(e, t, a) {
115
+ const o = { type: "google-cast", state: t };
116
+ e.notify("remote-playback-change", o, a);
117
+ }
118
+ #a(e, t) {
119
+ const a = Error(t);
120
+ return a.code = e, a;
121
+ }
122
+ }
123
+ const A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
124
+ __proto__: null,
125
+ GoogleCastLoader: S
126
+ }, Symbol.toStringTag, { value: "Module" }));
127
+ export {
128
+ l as a,
129
+ y as b,
130
+ E as c,
131
+ s as g,
132
+ I as h,
133
+ _ as l,
134
+ A as v
135
+ };
@@ -0,0 +1,50 @@
1
+ import { n as e, l as r, e as a, p as o, O as n, f as c } from "./wt-vidstack-player-B8Ilx2ml.js";
2
+ class d {
3
+ #t;
4
+ src = e("");
5
+ /**
6
+ * Defines which referrer is sent when fetching the resource.
7
+ *
8
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy}
9
+ */
10
+ referrerPolicy = null;
11
+ get iframe() {
12
+ return this.#t;
13
+ }
14
+ constructor(t) {
15
+ this.#t = t, t.setAttribute("frameBorder", "0"), t.setAttribute("aria-hidden", "true"), t.setAttribute(
16
+ "allow",
17
+ "autoplay; fullscreen; encrypted-media; picture-in-picture; accelerometer; gyroscope"
18
+ ), this.referrerPolicy !== null && t.setAttribute("referrerpolicy", this.referrerPolicy);
19
+ }
20
+ setup() {
21
+ r(window, "message", this.#i.bind(this)), r(this.#t, "load", this.onLoad.bind(this)), a(this.#s.bind(this));
22
+ }
23
+ #s() {
24
+ const t = this.src();
25
+ if (!t.length) {
26
+ this.#t.setAttribute("src", "");
27
+ return;
28
+ }
29
+ const s = o(() => this.buildParams());
30
+ this.#t.setAttribute("src", n(t, s));
31
+ }
32
+ postMessage(t, s) {
33
+ this.#t.contentWindow?.postMessage(JSON.stringify(t), s ?? "*");
34
+ }
35
+ #i(t) {
36
+ const s = this.getOrigin();
37
+ if ((t.source === null || t.source === this.#t?.contentWindow) && (!c(s) || s === t.origin)) {
38
+ try {
39
+ const i = JSON.parse(t.data);
40
+ i && this.onMessage(i, t);
41
+ return;
42
+ } catch {
43
+ }
44
+ t.data && this.onMessage(t.data, t);
45
+ }
46
+ }
47
+ }
48
+ export {
49
+ d as E
50
+ };
@@ -0,0 +1,20 @@
1
+ import { c as d, a as i, I as l, e as m } from "./wt-vidstack-player-B8Ilx2ml.js";
2
+ const p = /* @__PURE__ */ i(
3
+ '<svg viewBox="0 0 32 32" fill="none" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"></svg>'
4
+ );
5
+ function v(n, s) {
6
+ const o = d(p);
7
+ o.innerHTML = l, n.append(o);
8
+ const e = document.createElement("span");
9
+ e.classList.add("vds-google-cast-info"), n.append(e);
10
+ const t = document.createElement("span");
11
+ t.classList.add("vds-google-cast-device-name"), m(() => {
12
+ const { remotePlaybackInfo: c } = s, a = c();
13
+ return a?.deviceName && (t.textContent = a.deviceName, e.append("Google Cast on ", t)), () => {
14
+ e.textContent = "";
15
+ };
16
+ });
17
+ }
18
+ export {
19
+ v as insertContent
20
+ };
@@ -1,29 +1,28 @@
1
- const i = /(?:youtu\.be|youtube|youtube\.com|youtube-nocookie\.com)(?:\/shorts)?\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|)((?:\w|-){11})/, u = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
1
+ const i = /(?:youtu\.be|youtube|youtube\.com|youtube-nocookie\.com)(?:\/shorts)?\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|)((?:\w|-){11})/, u = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
2
2
  function l(e) {
3
- var t;
4
- return (t = e.match(i)) == null ? void 0 : t[1];
3
+ return e.match(i)?.[1];
5
4
  }
6
- async function b(e, t) {
5
+ async function b(e, n) {
7
6
  if (u.has(e)) return u.get(e);
8
- if (n.has(e)) return n.get(e);
9
- const s = new Promise(async (r) => {
7
+ if (s.has(e)) return s.get(e);
8
+ const t = new Promise(async (r) => {
10
9
  const c = ["maxresdefault", "sddefault", "hqdefault"];
11
10
  for (const a of c)
12
11
  for (const f of [!0, !1]) {
13
12
  const o = p(e, a, f);
14
13
  if ((await fetch(o, {
15
14
  mode: "no-cors",
16
- signal: t.signal
15
+ signal: n.signal
17
16
  })).status < 400) {
18
17
  u.set(e, o), r(o);
19
18
  return;
20
19
  }
21
20
  }
22
- }).catch(() => "").finally(() => n.delete(e));
23
- return n.set(e, s), s;
21
+ }).catch(() => "").finally(() => s.delete(e));
22
+ return s.set(e, t), t;
24
23
  }
25
- function p(e, t, s) {
26
- return `https://i.ytimg.com/${s ? "vi_webp" : "vi"}/${e}/${t}.${s ? "webp" : "jpg"}`;
24
+ function p(e, n, t) {
25
+ return `https://i.ytimg.com/${t ? "vi_webp" : "vi"}/${e}/${n}.${t ? "webp" : "jpg"}`;
27
26
  }
28
27
  export {
29
28
  b as findYouTubePoster,
@@ -0,0 +1,22 @@
1
+ import { q as i, r as s } from "./wt-vidstack-player-B8Ilx2ml.js";
2
+ class a {
3
+ #i;
4
+ #t;
5
+ constructor(t) {
6
+ this.#t = t;
7
+ }
8
+ start() {
9
+ i(this.#i) && this.#s();
10
+ }
11
+ stop() {
12
+ s(this.#i) && window.cancelAnimationFrame(this.#i), this.#i = void 0;
13
+ }
14
+ #s() {
15
+ this.#i = window.requestAnimationFrame(() => {
16
+ i(this.#i) || (this.#t(), this.#s());
17
+ });
18
+ }
19
+ }
20
+ export {
21
+ a as R
22
+ };