@sapia-ai/chatbot-v3 1.0.0 → 1.0.2
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 → EmbeddedVideoPlayer-CNcds-dW.js} +283 -282
- package/dist/Preview-Dmns6UWL.js +84 -0
- package/dist/api.js +1 -1
- package/dist/{dist-DGBYKC8c.js → dist-B9SbMqZU.js} +2693 -2693
- package/dist/embed/createChatbot.d.ts +2 -0
- package/dist/{fix-webm-duration-BW9Fbdzt.js → fix-webm-duration-BWL-ZRDX.js} +2 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +15479 -2067
- package/dist/jsx-runtime-8QqjHL5t.js +24 -0
- package/dist/messages-Czlp86gl.js +1963 -0
- package/dist/react-B0K-sClg.js +295 -0
- package/dist/{react-Bujo1aK5.js → react-ChCcxVnw.js} +90 -89
- package/dist/{react-GXf8sbzf.js → react-DJysvNxz.js} +72 -71
- package/dist/{react-BVzcquey.js → react-Dbs-sPBo.js} +93 -92
- package/dist/{react-lp7yfM94.js → react-NauLB_WU.js} +91 -90
- package/dist/{react-BGJ7Szvq.js → react-QrtEtv1G.js} +76 -74
- package/dist/{react-BrCGR7Ca.js → react-be7q6yw_.js} +312 -310
- package/dist/{react-CRTg4gz8.js → react-czRIxT0g.js} +85 -84
- package/dist/{react-BMxM8TWJ.js → react-dE7BdGuR.js} +49 -48
- package/dist-umd/sapia-chatbot.umd.js +1 -1
- package/package.json +14 -25
- package/dist/EmbeddedVideoPlayer-SaMMfDIW.js.map +0 -1
- package/dist/Preview-Db-hgkTh.js +0 -83
- package/dist/Preview-Db-hgkTh.js.map +0 -1
- package/dist/dash.all.min-DZ1yEcJk.js.map +0 -1
- package/dist/dist-BSi28_cP.js.map +0 -1
- package/dist/dist-DGBYKC8c.js.map +0 -1
- package/dist/dist-FvHBWiRa.js.map +0 -1
- package/dist/fix-webm-duration-BW9Fbdzt.js.map +0 -1
- package/dist/hls-mBncGwsE.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/max-Btet1snX.js.map +0 -1
- package/dist/messages-C4jqrtSG.js +0 -187
- package/dist/messages-C4jqrtSG.js.map +0 -1
- package/dist/react-BGJ7Szvq.js.map +0 -1
- package/dist/react-BMxM8TWJ.js.map +0 -1
- package/dist/react-BVzcquey.js.map +0 -1
- package/dist/react-BrCGR7Ca.js.map +0 -1
- package/dist/react-Bujo1aK5.js.map +0 -1
- package/dist/react-CRTg4gz8.js.map +0 -1
- package/dist/react-GXf8sbzf.js.map +0 -1
- package/dist/react-lp7yfM94.js.map +0 -1
- package/dist/sapia-chatbot.css +0 -3
- package/dist-umd/sapia-chatbot.umd.js.map +0 -1
|
@@ -1,125 +1,126 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
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
|
|
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" &&
|
|
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
|
-
},
|
|
12
|
-
html: (e) =>
|
|
13
|
-
hls: (e) =>
|
|
14
|
-
dash: (e) =>
|
|
15
|
-
mux: (e) =>
|
|
16
|
-
youtube: (e) =>
|
|
17
|
-
vimeo: (e) =>
|
|
18
|
-
wistia: (e) =>
|
|
19
|
-
spotify: (e) =>
|
|
20
|
-
twitch: (e) =>
|
|
21
|
-
tiktok: (e) =>
|
|
22
|
-
},
|
|
23
|
-
let
|
|
24
|
-
return /* @__PURE__ */
|
|
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:
|
|
27
|
+
ref: t
|
|
27
28
|
}, e.children);
|
|
28
|
-
}),
|
|
29
|
+
}), y = [
|
|
29
30
|
{
|
|
30
31
|
key: "hls",
|
|
31
32
|
name: "hls.js",
|
|
32
|
-
canPlay:
|
|
33
|
+
canPlay: _.hls,
|
|
33
34
|
canEnablePIP: () => !0,
|
|
34
|
-
player:
|
|
35
|
+
player: (0, i.lazy)(() => import(
|
|
35
36
|
/* webpackChunkName: 'reactPlayerHls' */
|
|
36
|
-
"./react-
|
|
37
|
+
"./react-QrtEtv1G.js"
|
|
37
38
|
))
|
|
38
39
|
},
|
|
39
40
|
{
|
|
40
41
|
key: "dash",
|
|
41
42
|
name: "dash.js",
|
|
42
|
-
canPlay:
|
|
43
|
+
canPlay: _.dash,
|
|
43
44
|
canEnablePIP: () => !0,
|
|
44
|
-
player:
|
|
45
|
+
player: (0, i.lazy)(() => import(
|
|
45
46
|
/* webpackChunkName: 'reactPlayerDash' */
|
|
46
|
-
"./react-
|
|
47
|
+
"./react-dE7BdGuR.js"
|
|
47
48
|
))
|
|
48
49
|
},
|
|
49
50
|
{
|
|
50
51
|
key: "mux",
|
|
51
52
|
name: "Mux",
|
|
52
|
-
canPlay:
|
|
53
|
+
canPlay: _.mux,
|
|
53
54
|
canEnablePIP: () => !0,
|
|
54
|
-
player:
|
|
55
|
+
player: (0, i.lazy)(() => import(
|
|
55
56
|
/* webpackChunkName: 'reactPlayerMux' */
|
|
56
|
-
"./dist-
|
|
57
|
+
"./dist-B9SbMqZU.js"
|
|
57
58
|
))
|
|
58
59
|
},
|
|
59
60
|
{
|
|
60
61
|
key: "youtube",
|
|
61
62
|
name: "YouTube",
|
|
62
|
-
canPlay:
|
|
63
|
-
player:
|
|
63
|
+
canPlay: _.youtube,
|
|
64
|
+
player: (0, i.lazy)(() => import(
|
|
64
65
|
/* webpackChunkName: 'reactPlayerYouTube' */
|
|
65
|
-
"./react-
|
|
66
|
+
"./react-Dbs-sPBo.js"
|
|
66
67
|
))
|
|
67
68
|
},
|
|
68
69
|
{
|
|
69
70
|
key: "vimeo",
|
|
70
71
|
name: "Vimeo",
|
|
71
|
-
canPlay:
|
|
72
|
-
player:
|
|
72
|
+
canPlay: _.vimeo,
|
|
73
|
+
player: (0, i.lazy)(() => import(
|
|
73
74
|
/* webpackChunkName: 'reactPlayerVimeo' */
|
|
74
|
-
"./react-
|
|
75
|
+
"./react-be7q6yw_.js"
|
|
75
76
|
))
|
|
76
77
|
},
|
|
77
78
|
{
|
|
78
79
|
key: "wistia",
|
|
79
80
|
name: "Wistia",
|
|
80
|
-
canPlay:
|
|
81
|
+
canPlay: _.wistia,
|
|
81
82
|
canEnablePIP: () => !0,
|
|
82
|
-
player:
|
|
83
|
+
player: (0, i.lazy)(() => import(
|
|
83
84
|
/* webpackChunkName: 'reactPlayerWistia' */
|
|
84
|
-
"./react-
|
|
85
|
+
"./react-NauLB_WU.js"
|
|
85
86
|
))
|
|
86
87
|
},
|
|
87
88
|
{
|
|
88
89
|
key: "spotify",
|
|
89
90
|
name: "Spotify",
|
|
90
|
-
canPlay:
|
|
91
|
+
canPlay: _.spotify,
|
|
91
92
|
canEnablePIP: () => !1,
|
|
92
|
-
player:
|
|
93
|
+
player: (0, i.lazy)(() => import(
|
|
93
94
|
/* webpackChunkName: 'reactPlayerSpotify' */
|
|
94
|
-
"./react-
|
|
95
|
+
"./react-DJysvNxz.js"
|
|
95
96
|
))
|
|
96
97
|
},
|
|
97
98
|
{
|
|
98
99
|
key: "twitch",
|
|
99
100
|
name: "Twitch",
|
|
100
|
-
canPlay:
|
|
101
|
+
canPlay: _.twitch,
|
|
101
102
|
canEnablePIP: () => !1,
|
|
102
|
-
player:
|
|
103
|
+
player: (0, i.lazy)(() => import(
|
|
103
104
|
/* webpackChunkName: 'reactPlayerTwitch' */
|
|
104
|
-
"./react-
|
|
105
|
+
"./react-czRIxT0g.js"
|
|
105
106
|
))
|
|
106
107
|
},
|
|
107
108
|
{
|
|
108
109
|
key: "tiktok",
|
|
109
110
|
name: "TikTok",
|
|
110
|
-
canPlay:
|
|
111
|
+
canPlay: _.tiktok,
|
|
111
112
|
canEnablePIP: () => !1,
|
|
112
|
-
player:
|
|
113
|
+
player: (0, i.lazy)(() => import(
|
|
113
114
|
/* webpackChunkName: 'reactPlayerTiktok' */
|
|
114
|
-
"./react-
|
|
115
|
+
"./react-ChCcxVnw.js"
|
|
115
116
|
))
|
|
116
117
|
},
|
|
117
118
|
{
|
|
118
119
|
key: "html",
|
|
119
120
|
name: "html",
|
|
120
|
-
canPlay:
|
|
121
|
+
canPlay: _.html,
|
|
121
122
|
canEnablePIP: () => !0,
|
|
122
|
-
player:
|
|
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
|
-
},
|
|
133
|
-
let { playing:
|
|
134
|
-
|
|
135
|
-
var t,
|
|
136
|
-
|
|
137
|
-
}),
|
|
138
|
-
var e, t, n,
|
|
139
|
-
if (!(!
|
|
140
|
-
if (
|
|
141
|
-
(t = (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 (!
|
|
144
|
-
(
|
|
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
|
-
}, [
|
|
148
|
-
let
|
|
148
|
+
}, [r]);
|
|
149
|
+
let c = (t) => {
|
|
149
150
|
var n, r;
|
|
150
|
-
|
|
151
|
-
},
|
|
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
|
-
|
|
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 (!
|
|
156
|
-
let
|
|
157
|
-
for (let t in e) t.startsWith("on") && !
|
|
158
|
-
return /* @__PURE__ */
|
|
159
|
-
...
|
|
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
|
-
|
|
165
|
-
}, [
|
|
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:
|
|
177
|
-
onPlay:
|
|
177
|
+
onLoadStart: c,
|
|
178
|
+
onPlay: l
|
|
178
179
|
}, e.children);
|
|
179
180
|
});
|
|
180
|
-
|
|
181
|
-
var
|
|
181
|
+
b.displayName = "Player";
|
|
182
|
+
var te = b, ne = (0, i.lazy)(() => import(
|
|
182
183
|
/* webpackChunkName: 'reactPlayerPreview' */
|
|
183
|
-
"./Preview-
|
|
184
|
-
)),
|
|
185
|
-
let
|
|
186
|
-
for (let
|
|
187
|
-
return
|
|
188
|
-
},
|
|
189
|
-
let
|
|
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:
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}, [
|
|
196
|
-
let
|
|
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
|
-
|
|
199
|
-
},
|
|
199
|
+
m(!1), (t = r.onClickPreview) == null || t.call(r, e);
|
|
200
|
+
}, g = (e) => {
|
|
200
201
|
if (!e) return null;
|
|
201
|
-
let { light:
|
|
202
|
-
return /* @__PURE__ */
|
|
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:
|
|
205
|
-
playIcon:
|
|
206
|
-
previewTabIndex:
|
|
205
|
+
light: t,
|
|
206
|
+
playIcon: n,
|
|
207
|
+
previewTabIndex: a,
|
|
207
208
|
previewAriaLabel: s,
|
|
208
|
-
oEmbedUrl:
|
|
209
|
-
onClickPreview:
|
|
209
|
+
oEmbedUrl: o,
|
|
210
|
+
onClickPreview: h
|
|
210
211
|
});
|
|
211
|
-
},
|
|
212
|
-
var
|
|
213
|
-
let
|
|
214
|
-
if (!
|
|
215
|
-
let { style:
|
|
216
|
-
return /* @__PURE__ */
|
|
217
|
-
...
|
|
218
|
-
ref:
|
|
219
|
-
activePlayer: (
|
|
220
|
-
slot: p ? void 0 :
|
|
221
|
-
className: p ? void 0 :
|
|
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
|
-
...
|
|
231
|
+
...u
|
|
231
232
|
},
|
|
232
233
|
config: m
|
|
233
234
|
});
|
|
234
|
-
},
|
|
235
|
-
return /* @__PURE__ */
|
|
236
|
-
slot:
|
|
237
|
-
className:
|
|
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:
|
|
240
|
-
height:
|
|
241
|
-
...
|
|
240
|
+
width: l,
|
|
241
|
+
height: u,
|
|
242
|
+
...c
|
|
242
243
|
}
|
|
243
|
-
}, /* @__PURE__ */
|
|
244
|
+
}, /* @__PURE__ */ i.createElement(y, { fallback: d }, p ? g(a) : _(a)));
|
|
244
245
|
});
|
|
245
|
-
return
|
|
246
|
-
|
|
247
|
-
},
|
|
248
|
-
|
|
249
|
-
},
|
|
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 [...
|
|
252
|
+
for (let n of [...x, ...e]) if (n.canPlay(t)) return !0;
|
|
252
253
|
}
|
|
253
254
|
return !1;
|
|
254
|
-
},
|
|
255
|
+
}, r.canEnablePIP = (t) => {
|
|
255
256
|
var n;
|
|
256
257
|
if (t) {
|
|
257
|
-
for (let r of [...
|
|
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
|
-
},
|
|
261
|
-
},
|
|
262
|
-
function
|
|
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
|
|
266
|
+
function oe(e) {
|
|
266
267
|
return !!(e && e.nodeType === 1 && "nodeName" in e && e.ownerDocument && e.ownerDocument.defaultView);
|
|
267
268
|
}
|
|
268
|
-
function
|
|
269
|
+
function se(e) {
|
|
269
270
|
return !isNaN(parseFloat(e)) && isFinite(e) && Math.floor(e) == e;
|
|
270
271
|
}
|
|
271
|
-
function
|
|
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
|
|
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
|
|
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
|
|
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 (
|
|
290
|
-
if (
|
|
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
|
|
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
|
|
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
|
|
307
|
-
if (!
|
|
308
|
-
var
|
|
309
|
-
function
|
|
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 :
|
|
363
|
-
var
|
|
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",
|
|
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
|
-
}),
|
|
515
|
-
function
|
|
516
|
-
let r =
|
|
517
|
-
t in r || (r[t] = []), r[t].push(n),
|
|
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
|
|
520
|
-
return (
|
|
520
|
+
function B(e, t) {
|
|
521
|
+
return (R.get(e.element) || {})[t] || [];
|
|
521
522
|
}
|
|
522
|
-
function
|
|
523
|
-
let r =
|
|
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] = [],
|
|
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),
|
|
528
|
+
return i !== -1 && r[t].splice(i, 1), R.set(e.element, r), r[t] && r[t].length === 0;
|
|
528
529
|
}
|
|
529
|
-
function
|
|
530
|
-
let n =
|
|
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
|
|
534
|
+
return V(e, t, r), r;
|
|
534
535
|
}
|
|
535
|
-
function
|
|
536
|
-
let n =
|
|
537
|
-
|
|
536
|
+
function de(e, t) {
|
|
537
|
+
let n = R.get(e);
|
|
538
|
+
R.set(t, n), R.delete(e);
|
|
538
539
|
}
|
|
539
|
-
function
|
|
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
|
|
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
|
|
555
|
-
t =
|
|
555
|
+
function fe(e, t) {
|
|
556
|
+
t = U(t);
|
|
556
557
|
let n = [], r;
|
|
557
|
-
if (t.event) t.event === "error" &&
|
|
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),
|
|
560
|
-
}), n =
|
|
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 =
|
|
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
|
|
576
|
-
function
|
|
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
|
|
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
|
|
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
|
|
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 (!
|
|
594
|
-
let a = `https://${
|
|
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
|
-
|
|
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
|
|
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 =
|
|
630
|
-
|
|
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
|
|
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 (!
|
|
640
|
-
let n = t.source ?
|
|
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
|
|
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 (!
|
|
651
|
-
let n =
|
|
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 ?
|
|
654
|
-
r &&
|
|
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
|
|
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 (!
|
|
666
|
-
let r =
|
|
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 ?
|
|
669
|
-
if (i &&
|
|
670
|
-
let e = new
|
|
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
|
|
682
|
+
function ve() {
|
|
682
683
|
window.VimeoDRMEmbedsUpdated || (window.VimeoDRMEmbedsUpdated = !0, window.addEventListener("message", (e) => {
|
|
683
|
-
if (!
|
|
684
|
-
let t =
|
|
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 ?
|
|
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
|
|
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
|
|
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
|
-
},
|
|
810
|
-
constructor(
|
|
811
|
-
let
|
|
812
|
-
super(),
|
|
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(
|
|
817
|
-
...
|
|
818
|
-
...
|
|
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 =
|
|
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 =
|
|
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
|
-
},
|
|
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)), !
|
|
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" && !
|
|
892
|
-
if (
|
|
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
|
|
895
|
+
let n = new L((n, r) => {
|
|
895
896
|
if (this._onMessage = (e) => {
|
|
896
|
-
if (!
|
|
897
|
+
if (!A(e.origin) || this.element.contentWindow !== e.source) return;
|
|
897
898
|
this.origin === "*" && (this.origin = e.origin);
|
|
898
|
-
let t =
|
|
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
|
-
|
|
910
|
+
fe(this, t);
|
|
910
911
|
}, this._window.addEventListener("message", this._onMessage), this.element.nodeName !== "IFRAME") {
|
|
911
|
-
let n =
|
|
912
|
-
|
|
913
|
-
let n =
|
|
914
|
-
return this.element = n, this._originalElement = e,
|
|
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 (
|
|
919
|
-
let e = () =>
|
|
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
|
-
|
|
922
|
-
|
|
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
|
-
},
|
|
925
|
+
}, X.on("fullscreenchange", this.fullscreenchangeHandler);
|
|
925
926
|
}
|
|
926
927
|
return this;
|
|
927
928
|
}
|
|
928
929
|
static isVimeoUrl(e) {
|
|
929
|
-
return
|
|
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
|
|
935
|
-
|
|
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]),
|
|
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
|
|
943
|
-
|
|
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
|
-
}),
|
|
947
|
+
}), W(this, e);
|
|
947
948
|
}).catch(n)));
|
|
948
949
|
}
|
|
949
950
|
set(e, t) {
|
|
950
|
-
return new
|
|
951
|
-
if (e =
|
|
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
|
-
|
|
954
|
+
z(this, e, {
|
|
954
955
|
resolve: n,
|
|
955
956
|
reject: r
|
|
956
|
-
}),
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
976
|
+
let e = Y.get(this) || new L((e, t) => {
|
|
976
977
|
t(/* @__PURE__ */ Error("Unknown player. Probably unloaded."));
|
|
977
978
|
});
|
|
978
|
-
return
|
|
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
|
|
1020
|
+
return X.isEnabled ? X.request(this.element) : this.callMethod("requestFullscreen");
|
|
1020
1021
|
}
|
|
1021
1022
|
exitFullscreen() {
|
|
1022
|
-
return
|
|
1023
|
+
return X.isEnabled ? X.exit() : this.callMethod("exitFullscreen");
|
|
1023
1024
|
}
|
|
1024
1025
|
getFullscreen() {
|
|
1025
|
-
return
|
|
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
|
|
1044
|
-
if (
|
|
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),
|
|
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
|
|
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
|
|
1089
|
-
let t = new
|
|
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
|
|
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
|
|
1197
|
-
return
|
|
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
|
-
|
|
1201
|
+
O || (X = ye(), me(), he(), ge(), _e(), ve());
|
|
1201
1202
|
//#endregion
|
|
1202
1203
|
//#region src/ui/media/EmbeddedVideo/VimeoPlayer.tsx
|
|
1203
|
-
var
|
|
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
|
-
},
|
|
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
|
-
},
|
|
1221
|
-
let
|
|
1222
|
-
return
|
|
1223
|
-
if (!
|
|
1224
|
-
let
|
|
1225
|
-
if (!
|
|
1226
|
-
|
|
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
|
|
1230
|
-
|
|
1231
|
-
let
|
|
1232
|
-
return
|
|
1233
|
-
|
|
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__ */
|
|
1236
|
-
ref:
|
|
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
|
-
},
|
|
1245
|
+
}, Te = (e) => /vimeo\.com/.test(e), $ = {
|
|
1245
1246
|
width: "100%",
|
|
1246
1247
|
aspectRatio: "16 / 9"
|
|
1247
|
-
},
|
|
1248
|
-
let [n, r] =
|
|
1249
|
-
return
|
|
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__ */
|
|
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__ */
|
|
1260
|
+
}) : /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1260
1261
|
style: $,
|
|
1261
|
-
children: /* @__PURE__ */
|
|
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 {
|
|
1276
|
+
export { Ee as EmbeddedVideoPlayer };
|
|
1276
1277
|
|
|
1277
|
-
//# sourceMappingURL=EmbeddedVideoPlayer-
|
|
1278
|
+
//# sourceMappingURL=EmbeddedVideoPlayer-CNcds-dW.js.map
|