@webitel/ui-sdk 26.6.33 → 26.6.35

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 (177) hide show
  1. package/dist/AgentStatus.enum-C3IGHtvR.js +9 -0
  2. package/dist/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
  3. package/dist/caseConverters-DXegZoCt.js +27 -0
  4. package/dist/chunk-CY3AvKd6.js +20 -0
  5. package/dist/clients-A6MHYfOX.js +36118 -0
  6. package/dist/components-B4aAS7wB.js +5391 -0
  7. package/dist/composables-DnDH-KUv.js +263 -0
  8. package/dist/convertDuration-1K7fuEpO.js +8 -0
  9. package/dist/debounce-DrmECuJ2.js +128 -0
  10. package/dist/deep-copy-CQw5yeEH.js +41 -0
  11. package/dist/displayText-CtaxzaBz.js +3 -0
  12. package/dist/dist-05Bf47Wg.js +87 -0
  13. package/dist/dist-BYiYpK00.js +7 -0
  14. package/dist/dist-Dz55hlwp.js +1371 -0
  15. package/dist/engineCallFileType-D7QVFOac.js +11 -0
  16. package/dist/enums-pbYAJNeb.js +158 -0
  17. package/dist/errors-SUXKojVW.js +69 -0
  18. package/dist/floating-ui.dom-n2j9PKCB.js +842 -0
  19. package/dist/generateInstance-ppTIeLX4.js +2582 -0
  20. package/dist/isObject-Dgs_L5xI.js +11 -0
  21. package/dist/logger-hl3ueNok.js +47 -0
  22. package/dist/prod-Cp0BjuxI.js +775 -0
  23. package/dist/prod-DSuxcp5t.js +2 -0
  24. package/dist/side-channel-Cyte-MzW.js +833 -0
  25. package/dist/sortQueryAdapters-CyYXvnDN.js +14 -0
  26. package/dist/srt-parser-DdH5U08c.js +21 -0
  27. package/dist/ssa-parser-Bjs7yDD1.js +184 -0
  28. package/dist/ui-sdk.css +2 -1
  29. package/dist/ui-sdk.js +34541 -4
  30. package/dist/ui-sdk.umd.cjs +7740 -7606
  31. package/dist/useExpansion-DVdIpoOn.js +24 -0
  32. package/dist/useValidation-DG0tifBv.js +37 -0
  33. package/dist/useVidstackSrc-DfNrFbOO.js +155 -0
  34. package/dist/useWtTable-tqmVOvve.js +12 -0
  35. package/dist/vidstack-B01xzxC4-DeYSgDZy.js +7 -0
  36. package/dist/vidstack-BGSTndAW-CyKM_CM4.js +957 -0
  37. package/dist/vidstack-BQlOPwOu-ChhdffAJ.js +43 -0
  38. package/dist/vidstack-Bq6c3Bam-3dCf_D36.js +398 -0
  39. package/dist/vidstack-C2US-gSO-DeIgENrW.js +127 -0
  40. package/dist/vidstack-C9vIqaYT-C1EgPq17.js +9 -0
  41. package/dist/vidstack-CTojmhKq-D7sZJxgm.js +30 -0
  42. package/dist/vidstack-ChQTHmIQ-nTO94M6P.js +51 -0
  43. package/dist/vidstack-Ci54COQW-CAAXpwzv.js +208 -0
  44. package/dist/vidstack-D2pY00kU-DoW028io.js +70 -0
  45. package/dist/vidstack-D5EzK014-DOe01V3H.js +14 -0
  46. package/dist/vidstack-DDXt6fpN-Don_e6LS.js +42 -0
  47. package/dist/vidstack-D_-9AA6_-Dq3APB0-.js +19 -0
  48. package/dist/vidstack-Dihypf8P-ibWMCHK-.js +12 -0
  49. package/dist/vidstack-Dm1xEU9Q-VlefmrP8.js +31 -0
  50. package/dist/vidstack-DqAw8m9J-Dk1GT3Oe.js +22 -0
  51. package/dist/vidstack-audio-B58bvsna.js +23 -0
  52. package/dist/vidstack-dash-CX-LTHx3.js +332 -0
  53. package/dist/vidstack-google-cast-Co5Q_rfL.js +361 -0
  54. package/dist/vidstack-hls-CLzdTFu6.js +269 -0
  55. package/dist/vidstack-krOAtKMi-DN1WZC3p.js +30 -0
  56. package/dist/vidstack-video-XtP8iTBc.js +151 -0
  57. package/dist/vidstack-vimeo-EzzPpggD.js +386 -0
  58. package/dist/vidstack-youtube-C1_NAfWa.js +205 -0
  59. package/dist/vue-i18n-B8Px6VcD.js +2201 -0
  60. package/dist/wt-action-bar-Ba1ZJjE_.js +85 -0
  61. package/dist/wt-button-DENbrKdy.js +785 -0
  62. package/dist/wt-button-select-BnRHgJ4i.js +80 -0
  63. package/dist/wt-call-media-action-Bkyppnsm.js +42 -0
  64. package/dist/wt-chat-emoji-wdBt1XzD.js +2208 -0
  65. package/dist/wt-confirm-dialog-DCUitG2v.js +70 -0
  66. package/dist/wt-context-menu-yW52oF-2.js +89 -0
  67. package/dist/wt-copy-action-d9gVzAsB.js +38 -0
  68. package/dist/wt-datepicker-Cnbarx_j.js +5774 -0
  69. package/dist/wt-display-chip-items-CvMM8WMk.js +34 -0
  70. package/dist/wt-dual-panel-DAhTYFS_.js +49 -0
  71. package/dist/wt-dummy-CLjhRWZ6.js +59 -0
  72. package/dist/wt-error-page-vhu4lIyF.js +62 -0
  73. package/dist/wt-expand-transition-C2p9bR4j.js +39 -0
  74. package/dist/wt-expansion-card-qsxvbtZm.js +47 -0
  75. package/dist/wt-expansion-panel-C_EXvx1d.js +40 -0
  76. package/dist/wt-filters-panel-wrapper-Cc9b3aci.js +51 -0
  77. package/dist/wt-galleria-CWXKuZTD.js +224 -0
  78. package/dist/wt-icon-action-CQlZHMDB.js +100 -0
  79. package/dist/wt-icon-btn-CjjI4cgE.js +107 -0
  80. package/dist/wt-icon-pxO7IjwV.js +1026 -0
  81. package/dist/wt-inline-add-panel-B0E4Vk2l.js +43 -0
  82. package/dist/wt-navigation-menu-CenQi_-T.js +126 -0
  83. package/dist/wt-notifications-bar-Ep1QuFZi.js +52 -0
  84. package/dist/wt-page-header-CDbd4aOh.js +59 -0
  85. package/dist/wt-pagination-BA_PZPIE.js +94 -0
  86. package/dist/wt-player-uidPXSTe.js +287 -0
  87. package/dist/wt-popover-CJZH3wMl.js +98 -0
  88. package/dist/wt-screen-recordings-action-Dg7Ts2Jt.js +37 -0
  89. package/dist/wt-search-bar-CWZdvAOf.js +123 -0
  90. package/dist/wt-selection-popup-B77UY7Yu.js +79 -0
  91. package/dist/wt-send-message-popup-D0GJMGni.js +77 -0
  92. package/dist/wt-slider-BS3SoGht.js +68 -0
  93. package/dist/wt-start-page-eN1PEokc.js +86 -0
  94. package/dist/wt-status-select-A5t6Vjm4.js +101 -0
  95. package/dist/wt-stepper-B6zpd1Uh.js +41 -0
  96. package/dist/wt-table-D0FynxIE.js +364 -0
  97. package/dist/wt-table-actions-4-peSVkc.js +63 -0
  98. package/dist/wt-table-column-select-DFF6z3a3.js +100 -0
  99. package/dist/wt-tabs-DuOgj-lZ.js +60 -0
  100. package/dist/wt-time-input-CO2cop3y.js +62 -0
  101. package/dist/wt-timepicker-BltFF1QD.js +145 -0
  102. package/dist/wt-tree-ZyoPrNOl.js +1206 -0
  103. package/dist/wt-tree-table-MLET4gIv.js +221 -0
  104. package/dist/wt-type-extension-value-input-fnNxJLsq.js +104 -0
  105. package/dist/wt-vidstack-player-DLTA9mBK.js +7440 -0
  106. package/package.json +5 -5
  107. package/src/components/wt-table-column-select/__tests__/WtTableColumnSelect.spec.js +3 -3
  108. package/src/components/wt-vidstack-player/wt-vidstack-player.vue +2 -2
  109. package/dist/contacts-C-FnP7wP.js +0 -49654
  110. package/dist/displayText-Cbh4IOfM.js +0 -5
  111. package/dist/engineCallFileType-yaadA7-2.js +0 -8
  112. package/dist/errors-CTL-RV3B.js +0 -70
  113. package/dist/index-BBLSS-t1.js +0 -50
  114. package/dist/install-DOSuNFtE.js +0 -53489
  115. package/dist/isObject-CMQJaQIp.js +0 -28
  116. package/dist/prod-BoQuiIB3.js +0 -973
  117. package/dist/srt-parser-CsN7bp5E.js +0 -26
  118. package/dist/ssa-parser-BJOOPeQF.js +0 -200
  119. package/dist/useExpansion-BrQ40HiR.js +0 -24
  120. package/dist/useVidstackSrc-MfWBq7Ef.js +0 -1341
  121. package/dist/vidstack-Bq6c3Bam-C_T8PkmG.js +0 -426
  122. package/dist/vidstack-D2pY00kU-CphVKcJq.js +0 -136
  123. package/dist/vidstack-DDXt6fpN-2lNfj8Ca.js +0 -51
  124. package/dist/vidstack-D_-9AA6_-Cyl8HzDm.js +0 -21
  125. package/dist/vidstack-Dm1xEU9Q-CXHNvShT.js +0 -30
  126. package/dist/vidstack-DqAw8m9J-C2p9K7Db.js +0 -22
  127. package/dist/vidstack-audio-BL-Sa_Ap.js +0 -28
  128. package/dist/vidstack-dash-mKhgfurw.js +0 -393
  129. package/dist/vidstack-google-cast-BGqSw2iP.js +0 -383
  130. package/dist/vidstack-hls-U5fTV3hj.js +0 -310
  131. package/dist/vidstack-krOAtKMi-C50BTxmn.js +0 -28
  132. package/dist/vidstack-video-Bxf7KDne.js +0 -164
  133. package/dist/vidstack-vimeo-MngSXtDR.js +0 -452
  134. package/dist/vidstack-youtube-Ctg91VeX.js +0 -233
  135. package/dist/wt-action-bar-DaDcqA4n.js +0 -102
  136. package/dist/wt-button-select-q_BITVhH.js +0 -105
  137. package/dist/wt-call-media-action-BkBcZN17.js +0 -60
  138. package/dist/wt-chat-emoji-BGuSgYi3.js +0 -2909
  139. package/dist/wt-confirm-dialog-C7-74ROm.js +0 -92
  140. package/dist/wt-context-menu-CzAHMaOj.js +0 -104
  141. package/dist/wt-copy-action-BpckAObd.js +0 -60
  142. package/dist/wt-datepicker-DauMnf2r.js +0 -5660
  143. package/dist/wt-display-chip-items-zcqxH89_.js +0 -47
  144. package/dist/wt-dual-panel-Cj79kJpk.js +0 -66
  145. package/dist/wt-dummy-BUHYAcsk.js +0 -104
  146. package/dist/wt-error-page-CNSqDA-o.js +0 -89
  147. package/dist/wt-expansion-card-CtcuXg6f.js +0 -56
  148. package/dist/wt-expansion-panel-BU2Hb-N2.js +0 -54
  149. package/dist/wt-filters-panel-wrapper-BlLlAixc.js +0 -75
  150. package/dist/wt-galleria-BQzGD6-3.js +0 -323
  151. package/dist/wt-inline-add-panel-fG58a6T3.js +0 -49
  152. package/dist/wt-navigation-menu-2ggfyrM_.js +0 -159
  153. package/dist/wt-notifications-bar-Epn_SA_R.js +0 -79
  154. package/dist/wt-page-header-DdsnoLgd.js +0 -115
  155. package/dist/wt-pagination-Byg79HfY.js +0 -144
  156. package/dist/wt-player-kjdJYVi3.js +0 -291
  157. package/dist/wt-popover-Di-7_rDL.js +0 -4
  158. package/dist/wt-popover.vue_vue_type_style_index_0_lang-DMDTlCgv.js +0 -81
  159. package/dist/wt-screen-recordings-action-Z3x-gI0n.js +0 -54
  160. package/dist/wt-search-bar-CxwSi-Xo.js +0 -144
  161. package/dist/wt-selection-popup-MdCfrgcd.js +0 -109
  162. package/dist/wt-send-message-popup-DklTgoGj.js +0 -579
  163. package/dist/wt-slider-BEkw4KGp.js +0 -4
  164. package/dist/wt-slider.vue_vue_type_script_setup_true_lang-DlaRDHxo.js +0 -55
  165. package/dist/wt-start-page-B59KbWqX.js +0 -99
  166. package/dist/wt-status-select-hOAr_xBg.js +0 -138
  167. package/dist/wt-stepper-CMeW3d6N.js +0 -65
  168. package/dist/wt-table-C5CLtnK5.js +0 -426
  169. package/dist/wt-table-actions-DgAfy-dd.js +0 -79
  170. package/dist/wt-table-column-select-BK5rozpI.js +0 -128
  171. package/dist/wt-tabs-Bn6rSg0s.js +0 -74
  172. package/dist/wt-time-input-DYiW0ijt.js +0 -42
  173. package/dist/wt-timepicker-CkjoLwXC.js +0 -118
  174. package/dist/wt-tree-CCvr4TTF.js +0 -2777
  175. package/dist/wt-tree-table-BWmGF3rE.js +0 -285
  176. package/dist/wt-type-extension-value-input-q5286OSO.js +0 -121
  177. package/dist/wt-vidstack-player-CTWna35Q.js +0 -9093
@@ -0,0 +1,775 @@
1
+ //#region node_modules/media-captions/dist/prod/index.js
2
+ var e = {
3
+ LoadFail: 0,
4
+ BadSignature: 1,
5
+ BadTimestamp: 2,
6
+ BadSettingValue: 3,
7
+ BadFormat: 4,
8
+ UnknownSetting: 5
9
+ }, t = class extends Error {
10
+ code;
11
+ line;
12
+ constructor(e) {
13
+ super(e.reason), this.code = e.code, this.line = e.line;
14
+ }
15
+ }, n = /\r?\n|\r/gm, r = class {
16
+ writable;
17
+ readable;
18
+ constructor(e) {
19
+ let t = new i(e);
20
+ this.writable = new WritableStream({
21
+ write(e) {
22
+ t.transform(e);
23
+ },
24
+ close() {
25
+ t.close();
26
+ }
27
+ }), this.readable = new ReadableStream({ start(e) {
28
+ t.onLine = (t) => e.enqueue(t), t.onClose = () => e.close();
29
+ } });
30
+ }
31
+ }, i = class {
32
+ a = "";
33
+ b;
34
+ onLine;
35
+ onClose;
36
+ constructor(e) {
37
+ this.b = new TextDecoder(e);
38
+ }
39
+ transform(e) {
40
+ this.a += this.b.decode(e, { stream: !0 });
41
+ let t = this.a.split(n);
42
+ this.a = t.pop() || "";
43
+ for (let e = 0; e < t.length; e++) this.onLine(t[e].trim());
44
+ }
45
+ close() {
46
+ this.a && this.onLine(this.a.trim()), this.a = "", this.onClose();
47
+ }
48
+ };
49
+ async function a(e, t) {
50
+ return o(new ReadableStream({ start(t) {
51
+ let r = e.split(n);
52
+ for (let e of r) t.enqueue(e);
53
+ t.close();
54
+ } }), t);
55
+ }
56
+ async function o(e, t) {
57
+ let n = t?.type ?? "vtt", r;
58
+ if (typeof n == "string") switch (n) {
59
+ case "srt":
60
+ r = (await import("./srt-parser-DdH5U08c.js")).default;
61
+ break;
62
+ case "ssa":
63
+ case "ass":
64
+ r = (await import("./ssa-parser-Bjs7yDD1.js")).default;
65
+ break;
66
+ default: r = (await Promise.resolve().then(function() {
67
+ return fe;
68
+ })).default;
69
+ }
70
+ else r = n;
71
+ let i, a = e.getReader(), o = r(), s = !!t?.strict || !!t?.errors;
72
+ await o.init({
73
+ strict: !1,
74
+ ...t,
75
+ errors: s,
76
+ type: n,
77
+ cancel() {
78
+ a.cancel(), i = o.done(!0);
79
+ }
80
+ });
81
+ let c = 1;
82
+ for (;;) {
83
+ let { value: e, done: t } = await a.read();
84
+ if (t) {
85
+ o.parse("", c), i = o.done(!1);
86
+ break;
87
+ }
88
+ o.parse(e, c), c++;
89
+ }
90
+ return i;
91
+ }
92
+ async function s(e, t) {
93
+ let n = await e;
94
+ if (!n.ok || !n.body) return {
95
+ metadata: {},
96
+ cues: [],
97
+ regions: [],
98
+ errors: [void 0]
99
+ };
100
+ let r = n.headers.get("content-type") || "", i = r.match(/text\/(.*?)(?:;|$)/)?.[1], a = r.match(/charset=(.*?)(?:;|$)/)?.[1];
101
+ return c(n.body, {
102
+ type: i,
103
+ encoding: a,
104
+ ...t
105
+ });
106
+ }
107
+ async function c(e, { encoding: t = "utf-8", ...n } = {}) {
108
+ return o(e.pipeThrough(new r(t)), n);
109
+ }
110
+ var l = class extends EventTarget {
111
+ id = "";
112
+ startTime;
113
+ endTime;
114
+ text;
115
+ pauseOnExit = !1;
116
+ constructor(e, t, n) {
117
+ super(), this.startTime = e, this.endTime = t, this.text = n;
118
+ }
119
+ addEventListener(e, t, n) {
120
+ super.addEventListener(e, t, n);
121
+ }
122
+ removeEventListener(e, t, n) {
123
+ super.removeEventListener(e, t, n);
124
+ }
125
+ }, u = typeof document > "u", d = u ? l : window.VTTCue, f = class extends d {
126
+ region = null;
127
+ vertical = "";
128
+ snapToLines = !0;
129
+ line = "auto";
130
+ lineAlign = "start";
131
+ position = "auto";
132
+ positionAlign = "auto";
133
+ size = 100;
134
+ align = "center";
135
+ style;
136
+ }, p = class {
137
+ id = "";
138
+ width = 100;
139
+ lines = 3;
140
+ regionAnchorX = 0;
141
+ regionAnchorY = 100;
142
+ viewportAnchorX = 0;
143
+ viewportAnchorY = 100;
144
+ scroll = "";
145
+ }, m = ",", ee = "%";
146
+ function te(e) {
147
+ let t = parseInt(e, 10);
148
+ return Number.isNaN(t) ? null : t;
149
+ }
150
+ function h(e) {
151
+ let t = parseInt(e.replace(ee, ""), 10);
152
+ return !Number.isNaN(t) && t >= 0 && t <= 100 ? t : null;
153
+ }
154
+ function g(e) {
155
+ if (!e.includes(m)) return null;
156
+ let [t, n] = e.split(m).map(h);
157
+ return t !== null && n !== null ? [t, n] : null;
158
+ }
159
+ function ne(e) {
160
+ let t = parseFloat(e);
161
+ return Number.isNaN(t) ? null : t;
162
+ }
163
+ var re = "WEBVTT", _ = ",", ie = "%", v = /[:=]/, y = /^[\s\t]*(region|vertical|line|position|size|align)[:=]/, b = "NOTE", x = "REGION", S = /^REGION:?[\s\t]+/, C = /[\s\t]+/, ae = "-->", oe = /[\s\t]*-->[\s\t]+/, se = /start|center|end|left|right/, ce = /start|center|end/, le = /line-(?:left|right)|center|auto/, ue = /^(?:(\d{1,2}):)?(\d{2}):(\d{2})(?:\.(\d{1,3}))?$/, w = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Header = 1] = "Header", e[e.Cue = 2] = "Cue", e[e.Region = 3] = "Region", e[e.Note = 4] = "Note", e))(w || {}), T = class {
164
+ h;
165
+ e = 0;
166
+ i = {};
167
+ j = {};
168
+ l = [];
169
+ c = null;
170
+ d = null;
171
+ m = [];
172
+ f;
173
+ n = "";
174
+ async init(e) {
175
+ this.h = e, e.strict && (this.e = 1), e.errors && (this.f = (await import("./errors-SUXKojVW.js")).ParseErrorBuilder);
176
+ }
177
+ parse(e, t) {
178
+ if (e === "") this.c ? (this.l.push(this.c), this.h.onCue?.(this.c), this.c = null) : this.d ? (this.j[this.d.id] = this.d, this.h.onRegion?.(this.d), this.d = null) : this.e === 1 && (this.k(e, t), this.h.onHeaderMetadata?.(this.i)), this.e = 0;
179
+ else if (this.e) switch (this.e) {
180
+ case 1:
181
+ this.k(e, t);
182
+ break;
183
+ case 2:
184
+ if (this.c) {
185
+ let n = this.c.text.length > 0;
186
+ !n && y.test(e) ? this.o(e.split(C), t) : this.c.text += (n ? "\n" : "") + e;
187
+ }
188
+ break;
189
+ case 3:
190
+ this.p(e.split(C), t);
191
+ break;
192
+ }
193
+ else if (e.startsWith(b)) this.e = 4;
194
+ else if (e.startsWith(x)) this.e = 3, this.d = new p(), this.p(e.replace(S, "").split(C), t);
195
+ else if (e.includes(ae)) {
196
+ let n = this.q(e, t);
197
+ n && (this.c = new f(n[0], n[1], ""), this.c.id = this.n, this.o(n[2], t)), this.e = 2;
198
+ } else t === 1 && this.k(e, t);
199
+ this.n = e;
200
+ }
201
+ done() {
202
+ return {
203
+ metadata: this.i,
204
+ cues: this.l,
205
+ regions: Object.values(this.j),
206
+ errors: this.m
207
+ };
208
+ }
209
+ k(e, t) {
210
+ if (t > 1) {
211
+ if (v.test(e)) {
212
+ let [t, n] = e.split(v);
213
+ t && (this.i[t] = (n || "").replace(C, ""));
214
+ }
215
+ } else e.startsWith(re) ? this.e = 1 : this.g(this.f?.r());
216
+ }
217
+ q(e, t) {
218
+ let [n, r = ""] = e.split(oe), [i, ...a] = r.split(C), o = E(n), s = E(i);
219
+ if (o !== null && s !== null && s > o) return [
220
+ o,
221
+ s,
222
+ a
223
+ ];
224
+ o === null && this.g(this.f?.s(n, t)), s === null && this.g(this.f?.t(i, t)), o != null && s !== null && s > o && this.g(this.f?.u(o, s, t));
225
+ }
226
+ p(e, t) {
227
+ let n;
228
+ for (let r = 0; r < e.length; r++) if (v.test(e[r])) {
229
+ n = !1;
230
+ let [i, a] = e[r].split(v);
231
+ switch (i) {
232
+ case "id":
233
+ this.d.id = a;
234
+ break;
235
+ case "width":
236
+ let e = h(a);
237
+ e === null ? n = !0 : this.d.width = e;
238
+ break;
239
+ case "lines":
240
+ let r = te(a);
241
+ r === null ? n = !0 : this.d.lines = r;
242
+ break;
243
+ case "regionanchor":
244
+ let o = g(a);
245
+ o === null ? n = !0 : (this.d.regionAnchorX = o[0], this.d.regionAnchorY = o[1]);
246
+ break;
247
+ case "viewportanchor":
248
+ let s = g(a);
249
+ s === null ? n = !0 : (this.d.viewportAnchorX = s[0], this.d.viewportAnchorY = s[1]);
250
+ break;
251
+ case "scroll":
252
+ a === "up" ? this.d.scroll = "up" : n = !0;
253
+ break;
254
+ default: this.g(this.f?.v(i, a, t));
255
+ }
256
+ n && this.g(this.f?.w(i, a, t));
257
+ }
258
+ }
259
+ o(e, t) {
260
+ let n;
261
+ for (let r = 0; r < e.length; r++) if (n = !1, v.test(e[r])) {
262
+ let [i, a] = e[r].split(v);
263
+ switch (i) {
264
+ case "region":
265
+ let e = this.j[a];
266
+ e && (this.c.region = e);
267
+ break;
268
+ case "vertical":
269
+ a === "lr" || a === "rl" ? (this.c.vertical = a, this.c.region = null) : n = !0;
270
+ break;
271
+ case "line":
272
+ let [r, o] = a.split(_);
273
+ if (r.includes(ie)) {
274
+ let e = h(r);
275
+ e === null ? n = !0 : (this.c.line = e, this.c.snapToLines = !1);
276
+ } else {
277
+ let e = ne(r);
278
+ e === null ? n = !0 : this.c.line = e;
279
+ }
280
+ ce.test(o) ? this.c.lineAlign = o : o && (n = !0), this.c.line !== "auto" && (this.c.region = null);
281
+ break;
282
+ case "position":
283
+ let [s, c] = a.split(_), l = h(s);
284
+ l === null ? n = !0 : this.c.position = l, c && le.test(c) ? this.c.positionAlign = c : c && (n = !0);
285
+ break;
286
+ case "size":
287
+ let u = h(a);
288
+ u === null ? n = !0 : (this.c.size = u, u < 100 && (this.c.region = null));
289
+ break;
290
+ case "align":
291
+ se.test(a) ? this.c.align = a : n = !0;
292
+ break;
293
+ default: this.g(this.f?.x(i, a, t));
294
+ }
295
+ n && this.g(this.f?.y(i, a, t));
296
+ }
297
+ }
298
+ g(e) {
299
+ if (e) {
300
+ if (this.m.push(e), this.h.strict) throw this.h.cancel(), e;
301
+ this.h.onError?.(e);
302
+ }
303
+ }
304
+ };
305
+ function E(e) {
306
+ let t = e.match(ue);
307
+ if (!t) return null;
308
+ let n = t[1] ? parseInt(t[1], 10) : 0, r = parseInt(t[2], 10), i = parseInt(t[3], 10), a = t[4] ? parseInt(t[4].padEnd(3, "0"), 10) : 0, o = n * 3600 + r * 60 + i + a / 1e3;
309
+ return n < 0 || r < 0 || i < 0 || a < 0 || r > 59 || i > 59 ? null : o;
310
+ }
311
+ function de() {
312
+ return new T();
313
+ }
314
+ var fe = /*#__PURE__*/ Object.freeze({
315
+ __proto__: null,
316
+ VTTBlock: w,
317
+ VTTParser: T,
318
+ default: de,
319
+ parseVTTTimestamp: E
320
+ }), pe = /[0-9]/, me = /[\s\t]+/, D = {
321
+ c: "span",
322
+ i: "i",
323
+ b: "b",
324
+ u: "u",
325
+ ruby: "ruby",
326
+ rt: "rt",
327
+ v: "span",
328
+ lang: "span",
329
+ timestamp: "span"
330
+ }, O = {
331
+ "&amp;": "&",
332
+ "&lt;": "<",
333
+ "&gt;": ">",
334
+ "&quot;": "\"",
335
+ "&#39;": "'",
336
+ "&nbsp;": "\xA0",
337
+ "&lrm;": "‎",
338
+ "&rlm;": "‏"
339
+ }, k = /&(?:amp|lt|gt|quot|#(0+)?39|nbsp|lrm|rlm);/g, A = /* @__PURE__ */ new Set([
340
+ "white",
341
+ "lime",
342
+ "cyan",
343
+ "red",
344
+ "yellow",
345
+ "magenta",
346
+ "blue",
347
+ "black"
348
+ ]), j = /* @__PURE__ */ new Set(Object.keys(D));
349
+ function M(e) {
350
+ let t = "", n = 1, r = [], i = [], a;
351
+ for (let r = 0; r < e.text.length; r++) {
352
+ let l = e.text[r];
353
+ switch (n) {
354
+ case 1:
355
+ l === "<" ? (c(), n = 2) : t += l;
356
+ break;
357
+ case 2:
358
+ switch (l) {
359
+ case "\n":
360
+ case " ":
361
+ case " ":
362
+ o(), n = 4;
363
+ break;
364
+ case ".":
365
+ o(), n = 3;
366
+ break;
367
+ case "/":
368
+ n = 5;
369
+ break;
370
+ case ">":
371
+ o(), n = 1;
372
+ break;
373
+ default:
374
+ !t && pe.test(l) && (n = 6), t += l;
375
+ break;
376
+ }
377
+ break;
378
+ case 3:
379
+ switch (l) {
380
+ case " ":
381
+ case " ":
382
+ case "\n":
383
+ s(), a && a.class?.trim(), n = 4;
384
+ break;
385
+ case ".":
386
+ s();
387
+ break;
388
+ case ">":
389
+ s(), a && a.class?.trim(), n = 1;
390
+ break;
391
+ default: t += l;
392
+ }
393
+ break;
394
+ case 4:
395
+ l === ">" ? (t = t.replace(me, " "), a?.type === "v" ? a.voice = P(t) : a?.type === "lang" && (a.lang = P(t)), t = "", n = 1) : t += l;
396
+ break;
397
+ case 5:
398
+ l === ">" && (t = "", a = i.pop(), n = 1);
399
+ break;
400
+ case 6:
401
+ if (l === ">") {
402
+ let r = E(t);
403
+ r !== null && r >= e.startTime && r <= e.endTime && (t = "timestamp", o(), a.time = r), t = "", n = 1;
404
+ } else t += l;
405
+ break;
406
+ }
407
+ }
408
+ function o() {
409
+ if (j.has(t)) {
410
+ let e = a;
411
+ a = N(t), e ? (i[i.length - 1] !== e && i.push(e), e.children.push(a)) : r.push(a);
412
+ }
413
+ t = "", n = 1;
414
+ }
415
+ function s() {
416
+ if (a && t) {
417
+ let e = t.replace("bg_", "");
418
+ A.has(e) ? a[t.startsWith("bg_") ? "bgColor" : "color"] = e : a.class = a.class ? a.class + " " + t : t;
419
+ }
420
+ t = "";
421
+ }
422
+ function c() {
423
+ if (!t) return;
424
+ let e = {
425
+ type: "text",
426
+ data: P(t)
427
+ };
428
+ a ? a.children.push(e) : r.push(e), t = "";
429
+ }
430
+ return n === 1 && c(), r;
431
+ }
432
+ function N(e) {
433
+ return {
434
+ tagName: D[e],
435
+ type: e,
436
+ children: []
437
+ };
438
+ }
439
+ function P(e) {
440
+ return e.replace(k, (e) => O[e] || "'");
441
+ }
442
+ function F(e, t, n) {
443
+ e.style.setProperty(`--${t}`, n + "");
444
+ }
445
+ function I(e, t, n = !0) {
446
+ e.setAttribute(`data-${t}`, n === !0 ? "" : n + "");
447
+ }
448
+ function L(e, t) {
449
+ e.setAttribute("data-part", t);
450
+ }
451
+ function R(e) {
452
+ return parseFloat(getComputedStyle(e).lineHeight) || 0;
453
+ }
454
+ function z(e) {
455
+ if (u) throw Error("[media-captions] called `createVTTCueTemplate` on the server - use `renderVTTCueString`");
456
+ let t = document.createElement("template");
457
+ return t.innerHTML = B(e), {
458
+ cue: e,
459
+ content: t.content
460
+ };
461
+ }
462
+ function B(e, t = 0) {
463
+ return V(M(e), t);
464
+ }
465
+ function V(e, t = 0) {
466
+ let n, r = "";
467
+ for (let i of e) if (i.type === "text") r += i.data;
468
+ else {
469
+ let e = i.type === "timestamp";
470
+ n = {}, n.class = i.class, n.title = i.type === "v" && i.voice, n.lang = i.type === "lang" && i.lang, n["data-part"] = i.type === "v" && "voice", e && (n["data-part"] = "timed", n["data-time"] = i.time, n["data-future"] = i.time > t, n["data-past"] = i.time < t), n.style = `${i.color ? `color: ${i.color};` : ""}${i.bgColor ? `background-color: ${i.bgColor};` : ""}`;
471
+ let a = Object.entries(n).filter((e) => e[1]).map((e) => `${e[0]}="${e[1] === !0 ? "" : e[1]}"`).join(" ");
472
+ r += `<${i.tagName}${a ? " " + a : ""}>${V(i.children)}</${i.tagName}>`;
473
+ }
474
+ return r;
475
+ }
476
+ function H(e, t) {
477
+ if (!u) for (let n of e.querySelectorAll("[data-part=\"timed\"]")) {
478
+ let e = Number(n.getAttribute("data-time"));
479
+ Number.isNaN(e) || (e > t ? I(n, "future") : n.removeAttribute("data-future"), e < t ? I(n, "past") : n.removeAttribute("data-past"));
480
+ }
481
+ }
482
+ function he(e, t) {
483
+ let n = null, r;
484
+ function i() {
485
+ a(), e(...r), r = void 0;
486
+ }
487
+ function a() {
488
+ clearTimeout(n), n = null;
489
+ }
490
+ function o() {
491
+ r = [].slice.call(arguments), a(), n = setTimeout(i, t);
492
+ }
493
+ return o;
494
+ }
495
+ var U = Symbol(0);
496
+ function W(e) {
497
+ return e instanceof HTMLElement ? {
498
+ top: e.offsetTop,
499
+ width: e.clientWidth,
500
+ height: e.clientHeight,
501
+ left: e.offsetLeft,
502
+ right: e.offsetLeft + e.clientWidth,
503
+ bottom: e.offsetTop + e.clientHeight
504
+ } : { ...e };
505
+ }
506
+ function G(e, t, n) {
507
+ switch (t) {
508
+ case "+x":
509
+ e.left += n, e.right += n;
510
+ break;
511
+ case "-x":
512
+ e.left -= n, e.right -= n;
513
+ break;
514
+ case "+y":
515
+ e.top += n, e.bottom += n;
516
+ break;
517
+ case "-y":
518
+ e.top -= n, e.bottom -= n;
519
+ break;
520
+ }
521
+ }
522
+ function ge(e, t) {
523
+ return e.left <= t.right && e.right >= t.left && e.top <= t.bottom && e.bottom >= t.top;
524
+ }
525
+ function _e(e, t) {
526
+ for (let n = 0; n < t.length; n++) if (ge(e, t[n])) return t[n];
527
+ return null;
528
+ }
529
+ function K(e, t) {
530
+ return t.top >= 0 && t.bottom <= e.height && t.left >= 0 && t.right <= e.width;
531
+ }
532
+ function ve(e, t, n) {
533
+ switch (n) {
534
+ case "+x": return t.left < 0;
535
+ case "-x": return t.right > e.width;
536
+ case "+y": return t.top < 0;
537
+ case "-y": return t.bottom > e.height;
538
+ }
539
+ }
540
+ function ye(e, t) {
541
+ return Math.max(0, Math.min(e.width, t.right) - Math.max(0, t.left)) * Math.max(0, Math.min(e.height, t.bottom) - Math.max(0, t.top)) / (e.height * e.width);
542
+ }
543
+ function q(e, t) {
544
+ return {
545
+ top: t.top / e.height,
546
+ left: t.left / e.width,
547
+ right: (e.width - t.right) / e.width,
548
+ bottom: (e.height - t.bottom) / e.height
549
+ };
550
+ }
551
+ function J(e, t) {
552
+ return t.top *= e.height, t.left *= e.width, t.right = e.width - t.right * e.width, t.bottom = e.height - t.bottom * e.height, t;
553
+ }
554
+ var Y = [
555
+ "top",
556
+ "left",
557
+ "right",
558
+ "bottom"
559
+ ];
560
+ function X(e, t, n, r) {
561
+ let i = q(t, n);
562
+ for (let t of Y) F(e, `${r}-${t}`, i[t] * 100 + "%");
563
+ }
564
+ function Z(e, t, n, r) {
565
+ let i = 1, a, o = { ...t };
566
+ for (let s = 0; s < r.length; s++) {
567
+ for (; ve(e, t, r[s]) || K(e, t) && _e(t, n);) G(t, r[s], 1);
568
+ if (K(e, t)) return t;
569
+ let c = ye(e, t);
570
+ i > c && (a = { ...t }, i = c), t = { ...o };
571
+ }
572
+ return a || o;
573
+ }
574
+ var Q = Symbol(0);
575
+ function be(e, t, n, r) {
576
+ let i = n.firstElementChild, a = Ce(t), o, s = [];
577
+ if (n[U] || (n[U] = xe(e, n)), o = J(e, { ...n[U] }), n[Q]) s = [
578
+ n[Q] === "top" ? "+y" : "-y",
579
+ "+x",
580
+ "-x"
581
+ ];
582
+ else if (t.snapToLines) {
583
+ let n;
584
+ switch (t.vertical) {
585
+ case "":
586
+ s = ["+y", "-y"], n = "height";
587
+ break;
588
+ case "rl":
589
+ s = ["+x", "-x"], n = "width";
590
+ break;
591
+ case "lr":
592
+ s = ["-x", "+x"], n = "width";
593
+ break;
594
+ }
595
+ let r = R(i), c = r * Math.round(a), l = e[n] + r, u = s[0];
596
+ Math.abs(c) > l && (c = c < 0 ? -1 : 1, c *= Math.ceil(l / r) * r), a < 0 && (c += t.vertical === "" ? e.height : e.width, s = s.reverse()), G(o, u, c);
597
+ } else {
598
+ let n = t.vertical === "", r = n ? "+y" : "+x", i = n ? o.height : o.width;
599
+ G(o, r, (n ? e.height : e.width) * a / 100), G(o, r, t.lineAlign === "center" ? i / 2 : t.lineAlign === "end" ? i : 0), s = n ? [
600
+ "-y",
601
+ "+y",
602
+ "-x",
603
+ "+x"
604
+ ] : [
605
+ "-x",
606
+ "+x",
607
+ "-y",
608
+ "+y"
609
+ ];
610
+ }
611
+ return o = Z(e, o, r, s), X(n, e, o, "cue"), o;
612
+ }
613
+ function xe(e, t) {
614
+ let n = W(t), r = Se(t);
615
+ if (t[Q] = !1, r.top && (n.top = r.top, n.bottom = r.top + n.height, t[Q] = "top"), r.bottom) {
616
+ let i = e.height - r.bottom;
617
+ n.top = i - n.height, n.bottom = i, t[Q] = "bottom";
618
+ }
619
+ return r.left && (n.left = r.left), r.right && (n.right = e.width - r.right), q(e, n);
620
+ }
621
+ function Se(e) {
622
+ let t = {};
623
+ for (let n of Y) t[n] = parseFloat(e.style.getPropertyValue(`--cue-${n}`));
624
+ return t;
625
+ }
626
+ function Ce(e) {
627
+ return e.line === "auto" ? e.snapToLines ? -1 : 100 : e.line;
628
+ }
629
+ function $(e) {
630
+ if (e.position === "auto") switch (e.align) {
631
+ case "start":
632
+ case "left": return 0;
633
+ case "right":
634
+ case "end": return 100;
635
+ default: return 50;
636
+ }
637
+ return e.position;
638
+ }
639
+ function we(e, t) {
640
+ if (e.positionAlign === "auto") switch (e.align) {
641
+ case "start": return t === "ltr" ? "line-left" : "line-right";
642
+ case "end": return t === "ltr" ? "line-right" : "line-left";
643
+ case "center": return "center";
644
+ default: return `line-${e.align}`;
645
+ }
646
+ return e.positionAlign;
647
+ }
648
+ var Te = [
649
+ "-y",
650
+ "+y",
651
+ "-x",
652
+ "+x"
653
+ ];
654
+ function Ee(e, t, n, r) {
655
+ let i = Array.from(n.querySelectorAll("[data-part=\"cue-display\"]")), a = 0, o = Math.max(0, i.length - t.lines);
656
+ for (let e = i.length - 1; e >= o; e--) a += i[e].offsetHeight;
657
+ F(n, "region-height", a + "px"), n[U] || (n[U] = q(e, W(n)));
658
+ let s = { ...n[U] };
659
+ return s = J(e, s), s.width = n.clientWidth, s.height = a, s.right = s.left + s.width, s.bottom = s.top + a, s = Z(e, s, r, Te), X(n, e, s, "region"), s;
660
+ }
661
+ var De = class {
662
+ overlay;
663
+ z;
664
+ A = 0;
665
+ C = "ltr";
666
+ B = [];
667
+ D = !1;
668
+ E;
669
+ j = /* @__PURE__ */ new Map();
670
+ l = /* @__PURE__ */ new Map();
671
+ get dir() {
672
+ return this.C;
673
+ }
674
+ set dir(e) {
675
+ this.C = e, I(this.overlay, "dir", e);
676
+ }
677
+ get currentTime() {
678
+ return this.A;
679
+ }
680
+ set currentTime(e) {
681
+ this.A = e, this.update();
682
+ }
683
+ constructor(e, t) {
684
+ this.overlay = e, this.dir = t?.dir ?? "ltr", e.setAttribute("translate", "yes"), e.setAttribute("aria-live", "off"), e.setAttribute("aria-atomic", "true"), L(e, "captions"), this.G(), this.E = new ResizeObserver(this.I.bind(this)), this.E.observe(e);
685
+ }
686
+ changeTrack({ regions: e, cues: t }) {
687
+ this.reset(), this.J(e);
688
+ for (let e of t) this.l.set(e, null);
689
+ this.update();
690
+ }
691
+ addCue(e) {
692
+ this.l.set(e, null), this.update();
693
+ }
694
+ removeCue(e) {
695
+ this.l.delete(e), this.update();
696
+ }
697
+ update(e = !1) {
698
+ this.H(e);
699
+ }
700
+ reset() {
701
+ this.l.clear(), this.j.clear(), this.B = [], this.overlay.textContent = "";
702
+ }
703
+ destroy() {
704
+ this.reset(), this.E.disconnect();
705
+ }
706
+ I() {
707
+ this.D = !0, this.K();
708
+ }
709
+ K = he(() => {
710
+ this.D = !1, this.G();
711
+ for (let e of this.j.values()) e[U] = null;
712
+ for (let e of this.l.values()) e && (e[U] = null);
713
+ this.H(!0);
714
+ }, 50);
715
+ G() {
716
+ this.z = W(this.overlay), F(this.overlay, "overlay-width", this.z.width + "px"), F(this.overlay, "overlay-height", this.z.height + "px");
717
+ }
718
+ H(e = !1) {
719
+ if (!this.l.size || this.D) return;
720
+ let t, n = [...this.l.keys()].filter((e) => this.A >= e.startTime && this.A <= e.endTime).sort((e, t) => e.startTime === t.startTime ? e.endTime - t.endTime : e.startTime - t.startTime), r = n.map((e) => e.region);
721
+ for (let i = 0; i < this.B.length; i++) {
722
+ if (t = this.B[i], n[i] === t) continue;
723
+ if (t.region && !r.includes(t.region)) {
724
+ let n = this.j.get(t.region.id);
725
+ n && (n.removeAttribute("data-active"), e = !0);
726
+ }
727
+ let a = this.l.get(t);
728
+ a && (a.remove(), e = !0);
729
+ }
730
+ for (let r = 0; r < n.length; r++) {
731
+ t = n[r];
732
+ let i = this.l.get(t);
733
+ i || this.l.set(t, i = this.L(t));
734
+ let a = this.F(t) && this.j.get(t.region.id);
735
+ a && !a.hasAttribute("data-active") && (requestAnimationFrame(() => I(a, "active")), e = !0), i.isConnected || ((a || this.overlay).append(i), e = !0);
736
+ }
737
+ if (e) {
738
+ let e = [], r = /* @__PURE__ */ new Set();
739
+ for (let i = n.length - 1; i >= 0; i--) {
740
+ if (t = n[i], r.has(t.region || t)) continue;
741
+ let a = this.F(t), o = a ? this.j.get(t.region.id) : this.l.get(t);
742
+ a ? e.push(Ee(this.z, t.region, o, e)) : e.push(be(this.z, t, o, e)), r.add(a ? t.region : t);
743
+ }
744
+ }
745
+ H(this.overlay, this.A), this.B = n;
746
+ }
747
+ J(e) {
748
+ if (e) for (let t of e) {
749
+ let e = this.M(t);
750
+ this.j.set(t.id, e), this.overlay.append(e);
751
+ }
752
+ }
753
+ M(e) {
754
+ let t = document.createElement("div");
755
+ return L(t, "region"), I(t, "id", e.id), I(t, "scroll", e.scroll), F(t, "region-width", e.width + "%"), F(t, "region-anchor-x", e.regionAnchorX), F(t, "region-anchor-y", e.regionAnchorY), F(t, "region-viewport-anchor-x", e.viewportAnchorX), F(t, "region-viewport-anchor-y", e.viewportAnchorY), F(t, "region-lines", e.lines), t;
756
+ }
757
+ L(e) {
758
+ let t = document.createElement("div"), n = $(e), r = we(e, this.C);
759
+ if (L(t, "cue-display"), e.vertical !== "" && I(t, "vertical"), F(t, "cue-text-align", e.align), e.style) for (let n of Object.keys(e.style)) t.style.setProperty(n, e.style[n]);
760
+ if (this.F(e)) F(t, "cue-offset", `${n - (r === "line-right" ? 100 : r === "center" ? 50 : 0)}%`);
761
+ else if (F(t, "cue-writing-mode", e.vertical === "" ? "horizontal-tb" : e.vertical === "lr" ? "vertical-lr" : "vertical-rl"), !e.style?.["--cue-width"]) {
762
+ let i = n;
763
+ r === "line-left" ? i = 100 - n : r === "center" && n <= 50 ? i = n * 2 : r === "center" && n > 50 && (i = (100 - n) * 2);
764
+ let a = e.size < i ? e.size : i;
765
+ e.vertical === "" ? F(t, "cue-width", a + "%") : F(t, "cue-height", a + "%");
766
+ }
767
+ let i = document.createElement("div");
768
+ return L(i, "cue"), e.id && I(i, "id", e.id), i.innerHTML = B(e), t.append(i), t;
769
+ }
770
+ F(e) {
771
+ return e.region && e.size === 100 && e.vertical === "" && e.line === "auto";
772
+ }
773
+ };
774
+ //#endregion
775
+ export { M as _, w as a, p as c, s as d, a as f, V as g, B as h, l as i, z as l, E as m, t as n, f as o, o as p, e as r, T as s, De as t, c as u, H as v };