@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,163 @@
1
+ import { s as l, t as o, u, v as p, o as h, l as P, D as f, E as g, T as k, w as n } from "./wt-vidstack-player-B8Ilx2ml.js";
2
+ import { H as x, a as T } from "./vidstack-Bq6c3Bam-CeA9TvJ4.js";
3
+ class m {
4
+ #t;
5
+ #i;
6
+ constructor(t, e) {
7
+ this.#t = t, this.#i = e, t.textTracks.onaddtrack = this.#e.bind(this), h(this.#s.bind(this));
8
+ }
9
+ #e(t) {
10
+ const e = t.track;
11
+ if (!e || v(this.#t, e)) return;
12
+ const i = new k({
13
+ id: e.id,
14
+ kind: e.kind,
15
+ label: e.label ?? "",
16
+ language: e.language,
17
+ type: "vtt"
18
+ });
19
+ i[n.native] = { track: e }, i[n.readyState] = 2, i[n.nativeHLS] = !0;
20
+ let a = 0;
21
+ const c = (d) => {
22
+ if (e.cues)
23
+ for (let r = a; r < e.cues.length; r++)
24
+ i.addCue(e.cues[r], d), a++;
25
+ };
26
+ c(t), e.oncuechange = c, this.#i.textTracks.add(i, t), i.setMode(e.mode, t);
27
+ }
28
+ #s() {
29
+ this.#t.textTracks.onaddtrack = null;
30
+ for (const t of this.#i.textTracks) {
31
+ const e = t[n.native]?.track;
32
+ e?.oncuechange && (e.oncuechange = null);
33
+ }
34
+ }
35
+ }
36
+ function v(s, t) {
37
+ return Array.from(s.children).find((e) => e.track === t);
38
+ }
39
+ class y {
40
+ #t;
41
+ #i;
42
+ constructor(t, e) {
43
+ this.#t = t, this.#i = e, new g(t).add("enterpictureinpicture", this.#e.bind(this)).add("leavepictureinpicture", this.#s.bind(this));
44
+ }
45
+ get active() {
46
+ return document.pictureInPictureElement === this.#t;
47
+ }
48
+ get supported() {
49
+ return u(this.#t);
50
+ }
51
+ async enter() {
52
+ return this.#t.requestPictureInPicture();
53
+ }
54
+ exit() {
55
+ return document.exitPictureInPicture();
56
+ }
57
+ #e(t) {
58
+ this.#n(!0, t);
59
+ }
60
+ #s(t) {
61
+ this.#n(!1, t);
62
+ }
63
+ #n = (t, e) => {
64
+ this.#i.notify("picture-in-picture-change", t, e);
65
+ };
66
+ }
67
+ class M {
68
+ #t;
69
+ #i;
70
+ #e = "inline";
71
+ get mode() {
72
+ return this.#e;
73
+ }
74
+ constructor(t, e) {
75
+ this.#t = t, this.#i = e, P(t, "webkitpresentationmodechanged", this.#s.bind(this));
76
+ }
77
+ get supported() {
78
+ return o(this.#t);
79
+ }
80
+ async setPresentationMode(t) {
81
+ this.#e !== t && this.#t.webkitSetPresentationMode(t);
82
+ }
83
+ #s(t) {
84
+ const e = this.#e;
85
+ this.#e = this.#t.webkitPresentationMode, this.#i.player?.dispatch(
86
+ new f("video-presentation-change", {
87
+ detail: this.#e,
88
+ trigger: t
89
+ })
90
+ ), ["fullscreen", "picture-in-picture"].forEach((i) => {
91
+ (this.#e === i || e === i) && this.#i.notify(`${i}-change`, this.#e === i, t);
92
+ });
93
+ }
94
+ }
95
+ class w {
96
+ #t;
97
+ get active() {
98
+ return this.#t.mode === "fullscreen";
99
+ }
100
+ get supported() {
101
+ return this.#t.supported;
102
+ }
103
+ constructor(t) {
104
+ this.#t = t;
105
+ }
106
+ async enter() {
107
+ this.#t.setPresentationMode("fullscreen");
108
+ }
109
+ async exit() {
110
+ this.#t.setPresentationMode("inline");
111
+ }
112
+ }
113
+ class E {
114
+ #t;
115
+ get active() {
116
+ return this.#t.mode === "picture-in-picture";
117
+ }
118
+ get supported() {
119
+ return this.#t.supported;
120
+ }
121
+ constructor(t) {
122
+ this.#t = t;
123
+ }
124
+ async enter() {
125
+ this.#t.setPresentationMode("picture-in-picture");
126
+ }
127
+ async exit() {
128
+ this.#t.setPresentationMode("inline");
129
+ }
130
+ }
131
+ class V extends x {
132
+ $$PROVIDER_TYPE = "VIDEO";
133
+ get type() {
134
+ return "video";
135
+ }
136
+ airPlay;
137
+ fullscreen;
138
+ pictureInPicture;
139
+ constructor(t, e) {
140
+ super(t, e), l(() => {
141
+ if (this.airPlay = new T(t, e), o(t)) {
142
+ const i = new M(t, e);
143
+ this.fullscreen = new w(i), this.pictureInPicture = new E(i);
144
+ } else u(t) && (this.pictureInPicture = new y(t, e));
145
+ }, this.scope);
146
+ }
147
+ setup() {
148
+ super.setup(), p(this.video) && new m(this.video, this.ctx), this.ctx.textRenderers.attachVideo(this.video), h(() => {
149
+ this.ctx.textRenderers.attachVideo(null);
150
+ }), this.type === "video" && this.ctx.notify("provider-setup", this);
151
+ }
152
+ /**
153
+ * The native HTML `<video>` element.
154
+ *
155
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement}
156
+ */
157
+ get video() {
158
+ return this.media;
159
+ }
160
+ }
161
+ export {
162
+ V as VideoProvider
163
+ };
@@ -0,0 +1,451 @@
1
+ import { b as y, n as u, K as o, y as b, e as c, p as l, f as k, M as d, L as h, l as v, N as m, T as w, Q as f } from "./wt-vidstack-player-B8Ilx2ml.js";
2
+ import { R as P } from "./vidstack-DqAw8m9J-BSNVCj3S.js";
3
+ import { E as T } from "./vidstack-DDXt6fpN-DEjXPjHx.js";
4
+ import { resolveVimeoVideoId as C, getVimeoVideoInfo as g } from "./vidstack-krOAtKMi-C50BTxmn.js";
5
+ const $ = [
6
+ "bufferend",
7
+ "bufferstart",
8
+ // 'cuechange',
9
+ "durationchange",
10
+ "ended",
11
+ "enterpictureinpicture",
12
+ "error",
13
+ "fullscreenchange",
14
+ "leavepictureinpicture",
15
+ "loaded",
16
+ // 'loadeddata',
17
+ // 'loadedmetadata',
18
+ // 'loadstart',
19
+ "playProgress",
20
+ "loadProgress",
21
+ "pause",
22
+ "play",
23
+ "playbackratechange",
24
+ // 'progress',
25
+ "qualitychange",
26
+ "seeked",
27
+ "seeking",
28
+ // 'texttrackchange',
29
+ "timeupdate",
30
+ "volumechange",
31
+ "waiting"
32
+ // 'adstarted',
33
+ // 'adcompleted',
34
+ // 'aderror',
35
+ // 'adskipped',
36
+ // 'adallcompleted',
37
+ // 'adclicked',
38
+ // 'chapterchange',
39
+ // 'chromecastconnected',
40
+ // 'remoteplaybackavailabilitychange',
41
+ // 'remoteplaybackconnecting',
42
+ // 'remoteplaybackconnect',
43
+ // 'remoteplaybackdisconnect',
44
+ // 'liveeventended',
45
+ // 'liveeventstarted',
46
+ // 'livestreamoffline',
47
+ // 'livestreamonline',
48
+ ];
49
+ class A extends T {
50
+ $$PROVIDER_TYPE = "VIMEO";
51
+ scope = y();
52
+ fullscreen;
53
+ #e;
54
+ #s = u("");
55
+ #i = u(!1);
56
+ #o = null;
57
+ #c = null;
58
+ #d = !1;
59
+ #n = new o(0, 0);
60
+ #l = new P(this.#g.bind(this));
61
+ #w = null;
62
+ #h = null;
63
+ #a = /* @__PURE__ */ new Map();
64
+ #u = null;
65
+ constructor(e, t) {
66
+ super(e), this.#e = t;
67
+ const s = this;
68
+ this.fullscreen = {
69
+ get active() {
70
+ return s.#d;
71
+ },
72
+ supported: !0,
73
+ enter: () => this.#t("requestFullscreen"),
74
+ exit: () => this.#t("exitFullscreen")
75
+ };
76
+ }
77
+ /**
78
+ * Whether tracking session data should be enabled on the embed, including cookies and analytics.
79
+ * This is turned off by default to be GDPR-compliant.
80
+ *
81
+ * @defaultValue `false`
82
+ */
83
+ cookies = !1;
84
+ title = !0;
85
+ byline = !0;
86
+ portrait = !0;
87
+ color = "00ADEF";
88
+ get type() {
89
+ return "vimeo";
90
+ }
91
+ get currentSrc() {
92
+ return this.#c;
93
+ }
94
+ get videoId() {
95
+ return this.#s();
96
+ }
97
+ get hash() {
98
+ return this.#o;
99
+ }
100
+ get isPro() {
101
+ return this.#i();
102
+ }
103
+ preconnect() {
104
+ b(this.getOrigin());
105
+ }
106
+ setup() {
107
+ super.setup(), c(this.#P.bind(this)), c(this.#T.bind(this)), c(this.#C.bind(this)), this.#e.notify("provider-setup", this);
108
+ }
109
+ destroy() {
110
+ this.#v(), this.fullscreen = void 0;
111
+ const e = "provider destroyed";
112
+ for (const t of this.#a.values())
113
+ for (const { reject: s } of t) s(e);
114
+ this.#a.clear(), this.#t("destroy");
115
+ }
116
+ async play() {
117
+ return this.#t("play");
118
+ }
119
+ async pause() {
120
+ return this.#t("pause");
121
+ }
122
+ setMuted(e) {
123
+ this.#t("setMuted", e);
124
+ }
125
+ setCurrentTime(e) {
126
+ this.#t("seekTo", e), this.#e.notify("seeking", e);
127
+ }
128
+ setVolume(e) {
129
+ this.#t("setVolume", e), this.#t("setMuted", l(this.#e.$state.muted));
130
+ }
131
+ setPlaybackRate(e) {
132
+ this.#t("setPlaybackRate", e);
133
+ }
134
+ async loadSource(e) {
135
+ if (!k(e.src)) {
136
+ this.#c = null, this.#o = null, this.#s.set("");
137
+ return;
138
+ }
139
+ const { videoId: t, hash: s } = C(e.src);
140
+ this.#s.set(t ?? ""), this.#o = s ?? null, this.#c = e;
141
+ }
142
+ #P() {
143
+ this.#v();
144
+ const e = this.#s();
145
+ if (!e) {
146
+ this.src.set("");
147
+ return;
148
+ }
149
+ this.src.set(`${this.getOrigin()}/video/${e}`), this.#e.notify("load-start");
150
+ }
151
+ #T() {
152
+ const e = this.#s();
153
+ if (!e) return;
154
+ const t = d(), s = new AbortController();
155
+ return this.#u = t, g(e, s, this.#o).then((i) => {
156
+ t.resolve(i);
157
+ }).catch((i) => {
158
+ t.reject();
159
+ }), () => {
160
+ t.reject(), s.abort();
161
+ };
162
+ }
163
+ #C() {
164
+ const e = this.#i(), { $state: t, qualities: s } = this.#e;
165
+ if (t.canSetPlaybackRate.set(e), s[h.setReadonly](!e), e)
166
+ return v(s, "change", () => {
167
+ if (s.auto) return;
168
+ const i = s.selected?.id;
169
+ i && this.#t("setQuality", i);
170
+ });
171
+ }
172
+ getOrigin() {
173
+ return "https://player.vimeo.com";
174
+ }
175
+ buildParams() {
176
+ const { keyDisabled: e } = this.#e.$props, { playsInline: t, nativeControls: s } = this.#e.$state, i = s();
177
+ return {
178
+ title: this.title,
179
+ byline: this.byline,
180
+ color: this.color,
181
+ portrait: this.portrait,
182
+ controls: i,
183
+ h: this.hash,
184
+ keyboard: i && !e(),
185
+ transparent: !0,
186
+ playsinline: t(),
187
+ dnt: !this.cookies
188
+ };
189
+ }
190
+ #g() {
191
+ this.#t("getCurrentTime");
192
+ }
193
+ // Embed will sometimes dispatch 0 at end of playback.
194
+ #r = !1;
195
+ #$(e, t) {
196
+ if (this.#r && e === 0) return;
197
+ const { realCurrentTime: s, paused: i, bufferedEnd: n, seekableEnd: a, live: r } = this.#e.$state;
198
+ if (s() === e) return;
199
+ const p = s();
200
+ this.#e.notify("time-change", e, t), Math.abs(p - e) > 1.5 && (this.#e.notify("seeking", e, t), !i() && n() < e && this.#e.notify("waiting", void 0, t)), !r() && a() - e < 0.01 && (this.#e.notify("end", void 0, t), this.#r = !0, setTimeout(() => {
201
+ this.#r = !1;
202
+ }, 500));
203
+ }
204
+ #E(e, t) {
205
+ this.#e.notify("seeked", e, t);
206
+ }
207
+ #V(e) {
208
+ const t = this.#s();
209
+ this.#u?.promise.then((s) => {
210
+ if (!s) return;
211
+ const { title: i, poster: n, duration: a, pro: r } = s;
212
+ this.#i.set(r), this.#e.notify("title-change", i, e), this.#e.notify("poster-change", n, e), this.#e.notify("duration-change", a, e), this.#f(a, e);
213
+ }).catch(() => {
214
+ t === this.#s() && (this.#t("getVideoTitle"), this.#t("getDuration"));
215
+ });
216
+ }
217
+ #f(e, t) {
218
+ const { nativeControls: s } = this.#e.$state, i = s();
219
+ this.#n = new o(0, e);
220
+ const n = {
221
+ buffered: new o(0, 0),
222
+ seekable: this.#n,
223
+ duration: e
224
+ };
225
+ this.#e.delegate.ready(n, t), i || this.#t("_hideOverlay"), this.#t("getQualities"), this.#t("getChapters");
226
+ }
227
+ #I(e, t, s) {
228
+ switch (e) {
229
+ case "getVideoTitle":
230
+ const i = t;
231
+ this.#e.notify("title-change", i, s);
232
+ break;
233
+ case "getDuration":
234
+ const n = t;
235
+ this.#e.$state.canPlay() ? this.#e.notify("duration-change", n, s) : this.#f(n, s);
236
+ break;
237
+ case "getCurrentTime":
238
+ this.#$(t, s);
239
+ break;
240
+ case "getBuffered":
241
+ m(t) && t.length && this.#p(t[t.length - 1][1], s);
242
+ break;
243
+ case "setMuted":
244
+ this.#y(l(this.#e.$state.volume), t, s);
245
+ break;
246
+ // case 'getTextTracks':
247
+ // this.#onTextTracksChange(data as VimeoTextTrack[], trigger);
248
+ // break;
249
+ case "getChapters":
250
+ this.#L(t);
251
+ break;
252
+ case "getQualities":
253
+ this.#F(t, s);
254
+ break;
255
+ }
256
+ this.#m(e)?.resolve();
257
+ }
258
+ #R() {
259
+ for (const e of $)
260
+ this.#t("addEventListener", e);
261
+ }
262
+ #M(e) {
263
+ this.#l.stop(), this.#e.notify("pause", void 0, e);
264
+ }
265
+ #A(e) {
266
+ this.#l.start(), this.#e.notify("play", void 0, e);
267
+ }
268
+ #S(e) {
269
+ const { paused: t } = this.#e.$state;
270
+ !t() && !this.#r && this.#e.notify("playing", void 0, e);
271
+ }
272
+ #p(e, t) {
273
+ const s = {
274
+ buffered: new o(0, e),
275
+ seekable: this.#n
276
+ };
277
+ this.#e.notify("progress", s, t);
278
+ }
279
+ #q(e) {
280
+ this.#e.notify("waiting", void 0, e);
281
+ }
282
+ #x(e) {
283
+ const { paused: t } = this.#e.$state;
284
+ t() || this.#e.notify("playing", void 0, e);
285
+ }
286
+ #Q(e) {
287
+ const { paused: t } = this.#e.$state;
288
+ t() && this.#e.notify("play", void 0, e), this.#e.notify("waiting", void 0, e);
289
+ }
290
+ #y(e, t, s) {
291
+ const i = { volume: e, muted: t };
292
+ this.#e.notify("volume-change", i, s);
293
+ }
294
+ // #onTextTrackChange(track: VimeoTextTrack, trigger: Event) {
295
+ // const textTrack = this.#ctx.textTracks.toArray().find((t) => t.language === track.language);
296
+ // if (textTrack) textTrack.mode = track.mode;
297
+ // }
298
+ // #onTextTracksChange(tracks: VimeoTextTrack[], trigger: Event) {
299
+ // for (const init of tracks) {
300
+ // const textTrack = new TextTrack({
301
+ // ...init,
302
+ // label: init.label.replace('auto-generated', 'auto'),
303
+ // });
304
+ // textTrack[TextTrackSymbol.readyState] = 2;
305
+ // this.#ctx.textTracks.add(textTrack, trigger);
306
+ // textTrack.setMode(init.mode, trigger);
307
+ // }
308
+ // }
309
+ // #onCueChange(cue: VimeoTextCue, trigger: Event) {
310
+ // const { textTracks, $state } = this.#ctx,
311
+ // { currentTime } = $state,
312
+ // track = textTracks.selected;
313
+ // if (this.#currentCue) track?.removeCue(this.#currentCue, trigger);
314
+ // this.#currentCue = new window.VTTCue(currentTime(), Number.MAX_SAFE_INTEGER, cue.text);
315
+ // track?.addCue(this.#currentCue, trigger);
316
+ // }
317
+ #L(e) {
318
+ if (this.#b(), !e.length) return;
319
+ const t = new w({
320
+ kind: "chapters",
321
+ default: !0
322
+ }), { seekableEnd: s } = this.#e.$state;
323
+ for (let i = 0; i < e.length; i++) {
324
+ const n = e[i], a = e[i + 1];
325
+ t.addCue(
326
+ new window.VTTCue(
327
+ n.startTime,
328
+ a?.startTime ?? s(),
329
+ n.title
330
+ )
331
+ );
332
+ }
333
+ this.#h = t, this.#e.textTracks.add(t);
334
+ }
335
+ #b() {
336
+ this.#h && (this.#e.textTracks.remove(this.#h), this.#h = null);
337
+ }
338
+ #F(e, t) {
339
+ this.#e.qualities[f.enableAuto] = e.some((s) => s.id === "auto") ? () => this.#t("setQuality", "auto") : void 0;
340
+ for (const s of e) {
341
+ if (s.id === "auto") continue;
342
+ const i = +s.id.slice(0, -1);
343
+ isNaN(i) || this.#e.qualities[h.add](
344
+ {
345
+ id: s.id,
346
+ width: i * (16 / 9),
347
+ height: i,
348
+ codec: "avc1,h.264",
349
+ bitrate: -1
350
+ },
351
+ t
352
+ );
353
+ }
354
+ this.#k(
355
+ e.find((s) => s.active),
356
+ t
357
+ );
358
+ }
359
+ #k({ id: e } = {}, t) {
360
+ if (!e) return;
361
+ const s = e === "auto", i = this.#e.qualities.getById(e);
362
+ s ? (this.#e.qualities[f.setAuto](s, t), this.#e.qualities[h.select](void 0, !0, t)) : this.#e.qualities[h.select](i ?? void 0, !0, t);
363
+ }
364
+ #O(e, t, s) {
365
+ switch (e) {
366
+ case "ready":
367
+ this.#R();
368
+ break;
369
+ case "loaded":
370
+ this.#V(s);
371
+ break;
372
+ case "play":
373
+ this.#A(s);
374
+ break;
375
+ case "playProgress":
376
+ this.#S(s);
377
+ break;
378
+ case "pause":
379
+ this.#M(s);
380
+ break;
381
+ case "loadProgress":
382
+ this.#p(t.seconds, s);
383
+ break;
384
+ case "waiting":
385
+ this.#Q(s);
386
+ break;
387
+ case "bufferstart":
388
+ this.#q(s);
389
+ break;
390
+ case "bufferend":
391
+ this.#x(s);
392
+ break;
393
+ case "volumechange":
394
+ this.#y(t.volume, l(this.#e.$state.muted), s);
395
+ break;
396
+ case "durationchange":
397
+ this.#n = new o(0, t.duration), this.#e.notify("duration-change", t.duration, s);
398
+ break;
399
+ case "playbackratechange":
400
+ this.#e.notify("rate-change", t.playbackRate, s);
401
+ break;
402
+ case "qualitychange":
403
+ this.#k(t, s);
404
+ break;
405
+ case "fullscreenchange":
406
+ this.#d = t.fullscreen, this.#e.notify("fullscreen-change", t.fullscreen, s);
407
+ break;
408
+ case "enterpictureinpicture":
409
+ this.#e.notify("picture-in-picture-change", !0, s);
410
+ break;
411
+ case "leavepictureinpicture":
412
+ this.#e.notify("picture-in-picture-change", !1, s);
413
+ break;
414
+ case "ended":
415
+ this.#e.notify("end", void 0, s);
416
+ break;
417
+ case "error":
418
+ this.#D(t, s);
419
+ break;
420
+ case "seek":
421
+ case "seeked":
422
+ this.#E(t.seconds, s);
423
+ break;
424
+ }
425
+ }
426
+ #D(e, t) {
427
+ const { message: s, method: i } = e;
428
+ i === "setPlaybackRate" && this.#i.set(!1), i && this.#m(i)?.reject(s);
429
+ }
430
+ onMessage(e, t) {
431
+ e.event ? this.#O(e.event, e.data, t) : e.method && this.#I(e.method, e.value, t);
432
+ }
433
+ onLoad() {
434
+ }
435
+ async #t(e, t) {
436
+ let s = d(), i = this.#a.get(e);
437
+ return i || this.#a.set(e, i = []), i.push(s), this.postMessage({
438
+ method: e,
439
+ value: t
440
+ }), s.promise;
441
+ }
442
+ #v() {
443
+ this.#l.stop(), this.#n = new o(0, 0), this.#u = null, this.#w = null, this.#i.set(!1), this.#b();
444
+ }
445
+ #m(e) {
446
+ return this.#a.get(e)?.shift();
447
+ }
448
+ }
449
+ export {
450
+ A as VimeoProvider
451
+ };