@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.
- package/dist/EmbeddedVideoPlayer-SaMMfDIW.js +1277 -0
- package/dist/EmbeddedVideoPlayer-SaMMfDIW.js.map +1 -0
- package/dist/Preview-Db-hgkTh.js +83 -0
- package/dist/Preview-Db-hgkTh.js.map +1 -0
- package/dist/api/client.d.ts +60 -0
- package/dist/api/config.d.ts +18 -0
- package/dist/api/constants.d.ts +5 -0
- package/dist/api/index.d.ts +5 -0
- package/dist/api/sse.d.ts +12 -0
- package/dist/api/types/branding.d.ts +17 -0
- package/dist/api/types/messages.d.ts +148 -0
- package/dist/api/types/responses.d.ts +106 -0
- package/dist/api.js +2 -0
- package/dist/classPrivateFieldSet2-DtQPURVD.js +32 -0
- package/dist/core/bubbles/convert.d.ts +18 -0
- package/dist/core/bubbles/types.d.ts +55 -0
- package/dist/core/constants.d.ts +14 -0
- package/dist/core/events.d.ts +44 -0
- package/dist/core/i18n/fallback.d.ts +2 -0
- package/dist/core/i18n/languages.d.ts +11 -0
- package/dist/core/i18n/translator.d.ts +13 -0
- package/dist/core/interview.d.ts +207 -0
- package/dist/core/media/mimeTypes.d.ts +10 -0
- package/dist/core/media/recorder.d.ts +61 -0
- package/dist/core/persistence.d.ts +4 -0
- package/dist/core/store.d.ts +49 -0
- package/dist/core/theme/branding.d.ts +6 -0
- package/dist/core/theme/cssVariables.d.ts +16 -0
- package/dist/core/theme/types.d.ts +11 -0
- package/dist/core/validation/phoneCountries.d.ts +21 -0
- package/dist/core/validation/pii.d.ts +30 -0
- package/dist/dash.all.min-DZ1yEcJk.js +27302 -0
- package/dist/dash.all.min-DZ1yEcJk.js.map +1 -0
- package/dist/defineProperty-DiFpLzd2.js +39 -0
- package/dist/dist-BSi28_cP.js +702 -0
- package/dist/dist-BSi28_cP.js.map +1 -0
- package/dist/dist-DGBYKC8c.js +14327 -0
- package/dist/dist-DGBYKC8c.js.map +1 -0
- package/dist/dist-FvHBWiRa.js +76 -0
- package/dist/dist-FvHBWiRa.js.map +1 -0
- package/dist/embed/compat.d.ts +82 -0
- package/dist/embed/constants.d.ts +2 -0
- package/dist/embed/createChatbot.d.ts +22 -0
- package/dist/fix-webm-duration-BW9Fbdzt.js +1057 -0
- package/dist/fix-webm-duration-BW9Fbdzt.js.map +1 -0
- package/dist/hls-mBncGwsE.js +18657 -0
- package/dist/hls-mBncGwsE.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4428 -0
- package/dist/index.js.map +1 -0
- package/dist/max-Btet1snX.js +12212 -0
- package/dist/max-Btet1snX.js.map +1 -0
- package/dist/messages-C4jqrtSG.js +187 -0
- package/dist/messages-C4jqrtSG.js.map +1 -0
- package/dist/react/AnswerInput.d.ts +21 -0
- package/dist/react/SapiaChatbot.d.ts +23 -0
- package/dist/react/bubbleViewModel.d.ts +50 -0
- package/dist/react/strings.d.ts +98 -0
- package/dist/react/useBeforeUnload.d.ts +5 -0
- package/dist/react/useVideoRecorder.d.ts +24 -0
- package/dist/react-BGJ7Szvq.js +216 -0
- package/dist/react-BGJ7Szvq.js.map +1 -0
- package/dist/react-BMxM8TWJ.js +192 -0
- package/dist/react-BMxM8TWJ.js.map +1 -0
- package/dist/react-BVzcquey.js +457 -0
- package/dist/react-BVzcquey.js.map +1 -0
- package/dist/react-BrCGR7Ca.js +2208 -0
- package/dist/react-BrCGR7Ca.js.map +1 -0
- package/dist/react-Bujo1aK5.js +334 -0
- package/dist/react-Bujo1aK5.js.map +1 -0
- package/dist/react-CRTg4gz8.js +367 -0
- package/dist/react-CRTg4gz8.js.map +1 -0
- package/dist/react-GXf8sbzf.js +311 -0
- package/dist/react-GXf8sbzf.js.map +1 -0
- package/dist/react-lp7yfM94.js +371 -0
- package/dist/react-lp7yfM94.js.map +1 -0
- package/dist/sapia-chatbot.css +3 -0
- package/dist/sapia.d.ts +4 -0
- package/dist/ui/chat/ChatBubble/ChatBubble.d.ts +47 -0
- package/dist/ui/chat/ChatLog/ChatLog.d.ts +33 -0
- package/dist/ui/chat/TypingIndicator/TypingIndicator.d.ts +17 -0
- package/dist/ui/chat/types.d.ts +71 -0
- package/dist/ui/constants.d.ts +2 -0
- package/dist/ui/inputs/DropdownInput/DropdownInput.d.ts +18 -0
- package/dist/ui/inputs/OptionList/OptionList.d.ts +18 -0
- package/dist/ui/inputs/PhoneAnswerInput/PhoneAnswerInput.d.ts +19 -0
- package/dist/ui/inputs/SliderInput/SliderInput.d.ts +19 -0
- package/dist/ui/inputs/TextAnswerInput/TextAnswerInput.d.ts +32 -0
- package/dist/ui/inputs/VideoRecorder/VideoRecorder.d.ts +54 -0
- package/dist/ui/media/EmbeddedVideo/EmbeddedVideo.d.ts +11 -0
- package/dist/ui/media/EmbeddedVideo/EmbeddedVideoPlayer.d.ts +16 -0
- package/dist/ui/media/EmbeddedVideo/VimeoPlayer.d.ts +20 -0
- package/dist/ui/media/UploadProgress/UploadProgress.d.ts +7 -0
- package/dist/ui/media/VideoPlayer/VideoPlayer.d.ts +13 -0
- package/dist/ui/primitives/Button/Button.d.ts +6 -0
- package/dist/ui/primitives/Dialog/Dialog.d.ts +16 -0
- package/dist/ui/richText.d.ts +6 -0
- package/dist/ui/shell/AccessVerificationForm/AccessVerificationForm.d.ts +21 -0
- package/dist/ui/shell/CopyLinkButton/CopyLinkButton.d.ts +11 -0
- package/dist/ui/shell/DoneScreen/DoneScreen.d.ts +15 -0
- package/dist/ui/shell/Header/Header.d.ts +13 -0
- package/dist/ui/shell/PreparingScreen/PreparingScreen.d.ts +9 -0
- package/dist/ui/shell/ProgressBar/ProgressBar.d.ts +9 -0
- package/dist/ui/shell/WelcomeScreen/WelcomeScreen.d.ts +22 -0
- package/dist/ui/shell/WidgetRoot/WidgetRoot.d.ts +12 -0
- package/dist-umd/sapia-chatbot.umd.js +3655 -0
- package/dist-umd/sapia-chatbot.umd.js.map +1 -0
- package/package.json +94 -0
|
@@ -0,0 +1,1277 @@
|
|
|
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";
|
|
4
|
+
//#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
|
+
if (Array.isArray(e)) {
|
|
7
|
+
for (let n of e) if (typeof n == "string" && b(n, t) || b(n.src, t)) return !0;
|
|
8
|
+
return !1;
|
|
9
|
+
}
|
|
10
|
+
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, {
|
|
25
|
+
...e,
|
|
26
|
+
ref: n
|
|
27
|
+
}, e.children);
|
|
28
|
+
}), C = [
|
|
29
|
+
{
|
|
30
|
+
key: "hls",
|
|
31
|
+
name: "hls.js",
|
|
32
|
+
canPlay: x.hls,
|
|
33
|
+
canEnablePIP: () => !0,
|
|
34
|
+
player: r(() => import(
|
|
35
|
+
/* webpackChunkName: 'reactPlayerHls' */
|
|
36
|
+
"./react-BGJ7Szvq.js"
|
|
37
|
+
))
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: "dash",
|
|
41
|
+
name: "dash.js",
|
|
42
|
+
canPlay: x.dash,
|
|
43
|
+
canEnablePIP: () => !0,
|
|
44
|
+
player: r(() => import(
|
|
45
|
+
/* webpackChunkName: 'reactPlayerDash' */
|
|
46
|
+
"./react-BMxM8TWJ.js"
|
|
47
|
+
))
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
key: "mux",
|
|
51
|
+
name: "Mux",
|
|
52
|
+
canPlay: x.mux,
|
|
53
|
+
canEnablePIP: () => !0,
|
|
54
|
+
player: r(() => import(
|
|
55
|
+
/* webpackChunkName: 'reactPlayerMux' */
|
|
56
|
+
"./dist-DGBYKC8c.js"
|
|
57
|
+
))
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
key: "youtube",
|
|
61
|
+
name: "YouTube",
|
|
62
|
+
canPlay: x.youtube,
|
|
63
|
+
player: r(() => import(
|
|
64
|
+
/* webpackChunkName: 'reactPlayerYouTube' */
|
|
65
|
+
"./react-BVzcquey.js"
|
|
66
|
+
))
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
key: "vimeo",
|
|
70
|
+
name: "Vimeo",
|
|
71
|
+
canPlay: x.vimeo,
|
|
72
|
+
player: r(() => import(
|
|
73
|
+
/* webpackChunkName: 'reactPlayerVimeo' */
|
|
74
|
+
"./react-BrCGR7Ca.js"
|
|
75
|
+
))
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
key: "wistia",
|
|
79
|
+
name: "Wistia",
|
|
80
|
+
canPlay: x.wistia,
|
|
81
|
+
canEnablePIP: () => !0,
|
|
82
|
+
player: r(() => import(
|
|
83
|
+
/* webpackChunkName: 'reactPlayerWistia' */
|
|
84
|
+
"./react-lp7yfM94.js"
|
|
85
|
+
))
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
key: "spotify",
|
|
89
|
+
name: "Spotify",
|
|
90
|
+
canPlay: x.spotify,
|
|
91
|
+
canEnablePIP: () => !1,
|
|
92
|
+
player: r(() => import(
|
|
93
|
+
/* webpackChunkName: 'reactPlayerSpotify' */
|
|
94
|
+
"./react-GXf8sbzf.js"
|
|
95
|
+
))
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
key: "twitch",
|
|
99
|
+
name: "Twitch",
|
|
100
|
+
canPlay: x.twitch,
|
|
101
|
+
canEnablePIP: () => !1,
|
|
102
|
+
player: r(() => import(
|
|
103
|
+
/* webpackChunkName: 'reactPlayerTwitch' */
|
|
104
|
+
"./react-CRTg4gz8.js"
|
|
105
|
+
))
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
key: "tiktok",
|
|
109
|
+
name: "TikTok",
|
|
110
|
+
canPlay: x.tiktok,
|
|
111
|
+
canEnablePIP: () => !1,
|
|
112
|
+
player: r(() => import(
|
|
113
|
+
/* webpackChunkName: 'reactPlayerTiktok' */
|
|
114
|
+
"./react-Bujo1aK5.js"
|
|
115
|
+
))
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
key: "html",
|
|
119
|
+
name: "html",
|
|
120
|
+
canPlay: x.html,
|
|
121
|
+
canEnablePIP: () => !0,
|
|
122
|
+
player: S
|
|
123
|
+
}
|
|
124
|
+
], ee = {
|
|
125
|
+
width: "320px",
|
|
126
|
+
height: "180px",
|
|
127
|
+
volume: 1,
|
|
128
|
+
playbackRate: 1,
|
|
129
|
+
previewTabIndex: 0,
|
|
130
|
+
previewAriaLabel: "",
|
|
131
|
+
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);
|
|
142
|
+
} catch {}
|
|
143
|
+
if (!s && document.pictureInPictureElement) try {
|
|
144
|
+
(r = (n = l.current).exitPictureInPicture) == null || r.call(n), (i = document.exitPictureInPicture) == null || i.call(document);
|
|
145
|
+
} catch {}
|
|
146
|
+
}
|
|
147
|
+
}, [s]);
|
|
148
|
+
let d = (t) => {
|
|
149
|
+
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) => {
|
|
152
|
+
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
|
+
};
|
|
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,
|
|
160
|
+
style: e.style,
|
|
161
|
+
className: e.className,
|
|
162
|
+
slot: e.slot,
|
|
163
|
+
ref: i((e) => {
|
|
164
|
+
l.current = e, typeof n == "function" ? n(e) : n !== null && (n.current = e);
|
|
165
|
+
}, [n]),
|
|
166
|
+
src: e.src,
|
|
167
|
+
crossOrigin: e.crossOrigin,
|
|
168
|
+
preload: e.preload,
|
|
169
|
+
controls: e.controls,
|
|
170
|
+
muted: e.muted,
|
|
171
|
+
autoPlay: e.autoPlay,
|
|
172
|
+
loop: e.loop,
|
|
173
|
+
playsInline: e.playsInline,
|
|
174
|
+
disableRemotePlayback: e.disableRemotePlayback,
|
|
175
|
+
config: e.config,
|
|
176
|
+
onLoadStart: d,
|
|
177
|
+
onPlay: f
|
|
178
|
+
}, e.children);
|
|
179
|
+
});
|
|
180
|
+
w.displayName = "Player";
|
|
181
|
+
var T = w, te = r(() => import(
|
|
182
|
+
/* 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 = {
|
|
190
|
+
...ee,
|
|
191
|
+
...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) => {
|
|
197
|
+
var t;
|
|
198
|
+
_(!1), (t = o.onClickPreview) == null || t.call(o, e);
|
|
199
|
+
}, y = (e) => {
|
|
200
|
+
if (!e) return null;
|
|
201
|
+
let { light: n, playIcon: r, previewTabIndex: i, oEmbedUrl: a, previewAriaLabel: s } = o;
|
|
202
|
+
return /* @__PURE__ */ t.createElement(te, {
|
|
203
|
+
src: e,
|
|
204
|
+
light: n,
|
|
205
|
+
playIcon: r,
|
|
206
|
+
previewTabIndex: i,
|
|
207
|
+
previewAriaLabel: s,
|
|
208
|
+
oEmbedUrl: a,
|
|
209
|
+
onClickPreview: v
|
|
210
|
+
});
|
|
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,
|
|
222
|
+
style: p ? {
|
|
223
|
+
display: "block",
|
|
224
|
+
width: "100%",
|
|
225
|
+
height: "100%"
|
|
226
|
+
} : {
|
|
227
|
+
display: "block",
|
|
228
|
+
width: d,
|
|
229
|
+
height: f,
|
|
230
|
+
...c
|
|
231
|
+
},
|
|
232
|
+
config: m
|
|
233
|
+
});
|
|
234
|
+
}, x = h == null ? D : h, S = m === !1 ? D : n;
|
|
235
|
+
return /* @__PURE__ */ t.createElement(x, {
|
|
236
|
+
slot: l,
|
|
237
|
+
className: u,
|
|
238
|
+
style: {
|
|
239
|
+
width: f,
|
|
240
|
+
height: p,
|
|
241
|
+
...d
|
|
242
|
+
}
|
|
243
|
+
}, /* @__PURE__ */ t.createElement(S, { fallback: m }, g ? y(c) : b(c)));
|
|
244
|
+
});
|
|
245
|
+
return o.displayName = "ReactPlayer", o.addCustomPlayer = (e) => {
|
|
246
|
+
E.push(e);
|
|
247
|
+
}, o.removeCustomPlayers = () => {
|
|
248
|
+
E.length = 0;
|
|
249
|
+
}, o.canPlay = (t) => {
|
|
250
|
+
if (t) {
|
|
251
|
+
for (let n of [...E, ...e]) if (n.canPlay(t)) return !0;
|
|
252
|
+
}
|
|
253
|
+
return !1;
|
|
254
|
+
}, o.canEnablePIP = (t) => {
|
|
255
|
+
var n;
|
|
256
|
+
if (t) {
|
|
257
|
+
for (let r of [...E, ...e]) if (r.canPlay(t) && (n = r.canEnablePIP) != null && n.call(r)) return !0;
|
|
258
|
+
}
|
|
259
|
+
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) {
|
|
263
|
+
return e.indexOf(t.toLowerCase()) === 0 ? e : `${t.toLowerCase()}${e.substr(0, 1).toUpperCase()}${e.substr(1)}`;
|
|
264
|
+
}
|
|
265
|
+
function se(e) {
|
|
266
|
+
return !!(e && e.nodeType === 1 && "nodeName" in e && e.ownerDocument && e.ownerDocument.defaultView);
|
|
267
|
+
}
|
|
268
|
+
function ce(e) {
|
|
269
|
+
return !isNaN(parseFloat(e)) && isFinite(e) && Math.floor(e) == e;
|
|
270
|
+
}
|
|
271
|
+
function N(e) {
|
|
272
|
+
return /^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(e);
|
|
273
|
+
}
|
|
274
|
+
function P(e) {
|
|
275
|
+
return /^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/.test(e);
|
|
276
|
+
}
|
|
277
|
+
function le(e) {
|
|
278
|
+
let t = (e || "").match(/^(?:https?:)?(?:\/\/)?([^/?]+)/), n = (t && t[1] || "").replace("player.", "");
|
|
279
|
+
for (let e of [
|
|
280
|
+
".videoji.hk",
|
|
281
|
+
".vimeo.work",
|
|
282
|
+
".videoji.cn"
|
|
283
|
+
]) if (n.endsWith(e)) return n;
|
|
284
|
+
return "vimeo.com";
|
|
285
|
+
}
|
|
286
|
+
function F() {
|
|
287
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.id, n = e.url, r = t || n;
|
|
288
|
+
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:");
|
|
291
|
+
throw TypeError(t ? `“${t}” is not a valid video id.` : `“${r}” is not a vimeo.com url.`);
|
|
292
|
+
}
|
|
293
|
+
var I = function(e, t, n) {
|
|
294
|
+
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
|
+
return a.forEach((t) => {
|
|
296
|
+
e[r](t, n);
|
|
297
|
+
}), { cancel: () => a.forEach((t) => e[i](t, n)) };
|
|
298
|
+
};
|
|
299
|
+
function L(e) {
|
|
300
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : document;
|
|
301
|
+
if (!e || !t || typeof t.querySelectorAll != "function") return null;
|
|
302
|
+
let n = t.querySelectorAll("iframe");
|
|
303
|
+
for (let t = 0; t < n.length; t++) if (n[t] && n[t].contentWindow === e) return n[t];
|
|
304
|
+
return null;
|
|
305
|
+
}
|
|
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) {
|
|
310
|
+
return t = { exports: {} }, e(t, t.exports), t.exports;
|
|
311
|
+
}
|
|
312
|
+
(function(e) {
|
|
313
|
+
if (e.WeakMap) return;
|
|
314
|
+
var t = Object.prototype.hasOwnProperty, n = Object.defineProperty && function() {
|
|
315
|
+
try {
|
|
316
|
+
return Object.defineProperty({}, "x", { value: 1 }).x === 1;
|
|
317
|
+
} catch {}
|
|
318
|
+
}(), r = function(e, t, r) {
|
|
319
|
+
n ? Object.defineProperty(e, t, {
|
|
320
|
+
configurable: !0,
|
|
321
|
+
writable: !0,
|
|
322
|
+
value: r
|
|
323
|
+
}) : e[t] = r;
|
|
324
|
+
};
|
|
325
|
+
e.WeakMap = function() {
|
|
326
|
+
function e() {
|
|
327
|
+
if (this === void 0) throw TypeError("Constructor WeakMap requires 'new'");
|
|
328
|
+
if (r(this, "_id", a("_WeakMap")), arguments.length > 0) throw TypeError("WeakMap iterable is not supported");
|
|
329
|
+
}
|
|
330
|
+
r(e.prototype, "delete", function(e) {
|
|
331
|
+
if (n(this, "delete"), !i(e)) return !1;
|
|
332
|
+
var t = e[this._id];
|
|
333
|
+
return t && t[0] === e ? (delete e[this._id], !0) : !1;
|
|
334
|
+
}), r(e.prototype, "get", function(e) {
|
|
335
|
+
if (n(this, "get"), i(e)) {
|
|
336
|
+
var t = e[this._id];
|
|
337
|
+
if (t && t[0] === e) return t[1];
|
|
338
|
+
}
|
|
339
|
+
}), r(e.prototype, "has", function(e) {
|
|
340
|
+
if (n(this, "has"), !i(e)) return !1;
|
|
341
|
+
var t = e[this._id];
|
|
342
|
+
return !!(t && t[0] === e);
|
|
343
|
+
}), r(e.prototype, "set", function(e, t) {
|
|
344
|
+
if (n(this, "set"), !i(e)) throw TypeError("Invalid value used as weak map key");
|
|
345
|
+
var a = e[this._id];
|
|
346
|
+
return a && a[0] === e ? (a[1] = t, this) : (r(e, this._id, [e, t]), this);
|
|
347
|
+
});
|
|
348
|
+
function n(e, n) {
|
|
349
|
+
if (!i(e) || !t.call(e, "_id")) throw TypeError(n + " method called on incompatible receiver " + typeof e);
|
|
350
|
+
}
|
|
351
|
+
function a(e) {
|
|
352
|
+
return e + "_" + o() + "." + o();
|
|
353
|
+
}
|
|
354
|
+
function o() {
|
|
355
|
+
return Math.random().toString().substring(2);
|
|
356
|
+
}
|
|
357
|
+
return r(e, "_polyfill", !0), e;
|
|
358
|
+
}();
|
|
359
|
+
function i(e) {
|
|
360
|
+
return Object(e) === e;
|
|
361
|
+
}
|
|
362
|
+
})(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : R);
|
|
363
|
+
var z = fe(function(e) {
|
|
364
|
+
(function(t, n, r) {
|
|
365
|
+
n[t] = n[t] || r(), e.exports && (e.exports = n[t]);
|
|
366
|
+
})("Promise", R, function() {
|
|
367
|
+
var e, t, n, r = Object.prototype.toString, i = typeof setImmediate < "u" ? function(e) {
|
|
368
|
+
return setImmediate(e);
|
|
369
|
+
} : setTimeout;
|
|
370
|
+
try {
|
|
371
|
+
Object.defineProperty({}, "x", {}), e = function(e, t, n, r) {
|
|
372
|
+
return Object.defineProperty(e, t, {
|
|
373
|
+
value: n,
|
|
374
|
+
writable: !0,
|
|
375
|
+
configurable: r !== !1
|
|
376
|
+
});
|
|
377
|
+
};
|
|
378
|
+
} catch {
|
|
379
|
+
e = function(e, t, n) {
|
|
380
|
+
return e[t] = n, e;
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
n = function() {
|
|
384
|
+
var e, n, r;
|
|
385
|
+
function i(e, t) {
|
|
386
|
+
this.fn = e, this.self = t, this.next = void 0;
|
|
387
|
+
}
|
|
388
|
+
return {
|
|
389
|
+
add: function(t, a) {
|
|
390
|
+
r = new i(t, a), n ? n.next = r : e = r, n = r, r = void 0;
|
|
391
|
+
},
|
|
392
|
+
drain: function() {
|
|
393
|
+
var r = e;
|
|
394
|
+
for (e = n = t = void 0; r;) r.fn.call(r.self), r = r.next;
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
}();
|
|
398
|
+
function a(e, r) {
|
|
399
|
+
n.add(e, r), t || (t = i(n.drain));
|
|
400
|
+
}
|
|
401
|
+
function o(e) {
|
|
402
|
+
var t, n = typeof e;
|
|
403
|
+
return e != null && (n == "object" || n == "function") && (t = e.then), typeof t == "function" ? t : !1;
|
|
404
|
+
}
|
|
405
|
+
function s() {
|
|
406
|
+
for (var e = 0; e < this.chain.length; e++) c(this, this.state === 1 ? this.chain[e].success : this.chain[e].failure, this.chain[e]);
|
|
407
|
+
this.chain.length = 0;
|
|
408
|
+
}
|
|
409
|
+
function c(e, t, n) {
|
|
410
|
+
var r, i;
|
|
411
|
+
try {
|
|
412
|
+
t === !1 ? n.reject(e.msg) : (r = t === !0 ? e.msg : t.call(void 0, e.msg), r === n.promise ? n.reject(TypeError("Promise-chain cycle")) : (i = o(r)) ? i.call(r, n.resolve, n.reject) : n.resolve(r));
|
|
413
|
+
} catch (e) {
|
|
414
|
+
n.reject(e);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
function l(e) {
|
|
418
|
+
var t, n = this;
|
|
419
|
+
if (!n.triggered) {
|
|
420
|
+
n.triggered = !0, n.def && (n = n.def);
|
|
421
|
+
try {
|
|
422
|
+
(t = o(e)) ? a(function() {
|
|
423
|
+
var r = new f(n);
|
|
424
|
+
try {
|
|
425
|
+
t.call(e, function() {
|
|
426
|
+
l.apply(r, arguments);
|
|
427
|
+
}, function() {
|
|
428
|
+
u.apply(r, arguments);
|
|
429
|
+
});
|
|
430
|
+
} catch (e) {
|
|
431
|
+
u.call(r, e);
|
|
432
|
+
}
|
|
433
|
+
}) : (n.msg = e, n.state = 1, n.chain.length > 0 && a(s, n));
|
|
434
|
+
} catch (e) {
|
|
435
|
+
u.call(new f(n), e);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
function u(e) {
|
|
440
|
+
var t = this;
|
|
441
|
+
t.triggered || (t.triggered = !0, t.def && (t = t.def), t.msg = e, t.state = 2, t.chain.length > 0 && a(s, t));
|
|
442
|
+
}
|
|
443
|
+
function d(e, t, n, r) {
|
|
444
|
+
for (var i = 0; i < t.length; i++) (function(i) {
|
|
445
|
+
e.resolve(t[i]).then(function(e) {
|
|
446
|
+
n(i, e);
|
|
447
|
+
}, r);
|
|
448
|
+
})(i);
|
|
449
|
+
}
|
|
450
|
+
function f(e) {
|
|
451
|
+
this.def = e, this.triggered = !1;
|
|
452
|
+
}
|
|
453
|
+
function p(e) {
|
|
454
|
+
this.promise = e, this.state = 0, this.triggered = !1, this.chain = [], this.msg = void 0;
|
|
455
|
+
}
|
|
456
|
+
function m(e) {
|
|
457
|
+
if (typeof e != "function") throw TypeError("Not a function");
|
|
458
|
+
if (this.__NPO__ !== 0) throw TypeError("Not a promise");
|
|
459
|
+
this.__NPO__ = 1;
|
|
460
|
+
var t = new p(this);
|
|
461
|
+
this.then = function(e, n) {
|
|
462
|
+
var r = {
|
|
463
|
+
success: typeof e == "function" ? e : !0,
|
|
464
|
+
failure: typeof n == "function" ? n : !1
|
|
465
|
+
};
|
|
466
|
+
return r.promise = new this.constructor(function(e, t) {
|
|
467
|
+
if (typeof e != "function" || typeof t != "function") throw TypeError("Not a function");
|
|
468
|
+
r.resolve = e, r.reject = t;
|
|
469
|
+
}), t.chain.push(r), t.state !== 0 && a(s, t), r.promise;
|
|
470
|
+
}, this.catch = function(e) {
|
|
471
|
+
return this.then(void 0, e);
|
|
472
|
+
};
|
|
473
|
+
try {
|
|
474
|
+
e.call(void 0, function(e) {
|
|
475
|
+
l.call(t, e);
|
|
476
|
+
}, function(e) {
|
|
477
|
+
u.call(t, e);
|
|
478
|
+
});
|
|
479
|
+
} catch (e) {
|
|
480
|
+
u.call(t, e);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
var h = e({}, "constructor", m, !1);
|
|
484
|
+
return m.prototype = h, e(h, "__NPO__", 0, !1), e(m, "resolve", function(e) {
|
|
485
|
+
var t = this;
|
|
486
|
+
return e && typeof e == "object" && e.__NPO__ === 1 ? e : new t(function(t, n) {
|
|
487
|
+
if (typeof t != "function" || typeof n != "function") throw TypeError("Not a function");
|
|
488
|
+
t(e);
|
|
489
|
+
});
|
|
490
|
+
}), e(m, "reject", function(e) {
|
|
491
|
+
return new this(function(t, n) {
|
|
492
|
+
if (typeof t != "function" || typeof n != "function") throw TypeError("Not a function");
|
|
493
|
+
n(e);
|
|
494
|
+
});
|
|
495
|
+
}), e(m, "all", function(e) {
|
|
496
|
+
var t = this;
|
|
497
|
+
return r.call(e) == "[object Array]" ? e.length === 0 ? t.resolve([]) : new t(function(n, r) {
|
|
498
|
+
if (typeof n != "function" || typeof r != "function") throw TypeError("Not a function");
|
|
499
|
+
var i = e.length, a = Array(i), o = 0;
|
|
500
|
+
d(t, e, function(e, t) {
|
|
501
|
+
a[e] = t, ++o === i && n(a);
|
|
502
|
+
}, r);
|
|
503
|
+
}) : t.reject(TypeError("Not an array"));
|
|
504
|
+
}), e(m, "race", function(e) {
|
|
505
|
+
var t = this;
|
|
506
|
+
return r.call(e) == "[object Array]" ? new t(function(n, r) {
|
|
507
|
+
if (typeof n != "function" || typeof r != "function") throw TypeError("Not a function");
|
|
508
|
+
d(t, e, function(e, t) {
|
|
509
|
+
n(t);
|
|
510
|
+
}, r);
|
|
511
|
+
}) : t.reject(TypeError("Not an array"));
|
|
512
|
+
}), m;
|
|
513
|
+
});
|
|
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);
|
|
518
|
+
}
|
|
519
|
+
function H(e, t) {
|
|
520
|
+
return (B.get(e.element) || {})[t] || [];
|
|
521
|
+
}
|
|
522
|
+
function U(e, t, n) {
|
|
523
|
+
let r = B.get(e.element) || {};
|
|
524
|
+
if (!r[t]) return !0;
|
|
525
|
+
if (!n) return r[t] = [], B.set(e.element, r), !0;
|
|
526
|
+
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
|
+
}
|
|
529
|
+
function pe(e, t) {
|
|
530
|
+
let n = H(e, t);
|
|
531
|
+
if (n.length < 1) return !1;
|
|
532
|
+
let r = n.shift();
|
|
533
|
+
return U(e, t, r), r;
|
|
534
|
+
}
|
|
535
|
+
function me(e, t) {
|
|
536
|
+
let n = B.get(e);
|
|
537
|
+
B.set(t, n), B.delete(e);
|
|
538
|
+
}
|
|
539
|
+
function W(e) {
|
|
540
|
+
if (typeof e == "string") try {
|
|
541
|
+
e = JSON.parse(e);
|
|
542
|
+
} catch (e) {
|
|
543
|
+
return console.warn(e), {};
|
|
544
|
+
}
|
|
545
|
+
return e;
|
|
546
|
+
}
|
|
547
|
+
function G(e, t, n) {
|
|
548
|
+
if (!e.element.contentWindow || !e.element.contentWindow.postMessage) return;
|
|
549
|
+
let r = { method: t };
|
|
550
|
+
n !== void 0 && (r.value = n);
|
|
551
|
+
let i = parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/, "$1"));
|
|
552
|
+
i >= 8 && i < 10 && (r = JSON.stringify(r)), e.element.contentWindow.postMessage(r, e.origin);
|
|
553
|
+
}
|
|
554
|
+
function he(e, t) {
|
|
555
|
+
t = W(t);
|
|
556
|
+
let n = [], r;
|
|
557
|
+
if (t.event) t.event === "error" && H(e, t.data.method).forEach((n) => {
|
|
558
|
+
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;
|
|
561
|
+
else if (t.method) {
|
|
562
|
+
let i = pe(e, t.method);
|
|
563
|
+
i && (n.push(i), r = t.value);
|
|
564
|
+
}
|
|
565
|
+
n.forEach((t) => {
|
|
566
|
+
try {
|
|
567
|
+
if (typeof t == "function") {
|
|
568
|
+
t.call(e, r);
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
t.resolve(r);
|
|
572
|
+
} catch {}
|
|
573
|
+
});
|
|
574
|
+
}
|
|
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) {
|
|
577
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
578
|
+
return ge.reduce((t, n) => {
|
|
579
|
+
let r = e.getAttribute(`data-vimeo-${n}`);
|
|
580
|
+
return (r || r === "") && (t[n] = r === "" ? 1 : r), t;
|
|
581
|
+
}, t);
|
|
582
|
+
}
|
|
583
|
+
function q(e, t) {
|
|
584
|
+
let { html: n } = e;
|
|
585
|
+
if (!t) throw TypeError("An element must be provided");
|
|
586
|
+
if (t.getAttribute("data-vimeo-initialized") !== null) return t.querySelector("iframe");
|
|
587
|
+
let r = document.createElement("div");
|
|
588
|
+
return r.innerHTML = n, t.appendChild(r.firstChild), t.setAttribute("data-vimeo-initialized", "true"), t.querySelector("iframe");
|
|
589
|
+
}
|
|
590
|
+
function J(e) {
|
|
591
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 ? arguments[2] : void 0;
|
|
592
|
+
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)}`;
|
|
595
|
+
for (let e in t) t.hasOwnProperty(e) && (a += `&${e}=${encodeURIComponent(t[e])}`);
|
|
596
|
+
let o = "XDomainRequest" in window ? new XDomainRequest() : new XMLHttpRequest();
|
|
597
|
+
o.open("GET", a, !0), o.onload = function() {
|
|
598
|
+
if (o.status === 404) {
|
|
599
|
+
i(/* @__PURE__ */ Error(`“${e}” was not found.`));
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
if (o.status === 403) {
|
|
603
|
+
i(/* @__PURE__ */ Error(`“${e}” is not embeddable.`));
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
try {
|
|
607
|
+
let t = JSON.parse(o.responseText);
|
|
608
|
+
if (t.domain_status_code === 403) {
|
|
609
|
+
q(t, n), i(/* @__PURE__ */ Error(`“${e}” is not embeddable.`));
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
r(t);
|
|
613
|
+
} catch (e) {
|
|
614
|
+
i(e);
|
|
615
|
+
}
|
|
616
|
+
}, o.onerror = function() {
|
|
617
|
+
let e = o.status ? ` (${o.status})` : "";
|
|
618
|
+
i(/* @__PURE__ */ Error(`There was an error fetching the embed code from Vimeo${e}.`));
|
|
619
|
+
}, o.send();
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
function _e() {
|
|
623
|
+
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
|
+
"console" in window && console.error && console.error(`There was an error creating an embed: ${e}`);
|
|
625
|
+
};
|
|
626
|
+
t.forEach((e) => {
|
|
627
|
+
try {
|
|
628
|
+
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);
|
|
631
|
+
} catch (e) {
|
|
632
|
+
n(e);
|
|
633
|
+
}
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
function ve() {
|
|
637
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
|
|
638
|
+
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;
|
|
641
|
+
if (n) {
|
|
642
|
+
let e = n.parentElement;
|
|
643
|
+
e.style.paddingBottom = `${t.data.data[0].bottom}px`;
|
|
644
|
+
}
|
|
645
|
+
}));
|
|
646
|
+
}
|
|
647
|
+
function ye() {
|
|
648
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
|
|
649
|
+
window.VimeoSeoMetadataAppended || (window.VimeoSeoMetadataAppended = !0, window.addEventListener("message", (t) => {
|
|
650
|
+
if (!N(t.origin)) return;
|
|
651
|
+
let n = W(t.data);
|
|
652
|
+
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);
|
|
655
|
+
}));
|
|
656
|
+
}
|
|
657
|
+
function be() {
|
|
658
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
|
|
659
|
+
if (window.VimeoCheckedUrlTimeParam) return;
|
|
660
|
+
window.VimeoCheckedUrlTimeParam = !0;
|
|
661
|
+
let t = (e) => {
|
|
662
|
+
"console" in window && console.error && console.error(`There was an error getting video Id: ${e}`);
|
|
663
|
+
};
|
|
664
|
+
window.addEventListener("message", (n) => {
|
|
665
|
+
if (!N(n.origin)) return;
|
|
666
|
+
let r = W(n.data);
|
|
667
|
+
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);
|
|
671
|
+
e.getVideoId().then((t) => {
|
|
672
|
+
let n = RegExp(`[?&]vimeo_t_${t}=([^&#]*)`).exec(window.location.href);
|
|
673
|
+
if (n && n[1]) {
|
|
674
|
+
let t = decodeURI(n[1]);
|
|
675
|
+
e.setCurrentTime(t);
|
|
676
|
+
}
|
|
677
|
+
}).catch(t);
|
|
678
|
+
}
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
function xe() {
|
|
682
|
+
window.VimeoDRMEmbedsUpdated || (window.VimeoDRMEmbedsUpdated = !0, window.addEventListener("message", (e) => {
|
|
683
|
+
if (!N(e.origin)) return;
|
|
684
|
+
let t = W(e.data);
|
|
685
|
+
if (!t || t.event !== "drminitfailed") return;
|
|
686
|
+
let n = e.source ? L(e.source) : null;
|
|
687
|
+
if (!n) return;
|
|
688
|
+
let r = n.getAttribute("allow") || "";
|
|
689
|
+
if (!r.includes("encrypted-media")) {
|
|
690
|
+
n.setAttribute("allow", `${r}; encrypted-media`);
|
|
691
|
+
let e = new URL(n.getAttribute("src"));
|
|
692
|
+
e.searchParams.set("forcereload", "drm"), n.setAttribute("src", e.toString());
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
}));
|
|
696
|
+
}
|
|
697
|
+
function Se() {
|
|
698
|
+
let e = function() {
|
|
699
|
+
let e, t = [
|
|
700
|
+
[
|
|
701
|
+
"requestFullscreen",
|
|
702
|
+
"exitFullscreen",
|
|
703
|
+
"fullscreenElement",
|
|
704
|
+
"fullscreenEnabled",
|
|
705
|
+
"fullscreenchange",
|
|
706
|
+
"fullscreenerror"
|
|
707
|
+
],
|
|
708
|
+
[
|
|
709
|
+
"webkitRequestFullscreen",
|
|
710
|
+
"webkitExitFullscreen",
|
|
711
|
+
"webkitFullscreenElement",
|
|
712
|
+
"webkitFullscreenEnabled",
|
|
713
|
+
"webkitfullscreenchange",
|
|
714
|
+
"webkitfullscreenerror"
|
|
715
|
+
],
|
|
716
|
+
[
|
|
717
|
+
"webkitRequestFullScreen",
|
|
718
|
+
"webkitCancelFullScreen",
|
|
719
|
+
"webkitCurrentFullScreenElement",
|
|
720
|
+
"webkitCancelFullScreen",
|
|
721
|
+
"webkitfullscreenchange",
|
|
722
|
+
"webkitfullscreenerror"
|
|
723
|
+
],
|
|
724
|
+
[
|
|
725
|
+
"mozRequestFullScreen",
|
|
726
|
+
"mozCancelFullScreen",
|
|
727
|
+
"mozFullScreenElement",
|
|
728
|
+
"mozFullScreenEnabled",
|
|
729
|
+
"mozfullscreenchange",
|
|
730
|
+
"mozfullscreenerror"
|
|
731
|
+
],
|
|
732
|
+
[
|
|
733
|
+
"msRequestFullscreen",
|
|
734
|
+
"msExitFullscreen",
|
|
735
|
+
"msFullscreenElement",
|
|
736
|
+
"msFullscreenEnabled",
|
|
737
|
+
"MSFullscreenChange",
|
|
738
|
+
"MSFullscreenError"
|
|
739
|
+
]
|
|
740
|
+
], n = 0, r = t.length, i = {};
|
|
741
|
+
for (; n < r; n++) if (e = t[n], e && e[1] in document) {
|
|
742
|
+
for (n = 0; n < e.length; n++) i[t[0][n]] = e[n];
|
|
743
|
+
return i;
|
|
744
|
+
}
|
|
745
|
+
return !1;
|
|
746
|
+
}(), t = {
|
|
747
|
+
fullscreenchange: e.fullscreenchange,
|
|
748
|
+
fullscreenerror: e.fullscreenerror
|
|
749
|
+
}, n = {
|
|
750
|
+
request(t) {
|
|
751
|
+
return new Promise((r, i) => {
|
|
752
|
+
let a = function() {
|
|
753
|
+
n.off("fullscreenchange", a), r();
|
|
754
|
+
};
|
|
755
|
+
n.on("fullscreenchange", a), t = t || document.documentElement;
|
|
756
|
+
let o = t[e.requestFullscreen]();
|
|
757
|
+
o instanceof Promise && o.then(a).catch(i);
|
|
758
|
+
});
|
|
759
|
+
},
|
|
760
|
+
exit() {
|
|
761
|
+
return new Promise((t, r) => {
|
|
762
|
+
if (!n.isFullscreen) {
|
|
763
|
+
t();
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
766
|
+
let i = function() {
|
|
767
|
+
n.off("fullscreenchange", i), t();
|
|
768
|
+
};
|
|
769
|
+
n.on("fullscreenchange", i);
|
|
770
|
+
let a = document[e.exitFullscreen]();
|
|
771
|
+
a instanceof Promise && a.then(i).catch(r);
|
|
772
|
+
});
|
|
773
|
+
},
|
|
774
|
+
on(e, n) {
|
|
775
|
+
let r = t[e];
|
|
776
|
+
r && document.addEventListener(r, n);
|
|
777
|
+
},
|
|
778
|
+
off(e, n) {
|
|
779
|
+
let r = t[e];
|
|
780
|
+
r && document.removeEventListener(r, n);
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
return Object.defineProperties(n, {
|
|
784
|
+
isFullscreen: { get() {
|
|
785
|
+
return !!document[e.fullscreenElement];
|
|
786
|
+
} },
|
|
787
|
+
element: {
|
|
788
|
+
enumerable: !0,
|
|
789
|
+
get() {
|
|
790
|
+
return document[e.fullscreenElement];
|
|
791
|
+
}
|
|
792
|
+
},
|
|
793
|
+
isEnabled: {
|
|
794
|
+
enumerable: !0,
|
|
795
|
+
get() {
|
|
796
|
+
return !!document[e.fullscreenEnabled];
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
}), n;
|
|
800
|
+
}
|
|
801
|
+
var Ce = {
|
|
802
|
+
role: "viewer",
|
|
803
|
+
autoPlayMuted: !0,
|
|
804
|
+
allowedDrift: .3,
|
|
805
|
+
maxAllowedDrift: 1,
|
|
806
|
+
minCheckInterval: .1,
|
|
807
|
+
maxRateAdjustment: .2,
|
|
808
|
+
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) => {
|
|
813
|
+
if (this.speedAdjustment === t) return;
|
|
814
|
+
let n = await e.getPlaybackRate() - this.speedAdjustment + t;
|
|
815
|
+
this.log(`New playbackRate: ${n}`), await e.setPlaybackRate(n), this.speedAdjustment = t;
|
|
816
|
+
}), this.logger = i, this.init(n, t, {
|
|
817
|
+
...Ce,
|
|
818
|
+
...r
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
disconnect() {
|
|
822
|
+
this.dispatchEvent(new Event("disconnect"));
|
|
823
|
+
}
|
|
824
|
+
async init(e, t, n) {
|
|
825
|
+
if (await this.waitForTOReadyState(e, "open"), n.role === "viewer") {
|
|
826
|
+
await this.updatePlayer(e, t, n);
|
|
827
|
+
let r = I(e, "change", () => this.updatePlayer(e, t, n)), i = this.maintainPlaybackPosition(e, t, n);
|
|
828
|
+
this.addEventListener("disconnect", () => {
|
|
829
|
+
i.cancel(), r.cancel();
|
|
830
|
+
});
|
|
831
|
+
} else {
|
|
832
|
+
await this.updateTimingObject(e, t);
|
|
833
|
+
let n = I(t, [
|
|
834
|
+
"seeked",
|
|
835
|
+
"play",
|
|
836
|
+
"pause",
|
|
837
|
+
"ratechange"
|
|
838
|
+
], () => this.updateTimingObject(e, t), "on", "off");
|
|
839
|
+
this.addEventListener("disconnect", () => n.cancel());
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
async updateTimingObject(e, t) {
|
|
843
|
+
let [n, r, i] = await Promise.all([
|
|
844
|
+
t.getCurrentTime(),
|
|
845
|
+
t.getPaused(),
|
|
846
|
+
t.getPlaybackRate()
|
|
847
|
+
]);
|
|
848
|
+
e.update({
|
|
849
|
+
position: n,
|
|
850
|
+
velocity: r ? 0 : i
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
async updatePlayer(e, t, n) {
|
|
854
|
+
let { position: r, velocity: i } = e.query();
|
|
855
|
+
typeof r == "number" && t.setCurrentTime(r), typeof i == "number" && (i === 0 ? await t.getPaused() === !1 && t.pause() : i > 0 && (await t.getPaused() === !0 && (await t.play().catch(async (e) => {
|
|
856
|
+
e.name === "NotAllowedError" && n.autoPlayMuted && (await t.setMuted(!0), await t.play().catch((e) => console.error("Couldn't play the video from TimingSrcConnector. Error:", e)));
|
|
857
|
+
}), this.updatePlayer(e, t, n)), await t.getPlaybackRate() !== i && t.setPlaybackRate(i)));
|
|
858
|
+
}
|
|
859
|
+
maintainPlaybackPosition(e, t, n) {
|
|
860
|
+
let { allowedDrift: r, maxAllowedDrift: i, minCheckInterval: a, maxRateAdjustment: o, maxTimeToCatchUp: s } = n, c = Math.min(s, Math.max(a, i)) * 1e3, l = async () => {
|
|
861
|
+
if (e.query().velocity === 0 || await t.getPaused() === !0) return;
|
|
862
|
+
let n = e.query().position - await t.getCurrentTime(), a = Math.abs(n);
|
|
863
|
+
if (this.log(`Drift: ${n}`), a > i) await this.adjustSpeed(t, 0), t.setCurrentTime(e.query().position), this.log("Resync by currentTime");
|
|
864
|
+
else if (a > r) {
|
|
865
|
+
let e = a / s, r = o, i = e < r ? (r - e) / 2 : r;
|
|
866
|
+
await this.adjustSpeed(t, i * Math.sign(n)), this.log("Resync by playbackRate");
|
|
867
|
+
}
|
|
868
|
+
}, u = setInterval(() => l(), c);
|
|
869
|
+
return { cancel: () => clearInterval(u) };
|
|
870
|
+
}
|
|
871
|
+
log(e) {
|
|
872
|
+
var t;
|
|
873
|
+
(t = this.logger) == null || t.call(this, `TimingSrcConnector: ${e}`);
|
|
874
|
+
}
|
|
875
|
+
waitForTOReadyState(e, t) {
|
|
876
|
+
return new Promise((n) => {
|
|
877
|
+
let r = () => {
|
|
878
|
+
e.readyState === t ? n() : e.addEventListener("readystatechange", r, { once: !0 });
|
|
879
|
+
};
|
|
880
|
+
r();
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
}, Y = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), Z = {}, Q = class {
|
|
884
|
+
constructor(e) {
|
|
885
|
+
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 (e.nodeName !== "IFRAME") {
|
|
888
|
+
let t = e.querySelector("iframe");
|
|
889
|
+
t && (e = t);
|
|
890
|
+
}
|
|
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);
|
|
893
|
+
this._window = e.ownerDocument.defaultView, this.element = e, this.origin = "*";
|
|
894
|
+
let n = new z((n, r) => {
|
|
895
|
+
if (this._onMessage = (e) => {
|
|
896
|
+
if (!N(e.origin) || this.element.contentWindow !== e.source) return;
|
|
897
|
+
this.origin === "*" && (this.origin = e.origin);
|
|
898
|
+
let t = W(e.data);
|
|
899
|
+
if (t && t.event === "error" && t.data && t.data.method === "ready") {
|
|
900
|
+
let e = Error(t.data.message);
|
|
901
|
+
e.name = t.data.name, r(e);
|
|
902
|
+
return;
|
|
903
|
+
}
|
|
904
|
+
let i = t && t.event === "ready", a = t && t.method === "ping";
|
|
905
|
+
if (i || a) {
|
|
906
|
+
this.element.setAttribute("data-ready", "true"), n();
|
|
907
|
+
return;
|
|
908
|
+
}
|
|
909
|
+
he(this, t);
|
|
910
|
+
}, 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;
|
|
915
|
+
}).catch(r);
|
|
916
|
+
}
|
|
917
|
+
});
|
|
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();
|
|
920
|
+
this.fullscreenchangeHandler = () => {
|
|
921
|
+
Z.isFullscreen ? V(this, "event:exitFullscreen", e) : U(this, "event:exitFullscreen", e), this.ready().then(() => {
|
|
922
|
+
G(this, "fullscreenchange", Z.isFullscreen);
|
|
923
|
+
});
|
|
924
|
+
}, Z.on("fullscreenchange", this.fullscreenchangeHandler);
|
|
925
|
+
}
|
|
926
|
+
return this;
|
|
927
|
+
}
|
|
928
|
+
static isVimeoUrl(e) {
|
|
929
|
+
return N(e);
|
|
930
|
+
}
|
|
931
|
+
callMethod(e) {
|
|
932
|
+
var t = [...arguments].slice(1);
|
|
933
|
+
if (e == null) throw TypeError("You must pass a method name.");
|
|
934
|
+
return new z((n, r) => this.ready().then(() => {
|
|
935
|
+
V(this, e, {
|
|
936
|
+
resolve: n,
|
|
937
|
+
reject: r
|
|
938
|
+
}), t.length === 0 ? t = {} : t.length === 1 && (t = t[0]), G(this, e, t);
|
|
939
|
+
}).catch(r));
|
|
940
|
+
}
|
|
941
|
+
get(e) {
|
|
942
|
+
return new z((t, n) => (e = M(e, "get"), this.ready().then(() => {
|
|
943
|
+
V(this, e, {
|
|
944
|
+
resolve: t,
|
|
945
|
+
reject: n
|
|
946
|
+
}), G(this, e);
|
|
947
|
+
}).catch(n)));
|
|
948
|
+
}
|
|
949
|
+
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.");
|
|
952
|
+
return this.ready().then(() => {
|
|
953
|
+
V(this, e, {
|
|
954
|
+
resolve: n,
|
|
955
|
+
reject: r
|
|
956
|
+
}), G(this, e, t);
|
|
957
|
+
}).catch(r);
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
on(e, t) {
|
|
961
|
+
if (!e) throw TypeError("You must pass an event name.");
|
|
962
|
+
if (!t) throw TypeError("You must pass a callback function.");
|
|
963
|
+
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
|
+
}
|
|
966
|
+
off(e, t) {
|
|
967
|
+
if (!e) throw TypeError("You must pass an event name.");
|
|
968
|
+
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
|
+
}
|
|
971
|
+
loadVideo(e) {
|
|
972
|
+
return this.callMethod("loadVideo", e);
|
|
973
|
+
}
|
|
974
|
+
ready() {
|
|
975
|
+
let e = X.get(this) || new z((e, t) => {
|
|
976
|
+
t(/* @__PURE__ */ Error("Unknown player. Probably unloaded."));
|
|
977
|
+
});
|
|
978
|
+
return z.resolve(e);
|
|
979
|
+
}
|
|
980
|
+
addCuePoint(e) {
|
|
981
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
982
|
+
return this.callMethod("addCuePoint", {
|
|
983
|
+
time: e,
|
|
984
|
+
data: t
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
removeCuePoint(e) {
|
|
988
|
+
return this.callMethod("removeCuePoint", e);
|
|
989
|
+
}
|
|
990
|
+
enableTextTrack(e) {
|
|
991
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0;
|
|
992
|
+
if (!e) throw TypeError("You must pass a language.");
|
|
993
|
+
return this.callMethod("enableTextTrack", {
|
|
994
|
+
language: e,
|
|
995
|
+
kind: t,
|
|
996
|
+
showing: n
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
disableTextTrack() {
|
|
1000
|
+
return this.callMethod("disableTextTrack");
|
|
1001
|
+
}
|
|
1002
|
+
selectAudioTrack(e, t) {
|
|
1003
|
+
if (!e) throw TypeError("You must pass a language.");
|
|
1004
|
+
return this.callMethod("selectAudioTrack", {
|
|
1005
|
+
language: e,
|
|
1006
|
+
kind: t
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
selectDefaultAudioTrack() {
|
|
1010
|
+
return this.callMethod("selectDefaultAudioTrack");
|
|
1011
|
+
}
|
|
1012
|
+
pause() {
|
|
1013
|
+
return this.callMethod("pause");
|
|
1014
|
+
}
|
|
1015
|
+
play() {
|
|
1016
|
+
return this.callMethod("play");
|
|
1017
|
+
}
|
|
1018
|
+
requestFullscreen() {
|
|
1019
|
+
return Z.isEnabled ? Z.request(this.element) : this.callMethod("requestFullscreen");
|
|
1020
|
+
}
|
|
1021
|
+
exitFullscreen() {
|
|
1022
|
+
return Z.isEnabled ? Z.exit() : this.callMethod("exitFullscreen");
|
|
1023
|
+
}
|
|
1024
|
+
getFullscreen() {
|
|
1025
|
+
return Z.isEnabled ? z.resolve(Z.isFullscreen) : this.get("fullscreen");
|
|
1026
|
+
}
|
|
1027
|
+
requestPictureInPicture() {
|
|
1028
|
+
return this.callMethod("requestPictureInPicture");
|
|
1029
|
+
}
|
|
1030
|
+
exitPictureInPicture() {
|
|
1031
|
+
return this.callMethod("exitPictureInPicture");
|
|
1032
|
+
}
|
|
1033
|
+
getPictureInPicture() {
|
|
1034
|
+
return this.get("pictureInPicture");
|
|
1035
|
+
}
|
|
1036
|
+
remotePlaybackPrompt() {
|
|
1037
|
+
return this.callMethod("remotePlaybackPrompt");
|
|
1038
|
+
}
|
|
1039
|
+
unload() {
|
|
1040
|
+
return this.callMethod("unload");
|
|
1041
|
+
}
|
|
1042
|
+
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) {
|
|
1045
|
+
this.element.removeAttribute("data-vimeo-initialized");
|
|
1046
|
+
let e = this.element.querySelector("iframe");
|
|
1047
|
+
e && e.parentNode && (e.parentNode.parentNode && this._originalElement && this._originalElement !== e.parentNode ? e.parentNode.parentNode.removeChild(e.parentNode) : e.parentNode.removeChild(e));
|
|
1048
|
+
}
|
|
1049
|
+
this._window.removeEventListener("message", this._onMessage), Z.isEnabled && Z.off("fullscreenchange", this.fullscreenchangeHandler), e();
|
|
1050
|
+
});
|
|
1051
|
+
}
|
|
1052
|
+
getAutopause() {
|
|
1053
|
+
return this.get("autopause");
|
|
1054
|
+
}
|
|
1055
|
+
setAutopause(e) {
|
|
1056
|
+
return this.set("autopause", e);
|
|
1057
|
+
}
|
|
1058
|
+
getBuffered() {
|
|
1059
|
+
return this.get("buffered");
|
|
1060
|
+
}
|
|
1061
|
+
getCameraProps() {
|
|
1062
|
+
return this.get("cameraProps");
|
|
1063
|
+
}
|
|
1064
|
+
setCameraProps(e) {
|
|
1065
|
+
return this.set("cameraProps", e);
|
|
1066
|
+
}
|
|
1067
|
+
getChapters() {
|
|
1068
|
+
return this.get("chapters");
|
|
1069
|
+
}
|
|
1070
|
+
getCurrentChapter() {
|
|
1071
|
+
return this.get("currentChapter");
|
|
1072
|
+
}
|
|
1073
|
+
getColor() {
|
|
1074
|
+
return this.get("color");
|
|
1075
|
+
}
|
|
1076
|
+
getColors() {
|
|
1077
|
+
return z.all([
|
|
1078
|
+
this.get("colorOne"),
|
|
1079
|
+
this.get("colorTwo"),
|
|
1080
|
+
this.get("colorThree"),
|
|
1081
|
+
this.get("colorFour")
|
|
1082
|
+
]);
|
|
1083
|
+
}
|
|
1084
|
+
setColor(e) {
|
|
1085
|
+
return this.set("color", e);
|
|
1086
|
+
}
|
|
1087
|
+
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 = [
|
|
1090
|
+
e[0] ? this.set("colorOne", e[0]) : t,
|
|
1091
|
+
e[1] ? this.set("colorTwo", e[1]) : t,
|
|
1092
|
+
e[2] ? this.set("colorThree", e[2]) : t,
|
|
1093
|
+
e[3] ? this.set("colorFour", e[3]) : t
|
|
1094
|
+
];
|
|
1095
|
+
return z.all(n);
|
|
1096
|
+
}
|
|
1097
|
+
getCuePoints() {
|
|
1098
|
+
return this.get("cuePoints");
|
|
1099
|
+
}
|
|
1100
|
+
getCurrentTime() {
|
|
1101
|
+
return this.get("currentTime");
|
|
1102
|
+
}
|
|
1103
|
+
setCurrentTime(e) {
|
|
1104
|
+
return this.set("currentTime", e);
|
|
1105
|
+
}
|
|
1106
|
+
getDuration() {
|
|
1107
|
+
return this.get("duration");
|
|
1108
|
+
}
|
|
1109
|
+
getEnded() {
|
|
1110
|
+
return this.get("ended");
|
|
1111
|
+
}
|
|
1112
|
+
getLoop() {
|
|
1113
|
+
return this.get("loop");
|
|
1114
|
+
}
|
|
1115
|
+
setLoop(e) {
|
|
1116
|
+
return this.set("loop", e);
|
|
1117
|
+
}
|
|
1118
|
+
setMuted(e) {
|
|
1119
|
+
return this.set("muted", e);
|
|
1120
|
+
}
|
|
1121
|
+
getMuted() {
|
|
1122
|
+
return this.get("muted");
|
|
1123
|
+
}
|
|
1124
|
+
getPaused() {
|
|
1125
|
+
return this.get("paused");
|
|
1126
|
+
}
|
|
1127
|
+
getPlaybackRate() {
|
|
1128
|
+
return this.get("playbackRate");
|
|
1129
|
+
}
|
|
1130
|
+
setPlaybackRate(e) {
|
|
1131
|
+
return this.set("playbackRate", e);
|
|
1132
|
+
}
|
|
1133
|
+
getPlayed() {
|
|
1134
|
+
return this.get("played");
|
|
1135
|
+
}
|
|
1136
|
+
getQualities() {
|
|
1137
|
+
return this.get("qualities");
|
|
1138
|
+
}
|
|
1139
|
+
getQuality() {
|
|
1140
|
+
return this.get("quality");
|
|
1141
|
+
}
|
|
1142
|
+
setQuality(e) {
|
|
1143
|
+
return this.set("quality", e);
|
|
1144
|
+
}
|
|
1145
|
+
getRemotePlaybackAvailability() {
|
|
1146
|
+
return this.get("remotePlaybackAvailability");
|
|
1147
|
+
}
|
|
1148
|
+
getRemotePlaybackState() {
|
|
1149
|
+
return this.get("remotePlaybackState");
|
|
1150
|
+
}
|
|
1151
|
+
getSeekable() {
|
|
1152
|
+
return this.get("seekable");
|
|
1153
|
+
}
|
|
1154
|
+
getSeeking() {
|
|
1155
|
+
return this.get("seeking");
|
|
1156
|
+
}
|
|
1157
|
+
getTextTracks() {
|
|
1158
|
+
return this.get("textTracks");
|
|
1159
|
+
}
|
|
1160
|
+
getAudioTracks() {
|
|
1161
|
+
return this.get("audioTracks");
|
|
1162
|
+
}
|
|
1163
|
+
getEnabledAudioTrack() {
|
|
1164
|
+
return this.get("enabledAudioTrack");
|
|
1165
|
+
}
|
|
1166
|
+
getDefaultAudioTrack() {
|
|
1167
|
+
return this.get("defaultAudioTrack");
|
|
1168
|
+
}
|
|
1169
|
+
getVideoEmbedCode() {
|
|
1170
|
+
return this.get("videoEmbedCode");
|
|
1171
|
+
}
|
|
1172
|
+
getVideoId() {
|
|
1173
|
+
return this.get("videoId");
|
|
1174
|
+
}
|
|
1175
|
+
getVideoTitle() {
|
|
1176
|
+
return this.get("videoTitle");
|
|
1177
|
+
}
|
|
1178
|
+
getVideoWidth() {
|
|
1179
|
+
return this.get("videoWidth");
|
|
1180
|
+
}
|
|
1181
|
+
getVideoHeight() {
|
|
1182
|
+
return this.get("videoHeight");
|
|
1183
|
+
}
|
|
1184
|
+
getVideoUrl() {
|
|
1185
|
+
return this.get("videoUrl");
|
|
1186
|
+
}
|
|
1187
|
+
getVolume() {
|
|
1188
|
+
return this.get("volume");
|
|
1189
|
+
}
|
|
1190
|
+
setVolume(e) {
|
|
1191
|
+
return this.set("volume", e);
|
|
1192
|
+
}
|
|
1193
|
+
async setTimingSrc(e, t) {
|
|
1194
|
+
if (!e) throw TypeError("A Timing Object must be provided.");
|
|
1195
|
+
await this.ready();
|
|
1196
|
+
let n = new we(this, e, t);
|
|
1197
|
+
return G(this, "notifyTimingObjectConnect"), n.addEventListener("disconnect", () => G(this, "notifyTimingObjectDisconnect")), n;
|
|
1198
|
+
}
|
|
1199
|
+
};
|
|
1200
|
+
j || (Z = Se(), _e(), ve(), ye(), be(), xe());
|
|
1201
|
+
//#endregion
|
|
1202
|
+
//#region src/ui/media/EmbeddedVideo/VimeoPlayer.tsx
|
|
1203
|
+
var Te = (e) => {
|
|
1204
|
+
let t = e.match(/vimeo\.com\/(video\/|event\/)?(\d+)(?:\/([a-zA-Z0-9]+))?/);
|
|
1205
|
+
if (!t) {
|
|
1206
|
+
let t = e.match(/player\.vimeo\.com\/video\/(\d+)/);
|
|
1207
|
+
return t ? { videoId: t[1] } : null;
|
|
1208
|
+
}
|
|
1209
|
+
let n = t[2], r = t[3];
|
|
1210
|
+
try {
|
|
1211
|
+
r = new URL(e).searchParams.get("h") || r;
|
|
1212
|
+
} catch {}
|
|
1213
|
+
return {
|
|
1214
|
+
videoId: n,
|
|
1215
|
+
privacyHash: r || void 0
|
|
1216
|
+
};
|
|
1217
|
+
}, Ee = (e, t) => {
|
|
1218
|
+
let n = new URLSearchParams();
|
|
1219
|
+
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"));
|
|
1227
|
+
return;
|
|
1228
|
+
}
|
|
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;
|
|
1234
|
+
};
|
|
1235
|
+
}, [e]), /* @__PURE__ */ c("div", {
|
|
1236
|
+
ref: d,
|
|
1237
|
+
style: {
|
|
1238
|
+
width: n,
|
|
1239
|
+
height: r,
|
|
1240
|
+
maxWidth: "100%",
|
|
1241
|
+
maxHeight: "100%"
|
|
1242
|
+
}
|
|
1243
|
+
});
|
|
1244
|
+
}, Oe = (e) => /vimeo\.com/.test(e), $ = {
|
|
1245
|
+
width: "100%",
|
|
1246
|
+
aspectRatio: "16 / 9"
|
|
1247
|
+
}, ke = ({ url: e, label: t }) => {
|
|
1248
|
+
let [n, r] = s(!1);
|
|
1249
|
+
return Oe(e) ? /* @__PURE__ */ c("div", {
|
|
1250
|
+
style: $,
|
|
1251
|
+
children: /* @__PURE__ */ c(De, {
|
|
1252
|
+
src: e,
|
|
1253
|
+
title: t,
|
|
1254
|
+
width: "100%",
|
|
1255
|
+
height: "100%",
|
|
1256
|
+
onPlay: () => r(!0),
|
|
1257
|
+
onPause: () => r(!1)
|
|
1258
|
+
})
|
|
1259
|
+
}) : /* @__PURE__ */ c("div", {
|
|
1260
|
+
style: $,
|
|
1261
|
+
children: /* @__PURE__ */ c(ie, {
|
|
1262
|
+
src: e,
|
|
1263
|
+
controls: !0,
|
|
1264
|
+
width: "100%",
|
|
1265
|
+
height: "100%",
|
|
1266
|
+
playing: n,
|
|
1267
|
+
onPlay: () => r(!0),
|
|
1268
|
+
onPause: () => r(!1),
|
|
1269
|
+
config: { youtube: { referrerpolicy: "strict-origin-when-cross-origin" } },
|
|
1270
|
+
style: { maxWidth: "100%" }
|
|
1271
|
+
})
|
|
1272
|
+
});
|
|
1273
|
+
};
|
|
1274
|
+
//#endregion
|
|
1275
|
+
export { ke as EmbeddedVideoPlayer };
|
|
1276
|
+
|
|
1277
|
+
//# sourceMappingURL=EmbeddedVideoPlayer-SaMMfDIW.js.map
|