@sapia-ai/chatbot-v3 1.0.0 → 1.0.1

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 (43) hide show
  1. package/dist/{EmbeddedVideoPlayer-SaMMfDIW.js → EmbeddedVideoPlayer-CNcds-dW.js} +283 -282
  2. package/dist/Preview-Dmns6UWL.js +84 -0
  3. package/dist/api.js +1 -1
  4. package/dist/{dist-DGBYKC8c.js → dist-B9SbMqZU.js} +2693 -2693
  5. package/dist/embed/createChatbot.d.ts +2 -0
  6. package/dist/{fix-webm-duration-BW9Fbdzt.js → fix-webm-duration-BWL-ZRDX.js} +2 -2
  7. package/dist/index.d.ts +0 -1
  8. package/dist/index.js +15479 -2067
  9. package/dist/jsx-runtime-8QqjHL5t.js +24 -0
  10. package/dist/messages-Czlp86gl.js +1963 -0
  11. package/dist/react-B0K-sClg.js +295 -0
  12. package/dist/{react-Bujo1aK5.js → react-ChCcxVnw.js} +90 -89
  13. package/dist/{react-GXf8sbzf.js → react-DJysvNxz.js} +72 -71
  14. package/dist/{react-BVzcquey.js → react-Dbs-sPBo.js} +93 -92
  15. package/dist/{react-lp7yfM94.js → react-NauLB_WU.js} +91 -90
  16. package/dist/{react-BGJ7Szvq.js → react-QrtEtv1G.js} +76 -74
  17. package/dist/{react-BrCGR7Ca.js → react-be7q6yw_.js} +312 -310
  18. package/dist/{react-CRTg4gz8.js → react-czRIxT0g.js} +85 -84
  19. package/dist/{react-BMxM8TWJ.js → react-dE7BdGuR.js} +49 -48
  20. package/package.json +14 -25
  21. package/dist/EmbeddedVideoPlayer-SaMMfDIW.js.map +0 -1
  22. package/dist/Preview-Db-hgkTh.js +0 -83
  23. package/dist/Preview-Db-hgkTh.js.map +0 -1
  24. package/dist/dash.all.min-DZ1yEcJk.js.map +0 -1
  25. package/dist/dist-BSi28_cP.js.map +0 -1
  26. package/dist/dist-DGBYKC8c.js.map +0 -1
  27. package/dist/dist-FvHBWiRa.js.map +0 -1
  28. package/dist/fix-webm-duration-BW9Fbdzt.js.map +0 -1
  29. package/dist/hls-mBncGwsE.js.map +0 -1
  30. package/dist/index.js.map +0 -1
  31. package/dist/max-Btet1snX.js.map +0 -1
  32. package/dist/messages-C4jqrtSG.js +0 -187
  33. package/dist/messages-C4jqrtSG.js.map +0 -1
  34. package/dist/react-BGJ7Szvq.js.map +0 -1
  35. package/dist/react-BMxM8TWJ.js.map +0 -1
  36. package/dist/react-BVzcquey.js.map +0 -1
  37. package/dist/react-BrCGR7Ca.js.map +0 -1
  38. package/dist/react-Bujo1aK5.js.map +0 -1
  39. package/dist/react-CRTg4gz8.js.map +0 -1
  40. package/dist/react-GXf8sbzf.js.map +0 -1
  41. package/dist/react-lp7yfM94.js.map +0 -1
  42. package/dist/sapia-chatbot.css +0 -3
  43. package/dist-umd/sapia-chatbot.umd.js.map +0 -1
@@ -1,125 +1,126 @@
1
- import { t as e } from "./defineProperty-DiFpLzd2.js";
2
- import t, { Suspense as n, lazy as r, useCallback as i, useEffect as a, useRef as o, useState as s } from "react";
3
- import { jsx as c } from "react/jsx-runtime";
1
+ import { b as e } from "./messages-Czlp86gl.js";
2
+ import { t } from "./react-B0K-sClg.js";
3
+ import { t as n } from "./jsx-runtime-8QqjHL5t.js";
4
+ import { t as r } from "./defineProperty-DiFpLzd2.js";
4
5
  //#region ../../node_modules/.pnpm/react-player@3.4.0_@svta+cml-cta@1.0.6_@svta+cml-structured-field-values@1.1.3_@svta+cm_a4f64f295cc2a316f39ce360b0a6e480/node_modules/react-player/dist/patterns.js
5
- var l = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i, u = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i, d = /\.(m3u8)($|\?)/i, f = /\.(mpd)($|\?)/i, p = /stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/, m = /(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//, h = /vimeo\.com\/(?!progressive_redirect).+/, g = /(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/, _ = /open\.spotify\.com\/(\w+)\/(\w+)/i, v = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+|(videos?\/|\?video=)\d+)($|\?)/, y = /tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/, b = (e, t) => {
6
+ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i, o = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i, s = /\.(m3u8)($|\?)/i, c = /\.(mpd)($|\?)/i, l = /stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/, u = /(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//, d = /vimeo\.com\/(?!progressive_redirect).+/, f = /(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/, p = /open\.spotify\.com\/(\w+)\/(\w+)/i, m = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+|(videos?\/|\?video=)\d+)($|\?)/, h = /tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/, g = (e, t) => {
6
7
  if (Array.isArray(e)) {
7
- for (let n of e) if (typeof n == "string" && b(n, t) || b(n.src, t)) return !0;
8
+ for (let n of e) if (typeof n == "string" && g(n, t) || g(n.src, t)) return !0;
8
9
  return !1;
9
10
  }
10
11
  return t(e);
11
- }, x = {
12
- html: (e) => b(e, (e) => l.test(e) || u.test(e)),
13
- hls: (e) => b(e, (e) => d.test(e)),
14
- dash: (e) => b(e, (e) => f.test(e)),
15
- mux: (e) => p.test(e),
16
- youtube: (e) => m.test(e),
17
- vimeo: (e) => h.test(e) && !u.test(e) && !d.test(e),
18
- wistia: (e) => g.test(e),
19
- spotify: (e) => _.test(e),
20
- twitch: (e) => v.test(e),
21
- tiktok: (e) => y.test(e)
22
- }, S = t.forwardRef((e, n) => {
23
- let r = l.test(`${e.src}`) ? "audio" : "video";
24
- return /* @__PURE__ */ t.createElement(r, {
12
+ }, _ = {
13
+ html: (e) => g(e, (e) => a.test(e) || o.test(e)),
14
+ hls: (e) => g(e, (e) => s.test(e)),
15
+ dash: (e) => g(e, (e) => c.test(e)),
16
+ mux: (e) => l.test(e),
17
+ youtube: (e) => u.test(e),
18
+ vimeo: (e) => d.test(e) && !o.test(e) && !s.test(e),
19
+ wistia: (e) => f.test(e),
20
+ spotify: (e) => p.test(e),
21
+ twitch: (e) => m.test(e),
22
+ tiktok: (e) => h.test(e)
23
+ }, v = i.forwardRef((e, t) => {
24
+ let n = a.test(`${e.src}`) ? "audio" : "video";
25
+ return /* @__PURE__ */ i.createElement(n, {
25
26
  ...e,
26
- ref: n
27
+ ref: t
27
28
  }, e.children);
28
- }), C = [
29
+ }), y = [
29
30
  {
30
31
  key: "hls",
31
32
  name: "hls.js",
32
- canPlay: x.hls,
33
+ canPlay: _.hls,
33
34
  canEnablePIP: () => !0,
34
- player: r(() => import(
35
+ player: (0, i.lazy)(() => import(
35
36
  /* webpackChunkName: 'reactPlayerHls' */
36
- "./react-BGJ7Szvq.js"
37
+ "./react-QrtEtv1G.js"
37
38
  ))
38
39
  },
39
40
  {
40
41
  key: "dash",
41
42
  name: "dash.js",
42
- canPlay: x.dash,
43
+ canPlay: _.dash,
43
44
  canEnablePIP: () => !0,
44
- player: r(() => import(
45
+ player: (0, i.lazy)(() => import(
45
46
  /* webpackChunkName: 'reactPlayerDash' */
46
- "./react-BMxM8TWJ.js"
47
+ "./react-dE7BdGuR.js"
47
48
  ))
48
49
  },
49
50
  {
50
51
  key: "mux",
51
52
  name: "Mux",
52
- canPlay: x.mux,
53
+ canPlay: _.mux,
53
54
  canEnablePIP: () => !0,
54
- player: r(() => import(
55
+ player: (0, i.lazy)(() => import(
55
56
  /* webpackChunkName: 'reactPlayerMux' */
56
- "./dist-DGBYKC8c.js"
57
+ "./dist-B9SbMqZU.js"
57
58
  ))
58
59
  },
59
60
  {
60
61
  key: "youtube",
61
62
  name: "YouTube",
62
- canPlay: x.youtube,
63
- player: r(() => import(
63
+ canPlay: _.youtube,
64
+ player: (0, i.lazy)(() => import(
64
65
  /* webpackChunkName: 'reactPlayerYouTube' */
65
- "./react-BVzcquey.js"
66
+ "./react-Dbs-sPBo.js"
66
67
  ))
67
68
  },
68
69
  {
69
70
  key: "vimeo",
70
71
  name: "Vimeo",
71
- canPlay: x.vimeo,
72
- player: r(() => import(
72
+ canPlay: _.vimeo,
73
+ player: (0, i.lazy)(() => import(
73
74
  /* webpackChunkName: 'reactPlayerVimeo' */
74
- "./react-BrCGR7Ca.js"
75
+ "./react-be7q6yw_.js"
75
76
  ))
76
77
  },
77
78
  {
78
79
  key: "wistia",
79
80
  name: "Wistia",
80
- canPlay: x.wistia,
81
+ canPlay: _.wistia,
81
82
  canEnablePIP: () => !0,
82
- player: r(() => import(
83
+ player: (0, i.lazy)(() => import(
83
84
  /* webpackChunkName: 'reactPlayerWistia' */
84
- "./react-lp7yfM94.js"
85
+ "./react-NauLB_WU.js"
85
86
  ))
86
87
  },
87
88
  {
88
89
  key: "spotify",
89
90
  name: "Spotify",
90
- canPlay: x.spotify,
91
+ canPlay: _.spotify,
91
92
  canEnablePIP: () => !1,
92
- player: r(() => import(
93
+ player: (0, i.lazy)(() => import(
93
94
  /* webpackChunkName: 'reactPlayerSpotify' */
94
- "./react-GXf8sbzf.js"
95
+ "./react-DJysvNxz.js"
95
96
  ))
96
97
  },
97
98
  {
98
99
  key: "twitch",
99
100
  name: "Twitch",
100
- canPlay: x.twitch,
101
+ canPlay: _.twitch,
101
102
  canEnablePIP: () => !1,
102
- player: r(() => import(
103
+ player: (0, i.lazy)(() => import(
103
104
  /* webpackChunkName: 'reactPlayerTwitch' */
104
- "./react-CRTg4gz8.js"
105
+ "./react-czRIxT0g.js"
105
106
  ))
106
107
  },
107
108
  {
108
109
  key: "tiktok",
109
110
  name: "TikTok",
110
- canPlay: x.tiktok,
111
+ canPlay: _.tiktok,
111
112
  canEnablePIP: () => !1,
112
- player: r(() => import(
113
+ player: (0, i.lazy)(() => import(
113
114
  /* webpackChunkName: 'reactPlayerTiktok' */
114
- "./react-Bujo1aK5.js"
115
+ "./react-ChCcxVnw.js"
115
116
  ))
116
117
  },
117
118
  {
118
119
  key: "html",
119
120
  name: "html",
120
- canPlay: x.html,
121
+ canPlay: _.html,
121
122
  canEnablePIP: () => !0,
122
- player: S
123
+ player: v
123
124
  }
124
125
  ], ee = {
125
126
  width: "320px",
@@ -129,40 +130,40 @@ var l = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i
129
130
  previewTabIndex: 0,
130
131
  previewAriaLabel: "",
131
132
  oEmbedUrl: "https://noembed.com/embed?url={url}"
132
- }, w = t.forwardRef((e, n) => {
133
- let { playing: r, pip: s } = e, c = e.activePlayer, l = o(null), u = o(!0);
134
- a(() => {
135
- var t, n;
136
- l.current && (l.current.paused && r === !0 && l.current.play(), !l.current.paused && r === !1 && l.current.pause(), l.current.playbackRate = (t = e.playbackRate) == null ? 1 : t, l.current.volume = (n = e.volume) == null ? 1 : n);
137
- }), a(() => {
138
- var e, t, n, r, i;
139
- if (!(!l.current || !globalThis.document)) {
140
- if (s && !document.pictureInPictureElement) try {
141
- (t = (e = l.current).requestPictureInPicture) == null || t.call(e);
133
+ }, b = i.forwardRef((e, t) => {
134
+ let { playing: n, pip: r } = e, a = e.activePlayer, o = (0, i.useRef)(null), s = (0, i.useRef)(!0);
135
+ (0, i.useEffect)(() => {
136
+ var t, r;
137
+ o.current && (o.current.paused && n === !0 && o.current.play(), !o.current.paused && n === !1 && o.current.pause(), o.current.playbackRate = (t = e.playbackRate) == null ? 1 : t, o.current.volume = (r = e.volume) == null ? 1 : r);
138
+ }), (0, i.useEffect)(() => {
139
+ var e, t, n, i, a;
140
+ if (!(!o.current || !globalThis.document)) {
141
+ if (r && !document.pictureInPictureElement) try {
142
+ (t = (e = o.current).requestPictureInPicture) == null || t.call(e);
142
143
  } catch {}
143
- if (!s && document.pictureInPictureElement) try {
144
- (r = (n = l.current).exitPictureInPicture) == null || r.call(n), (i = document.exitPictureInPicture) == null || i.call(document);
144
+ if (!r && document.pictureInPictureElement) try {
145
+ (i = (n = o.current).exitPictureInPicture) == null || i.call(n), (a = document.exitPictureInPicture) == null || a.call(document);
145
146
  } catch {}
146
147
  }
147
- }, [s]);
148
- let d = (t) => {
148
+ }, [r]);
149
+ let c = (t) => {
149
150
  var n, r;
150
- u.current = !0, (n = e.onReady) == null || n.call(e), (r = e.onLoadStart) == null || r.call(e, t);
151
- }, f = (t) => {
151
+ s.current = !0, (n = e.onReady) == null || n.call(e), (r = e.onLoadStart) == null || r.call(e, t);
152
+ }, l = (t) => {
152
153
  var n, r;
153
- u.current && (u.current = !1, (n = e.onStart) == null || n.call(e, t)), (r = e.onPlay) == null || r.call(e, t);
154
+ s.current && (s.current = !1, (n = e.onStart) == null || n.call(e, t)), (r = e.onPlay) == null || r.call(e, t);
154
155
  };
155
- if (!c) return null;
156
- let p = {}, m = ["onReady", "onStart"];
157
- for (let t in e) t.startsWith("on") && !m.includes(t) && (p[t] = e[t]);
158
- return /* @__PURE__ */ t.createElement(c, {
159
- ...p,
156
+ if (!a) return null;
157
+ let u = {}, d = ["onReady", "onStart"];
158
+ for (let t in e) t.startsWith("on") && !d.includes(t) && (u[t] = e[t]);
159
+ return /* @__PURE__ */ i.createElement(a, {
160
+ ...u,
160
161
  style: e.style,
161
162
  className: e.className,
162
163
  slot: e.slot,
163
- ref: i((e) => {
164
- l.current = e, typeof n == "function" ? n(e) : n !== null && (n.current = e);
165
- }, [n]),
164
+ ref: (0, i.useCallback)((e) => {
165
+ o.current = e, typeof t == "function" ? t(e) : t !== null && (t.current = e);
166
+ }, [t]),
166
167
  src: e.src,
167
168
  crossOrigin: e.crossOrigin,
168
169
  preload: e.preload,
@@ -173,52 +174,52 @@ var l = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i
173
174
  playsInline: e.playsInline,
174
175
  disableRemotePlayback: e.disableRemotePlayback,
175
176
  config: e.config,
176
- onLoadStart: d,
177
- onPlay: f
177
+ onLoadStart: c,
178
+ onPlay: l
178
179
  }, e.children);
179
180
  });
180
- w.displayName = "Player";
181
- var T = w, te = r(() => import(
181
+ b.displayName = "Player";
182
+ var te = b, ne = (0, i.lazy)(() => import(
182
183
  /* webpackChunkName: 'reactPlayerPreview' */
183
- "./Preview-Db-hgkTh.js"
184
- )), E = [], ne = (e, r) => {
185
- let i = (t) => {
186
- for (let n of [...E, ...e]) if (t && n.canPlay(t)) return n;
187
- return r || null;
188
- }, o = t.forwardRef((e, r) => {
189
- let o = {
184
+ "./Preview-Dmns6UWL.js"
185
+ )), x = [], S = (e, t) => {
186
+ let n = (n) => {
187
+ for (let t of [...x, ...e]) if (n && t.canPlay(n)) return t;
188
+ return t || null;
189
+ }, r = i.forwardRef((e, t) => {
190
+ let r = {
190
191
  ...ee,
191
192
  ...e
192
- }, { src: c, slot: l, className: u, style: d, width: f, height: p, fallback: m, wrapper: h } = o, [g, _] = s(!!o.light);
193
- a(() => {
194
- o.light ? _(!0) : _(!1);
195
- }, [o.light]);
196
- let v = (e) => {
193
+ }, { src: a, slot: o, className: s, style: c, width: l, height: u, fallback: d, wrapper: f } = r, [p, m] = (0, i.useState)(!!r.light);
194
+ (0, i.useEffect)(() => {
195
+ r.light ? m(!0) : m(!1);
196
+ }, [r.light]);
197
+ let h = (e) => {
197
198
  var t;
198
- _(!1), (t = o.onClickPreview) == null || t.call(o, e);
199
- }, y = (e) => {
199
+ m(!1), (t = r.onClickPreview) == null || t.call(r, e);
200
+ }, g = (e) => {
200
201
  if (!e) return null;
201
- let { light: n, playIcon: r, previewTabIndex: i, oEmbedUrl: a, previewAriaLabel: s } = o;
202
- return /* @__PURE__ */ t.createElement(te, {
202
+ let { light: t, playIcon: n, previewTabIndex: a, oEmbedUrl: o, previewAriaLabel: s } = r;
203
+ return /* @__PURE__ */ i.createElement(ne, {
203
204
  src: e,
204
- light: n,
205
- playIcon: r,
206
- previewTabIndex: i,
205
+ light: t,
206
+ playIcon: n,
207
+ previewTabIndex: a,
207
208
  previewAriaLabel: s,
208
- oEmbedUrl: a,
209
- onClickPreview: v
209
+ oEmbedUrl: o,
210
+ onClickPreview: h
210
211
  });
211
- }, b = (e) => {
212
- var n, a;
213
- let s = i(e);
214
- if (!s) return null;
215
- let { style: c, width: d, height: f, wrapper: p } = o, m = (n = o.config) == null ? void 0 : n[s.key];
216
- return /* @__PURE__ */ t.createElement(T, {
217
- ...o,
218
- ref: r,
219
- activePlayer: (a = s.player) == null ? s : a,
220
- slot: p ? void 0 : l,
221
- className: p ? void 0 : u,
212
+ }, _ = (e) => {
213
+ var a, c;
214
+ let l = n(e);
215
+ if (!l) return null;
216
+ let { style: u, width: d, height: f, wrapper: p } = r, m = (a = r.config) == null ? void 0 : a[l.key];
217
+ return /* @__PURE__ */ i.createElement(te, {
218
+ ...r,
219
+ ref: t,
220
+ activePlayer: (c = l.player) == null ? l : c,
221
+ slot: p ? void 0 : o,
222
+ className: p ? void 0 : s,
222
223
  style: p ? {
223
224
  display: "block",
224
225
  width: "100%",
@@ -227,54 +228,54 @@ var T = w, te = r(() => import(
227
228
  display: "block",
228
229
  width: d,
229
230
  height: f,
230
- ...c
231
+ ...u
231
232
  },
232
233
  config: m
233
234
  });
234
- }, x = h == null ? D : h, S = m === !1 ? D : n;
235
- return /* @__PURE__ */ t.createElement(x, {
236
- slot: l,
237
- className: u,
235
+ }, v = f == null ? C : f, y = d === !1 ? C : i.Suspense;
236
+ return /* @__PURE__ */ i.createElement(v, {
237
+ slot: o,
238
+ className: s,
238
239
  style: {
239
- width: f,
240
- height: p,
241
- ...d
240
+ width: l,
241
+ height: u,
242
+ ...c
242
243
  }
243
- }, /* @__PURE__ */ t.createElement(S, { fallback: m }, g ? y(c) : b(c)));
244
+ }, /* @__PURE__ */ i.createElement(y, { fallback: d }, p ? g(a) : _(a)));
244
245
  });
245
- return o.displayName = "ReactPlayer", o.addCustomPlayer = (e) => {
246
- E.push(e);
247
- }, o.removeCustomPlayers = () => {
248
- E.length = 0;
249
- }, o.canPlay = (t) => {
246
+ return r.displayName = "ReactPlayer", r.addCustomPlayer = (e) => {
247
+ x.push(e);
248
+ }, r.removeCustomPlayers = () => {
249
+ x.length = 0;
250
+ }, r.canPlay = (t) => {
250
251
  if (t) {
251
- for (let n of [...E, ...e]) if (n.canPlay(t)) return !0;
252
+ for (let n of [...x, ...e]) if (n.canPlay(t)) return !0;
252
253
  }
253
254
  return !1;
254
- }, o.canEnablePIP = (t) => {
255
+ }, r.canEnablePIP = (t) => {
255
256
  var n;
256
257
  if (t) {
257
- for (let r of [...E, ...e]) if (r.canPlay(t) && (n = r.canEnablePIP) != null && n.call(r)) return !0;
258
+ for (let r of [...x, ...e]) if (r.canPlay(t) && (n = r.canEnablePIP) != null && n.call(r)) return !0;
258
259
  }
259
260
  return !1;
260
- }, o;
261
- }, D = ({ children: e }) => e, re = C[C.length - 1], ie = ne(C, re), O, ae = typeof global < "u" && {}.toString.call(global) === "[object global]", oe = typeof Bun < "u", k = typeof Deno < "u", A = typeof WebSocketPair == "function" && ((O = caches) == null ? void 0 : O.default) !== void 0, j = ae || oe || k || A;
262
- function M(e, t) {
261
+ }, r;
262
+ }, C = ({ children: e }) => e, w = y[y.length - 1], re = S(y, w), T, E = typeof global < "u" && {}.toString.call(global) === "[object global]", ie = typeof Bun < "u", ae = typeof Deno < "u", D = typeof WebSocketPair == "function" && ((T = caches) == null ? void 0 : T.default) !== void 0, O = E || ie || ae || D;
263
+ function k(e, t) {
263
264
  return e.indexOf(t.toLowerCase()) === 0 ? e : `${t.toLowerCase()}${e.substr(0, 1).toUpperCase()}${e.substr(1)}`;
264
265
  }
265
- function se(e) {
266
+ function oe(e) {
266
267
  return !!(e && e.nodeType === 1 && "nodeName" in e && e.ownerDocument && e.ownerDocument.defaultView);
267
268
  }
268
- function ce(e) {
269
+ function se(e) {
269
270
  return !isNaN(parseFloat(e)) && isFinite(e) && Math.floor(e) == e;
270
271
  }
271
- function N(e) {
272
+ function A(e) {
272
273
  return /^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(e);
273
274
  }
274
- function P(e) {
275
+ function j(e) {
275
276
  return /^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/.test(e);
276
277
  }
277
- function le(e) {
278
+ function M(e) {
278
279
  let t = (e || "").match(/^(?:https?:)?(?:\/\/)?([^/?]+)/), n = (t && t[1] || "").replace("player.", "");
279
280
  for (let e of [
280
281
  ".videoji.hk",
@@ -283,30 +284,30 @@ function le(e) {
283
284
  ]) if (n.endsWith(e)) return n;
284
285
  return "vimeo.com";
285
286
  }
286
- function F() {
287
+ function N() {
287
288
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.id, n = e.url, r = t || n;
288
289
  if (!r) throw Error("An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.");
289
- if (ce(r)) return `https://vimeo.com/${r}`;
290
- if (N(r)) return r.replace("http:", "https:");
290
+ if (se(r)) return `https://vimeo.com/${r}`;
291
+ if (A(r)) return r.replace("http:", "https:");
291
292
  throw TypeError(t ? `“${t}” is not a valid video id.` : `“${r}” is not a vimeo.com url.`);
292
293
  }
293
- var I = function(e, t, n) {
294
+ var P = function(e, t, n) {
294
295
  let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "addEventListener", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "removeEventListener", a = typeof t == "string" ? [t] : t;
295
296
  return a.forEach((t) => {
296
297
  e[r](t, n);
297
298
  }), { cancel: () => a.forEach((t) => e[i](t, n)) };
298
299
  };
299
- function L(e) {
300
+ function F(e) {
300
301
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : document;
301
302
  if (!e || !t || typeof t.querySelectorAll != "function") return null;
302
303
  let n = t.querySelectorAll("iframe");
303
304
  for (let t = 0; t < n.length; t++) if (n[t] && n[t].contentWindow === e) return n[t];
304
305
  return null;
305
306
  }
306
- var ue = Array.prototype.indexOf !== void 0, de = typeof window < "u" && window.postMessage !== void 0;
307
- if (!j && (!ue || !de)) throw Error("Sorry, the Vimeo Player API is not available in this browser.");
308
- var R = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
309
- function fe(e, t) {
307
+ var ce = Array.prototype.indexOf !== void 0, le = typeof window < "u" && window.postMessage !== void 0;
308
+ if (!O && (!ce || !le)) throw Error("Sorry, the Vimeo Player API is not available in this browser.");
309
+ var I = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
310
+ function ue(e, t) {
310
311
  return t = { exports: {} }, e(t, t.exports), t.exports;
311
312
  }
312
313
  (function(e) {
@@ -359,11 +360,11 @@ function fe(e, t) {
359
360
  function i(e) {
360
361
  return Object(e) === e;
361
362
  }
362
- })(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : R);
363
- var z = fe(function(e) {
363
+ })(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : I);
364
+ var L = ue(function(e) {
364
365
  (function(t, n, r) {
365
366
  n[t] = n[t] || r(), e.exports && (e.exports = n[t]);
366
- })("Promise", R, function() {
367
+ })("Promise", I, function() {
367
368
  var e, t, n, r = Object.prototype.toString, i = typeof setImmediate < "u" ? function(e) {
368
369
  return setImmediate(e);
369
370
  } : setTimeout;
@@ -511,32 +512,32 @@ var z = fe(function(e) {
511
512
  }) : t.reject(TypeError("Not an array"));
512
513
  }), m;
513
514
  });
514
- }), B = /* @__PURE__ */ new WeakMap();
515
- function V(e, t, n) {
516
- let r = B.get(e.element) || {};
517
- t in r || (r[t] = []), r[t].push(n), B.set(e.element, r);
515
+ }), R = /* @__PURE__ */ new WeakMap();
516
+ function z(e, t, n) {
517
+ let r = R.get(e.element) || {};
518
+ t in r || (r[t] = []), r[t].push(n), R.set(e.element, r);
518
519
  }
519
- function H(e, t) {
520
- return (B.get(e.element) || {})[t] || [];
520
+ function B(e, t) {
521
+ return (R.get(e.element) || {})[t] || [];
521
522
  }
522
- function U(e, t, n) {
523
- let r = B.get(e.element) || {};
523
+ function V(e, t, n) {
524
+ let r = R.get(e.element) || {};
524
525
  if (!r[t]) return !0;
525
- if (!n) return r[t] = [], B.set(e.element, r), !0;
526
+ if (!n) return r[t] = [], R.set(e.element, r), !0;
526
527
  let i = r[t].indexOf(n);
527
- return i !== -1 && r[t].splice(i, 1), B.set(e.element, r), r[t] && r[t].length === 0;
528
+ return i !== -1 && r[t].splice(i, 1), R.set(e.element, r), r[t] && r[t].length === 0;
528
529
  }
529
- function pe(e, t) {
530
- let n = H(e, t);
530
+ function H(e, t) {
531
+ let n = B(e, t);
531
532
  if (n.length < 1) return !1;
532
533
  let r = n.shift();
533
- return U(e, t, r), r;
534
+ return V(e, t, r), r;
534
535
  }
535
- function me(e, t) {
536
- let n = B.get(e);
537
- B.set(t, n), B.delete(e);
536
+ function de(e, t) {
537
+ let n = R.get(e);
538
+ R.set(t, n), R.delete(e);
538
539
  }
539
- function W(e) {
540
+ function U(e) {
540
541
  if (typeof e == "string") try {
541
542
  e = JSON.parse(e);
542
543
  } catch (e) {
@@ -544,22 +545,22 @@ function W(e) {
544
545
  }
545
546
  return e;
546
547
  }
547
- function G(e, t, n) {
548
+ function W(e, t, n) {
548
549
  if (!e.element.contentWindow || !e.element.contentWindow.postMessage) return;
549
550
  let r = { method: t };
550
551
  n !== void 0 && (r.value = n);
551
552
  let i = parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/, "$1"));
552
553
  i >= 8 && i < 10 && (r = JSON.stringify(r)), e.element.contentWindow.postMessage(r, e.origin);
553
554
  }
554
- function he(e, t) {
555
- t = W(t);
555
+ function fe(e, t) {
556
+ t = U(t);
556
557
  let n = [], r;
557
- if (t.event) t.event === "error" && H(e, t.data.method).forEach((n) => {
558
+ if (t.event) t.event === "error" && B(e, t.data.method).forEach((n) => {
558
559
  let r = Error(t.data.message);
559
- r.name = t.data.name, n.reject(r), U(e, t.data.method, n);
560
- }), n = H(e, `event:${t.event}`), r = t.data;
560
+ r.name = t.data.name, n.reject(r), V(e, t.data.method, n);
561
+ }), n = B(e, `event:${t.event}`), r = t.data;
561
562
  else if (t.method) {
562
- let i = pe(e, t.method);
563
+ let i = H(e, t.method);
563
564
  i && (n.push(i), r = t.value);
564
565
  }
565
566
  n.forEach((t) => {
@@ -572,26 +573,26 @@ function he(e, t) {
572
573
  } catch {}
573
574
  });
574
575
  }
575
- var ge = /* @__PURE__ */ "airplay.audio_tracks.audiotrack.autopause.autoplay.background.byline.cc.chapter_id.chapters.chromecast.color.colors.controls.disable_context_menu.dnt.end_time.fullscreen.height.id.initial_quality.interactive_params.keyboard.loop.maxheight.max_quality.maxwidth.min_quality.muted.play_button_position.playsinline.portrait.preload.progress_bar.quality.quality_selector.responsive.skipping_forward.speed.start_time.texttrack.thumbnail_id.title.transcript.transparent.unmute_button.url.vimeo_logo.volume.watch_full_video.width".split(".");
576
- function K(e) {
576
+ var pe = /* @__PURE__ */ "airplay.audio_tracks.audiotrack.autopause.autoplay.background.byline.cc.chapter_id.chapters.chromecast.color.colors.controls.disable_context_menu.dnt.end_time.fullscreen.height.id.initial_quality.interactive_params.keyboard.loop.maxheight.max_quality.maxwidth.min_quality.muted.play_button_position.playsinline.portrait.preload.progress_bar.quality.quality_selector.responsive.skipping_forward.speed.start_time.texttrack.thumbnail_id.title.transcript.transparent.unmute_button.url.vimeo_logo.volume.watch_full_video.width".split(".");
577
+ function G(e) {
577
578
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
578
- return ge.reduce((t, n) => {
579
+ return pe.reduce((t, n) => {
579
580
  let r = e.getAttribute(`data-vimeo-${n}`);
580
581
  return (r || r === "") && (t[n] = r === "" ? 1 : r), t;
581
582
  }, t);
582
583
  }
583
- function q(e, t) {
584
+ function K(e, t) {
584
585
  let { html: n } = e;
585
586
  if (!t) throw TypeError("An element must be provided");
586
587
  if (t.getAttribute("data-vimeo-initialized") !== null) return t.querySelector("iframe");
587
588
  let r = document.createElement("div");
588
589
  return r.innerHTML = n, t.appendChild(r.firstChild), t.setAttribute("data-vimeo-initialized", "true"), t.querySelector("iframe");
589
590
  }
590
- function J(e) {
591
+ function q(e) {
591
592
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 ? arguments[2] : void 0;
592
593
  return new Promise((r, i) => {
593
- if (!N(e)) throw TypeError(`“${e}” is not a vimeo.com url.`);
594
- let a = `https://${le(e)}/api/oembed.json?url=${encodeURIComponent(e)}`;
594
+ if (!A(e)) throw TypeError(`“${e}” is not a vimeo.com url.`);
595
+ let a = `https://${M(e)}/api/oembed.json?url=${encodeURIComponent(e)}`;
595
596
  for (let e in t) t.hasOwnProperty(e) && (a += `&${e}=${encodeURIComponent(t[e])}`);
596
597
  let o = "XDomainRequest" in window ? new XDomainRequest() : new XMLHttpRequest();
597
598
  o.open("GET", a, !0), o.onload = function() {
@@ -606,7 +607,7 @@ function J(e) {
606
607
  try {
607
608
  let t = JSON.parse(o.responseText);
608
609
  if (t.domain_status_code === 403) {
609
- q(t, n), i(/* @__PURE__ */ Error(`“${e}” is not embeddable.`));
610
+ K(t, n), i(/* @__PURE__ */ Error(`“${e}” is not embeddable.`));
610
611
  return;
611
612
  }
612
613
  r(t);
@@ -619,42 +620,42 @@ function J(e) {
619
620
  }, o.send();
620
621
  });
621
622
  }
622
- function _e() {
623
+ function me() {
623
624
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document, t = [].slice.call(e.querySelectorAll("[data-vimeo-id], [data-vimeo-url]")), n = (e) => {
624
625
  "console" in window && console.error && console.error(`There was an error creating an embed: ${e}`);
625
626
  };
626
627
  t.forEach((e) => {
627
628
  try {
628
629
  if (e.getAttribute("data-vimeo-defer") !== null) return;
629
- let t = K(e);
630
- J(F(t), t, e).then((t) => q(t, e)).catch(n);
630
+ let t = G(e);
631
+ q(N(t), t, e).then((t) => K(t, e)).catch(n);
631
632
  } catch (e) {
632
633
  n(e);
633
634
  }
634
635
  });
635
636
  }
636
- function ve() {
637
+ function he() {
637
638
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
638
639
  window.VimeoPlayerResizeEmbeds_ || (window.VimeoPlayerResizeEmbeds_ = !0, window.addEventListener("message", (t) => {
639
- if (!N(t.origin) || !t.data || t.data.event !== "spacechange") return;
640
- let n = t.source ? L(t.source, e) : null;
640
+ if (!A(t.origin) || !t.data || t.data.event !== "spacechange") return;
641
+ let n = t.source ? F(t.source, e) : null;
641
642
  if (n) {
642
643
  let e = n.parentElement;
643
644
  e.style.paddingBottom = `${t.data.data[0].bottom}px`;
644
645
  }
645
646
  }));
646
647
  }
647
- function ye() {
648
+ function ge() {
648
649
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
649
650
  window.VimeoSeoMetadataAppended || (window.VimeoSeoMetadataAppended = !0, window.addEventListener("message", (t) => {
650
- if (!N(t.origin)) return;
651
- let n = W(t.data);
651
+ if (!A(t.origin)) return;
652
+ let n = U(t.data);
652
653
  if (!n || n.event !== "ready") return;
653
- let r = t.source ? L(t.source, e) : null;
654
- r && P(r.src) && new Q(r).callMethod("appendVideoMetadata", window.location.href);
654
+ let r = t.source ? F(t.source, e) : null;
655
+ r && j(r.src) && new Z(r).callMethod("appendVideoMetadata", window.location.href);
655
656
  }));
656
657
  }
657
- function be() {
658
+ function _e() {
658
659
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
659
660
  if (window.VimeoCheckedUrlTimeParam) return;
660
661
  window.VimeoCheckedUrlTimeParam = !0;
@@ -662,12 +663,12 @@ function be() {
662
663
  "console" in window && console.error && console.error(`There was an error getting video Id: ${e}`);
663
664
  };
664
665
  window.addEventListener("message", (n) => {
665
- if (!N(n.origin)) return;
666
- let r = W(n.data);
666
+ if (!A(n.origin)) return;
667
+ let r = U(n.data);
667
668
  if (!r || r.event !== "ready") return;
668
- let i = n.source ? L(n.source, e) : null;
669
- if (i && P(i.src)) {
670
- let e = new Q(i);
669
+ let i = n.source ? F(n.source, e) : null;
670
+ if (i && j(i.src)) {
671
+ let e = new Z(i);
671
672
  e.getVideoId().then((t) => {
672
673
  let n = RegExp(`[?&]vimeo_t_${t}=([^&#]*)`).exec(window.location.href);
673
674
  if (n && n[1]) {
@@ -678,12 +679,12 @@ function be() {
678
679
  }
679
680
  });
680
681
  }
681
- function xe() {
682
+ function ve() {
682
683
  window.VimeoDRMEmbedsUpdated || (window.VimeoDRMEmbedsUpdated = !0, window.addEventListener("message", (e) => {
683
- if (!N(e.origin)) return;
684
- let t = W(e.data);
684
+ if (!A(e.origin)) return;
685
+ let t = U(e.data);
685
686
  if (!t || t.event !== "drminitfailed") return;
686
- let n = e.source ? L(e.source) : null;
687
+ let n = e.source ? F(e.source) : null;
687
688
  if (!n) return;
688
689
  let r = n.getAttribute("allow") || "";
689
690
  if (!r.includes("encrypted-media")) {
@@ -694,7 +695,7 @@ function xe() {
694
695
  }
695
696
  }));
696
697
  }
697
- function Se() {
698
+ function ye() {
698
699
  let e = function() {
699
700
  let e, t = [
700
701
  [
@@ -798,7 +799,7 @@ function Se() {
798
799
  }
799
800
  }), n;
800
801
  }
801
- var Ce = {
802
+ var be = {
802
803
  role: "viewer",
803
804
  autoPlayMuted: !0,
804
805
  allowedDrift: .3,
@@ -806,16 +807,16 @@ var Ce = {
806
807
  minCheckInterval: .1,
807
808
  maxRateAdjustment: .2,
808
809
  maxTimeToCatchUp: 1
809
- }, we = class extends EventTarget {
810
- constructor(t, n) {
811
- let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = arguments.length > 3 ? arguments[3] : void 0;
812
- super(), e(this, "logger", void 0), e(this, "speedAdjustment", 0), e(this, "adjustSpeed", async (e, t) => {
810
+ }, xe = class extends EventTarget {
811
+ constructor(e, t) {
812
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = arguments.length > 3 ? arguments[3] : void 0;
813
+ super(), r(this, "logger", void 0), r(this, "speedAdjustment", 0), r(this, "adjustSpeed", async (e, t) => {
813
814
  if (this.speedAdjustment === t) return;
814
815
  let n = await e.getPlaybackRate() - this.speedAdjustment + t;
815
816
  this.log(`New playbackRate: ${n}`), await e.setPlaybackRate(n), this.speedAdjustment = t;
816
- }), this.logger = i, this.init(n, t, {
817
- ...Ce,
818
- ...r
817
+ }), this.logger = i, this.init(t, e, {
818
+ ...be,
819
+ ...n
819
820
  });
820
821
  }
821
822
  disconnect() {
@@ -824,13 +825,13 @@ var Ce = {
824
825
  async init(e, t, n) {
825
826
  if (await this.waitForTOReadyState(e, "open"), n.role === "viewer") {
826
827
  await this.updatePlayer(e, t, n);
827
- let r = I(e, "change", () => this.updatePlayer(e, t, n)), i = this.maintainPlaybackPosition(e, t, n);
828
+ let r = P(e, "change", () => this.updatePlayer(e, t, n)), i = this.maintainPlaybackPosition(e, t, n);
828
829
  this.addEventListener("disconnect", () => {
829
830
  i.cancel(), r.cancel();
830
831
  });
831
832
  } else {
832
833
  await this.updateTimingObject(e, t);
833
- let n = I(t, [
834
+ let n = P(t, [
834
835
  "seeked",
835
836
  "play",
836
837
  "pause",
@@ -880,22 +881,22 @@ var Ce = {
880
881
  r();
881
882
  });
882
883
  }
883
- }, Y = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), Z = {}, Q = class {
884
+ }, J = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap(), X = {}, Z = class {
884
885
  constructor(e) {
885
886
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
886
- if (window.jQuery && e instanceof jQuery && (e.length > 1 && window.console && console.warn && console.warn("A jQuery object with multiple elements was passed, using the first element."), e = e[0]), typeof document < "u" && typeof e == "string" && (e = document.getElementById(e)), !se(e)) throw TypeError("You must pass either a valid element or a valid id.");
887
+ if (window.jQuery && e instanceof jQuery && (e.length > 1 && window.console && console.warn && console.warn("A jQuery object with multiple elements was passed, using the first element."), e = e[0]), typeof document < "u" && typeof e == "string" && (e = document.getElementById(e)), !oe(e)) throw TypeError("You must pass either a valid element or a valid id.");
887
888
  if (e.nodeName !== "IFRAME") {
888
889
  let t = e.querySelector("iframe");
889
890
  t && (e = t);
890
891
  }
891
- if (e.nodeName === "IFRAME" && !N(e.getAttribute("src") || "")) throw Error("The player element passed isn’t a Vimeo embed.");
892
- if (Y.has(e)) return Y.get(e);
892
+ if (e.nodeName === "IFRAME" && !A(e.getAttribute("src") || "")) throw Error("The player element passed isn’t a Vimeo embed.");
893
+ if (J.has(e)) return J.get(e);
893
894
  this._window = e.ownerDocument.defaultView, this.element = e, this.origin = "*";
894
- let n = new z((n, r) => {
895
+ let n = new L((n, r) => {
895
896
  if (this._onMessage = (e) => {
896
- if (!N(e.origin) || this.element.contentWindow !== e.source) return;
897
+ if (!A(e.origin) || this.element.contentWindow !== e.source) return;
897
898
  this.origin === "*" && (this.origin = e.origin);
898
- let t = W(e.data);
899
+ let t = U(e.data);
899
900
  if (t && t.event === "error" && t.data && t.data.method === "ready") {
900
901
  let e = Error(t.data.message);
901
902
  e.name = t.data.name, r(e);
@@ -906,54 +907,54 @@ var Ce = {
906
907
  this.element.setAttribute("data-ready", "true"), n();
907
908
  return;
908
909
  }
909
- he(this, t);
910
+ fe(this, t);
910
911
  }, this._window.addEventListener("message", this._onMessage), this.element.nodeName !== "IFRAME") {
911
- let n = K(e, t);
912
- J(F(n), n, e).then((t) => {
913
- let n = q(t, e);
914
- return this.element = n, this._originalElement = e, me(e, n), Y.set(this.element, this), t;
912
+ let n = G(e, t);
913
+ q(N(n), n, e).then((t) => {
914
+ let n = K(t, e);
915
+ return this.element = n, this._originalElement = e, de(e, n), J.set(this.element, this), t;
915
916
  }).catch(r);
916
917
  }
917
918
  });
918
- if (X.set(this, n), Y.set(this.element, this), this.element.nodeName === "IFRAME" && G(this, "ping"), Z.isEnabled) {
919
- let e = () => Z.exit();
919
+ if (Y.set(this, n), J.set(this.element, this), this.element.nodeName === "IFRAME" && W(this, "ping"), X.isEnabled) {
920
+ let e = () => X.exit();
920
921
  this.fullscreenchangeHandler = () => {
921
- Z.isFullscreen ? V(this, "event:exitFullscreen", e) : U(this, "event:exitFullscreen", e), this.ready().then(() => {
922
- G(this, "fullscreenchange", Z.isFullscreen);
922
+ X.isFullscreen ? z(this, "event:exitFullscreen", e) : V(this, "event:exitFullscreen", e), this.ready().then(() => {
923
+ W(this, "fullscreenchange", X.isFullscreen);
923
924
  });
924
- }, Z.on("fullscreenchange", this.fullscreenchangeHandler);
925
+ }, X.on("fullscreenchange", this.fullscreenchangeHandler);
925
926
  }
926
927
  return this;
927
928
  }
928
929
  static isVimeoUrl(e) {
929
- return N(e);
930
+ return A(e);
930
931
  }
931
932
  callMethod(e) {
932
933
  var t = [...arguments].slice(1);
933
934
  if (e == null) throw TypeError("You must pass a method name.");
934
- return new z((n, r) => this.ready().then(() => {
935
- V(this, e, {
935
+ return new L((n, r) => this.ready().then(() => {
936
+ z(this, e, {
936
937
  resolve: n,
937
938
  reject: r
938
- }), t.length === 0 ? t = {} : t.length === 1 && (t = t[0]), G(this, e, t);
939
+ }), t.length === 0 ? t = {} : t.length === 1 && (t = t[0]), W(this, e, t);
939
940
  }).catch(r));
940
941
  }
941
942
  get(e) {
942
- return new z((t, n) => (e = M(e, "get"), this.ready().then(() => {
943
- V(this, e, {
943
+ return new L((t, n) => (e = k(e, "get"), this.ready().then(() => {
944
+ z(this, e, {
944
945
  resolve: t,
945
946
  reject: n
946
- }), G(this, e);
947
+ }), W(this, e);
947
948
  }).catch(n)));
948
949
  }
949
950
  set(e, t) {
950
- return new z((n, r) => {
951
- if (e = M(e, "set"), t == null) throw TypeError("There must be a value to set.");
951
+ return new L((n, r) => {
952
+ if (e = k(e, "set"), t == null) throw TypeError("There must be a value to set.");
952
953
  return this.ready().then(() => {
953
- V(this, e, {
954
+ z(this, e, {
954
955
  resolve: n,
955
956
  reject: r
956
- }), G(this, e, t);
957
+ }), W(this, e, t);
957
958
  }).catch(r);
958
959
  });
959
960
  }
@@ -961,21 +962,21 @@ var Ce = {
961
962
  if (!e) throw TypeError("You must pass an event name.");
962
963
  if (!t) throw TypeError("You must pass a callback function.");
963
964
  if (typeof t != "function") throw TypeError("The callback must be a function.");
964
- H(this, `event:${e}`).length === 0 && this.callMethod("addEventListener", e).catch(() => {}), V(this, `event:${e}`, t);
965
+ B(this, `event:${e}`).length === 0 && this.callMethod("addEventListener", e).catch(() => {}), z(this, `event:${e}`, t);
965
966
  }
966
967
  off(e, t) {
967
968
  if (!e) throw TypeError("You must pass an event name.");
968
969
  if (t && typeof t != "function") throw TypeError("The callback must be a function.");
969
- U(this, `event:${e}`, t) && this.callMethod("removeEventListener", e).catch((e) => {});
970
+ V(this, `event:${e}`, t) && this.callMethod("removeEventListener", e).catch((e) => {});
970
971
  }
971
972
  loadVideo(e) {
972
973
  return this.callMethod("loadVideo", e);
973
974
  }
974
975
  ready() {
975
- let e = X.get(this) || new z((e, t) => {
976
+ let e = Y.get(this) || new L((e, t) => {
976
977
  t(/* @__PURE__ */ Error("Unknown player. Probably unloaded."));
977
978
  });
978
- return z.resolve(e);
979
+ return L.resolve(e);
979
980
  }
980
981
  addCuePoint(e) {
981
982
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
@@ -1016,13 +1017,13 @@ var Ce = {
1016
1017
  return this.callMethod("play");
1017
1018
  }
1018
1019
  requestFullscreen() {
1019
- return Z.isEnabled ? Z.request(this.element) : this.callMethod("requestFullscreen");
1020
+ return X.isEnabled ? X.request(this.element) : this.callMethod("requestFullscreen");
1020
1021
  }
1021
1022
  exitFullscreen() {
1022
- return Z.isEnabled ? Z.exit() : this.callMethod("exitFullscreen");
1023
+ return X.isEnabled ? X.exit() : this.callMethod("exitFullscreen");
1023
1024
  }
1024
1025
  getFullscreen() {
1025
- return Z.isEnabled ? z.resolve(Z.isFullscreen) : this.get("fullscreen");
1026
+ return X.isEnabled ? L.resolve(X.isFullscreen) : this.get("fullscreen");
1026
1027
  }
1027
1028
  requestPictureInPicture() {
1028
1029
  return this.callMethod("requestPictureInPicture");
@@ -1040,13 +1041,13 @@ var Ce = {
1040
1041
  return this.callMethod("unload");
1041
1042
  }
1042
1043
  destroy() {
1043
- return new z((e) => {
1044
- if (X.delete(this), Y.delete(this.element), this._originalElement && (Y.delete(this._originalElement), this._originalElement.removeAttribute("data-vimeo-initialized")), this.element && this.element.nodeName === "IFRAME" && this.element.parentNode && (this.element.parentNode.parentNode && this._originalElement && this._originalElement !== this.element.parentNode ? this.element.parentNode.parentNode.removeChild(this.element.parentNode) : this.element.parentNode.removeChild(this.element)), this.element && this.element.nodeName === "DIV" && this.element.parentNode) {
1044
+ return new L((e) => {
1045
+ if (Y.delete(this), J.delete(this.element), this._originalElement && (J.delete(this._originalElement), this._originalElement.removeAttribute("data-vimeo-initialized")), this.element && this.element.nodeName === "IFRAME" && this.element.parentNode && (this.element.parentNode.parentNode && this._originalElement && this._originalElement !== this.element.parentNode ? this.element.parentNode.parentNode.removeChild(this.element.parentNode) : this.element.parentNode.removeChild(this.element)), this.element && this.element.nodeName === "DIV" && this.element.parentNode) {
1045
1046
  this.element.removeAttribute("data-vimeo-initialized");
1046
1047
  let e = this.element.querySelector("iframe");
1047
1048
  e && e.parentNode && (e.parentNode.parentNode && this._originalElement && this._originalElement !== e.parentNode ? e.parentNode.parentNode.removeChild(e.parentNode) : e.parentNode.removeChild(e));
1048
1049
  }
1049
- this._window.removeEventListener("message", this._onMessage), Z.isEnabled && Z.off("fullscreenchange", this.fullscreenchangeHandler), e();
1050
+ this._window.removeEventListener("message", this._onMessage), X.isEnabled && X.off("fullscreenchange", this.fullscreenchangeHandler), e();
1050
1051
  });
1051
1052
  }
1052
1053
  getAutopause() {
@@ -1074,7 +1075,7 @@ var Ce = {
1074
1075
  return this.get("color");
1075
1076
  }
1076
1077
  getColors() {
1077
- return z.all([
1078
+ return L.all([
1078
1079
  this.get("colorOne"),
1079
1080
  this.get("colorTwo"),
1080
1081
  this.get("colorThree"),
@@ -1085,14 +1086,14 @@ var Ce = {
1085
1086
  return this.set("color", e);
1086
1087
  }
1087
1088
  setColors(e) {
1088
- if (!Array.isArray(e)) return new z((e, t) => t(/* @__PURE__ */ TypeError("Argument must be an array.")));
1089
- let t = new z((e) => e(null)), n = [
1089
+ if (!Array.isArray(e)) return new L((e, t) => t(/* @__PURE__ */ TypeError("Argument must be an array.")));
1090
+ let t = new L((e) => e(null)), n = [
1090
1091
  e[0] ? this.set("colorOne", e[0]) : t,
1091
1092
  e[1] ? this.set("colorTwo", e[1]) : t,
1092
1093
  e[2] ? this.set("colorThree", e[2]) : t,
1093
1094
  e[3] ? this.set("colorFour", e[3]) : t
1094
1095
  ];
1095
- return z.all(n);
1096
+ return L.all(n);
1096
1097
  }
1097
1098
  getCuePoints() {
1098
1099
  return this.get("cuePoints");
@@ -1193,14 +1194,14 @@ var Ce = {
1193
1194
  async setTimingSrc(e, t) {
1194
1195
  if (!e) throw TypeError("A Timing Object must be provided.");
1195
1196
  await this.ready();
1196
- let n = new we(this, e, t);
1197
- return G(this, "notifyTimingObjectConnect"), n.addEventListener("disconnect", () => G(this, "notifyTimingObjectDisconnect")), n;
1197
+ let n = new xe(this, e, t);
1198
+ return W(this, "notifyTimingObjectConnect"), n.addEventListener("disconnect", () => W(this, "notifyTimingObjectDisconnect")), n;
1198
1199
  }
1199
1200
  };
1200
- j || (Z = Se(), _e(), ve(), ye(), be(), xe());
1201
+ O || (X = ye(), me(), he(), ge(), _e(), ve());
1201
1202
  //#endregion
1202
1203
  //#region src/ui/media/EmbeddedVideo/VimeoPlayer.tsx
1203
- var Te = (e) => {
1204
+ var Q = n(), Se = (e) => {
1204
1205
  let t = e.match(/vimeo\.com\/(video\/|event\/)?(\d+)(?:\/([a-zA-Z0-9]+))?/);
1205
1206
  if (!t) {
1206
1207
  let t = e.match(/player\.vimeo\.com\/video\/(\d+)/);
@@ -1214,26 +1215,26 @@ var Te = (e) => {
1214
1215
  videoId: n,
1215
1216
  privacyHash: r || void 0
1216
1217
  };
1217
- }, Ee = (e, t) => {
1218
+ }, Ce = (e, t) => {
1218
1219
  let n = new URLSearchParams();
1219
1220
  return t && n.append("h", t), n.append("dnt", "1"), n.append("fullscreen", "1"), `https://player.vimeo.com/video/${e}?${n.toString()}`;
1220
- }, De = ({ src: e, title: t, width: n = "100%", height: r = "100%", onPlay: i, onPause: s, onEnded: l, onError: u }) => {
1221
- let d = o(null), f = o(null);
1222
- return a(() => {
1223
- if (!d.current) return;
1224
- let a = Te(e);
1225
- if (!a) {
1226
- u == null || u(/* @__PURE__ */ Error("Invalid Vimeo URL"));
1221
+ }, we = ({ src: e, title: t, width: n = "100%", height: r = "100%", onPlay: a, onPause: o, onEnded: s, onError: c }) => {
1222
+ let l = (0, i.useRef)(null), u = (0, i.useRef)(null);
1223
+ return (0, i.useEffect)(() => {
1224
+ if (!l.current) return;
1225
+ let i = Se(e);
1226
+ if (!i) {
1227
+ c == null || c(/* @__PURE__ */ Error("Invalid Vimeo URL"));
1227
1228
  return;
1228
1229
  }
1229
- let o = document.createElement("iframe");
1230
- o.src = Ee(a.videoId, a.privacyHash), o.title = t, o.width = n, o.height = r, o.frameBorder = "0", o.referrerPolicy = "origin", o.allow = "autoplay; fullscreen; picture-in-picture", o.allowFullscreen = !0, o.style.width = "100%", o.style.height = "100%", o.style.border = "none", d.current.innerHTML = "", d.current.appendChild(o);
1231
- let c = new Q(o);
1232
- return f.current = c, c.on("play", () => i == null ? void 0 : i()), c.on("pause", () => s == null ? void 0 : s()), c.on("ended", () => l == null ? void 0 : l()), c.on("error", (e) => u == null ? void 0 : u(Error(e.message))), () => {
1233
- c.destroy(), f.current = null;
1230
+ let d = document.createElement("iframe");
1231
+ d.src = Ce(i.videoId, i.privacyHash), d.title = t, d.width = n, d.height = r, d.frameBorder = "0", d.referrerPolicy = "origin", d.allow = "autoplay; fullscreen; picture-in-picture", d.allowFullscreen = !0, d.style.width = "100%", d.style.height = "100%", d.style.border = "none", l.current.innerHTML = "", l.current.appendChild(d);
1232
+ let f = new Z(d);
1233
+ return u.current = f, f.on("play", () => a == null ? void 0 : a()), f.on("pause", () => o == null ? void 0 : o()), f.on("ended", () => s == null ? void 0 : s()), f.on("error", (e) => c == null ? void 0 : c(Error(e.message))), () => {
1234
+ f.destroy(), u.current = null;
1234
1235
  };
1235
- }, [e]), /* @__PURE__ */ c("div", {
1236
- ref: d,
1236
+ }, [e]), /* @__PURE__ */ (0, Q.jsx)("div", {
1237
+ ref: l,
1237
1238
  style: {
1238
1239
  width: n,
1239
1240
  height: r,
@@ -1241,14 +1242,14 @@ var Te = (e) => {
1241
1242
  maxHeight: "100%"
1242
1243
  }
1243
1244
  });
1244
- }, Oe = (e) => /vimeo\.com/.test(e), $ = {
1245
+ }, Te = (e) => /vimeo\.com/.test(e), $ = {
1245
1246
  width: "100%",
1246
1247
  aspectRatio: "16 / 9"
1247
- }, ke = ({ url: e, label: t }) => {
1248
- let [n, r] = s(!1);
1249
- return Oe(e) ? /* @__PURE__ */ c("div", {
1248
+ }, Ee = ({ url: e, label: t }) => {
1249
+ let [n, r] = (0, i.useState)(!1);
1250
+ return Te(e) ? /* @__PURE__ */ (0, Q.jsx)("div", {
1250
1251
  style: $,
1251
- children: /* @__PURE__ */ c(De, {
1252
+ children: /* @__PURE__ */ (0, Q.jsx)(we, {
1252
1253
  src: e,
1253
1254
  title: t,
1254
1255
  width: "100%",
@@ -1256,9 +1257,9 @@ var Te = (e) => {
1256
1257
  onPlay: () => r(!0),
1257
1258
  onPause: () => r(!1)
1258
1259
  })
1259
- }) : /* @__PURE__ */ c("div", {
1260
+ }) : /* @__PURE__ */ (0, Q.jsx)("div", {
1260
1261
  style: $,
1261
- children: /* @__PURE__ */ c(ie, {
1262
+ children: /* @__PURE__ */ (0, Q.jsx)(re, {
1262
1263
  src: e,
1263
1264
  controls: !0,
1264
1265
  width: "100%",
@@ -1272,6 +1273,6 @@ var Te = (e) => {
1272
1273
  });
1273
1274
  };
1274
1275
  //#endregion
1275
- export { ke as EmbeddedVideoPlayer };
1276
+ export { Ee as EmbeddedVideoPlayer };
1276
1277
 
1277
- //# sourceMappingURL=EmbeddedVideoPlayer-SaMMfDIW.js.map
1278
+ //# sourceMappingURL=EmbeddedVideoPlayer-CNcds-dW.js.map