@sapia-ai/chatbot-v3 1.0.0

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 (108) hide show
  1. package/dist/EmbeddedVideoPlayer-SaMMfDIW.js +1277 -0
  2. package/dist/EmbeddedVideoPlayer-SaMMfDIW.js.map +1 -0
  3. package/dist/Preview-Db-hgkTh.js +83 -0
  4. package/dist/Preview-Db-hgkTh.js.map +1 -0
  5. package/dist/api/client.d.ts +60 -0
  6. package/dist/api/config.d.ts +18 -0
  7. package/dist/api/constants.d.ts +5 -0
  8. package/dist/api/index.d.ts +5 -0
  9. package/dist/api/sse.d.ts +12 -0
  10. package/dist/api/types/branding.d.ts +17 -0
  11. package/dist/api/types/messages.d.ts +148 -0
  12. package/dist/api/types/responses.d.ts +106 -0
  13. package/dist/api.js +2 -0
  14. package/dist/classPrivateFieldSet2-DtQPURVD.js +32 -0
  15. package/dist/core/bubbles/convert.d.ts +18 -0
  16. package/dist/core/bubbles/types.d.ts +55 -0
  17. package/dist/core/constants.d.ts +14 -0
  18. package/dist/core/events.d.ts +44 -0
  19. package/dist/core/i18n/fallback.d.ts +2 -0
  20. package/dist/core/i18n/languages.d.ts +11 -0
  21. package/dist/core/i18n/translator.d.ts +13 -0
  22. package/dist/core/interview.d.ts +207 -0
  23. package/dist/core/media/mimeTypes.d.ts +10 -0
  24. package/dist/core/media/recorder.d.ts +61 -0
  25. package/dist/core/persistence.d.ts +4 -0
  26. package/dist/core/store.d.ts +49 -0
  27. package/dist/core/theme/branding.d.ts +6 -0
  28. package/dist/core/theme/cssVariables.d.ts +16 -0
  29. package/dist/core/theme/types.d.ts +11 -0
  30. package/dist/core/validation/phoneCountries.d.ts +21 -0
  31. package/dist/core/validation/pii.d.ts +30 -0
  32. package/dist/dash.all.min-DZ1yEcJk.js +27302 -0
  33. package/dist/dash.all.min-DZ1yEcJk.js.map +1 -0
  34. package/dist/defineProperty-DiFpLzd2.js +39 -0
  35. package/dist/dist-BSi28_cP.js +702 -0
  36. package/dist/dist-BSi28_cP.js.map +1 -0
  37. package/dist/dist-DGBYKC8c.js +14327 -0
  38. package/dist/dist-DGBYKC8c.js.map +1 -0
  39. package/dist/dist-FvHBWiRa.js +76 -0
  40. package/dist/dist-FvHBWiRa.js.map +1 -0
  41. package/dist/embed/compat.d.ts +82 -0
  42. package/dist/embed/constants.d.ts +2 -0
  43. package/dist/embed/createChatbot.d.ts +22 -0
  44. package/dist/fix-webm-duration-BW9Fbdzt.js +1057 -0
  45. package/dist/fix-webm-duration-BW9Fbdzt.js.map +1 -0
  46. package/dist/hls-mBncGwsE.js +18657 -0
  47. package/dist/hls-mBncGwsE.js.map +1 -0
  48. package/dist/index.d.ts +7 -0
  49. package/dist/index.js +4428 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/max-Btet1snX.js +12212 -0
  52. package/dist/max-Btet1snX.js.map +1 -0
  53. package/dist/messages-C4jqrtSG.js +187 -0
  54. package/dist/messages-C4jqrtSG.js.map +1 -0
  55. package/dist/react/AnswerInput.d.ts +21 -0
  56. package/dist/react/SapiaChatbot.d.ts +23 -0
  57. package/dist/react/bubbleViewModel.d.ts +50 -0
  58. package/dist/react/strings.d.ts +98 -0
  59. package/dist/react/useBeforeUnload.d.ts +5 -0
  60. package/dist/react/useVideoRecorder.d.ts +24 -0
  61. package/dist/react-BGJ7Szvq.js +216 -0
  62. package/dist/react-BGJ7Szvq.js.map +1 -0
  63. package/dist/react-BMxM8TWJ.js +192 -0
  64. package/dist/react-BMxM8TWJ.js.map +1 -0
  65. package/dist/react-BVzcquey.js +457 -0
  66. package/dist/react-BVzcquey.js.map +1 -0
  67. package/dist/react-BrCGR7Ca.js +2208 -0
  68. package/dist/react-BrCGR7Ca.js.map +1 -0
  69. package/dist/react-Bujo1aK5.js +334 -0
  70. package/dist/react-Bujo1aK5.js.map +1 -0
  71. package/dist/react-CRTg4gz8.js +367 -0
  72. package/dist/react-CRTg4gz8.js.map +1 -0
  73. package/dist/react-GXf8sbzf.js +311 -0
  74. package/dist/react-GXf8sbzf.js.map +1 -0
  75. package/dist/react-lp7yfM94.js +371 -0
  76. package/dist/react-lp7yfM94.js.map +1 -0
  77. package/dist/sapia-chatbot.css +3 -0
  78. package/dist/sapia.d.ts +4 -0
  79. package/dist/ui/chat/ChatBubble/ChatBubble.d.ts +47 -0
  80. package/dist/ui/chat/ChatLog/ChatLog.d.ts +33 -0
  81. package/dist/ui/chat/TypingIndicator/TypingIndicator.d.ts +17 -0
  82. package/dist/ui/chat/types.d.ts +71 -0
  83. package/dist/ui/constants.d.ts +2 -0
  84. package/dist/ui/inputs/DropdownInput/DropdownInput.d.ts +18 -0
  85. package/dist/ui/inputs/OptionList/OptionList.d.ts +18 -0
  86. package/dist/ui/inputs/PhoneAnswerInput/PhoneAnswerInput.d.ts +19 -0
  87. package/dist/ui/inputs/SliderInput/SliderInput.d.ts +19 -0
  88. package/dist/ui/inputs/TextAnswerInput/TextAnswerInput.d.ts +32 -0
  89. package/dist/ui/inputs/VideoRecorder/VideoRecorder.d.ts +54 -0
  90. package/dist/ui/media/EmbeddedVideo/EmbeddedVideo.d.ts +11 -0
  91. package/dist/ui/media/EmbeddedVideo/EmbeddedVideoPlayer.d.ts +16 -0
  92. package/dist/ui/media/EmbeddedVideo/VimeoPlayer.d.ts +20 -0
  93. package/dist/ui/media/UploadProgress/UploadProgress.d.ts +7 -0
  94. package/dist/ui/media/VideoPlayer/VideoPlayer.d.ts +13 -0
  95. package/dist/ui/primitives/Button/Button.d.ts +6 -0
  96. package/dist/ui/primitives/Dialog/Dialog.d.ts +16 -0
  97. package/dist/ui/richText.d.ts +6 -0
  98. package/dist/ui/shell/AccessVerificationForm/AccessVerificationForm.d.ts +21 -0
  99. package/dist/ui/shell/CopyLinkButton/CopyLinkButton.d.ts +11 -0
  100. package/dist/ui/shell/DoneScreen/DoneScreen.d.ts +15 -0
  101. package/dist/ui/shell/Header/Header.d.ts +13 -0
  102. package/dist/ui/shell/PreparingScreen/PreparingScreen.d.ts +9 -0
  103. package/dist/ui/shell/ProgressBar/ProgressBar.d.ts +9 -0
  104. package/dist/ui/shell/WelcomeScreen/WelcomeScreen.d.ts +22 -0
  105. package/dist/ui/shell/WidgetRoot/WidgetRoot.d.ts +12 -0
  106. package/dist-umd/sapia-chatbot.umd.js +3655 -0
  107. package/dist-umd/sapia-chatbot.umd.js.map +1 -0
  108. package/package.json +94 -0
@@ -0,0 +1,702 @@
1
+ import { a as e, i as t, n, r, t as i } from "./classPrivateFieldSet2-DtQPURVD.js";
2
+ import { t as a } from "./defineProperty-DiFpLzd2.js";
3
+ //#region ../../node_modules/.pnpm/custom-media-element@1.4.6/node_modules/custom-media-element/dist/custom-media-element.js
4
+ var o, s, c = /* @__PURE__ */ "abort.canplay.canplaythrough.durationchange.emptied.encrypted.ended.error.loadeddata.loadedmetadata.loadstart.pause.play.playing.progress.ratechange.seeked.seeking.stalled.suspend.timeupdate.volumechange.waiting.waitingforkey.resize.enterpictureinpicture.leavepictureinpicture.webkitbeginfullscreen.webkitendfullscreen.webkitpresentationmodechanged".split("."), l = [
5
+ "autopictureinpicture",
6
+ "disablepictureinpicture",
7
+ "disableremoteplayback",
8
+ "autoplay",
9
+ "controls",
10
+ "controlslist",
11
+ "crossorigin",
12
+ "loop",
13
+ "muted",
14
+ "playsinline",
15
+ "poster",
16
+ "preload",
17
+ "src"
18
+ ];
19
+ function ee(e) {
20
+ return `
21
+ <style>
22
+ :host {
23
+ display: inline-flex;
24
+ line-height: 0;
25
+ flex-direction: column;
26
+ justify-content: end;
27
+ }
28
+
29
+ audio {
30
+ width: 100%;
31
+ }
32
+ </style>
33
+ <slot name="media">
34
+ <audio${d(e)}></audio>
35
+ </slot>
36
+ <slot></slot>
37
+ `;
38
+ }
39
+ function te(e) {
40
+ return `
41
+ <style>
42
+ :host {
43
+ display: inline-block;
44
+ line-height: 0;
45
+ }
46
+
47
+ video {
48
+ max-width: 100%;
49
+ max-height: 100%;
50
+ min-width: 100%;
51
+ min-height: 100%;
52
+ object-fit: var(--media-object-fit, contain);
53
+ object-position: var(--media-object-position, 50% 50%);
54
+ }
55
+
56
+ video::-webkit-media-text-track-container {
57
+ transform: var(--media-webkit-text-track-transform);
58
+ transition: var(--media-webkit-text-track-transition);
59
+ }
60
+ </style>
61
+ <slot name="media">
62
+ <video${d(e)}></video>
63
+ </slot>
64
+ <slot></slot>
65
+ `;
66
+ }
67
+ function u(o, { tag: s, is: u }) {
68
+ var d, f, p, m, h, g, _, v, y, b;
69
+ let x = (d = globalThis.document) == null || (f = d.createElement) == null ? void 0 : f.call(d, s, { is: u }), S = x ? ne(x) : [];
70
+ return h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakSet(), p = class c extends o {
71
+ constructor(...n) {
72
+ super(...n), e(this, b), t(this, h, !1), t(this, g, null), t(this, _, /* @__PURE__ */ new Map()), t(this, v, void 0), t(this, y, void 0), a(this, "get", void 0), a(this, "set", void 0), a(this, "call", void 0);
73
+ }
74
+ static get observedAttributes() {
75
+ var e, t;
76
+ return r(p, c, C).call(c), [...(e = x == null || (t = x.constructor) == null ? void 0 : t.observedAttributes) == null ? [] : e, ...l];
77
+ }
78
+ get nativeEl() {
79
+ var e, t, i, a, o;
80
+ return r(b, this, w).call(this), (e = (t = (i = (a = n(g, this)) == null ? this.querySelector(":scope > [slot=media]") : a) == null ? this.querySelector(s) : i) == null ? (o = this.shadowRoot) == null ? void 0 : o.querySelector(s) : t) == null ? null : e;
81
+ }
82
+ set nativeEl(e) {
83
+ i(g, this, e);
84
+ }
85
+ get defaultMuted() {
86
+ return this.hasAttribute("muted");
87
+ }
88
+ set defaultMuted(e) {
89
+ this.toggleAttribute("muted", e);
90
+ }
91
+ get src() {
92
+ return this.getAttribute("src");
93
+ }
94
+ set src(e) {
95
+ this.setAttribute("src", `${e}`);
96
+ }
97
+ get preload() {
98
+ var e, t;
99
+ return (e = this.getAttribute("preload")) == null ? (t = this.nativeEl) == null ? void 0 : t.preload : e;
100
+ }
101
+ set preload(e) {
102
+ this.setAttribute("preload", `${e}`);
103
+ }
104
+ init() {
105
+ if (!this.shadowRoot) {
106
+ this.attachShadow({ mode: "open" });
107
+ let e = re(this.attributes);
108
+ u && (e.is = u), s && (e.part = s), this.shadowRoot.innerHTML = this.constructor.getTemplateHTML(e);
109
+ }
110
+ this.nativeEl.muted = this.hasAttribute("muted");
111
+ for (let e of S) r(b, this, k).call(this, e);
112
+ r(b, this, T).call(this);
113
+ }
114
+ handleEvent(e) {
115
+ e.target === this.nativeEl && this.dispatchEvent(new CustomEvent(e.type, { detail: e.detail }));
116
+ }
117
+ attributeChangedCallback(e, t, n) {
118
+ r(b, this, w).call(this), r(b, this, ie).call(this, e, t, n);
119
+ }
120
+ connectedCallback() {
121
+ r(b, this, w).call(this), n(y, this) || r(b, this, T).call(this);
122
+ }
123
+ disconnectedCallback() {
124
+ var e;
125
+ if ((e = n(v, this)) == null || e.disconnect(), i(v, this, void 0), n(y, this)) {
126
+ var t;
127
+ (t = this.shadowRoot) == null || t.removeEventListener("slotchange", n(y, this)), i(y, this, void 0);
128
+ }
129
+ for (let e of this.constructor.Events) {
130
+ var r;
131
+ (r = this.shadowRoot) == null || r.removeEventListener(e, this, !0);
132
+ }
133
+ n(_, this).forEach((e) => e.remove()), n(_, this).clear(), i(g, this, null);
134
+ }
135
+ }, a(p, "getTemplateHTML", s.endsWith("audio") ? ee : te), a(p, "shadowRootOptions", { mode: "open" }), a(p, "Events", c), m = { _: !1 }, p;
136
+ function C() {
137
+ if (r(p, this, m)._) return;
138
+ m._ = r(p, this, !0);
139
+ let e = new Set(this.observedAttributes);
140
+ e.delete("muted");
141
+ for (let t of S) if (!(t in this.prototype)) if (typeof x[t] == "function") this.prototype[t] = function(...e) {
142
+ return r(b, this, w).call(this), (() => {
143
+ var n;
144
+ if (this.call) return this.call(t, ...e);
145
+ let r = (n = this.nativeEl) == null ? void 0 : n[t];
146
+ return r == null ? void 0 : r.apply(this.nativeEl, e);
147
+ })();
148
+ };
149
+ else {
150
+ let n = { get() {
151
+ var n, i, a;
152
+ r(b, this, w).call(this);
153
+ let o = t.toLowerCase();
154
+ if (e.has(o)) {
155
+ let e = this.getAttribute(o);
156
+ return e === null ? !1 : e === "" ? !0 : e;
157
+ }
158
+ return (n = (i = this.get) == null ? void 0 : i.call(this, t)) == null ? (a = this.nativeEl) == null ? void 0 : a[t] : n;
159
+ } };
160
+ t !== t.toUpperCase() && (n.set = function(n) {
161
+ r(b, this, w).call(this);
162
+ let i = t.toLowerCase();
163
+ if (e.has(i)) {
164
+ n === !0 || n === !1 || n == null ? this.toggleAttribute(i, !!n) : this.setAttribute(i, n);
165
+ return;
166
+ }
167
+ if (this.set) {
168
+ this.set(t, n);
169
+ return;
170
+ }
171
+ this.nativeEl && (this.nativeEl[t] = n);
172
+ }), Object.defineProperty(this.prototype, t, n);
173
+ }
174
+ }
175
+ function w() {
176
+ n(h, this) || (i(h, this, !0), this.init());
177
+ }
178
+ function T() {
179
+ var e;
180
+ i(v, this, new MutationObserver(r(b, this, D).bind(this))), i(y, this, () => r(b, this, E).call(this)), (e = this.shadowRoot) == null || e.addEventListener("slotchange", n(y, this)), r(b, this, E).call(this);
181
+ for (let e of this.constructor.Events) {
182
+ var t;
183
+ (t = this.shadowRoot) == null || t.addEventListener(e, this, !0);
184
+ }
185
+ }
186
+ function E() {
187
+ var e;
188
+ let t = new Map(n(_, this)), i = (e = this.shadowRoot) == null ? void 0 : e.querySelector("slot:not([name])");
189
+ (i == null ? void 0 : i.assignedElements({ flatten: !0 }).filter((e) => ["track", "source"].includes(e.localName))).forEach((e) => {
190
+ var i;
191
+ t.delete(e);
192
+ let a = n(_, this).get(e);
193
+ if (!a) {
194
+ var o;
195
+ a = e.cloneNode(), n(_, this).set(e, a), (o = n(v, this)) == null || o.observe(e, { attributes: !0 });
196
+ }
197
+ (i = this.nativeEl) == null || i.append(a), r(b, this, O).call(this, a);
198
+ }), t.forEach((e, t) => {
199
+ e.remove(), n(_, this).delete(t);
200
+ });
201
+ }
202
+ function D(e) {
203
+ for (let i of e) if (i.type === "attributes") {
204
+ let { target: e, attributeName: a } = i, o = n(_, this).get(e);
205
+ if (o && a) {
206
+ var t;
207
+ o.setAttribute(a, (t = e.getAttribute(a)) == null ? "" : t), r(b, this, O).call(this, o);
208
+ }
209
+ }
210
+ }
211
+ function O(e) {
212
+ e && e.localName === "track" && e.default && (e.kind === "chapters" || e.kind === "metadata") && e.track.mode === "disabled" && (e.track.mode = "hidden");
213
+ }
214
+ function k(e) {
215
+ if (Object.prototype.hasOwnProperty.call(this, e)) {
216
+ let t = this[e];
217
+ delete this[e], this[e] = t;
218
+ }
219
+ }
220
+ function ie(e, t, n) {
221
+ var r;
222
+ if (!["id", "class"].includes(e) && !(!p.observedAttributes.includes(e) && this.constructor.observedAttributes.includes(e))) {
223
+ if (n === null) {
224
+ var i;
225
+ (i = this.nativeEl) == null || i.removeAttribute(e);
226
+ } else if (((r = this.nativeEl) == null ? void 0 : r.getAttribute(e)) !== n) {
227
+ var a;
228
+ (a = this.nativeEl) == null || a.setAttribute(e, n);
229
+ }
230
+ }
231
+ }
232
+ }
233
+ function ne(e) {
234
+ let t = [];
235
+ for (let n = Object.getPrototypeOf(e); n && n !== HTMLElement.prototype; n = Object.getPrototypeOf(n)) {
236
+ let e = Object.getOwnPropertyNames(n);
237
+ t.push(...e);
238
+ }
239
+ return t;
240
+ }
241
+ function d(e) {
242
+ let t = "";
243
+ for (let n in e) {
244
+ if (!l.includes(n)) continue;
245
+ let r = e[n];
246
+ r === "" ? t += ` ${n}` : t += ` ${n}="${r}"`;
247
+ }
248
+ return t;
249
+ }
250
+ function re(e) {
251
+ let t = {};
252
+ for (let n of e) t[n.name] = n.value;
253
+ return t;
254
+ }
255
+ var f = u((o = globalThis.HTMLElement) == null ? class {} : o, { tag: "video" });
256
+ u((s = globalThis.HTMLElement) == null ? class {} : s, { tag: "audio" });
257
+ //#endregion
258
+ //#region ../../node_modules/.pnpm/media-tracks@0.3.5/node_modules/media-tracks/dist/change-event.js
259
+ var p = class extends Event {
260
+ constructor(e, t) {
261
+ super(e), a(this, "track", void 0), this.track = t.track;
262
+ }
263
+ }, m = /* @__PURE__ */ new WeakMap();
264
+ function h(e) {
265
+ var t;
266
+ return (t = m.get(e)) == null ? g(e, {}) : t;
267
+ }
268
+ function g(e, t) {
269
+ let n = m.get(e);
270
+ return n || m.set(e, n = {}), Object.assign(n, t);
271
+ }
272
+ //#endregion
273
+ //#region ../../node_modules/.pnpm/media-tracks@0.3.5/node_modules/media-tracks/dist/video-track-list.js
274
+ var _;
275
+ function v(e, t) {
276
+ let n = e.videoTracks;
277
+ h(t).media = new WeakRef(e), h(t).renditionSet || (h(t).renditionSet = /* @__PURE__ */ new Set());
278
+ let r = h(n).trackSet;
279
+ r.add(t);
280
+ let i = r.size - 1;
281
+ i in T.prototype || Object.defineProperty(T.prototype, i, { get() {
282
+ return [...h(this).trackSet][i];
283
+ } }), queueMicrotask(() => {
284
+ n.dispatchEvent(new p("addtrack", { track: t }));
285
+ });
286
+ }
287
+ function y(e) {
288
+ var t;
289
+ let n = (t = h(e).media) == null || (t = t.deref()) == null ? void 0 : t.videoTracks;
290
+ n && (h(n).trackSet.delete(e), queueMicrotask(() => {
291
+ n.dispatchEvent(new p("removetrack", { track: e }));
292
+ }));
293
+ }
294
+ function b(e) {
295
+ var t, n;
296
+ let r = (t = (n = h(e).media) == null || (n = n.deref()) == null ? void 0 : n.videoTracks) == null ? [] : t, i = !1;
297
+ for (let t of r) t !== e && (t.selected = !1, i = !0);
298
+ if (i) {
299
+ if (h(r).changeRequested) return;
300
+ h(r).changeRequested = !0, queueMicrotask(() => {
301
+ delete h(r).changeRequested, r.dispatchEvent(new Event("change"));
302
+ });
303
+ }
304
+ }
305
+ var x = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakSet();
306
+ _ = Symbol.iterator;
307
+ var T = class extends EventTarget {
308
+ constructor() {
309
+ super(), e(this, w), t(this, x, void 0), t(this, S, void 0), t(this, C, void 0), h(this).trackSet = /* @__PURE__ */ new Set();
310
+ }
311
+ [_]() {
312
+ return E.call(r(w, this)).values();
313
+ }
314
+ get length() {
315
+ return E.call(r(w, this)).size;
316
+ }
317
+ getTrackById(e) {
318
+ var t;
319
+ return (t = [...E.call(r(w, this))].find((t) => t.id === e)) == null ? null : t;
320
+ }
321
+ get selectedIndex() {
322
+ return [...E.call(r(w, this))].findIndex((e) => e.selected);
323
+ }
324
+ get onaddtrack() {
325
+ return n(x, this);
326
+ }
327
+ set onaddtrack(e) {
328
+ n(x, this) && (this.removeEventListener("addtrack", n(x, this)), i(x, this, void 0)), typeof e == "function" && (i(x, this, e), this.addEventListener("addtrack", e));
329
+ }
330
+ get onremovetrack() {
331
+ return n(S, this);
332
+ }
333
+ set onremovetrack(e) {
334
+ n(S, this) && (this.removeEventListener("removetrack", n(S, this)), i(S, this, void 0)), typeof e == "function" && (i(S, this, e), this.addEventListener("removetrack", e));
335
+ }
336
+ get onchange() {
337
+ return n(C, this);
338
+ }
339
+ set onchange(e) {
340
+ n(C, this) && (this.removeEventListener("change", n(C, this)), i(C, this, void 0)), typeof e == "function" && (i(C, this, e), this.addEventListener("change", e));
341
+ }
342
+ };
343
+ function E() {
344
+ return h(this).trackSet;
345
+ }
346
+ //#endregion
347
+ //#region ../../node_modules/.pnpm/media-tracks@0.3.5/node_modules/media-tracks/dist/rendition-event.js
348
+ var D = class extends Event {
349
+ constructor(e, t) {
350
+ super(e), a(this, "rendition", void 0), this.rendition = t.rendition;
351
+ }
352
+ }, O;
353
+ function k(e, t) {
354
+ var n;
355
+ let r = (n = h(e).media) == null || (n = n.deref()) == null ? void 0 : n.videoRenditions;
356
+ h(t).media = h(e).media, h(t).track = e;
357
+ let i = h(e).renditionSet;
358
+ i.add(t);
359
+ let a = i.size - 1;
360
+ a in P.prototype || Object.defineProperty(P.prototype, a, { get() {
361
+ return A(this)[a];
362
+ } }), queueMicrotask(() => {
363
+ !r || !e.selected || r.dispatchEvent(new D("addrendition", { rendition: t }));
364
+ });
365
+ }
366
+ function ie(e) {
367
+ var t;
368
+ let n = (t = h(e).media) == null || (t = t.deref()) == null ? void 0 : t.videoRenditions, r = h(e).track;
369
+ h(r).renditionSet.delete(e), queueMicrotask(() => {
370
+ let t = h(e).track;
371
+ !n || !t.selected || n.dispatchEvent(new D("removerendition", { rendition: e }));
372
+ });
373
+ }
374
+ function ae(e) {
375
+ var t;
376
+ let n = (t = h(e).media) == null || (t = t.deref()) == null ? void 0 : t.videoRenditions;
377
+ !n || h(n).changeRequested || (h(n).changeRequested = !0, queueMicrotask(() => {
378
+ delete h(n).changeRequested, h(e).track.selected && n.dispatchEvent(new Event("change"));
379
+ }));
380
+ }
381
+ function A(e) {
382
+ var t;
383
+ let n = (t = h(e).media) == null ? void 0 : t.deref();
384
+ return n ? [...n.videoTracks].filter((e) => e.selected).flatMap((e) => [...h(e).renditionSet]) : [];
385
+ }
386
+ var j = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap();
387
+ O = Symbol.iterator;
388
+ var P = class extends EventTarget {
389
+ constructor(...e) {
390
+ super(...e), t(this, j, void 0), t(this, M, void 0), t(this, N, void 0);
391
+ }
392
+ [O]() {
393
+ return A(this).values();
394
+ }
395
+ get length() {
396
+ return A(this).length;
397
+ }
398
+ getRenditionById(e) {
399
+ var t;
400
+ return (t = A(this).find((t) => `${t.id}` == `${e}`)) == null ? null : t;
401
+ }
402
+ get selectedIndex() {
403
+ return A(this).findIndex((e) => e.selected);
404
+ }
405
+ set selectedIndex(e) {
406
+ for (let [t, n] of A(this).entries()) n.selected = t === e;
407
+ }
408
+ get onaddrendition() {
409
+ return n(j, this);
410
+ }
411
+ set onaddrendition(e) {
412
+ n(j, this) && (this.removeEventListener("addrendition", n(j, this)), i(j, this, void 0)), typeof e == "function" && (i(j, this, e), this.addEventListener("addrendition", e));
413
+ }
414
+ get onremoverendition() {
415
+ return n(M, this);
416
+ }
417
+ set onremoverendition(e) {
418
+ n(M, this) && (this.removeEventListener("removerendition", n(M, this)), i(M, this, void 0)), typeof e == "function" && (i(M, this, e), this.addEventListener("removerendition", e));
419
+ }
420
+ get onchange() {
421
+ return n(N, this);
422
+ }
423
+ set onchange(e) {
424
+ n(N, this) && (this.removeEventListener("change", n(N, this)), i(N, this, void 0)), typeof e == "function" && (i(N, this, e), this.addEventListener("change", e));
425
+ }
426
+ }, F = /* @__PURE__ */ new WeakMap(), oe = class {
427
+ constructor() {
428
+ a(this, "src", void 0), a(this, "id", void 0), a(this, "width", void 0), a(this, "height", void 0), a(this, "bitrate", void 0), a(this, "frameRate", void 0), a(this, "codec", void 0), t(this, F, !1);
429
+ }
430
+ get selected() {
431
+ return n(F, this);
432
+ }
433
+ set selected(e) {
434
+ n(F, this) !== e && (i(F, this, e), ae(this));
435
+ }
436
+ }, I = /* @__PURE__ */ new WeakMap(), se = class {
437
+ constructor() {
438
+ a(this, "id", void 0), a(this, "kind", void 0), a(this, "label", ""), a(this, "language", ""), a(this, "sourceBuffer", void 0), t(this, I, !1);
439
+ }
440
+ addRendition(e, t, n, r, i, a) {
441
+ let o = new oe();
442
+ return o.src = e, o.width = t, o.height = n, o.frameRate = a, o.bitrate = i, o.codec = r, k(this, o), o;
443
+ }
444
+ removeRendition(e) {
445
+ ie(e);
446
+ }
447
+ get selected() {
448
+ return n(I, this);
449
+ }
450
+ set selected(e) {
451
+ n(I, this) !== e && (i(I, this, e), e === !0 && b(this));
452
+ }
453
+ }, L;
454
+ function ce(e, t) {
455
+ var n;
456
+ let r = (n = h(e).media) == null || (n = n.deref()) == null ? void 0 : n.audioRenditions;
457
+ h(t).media = h(e).media, h(t).track = e;
458
+ let i = h(e).renditionSet;
459
+ i.add(t);
460
+ let a = i.size - 1;
461
+ a in H.prototype || Object.defineProperty(H.prototype, a, { get() {
462
+ return R(this)[a];
463
+ } }), queueMicrotask(() => {
464
+ !r || !e.enabled || r.dispatchEvent(new D("addrendition", { rendition: t }));
465
+ });
466
+ }
467
+ function le(e) {
468
+ var t;
469
+ let n = (t = h(e).media) == null || (t = t.deref()) == null ? void 0 : t.audioRenditions, r = h(e).track;
470
+ h(r).renditionSet.delete(e), queueMicrotask(() => {
471
+ let t = h(e).track;
472
+ !n || !t.enabled || n.dispatchEvent(new D("removerendition", { rendition: e }));
473
+ });
474
+ }
475
+ function ue(e) {
476
+ var t;
477
+ let n = (t = h(e).media) == null || (t = t.deref()) == null ? void 0 : t.audioRenditions;
478
+ !n || h(n).changeRequested || (h(n).changeRequested = !0, queueMicrotask(() => {
479
+ delete h(n).changeRequested, h(e).track.enabled && n.dispatchEvent(new Event("change"));
480
+ }));
481
+ }
482
+ function R(e) {
483
+ var t;
484
+ let n = (t = h(e).media) == null ? void 0 : t.deref();
485
+ return n ? [...n.audioTracks].filter((e) => e.enabled).flatMap((e) => [...h(e).renditionSet]) : [];
486
+ }
487
+ var z = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap();
488
+ L = Symbol.iterator;
489
+ var H = class extends EventTarget {
490
+ constructor(...e) {
491
+ super(...e), t(this, z, void 0), t(this, B, void 0), t(this, V, void 0);
492
+ }
493
+ [L]() {
494
+ return R(this).values();
495
+ }
496
+ get length() {
497
+ return R(this).length;
498
+ }
499
+ getRenditionById(e) {
500
+ var t;
501
+ return (t = R(this).find((t) => `${t.id}` == `${e}`)) == null ? null : t;
502
+ }
503
+ get selectedIndex() {
504
+ return R(this).findIndex((e) => e.selected);
505
+ }
506
+ set selectedIndex(e) {
507
+ for (let [t, n] of R(this).entries()) n.selected = t === e;
508
+ }
509
+ get onaddrendition() {
510
+ return n(z, this);
511
+ }
512
+ set onaddrendition(e) {
513
+ n(z, this) && (this.removeEventListener("addrendition", n(z, this)), i(z, this, void 0)), typeof e == "function" && (i(z, this, e), this.addEventListener("addrendition", e));
514
+ }
515
+ get onremoverendition() {
516
+ return n(B, this);
517
+ }
518
+ set onremoverendition(e) {
519
+ n(B, this) && (this.removeEventListener("removerendition", n(B, this)), i(B, this, void 0)), typeof e == "function" && (i(B, this, e), this.addEventListener("removerendition", e));
520
+ }
521
+ get onchange() {
522
+ return n(V, this);
523
+ }
524
+ set onchange(e) {
525
+ n(V, this) && (this.removeEventListener("change", n(V, this)), i(V, this, void 0)), typeof e == "function" && (i(V, this, e), this.addEventListener("change", e));
526
+ }
527
+ }, U = /* @__PURE__ */ new WeakMap(), de = class {
528
+ constructor() {
529
+ a(this, "src", void 0), a(this, "id", void 0), a(this, "bitrate", void 0), a(this, "codec", void 0), t(this, U, !1);
530
+ }
531
+ get selected() {
532
+ return n(U, this);
533
+ }
534
+ set selected(e) {
535
+ n(U, this) !== e && (i(U, this, e), ue(this));
536
+ }
537
+ }, fe;
538
+ function W(e, t) {
539
+ let n = e.audioTracks;
540
+ h(t).media = new WeakRef(e), h(t).renditionSet || (h(t).renditionSet = /* @__PURE__ */ new Set());
541
+ let r = h(n).trackSet;
542
+ r.add(t);
543
+ let i = r.size - 1;
544
+ i in X.prototype || Object.defineProperty(X.prototype, i, { get() {
545
+ return [...h(this).trackSet][i];
546
+ } }), queueMicrotask(() => {
547
+ n.dispatchEvent(new p("addtrack", { track: t }));
548
+ });
549
+ }
550
+ function G(e) {
551
+ var t;
552
+ let n = (t = h(e).media) == null || (t = t.deref()) == null ? void 0 : t.audioTracks;
553
+ n && (h(n).trackSet.delete(e), queueMicrotask(() => {
554
+ n.dispatchEvent(new p("removetrack", { track: e }));
555
+ }));
556
+ }
557
+ function pe(e) {
558
+ var t;
559
+ let n = (t = h(e).media) == null || (t = t.deref()) == null ? void 0 : t.audioTracks;
560
+ !n || h(n).changeRequested || (h(n).changeRequested = !0, queueMicrotask(() => {
561
+ delete h(n).changeRequested, n.dispatchEvent(new Event("change"));
562
+ }));
563
+ }
564
+ var K = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakSet();
565
+ fe = Symbol.iterator;
566
+ var X = class extends EventTarget {
567
+ constructor() {
568
+ super(), e(this, Y), t(this, K, void 0), t(this, q, void 0), t(this, J, void 0), h(this).trackSet = /* @__PURE__ */ new Set();
569
+ }
570
+ [fe]() {
571
+ return Z.call(r(Y, this)).values();
572
+ }
573
+ get length() {
574
+ return Z.call(r(Y, this)).size;
575
+ }
576
+ getTrackById(e) {
577
+ var t;
578
+ return (t = [...Z.call(r(Y, this))].find((t) => t.id === e)) == null ? null : t;
579
+ }
580
+ get onaddtrack() {
581
+ return n(K, this);
582
+ }
583
+ set onaddtrack(e) {
584
+ n(K, this) && (this.removeEventListener("addtrack", n(K, this)), i(K, this, void 0)), typeof e == "function" && (i(K, this, e), this.addEventListener("addtrack", e));
585
+ }
586
+ get onremovetrack() {
587
+ return n(q, this);
588
+ }
589
+ set onremovetrack(e) {
590
+ n(q, this) && (this.removeEventListener("removetrack", n(q, this)), i(q, this, void 0)), typeof e == "function" && (i(q, this, e), this.addEventListener("removetrack", e));
591
+ }
592
+ get onchange() {
593
+ return n(J, this);
594
+ }
595
+ set onchange(e) {
596
+ n(J, this) && (this.removeEventListener("change", n(J, this)), i(J, this, void 0)), typeof e == "function" && (i(J, this, e), this.addEventListener("change", e));
597
+ }
598
+ };
599
+ function Z() {
600
+ return h(this).trackSet;
601
+ }
602
+ //#endregion
603
+ //#region ../../node_modules/.pnpm/media-tracks@0.3.5/node_modules/media-tracks/dist/audio-track.js
604
+ var Q = /* @__PURE__ */ new WeakMap(), me = class {
605
+ constructor() {
606
+ a(this, "id", void 0), a(this, "kind", void 0), a(this, "label", ""), a(this, "language", ""), a(this, "sourceBuffer", void 0), t(this, Q, !1);
607
+ }
608
+ addRendition(e, t, n) {
609
+ let r = new de();
610
+ return r.src = e, r.codec = t, r.bitrate = n, ce(this, r), r;
611
+ }
612
+ removeRendition(e) {
613
+ le(e);
614
+ }
615
+ get enabled() {
616
+ return n(Q, this);
617
+ }
618
+ set enabled(e) {
619
+ n(Q, this) !== e && (i(Q, this, e), pe(this));
620
+ }
621
+ }, he = $(globalThis.HTMLMediaElement, "video"), ge = $(globalThis.HTMLMediaElement, "audio");
622
+ function _e(e) {
623
+ if (!(e != null && e.prototype)) return e;
624
+ let t = $(e, "video");
625
+ (!t || `${t}`.includes("[native code]")) && Object.defineProperty(e.prototype, "videoTracks", { get() {
626
+ return ve(this);
627
+ } });
628
+ let n = $(e, "audio");
629
+ (!n || `${n}`.includes("[native code]")) && Object.defineProperty(e.prototype, "audioTracks", { get() {
630
+ return ye(this);
631
+ } }), "addVideoTrack" in e.prototype || (e.prototype.addVideoTrack = function(e, t = "", n = "") {
632
+ let r = new se();
633
+ return r.kind = e, r.label = t, r.language = n, v(this, r), r;
634
+ }), "removeVideoTrack" in e.prototype || (e.prototype.removeVideoTrack = y), "addAudioTrack" in e.prototype || (e.prototype.addAudioTrack = function(e, t = "", n = "") {
635
+ let r = new me();
636
+ return r.kind = e, r.label = t, r.language = n, W(this, r), r;
637
+ }), "removeAudioTrack" in e.prototype || (e.prototype.removeAudioTrack = G), "videoRenditions" in e.prototype || Object.defineProperty(e.prototype, "videoRenditions", { get() {
638
+ return r(this);
639
+ } });
640
+ let r = (e) => {
641
+ let t = h(e).videoRenditions;
642
+ return t || (t = new P(), h(t).media = new WeakRef(e), h(e).videoRenditions = t), t;
643
+ };
644
+ "audioRenditions" in e.prototype || Object.defineProperty(e.prototype, "audioRenditions", { get() {
645
+ return i(this);
646
+ } });
647
+ let i = (e) => {
648
+ let t = h(e).audioRenditions;
649
+ return t || (t = new H(), h(t).media = new WeakRef(e), h(e).audioRenditions = t), t;
650
+ };
651
+ return e;
652
+ }
653
+ function $(e, t) {
654
+ if (e != null && e.prototype) {
655
+ var n;
656
+ return (n = Object.getOwnPropertyDescriptor(e.prototype, `${t}Tracks`)) == null ? void 0 : n.get;
657
+ }
658
+ }
659
+ function ve(e) {
660
+ let t = h(e).videoTracks;
661
+ if (!t && (t = new T(), h(e).videoTracks = t, he)) {
662
+ var n;
663
+ let r = he.call((n = e.nativeEl) == null ? e : n);
664
+ for (let t of r) v(e, t);
665
+ r.addEventListener("change", () => {
666
+ t.dispatchEvent(new Event("change"));
667
+ }), r.addEventListener("addtrack", (n) => {
668
+ if ([...t].some((e) => e instanceof se)) {
669
+ for (let e of r) y(e);
670
+ return;
671
+ }
672
+ v(e, n.track);
673
+ }), r.addEventListener("removetrack", (e) => {
674
+ y(e.track);
675
+ });
676
+ }
677
+ return t;
678
+ }
679
+ function ye(e) {
680
+ let t = h(e).audioTracks;
681
+ if (!t && (t = new X(), h(e).audioTracks = t, ge)) {
682
+ var n;
683
+ let r = ge.call((n = e.nativeEl) == null ? e : n);
684
+ for (let t of r) W(e, t);
685
+ r.addEventListener("change", () => {
686
+ t.dispatchEvent(new Event("change"));
687
+ }), r.addEventListener("addtrack", (n) => {
688
+ if ([...t].some((e) => e instanceof me)) {
689
+ for (let e of r) G(e);
690
+ return;
691
+ }
692
+ W(e, n.track);
693
+ }), r.addEventListener("removetrack", (e) => {
694
+ G(e.track);
695
+ });
696
+ }
697
+ return t;
698
+ }
699
+ //#endregion
700
+ export { f as n, _e as t };
701
+
702
+ //# sourceMappingURL=dist-BSi28_cP.js.map