@fu-css/fu-player 0.1.0 → 0.2.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.
@@ -1,31 +1,31 @@
1
- const ye = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}):(\d{2})(?:\.\d{1,3})?(?:Z|([+-])(\d{2}):(\d{2})))?$/, re = /^P(?:(\d+)D)?(?:T(?=\d)(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/, z = /* @__PURE__ */ new Set();
2
- function or(e) {
3
- return ie(e);
1
+ const ke = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}):(\d{2})(?:\.\d{1,3})?(?:Z|([+-])(\d{2}):(\d{2})))?$/, le = /^P(?:(\d+)D)?(?:T(?=\d)(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/, Z = /* @__PURE__ */ new Set();
2
+ function gr(e) {
3
+ return ue(e);
4
4
  }
5
- function I(e) {
6
- L(ie(e));
5
+ function B(e) {
6
+ V(ue(e));
7
7
  }
8
- function ge(e) {
9
- L(
10
- N([
8
+ function Te(e) {
9
+ V(
10
+ H([
11
11
  { path: "thumbnailUrl", value: e.thumbnailUrl, required: !0 },
12
12
  { path: "contentUrl", value: e.contentUrl },
13
13
  { path: "embedUrl", value: e.embedUrl }
14
14
  ])
15
15
  );
16
16
  }
17
- function be(e) {
18
- L(
19
- N([
17
+ function we(e) {
18
+ V(
19
+ H([
20
20
  { path: "head.canonicalUrl", value: e.canonicalUrl },
21
21
  { path: "head.image", value: e.image },
22
22
  { path: "head.videoUrl", value: e.videoUrl }
23
23
  ])
24
24
  );
25
25
  }
26
- function ve(e) {
27
- L(
28
- N([
26
+ function Pe(e) {
27
+ V(
28
+ H([
29
29
  { path: "sitemap.loc", value: e.loc, required: !0 },
30
30
  { path: "sitemap.thumbnailUrl", value: e.thumbnailUrl, required: !0 },
31
31
  { path: "sitemap.contentUrl", value: e.contentUrl },
@@ -33,39 +33,39 @@ function ve(e) {
33
33
  ])
34
34
  );
35
35
  }
36
- function ne(e) {
37
- const t = e.match(re);
38
- if (!t || !oe(t))
36
+ function ce(e) {
37
+ const t = e.match(le);
38
+ if (!t || !pe(t))
39
39
  return 0;
40
40
  const [, r = "0", n = "0", i = "0", s = "0"] = t;
41
41
  return Number(r) * 86400 + Number(n) * 3600 + Number(i) * 60 + Number(s);
42
42
  }
43
- function ie(e) {
44
- const t = [], r = ae(e.thumbnailUrl);
43
+ function ue(e) {
44
+ const t = [], r = he(e.thumbnailUrl);
45
45
  return r.length || t.push({
46
46
  code: "missing_url",
47
47
  path: "thumbnailUrl",
48
48
  message: "should include at least one absolute http(s) URL.",
49
49
  value: e.thumbnailUrl
50
50
  }), r.forEach((n, i) => {
51
- E(
51
+ T(
52
52
  t,
53
53
  Array.isArray(e.thumbnailUrl) ? `thumbnailUrl[${i}]` : "thumbnailUrl",
54
54
  n
55
55
  );
56
- }), e.contentUrl !== void 0 && E(t, "contentUrl", e.contentUrl), e.embedUrl !== void 0 && E(t, "embedUrl", e.embedUrl), ke(e.uploadDate) || t.push({
56
+ }), e.contentUrl !== void 0 && T(t, "contentUrl", e.contentUrl), e.embedUrl !== void 0 && T(t, "embedUrl", e.embedUrl), xe(e.uploadDate) || t.push({
57
57
  code: "invalid_date",
58
58
  path: "uploadDate",
59
59
  message: "should be an ISO 8601 date or datetime.",
60
60
  value: e.uploadDate
61
- }), we(e.duration) || t.push({
61
+ }), Ve(e.duration) || t.push({
62
62
  code: "invalid_duration",
63
63
  path: "duration",
64
64
  message: "should be an ISO 8601 duration string such as PT1M5S, or a non-negative seconds number.",
65
65
  value: e.duration
66
66
  }), t;
67
67
  }
68
- function N(e) {
68
+ function H(e) {
69
69
  const t = [];
70
70
  return e.forEach((r) => {
71
71
  if (r.value === void 0) {
@@ -77,14 +77,14 @@ function N(e) {
77
77
  });
78
78
  return;
79
79
  }
80
- const n = ae(r.value);
80
+ const n = he(r.value);
81
81
  r.required && !n.length && t.push({
82
82
  code: "missing_url",
83
83
  path: r.path,
84
84
  message: "should include at least one absolute http(s) URL.",
85
85
  value: r.value
86
86
  }), n.forEach((i, s) => {
87
- E(
87
+ T(
88
88
  t,
89
89
  Array.isArray(r.value) ? `${r.path}[${s}]` : r.path,
90
90
  i
@@ -92,27 +92,27 @@ function N(e) {
92
92
  });
93
93
  }), t;
94
94
  }
95
- function L(e) {
95
+ function V(e) {
96
96
  typeof console > "u" || typeof console.warn != "function" || e.forEach((t) => {
97
- const r = Se(t);
98
- z.has(r) || (z.add(r), Ee(t));
97
+ const r = Ae(t);
98
+ Z.has(r) || (Z.add(r), Le(t));
99
99
  });
100
100
  }
101
- function E(e, t, r) {
102
- Ce(r) || e.push({
101
+ function T(e, t, r) {
102
+ Oe(r) || e.push({
103
103
  code: "invalid_url",
104
104
  path: t,
105
105
  message: "should be an absolute http(s) URL.",
106
106
  value: r
107
107
  });
108
108
  }
109
- function Se(e) {
110
- return `${e.path}:${se(e.value)}`;
109
+ function Ae(e) {
110
+ return `${e.path}:${de(e.value)}`;
111
111
  }
112
- function Ee(e) {
113
- console.warn(`[FuPlayer SEO] ${e.path} ${e.message} Received: ${se(e.value)}`);
112
+ function Le(e) {
113
+ console.warn(`[FuPlayer SEO] ${e.path} ${e.message} Received: ${de(e.value)}`);
114
114
  }
115
- function se(e) {
115
+ function de(e) {
116
116
  if (e instanceof Date)
117
117
  return Number.isFinite(e.getTime()) ? e.toISOString() : "Invalid Date";
118
118
  if (typeof e == "string")
@@ -125,10 +125,10 @@ function se(e) {
125
125
  return String(e);
126
126
  }
127
127
  }
128
- function ae(e) {
128
+ function he(e) {
129
129
  return Array.isArray(e) ? e : [e];
130
130
  }
131
- function Ce(e) {
131
+ function Oe(e) {
132
132
  if (e.trim() !== e || !e)
133
133
  return !1;
134
134
  try {
@@ -138,10 +138,10 @@ function Ce(e) {
138
138
  return !1;
139
139
  }
140
140
  }
141
- function ke(e) {
141
+ function xe(e) {
142
142
  if (e instanceof Date)
143
143
  return Number.isFinite(e.getTime());
144
- const t = e.match(ye);
144
+ const t = e.match(ke);
145
145
  if (!t)
146
146
  return !1;
147
147
  const [
@@ -155,46 +155,46 @@ function ke(e) {
155
155
  ,
156
156
  l,
157
157
  h
158
- ] = t, p = Number(r), c = Number(n), u = Number(i);
159
- if (!Te(p, c, u))
158
+ ] = t, p = Number(r), c = Number(n), d = Number(i);
159
+ if (!_e(p, c, d))
160
160
  return !1;
161
161
  if (s === void 0)
162
162
  return !0;
163
- const d = Number(s), _ = Number(a), V = Number(o);
164
- return !(d > 23 || _ > 59 || V > 59 || l !== void 0 && (Number(l) > 23 || Number(h) > 59));
163
+ const u = Number(s), C = Number(a), k = Number(o);
164
+ return !(u > 23 || C > 59 || k > 59 || l !== void 0 && (Number(l) > 23 || Number(h) > 59));
165
165
  }
166
- function Te(e, t, r) {
166
+ function _e(e, t, r) {
167
167
  if (t < 1 || t > 12)
168
168
  return !1;
169
169
  const n = new Date(Date.UTC(e, t - 1, r));
170
170
  return n.getUTCFullYear() === e && n.getUTCMonth() === t - 1 && n.getUTCDate() === r;
171
171
  }
172
- function we(e) {
172
+ function Ve(e) {
173
173
  if (typeof e == "number")
174
174
  return Number.isFinite(e) && e >= 0;
175
- const t = e.match(re);
176
- return !!(t && oe(t));
175
+ const t = e.match(le);
176
+ return !!(t && pe(t));
177
177
  }
178
- function oe(e) {
178
+ function pe(e) {
179
179
  return !!(e[1] || e[2] || e[3] || e[4]);
180
180
  }
181
- function Pe(e, t, r = {}) {
181
+ function Fe(e, t, r = {}) {
182
182
  const n = {
183
183
  "@context": "https://schema.org",
184
184
  "@type": "VideoObject",
185
185
  name: e.name,
186
186
  description: e.description,
187
- thumbnailUrl: xe(e.thumbnailUrl),
188
- uploadDate: Ve(e.uploadDate),
189
- duration: Ue(e.duration),
187
+ thumbnailUrl: Re(e.thumbnailUrl),
188
+ uploadDate: De(e.uploadDate),
189
+ duration: $e(e.duration),
190
190
  contentUrl: e.contentUrl ?? t,
191
191
  embedUrl: e.embedUrl,
192
192
  inLanguage: e.inLanguage,
193
193
  keywords: Array.isArray(e.keywords) ? e.keywords.join(", ") : e.keywords,
194
194
  transcript: e.transcript,
195
- publisher: e.publisher ? q(e.publisher) : void 0,
196
- author: e.author ? q(e.author) : void 0,
197
- hasPart: e.chapters?.map((s) => Oe(s, e.seekToActionUrlTemplate)),
195
+ publisher: e.publisher ? W(e.publisher) : void 0,
196
+ author: e.author ? W(e.author) : void 0,
197
+ hasPart: e.chapters?.map((s) => Ie(s, e.seekToActionUrlTemplate)),
198
198
  potentialAction: e.seekToActionUrlTemplate ? {
199
199
  "@type": "SeekToAction",
200
200
  target: e.seekToActionUrlTemplate,
@@ -207,83 +207,83 @@ function Pe(e, t, r = {}) {
207
207
  interactionType: { "@type": "WatchAction" },
208
208
  userInteractionCount: e.userInteractionCount
209
209
  });
210
- const i = D(n);
211
- return r.seoWarnings !== !1 && (I(e), ge({
210
+ const i = j(n);
211
+ return r.seoWarnings !== !1 && (B(e), Te({
212
212
  thumbnailUrl: i.thumbnailUrl,
213
213
  contentUrl: i.contentUrl,
214
214
  embedUrl: i.embedUrl
215
215
  })), i;
216
216
  }
217
- function Ae(e) {
217
+ function Ue(e) {
218
218
  return JSON.stringify(e).replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/&/g, "\\u0026").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
219
219
  }
220
- function Le(e) {
221
- return ne(e);
220
+ function Me(e) {
221
+ return ce(e);
222
222
  }
223
- function xe(e) {
223
+ function Re(e) {
224
224
  return Array.isArray(e) ? e : [e];
225
225
  }
226
- function q(e) {
227
- return D({
226
+ function W(e) {
227
+ return j({
228
228
  "@type": e.type ?? "Organization",
229
229
  name: e.name,
230
230
  url: e.url,
231
231
  logo: e.logo
232
232
  });
233
233
  }
234
- function Oe(e, t) {
235
- return D({
234
+ function Ie(e, t) {
235
+ return j({
236
236
  "@type": "Clip",
237
237
  name: e.name,
238
238
  startOffset: e.startOffset,
239
239
  endOffset: e.endOffset,
240
- url: e.url ?? _e(t, e.startOffset)
240
+ url: e.url ?? Ne(t, e.startOffset)
241
241
  });
242
242
  }
243
- function _e(e, t) {
243
+ function Ne(e, t) {
244
244
  return e?.replace("{seek_to_second_number}", String(t));
245
245
  }
246
- function Ve(e) {
246
+ function De(e) {
247
247
  return e instanceof Date ? Number.isFinite(e.getTime()) ? e.toISOString() : void 0 : e;
248
248
  }
249
- function Ue(e) {
249
+ function $e(e) {
250
250
  if (typeof e == "string")
251
251
  return e;
252
252
  const t = Math.max(0, Math.floor(e)), r = Math.floor(t / 3600), n = Math.floor(t % 3600 / 60), i = t % 60;
253
253
  return `PT${r ? `${r}H` : ""}${n ? `${n}M` : ""}${i || !r && !n ? `${i}S` : ""}`;
254
254
  }
255
- function D(e) {
255
+ function j(e) {
256
256
  return Object.fromEntries(
257
257
  Object.entries(e).filter(([, t]) => t !== void 0)
258
258
  );
259
259
  }
260
- const Fe = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "tel:"]), j = /* @__PURE__ */ new Set();
261
- function x(e, t) {
260
+ const Be = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "tel:"]), J = /* @__PURE__ */ new Set();
261
+ function F(e, t) {
262
262
  if (e !== void 0) {
263
- if (Me(e))
263
+ if (He(e))
264
264
  return e;
265
- Re(t, e);
265
+ je(t, e);
266
266
  }
267
267
  }
268
- function $(e, t) {
268
+ function K(e, t) {
269
269
  if (e?.trim().toLowerCase() !== "_blank")
270
270
  return t;
271
271
  const r = new Set(t?.split(/\s+/).filter(Boolean));
272
272
  return r.add("noreferrer"), r.add("noopener"), [...r].join(" ");
273
273
  }
274
- function Me(e) {
274
+ function He(e) {
275
275
  if (!e || e.trim() !== e || /[\u0000-\u001F\u007F]/.test(e))
276
276
  return !1;
277
277
  const t = e.match(/^([a-zA-Z][a-zA-Z\d+.-]*):/);
278
- return t ? Fe.has(t[1].toLowerCase() + ":") : !0;
278
+ return t ? Be.has(t[1].toLowerCase() + ":") : !0;
279
279
  }
280
- function Re(e, t) {
280
+ function je(e, t) {
281
281
  if (typeof console > "u" || typeof console.warn != "function")
282
282
  return;
283
283
  const r = `${e}:${t}`;
284
- j.has(r) || (j.add(r), console.warn(`[FuPlayer] ${e} href uses an unsafe URL protocol. Received: ${t}`));
284
+ J.has(r) || (J.add(r), console.warn(`[FuPlayer] ${e} href uses an unsafe URL protocol. Received: ${t}`));
285
285
  }
286
- function B(e) {
286
+ function z(e) {
287
287
  return {
288
288
  share: "M18 16.1c-.76 0-1.45.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11A2.99 2.99 0 1 0 15 5c0 .24.04.47.09.7L8.04 9.81A3 3 0 1 0 8.04 14l7.12 4.18c-.04.2-.06.41-.06.62a2.9 2.9 0 1 0 2.9-2.7Z",
289
289
  play: "M8 5v14l11-7z",
@@ -298,7 +298,7 @@ function B(e) {
298
298
  copy: "M10.6 13.4a1 1 0 0 0 1.4 0l4.1-4.1a3 3 0 1 0-4.2-4.2l-1.2 1.2a1 1 0 0 0 1.4 1.4l1.2-1.2a1 1 0 1 1 1.4 1.4l-4.1 4.1a1 1 0 0 0 0 1.4Zm2.8-2.8a1 1 0 0 0-1.4 0l-4.1 4.1a3 3 0 1 0 4.2 4.2l1.2-1.2a1 1 0 0 0-1.4-1.4l-1.2 1.2a1 1 0 1 1-1.4-1.4l4.1-4.1a1 1 0 0 0 0-1.4Z"
299
299
  }[e];
300
300
  }
301
- function Ie(e, t) {
301
+ function Ke(e, t) {
302
302
  t.forEach((r, n) => {
303
303
  e.children[n] !== r && e.insertBefore(r, e.children[n] ?? null);
304
304
  }), Array.from(e.children).forEach((r) => {
@@ -320,18 +320,18 @@ function b(e, t) {
320
320
  });
321
321
  }
322
322
  }
323
- function C(e, t) {
323
+ function w(e, t) {
324
324
  t && Object.entries(t).forEach(([r, n]) => {
325
325
  if (n != null) {
326
326
  if (r.startsWith("--") || r.includes("-")) {
327
327
  e.style.setProperty(r, String(n));
328
328
  return;
329
329
  }
330
- e.style.setProperty(De(r), String(n));
330
+ e.style.setProperty(qe(r), String(n));
331
331
  }
332
332
  });
333
333
  }
334
- function G(e, t, r = /* @__PURE__ */ new Set()) {
334
+ function Q(e, t, r = /* @__PURE__ */ new Set()) {
335
335
  t && Object.entries(t).forEach(([n, i]) => {
336
336
  if (!(r.has(n) || n.startsWith("on"))) {
337
337
  if (i === !1 || i === null || i === void 0) {
@@ -349,83 +349,83 @@ function f(e, t, r) {
349
349
  }
350
350
  e.setAttribute(t, r === !0 ? "" : String(r));
351
351
  }
352
- function Ne(e, t) {
352
+ function ze(e, t) {
353
353
  const r = /* @__PURE__ */ new Set(["alt", "children", "class", "decoding", "height", "loading", "src", "width"]);
354
354
  Object.entries(t ?? {}).forEach(([n, i]) => {
355
355
  r.has(n) || i === void 0 || i === null || n.startsWith("on") || e.setAttribute(n, String(i));
356
356
  });
357
357
  }
358
358
  function S(e) {
359
- return O(B(e));
359
+ return U(z(e));
360
360
  }
361
- function O(e) {
361
+ function U(e) {
362
362
  const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
363
363
  t.setAttribute("viewBox", "0 0 24 24"), t.setAttribute("aria-hidden", "true"), t.setAttribute("focusable", "false");
364
364
  const r = document.createElementNS("http://www.w3.org/2000/svg", "path");
365
365
  return r.setAttribute("d", e), t.appendChild(r), t;
366
366
  }
367
- function De(e) {
367
+ function qe(e) {
368
368
  return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
369
369
  }
370
- const le = [
370
+ const me = [
371
371
  "fullscreenchange",
372
372
  "webkitfullscreenchange",
373
373
  "mozfullscreenchange",
374
374
  "MSFullscreenChange"
375
- ], k = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Set();
376
- let P = !1, A = !1;
377
- function W() {
375
+ ], P = /* @__PURE__ */ new Set(), A = /* @__PURE__ */ new Set();
376
+ let O = !1, x = !1;
377
+ function X() {
378
378
  const e = document;
379
379
  return e.fullscreenElement ?? e.webkitFullscreenElement ?? e.mozFullScreenElement ?? e.msFullscreenElement ?? null;
380
380
  }
381
- function $e(e) {
381
+ function Ge(e) {
382
382
  const t = e;
383
383
  return (t.requestFullscreen ?? t.webkitRequestFullscreen ?? t.webkitRequestFullScreen ?? t.mozRequestFullScreen ?? t.msRequestFullscreen)?.call(t);
384
384
  }
385
- function Be() {
385
+ function Ze() {
386
386
  const e = document;
387
387
  return (e.exitFullscreen ?? e.webkitExitFullscreen ?? e.webkitCancelFullScreen ?? e.mozCancelFullScreen ?? e.msExitFullscreen)?.call(e);
388
388
  }
389
- function He(e) {
390
- return k.add(e), ze(), e(), () => {
391
- k.delete(e), k.size || qe();
389
+ function We(e) {
390
+ return P.add(e), Qe(), e(), () => {
391
+ P.delete(e), P.size || Xe();
392
392
  };
393
393
  }
394
- function Ke(e) {
395
- return T.add(e), je(), () => {
396
- T.delete(e), T.size || Ge();
394
+ function Je(e) {
395
+ return A.add(e), Ye(), () => {
396
+ A.delete(e), A.size || et();
397
397
  };
398
398
  }
399
- function ze() {
400
- P || (le.forEach((e) => {
401
- document.addEventListener(e, ce);
402
- }), P = !0);
399
+ function Qe() {
400
+ O || (me.forEach((e) => {
401
+ document.addEventListener(e, fe);
402
+ }), O = !0);
403
403
  }
404
- function qe() {
405
- P && (le.forEach((e) => {
406
- document.removeEventListener(e, ce);
407
- }), P = !1);
404
+ function Xe() {
405
+ O && (me.forEach((e) => {
406
+ document.removeEventListener(e, fe);
407
+ }), O = !1);
408
408
  }
409
- function ce() {
410
- k.forEach((e) => {
409
+ function fe() {
410
+ P.forEach((e) => {
411
411
  e();
412
412
  });
413
413
  }
414
- function je() {
415
- A || (document.addEventListener("keydown", ue), A = !0);
414
+ function Ye() {
415
+ x || (document.addEventListener("keydown", ye), x = !0);
416
416
  }
417
- function Ge() {
418
- A && (document.removeEventListener("keydown", ue), A = !1);
417
+ function et() {
418
+ x && (document.removeEventListener("keydown", ye), x = !1);
419
419
  }
420
- function ue(e) {
421
- T.forEach((t) => {
420
+ function ye(e) {
421
+ A.forEach((t) => {
422
422
  t(e);
423
423
  });
424
424
  }
425
- function We(e, t) {
425
+ function tt(e, t) {
426
426
  if (t)
427
427
  for (const r of e) {
428
- const n = Qe(r);
428
+ const n = it(r);
429
429
  if (!n)
430
430
  continue;
431
431
  const i = t[n];
@@ -433,7 +433,7 @@ function We(e, t) {
433
433
  return { adapterKey: n, adapter: i, source: r };
434
434
  }
435
435
  }
436
- function Z(e) {
436
+ function Y(e) {
437
437
  if (typeof e == "function")
438
438
  return e;
439
439
  if (e?.destroy)
@@ -441,18 +441,18 @@ function Z(e) {
441
441
  if (e?.dispose)
442
442
  return () => e.dispose?.();
443
443
  }
444
- function Ze(e) {
445
- return e.map((t, r) => ({ track: t, index: r })).filter(({ track: t }) => de(t.kind)).map(({ track: t, index: r }) => ({
444
+ function rt(e) {
445
+ return e.map((t, r) => ({ track: t, index: r })).filter(({ track: t }) => ge(t.kind)).map(({ track: t, index: r }) => ({
446
446
  key: `track-${r}`,
447
- label: Xe(t, r),
447
+ label: st(t, r),
448
448
  trackIndex: r,
449
449
  default: t.default
450
450
  }));
451
451
  }
452
- function de(e) {
452
+ function ge(e) {
453
453
  return e === "subtitles" || e === "captions";
454
454
  }
455
- function Je(e) {
455
+ function nt(e) {
456
456
  return e ? e.message ? e.message : {
457
457
  1: "Video loading was aborted.",
458
458
  2: "Video failed because of a network error.",
@@ -460,14 +460,14 @@ function Je(e) {
460
460
  4: "Video source is not supported."
461
461
  }[e.code] ?? "Video failed to load." : "Video failed to load.";
462
462
  }
463
- function he(e, t) {
463
+ function be(e, t) {
464
464
  return e instanceof Error && e.message ? e.message : typeof e == "string" && e ? e : t;
465
465
  }
466
466
  function v(e) {
467
467
  const t = Number.isFinite(e) ? Math.max(0, Math.floor(e)) : 0, r = Math.floor(t / 60), n = t % 60;
468
468
  return `${String(r).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
469
469
  }
470
- function Qe(e) {
470
+ function it(e) {
471
471
  if (e.adapter === "native")
472
472
  return;
473
473
  if (e.adapter)
@@ -478,39 +478,63 @@ function Qe(e) {
478
478
  if (t === "application/dash+xml" || r.includes(".mpd"))
479
479
  return "dash";
480
480
  }
481
- function Xe(e, t) {
481
+ function st(e, t) {
482
482
  return e.label ?? e.srcLang?.toUpperCase() ?? `${e.kind} ${t + 1}`;
483
483
  }
484
- const U = "off", Ye = "16 / 9", et = "Video", tt = "Video", rt = "1970-01-01";
485
- function nt(e, t = {}) {
484
+ const M = "off", at = "16 / 9", ot = "Video", lt = "Video", ct = "1970-01-01", R = {
485
+ aspectRatio: at,
486
+ seoMode: "indexable",
487
+ lazy: !0,
488
+ rootMargin: "240px 0px",
489
+ tracks: [],
490
+ quickActions: [],
491
+ nativeControls: !1,
492
+ preload: "metadata",
493
+ playsInline: !0,
494
+ controls: !0,
495
+ pauseOtherPlayers: !1
496
+ };
497
+ function ut(e, t = {}) {
486
498
  return typeof e == "string" ? { ...t, src: e } : Array.isArray(e) ? { ...t, sources: e } : { ...t, ...e };
487
499
  }
488
- function J(e, t) {
489
- const { aliases: r, playerOptions: n } = it(e), i = st(e, t), s = at(e, t), a = ot(r, e.seo, e.geo, t, i, s), o = lt(r, n.geo, t, a), l = ct(o), h = n.renderJsonLd ?? t?.renderJsonLd ?? (Object.hasOwn(e, "seo") && e.seo !== void 0), p = Object.hasOwn(n, "renderGeoText"), c = p || !!t?.renderGeoTextExplicit, u = p ? !!n.renderGeoText : t?.renderGeoTextExplicit ? t.renderGeoText : l;
500
+ function D(...e) {
501
+ return e.reduce((t, r) => r ? ve(t, r) : t, {});
502
+ }
503
+ function ee(e, t) {
504
+ const { aliases: r, playerOptions: n } = ht(e), { display: i, ...s } = n, a = { ...i ?? {}, ...s }, o = pt(e, t), l = mt(e, t), h = ft(r, e.seo, e.geo, t, o, l), p = yt(r, a.geo, t, h), c = gt(p), d = a.renderJsonLd ?? t?.renderJsonLd ?? (Object.hasOwn(e, "seo") && e.seo !== void 0), u = Object.hasOwn(a, "renderGeoText"), C = u || !!t?.renderGeoTextExplicit, k = u ? !!a.renderGeoText : t?.renderGeoTextExplicit ? t.renderGeoText : c;
490
505
  return {
491
- aspectRatio: Ye,
492
- seoMode: "indexable",
493
- lazy: !0,
494
- rootMargin: "240px 0px",
495
- tracks: [],
496
- quickActions: [],
497
- nativeControls: !1,
498
- preload: "metadata",
499
- playsInline: !0,
500
- controls: !0,
501
- pauseOtherPlayers: !1,
506
+ ...dt(),
502
507
  ...t,
503
- ...n,
504
- sources: i,
505
- poster: s,
506
- seo: a,
507
- geo: o,
508
- renderJsonLd: h,
509
- renderGeoText: u,
510
- renderGeoTextExplicit: c
508
+ ...a,
509
+ sources: o,
510
+ poster: l,
511
+ seo: h,
512
+ geo: p,
513
+ renderJsonLd: d,
514
+ renderGeoText: k,
515
+ renderGeoTextExplicit: C
511
516
  };
512
517
  }
513
- function it(e) {
518
+ function dt() {
519
+ return {
520
+ ...R,
521
+ tracks: [...R.tracks],
522
+ quickActions: [...R.quickActions]
523
+ };
524
+ }
525
+ function ve(e, t) {
526
+ const r = { ...e };
527
+ return Object.entries(t).forEach(([n, i]) => {
528
+ if (i === void 0)
529
+ return;
530
+ const s = r[n];
531
+ r[n] = te(s) && te(i) ? ve(s, i) : i;
532
+ }), r;
533
+ }
534
+ function te(e) {
535
+ return Object.prototype.toString.call(e) === "[object Object]";
536
+ }
537
+ function ht(e) {
514
538
  const {
515
539
  title: t,
516
540
  description: r,
@@ -523,10 +547,10 @@ function it(e) {
523
547
  keyTakeaways: h,
524
548
  transcript: p,
525
549
  chapters: c,
526
- type: u,
527
- media: d,
528
- adapter: _,
529
- ...V
550
+ type: d,
551
+ media: u,
552
+ adapter: C,
553
+ ...k
530
554
  } = e;
531
555
  return {
532
556
  aliases: {
@@ -541,14 +565,14 @@ function it(e) {
541
565
  keyTakeaways: h,
542
566
  transcript: p,
543
567
  chapters: c,
544
- type: u,
545
- media: d,
546
- adapter: _
568
+ type: d,
569
+ media: u,
570
+ adapter: C
547
571
  },
548
- playerOptions: V
572
+ playerOptions: k
549
573
  };
550
574
  }
551
- function st(e, t) {
575
+ function pt(e, t) {
552
576
  if (Object.hasOwn(e, "sources"))
553
577
  return e.sources ?? [];
554
578
  if (Object.hasOwn(e, "src") || Object.hasOwn(e, "type") || Object.hasOwn(e, "media") || Object.hasOwn(e, "adapter")) {
@@ -564,26 +588,26 @@ function st(e, t) {
564
588
  }
565
589
  return t?.sources ?? [];
566
590
  }
567
- function at(e, t) {
591
+ function mt(e, t) {
568
592
  return Object.hasOwn(e, "poster") ? e.poster ?? "" : t?.poster ?? "";
569
593
  }
570
- function ot(e, t, r, n, i, s) {
571
- const a = n?.seo, o = i[0]?.src, l = e.title ?? t?.name ?? a?.name ?? et, h = e.description ?? t?.description ?? a?.description ?? tt, p = e.thumbnailUrl ?? t?.thumbnailUrl ?? a?.thumbnailUrl ?? s, c = e.contentUrl !== void 0 || t?.contentUrl !== void 0 || o !== n?.sources[0]?.src;
594
+ function ft(e, t, r, n, i, s) {
595
+ const a = n?.seo, o = i[0]?.src, l = e.title ?? t?.name ?? a?.name ?? ot, h = e.description ?? t?.description ?? a?.description ?? lt, p = e.thumbnailUrl ?? t?.thumbnailUrl ?? a?.thumbnailUrl ?? s, c = e.contentUrl !== void 0 || t?.contentUrl !== void 0 || o !== n?.sources[0]?.src;
572
596
  return {
573
597
  ...a,
574
598
  ...t,
575
599
  name: l,
576
600
  description: h,
577
601
  thumbnailUrl: p,
578
- uploadDate: e.uploadDate ?? t?.uploadDate ?? a?.uploadDate ?? rt,
602
+ uploadDate: e.uploadDate ?? t?.uploadDate ?? a?.uploadDate ?? ct,
579
603
  duration: e.duration ?? t?.duration ?? a?.duration ?? 0,
580
604
  contentUrl: e.contentUrl ?? t?.contentUrl ?? (c ? o : a?.contentUrl ?? o),
581
- embedUrl: e.embedUrl ?? t?.embedUrl ?? a?.embedUrl ?? ut(),
605
+ embedUrl: e.embedUrl ?? t?.embedUrl ?? a?.embedUrl ?? bt(),
582
606
  transcript: e.transcript ?? t?.transcript ?? r?.transcript ?? a?.transcript,
583
607
  chapters: e.chapters ?? t?.chapters ?? r?.chapters ?? a?.chapters
584
608
  };
585
609
  }
586
- function lt(e, t, r, n) {
610
+ function yt(e, t, r, n) {
587
611
  return {
588
612
  ...r?.geo,
589
613
  ...t,
@@ -593,13 +617,13 @@ function lt(e, t, r, n) {
593
617
  chapters: e.chapters ?? t?.chapters ?? n.chapters ?? r?.geo?.chapters
594
618
  };
595
619
  }
596
- function ct(e) {
620
+ function gt(e) {
597
621
  return !!(e.summary?.trim() || e.transcript?.trim() || e.keyTakeaways?.some((t) => t.trim()) || e.chapters?.length);
598
622
  }
599
- function ut() {
623
+ function bt() {
600
624
  return typeof window < "u" ? window.location.href : void 0;
601
625
  }
602
- function dt(e) {
626
+ function vt(e) {
603
627
  if (typeof e != "string")
604
628
  return e;
605
629
  const t = document.querySelector(e);
@@ -607,41 +631,41 @@ function dt(e) {
607
631
  throw new Error(`FuPlayer target was not found: ${e}`);
608
632
  return t;
609
633
  }
610
- function Q(e) {
634
+ function re(e) {
611
635
  e.preventDefault();
612
636
  }
613
- const ht = [
637
+ const St = [
614
638
  "whatsapp",
615
639
  "linkedin",
616
640
  "x",
617
641
  "facebook",
618
642
  "copy"
619
- ], pt = "_blank", pe = "noreferrer noopener";
620
- function H(e) {
643
+ ], Et = "_blank", Se = "noreferrer noopener";
644
+ function q(e) {
621
645
  return e === "phone" || e === "email" || e === "whatsapp";
622
646
  }
623
- function mt(e, t) {
624
- const r = x(e.href, `rightMenu.actions[${t}].href`), n = K(e.target, r);
647
+ function Ct(e, t) {
648
+ const r = F(e.href, `rightMenu.actions[${t}].href`), n = G(e.target, r);
625
649
  if (!(!r && !e.onClick))
626
650
  return {
627
651
  ...e,
628
652
  href: r,
629
653
  target: n,
630
- rel: $(n, e.rel)
654
+ rel: K(n, e.rel)
631
655
  };
632
656
  }
633
- function ft(e) {
657
+ function kt(e) {
634
658
  return !!e;
635
659
  }
636
- function yt(e, t, r) {
660
+ function Tt(e, t, r) {
637
661
  return e || (typeof window < "u" && window.location.href ? window.location.href : t.embedUrl ?? t.contentUrl ?? r ?? "");
638
662
  }
639
- function gt(e, t, r) {
663
+ function wt(e, t, r) {
640
664
  if (typeof e == "string")
641
- return X(e, void 0, t, r);
642
- if (bt(e))
643
- return X(e.preset, e, t, r);
644
- const n = typeof e.href == "function" ? e.href(r) : e.href, i = x(n, `share.targets.${e.id}.href`), s = K(e.target, i);
665
+ return ne(e, void 0, t, r);
666
+ if (Pt(e))
667
+ return ne(e.preset, e, t, r);
668
+ const n = typeof e.href == "function" ? e.href(r) : e.href, i = F(n, `share.targets.${e.id}.href`), s = G(e.target, i);
645
669
  return {
646
670
  id: e.id,
647
671
  target: e.id,
@@ -653,20 +677,20 @@ function gt(e, t, r) {
653
677
  className: e.className,
654
678
  iconClassName: e.iconClassName,
655
679
  targetWindow: s,
656
- rel: $(
680
+ rel: K(
657
681
  s,
658
- e.rel ?? (i ? pe : void 0)
682
+ e.rel ?? (i ? Se : void 0)
659
683
  ),
660
684
  onClick: e.onClick
661
685
  };
662
686
  }
663
- function X(e, t, r, n) {
664
- const i = t?.href !== void 0 ? vt(t.href, n) : St(e, n), s = x(i, `share.targets.${t?.id ?? e}.href`), a = K(t?.target, s);
687
+ function ne(e, t, r, n) {
688
+ const i = t?.href !== void 0 ? At(t.href, n) : Lt(e, n), s = F(i, `share.targets.${t?.id ?? e}.href`), a = G(t?.target, s);
665
689
  return {
666
690
  id: t?.id ?? e,
667
691
  target: t?.id ?? e,
668
692
  builtInTarget: e,
669
- label: t?.label ?? kt(e, r),
693
+ label: t?.label ?? _t(e, r),
670
694
  ariaLabel: t?.ariaLabel,
671
695
  href: s,
672
696
  icon: t?.icon,
@@ -674,23 +698,23 @@ function X(e, t, r, n) {
674
698
  className: t?.className,
675
699
  iconClassName: t?.iconClassName,
676
700
  targetWindow: a,
677
- rel: $(
701
+ rel: K(
678
702
  a,
679
- t?.rel ?? (s ? pe : void 0)
703
+ t?.rel ?? (s ? Se : void 0)
680
704
  ),
681
705
  onClick: t?.onClick
682
706
  };
683
707
  }
684
- function bt(e) {
708
+ function Pt(e) {
685
709
  return typeof e == "object" && "preset" in e;
686
710
  }
687
- function vt(e, t) {
711
+ function At(e, t) {
688
712
  return typeof e == "function" ? e(t) : e;
689
713
  }
690
- function St(e, t) {
691
- return e === "copy" ? void 0 : Tt(e, t.url, t.title, t.text);
714
+ function Lt(e, t) {
715
+ return e === "copy" ? void 0 : Vt(e, t.url, t.title, t.text);
692
716
  }
693
- async function Et(e) {
717
+ async function Ot(e) {
694
718
  if (typeof navigator < "u" && navigator.clipboard?.writeText)
695
719
  try {
696
720
  return await navigator.clipboard.writeText(e), !0;
@@ -704,10 +728,10 @@ async function Et(e) {
704
728
  document.body.removeChild(t);
705
729
  }
706
730
  }
707
- function Ct(e) {
731
+ function xt(e) {
708
732
  return e === "linkedin" ? "in" : e === "facebook" ? "f" : "X";
709
733
  }
710
- function kt(e, t) {
734
+ function _t(e, t) {
711
735
  return e === "copy" ? t?.copyLabel ?? "Copy link" : {
712
736
  whatsapp: "WhatsApp",
713
737
  linkedin: "LinkedIn",
@@ -715,7 +739,7 @@ function kt(e, t) {
715
739
  facebook: "Facebook"
716
740
  }[e];
717
741
  }
718
- function Tt(e, t, r, n) {
742
+ function Vt(e, t, r, n) {
719
743
  const i = encodeURIComponent(t), s = encodeURIComponent(r), a = encodeURIComponent(n);
720
744
  return {
721
745
  whatsapp: `https://wa.me/?text=${encodeURIComponent(`${r} ${t}`.trim())}`,
@@ -724,11 +748,11 @@ function Tt(e, t, r, n) {
724
748
  facebook: `https://www.facebook.com/sharer/sharer.php?u=${i}&quote=${a}`
725
749
  }[e];
726
750
  }
727
- function K(e, t) {
751
+ function G(e, t) {
728
752
  if (t)
729
- return e?.trim() || pt;
753
+ return e?.trim() || Et;
730
754
  }
731
- function wt({
755
+ function Ft({
732
756
  actions: e,
733
757
  ariaLabel: t
734
758
  }) {
@@ -737,46 +761,46 @@ function wt({
737
761
  const r = document.createElement("div");
738
762
  return r.className = "fu-player__quick-actions", r.setAttribute("aria-label", t), e.forEach((n) => {
739
763
  const i = n.href, s = i ? document.createElement("a") : document.createElement("button");
740
- b(s, Ft(n)), C(s, n.style), s.setAttribute(
764
+ b(s, Ht(n)), w(s, n.style), s.setAttribute(
741
765
  "aria-label",
742
- n.ariaLabel ?? n.label ?? Y(n.kind)
766
+ n.ariaLabel ?? n.label ?? ie(n.kind)
743
767
  ), s instanceof HTMLAnchorElement ? (s.href = i ?? "", f(s, "target", n.target), f(s, "rel", n.rel)) : s.type = "button", s.addEventListener("click", (o) => {
744
768
  n.onClick?.(o, n);
745
769
  });
746
- const a = Mt(n);
770
+ const a = jt(n);
747
771
  if (a) {
748
- const o = O(a);
749
- C(o, n.iconStyle), s.appendChild(o);
772
+ const o = U(a);
773
+ w(o, n.iconStyle), s.appendChild(o);
750
774
  } else {
751
775
  const o = document.createElement("span");
752
- o.className = "fu-player__quick-action-mark", o.setAttribute("aria-hidden", "true"), C(o, n.iconStyle), o.textContent = n.icon ?? Y(n.kind).slice(0, 2), s.appendChild(o);
776
+ o.className = "fu-player__quick-action-mark", o.setAttribute("aria-hidden", "true"), w(o, n.iconStyle), o.textContent = n.icon ?? ie(n.kind).slice(0, 2), s.appendChild(o);
753
777
  }
754
778
  r.appendChild(s);
755
779
  }), r;
756
780
  }
757
- function Pt(e) {
781
+ function Ut(e) {
758
782
  if (!e.shouldRenderBottomControls)
759
783
  return {};
760
784
  const t = document.createElement("div");
761
785
  t.className = "fu-player__chrome";
762
- const r = At(e);
786
+ const r = Mt(e);
763
787
  t.appendChild(r);
764
788
  const n = document.createElement("div");
765
789
  n.className = "fu-player__control-row";
766
- const i = Lt(e), s = xt(e);
790
+ const i = Rt(e), s = It(e);
767
791
  return n.appendChild(i.element), n.appendChild(s), t.appendChild(n), {
768
792
  element: t,
769
793
  progressInput: r,
770
794
  timeElement: i.timeElement
771
795
  };
772
796
  }
773
- function At(e) {
797
+ function Mt(e) {
774
798
  const t = document.createElement("input");
775
799
  return t.className = "fu-player__progress", t.type = "range", t.min = "0", t.max = String(e.videoMax), t.step = "0.1", t.value = String(
776
800
  Math.min(e.currentTime, e.visibleDuration || e.currentTime)
777
801
  ), t.style.setProperty("--fu-player-progress", `${Math.min(e.progressPercent, 100)}%`), t.setAttribute("aria-label", "Video progress"), t.disabled = !e.shouldExposeVideoElement && !e.visibleDuration, t.addEventListener("input", e.onProgressChange), t.addEventListener("change", e.onProgressChange), t;
778
802
  }
779
- function Lt(e) {
803
+ function Rt(e) {
780
804
  const t = document.createElement("div");
781
805
  t.className = "fu-player__control-left";
782
806
  const r = document.createElement("button");
@@ -784,12 +808,12 @@ function Lt(e) {
784
808
  const n = document.createElement("span");
785
809
  return n.className = "fu-player__time", n.textContent = `${v(e.currentTime)} / ${v(e.visibleDuration)}`, t.appendChild(n), { element: t, timeElement: n };
786
810
  }
787
- function xt(e) {
811
+ function It(e) {
788
812
  const t = document.createElement("div");
789
813
  t.className = "fu-player__control-right";
790
- const r = Ot(e);
814
+ const r = Nt(e);
791
815
  r && t.appendChild(r);
792
- const n = _t(e);
816
+ const n = Dt(e);
793
817
  n && t.appendChild(n);
794
818
  const i = document.createElement("button");
795
819
  i.className = "fu-player__control-button", i.type = "button", i.setAttribute("aria-label", e.isMuted ? "Unmute video" : "Mute video"), i.appendChild(S(e.isMuted || e.volume === 0 ? "muted" : "volume")), i.addEventListener("click", e.onToggleMute), t.appendChild(i);
@@ -801,7 +825,7 @@ function xt(e) {
801
825
  e.isFullscreenActive ? "Exit fullscreen" : "Enter fullscreen"
802
826
  ), a.appendChild(S(e.isFullscreenActive ? "fullscreenExit" : "fullscreen")), a.addEventListener("click", e.onToggleFullscreen), t.appendChild(a), t;
803
827
  }
804
- function Ot(e) {
828
+ function Nt(e) {
805
829
  if (e.textTrackOptions.length <= 1)
806
830
  return;
807
831
  const t = document.createElement("label");
@@ -814,25 +838,25 @@ function Ot(e) {
814
838
  s.value = i.key, s.textContent = i.label, s.selected = i.key === e.selectedTextTrackKey, n.appendChild(s);
815
839
  }), t.appendChild(n), t;
816
840
  }
817
- function _t(e) {
841
+ function Dt(e) {
818
842
  if (!e.isShareEnabled)
819
843
  return;
820
844
  const t = document.createElement("div");
821
845
  t.className = "fu-player__share";
822
846
  const r = document.createElement("button");
823
- if (b(r, ["fu-player__share-trigger", e.shareButtonClassName]), r.type = "button", r.setAttribute("aria-label", e.shareButtonLabel ?? "Share video"), r.setAttribute("aria-expanded", String(e.isShareOpen)), r.appendChild(Ut(e)), r.addEventListener("click", e.onToggleShare), t.appendChild(r), e.isShareOpen) {
847
+ if (b(r, ["fu-player__share-trigger", e.shareButtonClassName]), r.type = "button", r.setAttribute("aria-label", e.shareButtonLabel ?? "Share video"), r.setAttribute("aria-expanded", String(e.isShareOpen)), r.appendChild(Bt(e)), r.addEventListener("click", e.onToggleShare), t.appendChild(r), e.isShareOpen) {
824
848
  const n = document.createElement("div");
825
849
  b(n, ["fu-player__share-menu", e.shareMenuClassName]), n.setAttribute("role", "menu"), n.setAttribute("aria-label", e.shareMenuLabel ?? "Share video"), e.shareOptions.forEach((i) => {
826
- n.appendChild(Vt(i, e));
850
+ n.appendChild($t(i, e));
827
851
  }), t.appendChild(n);
828
852
  }
829
853
  return t;
830
854
  }
831
- function Vt(e, t) {
832
- const r = Rt(e), n = r ? document.createElement("button") : document.createElement("a");
855
+ function $t(e, t) {
856
+ const r = Kt(e), n = r ? document.createElement("button") : document.createElement("a");
833
857
  if (b(n, ["fu-player__share-option", e.className]), n.setAttribute("role", "menuitem"), n.setAttribute("aria-label", e.ariaLabel ?? e.label), r) {
834
858
  const o = n;
835
- o.type = "button", o.disabled = It(e, t.shareUrl);
859
+ o.type = "button", o.disabled = zt(e, t.shareUrl);
836
860
  } else {
837
861
  const o = n;
838
862
  f(o, "href", e.href), f(o, "target", e.targetWindow), f(o, "rel", e.rel);
@@ -841,65 +865,65 @@ function Vt(e, t) {
841
865
  t.onShareOptionClick(e, o);
842
866
  });
843
867
  const i = document.createElement("span");
844
- b(i, Nt(e)), i.setAttribute("aria-hidden", "true");
845
- const s = Dt(e);
846
- s ? i.appendChild(O(s)) : i.textContent = $t(e), n.appendChild(i);
868
+ b(i, qt(e)), i.setAttribute("aria-hidden", "true");
869
+ const s = Gt(e);
870
+ s ? i.appendChild(U(s)) : i.textContent = Zt(e), n.appendChild(i);
847
871
  const a = document.createElement("span");
848
872
  return a.className = "fu-player__share-label", a.textContent = e.builtInTarget === "copy" && t.copyState === "copied" ? t.copiedLabel ?? "Copied" : e.label, n.appendChild(a), n;
849
873
  }
850
- function Ut(e) {
874
+ function Bt(e) {
851
875
  if (e.shareButtonIconPath)
852
- return O(e.shareButtonIconPath);
876
+ return U(e.shareButtonIconPath);
853
877
  if (e.shareButtonIcon) {
854
878
  const t = document.createElement("span");
855
879
  return t.className = "fu-player__share-trigger-mark", t.setAttribute("aria-hidden", "true"), t.textContent = e.shareButtonIcon, t;
856
880
  }
857
881
  return S("share");
858
882
  }
859
- function Ft(e) {
883
+ function Ht(e) {
860
884
  return [
861
885
  "fu-player__quick-action",
862
- H(e.kind) ? `fu-player__quick-action--${e.kind}` : "fu-player__quick-action--custom",
886
+ q(e.kind) ? `fu-player__quick-action--${e.kind}` : "fu-player__quick-action--custom",
863
887
  e.className
864
888
  ];
865
889
  }
866
- function Mt(e) {
890
+ function jt(e) {
867
891
  if (e.iconPath)
868
892
  return e.iconPath;
869
893
  if (!e.icon)
870
- return H(e.kind) ? B(e.kind) : void 0;
894
+ return q(e.kind) ? z(e.kind) : void 0;
871
895
  }
872
- function Y(e) {
896
+ function ie(e) {
873
897
  const t = {
874
898
  phone: "Call",
875
899
  email: "Email",
876
900
  whatsapp: "WhatsApp"
877
901
  };
878
- return H(e) ? t[e] : e;
902
+ return q(e) ? t[e] : e;
879
903
  }
880
- function Rt(e) {
904
+ function Kt(e) {
881
905
  return e.builtInTarget === "copy" || !e.href;
882
906
  }
883
- function It(e, t) {
907
+ function zt(e, t) {
884
908
  return e.builtInTarget === "copy" ? !t : !e.href && !e.onClick;
885
909
  }
886
- function Nt(e) {
910
+ function qt(e) {
887
911
  return [
888
912
  "fu-player__share-icon",
889
913
  e.builtInTarget ? `fu-player__share-icon--${e.builtInTarget}` : "fu-player__share-icon--custom",
890
914
  e.iconClassName
891
915
  ];
892
916
  }
893
- function Dt(e) {
917
+ function Gt(e) {
894
918
  if (e.iconPath)
895
919
  return e.iconPath;
896
920
  if (!e.icon && (e.builtInTarget === "copy" || e.builtInTarget === "whatsapp"))
897
- return B(e.builtInTarget);
921
+ return z(e.builtInTarget);
898
922
  }
899
- function $t(e) {
900
- return e.icon ? e.icon : e.builtInTarget && e.builtInTarget !== "copy" && e.builtInTarget !== "whatsapp" ? Ct(e.builtInTarget) : e.label.slice(0, 2);
923
+ function Zt(e) {
924
+ return e.icon ? e.icon : e.builtInTarget && e.builtInTarget !== "copy" && e.builtInTarget !== "whatsapp" ? xt(e.builtInTarget) : e.label.slice(0, 2);
901
925
  }
902
- function Bt({
926
+ function Wt({
903
927
  root: e,
904
928
  lazy: t,
905
929
  rootMargin: r,
@@ -921,7 +945,7 @@ function Bt({
921
945
  );
922
946
  return i.observe(e), i;
923
947
  }
924
- class Ht {
948
+ class Jt {
925
949
  currentState = "idle";
926
950
  currentError;
927
951
  currentlyPlaying = !1;
@@ -968,24 +992,24 @@ class Ht {
968
992
  this.currentError = t, this.currentState = "error";
969
993
  }
970
994
  }
971
- function Kt(e, t) {
995
+ function Qt(e, t) {
972
996
  return {
973
997
  type: "playback",
974
- message: he(e, "Video playback failed."),
998
+ message: be(e, "Video playback failed."),
975
999
  source: t,
976
1000
  error: e
977
1001
  };
978
1002
  }
979
- function zt(e, t, r) {
1003
+ function Xt(e, t, r) {
980
1004
  return {
981
1005
  type: "media",
982
- message: Je(e.error),
1006
+ message: nt(e.error),
983
1007
  source: t,
984
1008
  event: r,
985
1009
  mediaError: e.error
986
1010
  };
987
1011
  }
988
- class qt {
1012
+ class Yt {
989
1013
  cleanup;
990
1014
  runId = 0;
991
1015
  signature = "";
@@ -1009,13 +1033,13 @@ class qt {
1009
1033
  this.cancelPending(), this.resetSignature(), this.dispose();
1010
1034
  }
1011
1035
  async setup(t) {
1012
- const { video: r, binding: n, sources: i, shouldExposeVideoElement: s } = t, a = jt(r, n, s);
1036
+ const { video: r, binding: n, sources: i, shouldExposeVideoElement: s } = t, a = er(r, n, s);
1013
1037
  if (a === this.signature)
1014
1038
  return;
1015
1039
  this.signature = a;
1016
1040
  const o = ++this.runId;
1017
1041
  if (this.dispose(), !r || !s || !n) {
1018
- Gt(r, n, i);
1042
+ tr(r, n, i);
1019
1043
  return;
1020
1044
  }
1021
1045
  t.onLoading();
@@ -1027,29 +1051,29 @@ class qt {
1027
1051
  adapter: n.adapterKey
1028
1052
  });
1029
1053
  if (o !== this.runId) {
1030
- Z(l)?.();
1054
+ Y(l)?.();
1031
1055
  return;
1032
1056
  }
1033
- this.cleanup = Z(l), r.readyState >= 2 && t.onReady(r.paused ? "ready" : "playing");
1057
+ this.cleanup = Y(l), r.readyState >= 2 && t.onReady(r.paused ? "ready" : "playing");
1034
1058
  } catch (l) {
1035
1059
  if (o !== this.runId)
1036
1060
  return;
1037
1061
  t.onError({
1038
- message: he(l, "Video source adapter failed."),
1062
+ message: be(l, "Video source adapter failed."),
1039
1063
  source: n.source,
1040
1064
  error: l
1041
1065
  });
1042
1066
  }
1043
1067
  }
1044
1068
  }
1045
- function jt(e, t, r) {
1069
+ function er(e, t, r) {
1046
1070
  return e && r && t ? `${t.adapterKey}:${t.source.src}:${t.source.type ?? ""}:${t.source.media ?? ""}:${t.source.adapter ?? ""}` : "";
1047
1071
  }
1048
- function Gt(e, t, r) {
1072
+ function tr(e, t, r) {
1049
1073
  e && !t && e.hasAttribute("src") && r.length && (e.removeAttribute("src"), e.load());
1050
1074
  }
1051
- const F = /* @__PURE__ */ new Set();
1052
- class Wt {
1075
+ const I = /* @__PURE__ */ new Set();
1076
+ class rr {
1053
1077
  root;
1054
1078
  container;
1055
1079
  options;
@@ -1062,7 +1086,7 @@ class Wt {
1062
1086
  durationSeconds = 0;
1063
1087
  isMuted = !1;
1064
1088
  volume = 1;
1065
- selectedTextTrackKey = U;
1089
+ selectedTextTrackKey = M;
1066
1090
  isFullscreen = !1;
1067
1091
  isPseudoFullscreen = !1;
1068
1092
  previousBodyOverflow;
@@ -1070,8 +1094,8 @@ class Wt {
1070
1094
  copyState = "idle";
1071
1095
  copyResetTimer;
1072
1096
  lazyObserver;
1073
- playbackStateRuntime = new Ht();
1074
- sourceAdapterRuntime = new qt();
1097
+ playbackStateRuntime = new Jt();
1098
+ sourceAdapterRuntime = new Yt();
1075
1099
  unsubscribeFullscreenState;
1076
1100
  unsubscribeFullscreenKeyDown;
1077
1101
  removeShareListeners;
@@ -1082,7 +1106,7 @@ class Wt {
1082
1106
  schemaDurationSecondsValue = 0;
1083
1107
  destroyed = !1;
1084
1108
  constructor(t, r) {
1085
- this.container = dt(t), this.options = J(r), this.root = document.createElement("div"), this.isNearViewport = !this.options.lazy, this.isMuted = this.effectiveMuted, this.playbackStateRuntime.resetForAutoPlay(this.effectiveAutoPlay), this.selectedTextTrackKey = this.getDefaultTextTrackKey(), this.refreshSeoCache(), this.root.addEventListener("contextmenu", Q), this.container.appendChild(this.root), F.add(this), this.unsubscribeFullscreenState = He(() => this.updateFullscreenState()), this.render(), this.setupLazyObserver(), this.setupSourceAdapter(), this.effectiveAutoPlay && (this.hasRequestedPlayback = !0, this.playVideo());
1109
+ this.container = vt(t), this.options = ee(r), this.root = document.createElement("div"), this.isNearViewport = !this.options.lazy, this.isMuted = this.effectiveMuted, this.playbackStateRuntime.resetForAutoPlay(this.effectiveAutoPlay), this.selectedTextTrackKey = this.getDefaultTextTrackKey(), this.refreshSeoCache(), this.root.addEventListener("contextmenu", re), this.container.appendChild(this.root), I.add(this), this.unsubscribeFullscreenState = We(() => this.updateFullscreenState()), this.render(), this.setupLazyObserver(), this.setupSourceAdapter(), this.effectiveAutoPlay && (this.hasRequestedPlayback = !0, this.playVideo());
1086
1110
  }
1087
1111
  get video() {
1088
1112
  return this.videoElement;
@@ -1100,7 +1124,7 @@ class Wt {
1100
1124
  if (this.destroyed)
1101
1125
  return;
1102
1126
  const r = Object.hasOwn(t, "muted") || Object.hasOwn(t, "autoPlay"), n = Object.hasOwn(t, "src") || Object.hasOwn(t, "sources") || Object.hasOwn(t, "type") || Object.hasOwn(t, "media") || Object.hasOwn(t, "adapter") || Object.hasOwn(t, "sourceAdapters");
1103
- this.options = J(t, this.options), r && this.setMutedState(this.effectiveMuted), n && (this.sourceAdapterRuntime.resetSignature(), this.mediaChildrenSignature = ""), this.refreshSeoCache(), this.getTextTrackOptions().some((i) => i.key === this.selectedTextTrackKey) || (this.selectedTextTrackKey = this.getDefaultTextTrackKey()), (!this.shouldRenderBottomControls || !this.isShareEnabled) && this.closeShareMenu(), this.render(), this.setupLazyObserver(), this.setupSourceAdapter(), this.syncTextTracks(), this.effectiveAutoPlay && (this.hasRequestedPlayback = !0, this.playVideo());
1127
+ this.options = ee(t, this.options), r && this.setMutedState(this.effectiveMuted), n && (this.sourceAdapterRuntime.resetSignature(), this.mediaChildrenSignature = ""), this.refreshSeoCache(), this.getTextTrackOptions().some((i) => i.key === this.selectedTextTrackKey) || (this.selectedTextTrackKey = this.getDefaultTextTrackKey()), (!this.shouldRenderBottomControls || !this.isShareEnabled) && this.closeShareMenu(), this.render(), this.setupLazyObserver(), this.setupSourceAdapter(), this.syncTextTracks(), this.effectiveAutoPlay && (this.hasRequestedPlayback = !0, this.playVideo());
1104
1128
  }
1105
1129
  async play() {
1106
1130
  this.hasRequestedPlayback = !0, this.playbackStateRuntime.requestPlayback(), this.render(), await this.playVideo();
@@ -1109,7 +1133,7 @@ class Wt {
1109
1133
  this.videoElement?.pause();
1110
1134
  }
1111
1135
  destroy() {
1112
- this.destroyed || (this.destroyed = !0, this.lazyObserver?.disconnect(), this.lazyObserver = void 0, this.sourceAdapterRuntime.destroy(), F.delete(this), this.destroyVideo(), this.closeShareMenu(), this.removeShareListeners?.(), this.removeShareListeners = void 0, this.clearCopyTimer(), this.unsubscribeFullscreenState?.(), this.unsubscribeFullscreenState = void 0, this.exitPseudoFullscreen(), this.root.removeEventListener("contextmenu", Q), this.root.remove());
1136
+ this.destroyed || (this.destroyed = !0, this.lazyObserver?.disconnect(), this.lazyObserver = void 0, this.sourceAdapterRuntime.destroy(), I.delete(this), this.destroyVideo(), this.closeShareMenu(), this.removeShareListeners?.(), this.removeShareListeners = void 0, this.clearCopyTimer(), this.unsubscribeFullscreenState?.(), this.unsubscribeFullscreenState = void 0, this.exitPseudoFullscreen(), this.root.removeEventListener("contextmenu", re), this.root.remove());
1113
1137
  }
1114
1138
  get normalizedSources() {
1115
1139
  return this.options.sources;
@@ -1167,10 +1191,10 @@ class Wt {
1167
1191
  return;
1168
1192
  this.progressInputElement = void 0, this.timeElement = void 0, this.syncRootAttributes();
1169
1193
  const t = [], r = this.renderJsonLd(), n = this.renderMedia(), i = this.renderStatusOverlay(), s = this.renderCenterPlayButton(), a = this.renderQuickActions(), o = this.renderControls(), l = this.renderGeoText();
1170
- r && t.push(r), n && t.push(n), i && t.push(i), s && t.push(s), a && t.push(a), o && t.push(o), l && t.push(l), Ie(this.root, t), this.syncShareListeners();
1194
+ r && t.push(r), n && t.push(n), i && t.push(i), s && t.push(s), a && t.push(a), o && t.push(o), l && t.push(l), Ke(this.root, t), this.syncShareListeners();
1171
1195
  }
1172
1196
  syncRootAttributes() {
1173
- this.root.className = "", this.root.classList.add("fu-player"), this.isPseudoFullscreen && this.root.classList.add("fu-player--fullscreen"), b(this.root, this.options.className), this.root.removeAttribute("style"), C(this.root, this.options.wrapperStyle), this.root.style.setProperty("--fu-player-aspect-ratio", this.options.aspectRatio), G(this.root, this.options.rootAttributes, /* @__PURE__ */ new Set(["class", "style"]));
1197
+ this.root.className = "", this.root.classList.add("fu-player"), this.isPseudoFullscreen && this.root.classList.add("fu-player--fullscreen"), b(this.root, this.options.className), this.root.removeAttribute("style"), w(this.root, this.options.wrapperStyle), this.root.style.setProperty("--fu-player-aspect-ratio", this.options.aspectRatio), Q(this.root, this.options.rootAttributes, /* @__PURE__ */ new Set(["class", "style"]));
1174
1198
  }
1175
1199
  renderJsonLd() {
1176
1200
  if (!this.options.renderJsonLd) {
@@ -1180,10 +1204,10 @@ class Wt {
1180
1204
  return this.scriptElement || (this.scriptElement = document.createElement("script"), this.scriptElement.type = "application/ld+json"), this.scriptElement.textContent = this.schemaJson, this.scriptElement;
1181
1205
  }
1182
1206
  refreshSeoCache() {
1183
- const t = Pe(this.options.seo, this.normalizedSources[0]?.src, {
1207
+ const t = Fe(this.options.seo, this.normalizedSources[0]?.src, {
1184
1208
  seoWarnings: this.options.renderJsonLd && this.effectiveSeoWarnings
1185
1209
  });
1186
- this.schemaJson = Ae(t), this.schemaDurationSecondsValue = Le(t.duration);
1210
+ this.schemaJson = Ue(t), this.schemaDurationSecondsValue = Me(t.duration);
1187
1211
  }
1188
1212
  renderMedia() {
1189
1213
  if (this.shouldExposeVideoElement) {
@@ -1205,7 +1229,7 @@ class Wt {
1205
1229
  }));
1206
1230
  }
1207
1231
  syncVideoAttributes(t) {
1208
- G(t, this.options.videoAttributes, /* @__PURE__ */ new Set(["class"])), t.className = "fu-player__media", t.poster = this.options.poster, t.preload = this.options.preload, t.autoplay = !!(this.effectiveAutoPlay || this.hasRequestedPlayback), t.muted = this.isMuted, t.playsInline = this.options.playsInline, t.controls = !!(this.options.nativeControls && this.options.controls && !this.effectiveHideControls), t.loop = this.effectiveLoop, t.disablePictureInPicture = !!this.options.disablePictureInPicture, f(t, "crossorigin", this.options.crossOrigin), f(t, "controlslist", this.options.controlsList);
1232
+ Q(t, this.options.videoAttributes, /* @__PURE__ */ new Set(["class"])), t.className = "fu-player__media", t.poster = this.options.poster, t.preload = this.options.preload, t.autoplay = !!(this.effectiveAutoPlay || this.hasRequestedPlayback), t.muted = this.isMuted, t.playsInline = this.options.playsInline, t.controls = !!(this.options.nativeControls && this.options.controls && !this.effectiveHideControls), t.loop = this.effectiveLoop, t.disablePictureInPicture = !!this.options.disablePictureInPicture, f(t, "crossorigin", this.options.crossOrigin), f(t, "controlslist", this.options.controlsList);
1209
1233
  }
1210
1234
  syncVideoChildren(t) {
1211
1235
  const r = this.sourceAdapterBinding ? [] : this.normalizedSources, n = JSON.stringify({
@@ -1230,7 +1254,7 @@ class Wt {
1230
1254
  this.play();
1231
1255
  });
1232
1256
  const r = document.createElement("img");
1233
- r.className = "fu-player__poster-image", r.loading = "lazy", r.decoding = "async", Ne(r, this.options.posterImageProps), r.src = this.options.poster, r.alt = this.options.posterAlt ?? this.options.seo.name, t.appendChild(r);
1257
+ r.className = "fu-player__poster-image", r.loading = "lazy", r.decoding = "async", ze(r, this.options.posterImageProps), r.src = this.options.poster, r.alt = this.options.posterAlt ?? this.options.seo.name, t.appendChild(r);
1234
1258
  const n = document.createElement("span");
1235
1259
  return n.className = "fu-player__play", n.setAttribute("aria-hidden", "true"), n.appendChild(S("play")), t.appendChild(n), t;
1236
1260
  }
@@ -1264,13 +1288,13 @@ class Wt {
1264
1288
  }), t;
1265
1289
  }
1266
1290
  renderQuickActions() {
1267
- return wt({
1291
+ return Ft({
1268
1292
  actions: this.getRightMenuActions(),
1269
1293
  ariaLabel: this.getRightMenuAriaLabel()
1270
1294
  });
1271
1295
  }
1272
1296
  renderControls() {
1273
- const r = this.shouldRenderBottomControls && this.isShareEnabled ? this.getSharePayload() : void 0, n = Pt({
1297
+ const r = this.shouldRenderBottomControls && this.isShareEnabled ? this.getSharePayload() : void 0, n = Ut({
1274
1298
  shouldRenderBottomControls: this.shouldRenderBottomControls,
1275
1299
  currentTime: this.currentTime,
1276
1300
  visibleDuration: this.visibleDuration,
@@ -1354,7 +1378,7 @@ class Wt {
1354
1378
  n.textContent = "Chapters", t.appendChild(n);
1355
1379
  const i = document.createElement("ol");
1356
1380
  r.forEach((s, a) => {
1357
- const o = document.createElement("li"), l = this.formatChapterTimeRange(s.startOffset, s.endOffset), h = l ? `${l} ${s.name}` : s.name, p = x(s.url, `geo.chapters[${a}].url`);
1381
+ const o = document.createElement("li"), l = this.formatChapterTimeRange(s.startOffset, s.endOffset), h = l ? `${l} ${s.name}` : s.name, p = F(s.url, `geo.chapters[${a}].url`);
1358
1382
  if (p) {
1359
1383
  const c = document.createElement("a");
1360
1384
  c.href = p, c.textContent = h, o.appendChild(c);
@@ -1398,7 +1422,7 @@ class Wt {
1398
1422
  try {
1399
1423
  await t.play();
1400
1424
  } catch (r) {
1401
- this.reportPlaybackError(Kt(r, this.getCurrentSource()));
1425
+ this.reportPlaybackError(Qt(r, this.getCurrentSource()));
1402
1426
  }
1403
1427
  }
1404
1428
  async togglePlayback() {
@@ -1463,7 +1487,7 @@ class Wt {
1463
1487
  };
1464
1488
  handleError = (t) => {
1465
1489
  const r = t.currentTarget;
1466
- this.reportPlaybackError(zt(r, this.getCurrentSource(), t)), this.callVideoHandler("onError", t), this.render();
1490
+ this.reportPlaybackError(Xt(r, this.getCurrentSource(), t)), this.callVideoHandler("onError", t), this.render();
1467
1491
  };
1468
1492
  handleVolumeChangeEvent = (t) => {
1469
1493
  const r = t.currentTarget;
@@ -1484,7 +1508,7 @@ class Wt {
1484
1508
  ), this.progressInputElement.disabled = !this.shouldExposeVideoElement && !this.visibleDuration), this.timeElement && (this.timeElement.textContent = `${v(this.currentTime)} / ${v(this.visibleDuration)}`);
1485
1509
  }
1486
1510
  pausePeerPlayers() {
1487
- this.options.pauseOtherPlayers && F.forEach((t) => {
1511
+ this.options.pauseOtherPlayers && I.forEach((t) => {
1488
1512
  t !== this && t.pause();
1489
1513
  });
1490
1514
  }
@@ -1496,7 +1520,7 @@ class Wt {
1496
1520
  n?.(r);
1497
1521
  }
1498
1522
  get sourceAdapterBinding() {
1499
- return We(this.normalizedSources, this.options.sourceAdapters);
1523
+ return tt(this.normalizedSources, this.options.sourceAdapters);
1500
1524
  }
1501
1525
  async setupSourceAdapter() {
1502
1526
  await this.sourceAdapterRuntime.setup({
@@ -1521,7 +1545,7 @@ class Wt {
1521
1545
  });
1522
1546
  }
1523
1547
  setupLazyObserver() {
1524
- this.lazyObserver?.disconnect(), this.lazyObserver = Bt({
1548
+ this.lazyObserver?.disconnect(), this.lazyObserver = Wt({
1525
1549
  root: this.root,
1526
1550
  lazy: this.options.lazy,
1527
1551
  rootMargin: this.options.rootMargin,
@@ -1532,12 +1556,12 @@ class Wt {
1532
1556
  }
1533
1557
  getTextTrackOptions() {
1534
1558
  return [
1535
- { key: U, label: this.options.subtitlesOffLabel ?? "Subtitles off" },
1536
- ...Ze(this.options.tracks)
1559
+ { key: M, label: this.options.subtitlesOffLabel ?? "Subtitles off" },
1560
+ ...rt(this.options.tracks)
1537
1561
  ];
1538
1562
  }
1539
1563
  getDefaultTextTrackKey() {
1540
- return this.getTextTrackOptions().find((r) => r.default)?.key ?? U;
1564
+ return this.getTextTrackOptions().find((r) => r.default)?.key ?? M;
1541
1565
  }
1542
1566
  syncTextTracks() {
1543
1567
  const t = this.videoElement;
@@ -1548,7 +1572,7 @@ class Wt {
1548
1572
  )?.trackIndex;
1549
1573
  for (let n = 0; n < t.textTracks.length; n += 1) {
1550
1574
  const i = this.options.tracks[n];
1551
- if (!(!i || !de(i.kind)))
1575
+ if (!(!i || !ge(i.kind)))
1552
1576
  try {
1553
1577
  t.textTracks[n].mode = n === r ? "showing" : "disabled";
1554
1578
  } catch {
@@ -1561,20 +1585,20 @@ class Wt {
1561
1585
  }
1562
1586
  getRightMenuActions() {
1563
1587
  const t = this.getRightMenuConfig();
1564
- return this.effectiveHideMenu || t.enabled === !1 ? [] : (t.actions ?? []).map(mt).filter(ft);
1588
+ return this.effectiveHideMenu || t.enabled === !1 ? [] : (t.actions ?? []).map(Ct).filter(kt);
1565
1589
  }
1566
1590
  getRightMenuAriaLabel() {
1567
1591
  return this.getRightMenuConfig().ariaLabel ?? "Quick actions";
1568
1592
  }
1569
1593
  getSharePayload() {
1570
1594
  return {
1571
- url: yt(this.shareConfig?.url, this.options.seo, this.normalizedSources[0]?.src),
1595
+ url: Tt(this.shareConfig?.url, this.options.seo, this.normalizedSources[0]?.src),
1572
1596
  title: this.shareConfig?.title ?? this.options.seo.name,
1573
1597
  text: this.shareConfig?.text ?? this.options.seo.description
1574
1598
  };
1575
1599
  }
1576
1600
  getShareOptions(t = this.getSharePayload()) {
1577
- return (this.shareConfig?.targets ?? ht).map((n) => gt(n, this.shareConfig, t));
1601
+ return (this.shareConfig?.targets ?? St).map((n) => wt(n, this.shareConfig, t));
1578
1602
  }
1579
1603
  async handleShareOptionClick(t, r) {
1580
1604
  if (t.onClick) {
@@ -1592,7 +1616,7 @@ class Wt {
1592
1616
  const r = this.getSharePayload().url;
1593
1617
  if (!r)
1594
1618
  return;
1595
- await Et(r) && (this.clearCopyTimer(), this.copyState = "copied", this.copyResetTimer = window.setTimeout(() => {
1619
+ await Ot(r) && (this.clearCopyTimer(), this.copyState = "copied", this.copyResetTimer = window.setTimeout(() => {
1596
1620
  this.copyResetTimer = void 0, this.copyState = "idle", this.render();
1597
1621
  }, 1800), this.render());
1598
1622
  }
@@ -1621,12 +1645,12 @@ class Wt {
1621
1645
  this.exitPseudoFullscreen(), this.render();
1622
1646
  return;
1623
1647
  }
1624
- if (W()) {
1625
- Promise.resolve(Be()).then(() => this.updateFullscreenState()).catch(() => {
1648
+ if (X()) {
1649
+ Promise.resolve(Ze()).then(() => this.updateFullscreenState()).catch(() => {
1626
1650
  });
1627
1651
  return;
1628
1652
  }
1629
- const t = $e(this.root);
1653
+ const t = Ge(this.root);
1630
1654
  if (t !== void 0) {
1631
1655
  Promise.resolve(t).then(() => this.updateFullscreenState()).catch(() => {
1632
1656
  this.enterNativeVideoFullscreen() || this.enterPseudoFullscreen(), this.render();
@@ -1651,7 +1675,7 @@ class Wt {
1651
1675
  return !1;
1652
1676
  }
1653
1677
  enterPseudoFullscreen() {
1654
- this.isPseudoFullscreen || (this.previousBodyOverflow === void 0 && (this.previousBodyOverflow = document.body.style.overflow, document.body.style.overflow = "hidden"), this.isPseudoFullscreen = !0, this.unsubscribeFullscreenKeyDown = Ke((t) => {
1678
+ this.isPseudoFullscreen || (this.previousBodyOverflow === void 0 && (this.previousBodyOverflow = document.body.style.overflow, document.body.style.overflow = "hidden"), this.isPseudoFullscreen = !0, this.unsubscribeFullscreenKeyDown = Je((t) => {
1655
1679
  t.key === "Escape" && this.isPseudoFullscreen && (this.exitPseudoFullscreen(), this.render());
1656
1680
  }));
1657
1681
  }
@@ -1659,7 +1683,7 @@ class Wt {
1659
1683
  this.isPseudoFullscreen = !1, this.unsubscribeFullscreenKeyDown?.(), this.unsubscribeFullscreenKeyDown = void 0, this.previousBodyOverflow !== void 0 && (document.body.style.overflow = this.previousBodyOverflow, this.previousBodyOverflow = void 0);
1660
1684
  }
1661
1685
  updateFullscreenState() {
1662
- const t = W();
1686
+ const t = X();
1663
1687
  this.isFullscreen = !!(t && (t === this.root || this.root.contains(t) || t.contains(this.root))), this.render();
1664
1688
  }
1665
1689
  destroyVideo() {
@@ -1669,14 +1693,68 @@ class Wt {
1669
1693
  this.root.querySelector(".fu-player__poster")?.remove();
1670
1694
  }
1671
1695
  }
1672
- function lr(e, t, r) {
1673
- return new Wt(e, nt(t, r));
1696
+ function br(e, t, r) {
1697
+ return new rr(e, ut(t, r));
1698
+ }
1699
+ function vr(e) {
1700
+ const t = nr(e), r = _(
1701
+ E(e.options)
1702
+ );
1703
+ return r ? D(t, r) : D(
1704
+ t,
1705
+ se(e.commonOptions),
1706
+ se(e.personalizedOptions)
1707
+ );
1708
+ }
1709
+ function nr(e) {
1710
+ return _(
1711
+ E({
1712
+ sources: e.sources,
1713
+ tracks: e.tracks,
1714
+ chapters: e.chapters,
1715
+ seo: e.seo,
1716
+ geo: e.geo
1717
+ })
1718
+ );
1719
+ }
1720
+ function se(e) {
1721
+ if (!e)
1722
+ return;
1723
+ const t = E(e.player), r = _(
1724
+ E(e.display)
1725
+ );
1726
+ return _(
1727
+ D(
1728
+ t,
1729
+ r ? { display: r } : void 0
1730
+ )
1731
+ );
1674
1732
  }
1675
- function Zt(e, t = {}) {
1676
- t.seoWarnings !== !1 && I(e);
1677
- const r = t.title ?? e.name, n = Jt(r, t.titleTemplate), i = t.description ?? e.description, s = t.canonicalUrl ?? e.embedUrl, a = t.image ?? me(e.thumbnailUrl), o = e.embedUrl ?? e.contentUrl, l = R(t.publishedTime ?? e.uploadDate), h = R(t.modifiedTime), p = Yt(t.locale ?? e.inLanguage), c = t.twitterCard ?? "summary_large_image";
1678
- t.seoWarnings !== !1 && be({ canonicalUrl: s, image: a, videoUrl: o });
1679
- const u = [
1733
+ function E(e) {
1734
+ if (e == null)
1735
+ return;
1736
+ if (Array.isArray(e))
1737
+ return e.map((r) => E(r)).filter((r) => r !== void 0);
1738
+ if (!ir(e))
1739
+ return e;
1740
+ const t = {};
1741
+ return Object.entries(e).forEach(([r, n]) => {
1742
+ const i = E(n);
1743
+ i !== void 0 && (t[r] = i);
1744
+ }), t;
1745
+ }
1746
+ function _(e) {
1747
+ if (!(!e || Object.keys(e).length === 0))
1748
+ return e;
1749
+ }
1750
+ function ir(e) {
1751
+ return Object.prototype.toString.call(e) === "[object Object]";
1752
+ }
1753
+ function sr(e, t = {}) {
1754
+ t.seoWarnings !== !1 && B(e);
1755
+ const r = t.title ?? e.name, n = ar(r, t.titleTemplate), i = t.description ?? e.description, s = t.canonicalUrl ?? e.embedUrl, a = t.image ?? Ee(e.thumbnailUrl), o = e.embedUrl ?? e.contentUrl, l = $(t.publishedTime ?? e.uploadDate), h = $(t.modifiedTime), p = cr(t.locale ?? e.inLanguage), c = t.twitterCard ?? "summary_large_image";
1756
+ t.seoWarnings !== !1 && we({ canonicalUrl: s, image: a, videoUrl: o });
1757
+ const d = [
1680
1758
  { name: "description", content: i },
1681
1759
  m("name", "robots", t.robots),
1682
1760
  { property: "og:type", content: t.ogType ?? "video.other" },
@@ -1688,7 +1766,7 @@ function Zt(e, t = {}) {
1688
1766
  m("property", "og:locale", p),
1689
1767
  m("property", "og:video", o),
1690
1768
  m("property", "og:video:url", o),
1691
- m("property", "og:video:secure_url", er(o) ? o : void 0),
1769
+ m("property", "og:video:secure_url", ur(o) ? o : void 0),
1692
1770
  m("property", "video:release_date", l),
1693
1771
  m("property", "article:published_time", l),
1694
1772
  m("property", "article:modified_time", h),
@@ -1699,28 +1777,28 @@ function Zt(e, t = {}) {
1699
1777
  m("name", "twitter:site", t.twitterSite),
1700
1778
  m("name", "twitter:creator", t.twitterCreator),
1701
1779
  m("name", "twitter:player", c === "player" ? e.embedUrl : void 0),
1702
- m("name", "twitter:player:width", ee(t.twitterPlayerWidth)),
1703
- m("name", "twitter:player:height", ee(t.twitterPlayerHeight)),
1780
+ m("name", "twitter:player:width", ae(t.twitterPlayerWidth)),
1781
+ m("name", "twitter:player:height", ae(t.twitterPlayerHeight)),
1704
1782
  ...t.extraMeta ?? []
1705
- ].filter(Qt), d = [
1783
+ ].filter(or), u = [
1706
1784
  ...s ? [{ rel: "canonical", href: s }] : [],
1707
1785
  ...t.extraLinks ?? []
1708
1786
  ];
1709
1787
  return {
1710
1788
  title: n,
1711
- meta: rr(u),
1712
- links: nr(d)
1789
+ meta: hr(d),
1790
+ links: pr(u)
1713
1791
  };
1714
1792
  }
1715
- function cr(e, t = {}) {
1793
+ function Sr(e, t = {}) {
1716
1794
  return [
1717
1795
  '<?xml version="1.0" encoding="UTF-8"?>',
1718
1796
  '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">',
1719
1797
  ...e.map((n) => {
1720
1798
  const i = n.seo;
1721
- t.seoWarnings !== !1 && I(i);
1722
- const s = me(i.thumbnailUrl), a = n.contentUrl ?? i.contentUrl, o = n.playerUrl ?? i.embedUrl, l = tr(i.duration), h = R(i.uploadDate), p = n.tags ?? Xt(i.keywords);
1723
- return t.seoWarnings !== !1 && ve({
1799
+ t.seoWarnings !== !1 && B(i);
1800
+ const s = Ee(i.thumbnailUrl), a = n.contentUrl ?? i.contentUrl, o = n.playerUrl ?? i.embedUrl, l = dr(i.duration), h = $(i.uploadDate), p = n.tags ?? lr(i.keywords);
1801
+ return t.seoWarnings !== !1 && Pe({
1724
1802
  loc: n.loc,
1725
1803
  thumbnailUrl: s,
1726
1804
  contentUrl: a,
@@ -1746,46 +1824,46 @@ function cr(e, t = {}) {
1746
1824
  ].join(`
1747
1825
  `);
1748
1826
  }
1749
- function Jt(e, t) {
1827
+ function ar(e, t) {
1750
1828
  return t ? t.includes("%s") ? t.replace("%s", e) : `${e}${t}` : e;
1751
1829
  }
1752
1830
  function m(e, t, r) {
1753
1831
  return r ? { [e]: t, content: r } : void 0;
1754
1832
  }
1755
- function Qt(e) {
1833
+ function or(e) {
1756
1834
  return !!(e?.content && (e.name || e.property));
1757
1835
  }
1758
- function me(e) {
1836
+ function Ee(e) {
1759
1837
  return Array.isArray(e) ? e[0] : e;
1760
1838
  }
1761
- function Xt(e) {
1839
+ function lr(e) {
1762
1840
  return e ? Array.isArray(e) ? e : e.split(",").map((t) => t.trim()).filter(Boolean) : [];
1763
1841
  }
1764
- function R(e) {
1842
+ function $(e) {
1765
1843
  if (e)
1766
1844
  return e instanceof Date ? Number.isFinite(e.getTime()) ? e.toISOString() : void 0 : e;
1767
1845
  }
1768
- function ee(e) {
1846
+ function ae(e) {
1769
1847
  return typeof e == "number" ? String(e) : void 0;
1770
1848
  }
1771
- function Yt(e) {
1849
+ function cr(e) {
1772
1850
  return e?.replace("-", "_");
1773
1851
  }
1774
- function er(e) {
1852
+ function ur(e) {
1775
1853
  return !!e?.startsWith("https://");
1776
1854
  }
1777
- function tr(e) {
1778
- const t = typeof e == "number" ? e : ne(e);
1855
+ function dr(e) {
1856
+ const t = typeof e == "number" ? e : ce(e);
1779
1857
  return !Number.isFinite(t) || t <= 0 ? 0 : Math.floor(t);
1780
1858
  }
1781
- function rr(e) {
1859
+ function hr(e) {
1782
1860
  const t = /* @__PURE__ */ new Map();
1783
1861
  return e.forEach((r) => {
1784
1862
  const n = r.name ? `name:${r.name}` : `property:${r.property}`;
1785
1863
  t.set(n, r);
1786
1864
  }), [...t.values()];
1787
1865
  }
1788
- function nr(e) {
1866
+ function pr(e) {
1789
1867
  const t = /* @__PURE__ */ new Map();
1790
1868
  return e.forEach((r) => {
1791
1869
  t.set(`${r.rel}:${r.hreflang ?? ""}:${r.type ?? ""}`, r);
@@ -1794,27 +1872,27 @@ function nr(e) {
1794
1872
  function y(e) {
1795
1873
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
1796
1874
  }
1797
- const te = "data-fu-player-seo-head", M = "data-fu-player-seo-head-id";
1798
- let ir = 0, w;
1875
+ const oe = "data-fu-player-seo-head", N = "data-fu-player-seo-head-id";
1876
+ let mr = 0, L;
1799
1877
  const g = [];
1800
- function ur(e, t = {}) {
1801
- const r = `fu-player-seo-head-${++ir}`, n = `[${M}="${r}"]`;
1878
+ function Er(e, t = {}) {
1879
+ const r = `fu-player-seo-head-${++mr}`, n = `[${N}="${r}"]`;
1802
1880
  let i = e, s = t, a = !1;
1803
1881
  h();
1804
- function o(c, u = {}) {
1805
- a || (i = c, s = u, h());
1882
+ function o(c, d = {}) {
1883
+ a || (i = c, s = d, h());
1806
1884
  }
1807
1885
  function l() {
1808
- a || (a = !0, p(), ar(r));
1886
+ a || (a = !0, p(), yr(r));
1809
1887
  }
1810
1888
  function h() {
1811
- const c = Zt(i, s);
1812
- sr(r, c.title), p(), c.meta.forEach((u) => {
1813
- const d = document.createElement("meta");
1814
- u.name && d.setAttribute("name", u.name), u.property && d.setAttribute("property", u.property), d.setAttribute("content", u.content), d.setAttribute(te, "true"), d.setAttribute(M, r), document.head.appendChild(d);
1815
- }), c.links.forEach((u) => {
1816
- const d = document.createElement("link");
1817
- d.setAttribute("rel", u.rel), d.setAttribute("href", u.href), u.hreflang && d.setAttribute("hreflang", u.hreflang), u.type && d.setAttribute("type", u.type), d.setAttribute(te, "true"), d.setAttribute(M, r), document.head.appendChild(d);
1889
+ const c = sr(i, s);
1890
+ fr(r, c.title), p(), c.meta.forEach((d) => {
1891
+ const u = document.createElement("meta");
1892
+ d.name && u.setAttribute("name", d.name), d.property && u.setAttribute("property", d.property), u.setAttribute("content", d.content), u.setAttribute(oe, "true"), u.setAttribute(N, r), document.head.appendChild(u);
1893
+ }), c.links.forEach((d) => {
1894
+ const u = document.createElement("link");
1895
+ u.setAttribute("rel", d.rel), u.setAttribute("href", d.href), d.hreflang && u.setAttribute("hreflang", d.hreflang), d.type && u.setAttribute("type", d.type), u.setAttribute(oe, "true"), u.setAttribute(N, r), document.head.appendChild(u);
1818
1896
  });
1819
1897
  }
1820
1898
  function p() {
@@ -1827,33 +1905,35 @@ function ur(e, t = {}) {
1827
1905
  destroy: l
1828
1906
  };
1829
1907
  }
1830
- function sr(e, t) {
1831
- g.length === 0 && (w = document.title);
1908
+ function fr(e, t) {
1909
+ g.length === 0 && (L = document.title);
1832
1910
  const r = g.find((n) => n.id === e);
1833
- r ? r.title = t : g.push({ id: e, title: t }), fe();
1911
+ r ? r.title = t : g.push({ id: e, title: t }), Ce();
1834
1912
  }
1835
- function ar(e) {
1913
+ function yr(e) {
1836
1914
  const t = g.findIndex((r) => r.id === e);
1837
1915
  if (t !== -1) {
1838
1916
  if (g.splice(t, 1), g.length === 0) {
1839
- w !== void 0 && (document.title = w), w = void 0;
1917
+ L !== void 0 && (document.title = L), L = void 0;
1840
1918
  return;
1841
1919
  }
1842
- fe();
1920
+ Ce();
1843
1921
  }
1844
1922
  }
1845
- function fe() {
1923
+ function Ce() {
1846
1924
  const e = g[g.length - 1];
1847
1925
  e && (document.title = e.title);
1848
1926
  }
1849
1927
  export {
1850
- Wt as FuPlayer,
1851
- ur as applyFuPlayerSeoHead,
1852
- Zt as buildFuPlayerSeoHead,
1853
- cr as buildFuPlayerVideoSitemapXml,
1854
- Pe as buildVideoObjectSchema,
1855
- lr as createFuPlayer,
1856
- Le as parseDurationToSeconds,
1857
- Ae as stringifyVideoObjectJsonLd,
1858
- or as validateFuPlayerSeo
1928
+ rr as FuPlayer,
1929
+ Er as applyFuPlayerSeoHead,
1930
+ vr as buildFuPlayerOptionsFromDto,
1931
+ sr as buildFuPlayerSeoHead,
1932
+ Sr as buildFuPlayerVideoSitemapXml,
1933
+ Fe as buildVideoObjectSchema,
1934
+ br as createFuPlayer,
1935
+ D as mergeFuPlayerOptions,
1936
+ Me as parseDurationToSeconds,
1937
+ Ue as stringifyVideoObjectJsonLd,
1938
+ gr as validateFuPlayerSeo
1859
1939
  };