boss-web-player-sdk 1.1.21 → 1.1.22

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/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { c as e, t, u as n } from "./src-B8eoxemB.js";
2
2
  import { createContext as r, createElement as i, forwardRef as a, useCallback as o, useContext as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
3
- import { createPortal as ee } from "react-dom";
4
- import { Fragment as te, jsx as f, jsxs as p } from "react/jsx-runtime";
5
- import { createRoot as ne } from "react-dom/client";
3
+ import { createPortal as f } from "react-dom";
4
+ import { Fragment as ee, jsx as p, jsxs as m } from "react/jsx-runtime";
5
+ import { createRoot as te } from "react-dom/client";
6
6
  //#region ../ui-controls/src/ErrorScreen.tsx
7
- function re({ title: e = "Something Went Wrong", subtitle: t = "We encountered an error while playing this video.\nPlease try again.", onRetry: n }) {
8
- return /* @__PURE__ */ p(te, { children: [
9
- /* @__PURE__ */ f("div", {
7
+ function ne({ title: e = "Something Went Wrong", subtitle: t = "We encountered an error while playing this video.\nPlease try again.", onRetry: n }) {
8
+ return /* @__PURE__ */ m(ee, { children: [
9
+ /* @__PURE__ */ p("div", {
10
10
  style: {
11
11
  width: 80,
12
12
  height: 80,
@@ -17,7 +17,7 @@ function re({ title: e = "Something Went Wrong", subtitle: t = "We encountered a
17
17
  justifyContent: "center",
18
18
  flexShrink: 0
19
19
  },
20
- children: /* @__PURE__ */ p("svg", {
20
+ children: /* @__PURE__ */ m("svg", {
21
21
  width: "36",
22
22
  height: "36",
23
23
  viewBox: "0 0 24 24",
@@ -27,14 +27,14 @@ function re({ title: e = "Something Went Wrong", subtitle: t = "We encountered a
27
27
  strokeLinecap: "round",
28
28
  strokeLinejoin: "round",
29
29
  children: [
30
- /* @__PURE__ */ f("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
31
- /* @__PURE__ */ f("line", {
30
+ /* @__PURE__ */ p("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
31
+ /* @__PURE__ */ p("line", {
32
32
  x1: "12",
33
33
  y1: "9",
34
34
  x2: "12",
35
35
  y2: "13"
36
36
  }),
37
- /* @__PURE__ */ f("line", {
37
+ /* @__PURE__ */ p("line", {
38
38
  x1: "12",
39
39
  y1: "17",
40
40
  x2: "12.01",
@@ -43,12 +43,12 @@ function re({ title: e = "Something Went Wrong", subtitle: t = "We encountered a
43
43
  ]
44
44
  })
45
45
  }),
46
- /* @__PURE__ */ p("div", {
46
+ /* @__PURE__ */ m("div", {
47
47
  style: {
48
48
  textAlign: "center",
49
49
  padding: "0 24px"
50
50
  },
51
- children: [/* @__PURE__ */ f("p", {
51
+ children: [/* @__PURE__ */ p("p", {
52
52
  style: {
53
53
  color: "#ffffff",
54
54
  fontSize: 22,
@@ -57,7 +57,7 @@ function re({ title: e = "Something Went Wrong", subtitle: t = "We encountered a
57
57
  letterSpacing: "-0.2px"
58
58
  },
59
59
  children: e
60
- }), /* @__PURE__ */ f("p", {
60
+ }), /* @__PURE__ */ p("p", {
61
61
  style: {
62
62
  color: "rgba(255,255,255,0.5)",
63
63
  fontSize: 14,
@@ -68,7 +68,7 @@ function re({ title: e = "Something Went Wrong", subtitle: t = "We encountered a
68
68
  children: t
69
69
  })]
70
70
  }),
71
- /* @__PURE__ */ p("button", {
71
+ /* @__PURE__ */ m("button", {
72
72
  onClick: n,
73
73
  style: {
74
74
  display: "flex",
@@ -84,7 +84,7 @@ function re({ title: e = "Something Went Wrong", subtitle: t = "We encountered a
84
84
  cursor: "pointer",
85
85
  letterSpacing: "-0.1px"
86
86
  },
87
- children: [/* @__PURE__ */ p("svg", {
87
+ children: [/* @__PURE__ */ m("svg", {
88
88
  width: "20",
89
89
  height: "20",
90
90
  viewBox: "0 0 24 24",
@@ -93,17 +93,17 @@ function re({ title: e = "Something Went Wrong", subtitle: t = "We encountered a
93
93
  strokeWidth: "2.5",
94
94
  strokeLinecap: "round",
95
95
  strokeLinejoin: "round",
96
- children: [/* @__PURE__ */ f("polyline", { points: "1 4 1 10 7 10" }), /* @__PURE__ */ f("path", { d: "M3.51 15a9 9 0 1 0 .49-3.51" })]
96
+ children: [/* @__PURE__ */ p("polyline", { points: "1 4 1 10 7 10" }), /* @__PURE__ */ p("path", { d: "M3.51 15a9 9 0 1 0 .49-3.51" })]
97
97
  }), "Retry Now"]
98
98
  })
99
99
  ] });
100
100
  }
101
101
  //#endregion
102
102
  //#region ../../node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs
103
- var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), ie = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), h = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), ae = (e) => {
104
- let t = h(e);
103
+ var h = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), g = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), _ = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), re = (e) => {
104
+ let t = _(e);
105
105
  return t.charAt(0).toUpperCase() + t.slice(1);
106
- }, oe = {
106
+ }, ie = {
107
107
  xmlns: "http://www.w3.org/2000/svg",
108
108
  width: 24,
109
109
  height: 24,
@@ -113,37 +113,37 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
113
113
  strokeWidth: 2,
114
114
  strokeLinecap: "round",
115
115
  strokeLinejoin: "round"
116
- }, se = (e) => {
116
+ }, ae = (e) => {
117
117
  for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
118
118
  return !1;
119
- }, ce = r({}), le = () => s(ce), ue = a(({ color: e, size: t, strokeWidth: n, absoluteStrokeWidth: r, className: a = "", children: o, iconNode: s, ...c }, l) => {
120
- let { size: u = 24, strokeWidth: d = 2, absoluteStrokeWidth: ee = !1, color: te = "currentColor", className: f = "" } = le() ?? {}, p = r ?? ee ? Number(n ?? d) * 24 / Number(t ?? u) : n ?? d;
119
+ }, oe = r({}), se = () => s(oe), ce = a(({ color: e, size: t, strokeWidth: n, absoluteStrokeWidth: r, className: a = "", children: o, iconNode: s, ...c }, l) => {
120
+ let { size: u = 24, strokeWidth: d = 2, absoluteStrokeWidth: f = !1, color: ee = "currentColor", className: p = "" } = se() ?? {}, m = r ?? f ? Number(n ?? d) * 24 / Number(t ?? u) : n ?? d;
121
121
  return i("svg", {
122
122
  ref: l,
123
- ...oe,
124
- width: t ?? u ?? oe.width,
125
- height: t ?? u ?? oe.height,
126
- stroke: e ?? te,
127
- strokeWidth: p,
128
- className: m("lucide", f, a),
129
- ...!o && !se(c) && { "aria-hidden": "true" },
123
+ ...ie,
124
+ width: t ?? u ?? ie.width,
125
+ height: t ?? u ?? ie.height,
126
+ stroke: e ?? ee,
127
+ strokeWidth: m,
128
+ className: h("lucide", p, a),
129
+ ...!o && !ae(c) && { "aria-hidden": "true" },
130
130
  ...c
131
131
  }, [...s.map(([e, t]) => i(e, t)), ...Array.isArray(o) ? o : [o]]);
132
- }), g = (e, t) => {
133
- let n = a(({ className: n, ...r }, a) => i(ue, {
132
+ }), v = (e, t) => {
133
+ let n = a(({ className: n, ...r }, a) => i(ce, {
134
134
  ref: a,
135
135
  iconNode: t,
136
- className: m(`lucide-${ie(ae(e))}`, `lucide-${e}`, n),
136
+ className: h(`lucide-${g(re(e))}`, `lucide-${e}`, n),
137
137
  ...r
138
138
  }));
139
- return n.displayName = ae(e), n;
140
- }, de = g("airplay", [["path", {
139
+ return n.displayName = re(e), n;
140
+ }, le = v("airplay", [["path", {
141
141
  d: "M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1",
142
142
  key: "ns4c3b"
143
143
  }], ["path", {
144
144
  d: "m12 15 5 6H7Z",
145
145
  key: "14qnn2"
146
- }]]), fe = g("captions", [["rect", {
146
+ }]]), ue = v("captions", [["rect", {
147
147
  width: "18",
148
148
  height: "14",
149
149
  x: "3",
@@ -154,7 +154,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
154
154
  }], ["path", {
155
155
  d: "M7 15h4M15 15h2M7 11h2M13 11h4",
156
156
  key: "1ueiar"
157
- }]]), pe = g("cast", [
157
+ }]]), de = v("cast", [
158
158
  ["path", {
159
159
  d: "M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6",
160
160
  key: "3zrzxg"
@@ -174,13 +174,13 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
174
174
  y2: "20",
175
175
  key: "xu2jvo"
176
176
  }]
177
- ]), _ = g("check", [["path", {
177
+ ]), y = v("check", [["path", {
178
178
  d: "M20 6 9 17l-5-5",
179
179
  key: "1gmf2c"
180
- }]]), me = g("chevron-left", [["path", {
180
+ }]]), fe = v("chevron-left", [["path", {
181
181
  d: "m15 18-6-6 6-6",
182
182
  key: "1wnfg3"
183
- }]]), he = g("external-link", [
183
+ }]]), pe = v("external-link", [
184
184
  ["path", {
185
185
  d: "M15 3h6v6",
186
186
  key: "1q9fwt"
@@ -193,13 +193,13 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
193
193
  d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",
194
194
  key: "a6xqqp"
195
195
  }]
196
- ]), ge = g("gauge", [["path", {
196
+ ]), me = v("gauge", [["path", {
197
197
  d: "m12 14 4-4",
198
198
  key: "9kzdfg"
199
199
  }], ["path", {
200
200
  d: "M3.34 19a10 10 0 1 1 17.32 0",
201
201
  key: "19p75a"
202
- }]]), _e = g("languages", [
202
+ }]]), he = v("languages", [
203
203
  ["path", {
204
204
  d: "m5 8 6 6",
205
205
  key: "1wu5hv"
@@ -224,7 +224,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
224
224
  d: "M14 18h6",
225
225
  key: "1m8k6r"
226
226
  }]
227
- ]), ve = g("list-video", [
227
+ ]), ge = v("list-video", [
228
228
  ["path", {
229
229
  d: "M21 5H3",
230
230
  key: "1fi0y6"
@@ -241,7 +241,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
241
241
  d: "M15 12.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997a1 1 0 0 1-1.517-.86z",
242
242
  key: "ms4nik"
243
243
  }]
244
- ]), ye = g("maximize", [
244
+ ]), _e = v("maximize", [
245
245
  ["path", {
246
246
  d: "M8 3H5a2 2 0 0 0-2 2v3",
247
247
  key: "1dcmit"
@@ -258,7 +258,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
258
258
  d: "M16 21h3a2 2 0 0 0 2-2v-3",
259
259
  key: "18trek"
260
260
  }]
261
- ]), be = g("minimize", [
261
+ ]), ve = v("minimize", [
262
262
  ["path", {
263
263
  d: "M8 3v3a2 2 0 0 1-2 2H3",
264
264
  key: "hohbtr"
@@ -275,7 +275,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
275
275
  d: "M16 21v-3a2 2 0 0 1 2-2h3",
276
276
  key: "ph8mxp"
277
277
  }]
278
- ]), v = g("pause", [["rect", {
278
+ ]), b = v("pause", [["rect", {
279
279
  x: "14",
280
280
  y: "3",
281
281
  width: "5",
@@ -289,7 +289,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
289
289
  height: "18",
290
290
  rx: "1",
291
291
  key: "1wsw3u"
292
- }]]), xe = g("picture-in-picture", [
292
+ }]]), ye = v("picture-in-picture", [
293
293
  ["path", {
294
294
  d: "M2 10h6V4",
295
295
  key: "zwrco"
@@ -314,28 +314,28 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
314
314
  rx: "1",
315
315
  key: "1wjs3o"
316
316
  }]
317
- ]), Se = g("play", [["path", {
317
+ ]), be = v("play", [["path", {
318
318
  d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
319
319
  key: "10ikf1"
320
- }]]), Ce = g("rotate-ccw", [["path", {
320
+ }]]), xe = v("rotate-ccw", [["path", {
321
321
  d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",
322
322
  key: "1357e3"
323
323
  }], ["path", {
324
324
  d: "M3 3v5h5",
325
325
  key: "1xhq8a"
326
- }]]), we = g("rotate-cw", [["path", {
326
+ }]]), Se = v("rotate-cw", [["path", {
327
327
  d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",
328
328
  key: "1p45f6"
329
329
  }], ["path", {
330
330
  d: "M21 3v5h-5",
331
331
  key: "1q7to0"
332
- }]]), Te = g("volume-1", [["path", {
332
+ }]]), Ce = v("volume-1", [["path", {
333
333
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
334
334
  key: "uqj9uw"
335
335
  }], ["path", {
336
336
  d: "M16 9a5 5 0 0 1 0 6",
337
337
  key: "1q6k2b"
338
- }]]), Ee = g("volume-2", [
338
+ }]]), we = v("volume-2", [
339
339
  ["path", {
340
340
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
341
341
  key: "uqj9uw"
@@ -348,7 +348,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
348
348
  d: "M19.364 18.364a9 9 0 0 0 0-12.728",
349
349
  key: "ijwkga"
350
350
  }]
351
- ]), De = g("volume-x", [
351
+ ]), Te = v("volume-x", [
352
352
  ["path", {
353
353
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
354
354
  key: "uqj9uw"
@@ -367,15 +367,15 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
367
367
  y2: "15",
368
368
  key: "5ykzw1"
369
369
  }]
370
- ]), Oe = g("volume", [["path", {
370
+ ]), Ee = v("volume", [["path", {
371
371
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
372
372
  key: "uqj9uw"
373
- }]]), ke = 1e4, Ae = !1, je = "\n html, body { margin: 0; padding: 0; height: 100%; background: #000; overflow: hidden; }\n * { box-sizing: border-box; }\n .gb-pip-video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }\n .gb-pip-overlay {\n position: absolute; inset: 0; z-index: 2;\n display: flex; flex-direction: column; justify-content: space-between;\n font-family: system-ui, -apple-system, sans-serif; color: #fff;\n opacity: 0; transition: opacity 0.15s ease;\n background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 65%, rgba(0,0,0,0.55) 100%);\n }\n .gb-pip-overlay:hover, .gb-pip-overlay.gb-pip-paused { opacity: 1; }\n .gb-pip-center {\n flex: 1; display: flex; align-items: center; justify-content: center; gap: 28px;\n }\n .gb-pip-btn {\n background: rgba(0,0,0,0.35); border: none; color: #fff; border-radius: 50%;\n width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;\n cursor: pointer; padding: 0;\n }\n .gb-pip-btn:hover { background: rgba(0,0,0,0.55); }\n .gb-pip-btn.gb-pip-play { width: 56px; height: 56px; }\n .gb-pip-bottom { padding: 6px 10px 8px; display: flex; flex-direction: column; gap: 4px; }\n .gb-pip-progress { position: relative; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.3); cursor: pointer; }\n .gb-pip-progress-fill { position: absolute; inset: 0; width: 0%; border-radius: 2px; background: #fff; }\n .gb-pip-time { font-size: 11px; font-variant-numeric: tabular-nums; opacity: 0.9; }\n", Me = (e) => {
373
+ }]]), De = 1e4, Oe = !1, ke = "\n html, body { margin: 0; padding: 0; height: 100%; background: #000; overflow: hidden; }\n * { box-sizing: border-box; }\n .gb-pip-video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }\n .gb-pip-overlay {\n position: absolute; inset: 0; z-index: 2;\n display: flex; flex-direction: column; justify-content: space-between;\n font-family: system-ui, -apple-system, sans-serif; color: #fff;\n opacity: 0; transition: opacity 0.15s ease;\n background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 65%, rgba(0,0,0,0.55) 100%);\n }\n .gb-pip-overlay:hover, .gb-pip-overlay.gb-pip-paused { opacity: 1; }\n .gb-pip-center {\n flex: 1; display: flex; align-items: center; justify-content: center; gap: 28px;\n }\n .gb-pip-btn {\n background: rgba(0,0,0,0.35); border: none; color: #fff; border-radius: 50%;\n width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;\n cursor: pointer; padding: 0;\n }\n .gb-pip-btn:hover { background: rgba(0,0,0,0.55); }\n .gb-pip-btn.gb-pip-play { width: 56px; height: 56px; }\n .gb-pip-bottom { padding: 6px 10px 8px; display: flex; flex-direction: column; gap: 4px; }\n .gb-pip-progress { position: relative; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.3); cursor: pointer; }\n .gb-pip-progress-fill { position: absolute; inset: 0; width: 0%; border-radius: 2px; background: #fff; }\n .gb-pip-time { font-size: 11px; font-variant-numeric: tabular-nums; opacity: 0.9; }\n", Ae = (e) => {
374
374
  let t = e.match(/#EXT-X-TITLE:(.+)/);
375
375
  if (t?.[1]?.trim()) return t[1].trim();
376
376
  let n = e.match(/#EXT-X-SESSION-DATA:[^\n]*DATA-ID="[^"]*title[^"]*"[^\n]*VALUE="([^"]+)"/i);
377
377
  return n?.[1]?.trim() ? n[1].trim() : null;
378
- }, y = (e) => {
378
+ }, je = (e) => {
379
379
  if (!e || e.length < 10 || e[0] !== 73 || e[1] !== 68 || e[2] !== 51) return null;
380
380
  let t = e[3], n = (e[6] & 127) << 21 | (e[7] & 127) << 14 | (e[8] & 127) << 7 | e[9] & 127, r = Math.min(10 + n, e.length), i = 10;
381
381
  for (; i + 10 <= r;) {
@@ -388,7 +388,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
388
388
  i += 10 + a;
389
389
  }
390
390
  return null;
391
- }, Ne = ({ size: e = 20 }) => /* @__PURE__ */ p("svg", {
391
+ }, Me = ({ size: e = 20 }) => /* @__PURE__ */ m("svg", {
392
392
  width: e,
393
393
  height: e,
394
394
  viewBox: "0 0 24 24",
@@ -398,17 +398,17 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
398
398
  strokeLinecap: "round",
399
399
  strokeLinejoin: "round",
400
400
  children: [
401
- /* @__PURE__ */ f("rect", {
401
+ /* @__PURE__ */ p("rect", {
402
402
  x: "2",
403
403
  y: "5",
404
404
  width: "20",
405
405
  height: "14",
406
406
  rx: "3"
407
407
  }),
408
- /* @__PURE__ */ f("path", { d: "M7 9v6M7 12h3M10 9v6" }),
409
- /* @__PURE__ */ f("path", { d: "M14 9h1.5a3 3 0 0 1 0 6H14z" })
408
+ /* @__PURE__ */ p("path", { d: "M7 9v6M7 12h3M10 9v6" }),
409
+ /* @__PURE__ */ p("path", { d: "M14 9h1.5a3 3 0 0 1 0 6H14z" })
410
410
  ]
411
- }), Pe = ({ size: e = 20 }) => /* @__PURE__ */ p("svg", {
411
+ }), Ne = ({ size: e = 20 }) => /* @__PURE__ */ m("svg", {
412
412
  width: e,
413
413
  height: e,
414
414
  viewBox: "0 0 24 24",
@@ -418,20 +418,20 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
418
418
  strokeLinecap: "round",
419
419
  strokeLinejoin: "round",
420
420
  children: [
421
- /* @__PURE__ */ f("rect", {
421
+ /* @__PURE__ */ p("rect", {
422
422
  x: "2",
423
423
  y: "5",
424
424
  width: "20",
425
425
  height: "14",
426
426
  rx: "3"
427
427
  }),
428
- /* @__PURE__ */ f("path", { d: "M7 9v6M7 12h3M10 9v6" }),
429
- /* @__PURE__ */ f("path", { d: "M14 9h1.5a3 3 0 0 1 0 6H14z" })
428
+ /* @__PURE__ */ p("path", { d: "M7 9v6M7 12h3M10 9v6" }),
429
+ /* @__PURE__ */ p("path", { d: "M14 9h1.5a3 3 0 0 1 0 6H14z" })
430
430
  ]
431
- }), Fe = (e) => {
431
+ }), Pe = (e) => {
432
432
  let t = e.replace("#", "");
433
433
  return t.length === 6 ? `${parseInt(t.substring(0, 2), 16)}, ${parseInt(t.substring(2, 4), 16)}, ${parseInt(t.substring(4, 6), 16)}` : t.length === 3 ? `${parseInt(t[0] + t[0], 16)}, ${parseInt(t[1] + t[1], 16)}, ${parseInt(t[2] + t[2], 16)}` : "99, 102, 241";
434
- }, Ie = {
434
+ }, Fe = {
435
435
  en: "English",
436
436
  eng: "English",
437
437
  fr: "French",
@@ -454,37 +454,37 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
454
454
  hi: "Hindi",
455
455
  ta: "Tamil",
456
456
  tam: "Tamil"
457
- }, Le = (e) => {
457
+ }, Ie = (e) => {
458
458
  if (!e) return null;
459
459
  let t = e.trim().toLowerCase(), n = t.match(/^(en|eng|fr|fre|fra|es|spa|de|ger|deu|it|ita|pt|por|ja|zh|ko|ru|ar|hi|ta|tam)/);
460
- if (n && Ie[n[0]]) return Ie[n[0]];
461
- for (let [e, n] of Object.entries(Ie)) if (t.includes(e)) return n;
460
+ if (n && Fe[n[0]]) return Fe[n[0]];
461
+ for (let [e, n] of Object.entries(Fe)) if (t.includes(e)) return n;
462
462
  return /english|anglais|ingles/i.test(t) ? "English" : /french|français/i.test(t) ? "French" : /spanish|español/i.test(t) ? "Spanish" : /german|deutsch/i.test(t) ? "German" : /italian|italiano/i.test(t) ? "Italian" : /portuguese|português/i.test(t) ? "Portuguese" : /japanese|nihongo/i.test(t) ? "Japanese" : /chinese|中文/i.test(t) ? "Chinese" : /korean|한국어/i.test(t) ? "Korean" : /tamil|தமிழ்/i.test(t) ? "Tamil" : /russian|русский/i.test(t) ? "Russian" : /arabic|العربية/i.test(t) ? "Arabic" : /hindi|हिन्दी/i.test(t) ? "Hindi" : null;
463
- }, b = (e) => {
463
+ }, x = (e) => {
464
464
  if (e.lang) {
465
- let t = Le(e.lang);
465
+ let t = Ie(e.lang);
466
466
  if (t) return t;
467
467
  }
468
468
  if (e.label) {
469
469
  let t = e.label.trim(), n = t.split(/[#\d\.\s\-_/|:]+/).filter(Boolean);
470
470
  for (let e = n.length - 1; e >= 0; --e) {
471
- let t = Le(n[e]);
471
+ let t = Ie(n[e]);
472
472
  if (t) return t;
473
473
  }
474
474
  let r = t.replace(/^[#\d\.\s]+/, "").trim();
475
- return Le(r) || r;
475
+ return Ie(r) || r;
476
476
  }
477
477
  return "Unknown";
478
- }, Re = (e) => {
478
+ }, Le = (e) => {
479
479
  let t = /* @__PURE__ */ new Set();
480
480
  return e.filter((e) => {
481
- let n = `${b(e).toLowerCase()}|${(e.lang || "").trim().toLowerCase()}`;
481
+ let n = `${x(e).toLowerCase()}|${(e.lang || "").trim().toLowerCase()}`;
482
482
  return t.has(n) ? !1 : (t.add(n), !0);
483
483
  });
484
- }, ze = (e) => {
484
+ }, Re = (e) => {
485
485
  let t = (e ?? "").split(":").map(Number);
486
486
  return (t[0] || 0) * 3600 + (t[1] || 0) * 60 + (t[2] || 0);
487
- }, Be = (e) => {
487
+ }, ze = (e) => {
488
488
  if (!e) return !1;
489
489
  try {
490
490
  let { protocol: t } = new URL(e, window.location.href);
@@ -492,15 +492,15 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
492
492
  } catch {
493
493
  return !1;
494
494
  }
495
- }, Ve = (e) => {
495
+ }, Be = (e) => {
496
496
  if (typeof e == "number") return Number.isFinite(e) && e >= 0 ? e : null;
497
497
  if (typeof e != "string") return null;
498
498
  let t = e.trim();
499
499
  if (!t) return null;
500
- if (/^\d+:\d{1,2}:\d{1,2}(\.\d+)?$/.test(t)) return ze(t);
500
+ if (/^\d+:\d{1,2}:\d{1,2}(\.\d+)?$/.test(t)) return Re(t);
501
501
  let n = Number(t);
502
502
  return Number.isFinite(n) && n >= 0 ? n : null;
503
- }, He = [
503
+ }, Ve = [
504
504
  0,
505
505
  1e3,
506
506
  2e3,
@@ -508,7 +508,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
508
508
  5e3,
509
509
  8e3
510
510
  ];
511
- function Ue(e, t, n) {
511
+ function He(e, t, n) {
512
512
  let r = !1, i, a = (o) => {
513
513
  i = setTimeout(() => {
514
514
  r || fetch(e).then((e) => e.json()).then((e) => {
@@ -518,54 +518,57 @@ function Ue(e, t, n) {
518
518
  n(i);
519
519
  return;
520
520
  }
521
- o + 1 < He.length && a(o + 1);
521
+ o + 1 < Ve.length && a(o + 1);
522
522
  }).catch(() => {
523
- r || o + 1 < He.length && a(o + 1);
523
+ r || o + 1 < Ve.length && a(o + 1);
524
524
  });
525
- }, He[o]);
525
+ }, Ve[o]);
526
526
  };
527
527
  return a(0), () => {
528
528
  r = !0, i && clearTimeout(i);
529
529
  };
530
530
  }
531
- var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoments: ne, subtitles: m = [], watermark: ie, themeColor: h = "#6366f1", drmConfig: ae, firebaseConfig: oe, videoId: se, onAnalyticsEvent: ce, onAdBreakChange: le, onKeyMomentsLoaded: ue, enableControls: g = !0, enableChromecast: Ie, enableKeyMoments: Le, enableSubtitles: He, enableQuality: We, enablePlaybackSpeed: Ge, enablePiP: Ke, enableFullscreen: qe = !0, autoFullscreen: Je = !1, watchProgressInterval: Ye = 30, subtitleStyle: Xe = {}, resolvedEntitlement: Ze, licenseKey: Qe, title: x, chaptersDisplayMode: $e = "strip", volumeControlType: et = "slider", urlTransformer: tt, pauseAdOnTabSwitch: nt = !0, enableSkipAd: rt = !1, skipAdAfterSeconds: it = 5, overlayAdUrl: at, adTrackingUrl: ot, sources: S, activeSourceIndex: st = 0, onSourceChange: ct, initialTime: lt, onTimeUpdate: ut }) => {
532
- let dt = tt ?? ((e) => e), C = u(null), ft = u(null), pt = u(!1), w = u(null), mt = u(0), ht = u(null), T = u(null), gt = u(null), _t = u(null), vt = u(!1), E = u(!1), D = u(null), O = u(null), k = u(null), yt = u(null), bt = u(() => {}), A = u(null), xt = u(!1), St = u(null), Ct = (e) => {
533
- !e || St.current !== null || (St.current = e.muted, e.muted = !0);
534
- }, wt = (e) => {
535
- St.current !== null && (e && (e.muted = St.current), St.current = null);
536
- }, Tt = u(null), Et = u(!1), Dt = u(null), Ot = u(null), kt = u(null), j = u(null), At = u(null), jt = u(S), Mt = u(ct), Nt = u(!1), M = u(null), N = u(null), P = u(null), Pt = u(null), Ft = u(0), It = u(null), [Lt, Rt] = d(!1), zt = u(!1), Bt = u(null), [Vt, Ht] = d(null);
531
+ var Ue = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoments: te, subtitles: h = [], watermark: g, themeColor: _ = "#6366f1", drmConfig: re, firebaseConfig: ie, videoId: ae, onAnalyticsEvent: oe, onAdBreakChange: se, onKeyMomentsLoaded: ce, enableControls: v = !0, enableChromecast: Fe, enableKeyMoments: Ie, enableSubtitles: Ve, enableQuality: Ue, enablePlaybackSpeed: We, enablePiP: Ge, enableFullscreen: Ke = !0, autoFullscreen: qe = !1, watchProgressInterval: Je = 30, subtitleStyle: Ye = {}, resolvedEntitlement: Xe, licenseKey: Ze, title: S, chaptersDisplayMode: Qe = "strip", volumeControlType: $e = "slider", urlTransformer: et, pauseAdOnTabSwitch: tt = !0, enableSkipAd: nt = !1, skipAdAfterSeconds: rt = 5, overlayAdUrl: it, adTrackingUrl: at, sources: C, activeSourceIndex: ot = 0, onSourceChange: st, initialTime: ct, onTimeUpdate: lt }) => {
532
+ let ut = et ?? ((e) => e), w = u(null), dt = u(null), ft = u(!1), T = u(null), pt = u(0), mt = u(null), E = u(null), ht = u(null), gt = u(null), _t = u(!1), D = u(!1), O = u(null), k = u(null), A = u(null), vt = u(null), yt = u(() => {}), j = u(null), bt = u(!1), xt = u(null), St = (e) => {
533
+ !e || xt.current !== null || (xt.current = e.muted, e.muted = !0);
534
+ }, Ct = (e) => {
535
+ xt.current !== null && (e && (e.muted = xt.current), xt.current = null);
536
+ }, wt = u(null), Tt = u(!1), Et = u(null), Dt = u(null), Ot = u(null), kt = u(null), At = u(null), jt = u(null), Mt = u(C), Nt = u(st), Pt = u(!1), M = u(null), N = u(null), P = u(null), Ft = u(null), It = u(0), Lt = u(null), [Rt, zt] = d(!1), Bt = u(!1), Vt = u(null), [Ht, Ut] = d(null);
537
537
  c(() => {
538
- if (typeof window > "u" || Ae) return;
538
+ if (typeof window > "u" || Oe) return;
539
539
  let e = window.requestAnimationFrame(() => {
540
- let e = C.current;
540
+ let e = w.current;
541
541
  if (!e) return;
542
542
  let t = window.getComputedStyle(e);
543
- t.overflow !== "hidden" && t.borderTopLeftRadius === "0px" && (Ae = !0, console.warn("[boss-web-player-sdk] Player styles appear to be missing — the player will look broken/unstyled.\nImport the stylesheet once at your app entry point:\n import 'boss-web-player-sdk/css';"));
543
+ t.overflow !== "hidden" && t.borderTopLeftRadius === "0px" && (Oe = !0, console.warn("[boss-web-player-sdk] Player styles appear to be missing — the player will look broken/unstyled.\nImport the stylesheet once at your app entry point:\n import 'boss-web-player-sdk/css';"));
544
544
  });
545
545
  return () => window.cancelAnimationFrame(e);
546
546
  }, []), c(() => {
547
- let e = C.current;
547
+ let e = w.current;
548
548
  if (!e) return;
549
549
  let t = new ResizeObserver((e) => {
550
- for (let t of e) Rt(t.contentRect.width <= 768);
550
+ for (let t of e) zt(t.contentRect.width <= 768);
551
551
  });
552
- return t.observe(e), Rt(e.getBoundingClientRect().width <= 768), () => t.disconnect();
552
+ return t.observe(e), zt(e.getBoundingClientRect().width <= 768), () => t.disconnect();
553
553
  }, []);
554
- let [F, Ut] = d(null), [Wt, Gt] = d(!1), Kt = Ze ?? null, qt = Kt != null, Jt = Kt?.features ?? {}, Yt = qt ? !!(Jt.drm_protection && !Qe) : !1, I = {
555
- enableSubtitles: qt ? !!Jt.subtitle_support : typeof He == "boolean" ? He : !0,
556
- enableChromecast: qt ? !!Jt.chromecast : typeof Ie == "boolean" ? Ie : !0,
557
- enableKeyMoments: qt ? !!Jt.key_moments : typeof Le == "boolean" ? Le : !0,
558
- enableQuality: qt ? !!Jt.multiple_resolution : typeof We == "boolean" ? We : !0,
559
- enablePlaybackSpeed: qt ? !!Jt.playback_speed : typeof Ge == "boolean" ? Ge : !0,
560
- enablePiP: qt ? !!Jt.picture_in_picture : typeof Ke == "boolean" ? Ke : !0,
561
- allowAirplay: qt ? !!Jt.airplay : !1,
562
- allowMultipleAudio: qt ? !!Jt.multiple_audio : !0,
563
- m3u8_playback: qt ? !!Jt.m3u8_playback : !0,
564
- drm_protection: qt ? !!Jt.drm_protection : !1
565
- }, [Xt, Zt] = d(!1), [Qt, $t] = d(0), [en, tn] = d(!1), [L, nn] = d(0), [rn, an] = d(0), [on, sn] = d(1), [cn, ln] = d(!1), [un, dn] = d(!1), [fn, pn] = d(!1), [mn, hn] = d(!1), [gn, _n] = d(!1), vn = Lt || (fn || mn) && gn, [yn, bn] = d(!1), [xn, Sn] = d(null), [Cn, wn] = d(!1), [R, Tn] = d([]), z = u([]), En = u(/* @__PURE__ */ new Set()), Dn = S && S.length > 0 ? S.map((e) => e.url).join("|") : r, [On, kn] = d(/* @__PURE__ */ new Set()), [An, jn] = d(Dn), Mn = u(null), Nn = u(!1), Pn = u(null);
566
- An !== Dn && (jn(Dn), kn(/* @__PURE__ */ new Set()), En.current = /* @__PURE__ */ new Set(), Mn.current = null, Nn.current = !1);
567
- let Fn = u(null), In = u(!1), [Ln, Rn] = d([]), [zn, Bn] = d(null), Vn = u([]), Hn = u(null), Un = u(/* @__PURE__ */ new Set()), [Wn, Gn] = d([]), Kn = u([]), [qn, Jn] = d([]), Yn = (e) => {
568
- let t = Kn.current.find((t) => e >= t.startTimeSeconds && e < t.endTimeSeconds);
554
+ let [F, Wt] = d(null), [Gt, Kt] = d(!1), qt = Xe ?? null, Jt = qt != null, Yt = qt?.features ?? {}, Xt = Jt ? !!(Yt.drm_protection && !Ze) : !1, I = {
555
+ enableSubtitles: Jt ? !!Yt.subtitle_support : typeof Ve == "boolean" ? Ve : !0,
556
+ enableChromecast: Jt ? !!Yt.chromecast : typeof Fe == "boolean" ? Fe : !0,
557
+ enableKeyMoments: Jt ? !!Yt.key_moments : typeof Ie == "boolean" ? Ie : !0,
558
+ enableQuality: Jt ? !!Yt.multiple_resolution : typeof Ue == "boolean" ? Ue : !0,
559
+ enablePlaybackSpeed: Jt ? !!Yt.playback_speed : typeof We == "boolean" ? We : !0,
560
+ enablePiP: Jt ? !!Yt.picture_in_picture : typeof Ge == "boolean" ? Ge : !0,
561
+ allowAirplay: Jt ? !!Yt.airplay : !1,
562
+ allowMultipleAudio: Jt ? !!Yt.multiple_audio : !0,
563
+ m3u8_playback: Jt ? !!Yt.m3u8_playback : !0,
564
+ drm_protection: Jt ? !!Yt.drm_protection : !1
565
+ }, [Zt, Qt] = d(!1), [$t, en] = d(0), [tn, nn] = d(!1), [L, rn] = d(0), [an, on] = d(0), [sn, cn] = d(1), [ln, un] = d(!1), [dn, fn] = d(!1), [pn, mn] = d(!1), [hn, gn] = d(!1), [_n, vn] = d(!1), yn = Rt || (pn || hn) && _n, [bn, xn] = d(!1), [Sn, Cn] = d(null), [wn, Tn] = d(!1), [R, En] = d([]), z = u([]), Dn = u(/* @__PURE__ */ new Set()), On = C && C.length > 0 ? C.map((e) => e.url).join("|") : r, [kn, An] = d(/* @__PURE__ */ new Set()), [jn, Mn] = d(On), Nn = u(null), Pn = u(!1), Fn = u(null);
566
+ jn !== On && (Mn(On), An(/* @__PURE__ */ new Set()), Dn.current = /* @__PURE__ */ new Set(), Nn.current = null, Pn.current = !1);
567
+ let In = u(null), Ln = u(!1), [Rn, zn] = d([]), [Bn, Vn] = d(null), Hn = u([]), Un = u(null), Wn = u(/* @__PURE__ */ new Set()), [Gn, Kn] = d([]), qn = u([]), Jn = u(null), [Yn, Xn] = d({
568
+ w: 0,
569
+ h: 0
570
+ }), [Zn, Qn] = d([]), $n = (e) => {
571
+ let t = qn.current.find((t) => e >= t.startTimeSeconds && e < t.endTimeSeconds);
569
572
  if (t) return {
570
573
  start: t.startTimeSeconds,
571
574
  end: t.endTimeSeconds
@@ -575,7 +578,7 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
575
578
  start: n.startTime,
576
579
  end: n.endTime
577
580
  } : null;
578
- }, Xn = l(() => R.reduce((e, t) => e + (t.endTime - t.startTime), 0), [R]), Zn = rn > 0 ? Math.max(0, rn - Xn) : 0, B = R.length > 0 && Zn > 0 ? Zn : rn, V = o((e) => {
581
+ }, er = l(() => R.reduce((e, t) => e + (t.endTime - t.startTime), 0), [R]), tr = an > 0 ? Math.max(0, an - er) : 0, B = R.length > 0 && tr > 0 ? tr : an, V = o((e) => {
579
582
  let t = e;
580
583
  for (let n of R) e >= n.endTime ? t -= n.endTime - n.startTime : e >= n.startTime && (t -= e - n.startTime);
581
584
  return Math.max(0, t);
@@ -583,38 +586,38 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
583
586
  let t = e;
584
587
  for (let e of R) t >= e.startTime && (t += e.endTime - e.startTime);
585
588
  return t;
586
- }, [R]), [Qn, $n] = d([]), [er, tr] = d({
589
+ }, [R]), [nr, rr] = d([]), [ir, ar] = d({
587
590
  id: -1,
588
591
  height: 0,
589
592
  width: 0,
590
593
  bitrate: 0,
591
594
  label: "Auto"
592
- }), [nr, rr] = d(""), [U, ir] = d("off"), [ar, or] = d(Re(m)), [sr, cr] = d([]), [lr, ur] = d(0);
595
+ }), [or, sr] = d(""), [U, cr] = d("off"), [lr, ur] = d(Le(h)), [dr, fr] = d([]), [pr, mr] = d(0);
593
596
  c(() => {
594
597
  if (F) {
595
598
  let e = F.subtitles.getTracks();
596
- or(Re([...m, ...e.filter((e) => !m.some((t) => t.id === e.id))]));
597
- } else or(Re(m));
598
- }, [m.map((e) => e.id).join(","), F]);
599
- let [dr, fr] = d({
599
+ ur(Le([...h, ...e.filter((e) => !h.some((t) => t.id === e.id))]));
600
+ } else ur(Le(h));
601
+ }, [h.map((e) => e.id).join(","), F]);
602
+ let [hr, gr] = d({
600
603
  chapter: null,
601
604
  index: -1
602
- }), [W, pr] = d(ne || s || []), [G, K] = d("none"), [mr, hr] = d(1), [gr, _r] = d(!1), [vr, yr] = d({}), [br, xr] = d(""), [Sr, Cr] = d(null), wr = u(!1), Tr = JSON.stringify(W.map((e) => ({
605
+ }), [W, _r] = d(te || s || []), [G, K] = d("none"), [vr, yr] = d(1), [br, xr] = d(!1), [Sr, Cr] = d({}), [wr, Tr] = d(""), [Er, Dr] = d(null), Or = u(!1), kr = JSON.stringify(W.map((e) => ({
603
606
  title: e.title,
604
607
  startTime: e.startTime
605
608
  })));
606
609
  c(() => {
607
- pr(ne || s || []);
608
- }, [(ne || s || []).map((e) => `${e.startTime}:${e.title}`).join(",")]), c(() => {
610
+ _r(te || s || []);
611
+ }, [(te || s || []).map((e) => `${e.startTime}:${e.title}`).join(",")]), c(() => {
609
612
  if (!r || !W || W.length === 0) return;
610
- yr({});
613
+ Cr({});
611
614
  let e = document.createElement("video");
612
615
  e.muted = !0, e.preload = "metadata", e.crossOrigin = "anonymous", e.style.cssText = "position:fixed;top:0;left:0;width:10px;height:10px;opacity:0.01;pointer-events:none;z-index:-9999;", document.body.appendChild(e);
613
616
  let t = null, i = r.includes(".m3u8"), a = document.createElement("canvas");
614
617
  a.width = 160, a.height = 90;
615
618
  let o = a.getContext("2d"), s = 0, c = !1, l = () => {
616
619
  if (s >= W.length) {
617
- ee();
620
+ f();
618
621
  return;
619
622
  }
620
623
  let t = W[s].startTime;
@@ -623,7 +626,7 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
623
626
  if (o && e.readyState >= 2) {
624
627
  o.drawImage(e, 0, 0, a.width, a.height);
625
628
  let t = a.toDataURL("image/jpeg", .8);
626
- yr((e) => ({
629
+ Cr((e) => ({
627
630
  ...e,
628
631
  [s]: t
629
632
  })), s++, l();
@@ -635,34 +638,34 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
635
638
  enableWorker: !1,
636
639
  maxBufferLength: 5,
637
640
  xhrSetup: (e, t) => {
638
- let n = ae?.authToken;
641
+ let n = re?.authToken;
639
642
  try {
640
- let r = dt(t), i = new URL(r, window.location.origin);
643
+ let r = ut(t), i = new URL(r, window.location.origin);
641
644
  n && i.searchParams.set("token", n), e.open("GET", i.toString(), !0);
642
645
  } catch (e) {
643
646
  console.error("[WebVideoPlayer tempHls] xhrSetup error:", e);
644
647
  }
645
648
  }
646
- }), t.loadSource(dt(r)), t.attachMedia(e)) : e.src = r, e.readyState >= 2 && d();
647
- let ee = () => {
649
+ }), t.loadSource(ut(r)), t.attachMedia(e)) : e.src = r, e.readyState >= 2 && d();
650
+ let f = () => {
648
651
  e.removeEventListener("seeked", u), e.removeEventListener("canplay", d), t && t.destroy(), document.body.contains(e) && document.body.removeChild(e);
649
652
  };
650
- return ee;
651
- }, [r, Tr]);
652
- let [q, Er] = d(null), [Dr, Or] = d(null), kr = u(!1), [Ar, jr] = d(!1), [Mr, Nr] = d(!1), [Pr, Fr] = d(null), [Ir, Lr] = d(null), [Rr, zr] = d(0), [Br, Vr] = d(0), [Hr, Ur] = d(null), [Wr, Gr] = d(null), [J, Kr] = d(null);
653
+ return f;
654
+ }, [r, kr]);
655
+ let [q, Ar] = d(null), [jr, Mr] = d(null), Nr = u(!1), [Pr, Fr] = d(!1), [Ir, Lr] = d(!1), [Rr, zr] = d(null), [Br, Vr] = d(null), [Hr, Ur] = d(0), [Wr, Gr] = d(0), [Kr, qr] = d(null), [Jr, Yr] = d(null), [J, Xr] = d(null);
653
656
  c(() => {
654
- if (yt.current && !yt.current.querySelector("google-cast-launcher")) {
657
+ if (vt.current && !vt.current.querySelector("google-cast-launcher")) {
655
658
  let e = document.createElement("google-cast-launcher");
656
- e.style.cursor = "pointer", e.style.width = "100%", e.style.height = "100%", e.style.display = "block", yt.current.appendChild(e);
659
+ e.style.cursor = "pointer", e.style.width = "100%", e.style.height = "100%", e.style.display = "block", vt.current.appendChild(e);
657
660
  }
658
661
  }, []), c(() => {
659
662
  if (!F) {
660
- jr(!1), Nr(!1), Fr(null);
663
+ Fr(!1), Lr(!1), zr(null);
661
664
  return;
662
665
  }
663
- let e = (e) => jr(e), t = () => {
666
+ let e = (e) => Fr(e), t = () => {
664
667
  let e = F.getVideoElement(), t = !!e?.webkitCurrentPlaybackTargetIsWireless;
665
- Nr(t), Fr(t ? e.webkitCurrentPlaybackTargetName || "AirPlay device" : null);
668
+ Lr(t), zr(t ? e.webkitCurrentPlaybackTargetName || "AirPlay device" : null);
666
669
  };
667
670
  e(F.casting.isAirPlayAvailable()), t();
668
671
  let n = F.getVideoElement(), r = (t) => {
@@ -674,124 +677,134 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
674
677
  "webkitShowPlaybackTargetPicker" in n && (n.removeEventListener("webkitplaybacktargetavailabilitychanged", r), n.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged", i));
675
678
  };
676
679
  }, [F]);
677
- let [qr, Jr] = d(""), [Yr, Xr] = d(!0), [Y, Zr] = d(!1), [Qr, $r] = d(!1), ei = u(!1), ti = u(null), ni = u(!1), ri = u(!1), ii = u("none"), ai = u(m), oi = () => {
678
- Xr(!0), ti.current && window.clearTimeout(ti.current);
679
- let e = zt.current ? 3500 : 1e4;
680
- ti.current = window.setTimeout(() => {
681
- ni.current && ii.current === "none" && Xr(!1);
680
+ let [Zr, Qr] = d(""), [$r, ei] = d(!0), [Y, ti] = d(!1), [ni, ri] = d(!1), ii = u(!1), ai = u(null), oi = u(!1), si = u(!1), ci = u("none"), li = u(h), ui = () => {
681
+ ei(!0), ai.current && window.clearTimeout(ai.current);
682
+ let e = Bt.current ? 3500 : 1e4;
683
+ ai.current = window.setTimeout(() => {
684
+ oi.current && ci.current === "none" && ei(!1);
682
685
  }, e);
683
- }, si = o((e) => {
684
- j.current &&= (clearTimeout(j.current), null);
685
- let t = jt.current, n = t?.[e]?.label ?? "This format", r = t?.[0]?.label ?? "default";
686
- At.current = null, Cr(`${n} isn't supported on this device. Switched to ${r}.`), window.setTimeout(() => Cr(null), 4e3), Mt.current?.(0);
686
+ }, di = o((e) => {
687
+ At.current &&= (clearTimeout(At.current), null);
688
+ let t = Mt.current, n = t?.[e]?.label ?? "This format", r = t?.[0]?.label ?? "default";
689
+ jt.current = null, Dr(`${n} isn't supported on this device. Switched to ${r}.`), window.setTimeout(() => Dr(null), 4e3), Nt.current?.(0);
687
690
  }, []);
688
691
  c(() => {
689
- if (!C.current) return;
692
+ if (!w.current) return;
690
693
  let o = document.createElement("video");
691
- o.muted = !0, o.preload = "metadata", o.crossOrigin = "anonymous", o.style.cssText = "display:none;position:absolute;pointer-events:none;", document.body.appendChild(o), T.current = o;
694
+ o.muted = !0, o.preload = "metadata", o.crossOrigin = "anonymous", o.style.cssText = "display:none;position:absolute;pointer-events:none;", document.body.appendChild(o), E.current = o;
692
695
  let s = r.includes(".m3u8");
693
696
  if (s && n.isSupported()) {
694
697
  let e = new n({
695
698
  enableWorker: !1,
696
699
  maxBufferLength: 5,
697
700
  xhrSetup: (e, t) => {
698
- let n = ae?.authToken;
701
+ let n = re?.authToken;
699
702
  try {
700
- let r = dt(t), i = new URL(r, window.location.origin);
703
+ let r = ut(t), i = new URL(r, window.location.origin);
701
704
  n && i.searchParams.set("token", n), e.open("GET", i.toString(), !0);
702
705
  } catch (e) {
703
706
  console.error("[WebVideoPlayer hiddenHls] xhrSetup error:", e);
704
707
  }
705
708
  }
706
709
  });
707
- e.loadSource(dt(r)), e.attachMedia(o), gt.current = e, e.on(n.Events.MANIFEST_LOADED, (e, t) => {
708
- if (x) return;
709
- let n = Me(t?.networkDetails?.responseText ?? "");
710
- n && Jr(n);
710
+ e.loadSource(ut(r)), e.attachMedia(o), ht.current = e, e.on(n.Events.MANIFEST_LOADED, (e, t) => {
711
+ if (S) return;
712
+ let n = Ae(t?.networkDetails?.responseText ?? "");
713
+ n && Qr(n);
711
714
  }), e.on(n.Events.FRAG_PARSING_METADATA, (e, t) => {
712
- if (!(x || qr)) for (let e of t?.samples ?? []) {
713
- let t = y(e.data);
715
+ if (!(S || Zr)) for (let e of t?.samples ?? []) {
716
+ let t = je(e.data);
714
717
  if (t) {
715
- Jr(t);
718
+ Qr(t);
716
719
  break;
717
720
  }
718
721
  }
719
722
  });
720
723
  } else s && o.canPlayType("application/vnd.apple.mpegurl"), o.src = r;
721
724
  o.addEventListener("seeked", () => {
722
- let e = ht.current;
725
+ let e = mt.current;
723
726
  if (!e) return;
724
727
  let t = e.getContext("2d");
725
- t && o.readyState >= 2 && (t.drawImage(o, 0, 0, e.width, e.height), Ur(e.toDataURL("image/jpeg", .82)));
728
+ t && o.readyState >= 2 && (t.drawImage(o, 0, 0, e.width, e.height), qr(e.toDataURL("image/jpeg", .82)));
726
729
  });
727
730
  let c;
728
- if (oe) {
729
- let t = new e(oe);
730
- ft.current = t, c = t.createCallback();
731
+ if (ie) {
732
+ let t = new e(ie);
733
+ dt.current = t, c = t.createCallback();
731
734
  }
732
- if (Yt) return;
735
+ if (Xt) return;
733
736
  let l = new t({
734
- container: C.current,
737
+ container: w.current,
735
738
  src: r,
736
- videoId: se,
739
+ videoId: ae,
737
740
  autoplay: i,
738
741
  muted: a,
739
742
  keyMoments: W,
740
- subtitles: m,
743
+ subtitles: h,
741
744
  drm: {
742
- watermarkText: ie,
745
+ watermarkText: g,
743
746
  allowedDomains: [
744
747
  "localhost",
745
748
  "127.0.0.1",
746
749
  window.location.hostname
747
750
  ],
748
- ...ae
751
+ ...re
749
752
  },
750
753
  analyticsCallback: (e) => {
751
- if (e.sessionId && (Mn.current === null ? Mn.current = e.sessionId : e.sessionId !== Mn.current && (e = {
754
+ if (e.sessionId && (Nn.current === null ? Nn.current = e.sessionId : e.sessionId !== Nn.current && (e = {
752
755
  ...e,
753
- sessionId: Mn.current
756
+ sessionId: Nn.current
754
757
  })), e.eventType === "session_start") {
755
- if (Nn.current) return;
756
- Nn.current = !0;
758
+ if (Pn.current) return;
759
+ Pn.current = !0;
757
760
  }
758
- c?.(e), ce && ce(e);
761
+ c?.(e), oe && oe(e);
759
762
  },
760
- analyticsSessionSeed: Pn.current?.key === Dn ? Pn.current.snapshot : void 0,
761
- watchProgressInterval: Ye * 1e3,
762
- themeColor: h,
763
- urlTransformer: tt
763
+ analyticsSessionSeed: Fn.current?.key === On ? Fn.current.snapshot : void 0,
764
+ watchProgressInterval: Je * 1e3,
765
+ themeColor: _,
766
+ urlTransformer: et
764
767
  });
765
768
  l.on("keymomentsloaded", (e) => {
766
- pr(e), ue && ue(e);
769
+ _r(e), ce && ce(e);
767
770
  }), l.on("chaptersloaded", (e) => {
768
- pr(e), ue && ue(e);
771
+ _r(e), ce && ce(e);
769
772
  }), l.on("play", () => {
770
- tn(!0), wn(!1), te(l.getCurrentTime(), !1);
773
+ nn(!0), Tn(!1), ee(l.getCurrentTime(), !1);
771
774
  }), l.on("pause", () => {
772
- tn(!1), te(l.getCurrentTime(), !0);
775
+ nn(!1), ee(l.getCurrentTime(), !0);
773
776
  }), l.on("ended", () => {
774
- tn(!1), wn(!0);
777
+ nn(!1), Tn(!0);
775
778
  });
776
779
  let u = () => {
777
- xt.current = !0, dn(!1), A.current && (A.current.style.opacity = "1"), Ct(l.getVideoElement());
780
+ bt.current = !0, fn(!1), j.current && (j.current.style.opacity = "1"), St(l.getVideoElement());
778
781
  }, d = () => {
779
782
  requestAnimationFrame(() => {
780
783
  requestAnimationFrame(() => {
781
- xt.current = !1, A.current && (A.current.style.opacity = "0"), wt(l.getVideoElement());
784
+ bt.current = !1, j.current && (j.current.style.opacity = "0"), Ct(l.getVideoElement());
782
785
  let e = l.getVideoElement();
783
- e && !e.paused && e.readyState < 3 && dn(!0);
786
+ e && !e.paused && e.readyState < 3 && fn(!0);
784
787
  });
785
788
  });
786
- }, ee = (e, t = !1) => {
787
- E.current = !0;
788
- let n = t ? e + .5 : Dt.current ?? e + .5;
789
- t || (Dt.current = null), Et.current = t, D.current = n, O.current = l.getCurrentTime(), u(), l.seek(n), k.current && window.clearTimeout(k.current), k.current = window.setTimeout(() => {
790
- E.current = !1, D.current = null, O.current = null, k.current = null, Et.current = !1, d();
789
+ }, f = (e, t = !1) => {
790
+ D.current = !0;
791
+ let n = t ? e + .5 : Et.current ?? e + .5;
792
+ t || (Et.current = null), Tt.current = t, O.current = n, k.current = l.getCurrentTime(), u(), l.seek(n);
793
+ let r = l.getVideoElement();
794
+ if (r) {
795
+ let e = () => {
796
+ r.removeEventListener("seeked", e), A.current &&= (window.clearTimeout(A.current), null), D.current = !1, O.current = null, k.current = null;
797
+ let t = Tt.current;
798
+ Tt.current = !1, (t || Et.current === null) && d();
799
+ };
800
+ r.addEventListener("seeked", e);
801
+ }
802
+ A.current && window.clearTimeout(A.current), A.current = window.setTimeout(() => {
803
+ D.current = !1, O.current = null, k.current = null, A.current = null, Tt.current = !1, d();
791
804
  }, 3e3);
792
805
  };
793
- Tt.current = ee;
794
- let te = (e, t) => {
806
+ wt.current = f;
807
+ let ee = (e, t) => {
795
808
  if (!("mediaSession" in navigator) || !navigator.mediaSession.setPositionState) return;
796
809
  navigator.mediaSession.playbackState = t ? "paused" : "playing";
797
810
  let n = l.getDuration(), r = z.current.find((t) => e >= t.startTime && e < t.endTime);
@@ -819,147 +832,175 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
819
832
  }
820
833
  };
821
834
  if (l.on("timeupdate", (e) => {
822
- if (!E.current && N.current === null) {
823
- let t = z.current.find((t) => En.current.has(t.startTime) && e >= t.startTime - .5 && e < t.endTime);
835
+ if (!D.current && N.current === null) {
836
+ let t = z.current.find((t) => Dn.current.has(t.startTime) && e >= t.startTime - .5 && e < t.endTime);
824
837
  if (t) {
825
- ee(t.endTime);
838
+ f(t.endTime);
826
839
  return;
827
840
  }
828
- Dt.current !== null && z.current.find((t) => e >= t.endTime - .5 && e < t.endTime) && u();
841
+ Et.current !== null && z.current.find((t) => e >= t.endTime - .5 && e < t.endTime) && u();
829
842
  }
830
- if (E.current && D.current !== null) {
831
- let t = D.current;
832
- if (O.current !== null && t < O.current ? e <= t + 2 && e >= t - 2 : e >= t - 2) {
833
- E.current = !1, D.current = null, O.current = null, k.current &&= (window.clearTimeout(k.current), null);
834
- let t = z.current.some((t) => e >= t.startTime && e < t.endTime), n = Et.current;
835
- Et.current = !1, (n || !t && Dt.current === null) && d();
843
+ if (D.current && O.current !== null) {
844
+ let t = O.current;
845
+ if (k.current !== null && t < k.current ? e <= t + 2 && e >= t - 2 : e >= t - 2) {
846
+ D.current = !1, O.current = null, k.current = null, A.current &&= (window.clearTimeout(A.current), null);
847
+ let t = z.current.some((t) => e >= t.startTime && e < t.endTime), n = Tt.current;
848
+ Tt.current = !1, (n || !t && Et.current === null) && d();
836
849
  } else return;
837
850
  }
838
- nn(e), Ft.current = e;
851
+ rn(e), It.current = e;
839
852
  let t = l.getDuration();
840
- if (an(t), N.current !== null && e >= N.current - 2) {
853
+ if (on(t), N.current !== null && e >= N.current - 2) {
841
854
  N.current = null, P.current &&= (window.clearTimeout(P.current), null);
842
- let t = z.current.find((t) => En.current.has(t.startTime) && e >= t.startTime && e < t.endTime);
843
- t && ee(t.endTime), requestAnimationFrame(() => {
855
+ let t = z.current.find((t) => Dn.current.has(t.startTime) && e >= t.startTime && e < t.endTime);
856
+ t && f(t.endTime), requestAnimationFrame(() => {
844
857
  requestAnimationFrame(() => {
845
858
  M.current && (M.current.style.opacity = "0");
846
859
  });
847
860
  });
848
861
  }
849
- if (!Nt.current && kt.current === null && lt && lt > 0 && t > 0 && lt < t) {
850
- Nt.current = !0;
851
- let e = z.current.find((e) => lt >= e.startTime && lt < e.endTime), t = e ? e.startTime : lt;
852
- Pt.current = e ? null : lt, N.current = t, l.seek(t), P.current && window.clearTimeout(P.current), P.current = window.setTimeout(() => {
862
+ if (!Pt.current && Ot.current === null && ct && ct > 0 && t > 0 && ct < t) {
863
+ Pt.current = !0;
864
+ let e = z.current.find((e) => ct >= e.startTime && ct < e.endTime), t = e ? e.startTime : ct;
865
+ Ft.current = e ? null : ct, N.current = t, l.seek(t), P.current && window.clearTimeout(P.current), P.current = window.setTimeout(() => {
853
866
  N.current = null, P.current = null, M.current && (M.current.style.opacity = "0");
854
867
  }, 4e3);
855
868
  }
856
- if (ut?.(e), Vn.current.length > 0) if (Hn.current) {
857
- let t = Hn.current;
858
- (e >= t.startTimeSeconds + t.durationSeconds || e < t.startTimeSeconds) && (Bn(null), Hn.current = null);
869
+ if (lt?.(e), Hn.current.length > 0) if (Un.current) {
870
+ let t = Un.current;
871
+ (e >= t.startTimeSeconds + t.durationSeconds || e < t.startTimeSeconds) && (Vn(null), Un.current = null);
859
872
  } else {
860
- let t = Vn.current.find((t) => e >= t.startTimeSeconds && e < t.startTimeSeconds + t.durationSeconds && !Un.current.has(t.availId));
861
- t && (Bn(t), Hn.current = t, t.impressionBeacons.forEach((e) => {
873
+ let t = Hn.current.find((t) => e >= t.startTimeSeconds && e < t.startTimeSeconds + t.durationSeconds && !Wn.current.has(t.availId));
874
+ t && (Vn(t), Un.current = t, t.impressionBeacons.forEach((e) => {
862
875
  fetch(e, { mode: "no-cors" }).catch(() => {});
863
876
  }));
864
877
  }
865
878
  let n = l.keyMoments.getCurrentMoment(e);
866
- fr({
879
+ gr({
867
880
  chapter: n.keyMoment,
868
881
  index: n.index
869
- }), te(e, l.getVideoElement().paused);
882
+ }), ee(e, l.getVideoElement().paused);
870
883
  }), l.on("qualitylevels", (e) => {
871
- $n(e);
884
+ rr(e);
885
+ let t = kt.current;
886
+ if (!t) return;
887
+ let n = t.qualityHeight === null ? void 0 : e.find((e) => e.height === t.qualityHeight);
888
+ n ? (l.setQuality(n.id), ar(n)) : ar({
889
+ id: -1,
890
+ height: 0,
891
+ width: 0,
892
+ bitrate: 0,
893
+ label: "Auto"
894
+ });
872
895
  }), l.on("qualitychange", (e) => {
873
- tr(e);
896
+ ar(e);
874
897
  }), l.on("buffering", (e) => {
875
- if (dn(e && !xt.current), !e && (j.current &&= (clearTimeout(j.current), null), At.current = null, kt.current !== null)) {
898
+ if (fn(e && !bt.current), !e) {
899
+ At.current &&= (clearTimeout(At.current), null), jt.current = null;
876
900
  let e = kt.current;
877
- kt.current = null, Nt.current = !0, N.current = e, P.current && window.clearTimeout(P.current), P.current = window.setTimeout(() => {
878
- N.current = null, P.current = null, M.current && (M.current.style.opacity = "0");
879
- }, 4e3), l.seek(e);
901
+ if (e && (kt.current = null, e.playbackRate !== 1 && l.setPlaybackRate(e.playbackRate), l.setVolume(e.volume), l.setMute(e.muted)), Ot.current !== null) {
902
+ let e = Ot.current;
903
+ Ot.current = null, Pt.current = !0, N.current = e, P.current && window.clearTimeout(P.current), P.current = window.setTimeout(() => {
904
+ N.current = null, P.current = null, M.current && (M.current.style.opacity = "0");
905
+ }, 4e3), l.seek(e);
906
+ }
880
907
  }
881
908
  }), l.on("adbreakchange", (e) => {
882
- if (l.analytics.setAdBreak(e, l.getVideoElement()), le && le(e), e) {
909
+ if (l.analytics.setAdBreak(e, l.getVideoElement()), se && se(e), e) {
883
910
  let e = l.getCurrentTime(), t = z.current.find((t) => e >= t.startTime && e < t.endTime);
884
- if (ei.current = !1, $r(!1), t && En.current.has(t.startTime)) {
885
- u(), E.current || ee(t.endTime);
911
+ if (ii.current = !1, ri(!1), t && Dn.current.has(t.startTime)) {
912
+ u(), D.current || f(t.endTime);
886
913
  return;
887
914
  }
888
- t && (Fn.current = t.startTime), Zr(!0), K("none"), d();
889
- } else if (Fn.current !== null && (En.current.add(Fn.current), kn(new Set(En.current)), Fn.current = null), Zr(!1), Dt.current !== null) {
890
- let e = Dt.current;
891
- Dt.current = null, E.current = !0, D.current = e, O.current = l.getCurrentTime(), u(), l.seek(e), k.current && window.clearTimeout(k.current), k.current = window.setTimeout(() => {
892
- E.current = !1, D.current = null, O.current = null, k.current = null, d();
915
+ t && (In.current = t.startTime), ti(!0), K("none"), d();
916
+ } else if (In.current !== null && (Dn.current.add(In.current), An(new Set(Dn.current)), In.current = null), ti(!1), Et.current !== null) {
917
+ let e = Et.current;
918
+ Et.current = null, D.current = !0, O.current = e, k.current = l.getCurrentTime(), u(), l.seek(e), A.current && window.clearTimeout(A.current), A.current = window.setTimeout(() => {
919
+ D.current = !1, O.current = null, k.current = null, A.current = null, d();
893
920
  }, 3e3);
894
921
  }
895
922
  }), l.on("adbreaksloaded", (e) => {
896
- z.current = e, Tn(e);
897
- let t = Pt.current;
923
+ z.current = e, En(e);
924
+ let t = Ft.current;
898
925
  if (t === null) return;
899
- Pt.current = null;
926
+ Ft.current = null;
900
927
  let n = e.find((e) => t >= e.startTime && t < e.endTime);
901
- if (!n || En.current.has(n.startTime)) return;
928
+ if (!n || Dn.current.has(n.startTime)) return;
902
929
  let r = l.getCurrentTime();
903
930
  r < n.startTime || r >= n.endTime || (M.current && (M.current.style.opacity = "1"), N.current = n.startTime, P.current && window.clearTimeout(P.current), P.current = window.setTimeout(() => {
904
931
  N.current = null, P.current = null, M.current && (M.current.style.opacity = "0");
905
932
  }, 4e3), l.seek(n.startTime));
906
933
  }), l.on("volumechange", (e) => {
907
- sn(e.volume), St.current === null && ln(e.muted);
934
+ cn(e.volume), xt.current === null && un(e.muted);
908
935
  }), l.on("pipchange", (e) => {
909
- bn(e);
936
+ xn(e);
910
937
  }), l.on("error", () => {
911
- Zt(!0), dn(!1), N.current = null, P.current &&= (window.clearTimeout(P.current), null), M.current && (M.current.style.opacity = "0");
938
+ Qt(!0), fn(!1), N.current = null, P.current &&= (window.clearTimeout(P.current), null), M.current && (M.current.style.opacity = "0");
912
939
  }), l.on("unsupportedcodec", () => {
913
- let e = At.current;
914
- e && e.targetIdx !== 0 && (jt.current?.length ?? 0) > 1 && si(e.targetIdx);
940
+ let e = jt.current;
941
+ e && e.targetIdx !== 0 && (Mt.current?.length ?? 0) > 1 && di(e.targetIdx);
915
942
  }), l.subtitles.onSubtitleChange((e) => {
916
- rr(e);
943
+ sr(e);
917
944
  }), l.on("subtitlesloaded", (e) => {
918
945
  if (!I.enableSubtitles) return;
919
- or(Re([...e]));
920
- let t = e.find((e) => e.isDefault);
921
- t && (l.subtitles.setActiveTrack(t.id), ir(t.id));
946
+ ur(Le([...e]));
947
+ let t = kt.current;
948
+ if (t) {
949
+ let n = t.subtitleId === "off" ? "off" : e.find((e) => e.id === t.subtitleId)?.id ?? (t.subtitleLang ? e.find((e) => e.lang === t.subtitleLang)?.id : void 0);
950
+ if (n) {
951
+ l.subtitles.setActiveTrack(n), cr(n);
952
+ return;
953
+ }
954
+ }
955
+ let n = e.find((e) => e.isDefault);
956
+ n && (l.subtitles.setActiveTrack(n.id), cr(n.id));
922
957
  }), l.on("audiotracksloaded", (e) => {
923
- cr(e), ur(e[0]?.id ?? 0);
958
+ fr(e);
959
+ let t = kt.current, n = t ? e.find((e) => t.audioLang && e.lang === t.audioLang) ?? e.find((e) => t.audioLabel && e.label === t.audioLabel) : void 0;
960
+ if (n) {
961
+ l.setAudioTrack(n.id), mr(n.id);
962
+ return;
963
+ }
964
+ mr(e[0]?.id ?? 0);
924
965
  }), l.on("audiotrackchange", (e) => {
925
- ur(e);
966
+ mr(e);
926
967
  }), l.casting.onCastStateChange((e, t) => {
927
968
  if (e) {
928
- kr.current = l.isMuted(), l.pause();
969
+ Nr.current = l.isMuted(), l.pause();
929
970
  let e = l.getVideoElement();
930
- e.muted = !0, Er(t);
971
+ e.muted = !0, Ar(t);
931
972
  } else {
932
973
  let e = l.casting.getRemoteState();
933
- e && e.currentTime > 0 && (E.current = !0, D.current = e.currentTime, O.current = l.getCurrentTime(), l.seek(e.currentTime), k.current && window.clearTimeout(k.current), k.current = window.setTimeout(() => {
934
- E.current = !1, D.current = null, O.current = null, k.current = null;
974
+ e && e.currentTime > 0 && (D.current = !0, O.current = e.currentTime, k.current = l.getCurrentTime(), l.seek(e.currentTime), A.current && window.clearTimeout(A.current), A.current = window.setTimeout(() => {
975
+ D.current = !1, O.current = null, k.current = null, A.current = null;
935
976
  }, 3e3));
936
977
  let t = l.getVideoElement();
937
- t.muted = kr.current, Er(null), Or(null);
978
+ t.muted = Nr.current, Ar(null), Mr(null);
938
979
  }
939
980
  }), l.casting.onRemoteStateChange((e) => {
940
- Or(e);
941
- }), sn(l.getVolume()), ln(l.isMuted()), "mediaSession" in navigator) try {
981
+ Mr(e);
982
+ }), cn(l.getVolume()), un(l.isMuted()), "mediaSession" in navigator) try {
942
983
  navigator.mediaSession.setActionHandler("seekto", (e) => {
943
- if (e.seekTime == null || ri.current || ei.current) return;
984
+ if (e.seekTime == null || si.current || ii.current) return;
944
985
  let t = e.seekTime;
945
986
  for (let e of z.current) t >= e.startTime && (t += e.endTime - e.startTime);
946
- Ot.current?.(t);
987
+ Dt.current?.(t);
947
988
  });
948
989
  let e = (e, t) => {
949
- if (ri.current || ei.current) return;
990
+ if (si.current || ii.current) return;
950
991
  let n = t && t > 0 ? t : 10, r = l.getCurrentTime(), i = r;
951
992
  for (let e of z.current) r >= e.endTime ? i -= e.endTime - e.startTime : r >= e.startTime && (i -= r - e.startTime);
952
993
  if (e) {
953
994
  let e = z.current.reduce((e, t) => e + (t.endTime - t.startTime), 0), t = Math.max(0, l.getDuration() - e), r = Math.min(t, i + n);
954
995
  for (let e of z.current) r >= e.startTime && (r += e.endTime - e.startTime);
955
- Ot.current?.(r, {
996
+ Dt.current?.(r, {
956
997
  eventType: "fast_forward",
957
998
  skipSeconds: n
958
999
  });
959
1000
  } else {
960
1001
  let e = Math.max(0, i - n);
961
1002
  for (let t of z.current) e >= t.startTime && (e += t.endTime - t.startTime);
962
- Ot.current?.(e, {
1003
+ Dt.current?.(e, {
963
1004
  eventType: "fast_backward",
964
1005
  skipSeconds: n
965
1006
  });
@@ -967,34 +1008,34 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
967
1008
  };
968
1009
  navigator.mediaSession.setActionHandler("seekforward", (t) => e(!0, t.seekOffset ?? void 0)), navigator.mediaSession.setActionHandler("seekbackward", (t) => e(!1, t.seekOffset ?? void 0));
969
1010
  } catch {}
970
- let f = l.getVideoElement(), p = () => {
971
- if (!(document.pictureInPictureElement === f || f.webkitPresentationMode === "picture-in-picture") || E.current || N.current !== null || kt.current !== null) return;
972
- let e = f.currentTime, t = Ft.current;
1011
+ let p = l.getVideoElement(), m = () => {
1012
+ if (!(document.pictureInPictureElement === p || p.webkitPresentationMode === "picture-in-picture") || D.current || N.current !== null || Ot.current !== null) return;
1013
+ let e = p.currentTime, t = It.current;
973
1014
  if (!(Math.abs(e - t) < .5)) {
974
- if (ri.current) {
975
- f.currentTime = t;
1015
+ if (si.current) {
1016
+ p.currentTime = t;
976
1017
  return;
977
1018
  }
978
- f.currentTime = t, Ot.current?.(e);
1019
+ p.currentTime = t, Dt.current?.(e);
979
1020
  }
980
1021
  };
981
- f.addEventListener("seeking", p), Ut(l);
982
- let ne = At.current;
983
- ne && ne.targetIdx !== 0 && (j.current && clearTimeout(j.current), j.current = setTimeout(() => {
984
- j.current = null, !l.getBufferedRanges().some((e) => e.end > e.start) && si(ne.targetIdx);
985
- }, ke)), kt.current !== null && (P.current && window.clearTimeout(P.current), P.current = window.setTimeout(() => {
986
- P.current = null, N.current = null, M.current && (M.current.style.opacity = "0"), dn(!1);
987
- }, 12e3)), Je && C.current && (pt.current = !0, C.current.requestFullscreen().catch(() => {
988
- pt.current = !1;
1022
+ p.addEventListener("seeking", m), Wt(l);
1023
+ let te = jt.current;
1024
+ te && te.targetIdx !== 0 && (At.current && clearTimeout(At.current), At.current = setTimeout(() => {
1025
+ At.current = null, !l.getBufferedRanges().some((e) => e.end > e.start) && di(te.targetIdx);
1026
+ }, De)), Ot.current !== null && (P.current && window.clearTimeout(P.current), P.current = window.setTimeout(() => {
1027
+ P.current = null, N.current = null, M.current && (M.current.style.opacity = "0"), fn(!1);
1028
+ }, 12e3)), qe && w.current && (ft.current = !0, w.current.requestFullscreen().catch(() => {
1029
+ ft.current = !1;
989
1030
  }));
990
- let re = () => {
1031
+ let ne = () => {
991
1032
  let e = document, t = !!(document.fullscreenElement || e.webkitFullscreenElement);
992
- pn(t), t || hn(!1);
1033
+ mn(t), t || gn(!1);
993
1034
  let n = l.getVideoElement();
994
1035
  l.analytics.track(t ? "fullscreen_enter" : "fullscreen_exit", n);
995
1036
  };
996
- document.addEventListener("fullscreenchange", re), document.addEventListener("webkitfullscreenchange", re);
997
- let g = (e) => {
1037
+ document.addEventListener("fullscreenchange", ne), document.addEventListener("webkitfullscreenchange", ne);
1038
+ let v = (e) => {
998
1039
  let t = document.activeElement;
999
1040
  if (!(t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.getAttribute("contenteditable") === "true" || t.getAttribute("role") === "slider"))) {
1000
1041
  switch (e.key.toLowerCase()) {
@@ -1007,19 +1048,19 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1007
1048
  let e = l.getVideoElement();
1008
1049
  e && !e.paused && e.pause();
1009
1050
  } catch {}
1010
- if (T.current && !T.current.paused) try {
1011
- T.current.pause();
1051
+ if (E.current && !E.current.paused) try {
1052
+ E.current.pause();
1012
1053
  } catch {}
1013
1054
  }
1014
1055
  break;
1015
1056
  case "arrowleft":
1016
1057
  case "j":
1017
- if (e.preventDefault(), !ri.current) {
1058
+ if (e.preventDefault(), !si.current) {
1018
1059
  let e = l.getCurrentTime(), t = e;
1019
1060
  for (let n of z.current) e >= n.endTime ? t -= n.endTime - n.startTime : e >= n.startTime && (t -= e - n.startTime);
1020
1061
  let n = Math.max(0, t - 10);
1021
1062
  for (let e of z.current) n >= e.startTime && (n += e.endTime - e.startTime);
1022
- Ot.current?.(n, {
1063
+ Dt.current?.(n, {
1023
1064
  eventType: "fast_backward",
1024
1065
  skipSeconds: 10
1025
1066
  });
@@ -1027,12 +1068,12 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1027
1068
  break;
1028
1069
  case "arrowright":
1029
1070
  case "l":
1030
- if (e.preventDefault(), !ri.current) {
1071
+ if (e.preventDefault(), !si.current) {
1031
1072
  let e = l.getCurrentTime(), t = z.current.reduce((e, t) => e + (t.endTime - t.startTime), 0), n = Math.max(0, l.getDuration() - t), r = e;
1032
1073
  for (let t of z.current) e >= t.endTime ? r -= t.endTime - t.startTime : e >= t.startTime && (r -= e - t.startTime);
1033
1074
  let i = Math.min(n, r + 10);
1034
1075
  for (let e of z.current) i >= e.startTime && (i += e.endTime - e.startTime);
1035
- Ot.current?.(i, {
1076
+ Dt.current?.(i, {
1036
1077
  eventType: "fast_forward",
1037
1078
  skipSeconds: 10
1038
1079
  });
@@ -1048,32 +1089,32 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1048
1089
  e.preventDefault(), l.setMute(!l.isMuted());
1049
1090
  break;
1050
1091
  case "f":
1051
- e.preventDefault(), bt.current();
1092
+ e.preventDefault(), yt.current();
1052
1093
  break;
1053
1094
  case "p":
1054
- e.preventDefault(), ri.current || l.togglePictureInPicture();
1095
+ e.preventDefault(), si.current || l.togglePictureInPicture();
1055
1096
  break;
1056
1097
  case "c":
1057
- if (e.preventDefault(), I.enableSubtitles && !ri.current) if (l.subtitles.getActiveTrackId() !== "off") l.subtitles.setActiveTrack("off"), ir("off");
1098
+ if (e.preventDefault(), I.enableSubtitles && !si.current) if (l.subtitles.getActiveTrackId() !== "off") l.subtitles.setActiveTrack("off"), cr("off");
1058
1099
  else {
1059
- let e = ai.current;
1060
- e && e.length > 0 && (l.subtitles.setActiveTrack(e[0].id), ir(e[0].id));
1100
+ let e = li.current;
1101
+ e && e.length > 0 && (l.subtitles.setActiveTrack(e[0].id), cr(e[0].id));
1061
1102
  }
1062
1103
  break;
1063
1104
  default: return;
1064
1105
  }
1065
- oi();
1106
+ ui();
1066
1107
  }
1067
1108
  };
1068
- return document.addEventListener("keydown", g), oi(), () => {
1069
- if (Pn.current = {
1070
- key: Dn,
1109
+ return document.addEventListener("keydown", v), ui(), () => {
1110
+ if (Fn.current = {
1111
+ key: On,
1071
1112
  snapshot: l.analytics.getSessionSnapshot()
1072
- }, It.current) {
1073
- let e = It.current, t = l.getVideoElement();
1074
- C.current && t.ownerDocument !== document && (t.classList.remove("gb-pip-video"), C.current.insertBefore(t, C.current.firstChild)), It.current = null, Sn(null), bn(!1), e.close();
1113
+ }, Lt.current) {
1114
+ let e = Lt.current, t = l.getVideoElement();
1115
+ w.current && t.ownerDocument !== document && (t.classList.remove("gb-pip-video"), w.current.insertBefore(t, w.current.firstChild)), Lt.current = null, Cn(null), xn(!1), e.close();
1075
1116
  }
1076
- if (l.destroy(), ft.current?.destroy(), ft.current = null, document.body.style.overflow = "", document.body.style.touchAction = "", document.removeEventListener("fullscreenchange", re), document.removeEventListener("webkitfullscreenchange", re), document.removeEventListener("keydown", g), ti.current && window.clearTimeout(ti.current), k.current &&= (window.clearTimeout(k.current), null), j.current &&= (clearTimeout(j.current), null), xt.current = !1, A.current && (A.current.style.opacity = "0"), f.removeEventListener("seeking", p), "mediaSession" in navigator) {
1117
+ if (l.destroy(), dt.current?.destroy(), dt.current = null, document.body.style.overflow = "", document.body.style.touchAction = "", document.removeEventListener("fullscreenchange", ne), document.removeEventListener("webkitfullscreenchange", ne), document.removeEventListener("keydown", v), ai.current && window.clearTimeout(ai.current), A.current &&= (window.clearTimeout(A.current), null), At.current &&= (clearTimeout(At.current), null), bt.current = !1, j.current && (j.current.style.opacity = "0"), p.removeEventListener("seeking", m), "mediaSession" in navigator) {
1077
1118
  try {
1078
1119
  navigator.mediaSession.setActionHandler("seekto", null);
1079
1120
  } catch {}
@@ -1084,25 +1125,25 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1084
1125
  navigator.mediaSession.setActionHandler("seekbackward", null);
1085
1126
  } catch {}
1086
1127
  }
1087
- gt.current &&= (gt.current.destroy(), null), T.current &&= (document.body.removeChild(T.current), null), Nt.current = !1, N.current = null, P.current &&= (window.clearTimeout(P.current), null);
1128
+ ht.current &&= (ht.current.destroy(), null), E.current &&= (document.body.removeChild(E.current), null), Pt.current = !1, N.current = null, P.current &&= (window.clearTimeout(P.current), null);
1088
1129
  };
1089
1130
  }, [
1090
1131
  r,
1091
- ie,
1092
- Qt
1132
+ g,
1133
+ $t
1093
1134
  ]), c(() => {
1094
1135
  if (F) {
1095
1136
  F.keyMoments.setKeyMoments(W);
1096
- let e = C.current?.querySelector("video");
1137
+ let e = w.current?.querySelector("video");
1097
1138
  if (e) {
1098
1139
  let t = F.keyMoments.getCurrentMoment(e.currentTime);
1099
- fr({
1140
+ gr({
1100
1141
  chapter: t.keyMoment,
1101
1142
  index: t.index
1102
1143
  });
1103
1144
  }
1104
1145
  }
1105
- }, [Tr, F]), c(() => {
1146
+ }, [kr, F]), c(() => {
1106
1147
  let e = (e) => {
1107
1148
  G !== "none" && (e.target.closest(".sdk-menu-container") || K("none"));
1108
1149
  };
@@ -1110,17 +1151,17 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1110
1151
  document.removeEventListener("click", e);
1111
1152
  };
1112
1153
  }, [G]), c(() => {
1113
- ni.current = en;
1114
- }, [en]), c(() => {
1115
- ri.current = Y;
1154
+ oi.current = tn;
1155
+ }, [tn]), c(() => {
1156
+ si.current = Y;
1116
1157
  }, [Y]), c(() => {
1117
- ei.current = Qr;
1118
- }, [Qr]);
1119
- let X = Y || Qr;
1158
+ ii.current = ni;
1159
+ }, [ni]);
1160
+ let X = Y || ni;
1120
1161
  c(() => {
1121
- It.current = xn;
1122
- }, [xn]), c(() => {
1123
- ii.current = G;
1162
+ Lt.current = Sn;
1163
+ }, [Sn]), c(() => {
1164
+ ci.current = G;
1124
1165
  }, [G]), c(() => {
1125
1166
  if (!Y || !F) return;
1126
1167
  let e = 0, t = F.getCurrentTime(), n = performance.now(), r = () => {
@@ -1130,10 +1171,10 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1130
1171
  let e = i.playbackRate || 1;
1131
1172
  s = t + (o - n) / 1e3 * e;
1132
1173
  } else s = t;
1133
- let c = Yn(a);
1174
+ let c = $n(a);
1134
1175
  if (c) {
1135
1176
  let e = Math.min(s, a + .4, c.end), t = Math.min(100, Math.max(0, (e - c.start) / (c.end - c.start) * 100));
1136
- (C.current?.querySelectorAll(".sdk-ad-progress-fill"))?.forEach((e) => {
1177
+ (w.current?.querySelectorAll(".sdk-ad-progress-fill"))?.forEach((e) => {
1137
1178
  e.style.width = `${t}%`;
1138
1179
  });
1139
1180
  }
@@ -1141,38 +1182,51 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1141
1182
  };
1142
1183
  return e = requestAnimationFrame(r), () => cancelAnimationFrame(e);
1143
1184
  }, [Y, F]), c(() => {
1144
- ai.current = ar;
1145
- }, [ar]), c(() => {
1146
- zt.current = Lt;
1147
- }, [Lt]), c(() => {
1185
+ li.current = lr;
1186
+ }, [lr]), c(() => {
1187
+ Bt.current = Rt;
1188
+ }, [Rt]), c(() => {
1148
1189
  z.current = R;
1149
1190
  }, [R]), c(() => {
1150
- Vn.current = Ln;
1151
- }, [Ln]), c(() => {
1152
- Hn.current = zn;
1153
- }, [zn]), c(() => {
1154
- Kn.current = Wn;
1155
- }, [Wn]), c(() => {
1156
- jt.current = S;
1157
- }, [S]), c(() => {
1158
- Mt.current = ct;
1159
- }, [ct]), c(() => {
1160
- Fn.current = null, In.current = !1, Dt.current = null, Pt.current = null, Bn(null), Hn.current = null, Un.current = /* @__PURE__ */ new Set(), Zt(!1);
1191
+ Hn.current = Rn;
1192
+ }, [Rn]), c(() => {
1193
+ Un.current = Bn;
1194
+ }, [Bn]), c(() => {
1195
+ qn.current = Gn;
1196
+ }, [Gn]), c(() => {
1197
+ Mt.current = C;
1198
+ }, [C]), c(() => {
1199
+ let e = Jn.current;
1200
+ if (!Y || !e || typeof ResizeObserver > "u") return;
1201
+ let t = () => {
1202
+ let t = e.getBoundingClientRect();
1203
+ Xn((e) => e.w === t.width && e.h === t.height ? e : {
1204
+ w: t.width,
1205
+ h: t.height
1206
+ });
1207
+ };
1208
+ t();
1209
+ let n = new ResizeObserver(t);
1210
+ return n.observe(e), () => n.disconnect();
1211
+ }, [Y, Gn]), c(() => {
1212
+ Nt.current = st;
1213
+ }, [st]), c(() => {
1214
+ In.current = null, Ln.current = !1, Et.current = null, Ft.current = null, Vn(null), Un.current = null, Wn.current = /* @__PURE__ */ new Set(), Qt(!1);
1161
1215
  }, [r]), c(() => {
1162
- Gt(!1);
1216
+ Kt(!1);
1163
1217
  }, [r]), c(() => {
1164
1218
  if (!F) return;
1165
1219
  let e = F.getVideoElement();
1166
1220
  if (e && e.readyState >= 1) {
1167
- Gt(!0);
1221
+ Kt(!0);
1168
1222
  return;
1169
1223
  }
1170
- let t = () => Gt(!0);
1224
+ let t = () => Kt(!0);
1171
1225
  return F.on("qualitylevels", t), e?.addEventListener("loadedmetadata", t), () => {
1172
1226
  F.off("qualitylevels", t), e?.removeEventListener("loadedmetadata", t);
1173
1227
  };
1174
1228
  }, [F]), c(() => {
1175
- if (Rn([]), !(!at || !Wt)) return Ue(at, (e) => {
1229
+ if (zn([]), !(!it || !Gt)) return He(it, (e) => {
1176
1230
  let t = /* @__PURE__ */ new Set(), n = [];
1177
1231
  for (let r of e.nonLinearAvails ?? []) {
1178
1232
  if (t.has(r.availId)) continue;
@@ -1186,13 +1240,13 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1186
1240
  let s = o.position ?? "bottom_center";
1187
1241
  n.push({
1188
1242
  availId: r.availId,
1189
- startTimeSeconds: ze(r.startTime ?? ""),
1190
- durationSeconds: ze(i.minSuggestedDuration ?? "00:00:15"),
1243
+ startTimeSeconds: Re(r.startTime ?? ""),
1244
+ durationSeconds: Re(i.minSuggestedDuration ?? "00:00:15"),
1191
1245
  imageUrl: i.staticResource,
1192
1246
  imageWidth: parseInt(i.width ?? "320", 10),
1193
1247
  imageHeight: parseInt(i.height ?? "50", 10),
1194
1248
  title: i.adTitle ?? "",
1195
- clickThrough: Be(i.clickThrough) ? i.clickThrough : "",
1249
+ clickThrough: ze(i.clickThrough) ? i.clickThrough : "",
1196
1250
  clickTrackingUrl: i.clickTracking ?? "",
1197
1251
  impressionBeacons: a,
1198
1252
  position: s,
@@ -1200,13 +1254,13 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1200
1254
  });
1201
1255
  }
1202
1256
  return n.length > 0 ? n : null;
1203
- }, Rn);
1257
+ }, zn);
1204
1258
  }, [
1205
- at,
1259
+ it,
1206
1260
  r,
1207
- Wt
1261
+ Gt
1208
1262
  ]), c(() => {
1209
- if (Gn([]), Jn([]), !(!ot || !Wt)) return Ue(ot, (e) => {
1263
+ if (Kn([]), Qn([]), !(!at || !Gt)) return He(at, (e) => {
1210
1264
  let t = [], n = [];
1211
1265
  for (let r of e.avails ?? []) {
1212
1266
  let e = r.ads ?? [];
@@ -1216,11 +1270,11 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1216
1270
  startTime: i,
1217
1271
  endTime: r.durationInSeconds == null ? Math.max(o, i) : i + r.durationInSeconds
1218
1272
  }), e.forEach((n, r) => {
1219
- let i = Ve(n?.skipOffset), a = i !== null, o = {};
1273
+ let i = Be(n?.skipOffset), a = i !== null, o = {};
1220
1274
  try {
1221
1275
  o = JSON.parse(n?.adParameters ?? "{}");
1222
1276
  } catch {}
1223
- let s = o.ctaText && Be(o.redirectUrl) ? {
1277
+ let s = o.ctaText && ze(o.redirectUrl) ? {
1224
1278
  text: o.ctaText,
1225
1279
  url: o.redirectUrl,
1226
1280
  title: o.title || void 0,
@@ -1243,141 +1297,157 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1243
1297
  breaks: n
1244
1298
  } : null;
1245
1299
  }, ({ pods: e, breaks: t }) => {
1246
- Gn(e), Jn(t);
1300
+ Kn(e), Qn(t);
1247
1301
  });
1248
1302
  }, [
1249
- ot,
1303
+ at,
1250
1304
  r,
1251
- Wt
1305
+ Gt
1252
1306
  ]), c(() => {
1253
- !F || qn.length === 0 || F.setAdBreaks(qn);
1254
- }, [F, qn]), c(() => {
1307
+ !F || Zn.length === 0 || F.setAdBreaks(Zn);
1308
+ }, [F, Zn]), c(() => {
1255
1309
  if (!F) return;
1256
1310
  let e = () => {
1257
- document.hidden ? nt && ri.current && ni.current && (F.pause(), In.current = !0) : In.current &&= (F.play(), !1);
1311
+ document.hidden ? tt && si.current && oi.current && (F.pause(), Ln.current = !0) : Ln.current &&= (F.play(), !1);
1258
1312
  };
1259
1313
  return document.addEventListener("visibilitychange", e), () => {
1260
1314
  document.removeEventListener("visibilitychange", e);
1261
1315
  };
1262
- }, [F, nt]);
1263
- let ci = () => {
1264
- oi();
1265
- }, li = () => {
1266
- Je && !pt.current && C.current && (pt.current = !0, C.current.requestFullscreen().catch(() => {}));
1267
- }, ui = () => {
1316
+ }, [F, tt]);
1317
+ let fi = () => {
1318
+ ui();
1319
+ }, pi = () => {
1320
+ qe && !ft.current && w.current && (ft.current = !0, w.current.requestFullscreen().catch(() => {}));
1321
+ }, mi = () => {
1268
1322
  if (F) {
1269
1323
  if (q) {
1270
- F.casting.remotePlayPause(), oi();
1324
+ F.casting.remotePlayPause(), ui();
1271
1325
  return;
1272
1326
  }
1273
- if (Cn) Z(0), li(), F.play(), wn(!1);
1274
- else if (en) {
1327
+ if (wn) Z(0), pi(), F.play(), Tn(!1);
1328
+ else if (tn) {
1275
1329
  F.pause();
1276
1330
  try {
1277
1331
  let e = F.getVideoElement?.();
1278
1332
  e && !e.paused && e.pause();
1279
1333
  } catch {}
1280
- if (C.current && C.current.querySelectorAll("video").forEach((e) => {
1334
+ if (w.current && w.current.querySelectorAll("video").forEach((e) => {
1281
1335
  try {
1282
1336
  e.pause();
1283
1337
  } catch {}
1284
- }), T.current && !T.current.paused) try {
1285
- T.current.pause();
1338
+ }), E.current && !E.current.paused) try {
1339
+ E.current.pause();
1286
1340
  } catch {}
1287
- } else li(), F.play();
1288
- oi();
1341
+ } else pi(), F.play();
1342
+ ui();
1289
1343
  }
1290
- }, di = (e) => {
1291
- if (!w.current || !F || B === 0) return 0;
1292
- let t = w.current.getBoundingClientRect();
1344
+ }, hi = (e) => {
1345
+ if (!T.current || !F || B === 0) return 0;
1346
+ let t = T.current.getBoundingClientRect();
1293
1347
  return H(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * B);
1294
- }, fi = (e) => {
1295
- if (!F || Y || Qr) return;
1296
- vt.current = !0, Kr(di(e));
1348
+ }, gi = (e) => {
1349
+ if (!F || Y || ni) return;
1350
+ _t.current = !0, Xr(hi(e));
1297
1351
  let t = (e) => {
1298
- if (!vt.current || !w.current) return;
1299
- let t = w.current.getBoundingClientRect(), n = H(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * B);
1300
- Kr(n), Lr(e.clientX - t.left), Vr(n), T.current && (T.current.currentTime = n), oi();
1352
+ if (!_t.current || !T.current) return;
1353
+ let t = T.current.getBoundingClientRect(), n = H(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * B);
1354
+ Xr(n), Vr(e.clientX - t.left), Gr(n), E.current && (E.current.currentTime = n), ui();
1301
1355
  }, n = (e) => {
1302
- if (vt.current = !1, w.current) {
1303
- let t = w.current.getBoundingClientRect();
1356
+ if (_t.current = !1, T.current) {
1357
+ let t = T.current.getBoundingClientRect();
1304
1358
  Z(H(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * B));
1305
1359
  }
1306
- Kr(null), Lr(null), Ur(null), Gr(null), document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
1360
+ Xr(null), Vr(null), qr(null), Yr(null), document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
1307
1361
  };
1308
1362
  document.addEventListener("mousemove", t), document.addEventListener("mouseup", n);
1309
1363
  }, Z = (e, t) => {
1310
1364
  if (!F) return;
1311
- if (Pt.current = null, q) {
1365
+ if (Ft.current = null, q) {
1312
1366
  F.casting.remoteSeek(e);
1313
1367
  return;
1314
1368
  }
1315
- let n = Math.max(0, rn > 0 ? Math.min(e, rn) : e);
1369
+ let n = Math.max(0, an > 0 ? Math.min(e, an) : e);
1316
1370
  if (t) {
1317
1371
  let { eventType: e, ...n } = t;
1318
1372
  F.attributeNextSeek(e, n);
1319
1373
  }
1320
1374
  let r = F.getCurrentTime();
1321
1375
  if (n > r && z.current.length > 0) {
1322
- let e = z.current.filter((e) => e.startTime < n && e.endTime > r && !En.current.has(e.startTime)).sort((e, t) => e.startTime - t.startTime);
1376
+ let e = z.current.filter((e) => e.startTime < n && e.endTime > r && !Dn.current.has(e.startTime)).sort((e, t) => e.startTime - t.startTime);
1323
1377
  if (e.length > 0) {
1324
- Dt.current = n;
1378
+ Et.current = n;
1325
1379
  let t = e[e.length - 1], i = Math.max(t.startTime, r);
1326
- E.current = !0, D.current = i, O.current = r, nn(i), ei.current = !0, $r(!0), A.current && (A.current.style.opacity = "1"), Ct(F.getVideoElement()), F.seek(i), k.current && window.clearTimeout(k.current), k.current = window.setTimeout(() => {
1327
- E.current = !1, ei.current = !1, $r(!1), D.current = null, O.current = null, k.current = null, xt.current = !1, A.current && (A.current.style.opacity = "0"), wt(F.getVideoElement());
1380
+ D.current = !0, O.current = i, k.current = r, rn(i), ii.current = !0, ri(!0), j.current && (j.current.style.opacity = "1"), St(F.getVideoElement()), F.seek(i), A.current && window.clearTimeout(A.current), A.current = window.setTimeout(() => {
1381
+ D.current = !1, ii.current = !1, ri(!1), O.current = null, k.current = null, A.current = null, bt.current = !1, j.current && (j.current.style.opacity = "0"), Ct(F.getVideoElement());
1328
1382
  }, 3e3);
1329
1383
  return;
1330
1384
  }
1331
1385
  }
1332
- Dt.current = null;
1333
- let i = z.current.find((e) => En.current.has(e.startTime) && n >= e.startTime - .5 && n < e.endTime + 2), a = i ? Math.max(n, i.endTime + .5) : n;
1334
- E.current = !0, D.current = a, O.current = r, nn(a), xt.current = !1, A.current && (A.current.style.opacity = "0"), wt(F.getVideoElement()), F.seek(a), k.current && window.clearTimeout(k.current), k.current = window.setTimeout(() => {
1335
- E.current = !1, D.current = null, O.current = null, k.current = null, xt.current = !1, A.current && (A.current.style.opacity = "0");
1386
+ Et.current = null;
1387
+ let i = z.current.find((e) => Dn.current.has(e.startTime) && n >= e.startTime - .5 && n < e.endTime + 2), a = i ? Math.max(n, i.endTime + .5) : n;
1388
+ D.current = !0, O.current = a, k.current = r, rn(a), bt.current = !1, j.current && (j.current.style.opacity = "0"), Ct(F.getVideoElement()), F.seek(a), A.current && window.clearTimeout(A.current), A.current = window.setTimeout(() => {
1389
+ D.current = !1, O.current = null, k.current = null, A.current = null, bt.current = !1, j.current && (j.current.style.opacity = "0");
1336
1390
  }, 3e3);
1337
1391
  };
1338
- Ot.current = Z;
1339
- let pi = () => {
1392
+ Dt.current = Z;
1393
+ let _i = () => {
1340
1394
  if (!F) return;
1341
1395
  if (q) {
1342
- F.casting.remoteSetMute(!(Dr?.isMuted ?? !1));
1396
+ F.casting.remoteSetMute(!(jr?.isMuted ?? !1));
1343
1397
  return;
1344
1398
  }
1345
- let e = !cn;
1346
- F.setMute(e), ln(e);
1347
- }, mi = (e) => {
1348
- F && (F.setPlaybackRate(e), hr(e), K("none"), xr(`Playback speed: ${e === 1 ? "Normal" : `${e}x`}`));
1349
- }, hi = (e) => {
1399
+ let e = !ln;
1400
+ F.setMute(e), un(e);
1401
+ }, vi = (e) => {
1402
+ F && (F.setPlaybackRate(e), yr(e), K("none"), Tr(`Playback speed: ${e === 1 ? "Normal" : `${e}x`}`));
1403
+ }, yi = (e) => {
1350
1404
  if (!F) return;
1351
1405
  F.setQuality(e);
1352
- let t = Qn.find((t) => t.id === e);
1353
- t && (tr(t), xr(`Quality: ${t.label}`)), K("none");
1354
- }, gi = (e) => {
1355
- if (F) if (F.subtitles.setActiveTrack(e), ir(e), K("none"), e === "off") xr("Captions off");
1406
+ let t = nr.find((t) => t.id === e);
1407
+ t && (ar(t), Tr(`Quality: ${t.label}`)), K("none");
1408
+ }, bi = (e) => {
1409
+ if (F) if (F.subtitles.setActiveTrack(e), cr(e), K("none"), e === "off") Tr("Captions off");
1356
1410
  else {
1357
- let t = ar.find((t) => t.id === e);
1358
- xr(`Captions: ${t ? b(t) : "on"}`);
1411
+ let t = lr.find((t) => t.id === e);
1412
+ Tr(`Captions: ${t ? x(t) : "on"}`);
1413
+ }
1414
+ }, xi = (e) => {
1415
+ if (F) {
1416
+ if (At.current &&= (clearTimeout(At.current), null), Dr(null), M.current && (M.current.style.opacity = "1"), fn(!0), jt.current === null) {
1417
+ Ot.current = F.getCurrentTime();
1418
+ let e = lr.find((e) => e.id === U), t = dr.find((e) => e.id === pr);
1419
+ kt.current = {
1420
+ playbackRate: vr,
1421
+ volume: sn,
1422
+ muted: ln,
1423
+ subtitleId: U,
1424
+ subtitleLang: e?.lang ?? null,
1425
+ audioLang: t && pr !== 0 ? t.lang : null,
1426
+ audioLabel: t && pr !== 0 ? t.label : null,
1427
+ qualityHeight: ir.id === -1 ? null : ir.height
1428
+ };
1429
+ }
1430
+ jt.current = { targetIdx: e }, K("none"), Tr(`Source: ${C?.[e]?.label ?? ""}`), st?.(e);
1359
1431
  }
1360
- }, _i = (e) => {
1361
- F && (j.current &&= (clearTimeout(j.current), null), Cr(null), M.current && (M.current.style.opacity = "1"), dn(!0), At.current === null && (kt.current = F.getCurrentTime()), At.current = { targetIdx: e }, K("none"), xr(`Source: ${S?.[e]?.label ?? ""}`), ct?.(e));
1362
- }, vi = (e, t) => {
1432
+ }, Si = (e, t) => {
1363
1433
  Z(e, {
1364
1434
  eventType: "key_moments",
1365
1435
  momentTitle: t?.title ?? "",
1366
1436
  momentTime: e
1367
1437
  }), K("none");
1368
- }, yi = o(() => {
1369
- if (!It.current) return;
1438
+ }, Ci = o(() => {
1439
+ if (!Lt.current) return;
1370
1440
  let e = F?.getVideoElement?.();
1371
- e && C.current && e.ownerDocument !== document && (e.classList.remove("gb-pip-video"), e.style.objectFit = "", C.current.insertBefore(e, C.current.firstChild)), It.current = null, Sn(null), bn(!1);
1372
- }, [F]), bi = async () => {
1441
+ e && w.current && e.ownerDocument !== document && (e.classList.remove("gb-pip-video"), e.style.objectFit = "", w.current.insertBefore(e, w.current.firstChild)), Lt.current = null, Cn(null), xn(!1);
1442
+ }, [F]), wi = async () => {
1373
1443
  if (!F) return;
1374
1444
  let e = window.documentPictureInPicture;
1375
1445
  if (!e) {
1376
1446
  F.togglePictureInPicture();
1377
1447
  return;
1378
1448
  }
1379
- if (It.current) {
1380
- It.current.close();
1449
+ if (Lt.current) {
1450
+ Lt.current.close();
1381
1451
  return;
1382
1452
  }
1383
1453
  try {
@@ -1385,161 +1455,161 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1385
1455
  width: 360,
1386
1456
  height: Math.round(360 / n)
1387
1457
  }), i = r.document.createElement("style");
1388
- i.textContent = je, r.document.head.appendChild(i), t.classList.add("gb-pip-video"), r.document.body.appendChild(t), r.addEventListener("pagehide", () => yi(), { once: !0 }), It.current = r, Sn(r), bn(!0);
1458
+ i.textContent = ke, r.document.head.appendChild(i), t.classList.add("gb-pip-video"), r.document.body.appendChild(t), r.addEventListener("pagehide", () => Ci(), { once: !0 }), Lt.current = r, Cn(r), xn(!0);
1389
1459
  } catch (e) {
1390
1460
  console.error("[PlayerSDK PiP] Failed to open custom Picture-in-Picture window:", e);
1391
1461
  }
1392
- }, xi = (e) => {
1393
- if (Y || Qr) return;
1462
+ }, Ti = (e) => {
1463
+ if (Y || ni) return;
1394
1464
  let t = e.currentTarget.getBoundingClientRect();
1395
1465
  Z(H(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * B));
1396
- }, Si = () => {
1397
- if (!C.current) return;
1398
- let e = C.current, t = document, n = e, r = !!(document.fullscreenElement || t.webkitFullscreenElement), i = () => {
1399
- hn(!0), pn(!0), document.body.style.overflow = "hidden", document.body.style.touchAction = "none", F?.analytics.track("fullscreen_enter", F.getVideoElement());
1466
+ }, Ei = () => {
1467
+ if (!w.current) return;
1468
+ let e = w.current, t = document, n = e, r = !!(document.fullscreenElement || t.webkitFullscreenElement), i = () => {
1469
+ gn(!0), mn(!0), document.body.style.overflow = "hidden", document.body.style.touchAction = "none", F?.analytics.track("fullscreen_enter", F.getVideoElement());
1400
1470
  }, a = () => {
1401
- hn(!1), pn(!1), document.body.style.overflow = "", document.body.style.touchAction = "", F?.analytics.track("fullscreen_exit", F.getVideoElement());
1471
+ gn(!1), mn(!1), document.body.style.overflow = "", document.body.style.touchAction = "", F?.analytics.track("fullscreen_exit", F.getVideoElement());
1402
1472
  };
1403
- if (r || mn) _n(!1), document.fullscreenElement ? document.exitFullscreen() : t.webkitFullscreenElement ? t.webkitExitFullscreen?.() : a();
1473
+ if (r || hn) vn(!1), document.fullscreenElement ? document.exitFullscreen() : t.webkitFullscreenElement ? t.webkitExitFullscreen?.() : a();
1404
1474
  else {
1405
- _n(zt.current);
1475
+ vn(Bt.current);
1406
1476
  let t = e.requestFullscreen?.bind(e) ?? n.webkitRequestFullscreen?.bind(n);
1407
1477
  t ? t().catch(i) : i();
1408
1478
  }
1409
1479
  };
1410
1480
  c(() => {
1411
- bt.current = Si;
1481
+ yt.current = Ei;
1412
1482
  });
1413
- let Ci = () => {
1483
+ let Di = () => {
1414
1484
  if (!Y) return;
1415
- let e = R.find((e) => L >= e.startTime && L < e.endTime), t = Wn.find((e) => L >= e.startTimeSeconds && L < e.endTimeSeconds);
1485
+ let e = R.find((e) => L >= e.startTime && L < e.endTime), t = Gn.find((e) => L >= e.startTimeSeconds && L < e.endTimeSeconds);
1416
1486
  if (t) {
1417
1487
  let n = t.podIndex >= t.podTotal - 1;
1418
- Tt.current?.(n ? e?.endTime ?? t.endTimeSeconds : t.endTimeSeconds, !n);
1488
+ wt.current?.(n ? e?.endTime ?? t.endTimeSeconds : t.endTimeSeconds, !n);
1419
1489
  return;
1420
1490
  }
1421
- e && Tt.current?.(e.endTime);
1422
- }, wi = () => {
1423
- Hn.current && Un.current.add(Hn.current.availId), Bn(null), Hn.current = null;
1424
- }, Ti = (e) => {
1491
+ e && wt.current?.(e.endTime);
1492
+ }, Oi = () => {
1493
+ Un.current && Wn.current.add(Un.current.availId), Vn(null), Un.current = null;
1494
+ }, ki = (e) => {
1425
1495
  e.clickTrackingUrl && fetch(e.clickTrackingUrl, { mode: "no-cors" }).catch(() => {}), e.clickThrough && window.open(e.clickThrough, "_blank", "noopener,noreferrer");
1426
- }, Ei = (e) => {
1496
+ }, Ai = (e) => {
1427
1497
  window.open(e.url, "_blank", "noopener,noreferrer");
1428
- }, Di = () => {
1498
+ }, ji = () => {
1429
1499
  F && (q ? F.casting.stopCasting() : F.casting.requestSession(r, L));
1430
- }, Oi = () => {
1500
+ }, Mi = () => {
1431
1501
  if (!F) return;
1432
1502
  let e = F.getVideoElement();
1433
- if (Mr) {
1503
+ if (Ir) {
1434
1504
  F.casting.stopAirPlay(e);
1435
1505
  return;
1436
1506
  }
1437
1507
  typeof e.webkitShowPlaybackTargetPicker == "function" || F.casting.isAirPlayAvailable() ? F.casting.requestAirPlaySession(e) : console.warn("[PlayerSDK AirPlay] AirPlay is not available on this device.");
1438
- }, ki = (e) => {
1439
- if (!w.current || B === 0 || !F || Y || Qr) return;
1440
- let t = w.current.getBoundingClientRect();
1441
- mt.current = t.width, zr(Math.max(192 / 2, Math.min(e.clientX - t.left, t.width - 192 / 2)));
1508
+ }, Ni = (e) => {
1509
+ if (!T.current || B === 0 || !F || Y || ni) return;
1510
+ let t = T.current.getBoundingClientRect();
1511
+ pt.current = t.width, Ur(Math.max(192 / 2, Math.min(e.clientX - t.left, t.width - 192 / 2)));
1442
1512
  let n = H(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * B);
1443
- Lr(e.clientX - t.left), Vr(n), _t.current && window.clearTimeout(_t.current), _t.current = window.setTimeout(() => {
1444
- T.current && (T.current.currentTime = n);
1445
- }, 100), Gr(F.keyMoments.getCurrentMoment(n).keyMoment);
1446
- }, Ai = (e) => {
1447
- if (!w.current || B === 0) return 0;
1448
- let t = w.current.getBoundingClientRect();
1513
+ Vr(e.clientX - t.left), Gr(n), gt.current && window.clearTimeout(gt.current), gt.current = window.setTimeout(() => {
1514
+ E.current && (E.current.currentTime = n);
1515
+ }, 100), Yr(F.keyMoments.getCurrentMoment(n).keyMoment);
1516
+ }, Pi = (e) => {
1517
+ if (!T.current || B === 0) return 0;
1518
+ let t = T.current.getBoundingClientRect();
1449
1519
  return H(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * B);
1450
- }, ji = (e) => {
1451
- if (!F || Y || Qr || B === 0) return;
1452
- e.preventDefault(), vt.current = !0, Kr(Ai(e.touches[0]));
1520
+ }, Fi = (e) => {
1521
+ if (!F || Y || ni || B === 0) return;
1522
+ e.preventDefault(), _t.current = !0, Xr(Pi(e.touches[0]));
1453
1523
  let t = (e) => {
1454
- if (!vt.current || !w.current) return;
1455
- let t = e.touches[0], n = w.current.getBoundingClientRect(), r = H(Math.max(0, Math.min(1, (t.clientX - n.left) / n.width)) * B);
1456
- Kr(r), Vr(r), oi();
1524
+ if (!_t.current || !T.current) return;
1525
+ let t = e.touches[0], n = T.current.getBoundingClientRect(), r = H(Math.max(0, Math.min(1, (t.clientX - n.left) / n.width)) * B);
1526
+ Xr(r), Gr(r), ui();
1457
1527
  }, n = (e) => {
1458
- if (vt.current = !1, w.current && e.changedTouches[0]) {
1459
- let t = e.changedTouches[0], n = w.current.getBoundingClientRect();
1528
+ if (_t.current = !1, T.current && e.changedTouches[0]) {
1529
+ let t = e.changedTouches[0], n = T.current.getBoundingClientRect();
1460
1530
  Z(H(Math.max(0, Math.min(1, (t.clientX - n.left) / n.width)) * B));
1461
1531
  }
1462
- Kr(null), document.removeEventListener("touchmove", t), document.removeEventListener("touchend", n);
1532
+ Xr(null), document.removeEventListener("touchmove", t), document.removeEventListener("touchend", n);
1463
1533
  };
1464
1534
  document.addEventListener("touchmove", t, { passive: !1 }), document.addEventListener("touchend", n);
1465
- }, Mi = () => {
1466
- Lr(null), Ur(null), Gr(null), _t.current && window.clearTimeout(_t.current);
1535
+ }, Ii = () => {
1536
+ Vr(null), qr(null), Yr(null), gt.current && window.clearTimeout(gt.current);
1467
1537
  }, Q = (e) => {
1468
1538
  if (isNaN(e) || e < 0) return "00:00";
1469
1539
  let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60, a = (e) => String(e).padStart(2, "0");
1470
1540
  return n > 0 ? `${a(n)}:${a(r)}:${a(i)}` : `${a(r)}:${a(i)}`;
1471
1541
  };
1472
1542
  c(() => {
1473
- wr.current && xr(en ? "Playing" : "Paused");
1474
- }, [en]), c(() => {
1475
- wr.current && xr(cn ? "Muted" : "Unmuted");
1476
- }, [cn]), c(() => {
1477
- wr.current = !0;
1543
+ Or.current && Tr(tn ? "Playing" : "Paused");
1544
+ }, [tn]), c(() => {
1545
+ Or.current && Tr(ln ? "Muted" : "Unmuted");
1546
+ }, [ln]), c(() => {
1547
+ Or.current = !0;
1478
1548
  }, []), c(() => {
1479
1549
  let e = (e) => {
1480
- e.key === "Escape" && ii.current !== "none" && (e.preventDefault(), K("none"));
1550
+ e.key === "Escape" && ci.current !== "none" && (e.preventDefault(), K("none"));
1481
1551
  };
1482
1552
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
1483
1553
  }, []);
1484
- let Ni = q ? !(Dr?.isPaused ?? !0) : en, $ = q ? Dr?.currentTime ?? 0 : L, Pi = q ? Dr?.duration ?? 0 : B, Fi = q ? Dr?.volumeLevel ?? 1 : on, Ii = q ? Dr?.isMuted ?? !1 : cn, Li = o((e) => {
1485
- if (Y || Qr || e.target.closest(".sdk-mobile-ctrl")) return;
1486
- let t = Date.now(), n = C.current?.getBoundingClientRect(), r = e.clientX - (n?.left ?? 0), i = Bt.current;
1554
+ let Li = q ? !(jr?.isPaused ?? !0) : tn, $ = q ? jr?.currentTime ?? 0 : L, Ri = q ? jr?.duration ?? 0 : B, zi = q ? jr?.volumeLevel ?? 1 : sn, Bi = q ? jr?.isMuted ?? !1 : ln, Vi = o((e) => {
1555
+ if (Y || ni || e.target.closest(".sdk-mobile-ctrl")) return;
1556
+ let t = Date.now(), n = w.current?.getBoundingClientRect(), r = e.clientX - (n?.left ?? 0), i = Vt.current;
1487
1557
  if (i && t - i.time < 300) {
1488
- Bt.current = null;
1558
+ Vt.current = null;
1489
1559
  let e = r < (n?.width ?? 0) / 2, t = e ? -10 : 10;
1490
1560
  Z(H(Math.max(0, Math.min(B, V($) + t))), {
1491
1561
  eventType: e ? "fast_backward" : "fast_forward",
1492
1562
  skipSeconds: 10
1493
- }), Ht(e ? "left" : "right"), window.setTimeout(() => Ht(null), 700), oi();
1494
- } else Bt.current = {
1563
+ }), Ut(e ? "left" : "right"), window.setTimeout(() => Ut(null), 700), ui();
1564
+ } else Vt.current = {
1495
1565
  time: t,
1496
1566
  x: r
1497
- }, Yr ? (Xr(!1), ti.current && window.clearTimeout(ti.current)) : oi();
1567
+ }, $r ? (ei(!1), ai.current && window.clearTimeout(ai.current)) : ui();
1498
1568
  }, [
1499
1569
  Y,
1500
- Qr,
1570
+ ni,
1501
1571
  B,
1502
1572
  V,
1503
1573
  $,
1504
1574
  H,
1505
1575
  Z,
1506
- Yr
1507
- ]), Ri = () => f(Ii || Fi === 0 ? De : Fi < .3 ? Oe : Fi < .7 ? Te : Ee, { size: 18 }), zi = (e) => (t) => {
1576
+ $r
1577
+ ]), Hi = () => p(Bi || zi === 0 ? Te : zi < .3 ? Ee : zi < .7 ? Ce : we, { size: 18 }), Ui = (e) => (t) => {
1508
1578
  t.key === "Enter" || t.key === " " ? (t.preventDefault(), e()) : t.key === "Escape" && (t.preventDefault(), K("none"));
1509
- }, Bi = (e) => (t) => {
1579
+ }, Wi = (e) => (t) => {
1510
1580
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), e());
1511
- }, Vi = (e) => {
1512
- if (!(Y || Qr)) if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
1581
+ }, Gi = (e) => {
1582
+ if (!(Y || ni)) if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
1513
1583
  e.preventDefault();
1514
1584
  let t = e.key === "ArrowLeft" ? -5 : 5;
1515
1585
  Z(H(Math.max(0, Math.min(B, V($) + t))));
1516
1586
  } else e.key === "Home" ? (e.preventDefault(), Z(H(0))) : e.key === "End" && (e.preventDefault(), Z(H(B)));
1517
- }, Hi = (e) => {
1587
+ }, Ki = (e) => {
1518
1588
  K(G === e ? "none" : e);
1519
- }, Ui = o((e) => {
1589
+ }, qi = o((e) => {
1520
1590
  if (!e) return;
1521
1591
  e.style.left = "";
1522
- let t = C.current;
1592
+ let t = w.current;
1523
1593
  if (!t) return;
1524
1594
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = n.right - (r.right - 8), a = r.left + 8 - n.left;
1525
1595
  i > 0 ? e.style.left = `calc(50% - ${Math.ceil(i)}px)` : a > 0 && (e.style.left = `calc(50% + ${Math.ceil(a)}px)`);
1526
1596
  }, []);
1527
- return /* @__PURE__ */ p("div", {
1528
- ref: C,
1597
+ return /* @__PURE__ */ m("div", {
1598
+ ref: w,
1529
1599
  role: "region",
1530
- "aria-label": x || qr ? `${x || qr} video player` : "Video player",
1531
- className: `sdk-player-container ${Yr ? "controls-active" : ""} ${mn ? "sdk-fs-simulated" : ""}`,
1532
- onMouseMove: ci,
1533
- onTouchStart: vn ? void 0 : oi,
1600
+ "aria-label": S || Zr ? `${S || Zr} video player` : "Video player",
1601
+ className: `sdk-player-container ${$r ? "controls-active" : ""} ${hn ? "sdk-fs-simulated" : ""}`,
1602
+ onMouseMove: fi,
1603
+ onTouchStart: yn ? void 0 : ui,
1534
1604
  onMouseLeave: () => {},
1535
1605
  style: {
1536
- border: mn ? "none" : "1px solid rgba(255, 255, 255, 0.08)",
1537
- "--sdk-theme-color": h,
1538
- "--sdk-theme-color-rgb": Fe(h)
1606
+ border: hn ? "none" : "1px solid rgba(255, 255, 255, 0.08)",
1607
+ "--sdk-theme-color": _,
1608
+ "--sdk-theme-color-rgb": Pe(_)
1539
1609
  },
1540
1610
  children: [
1541
- /* @__PURE__ */ f("canvas", {
1542
- ref: ht,
1611
+ /* @__PURE__ */ p("canvas", {
1612
+ ref: mt,
1543
1613
  width: 160,
1544
1614
  height: 90,
1545
1615
  style: {
@@ -1549,15 +1619,15 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1549
1619
  },
1550
1620
  "aria-hidden": "true"
1551
1621
  }),
1552
- /* @__PURE__ */ f("div", {
1622
+ /* @__PURE__ */ p("div", {
1553
1623
  role: "status",
1554
1624
  "aria-live": "polite",
1555
1625
  "aria-atomic": "true",
1556
1626
  className: "sdk-sr-only",
1557
- children: br
1627
+ children: wr
1558
1628
  }),
1559
- /* @__PURE__ */ f("div", {
1560
- ref: A,
1629
+ /* @__PURE__ */ p("div", {
1630
+ ref: j,
1561
1631
  style: {
1562
1632
  opacity: 0,
1563
1633
  position: "absolute",
@@ -1569,18 +1639,18 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1569
1639
  },
1570
1640
  "aria-hidden": "true"
1571
1641
  }),
1572
- xn && /* @__PURE__ */ p("div", {
1642
+ Sn && /* @__PURE__ */ m("div", {
1573
1643
  className: "sdk-pip-placeholder",
1574
1644
  "aria-hidden": "true",
1575
- children: [/* @__PURE__ */ f(xe, {
1645
+ children: [/* @__PURE__ */ p(ye, {
1576
1646
  size: 32,
1577
1647
  "aria-hidden": "true"
1578
- }), /* @__PURE__ */ f("span", { children: "Playing in Picture-in-Picture" })]
1648
+ }), /* @__PURE__ */ p("span", { children: "Playing in Picture-in-Picture" })]
1579
1649
  }),
1580
- /* @__PURE__ */ f("div", {
1650
+ /* @__PURE__ */ p("div", {
1581
1651
  ref: M,
1582
1652
  style: {
1583
- opacity: lt && lt > 0 ? 1 : 0,
1653
+ opacity: ct && ct > 0 ? 1 : 0,
1584
1654
  position: "absolute",
1585
1655
  inset: 0,
1586
1656
  background: "#000",
@@ -1590,12 +1660,12 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1590
1660
  },
1591
1661
  "aria-hidden": "true"
1592
1662
  }),
1593
- /* @__PURE__ */ f("div", {
1594
- className: `sdk-spinner-overlay ${un ? "active" : ""}`,
1663
+ /* @__PURE__ */ p("div", {
1664
+ className: `sdk-spinner-overlay ${dn ? "active" : ""}`,
1595
1665
  "aria-hidden": "true",
1596
- children: /* @__PURE__ */ f("div", { className: "sdk-spinner" })
1666
+ children: /* @__PURE__ */ p("div", { className: "sdk-spinner" })
1597
1667
  }),
1598
- Xt && /* @__PURE__ */ f("div", {
1668
+ Zt && /* @__PURE__ */ p("div", {
1599
1669
  style: {
1600
1670
  position: "absolute",
1601
1671
  inset: 0,
@@ -1608,11 +1678,11 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1608
1678
  gap: 20,
1609
1679
  padding: "0 24px"
1610
1680
  },
1611
- children: /* @__PURE__ */ f(re, { onRetry: () => {
1612
- Zt(!1), $t((e) => e + 1);
1681
+ children: /* @__PURE__ */ p(ne, { onRetry: () => {
1682
+ Qt(!1), en((e) => e + 1);
1613
1683
  } })
1614
1684
  }),
1615
- Sr && /* @__PURE__ */ f("div", {
1685
+ Er && /* @__PURE__ */ p("div", {
1616
1686
  style: {
1617
1687
  position: "absolute",
1618
1688
  top: "50%",
@@ -1631,105 +1701,132 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1631
1701
  backdropFilter: "blur(8px)",
1632
1702
  border: "1px solid rgba(255,255,255,0.12)"
1633
1703
  },
1634
- children: Sr
1704
+ children: Er
1635
1705
  }),
1636
- I.enableSubtitles && !Y && nr && U !== "off" && /* @__PURE__ */ f("div", {
1706
+ I.enableSubtitles && !Y && or && U !== "off" && /* @__PURE__ */ p("div", {
1637
1707
  className: "sdk-subtitles-overlay",
1638
- children: /* @__PURE__ */ f("span", {
1708
+ children: /* @__PURE__ */ p("span", {
1639
1709
  className: "sdk-subtitles-text",
1640
1710
  style: {
1641
- fontSize: Xe.size === "small" ? "14px" : Xe.size === "large" ? "24px" : "18px",
1642
- color: Xe.color ?? "#ffffff",
1643
- background: Xe.background === "none" ? "transparent" : Xe.background === "solid" ? "rgba(0, 0, 0, 0.92)" : "rgba(15, 23, 42, 0.78)",
1644
- border: Xe.background === "none" ? "none" : "1px solid rgba(255,255,255,0.08)",
1645
- backdropFilter: Xe.background === "none" ? "none" : "blur(8px)"
1711
+ fontSize: Ye.size === "small" ? "14px" : Ye.size === "large" ? "24px" : "18px",
1712
+ color: Ye.color ?? "#ffffff",
1713
+ background: Ye.background === "none" ? "transparent" : Ye.background === "solid" ? "rgba(0, 0, 0, 0.92)" : "rgba(15, 23, 42, 0.78)",
1714
+ border: Ye.background === "none" ? "none" : "1px solid rgba(255,255,255,0.08)",
1715
+ backdropFilter: Ye.background === "none" ? "none" : "blur(8px)"
1646
1716
  },
1647
- dangerouslySetInnerHTML: { __html: nr }
1717
+ dangerouslySetInnerHTML: { __html: or }
1648
1718
  })
1649
1719
  }),
1650
- zn && /* @__PURE__ */ p("div", {
1651
- className: `sdk-overlay-ad sdk-overlay-ad--${zn.position}`,
1720
+ Bn && /* @__PURE__ */ m("div", {
1721
+ className: `sdk-overlay-ad sdk-overlay-ad--${Bn.position}`,
1652
1722
  role: "complementary",
1653
1723
  "aria-label": "Advertisement",
1654
- children: [/* @__PURE__ */ p("div", {
1724
+ children: [/* @__PURE__ */ m("div", {
1655
1725
  className: "sdk-overlay-ad-topbar",
1656
- children: [/* @__PURE__ */ f("span", {
1726
+ children: [/* @__PURE__ */ p("span", {
1657
1727
  className: "sdk-overlay-ad-label",
1658
1728
  children: "Ad"
1659
- }), zn.dismissible && /* @__PURE__ */ f("button", {
1729
+ }), Bn.dismissible && /* @__PURE__ */ p("button", {
1660
1730
  className: "sdk-overlay-ad-close",
1661
- onClick: wi,
1731
+ onClick: Oi,
1662
1732
  "aria-label": "Close advertisement",
1663
1733
  children: "✕"
1664
1734
  })]
1665
- }), /* @__PURE__ */ f("img", {
1666
- src: zn.imageUrl,
1667
- width: zn.imageWidth,
1668
- height: zn.imageHeight,
1669
- alt: zn.title || "Advertisement",
1735
+ }), /* @__PURE__ */ p("img", {
1736
+ src: Bn.imageUrl,
1737
+ width: Bn.imageWidth,
1738
+ height: Bn.imageHeight,
1739
+ alt: Bn.title || "Advertisement",
1670
1740
  className: "sdk-overlay-ad-img",
1671
- onClick: () => Ti(zn)
1741
+ onClick: () => ki(Bn)
1672
1742
  })]
1673
1743
  }),
1674
1744
  Y && (() => {
1675
- let e = Wn.find((e) => L >= e.startTimeSeconds && L < e.endTimeSeconds), t = R.find((e) => L >= e.startTime && L < e.endTime), n = e ? Math.max(0, e.endTimeSeconds - L) : t ? Math.max(0, t.endTime - L) : 0, r = e ? L - e.startTimeSeconds : t ? L - t.startTime : 0, i = !!e && e.podTotal > 1, a = e ? e.skippable : rt, o = e ? e.skipOffsetSeconds : it, s = a && r >= o, c = Math.ceil(o - r);
1676
- return /* @__PURE__ */ p(te, { children: [
1677
- /* @__PURE__ */ p("div", {
1745
+ let e = Gn.find((e) => L >= e.startTimeSeconds && L < e.endTimeSeconds), t = R.find((e) => L >= e.startTime && L < e.endTime), n = e ? Math.max(0, e.endTimeSeconds - L) : t ? Math.max(0, t.endTime - L) : 0, r = e ? L - e.startTimeSeconds : t ? L - t.startTime : 0, i = !!e && e.podTotal > 1, a = e ? e.skippable : nt, o = e ? e.skipOffsetSeconds : rt, s = a && r >= o, c = Math.ceil(o - r), l = r + n, u = l > 0 ? Math.min(1, Math.max(0, r / l)) : 0, d = 2.5, { w: f, h: te } = Yn, ne = Math.max(0, f - d), h = Math.max(0, te - d), g = Math.min(22 - d / 2, h / 2), _ = Math.max(0, ne - 2 * g), re = Math.max(0, h - 2 * g), ie = `M${1.25 + g + _ / 2},1.25h${_ / 2}a${g},${g} 0 0 1 ${g},${g}v${re}a${g},${g} 0 0 1 ${-g},${g}h${-_}a${g},${g} 0 0 1 ${-g},${-g}v${-re}a${g},${g} 0 0 1 ${g},${-g}h${_ / 2}`, ae = 2 * _ + 2 * re + 2 * Math.PI * g;
1746
+ return /* @__PURE__ */ m(ee, { children: [
1747
+ /* @__PURE__ */ m("div", {
1748
+ ref: Jn,
1678
1749
  className: "sdk-ad-countdown",
1679
1750
  role: "timer",
1680
1751
  "aria-label": i ? `Advertisement ${e.podIndex + 1} of ${e.podTotal} — ${Q(n)} remaining` : `Advertisement — ${Q(n)} remaining`,
1681
1752
  "aria-live": "off",
1682
1753
  children: [
1683
- /* @__PURE__ */ f("span", {
1684
- className: "sdk-ad-countdown-label",
1754
+ f > 0 && te > 0 && /* @__PURE__ */ m("svg", {
1755
+ className: "sdk-ad-countdown-border",
1756
+ width: f,
1757
+ height: te,
1758
+ viewBox: `0 0 ${f} ${te}`,
1685
1759
  "aria-hidden": "true",
1686
- children: i ? `Ad ${e.podIndex + 1} of ${e.podTotal}` : "Ad"
1760
+ children: [/* @__PURE__ */ p("path", {
1761
+ className: "sdk-ad-countdown-border-track",
1762
+ d: ie,
1763
+ strokeWidth: d
1764
+ }), /* @__PURE__ */ p("path", {
1765
+ className: "sdk-ad-countdown-border-fill",
1766
+ d: ie,
1767
+ strokeWidth: d,
1768
+ strokeDasharray: ae,
1769
+ strokeDashoffset: ae * (1 - u)
1770
+ })]
1687
1771
  }),
1688
- !i && /* @__PURE__ */ f("span", {
1689
- className: "sdk-ad-countdown-sep",
1772
+ /* @__PURE__ */ p("span", {
1773
+ className: "sdk-ad-countdown-badge",
1774
+ "aria-hidden": "true",
1775
+ children: "Ad"
1776
+ }),
1777
+ i && /* @__PURE__ */ m("span", {
1778
+ className: "sdk-ad-countdown-count",
1690
1779
  "aria-hidden": "true",
1691
- children: "·"
1780
+ children: [
1781
+ e.podIndex + 1,
1782
+ " of ",
1783
+ e.podTotal
1784
+ ]
1785
+ }),
1786
+ /* @__PURE__ */ p("span", {
1787
+ className: "sdk-ad-countdown-sep",
1788
+ "aria-hidden": "true"
1692
1789
  }),
1693
- /* @__PURE__ */ f("span", {
1790
+ /* @__PURE__ */ p("span", {
1694
1791
  className: "sdk-ad-countdown-time",
1695
1792
  "aria-hidden": "true",
1696
1793
  children: Q(n)
1697
1794
  })
1698
1795
  ]
1699
1796
  }),
1700
- a && /* @__PURE__ */ f("button", {
1797
+ a && /* @__PURE__ */ p("button", {
1701
1798
  className: `sdk-skip-ad-btn ${s ? "sdk-skip-ad-btn--ready" : ""}`,
1702
- onClick: s ? Ci : void 0,
1799
+ onClick: s ? Di : void 0,
1703
1800
  disabled: !s,
1704
1801
  "aria-label": s ? "Skip advertisement" : `Skip advertisement available in ${c} seconds`,
1705
1802
  "aria-disabled": !s,
1706
1803
  children: s ? "Skip Ad ›" : `Skip in ${c}s`
1707
1804
  }),
1708
1805
  e?.cta && (() => {
1709
- let t = e.cta, n = /* @__PURE__ */ p("button", {
1806
+ let t = e.cta, n = /* @__PURE__ */ m("button", {
1710
1807
  className: "sdk-ad-cta-btn",
1711
- onClick: () => Ei(t),
1808
+ onClick: () => Ai(t),
1712
1809
  "aria-label": `${t.text} — opens advertiser site in a new tab`,
1713
- children: [/* @__PURE__ */ f("span", {
1810
+ children: [/* @__PURE__ */ p("span", {
1714
1811
  className: "sdk-ad-cta-btn-text",
1715
1812
  children: t.text
1716
- }), /* @__PURE__ */ f(he, {
1813
+ }), /* @__PURE__ */ p(pe, {
1717
1814
  size: 15,
1718
1815
  "aria-hidden": "true"
1719
1816
  })]
1720
1817
  });
1721
- return /* @__PURE__ */ f("div", {
1818
+ return /* @__PURE__ */ p("div", {
1722
1819
  className: "sdk-ad-cta",
1723
1820
  role: "complementary",
1724
1821
  "aria-label": "Advertisement call to action",
1725
- children: t.title ? /* @__PURE__ */ p("div", {
1822
+ children: t.title ? /* @__PURE__ */ m("div", {
1726
1823
  className: "sdk-ad-cta-card",
1727
- children: [/* @__PURE__ */ p("div", {
1824
+ children: [/* @__PURE__ */ m("div", {
1728
1825
  className: "sdk-ad-cta-info",
1729
- children: [/* @__PURE__ */ f("div", {
1826
+ children: [/* @__PURE__ */ p("div", {
1730
1827
  className: "sdk-ad-cta-title",
1731
1828
  children: t.title
1732
- }), t.description && /* @__PURE__ */ f("div", {
1829
+ }), t.description && /* @__PURE__ */ p("div", {
1733
1830
  className: "sdk-ad-cta-desc",
1734
1831
  children: t.description
1735
1832
  })]
@@ -1739,7 +1836,7 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1739
1836
  })()
1740
1837
  ] });
1741
1838
  })(),
1742
- Yt && /* @__PURE__ */ f("div", {
1839
+ Xt && /* @__PURE__ */ p("div", {
1743
1840
  style: {
1744
1841
  position: "absolute",
1745
1842
  inset: 0,
@@ -1750,87 +1847,87 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1750
1847
  color: "#fff",
1751
1848
  zIndex: 60
1752
1849
  },
1753
- children: /* @__PURE__ */ p("div", {
1850
+ children: /* @__PURE__ */ m("div", {
1754
1851
  style: {
1755
1852
  maxWidth: 480,
1756
1853
  textAlign: "center",
1757
1854
  padding: 24
1758
1855
  },
1759
- children: [/* @__PURE__ */ f("h3", {
1856
+ children: [/* @__PURE__ */ p("h3", {
1760
1857
  style: { margin: "0 0 8px" },
1761
1858
  children: "Playback restricted"
1762
- }), /* @__PURE__ */ f("p", {
1859
+ }), /* @__PURE__ */ p("p", {
1763
1860
  style: { margin: 0 },
1764
1861
  children: "Your account is missing a required license key. Please contact your administrator."
1765
1862
  })]
1766
1863
  })
1767
1864
  }),
1768
- (q || Mr) && /* @__PURE__ */ f("div", { className: "sdk-cast-bg" }),
1769
- vn && /* @__PURE__ */ p("div", {
1770
- className: `sdk-mobile-overlay ${Yr ? "active" : ""}`,
1771
- onClick: Li,
1772
- children: [Vt && /* @__PURE__ */ f("div", {
1773
- className: `sdk-mobile-doubletap ${Vt}`,
1774
- children: /* @__PURE__ */ p("div", {
1865
+ (q || Ir) && /* @__PURE__ */ p("div", { className: "sdk-cast-bg" }),
1866
+ yn && /* @__PURE__ */ m("div", {
1867
+ className: `sdk-mobile-overlay ${$r ? "active" : ""}`,
1868
+ onClick: Vi,
1869
+ children: [Ht && /* @__PURE__ */ p("div", {
1870
+ className: `sdk-mobile-doubletap ${Ht}`,
1871
+ children: /* @__PURE__ */ m("div", {
1775
1872
  className: "sdk-mobile-doubletap-icon",
1776
- children: [f(Vt === "left" ? Ce : we, { size: 26 }), /* @__PURE__ */ f("span", {
1873
+ children: [p(Ht === "left" ? xe : Se, { size: 26 }), /* @__PURE__ */ p("span", {
1777
1874
  className: "sdk-mobile-doubletap-label",
1778
1875
  children: "10s"
1779
1876
  })]
1780
1877
  })
1781
- }), g && /* @__PURE__ */ p(te, { children: [
1782
- /* @__PURE__ */ p("div", {
1878
+ }), v && /* @__PURE__ */ m(ee, { children: [
1879
+ /* @__PURE__ */ m("div", {
1783
1880
  className: "sdk-mobile-header sdk-mobile-ctrl",
1784
- children: [/* @__PURE__ */ p("div", {
1881
+ children: [/* @__PURE__ */ m("div", {
1785
1882
  className: "sdk-mobile-header-left",
1786
- children: [(fn || mn) && /* @__PURE__ */ f("button", {
1883
+ children: [(pn || hn) && /* @__PURE__ */ p("button", {
1787
1884
  className: "sdk-mobile-back-btn",
1788
- onClick: Si,
1885
+ onClick: Ei,
1789
1886
  "aria-label": "Exit fullscreen",
1790
- children: /* @__PURE__ */ f(me, {
1887
+ children: /* @__PURE__ */ p(fe, {
1791
1888
  size: 22,
1792
1889
  "aria-hidden": "true"
1793
1890
  })
1794
- }), (x || qr) && /* @__PURE__ */ f("div", {
1891
+ }), (S || Zr) && /* @__PURE__ */ p("div", {
1795
1892
  className: "sdk-mobile-title",
1796
- children: x || qr
1893
+ children: S || Zr
1797
1894
  })]
1798
- }), /* @__PURE__ */ p("div", {
1895
+ }), /* @__PURE__ */ m("div", {
1799
1896
  className: "sdk-mobile-header-actions",
1800
1897
  children: [
1801
- I.enablePiP && /* @__PURE__ */ f("button", {
1898
+ I.enablePiP && /* @__PURE__ */ p("button", {
1802
1899
  className: "sdk-mobile-hdr-btn",
1803
1900
  onClick: () => {
1804
- Y || bi();
1901
+ Y || wi();
1805
1902
  },
1806
- style: { color: yn ? h : "" },
1807
- "aria-label": yn ? "Exit picture-in-picture" : "Enter picture-in-picture",
1808
- "aria-pressed": yn,
1809
- children: /* @__PURE__ */ f(xe, {
1903
+ style: { color: bn ? _ : "" },
1904
+ "aria-label": bn ? "Exit picture-in-picture" : "Enter picture-in-picture",
1905
+ "aria-pressed": bn,
1906
+ children: /* @__PURE__ */ p(ye, {
1810
1907
  size: 20,
1811
1908
  "aria-hidden": "true"
1812
1909
  })
1813
1910
  }),
1814
- I.enableChromecast && !Y && /* @__PURE__ */ f("button", {
1911
+ I.enableChromecast && !Y && /* @__PURE__ */ p("button", {
1815
1912
  className: "sdk-mobile-hdr-btn",
1816
- onClick: Di,
1913
+ onClick: ji,
1817
1914
  "data-tooltip": q ? `Casting to ${q} — tap to disconnect` : "Cast to device",
1818
1915
  "aria-label": q ? `Stop casting to ${q}` : "Cast to device",
1819
1916
  "aria-pressed": !!q,
1820
1917
  style: { color: q ? "#3b82f6" : "" },
1821
- children: /* @__PURE__ */ f(pe, {
1918
+ children: /* @__PURE__ */ p(de, {
1822
1919
  size: 20,
1823
1920
  fill: q ? "currentColor" : "none",
1824
1921
  "aria-hidden": "true"
1825
1922
  })
1826
1923
  }),
1827
- I.allowAirplay && Ar && /* @__PURE__ */ f("button", {
1924
+ I.allowAirplay && Pr && /* @__PURE__ */ p("button", {
1828
1925
  className: "sdk-mobile-hdr-btn",
1829
- onClick: Oi,
1830
- "aria-label": Mr ? `Stop AirPlay to ${Pr || "device"}` : "AirPlay to device",
1831
- "aria-pressed": Mr,
1832
- style: { color: Mr ? h : "" },
1833
- children: /* @__PURE__ */ f(de, {
1926
+ onClick: Mi,
1927
+ "aria-label": Ir ? `Stop AirPlay to ${Rr || "device"}` : "AirPlay to device",
1928
+ "aria-pressed": Ir,
1929
+ style: { color: Ir ? _ : "" },
1930
+ children: /* @__PURE__ */ p(le, {
1834
1931
  size: 20,
1835
1932
  "aria-hidden": "true"
1836
1933
  })
@@ -1838,54 +1935,54 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1838
1935
  ]
1839
1936
  })]
1840
1937
  }),
1841
- /* @__PURE__ */ p("div", {
1938
+ /* @__PURE__ */ m("div", {
1842
1939
  className: "sdk-mobile-center-controls sdk-mobile-ctrl",
1843
1940
  children: [
1844
- !Y && /* @__PURE__ */ p("button", {
1941
+ !Y && /* @__PURE__ */ m("button", {
1845
1942
  className: "sdk-mobile-seek-btn",
1846
1943
  onClick: () => Z(H(Math.max(0, V($) - 10)), {
1847
1944
  eventType: "fast_backward",
1848
1945
  skipSeconds: 10
1849
1946
  }),
1850
1947
  "aria-label": "Rewind 10 seconds",
1851
- children: [/* @__PURE__ */ f(Ce, {
1948
+ children: [/* @__PURE__ */ p(xe, {
1852
1949
  size: 22,
1853
1950
  "aria-hidden": "true"
1854
- }), /* @__PURE__ */ f("span", {
1951
+ }), /* @__PURE__ */ p("span", {
1855
1952
  className: "sdk-mobile-seek-label",
1856
1953
  "aria-hidden": "true",
1857
1954
  children: "10"
1858
1955
  })]
1859
1956
  }),
1860
- /* @__PURE__ */ f("button", {
1957
+ /* @__PURE__ */ p("button", {
1861
1958
  className: "sdk-mobile-play-btn",
1862
- onClick: ui,
1863
- "aria-label": Cn ? "Replay" : Ni ? "Pause" : "Play",
1864
- children: Cn ? /* @__PURE__ */ f(Ce, {
1959
+ onClick: mi,
1960
+ "aria-label": wn ? "Replay" : Li ? "Pause" : "Play",
1961
+ children: wn ? /* @__PURE__ */ p(xe, {
1865
1962
  size: 38,
1866
1963
  "aria-hidden": "true"
1867
- }) : Ni ? /* @__PURE__ */ f(v, {
1964
+ }) : Li ? /* @__PURE__ */ p(b, {
1868
1965
  size: 38,
1869
1966
  fill: "currentColor",
1870
1967
  "aria-hidden": "true"
1871
- }) : /* @__PURE__ */ f(Se, {
1968
+ }) : /* @__PURE__ */ p(be, {
1872
1969
  size: 38,
1873
1970
  fill: "currentColor",
1874
1971
  style: { marginLeft: "3px" },
1875
1972
  "aria-hidden": "true"
1876
1973
  })
1877
1974
  }),
1878
- !Y && /* @__PURE__ */ p("button", {
1975
+ !Y && /* @__PURE__ */ m("button", {
1879
1976
  className: "sdk-mobile-seek-btn",
1880
1977
  onClick: () => Z(H(Math.min(B, V($) + 10)), {
1881
1978
  eventType: "fast_forward",
1882
1979
  skipSeconds: 10
1883
1980
  }),
1884
1981
  "aria-label": "Skip forward 10 seconds",
1885
- children: [/* @__PURE__ */ f(we, {
1982
+ children: [/* @__PURE__ */ p(Se, {
1886
1983
  size: 22,
1887
1984
  "aria-hidden": "true"
1888
- }), /* @__PURE__ */ f("span", {
1985
+ }), /* @__PURE__ */ p("span", {
1889
1986
  className: "sdk-mobile-seek-label",
1890
1987
  "aria-hidden": "true",
1891
1988
  children: "10"
@@ -1893,28 +1990,28 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1893
1990
  })
1894
1991
  ]
1895
1992
  }),
1896
- /* @__PURE__ */ p("div", {
1993
+ /* @__PURE__ */ m("div", {
1897
1994
  className: "sdk-mobile-bottom-bar sdk-mobile-ctrl",
1898
1995
  children: [
1899
- I.enableKeyMoments && gr && W.length > 0 && /* @__PURE__ */ f("div", {
1996
+ I.enableKeyMoments && br && W.length > 0 && /* @__PURE__ */ p("div", {
1900
1997
  className: "sdk-mobile-chapters-scroll",
1901
1998
  children: W.map((e, t) => {
1902
- let n = dr.index === t;
1903
- return /* @__PURE__ */ p("div", {
1999
+ let n = hr.index === t;
2000
+ return /* @__PURE__ */ m("div", {
1904
2001
  role: "button",
1905
2002
  tabIndex: 0,
1906
2003
  className: `sdk-mobile-chapter-card${n ? " active" : ""}`,
1907
- style: { borderColor: n ? h : void 0 },
2004
+ style: { borderColor: n ? _ : void 0 },
1908
2005
  "aria-label": `${e.title}, ${Q(e.startTime)}${n ? ", current chapter" : ""}`,
1909
2006
  "aria-current": n ? "true" : void 0,
1910
2007
  onClick: () => {
1911
- vi(e.startTime, e);
2008
+ Si(e.startTime, e);
1912
2009
  },
1913
- onKeyDown: Bi(() => vi(e.startTime, e)),
1914
- children: [/* @__PURE__ */ p("div", {
2010
+ onKeyDown: Wi(() => Si(e.startTime, e)),
2011
+ children: [/* @__PURE__ */ m("div", {
1915
2012
  className: "sdk-mobile-chapter-thumb",
1916
- children: [vr[t] || e.thumbnail ? /* @__PURE__ */ f("img", {
1917
- src: vr[t] || e.thumbnail,
2013
+ children: [Sr[t] || e.thumbnail ? /* @__PURE__ */ p("img", {
2014
+ src: Sr[t] || e.thumbnail,
1918
2015
  alt: "",
1919
2016
  "aria-hidden": "true",
1920
2017
  style: {
@@ -1923,25 +2020,25 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1923
2020
  objectFit: "cover",
1924
2021
  display: "block"
1925
2022
  }
1926
- }) : /* @__PURE__ */ f(ve, {
2023
+ }) : /* @__PURE__ */ p(ge, {
1927
2024
  size: 16,
1928
2025
  "aria-hidden": "true",
1929
- style: { color: n ? h : "rgba(255,255,255,0.3)" }
1930
- }), /* @__PURE__ */ f("span", {
2026
+ style: { color: n ? _ : "rgba(255,255,255,0.3)" }
2027
+ }), /* @__PURE__ */ p("span", {
1931
2028
  className: "sdk-mobile-chapter-time-badge",
1932
2029
  "aria-hidden": "true",
1933
2030
  children: Q(e.startTime)
1934
2031
  })]
1935
- }), /* @__PURE__ */ f("div", {
2032
+ }), /* @__PURE__ */ p("div", {
1936
2033
  className: "sdk-mobile-chapter-title",
1937
- style: { color: n ? h : void 0 },
2034
+ style: { color: n ? _ : void 0 },
1938
2035
  children: e.title
1939
2036
  })]
1940
2037
  }, t);
1941
2038
  })
1942
2039
  }),
1943
- /* @__PURE__ */ f("div", {
1944
- ref: w,
2040
+ /* @__PURE__ */ p("div", {
2041
+ ref: T,
1945
2042
  role: X ? void 0 : "slider",
1946
2043
  "aria-label": X ? void 0 : "Seek",
1947
2044
  "aria-valuemin": X ? void 0 : 0,
@@ -1950,41 +2047,41 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1950
2047
  "aria-valuetext": X ? void 0 : `${Q(V(J === null ? L : J))} of ${Q(B)}`,
1951
2048
  tabIndex: X ? void 0 : 0,
1952
2049
  className: `sdk-seekbar-container sdk-mobile-seekbar${Y ? " sdk-ad-mode" : ""}`,
1953
- onMouseDown: X ? void 0 : fi,
1954
- onMouseMove: X ? void 0 : ki,
1955
- onMouseLeave: X ? void 0 : Mi,
1956
- onTouchStart: X ? void 0 : ji,
1957
- onKeyDown: X ? void 0 : Vi,
2050
+ onMouseDown: X ? void 0 : gi,
2051
+ onMouseMove: X ? void 0 : Ni,
2052
+ onMouseLeave: X ? void 0 : Ii,
2053
+ onTouchStart: X ? void 0 : Fi,
2054
+ onKeyDown: X ? void 0 : Gi,
1958
2055
  style: {
1959
2056
  pointerEvents: X ? "none" : void 0,
1960
2057
  touchAction: "none"
1961
2058
  },
1962
- children: Y ? /* @__PURE__ */ f("div", {
2059
+ children: Y ? /* @__PURE__ */ p("div", {
1963
2060
  className: "sdk-ad-progress-fill",
1964
2061
  style: { width: (() => {
1965
- let e = F ? F.getCurrentTime() : L, t = Yn(e);
2062
+ let e = F ? F.getCurrentTime() : L, t = $n(e);
1966
2063
  return t ? `${Math.min(100, Math.max(0, (e - t.start) / (t.end - t.start) * 100))}%` : "0%";
1967
2064
  })() }
1968
- }) : /* @__PURE__ */ p(te, { children: [
1969
- /* @__PURE__ */ f("div", {
2065
+ }) : /* @__PURE__ */ m(ee, { children: [
2066
+ /* @__PURE__ */ p("div", {
1970
2067
  className: "sdk-seekbar-buffered",
1971
- style: { width: `${rn ? (F && F.getBufferedRanges()[0]?.end || 0) / rn * 100 : 0}%` }
2068
+ style: { width: `${an ? (F && F.getBufferedRanges()[0]?.end || 0) / an * 100 : 0}%` }
1972
2069
  }),
1973
- B > 0 && R.filter((e) => !On.has(e.startTime)).map((e, t) => /* @__PURE__ */ f("div", {
2070
+ B > 0 && R.filter((e) => !kn.has(e.startTime)).map((e, t) => /* @__PURE__ */ p("div", {
1974
2071
  className: "sdk-seekbar-adbreak",
1975
2072
  style: {
1976
2073
  left: `${V(e.startTime) / B * 100}%`,
1977
2074
  width: "3px"
1978
2075
  }
1979
2076
  }, t)),
1980
- /* @__PURE__ */ f("div", {
2077
+ /* @__PURE__ */ p("div", {
1981
2078
  className: "sdk-seekbar-progress",
1982
2079
  style: {
1983
- width: q ? `${Pi > 0 ? $ / Pi * 100 : 0}%` : `${B ? V(J === null ? L : J) / B * 100 : 0}%`,
2080
+ width: q ? `${Ri > 0 ? $ / Ri * 100 : 0}%` : `${B ? V(J === null ? L : J) / B * 100 : 0}%`,
1984
2081
  background: "#ffffff",
1985
2082
  boxShadow: "none"
1986
2083
  },
1987
- children: /* @__PURE__ */ f("div", {
2084
+ children: /* @__PURE__ */ p("div", {
1988
2085
  className: "sdk-seekbar-handle",
1989
2086
  style: {
1990
2087
  opacity: 1,
@@ -1992,77 +2089,77 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1992
2089
  }
1993
2090
  })
1994
2091
  }),
1995
- I.enableKeyMoments && W.map((e, t) => B === 0 ? null : /* @__PURE__ */ f("div", {
2092
+ I.enableKeyMoments && W.map((e, t) => B === 0 ? null : /* @__PURE__ */ p("div", {
1996
2093
  className: "sdk-seekbar-chapter-marker sdk-desktop-chapter-dot",
1997
2094
  style: { left: `${V(e.startTime) / B * 100}%` }
1998
2095
  }, t))
1999
2096
  ] })
2000
2097
  }),
2001
- /* @__PURE__ */ p("div", {
2098
+ /* @__PURE__ */ m("div", {
2002
2099
  className: "sdk-mobile-controls-row",
2003
- children: [!Y && /* @__PURE__ */ f("span", {
2100
+ children: [!Y && /* @__PURE__ */ p("span", {
2004
2101
  className: "sdk-time-display",
2005
- children: q ? `${Q($)} / ${Q(Pi)}` : `${Q(V(J === null ? L : J))} / ${Q(B)}`
2006
- }), /* @__PURE__ */ p("div", {
2102
+ children: q ? `${Q($)} / ${Q(Ri)}` : `${Q(V(J === null ? L : J))} / ${Q(B)}`
2103
+ }), /* @__PURE__ */ m("div", {
2007
2104
  className: "sdk-mobile-bottom-icons",
2008
2105
  children: [
2009
- I.enableKeyMoments && W.length > 0 && !Y && /* @__PURE__ */ f("button", {
2010
- className: `sdk-mobile-icon-btn${gr ? " active" : ""}`,
2106
+ I.enableKeyMoments && W.length > 0 && !Y && /* @__PURE__ */ p("button", {
2107
+ className: `sdk-mobile-icon-btn${br ? " active" : ""}`,
2011
2108
  onClick: () => {
2012
- _r(!gr);
2109
+ xr(!br);
2013
2110
  },
2014
- "aria-label": gr ? "Hide chapters" : "Show chapters",
2015
- "aria-pressed": gr,
2016
- children: /* @__PURE__ */ f(ve, {
2111
+ "aria-label": br ? "Hide chapters" : "Show chapters",
2112
+ "aria-pressed": br,
2113
+ children: /* @__PURE__ */ p(ge, {
2017
2114
  size: 18,
2018
2115
  "aria-hidden": "true"
2019
2116
  })
2020
2117
  }),
2021
- I.enableSubtitles && !Y && ar.some((e) => !e.isNative) && /* @__PURE__ */ p("div", {
2118
+ I.enableSubtitles && !Y && lr.some((e) => !e.isNative) && /* @__PURE__ */ m("div", {
2022
2119
  className: "sdk-menu-container",
2023
- children: [/* @__PURE__ */ f("button", {
2120
+ children: [/* @__PURE__ */ p("button", {
2024
2121
  className: `sdk-mobile-icon-btn${U === "off" ? "" : " active"}`,
2025
2122
  onClick: () => {
2026
- Hi("subtitles");
2123
+ Ki("subtitles");
2027
2124
  },
2028
2125
  "aria-label": "Captions",
2029
2126
  "aria-haspopup": "listbox",
2030
2127
  "aria-expanded": G === "subtitles",
2031
- children: /* @__PURE__ */ f(fe, {
2128
+ children: /* @__PURE__ */ p(ue, {
2032
2129
  size: 18,
2033
2130
  "aria-hidden": "true"
2034
2131
  })
2035
- }), G === "subtitles" && /* @__PURE__ */ p("div", {
2036
- ref: Ui,
2132
+ }), G === "subtitles" && /* @__PURE__ */ m("div", {
2133
+ ref: qi,
2037
2134
  className: "sdk-dropup-menu",
2038
2135
  role: "listbox",
2039
2136
  "aria-label": "Captions",
2040
2137
  children: [
2041
- /* @__PURE__ */ f("div", {
2138
+ /* @__PURE__ */ p("div", {
2042
2139
  className: "sdk-dropup-header",
2043
2140
  "aria-hidden": "true",
2044
2141
  children: "Subtitles"
2045
2142
  }),
2046
- /* @__PURE__ */ p("div", {
2143
+ /* @__PURE__ */ m("div", {
2047
2144
  role: "option",
2048
2145
  "aria-selected": U === "off",
2049
2146
  tabIndex: 0,
2050
2147
  className: `sdk-dropup-item ${U === "off" ? "active" : ""}`,
2051
- onClick: () => gi("off"),
2052
- onKeyDown: zi(() => gi("off")),
2053
- children: [/* @__PURE__ */ f("span", { children: "Off" }), U === "off" && /* @__PURE__ */ f(_, {
2148
+ onClick: () => bi("off"),
2149
+ onKeyDown: Ui(() => bi("off")),
2150
+ children: [/* @__PURE__ */ p("span", { children: "Off" }), U === "off" && /* @__PURE__ */ p(y, {
2054
2151
  size: 12,
2055
2152
  "aria-hidden": "true"
2056
2153
  })]
2057
2154
  }),
2058
- ar.map((e) => /* @__PURE__ */ p("div", {
2155
+ lr.map((e) => /* @__PURE__ */ m("div", {
2059
2156
  role: "option",
2060
2157
  "aria-selected": U === e.id,
2061
2158
  tabIndex: 0,
2062
2159
  className: `sdk-dropup-item ${U === e.id ? "active" : ""}`,
2063
- onClick: () => gi(e.id),
2064
- onKeyDown: zi(() => gi(e.id)),
2065
- children: [/* @__PURE__ */ f("span", { children: b(e) }), U === e.id && /* @__PURE__ */ f(_, {
2160
+ onClick: () => bi(e.id),
2161
+ onKeyDown: Ui(() => bi(e.id)),
2162
+ children: [/* @__PURE__ */ p("span", { children: x(e) }), U === e.id && /* @__PURE__ */ p(y, {
2066
2163
  size: 12,
2067
2164
  "aria-hidden": "true"
2068
2165
  })]
@@ -2070,67 +2167,67 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2070
2167
  ]
2071
2168
  })]
2072
2169
  }),
2073
- I.allowMultipleAudio && sr.length > 1 && !Y && /* @__PURE__ */ p("div", {
2170
+ I.allowMultipleAudio && dr.length > 1 && !Y && /* @__PURE__ */ m("div", {
2074
2171
  className: "sdk-menu-container",
2075
- children: [/* @__PURE__ */ f("button", {
2172
+ children: [/* @__PURE__ */ p("button", {
2076
2173
  className: `sdk-mobile-icon-btn${G === "audio" ? " active" : ""}`,
2077
2174
  onClick: () => {
2078
- Hi("audio");
2175
+ Ki("audio");
2079
2176
  },
2080
2177
  "aria-label": "Audio track",
2081
2178
  "aria-haspopup": "listbox",
2082
2179
  "aria-expanded": G === "audio",
2083
- children: /* @__PURE__ */ f(_e, {
2180
+ children: /* @__PURE__ */ p(he, {
2084
2181
  size: 18,
2085
2182
  "aria-hidden": "true"
2086
2183
  })
2087
- }), G === "audio" && /* @__PURE__ */ p("div", {
2088
- ref: Ui,
2184
+ }), G === "audio" && /* @__PURE__ */ m("div", {
2185
+ ref: qi,
2089
2186
  className: "sdk-dropup-menu",
2090
2187
  role: "listbox",
2091
2188
  "aria-label": "Audio track",
2092
- children: [/* @__PURE__ */ f("div", {
2189
+ children: [/* @__PURE__ */ p("div", {
2093
2190
  className: "sdk-dropup-header",
2094
2191
  "aria-hidden": "true",
2095
2192
  children: "Audio Track"
2096
- }), sr.map((e) => /* @__PURE__ */ p("div", {
2193
+ }), dr.map((e) => /* @__PURE__ */ m("div", {
2097
2194
  role: "option",
2098
- "aria-selected": lr === e.id,
2195
+ "aria-selected": pr === e.id,
2099
2196
  tabIndex: 0,
2100
- className: `sdk-dropup-item ${lr === e.id ? "active" : ""}`,
2197
+ className: `sdk-dropup-item ${pr === e.id ? "active" : ""}`,
2101
2198
  onClick: () => {
2102
- F?.setAudioTrack(e.id), ur(e.id), K("none"), xr(`Audio: ${b(e)}`);
2199
+ F?.setAudioTrack(e.id), mr(e.id), K("none"), Tr(`Audio: ${x(e)}`);
2103
2200
  },
2104
- onKeyDown: zi(() => {
2105
- F?.setAudioTrack(e.id), ur(e.id), K("none"), xr(`Audio: ${b(e)}`);
2201
+ onKeyDown: Ui(() => {
2202
+ F?.setAudioTrack(e.id), mr(e.id), K("none"), Tr(`Audio: ${x(e)}`);
2106
2203
  }),
2107
- children: [/* @__PURE__ */ f("span", { children: b(e) }), lr === e.id && /* @__PURE__ */ f(_, {
2204
+ children: [/* @__PURE__ */ p("span", { children: x(e) }), pr === e.id && /* @__PURE__ */ p(y, {
2108
2205
  size: 12,
2109
2206
  "aria-hidden": "true"
2110
2207
  })]
2111
2208
  }, e.id))]
2112
2209
  })]
2113
2210
  }),
2114
- I.enablePlaybackSpeed && !Y && /* @__PURE__ */ p("div", {
2211
+ I.enablePlaybackSpeed && !Y && /* @__PURE__ */ m("div", {
2115
2212
  className: "sdk-menu-container",
2116
- children: [/* @__PURE__ */ f("button", {
2213
+ children: [/* @__PURE__ */ p("button", {
2117
2214
  className: `sdk-mobile-icon-btn${G === "speed" ? " active" : ""}`,
2118
2215
  onClick: () => {
2119
- Hi("speed");
2216
+ Ki("speed");
2120
2217
  },
2121
2218
  "aria-label": "Playback speed",
2122
2219
  "aria-haspopup": "listbox",
2123
2220
  "aria-expanded": G === "speed",
2124
- children: /* @__PURE__ */ f(ge, {
2221
+ children: /* @__PURE__ */ p(me, {
2125
2222
  size: 18,
2126
2223
  "aria-hidden": "true"
2127
2224
  })
2128
- }), G === "speed" && /* @__PURE__ */ p("div", {
2129
- ref: Ui,
2225
+ }), G === "speed" && /* @__PURE__ */ m("div", {
2226
+ ref: qi,
2130
2227
  className: "sdk-dropup-menu",
2131
2228
  role: "listbox",
2132
2229
  "aria-label": "Playback speed",
2133
- children: [/* @__PURE__ */ f("div", {
2230
+ children: [/* @__PURE__ */ p("div", {
2134
2231
  className: "sdk-dropup-header",
2135
2232
  "aria-hidden": "true",
2136
2233
  children: "Speed"
@@ -2141,100 +2238,100 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2141
2238
  1.25,
2142
2239
  1.5,
2143
2240
  2
2144
- ].map((e) => /* @__PURE__ */ p("div", {
2241
+ ].map((e) => /* @__PURE__ */ m("div", {
2145
2242
  role: "option",
2146
- "aria-selected": mr === e,
2243
+ "aria-selected": vr === e,
2147
2244
  tabIndex: 0,
2148
- className: `sdk-dropup-item ${mr === e ? "active" : ""}`,
2149
- onClick: () => mi(e),
2150
- onKeyDown: zi(() => mi(e)),
2151
- children: [/* @__PURE__ */ f("span", { children: e === 1 ? "Normal" : `${e}x` }), mr === e && /* @__PURE__ */ f(_, {
2245
+ className: `sdk-dropup-item ${vr === e ? "active" : ""}`,
2246
+ onClick: () => vi(e),
2247
+ onKeyDown: Ui(() => vi(e)),
2248
+ children: [/* @__PURE__ */ p("span", { children: e === 1 ? "Normal" : `${e}x` }), vr === e && /* @__PURE__ */ p(y, {
2152
2249
  size: 12,
2153
2250
  "aria-hidden": "true"
2154
2251
  })]
2155
2252
  }, e))]
2156
2253
  })]
2157
2254
  }),
2158
- I.enableQuality && !Y && /* @__PURE__ */ p("div", {
2255
+ I.enableQuality && !Y && /* @__PURE__ */ m("div", {
2159
2256
  className: "sdk-menu-container",
2160
- children: [/* @__PURE__ */ f("button", {
2161
- className: `sdk-mobile-icon-btn${er.id === -1 ? "" : " active"}`,
2257
+ children: [/* @__PURE__ */ p("button", {
2258
+ className: `sdk-mobile-icon-btn${ir.id === -1 ? "" : " active"}`,
2162
2259
  onClick: () => {
2163
- Hi("quality");
2260
+ Ki("quality");
2164
2261
  },
2165
2262
  "aria-label": "Video quality",
2166
2263
  "aria-haspopup": "listbox",
2167
2264
  "aria-expanded": G === "quality",
2168
- children: /* @__PURE__ */ f(Ne, {
2265
+ children: /* @__PURE__ */ p(Me, {
2169
2266
  size: 18,
2170
2267
  "aria-hidden": "true"
2171
2268
  })
2172
- }), G === "quality" && /* @__PURE__ */ p("div", {
2173
- ref: Ui,
2269
+ }), G === "quality" && /* @__PURE__ */ m("div", {
2270
+ ref: qi,
2174
2271
  className: "sdk-dropup-menu large",
2175
2272
  role: "listbox",
2176
2273
  "aria-label": "Video quality",
2177
- children: [/* @__PURE__ */ f("div", {
2274
+ children: [/* @__PURE__ */ p("div", {
2178
2275
  className: "sdk-dropup-header",
2179
2276
  "aria-hidden": "true",
2180
2277
  children: "Quality"
2181
- }), Qn.map((e) => /* @__PURE__ */ p("div", {
2278
+ }), nr.map((e) => /* @__PURE__ */ m("div", {
2182
2279
  role: "option",
2183
- "aria-selected": er.id === e.id,
2280
+ "aria-selected": ir.id === e.id,
2184
2281
  tabIndex: 0,
2185
- className: `sdk-dropup-item ${er.id === e.id ? "active" : ""}`,
2186
- onClick: () => hi(e.id),
2187
- onKeyDown: zi(() => hi(e.id)),
2188
- children: [/* @__PURE__ */ f("span", { children: e.label }), er.id === e.id && /* @__PURE__ */ f(_, {
2282
+ className: `sdk-dropup-item ${ir.id === e.id ? "active" : ""}`,
2283
+ onClick: () => yi(e.id),
2284
+ onKeyDown: Ui(() => yi(e.id)),
2285
+ children: [/* @__PURE__ */ p("span", { children: e.label }), ir.id === e.id && /* @__PURE__ */ p(y, {
2189
2286
  size: 12,
2190
2287
  "aria-hidden": "true"
2191
2288
  })]
2192
2289
  }, e.id))]
2193
2290
  })]
2194
2291
  }),
2195
- S && S.length > 1 && !Y && /* @__PURE__ */ p("div", {
2292
+ C && C.length > 1 && !Y && /* @__PURE__ */ m("div", {
2196
2293
  className: "sdk-menu-container",
2197
- children: [/* @__PURE__ */ f("button", {
2294
+ children: [/* @__PURE__ */ p("button", {
2198
2295
  className: `sdk-mobile-icon-btn${G === "sources" ? " active" : ""}`,
2199
2296
  onClick: () => {
2200
- Hi("sources");
2297
+ Ki("sources");
2201
2298
  },
2202
2299
  "aria-label": "Select source",
2203
2300
  "aria-haspopup": "listbox",
2204
2301
  "aria-expanded": G === "sources",
2205
- children: /* @__PURE__ */ f(Pe, {
2302
+ children: /* @__PURE__ */ p(Ne, {
2206
2303
  size: 18,
2207
2304
  "aria-hidden": "true"
2208
2305
  })
2209
- }), G === "sources" && /* @__PURE__ */ p("div", {
2210
- ref: Ui,
2306
+ }), G === "sources" && /* @__PURE__ */ m("div", {
2307
+ ref: qi,
2211
2308
  className: "sdk-dropup-menu",
2212
2309
  role: "listbox",
2213
2310
  "aria-label": "Select source",
2214
- children: [/* @__PURE__ */ f("div", {
2311
+ children: [/* @__PURE__ */ p("div", {
2215
2312
  className: "sdk-dropup-header",
2216
2313
  "aria-hidden": "true",
2217
2314
  children: "Source"
2218
- }), S.map((e, t) => /* @__PURE__ */ p("div", {
2315
+ }), C.map((e, t) => /* @__PURE__ */ m("div", {
2219
2316
  role: "option",
2220
- "aria-selected": st === t,
2317
+ "aria-selected": ot === t,
2221
2318
  tabIndex: 0,
2222
- className: `sdk-dropup-item ${st === t ? "active" : ""}`,
2223
- onClick: () => _i(t),
2224
- onKeyDown: zi(() => _i(t)),
2225
- children: [/* @__PURE__ */ f("span", { children: e.label }), st === t && /* @__PURE__ */ f(_, {
2319
+ className: `sdk-dropup-item ${ot === t ? "active" : ""}`,
2320
+ onClick: () => xi(t),
2321
+ onKeyDown: Ui(() => xi(t)),
2322
+ children: [/* @__PURE__ */ p("span", { children: e.label }), ot === t && /* @__PURE__ */ p(y, {
2226
2323
  size: 12,
2227
2324
  "aria-hidden": "true"
2228
2325
  })]
2229
2326
  }, t))]
2230
2327
  })]
2231
2328
  }),
2232
- /* @__PURE__ */ f("button", {
2329
+ /* @__PURE__ */ p("button", {
2233
2330
  className: "sdk-mobile-icon-btn",
2234
- onClick: Si,
2235
- "aria-label": fn || mn ? "Exit fullscreen" : "Enter fullscreen",
2236
- "aria-pressed": fn || mn,
2237
- children: f(fn ? be : ye, {
2331
+ onClick: Ei,
2332
+ "aria-label": pn || hn ? "Exit fullscreen" : "Enter fullscreen",
2333
+ "aria-pressed": pn || hn,
2334
+ children: p(pn ? ve : _e, {
2238
2335
  size: 18,
2239
2336
  "aria-hidden": "true"
2240
2337
  })
@@ -2246,78 +2343,78 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2246
2343
  })
2247
2344
  ] })]
2248
2345
  }),
2249
- !vn && /* @__PURE__ */ p("div", {
2346
+ !yn && /* @__PURE__ */ m("div", {
2250
2347
  className: "sdk-controls-overlay",
2251
2348
  onClick: (e) => {
2252
- Y || e.target.closest(".sdk-desktop-header") || e.target.closest(".sdk-desktop-center-controls") || e.target.closest(".sdk-desktop-bottom") || ui();
2349
+ Y || e.target.closest(".sdk-desktop-header") || e.target.closest(".sdk-desktop-center-controls") || e.target.closest(".sdk-desktop-bottom") || mi();
2253
2350
  },
2254
- children: [/* @__PURE__ */ p("div", {
2351
+ children: [/* @__PURE__ */ m("div", {
2255
2352
  className: "sdk-desktop-header",
2256
- children: [/* @__PURE__ */ p("div", {
2353
+ children: [/* @__PURE__ */ m("div", {
2257
2354
  className: "sdk-desktop-header-left",
2258
- children: [(fn || mn) && /* @__PURE__ */ f("button", {
2355
+ children: [(pn || hn) && /* @__PURE__ */ p("button", {
2259
2356
  className: "sdk-desktop-back-btn",
2260
2357
  onClick: (e) => {
2261
- e.stopPropagation(), Si();
2358
+ e.stopPropagation(), Ei();
2262
2359
  },
2263
2360
  "aria-label": "Exit fullscreen",
2264
- children: /* @__PURE__ */ f(me, {
2361
+ children: /* @__PURE__ */ p(fe, {
2265
2362
  size: 22,
2266
2363
  "aria-hidden": "true"
2267
2364
  })
2268
- }), (x || qr) && /* @__PURE__ */ f("span", {
2365
+ }), (S || Zr) && /* @__PURE__ */ p("span", {
2269
2366
  className: "sdk-desktop-title",
2270
- children: x || qr
2367
+ children: S || Zr
2271
2368
  })]
2272
- }), /* @__PURE__ */ p("div", {
2369
+ }), /* @__PURE__ */ m("div", {
2273
2370
  className: "sdk-desktop-header-right",
2274
2371
  children: [
2275
- I.enableChromecast && !Y && /* @__PURE__ */ f("button", {
2372
+ I.enableChromecast && !Y && /* @__PURE__ */ p("button", {
2276
2373
  className: "sdk-desktop-hdr-btn",
2277
2374
  onClick: (e) => {
2278
- e.stopPropagation(), Di();
2375
+ e.stopPropagation(), ji();
2279
2376
  },
2280
2377
  "data-tooltip": q ? `Casting to ${q} — click to disconnect` : "Cast to device",
2281
2378
  "aria-label": q ? `Stop casting to ${q}` : "Cast to device",
2282
2379
  "aria-pressed": !!q,
2283
2380
  style: { color: q ? "#3b82f6" : "" },
2284
- children: /* @__PURE__ */ f(pe, {
2381
+ children: /* @__PURE__ */ p(de, {
2285
2382
  size: 20,
2286
2383
  fill: q ? "currentColor" : "none",
2287
2384
  "aria-hidden": "true"
2288
2385
  })
2289
2386
  }),
2290
- q && /* @__PURE__ */ p("span", {
2387
+ q && /* @__PURE__ */ m("span", {
2291
2388
  className: "sdk-cast-indicator",
2292
2389
  "aria-hidden": "true",
2293
- children: [/* @__PURE__ */ f(pe, {
2390
+ children: [/* @__PURE__ */ p(de, {
2294
2391
  size: 10,
2295
2392
  fill: "currentColor",
2296
2393
  "aria-hidden": "true"
2297
2394
  }), q]
2298
2395
  }),
2299
- I.allowAirplay && Ar && /* @__PURE__ */ f("button", {
2396
+ I.allowAirplay && Pr && /* @__PURE__ */ p("button", {
2300
2397
  className: "sdk-desktop-hdr-btn",
2301
2398
  onClick: (e) => {
2302
- e.stopPropagation(), Oi();
2399
+ e.stopPropagation(), Mi();
2303
2400
  },
2304
- "data-tooltip": Mr ? `AirPlay to ${Pr || "device"} — click to disconnect` : "AirPlay to device",
2305
- "aria-label": Mr ? `Stop AirPlay to ${Pr || "device"}` : "AirPlay to device",
2306
- "aria-pressed": Mr,
2307
- style: { color: Mr ? h : "" },
2308
- children: /* @__PURE__ */ f(de, {
2401
+ "data-tooltip": Ir ? `AirPlay to ${Rr || "device"} — click to disconnect` : "AirPlay to device",
2402
+ "aria-label": Ir ? `Stop AirPlay to ${Rr || "device"}` : "AirPlay to device",
2403
+ "aria-pressed": Ir,
2404
+ style: { color: Ir ? _ : "" },
2405
+ children: /* @__PURE__ */ p(le, {
2309
2406
  size: 20,
2310
2407
  "aria-hidden": "true"
2311
2408
  })
2312
2409
  })
2313
2410
  ]
2314
2411
  })]
2315
- }), g && /* @__PURE__ */ p(te, { children: [
2316
- /* @__PURE__ */ p("div", {
2412
+ }), v && /* @__PURE__ */ m(ee, { children: [
2413
+ /* @__PURE__ */ m("div", {
2317
2414
  className: "sdk-desktop-center-controls",
2318
2415
  style: { pointerEvents: "none" },
2319
2416
  children: [
2320
- !Y && /* @__PURE__ */ f("button", {
2417
+ !Y && /* @__PURE__ */ p("button", {
2321
2418
  className: "sdk-desktop-seek-btn",
2322
2419
  style: { pointerEvents: "auto" },
2323
2420
  onClick: (e) => {
@@ -2327,45 +2424,45 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2327
2424
  });
2328
2425
  },
2329
2426
  "aria-label": "Rewind 10 seconds",
2330
- children: /* @__PURE__ */ p("div", {
2427
+ children: /* @__PURE__ */ m("div", {
2331
2428
  style: {
2332
2429
  position: "relative",
2333
2430
  display: "flex",
2334
2431
  alignItems: "center",
2335
2432
  justifyContent: "center"
2336
2433
  },
2337
- children: [/* @__PURE__ */ f(Ce, {
2434
+ children: [/* @__PURE__ */ p(xe, {
2338
2435
  size: 30,
2339
2436
  "aria-hidden": "true"
2340
- }), /* @__PURE__ */ f("span", {
2437
+ }), /* @__PURE__ */ p("span", {
2341
2438
  className: "sdk-desktop-seek-label",
2342
2439
  "aria-hidden": "true",
2343
2440
  children: "10"
2344
2441
  })]
2345
2442
  })
2346
2443
  }),
2347
- /* @__PURE__ */ f("button", {
2444
+ /* @__PURE__ */ p("button", {
2348
2445
  className: "sdk-desktop-play-btn",
2349
2446
  style: { pointerEvents: "auto" },
2350
2447
  onClick: (e) => {
2351
- e.stopPropagation(), ui();
2448
+ e.stopPropagation(), mi();
2352
2449
  },
2353
- "aria-label": Cn ? "Replay" : Ni ? "Pause" : "Play",
2354
- children: Cn ? /* @__PURE__ */ f(Ce, {
2450
+ "aria-label": wn ? "Replay" : Li ? "Pause" : "Play",
2451
+ children: wn ? /* @__PURE__ */ p(xe, {
2355
2452
  size: 38,
2356
2453
  "aria-hidden": "true"
2357
- }) : Ni ? /* @__PURE__ */ f(v, {
2454
+ }) : Li ? /* @__PURE__ */ p(b, {
2358
2455
  size: 38,
2359
2456
  fill: "currentColor",
2360
2457
  "aria-hidden": "true"
2361
- }) : /* @__PURE__ */ f(Se, {
2458
+ }) : /* @__PURE__ */ p(be, {
2362
2459
  size: 38,
2363
2460
  fill: "currentColor",
2364
2461
  style: { marginLeft: "4px" },
2365
2462
  "aria-hidden": "true"
2366
2463
  })
2367
2464
  }),
2368
- !Y && /* @__PURE__ */ f("button", {
2465
+ !Y && /* @__PURE__ */ p("button", {
2369
2466
  className: "sdk-desktop-seek-btn",
2370
2467
  style: { pointerEvents: "auto" },
2371
2468
  onClick: (e) => {
@@ -2375,17 +2472,17 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2375
2472
  });
2376
2473
  },
2377
2474
  "aria-label": "Skip forward 10 seconds",
2378
- children: /* @__PURE__ */ p("div", {
2475
+ children: /* @__PURE__ */ m("div", {
2379
2476
  style: {
2380
2477
  position: "relative",
2381
2478
  display: "flex",
2382
2479
  alignItems: "center",
2383
2480
  justifyContent: "center"
2384
2481
  },
2385
- children: [/* @__PURE__ */ f(we, {
2482
+ children: [/* @__PURE__ */ p(Se, {
2386
2483
  size: 30,
2387
2484
  "aria-hidden": "true"
2388
- }), /* @__PURE__ */ f("span", {
2485
+ }), /* @__PURE__ */ p("span", {
2389
2486
  className: "sdk-desktop-seek-label",
2390
2487
  "aria-hidden": "true",
2391
2488
  children: "10"
@@ -2394,31 +2491,31 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2394
2491
  })
2395
2492
  ]
2396
2493
  }),
2397
- I.enableKeyMoments && gr && W.length > 0 && $e === "panel" && /* @__PURE__ */ p("div", {
2494
+ I.enableKeyMoments && br && W.length > 0 && Qe === "panel" && /* @__PURE__ */ m("div", {
2398
2495
  className: "sdk-chapters-panel",
2399
2496
  onClick: (e) => e.stopPropagation(),
2400
- children: [/* @__PURE__ */ f("div", {
2497
+ children: [/* @__PURE__ */ p("div", {
2401
2498
  className: "sdk-chapters-panel-header",
2402
- children: /* @__PURE__ */ f("span", {
2499
+ children: /* @__PURE__ */ p("span", {
2403
2500
  className: "sdk-chapters-panel-title",
2404
2501
  children: "Chapters"
2405
2502
  })
2406
- }), /* @__PURE__ */ f("div", {
2503
+ }), /* @__PURE__ */ p("div", {
2407
2504
  className: "sdk-chapters-panel-list",
2408
2505
  children: W.map((e, t) => {
2409
- let n = dr.index === t;
2410
- return /* @__PURE__ */ p("div", {
2506
+ let n = hr.index === t;
2507
+ return /* @__PURE__ */ m("div", {
2411
2508
  role: "button",
2412
2509
  tabIndex: 0,
2413
2510
  className: `sdk-chapters-panel-item${n ? " active" : ""}`,
2414
2511
  "aria-label": `${e.title}, ${Q(e.startTime)}${n ? ", current chapter" : ""}`,
2415
2512
  "aria-current": n ? "true" : void 0,
2416
- onClick: () => vi(e.startTime, e),
2417
- onKeyDown: Bi(() => vi(e.startTime, e)),
2418
- children: [/* @__PURE__ */ f("div", {
2513
+ onClick: () => Si(e.startTime, e),
2514
+ onKeyDown: Wi(() => Si(e.startTime, e)),
2515
+ children: [/* @__PURE__ */ p("div", {
2419
2516
  className: "sdk-chapters-panel-thumb",
2420
- children: vr[t] || e.thumbnail ? /* @__PURE__ */ f("img", {
2421
- src: vr[t] || e.thumbnail,
2517
+ children: Sr[t] || e.thumbnail ? /* @__PURE__ */ p("img", {
2518
+ src: Sr[t] || e.thumbnail,
2422
2519
  alt: "",
2423
2520
  "aria-hidden": "true",
2424
2521
  style: {
@@ -2427,23 +2524,23 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2427
2524
  objectFit: "cover",
2428
2525
  display: "block"
2429
2526
  }
2430
- }) : /* @__PURE__ */ f(ve, {
2527
+ }) : /* @__PURE__ */ p(ge, {
2431
2528
  size: 18,
2432
2529
  "aria-hidden": "true",
2433
2530
  style: { color: "rgba(255,255,255,0.3)" }
2434
2531
  })
2435
- }), /* @__PURE__ */ p("div", {
2532
+ }), /* @__PURE__ */ m("div", {
2436
2533
  className: "sdk-chapters-panel-info",
2437
2534
  children: [
2438
- /* @__PURE__ */ f("div", {
2535
+ /* @__PURE__ */ p("div", {
2439
2536
  className: "sdk-chapters-panel-item-title",
2440
2537
  children: e.title
2441
2538
  }),
2442
- e.description && /* @__PURE__ */ f("div", {
2539
+ e.description && /* @__PURE__ */ p("div", {
2443
2540
  className: "sdk-chapters-panel-item-desc",
2444
2541
  children: e.description
2445
2542
  }),
2446
- /* @__PURE__ */ f("div", {
2543
+ /* @__PURE__ */ p("div", {
2447
2544
  className: "sdk-chapters-panel-item-time",
2448
2545
  "aria-hidden": "true",
2449
2546
  children: Q(e.startTime)
@@ -2454,28 +2551,28 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2454
2551
  })
2455
2552
  })]
2456
2553
  }),
2457
- /* @__PURE__ */ p("div", {
2554
+ /* @__PURE__ */ m("div", {
2458
2555
  className: "sdk-desktop-bottom",
2459
2556
  children: [
2460
- I.enableKeyMoments && gr && W.length > 0 && $e === "strip" && /* @__PURE__ */ f("div", {
2557
+ I.enableKeyMoments && br && W.length > 0 && Qe === "strip" && /* @__PURE__ */ p("div", {
2461
2558
  className: "sdk-desktop-chapters-strip",
2462
2559
  children: W.map((e, t) => {
2463
- let n = dr.index === t;
2464
- return /* @__PURE__ */ p("div", {
2560
+ let n = hr.index === t;
2561
+ return /* @__PURE__ */ m("div", {
2465
2562
  role: "button",
2466
2563
  tabIndex: 0,
2467
2564
  className: `sdk-desktop-chapter-card${n ? " active" : ""}`,
2468
2565
  "aria-label": `${e.title}, ${Q(e.startTime)}${n ? ", current chapter" : ""}`,
2469
2566
  "aria-current": n ? "true" : void 0,
2470
2567
  onClick: (t) => {
2471
- t.stopPropagation(), vi(e.startTime, e);
2568
+ t.stopPropagation(), Si(e.startTime, e);
2472
2569
  },
2473
- onKeyDown: Bi(() => vi(e.startTime, e)),
2570
+ onKeyDown: Wi(() => Si(e.startTime, e)),
2474
2571
  children: [
2475
- /* @__PURE__ */ f("div", {
2572
+ /* @__PURE__ */ p("div", {
2476
2573
  className: "sdk-desktop-chapter-thumb",
2477
- children: vr[t] || e.thumbnail ? /* @__PURE__ */ f("img", {
2478
- src: vr[t] || e.thumbnail,
2574
+ children: Sr[t] || e.thumbnail ? /* @__PURE__ */ p("img", {
2575
+ src: Sr[t] || e.thumbnail,
2479
2576
  alt: "",
2480
2577
  "aria-hidden": "true",
2481
2578
  style: {
@@ -2484,17 +2581,17 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2484
2581
  objectFit: "cover",
2485
2582
  display: "block"
2486
2583
  }
2487
- }) : /* @__PURE__ */ f(ve, {
2584
+ }) : /* @__PURE__ */ p(ge, {
2488
2585
  size: 18,
2489
2586
  "aria-hidden": "true",
2490
2587
  style: { color: "rgba(255,255,255,0.35)" }
2491
2588
  })
2492
2589
  }),
2493
- /* @__PURE__ */ f("div", {
2590
+ /* @__PURE__ */ p("div", {
2494
2591
  className: "sdk-desktop-chapter-title",
2495
2592
  children: e.title
2496
2593
  }),
2497
- /* @__PURE__ */ f("div", {
2594
+ /* @__PURE__ */ p("div", {
2498
2595
  className: "sdk-desktop-chapter-time",
2499
2596
  "aria-hidden": "true",
2500
2597
  children: Q(e.startTime)
@@ -2503,8 +2600,8 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2503
2600
  }, t);
2504
2601
  })
2505
2602
  }),
2506
- /* @__PURE__ */ f("div", {
2507
- ref: w,
2603
+ /* @__PURE__ */ p("div", {
2604
+ ref: T,
2508
2605
  role: X ? void 0 : "slider",
2509
2606
  "aria-label": X ? void 0 : "Seek",
2510
2607
  "aria-valuemin": X ? void 0 : 0,
@@ -2513,51 +2610,51 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2513
2610
  "aria-valuetext": X ? void 0 : `${Q(V(J === null ? L : J))} of ${Q(B)}`,
2514
2611
  tabIndex: X ? void 0 : 0,
2515
2612
  className: `sdk-seekbar-container sdk-desktop-seekbar${Y ? " sdk-ad-mode" : ""}`,
2516
- onMouseDown: X ? void 0 : fi,
2517
- onMouseMove: X ? void 0 : ki,
2518
- onMouseLeave: X ? void 0 : Mi,
2519
- onTouchStart: X ? void 0 : ji,
2520
- onKeyDown: X ? void 0 : Vi,
2613
+ onMouseDown: X ? void 0 : gi,
2614
+ onMouseMove: X ? void 0 : Ni,
2615
+ onMouseLeave: X ? void 0 : Ii,
2616
+ onTouchStart: X ? void 0 : Fi,
2617
+ onKeyDown: X ? void 0 : Gi,
2521
2618
  style: { pointerEvents: X ? "none" : void 0 },
2522
- children: Y ? /* @__PURE__ */ f("div", {
2619
+ children: Y ? /* @__PURE__ */ p("div", {
2523
2620
  className: "sdk-ad-progress-fill",
2524
2621
  style: { width: (() => {
2525
- let e = F ? F.getCurrentTime() : L, t = Yn(e);
2622
+ let e = F ? F.getCurrentTime() : L, t = $n(e);
2526
2623
  return t ? `${Math.min(100, Math.max(0, (e - t.start) / (t.end - t.start) * 100))}%` : "0%";
2527
2624
  })() }
2528
- }) : /* @__PURE__ */ p(te, { children: [
2529
- /* @__PURE__ */ f("div", {
2625
+ }) : /* @__PURE__ */ m(ee, { children: [
2626
+ /* @__PURE__ */ p("div", {
2530
2627
  className: "sdk-seekbar-buffered",
2531
- style: { width: `${rn ? (F && F.getBufferedRanges()[0]?.end || 0) / rn * 100 : 0}%` }
2628
+ style: { width: `${an ? (F && F.getBufferedRanges()[0]?.end || 0) / an * 100 : 0}%` }
2532
2629
  }),
2533
- B > 0 && R.filter((e) => !On.has(e.startTime)).map((e, t) => /* @__PURE__ */ f("div", {
2630
+ B > 0 && R.filter((e) => !kn.has(e.startTime)).map((e, t) => /* @__PURE__ */ p("div", {
2534
2631
  className: "sdk-seekbar-adbreak",
2535
2632
  style: {
2536
2633
  left: `${V(e.startTime) / B * 100}%`,
2537
2634
  width: "3px"
2538
2635
  }
2539
2636
  }, t)),
2540
- /* @__PURE__ */ f("div", {
2637
+ /* @__PURE__ */ p("div", {
2541
2638
  className: "sdk-seekbar-progress",
2542
2639
  style: {
2543
- width: q ? `${Pi > 0 ? $ / Pi * 100 : 0}%` : `${B ? V(J === null ? L : J) / B * 100 : 0}%`,
2640
+ width: q ? `${Ri > 0 ? $ / Ri * 100 : 0}%` : `${B ? V(J === null ? L : J) / B * 100 : 0}%`,
2544
2641
  background: "#ffffff",
2545
2642
  boxShadow: "none"
2546
2643
  },
2547
- children: /* @__PURE__ */ f("div", { className: "sdk-seekbar-handle" })
2644
+ children: /* @__PURE__ */ p("div", { className: "sdk-seekbar-handle" })
2548
2645
  }),
2549
- I.enableKeyMoments && W.map((e, t) => B === 0 ? null : /* @__PURE__ */ f("div", {
2646
+ I.enableKeyMoments && W.map((e, t) => B === 0 ? null : /* @__PURE__ */ p("div", {
2550
2647
  className: "sdk-seekbar-chapter-marker sdk-desktop-chapter-dot",
2551
2648
  style: { left: `${V(e.startTime) / B * 100}%` }
2552
2649
  }, t)),
2553
- Ir !== null && Hr && /* @__PURE__ */ p("div", {
2650
+ Br !== null && Kr && /* @__PURE__ */ m("div", {
2554
2651
  className: "sdk-thumbnail-tooltip",
2555
- style: { left: `${Rr}px` },
2652
+ style: { left: `${Hr}px` },
2556
2653
  children: [
2557
- /* @__PURE__ */ f("div", {
2654
+ /* @__PURE__ */ p("div", {
2558
2655
  className: "sdk-thumbnail-preview",
2559
- children: /* @__PURE__ */ f("img", {
2560
- src: Hr,
2656
+ children: /* @__PURE__ */ p("img", {
2657
+ src: Kr,
2561
2658
  alt: "preview",
2562
2659
  style: {
2563
2660
  width: "100%",
@@ -2568,115 +2665,115 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2568
2665
  }
2569
2666
  })
2570
2667
  }),
2571
- Wr && /* @__PURE__ */ f("div", {
2668
+ Jr && /* @__PURE__ */ p("div", {
2572
2669
  className: "sdk-thumbnail-chapter-name",
2573
- children: Wr.title
2670
+ children: Jr.title
2574
2671
  }),
2575
- /* @__PURE__ */ f("div", {
2672
+ /* @__PURE__ */ p("div", {
2576
2673
  className: "sdk-thumbnail-time-label",
2577
- children: Q(V(Br))
2674
+ children: Q(V(Wr))
2578
2675
  })
2579
2676
  ]
2580
2677
  })
2581
2678
  ] })
2582
2679
  }),
2583
- /* @__PURE__ */ p("div", {
2680
+ /* @__PURE__ */ m("div", {
2584
2681
  className: "sdk-desktop-controls-row",
2585
- children: [/* @__PURE__ */ p("div", {
2682
+ children: [/* @__PURE__ */ m("div", {
2586
2683
  className: "sdk-desktop-left-controls",
2587
- children: [!Y && /* @__PURE__ */ f("div", {
2684
+ children: [!Y && /* @__PURE__ */ p("div", {
2588
2685
  className: "sdk-time-display",
2589
- children: q ? `${Q($)} / ${Q(Pi)}` : `${Q(V(J === null ? L : J))} / ${Q(B)}`
2590
- }), et === "slider" && /* @__PURE__ */ p("div", {
2686
+ children: q ? `${Q($)} / ${Q(Ri)}` : `${Q(V(J === null ? L : J))} / ${Q(B)}`
2687
+ }), $e === "slider" && /* @__PURE__ */ m("div", {
2591
2688
  className: "sdk-volume-control",
2592
- children: [/* @__PURE__ */ f("button", {
2689
+ children: [/* @__PURE__ */ p("button", {
2593
2690
  className: "sdk-desktop-icon-btn",
2594
2691
  onClick: (e) => {
2595
- e.stopPropagation(), pi();
2692
+ e.stopPropagation(), _i();
2596
2693
  },
2597
- "data-tooltip": Ii ? "Unmute" : "Mute",
2598
- "aria-label": Ii ? "Unmute" : "Mute",
2599
- "aria-pressed": Ii,
2600
- children: Ri()
2601
- }), /* @__PURE__ */ f("input", {
2694
+ "data-tooltip": Bi ? "Unmute" : "Mute",
2695
+ "aria-label": Bi ? "Unmute" : "Mute",
2696
+ "aria-pressed": Bi,
2697
+ children: Hi()
2698
+ }), /* @__PURE__ */ p("input", {
2602
2699
  type: "range",
2603
2700
  className: "sdk-volume-slider",
2604
2701
  min: 0,
2605
2702
  max: 1,
2606
2703
  step: .02,
2607
- value: Ii ? 0 : Fi,
2704
+ value: Bi ? 0 : zi,
2608
2705
  "aria-label": "Volume",
2609
- "aria-valuetext": Ii ? "Muted" : `${Math.round(Fi * 100)}%`,
2610
- style: { "--vol-pct": Math.round((Ii ? 0 : Fi) * 100) },
2706
+ "aria-valuetext": Bi ? "Muted" : `${Math.round(zi * 100)}%`,
2707
+ style: { "--vol-pct": Math.round((Bi ? 0 : zi) * 100) },
2611
2708
  onChange: (e) => {
2612
2709
  let t = parseFloat(e.target.value);
2613
- q ? (F?.casting.remoteSetVolume(t), t > 0 && F?.casting.remoteSetMute(!1)) : (F?.setVolume(t), t > 0 && cn && F?.setMute(!1));
2710
+ q ? (F?.casting.remoteSetVolume(t), t > 0 && F?.casting.remoteSetMute(!1)) : (F?.setVolume(t), t > 0 && ln && F?.setMute(!1));
2614
2711
  },
2615
2712
  onClick: (e) => e.stopPropagation()
2616
2713
  })]
2617
2714
  })]
2618
- }), /* @__PURE__ */ p("div", {
2715
+ }), /* @__PURE__ */ m("div", {
2619
2716
  className: "sdk-desktop-right-icons",
2620
2717
  children: [
2621
- I.enableKeyMoments && W.length > 0 && !Y && /* @__PURE__ */ f("button", {
2622
- className: `sdk-desktop-icon-btn${gr ? " active" : ""}`,
2718
+ I.enableKeyMoments && W.length > 0 && !Y && /* @__PURE__ */ p("button", {
2719
+ className: `sdk-desktop-icon-btn${br ? " active" : ""}`,
2623
2720
  onClick: (e) => {
2624
- e.stopPropagation(), _r(!gr);
2721
+ e.stopPropagation(), xr(!br);
2625
2722
  },
2626
2723
  "data-tooltip": "Key Moments",
2627
- "aria-label": gr ? "Hide chapters" : "Show chapters",
2628
- "aria-pressed": gr,
2629
- children: /* @__PURE__ */ f(ve, {
2724
+ "aria-label": br ? "Hide chapters" : "Show chapters",
2725
+ "aria-pressed": br,
2726
+ children: /* @__PURE__ */ p(ge, {
2630
2727
  size: 20,
2631
2728
  "aria-hidden": "true"
2632
2729
  })
2633
2730
  }),
2634
- I.enableSubtitles && !Y && ar.some((e) => !e.isNative) && /* @__PURE__ */ p("div", {
2731
+ I.enableSubtitles && !Y && lr.some((e) => !e.isNative) && /* @__PURE__ */ m("div", {
2635
2732
  className: "sdk-menu-container",
2636
- children: [/* @__PURE__ */ f("button", {
2733
+ children: [/* @__PURE__ */ p("button", {
2637
2734
  className: `sdk-desktop-icon-btn${U === "off" ? "" : " active"}`,
2638
2735
  onClick: (e) => {
2639
- e.stopPropagation(), Hi("subtitles");
2736
+ e.stopPropagation(), Ki("subtitles");
2640
2737
  },
2641
2738
  "data-tooltip": "Captions",
2642
2739
  "aria-label": "Captions",
2643
2740
  "aria-haspopup": "listbox",
2644
2741
  "aria-expanded": G === "subtitles",
2645
- children: /* @__PURE__ */ f(fe, {
2742
+ children: /* @__PURE__ */ p(ue, {
2646
2743
  size: 20,
2647
2744
  "aria-hidden": "true"
2648
2745
  })
2649
- }), G === "subtitles" && /* @__PURE__ */ p("div", {
2650
- ref: Ui,
2746
+ }), G === "subtitles" && /* @__PURE__ */ m("div", {
2747
+ ref: qi,
2651
2748
  className: "sdk-dropup-menu",
2652
2749
  role: "listbox",
2653
2750
  "aria-label": "Captions",
2654
2751
  children: [
2655
- /* @__PURE__ */ f("div", {
2752
+ /* @__PURE__ */ p("div", {
2656
2753
  className: "sdk-dropup-header",
2657
2754
  "aria-hidden": "true",
2658
2755
  children: "Subtitles"
2659
2756
  }),
2660
- /* @__PURE__ */ p("div", {
2757
+ /* @__PURE__ */ m("div", {
2661
2758
  role: "option",
2662
2759
  "aria-selected": U === "off",
2663
2760
  tabIndex: 0,
2664
2761
  className: `sdk-dropup-item ${U === "off" ? "active" : ""}`,
2665
- onClick: () => gi("off"),
2666
- onKeyDown: zi(() => gi("off")),
2667
- children: [/* @__PURE__ */ f("span", { children: "Off" }), U === "off" && /* @__PURE__ */ f(_, {
2762
+ onClick: () => bi("off"),
2763
+ onKeyDown: Ui(() => bi("off")),
2764
+ children: [/* @__PURE__ */ p("span", { children: "Off" }), U === "off" && /* @__PURE__ */ p(y, {
2668
2765
  size: 12,
2669
2766
  "aria-hidden": "true"
2670
2767
  })]
2671
2768
  }),
2672
- ar.map((e) => /* @__PURE__ */ p("div", {
2769
+ lr.map((e) => /* @__PURE__ */ m("div", {
2673
2770
  role: "option",
2674
2771
  "aria-selected": U === e.id,
2675
2772
  tabIndex: 0,
2676
2773
  className: `sdk-dropup-item ${U === e.id ? "active" : ""}`,
2677
- onClick: () => gi(e.id),
2678
- onKeyDown: zi(() => gi(e.id)),
2679
- children: [/* @__PURE__ */ f("span", { children: b(e) }), U === e.id && /* @__PURE__ */ f(_, {
2774
+ onClick: () => bi(e.id),
2775
+ onKeyDown: Ui(() => bi(e.id)),
2776
+ children: [/* @__PURE__ */ p("span", { children: x(e) }), U === e.id && /* @__PURE__ */ p(y, {
2680
2777
  size: 12,
2681
2778
  "aria-hidden": "true"
2682
2779
  })]
@@ -2684,69 +2781,69 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2684
2781
  ]
2685
2782
  })]
2686
2783
  }),
2687
- I.allowMultipleAudio && sr.length > 1 && !Y && /* @__PURE__ */ p("div", {
2784
+ I.allowMultipleAudio && dr.length > 1 && !Y && /* @__PURE__ */ m("div", {
2688
2785
  className: "sdk-menu-container",
2689
- children: [/* @__PURE__ */ f("button", {
2786
+ children: [/* @__PURE__ */ p("button", {
2690
2787
  className: `sdk-desktop-icon-btn${G === "audio" ? " active" : ""}`,
2691
2788
  onClick: (e) => {
2692
- e.stopPropagation(), Hi("audio");
2789
+ e.stopPropagation(), Ki("audio");
2693
2790
  },
2694
2791
  "data-tooltip": "Audio Track",
2695
2792
  "aria-label": "Audio track",
2696
2793
  "aria-haspopup": "listbox",
2697
2794
  "aria-expanded": G === "audio",
2698
- children: /* @__PURE__ */ f(_e, {
2795
+ children: /* @__PURE__ */ p(he, {
2699
2796
  size: 20,
2700
2797
  "aria-hidden": "true"
2701
2798
  })
2702
- }), G === "audio" && /* @__PURE__ */ p("div", {
2703
- ref: Ui,
2799
+ }), G === "audio" && /* @__PURE__ */ m("div", {
2800
+ ref: qi,
2704
2801
  className: "sdk-dropup-menu",
2705
2802
  role: "listbox",
2706
2803
  "aria-label": "Audio track",
2707
- children: [/* @__PURE__ */ f("div", {
2804
+ children: [/* @__PURE__ */ p("div", {
2708
2805
  className: "sdk-dropup-header",
2709
2806
  "aria-hidden": "true",
2710
2807
  children: "Audio Track"
2711
- }), sr.map((e) => /* @__PURE__ */ p("div", {
2808
+ }), dr.map((e) => /* @__PURE__ */ m("div", {
2712
2809
  role: "option",
2713
- "aria-selected": lr === e.id,
2810
+ "aria-selected": pr === e.id,
2714
2811
  tabIndex: 0,
2715
- className: `sdk-dropup-item ${lr === e.id ? "active" : ""}`,
2812
+ className: `sdk-dropup-item ${pr === e.id ? "active" : ""}`,
2716
2813
  onClick: () => {
2717
- F?.setAudioTrack(e.id), ur(e.id), K("none"), xr(`Audio: ${b(e)}`);
2814
+ F?.setAudioTrack(e.id), mr(e.id), K("none"), Tr(`Audio: ${x(e)}`);
2718
2815
  },
2719
- onKeyDown: zi(() => {
2720
- F?.setAudioTrack(e.id), ur(e.id), K("none"), xr(`Audio: ${b(e)}`);
2816
+ onKeyDown: Ui(() => {
2817
+ F?.setAudioTrack(e.id), mr(e.id), K("none"), Tr(`Audio: ${x(e)}`);
2721
2818
  }),
2722
- children: [/* @__PURE__ */ f("span", { children: b(e) }), lr === e.id && /* @__PURE__ */ f(_, {
2819
+ children: [/* @__PURE__ */ p("span", { children: x(e) }), pr === e.id && /* @__PURE__ */ p(y, {
2723
2820
  size: 12,
2724
2821
  "aria-hidden": "true"
2725
2822
  })]
2726
2823
  }, e.id))]
2727
2824
  })]
2728
2825
  }),
2729
- I.enablePlaybackSpeed && !Y && /* @__PURE__ */ p("div", {
2826
+ I.enablePlaybackSpeed && !Y && /* @__PURE__ */ m("div", {
2730
2827
  className: "sdk-menu-container",
2731
- children: [/* @__PURE__ */ f("button", {
2828
+ children: [/* @__PURE__ */ p("button", {
2732
2829
  className: `sdk-desktop-icon-btn${G === "speed" ? " active" : ""}`,
2733
2830
  onClick: (e) => {
2734
- e.stopPropagation(), Hi("speed");
2831
+ e.stopPropagation(), Ki("speed");
2735
2832
  },
2736
2833
  "data-tooltip": "Playback Speed",
2737
2834
  "aria-label": "Playback speed",
2738
2835
  "aria-haspopup": "listbox",
2739
2836
  "aria-expanded": G === "speed",
2740
- children: /* @__PURE__ */ f(ge, {
2837
+ children: /* @__PURE__ */ p(me, {
2741
2838
  size: 20,
2742
2839
  "aria-hidden": "true"
2743
2840
  })
2744
- }), G === "speed" && /* @__PURE__ */ p("div", {
2745
- ref: Ui,
2841
+ }), G === "speed" && /* @__PURE__ */ m("div", {
2842
+ ref: qi,
2746
2843
  className: "sdk-dropup-menu",
2747
2844
  role: "listbox",
2748
2845
  "aria-label": "Playback speed",
2749
- children: [/* @__PURE__ */ f("div", {
2846
+ children: [/* @__PURE__ */ p("div", {
2750
2847
  className: "sdk-dropup-header",
2751
2848
  "aria-hidden": "true",
2752
2849
  children: "Speed"
@@ -2757,128 +2854,128 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2757
2854
  1.25,
2758
2855
  1.5,
2759
2856
  2
2760
- ].map((e) => /* @__PURE__ */ p("div", {
2857
+ ].map((e) => /* @__PURE__ */ m("div", {
2761
2858
  role: "option",
2762
- "aria-selected": mr === e,
2859
+ "aria-selected": vr === e,
2763
2860
  tabIndex: 0,
2764
- className: `sdk-dropup-item ${mr === e ? "active" : ""}`,
2765
- onClick: () => mi(e),
2766
- onKeyDown: zi(() => mi(e)),
2767
- children: [/* @__PURE__ */ f("span", { children: e === 1 ? "Normal" : `${e}x` }), mr === e && /* @__PURE__ */ f(_, {
2861
+ className: `sdk-dropup-item ${vr === e ? "active" : ""}`,
2862
+ onClick: () => vi(e),
2863
+ onKeyDown: Ui(() => vi(e)),
2864
+ children: [/* @__PURE__ */ p("span", { children: e === 1 ? "Normal" : `${e}x` }), vr === e && /* @__PURE__ */ p(y, {
2768
2865
  size: 12,
2769
2866
  "aria-hidden": "true"
2770
2867
  })]
2771
2868
  }, e))]
2772
2869
  })]
2773
2870
  }),
2774
- I.enableQuality && !Y && /* @__PURE__ */ p("div", {
2871
+ I.enableQuality && !Y && /* @__PURE__ */ m("div", {
2775
2872
  className: "sdk-menu-container",
2776
- children: [/* @__PURE__ */ f("button", {
2777
- className: `sdk-desktop-icon-btn${er.id === -1 ? "" : " active"}`,
2873
+ children: [/* @__PURE__ */ p("button", {
2874
+ className: `sdk-desktop-icon-btn${ir.id === -1 ? "" : " active"}`,
2778
2875
  onClick: (e) => {
2779
- e.stopPropagation(), Hi("quality");
2876
+ e.stopPropagation(), Ki("quality");
2780
2877
  },
2781
2878
  "data-tooltip": "Quality",
2782
2879
  "aria-label": "Video quality",
2783
2880
  "aria-haspopup": "listbox",
2784
2881
  "aria-expanded": G === "quality",
2785
- children: /* @__PURE__ */ f(Ne, {
2882
+ children: /* @__PURE__ */ p(Me, {
2786
2883
  size: 20,
2787
2884
  "aria-hidden": "true"
2788
2885
  })
2789
- }), G === "quality" && /* @__PURE__ */ p("div", {
2790
- ref: Ui,
2886
+ }), G === "quality" && /* @__PURE__ */ m("div", {
2887
+ ref: qi,
2791
2888
  className: "sdk-dropup-menu large",
2792
2889
  role: "listbox",
2793
2890
  "aria-label": "Video quality",
2794
- children: [/* @__PURE__ */ f("div", {
2891
+ children: [/* @__PURE__ */ p("div", {
2795
2892
  className: "sdk-dropup-header",
2796
2893
  "aria-hidden": "true",
2797
2894
  children: "Quality"
2798
- }), Qn.map((e) => /* @__PURE__ */ p("div", {
2895
+ }), nr.map((e) => /* @__PURE__ */ m("div", {
2799
2896
  role: "option",
2800
- "aria-selected": er.id === e.id,
2897
+ "aria-selected": ir.id === e.id,
2801
2898
  tabIndex: 0,
2802
- className: `sdk-dropup-item ${er.id === e.id ? "active" : ""}`,
2803
- onClick: () => hi(e.id),
2804
- onKeyDown: zi(() => hi(e.id)),
2805
- children: [/* @__PURE__ */ f("span", { children: e.label }), er.id === e.id && /* @__PURE__ */ f(_, {
2899
+ className: `sdk-dropup-item ${ir.id === e.id ? "active" : ""}`,
2900
+ onClick: () => yi(e.id),
2901
+ onKeyDown: Ui(() => yi(e.id)),
2902
+ children: [/* @__PURE__ */ p("span", { children: e.label }), ir.id === e.id && /* @__PURE__ */ p(y, {
2806
2903
  size: 12,
2807
2904
  "aria-hidden": "true"
2808
2905
  })]
2809
2906
  }, e.id))]
2810
2907
  })]
2811
2908
  }),
2812
- S && S.length > 1 && !Y && /* @__PURE__ */ p("div", {
2909
+ C && C.length > 1 && !Y && /* @__PURE__ */ m("div", {
2813
2910
  className: "sdk-menu-container",
2814
- children: [/* @__PURE__ */ f("button", {
2911
+ children: [/* @__PURE__ */ p("button", {
2815
2912
  className: `sdk-desktop-icon-btn${G === "sources" ? " active" : ""}`,
2816
2913
  onClick: (e) => {
2817
- e.stopPropagation(), Hi("sources");
2914
+ e.stopPropagation(), Ki("sources");
2818
2915
  },
2819
2916
  "data-tooltip": "Select Source",
2820
2917
  "aria-label": "Select source",
2821
2918
  "aria-haspopup": "listbox",
2822
2919
  "aria-expanded": G === "sources",
2823
- children: /* @__PURE__ */ f(Pe, {
2920
+ children: /* @__PURE__ */ p(Ne, {
2824
2921
  size: 20,
2825
2922
  "aria-hidden": "true"
2826
2923
  })
2827
- }), G === "sources" && /* @__PURE__ */ p("div", {
2828
- ref: Ui,
2924
+ }), G === "sources" && /* @__PURE__ */ m("div", {
2925
+ ref: qi,
2829
2926
  className: "sdk-dropup-menu",
2830
2927
  role: "listbox",
2831
2928
  "aria-label": "Select source",
2832
- children: [/* @__PURE__ */ f("div", {
2929
+ children: [/* @__PURE__ */ p("div", {
2833
2930
  className: "sdk-dropup-header",
2834
2931
  "aria-hidden": "true",
2835
2932
  children: "Source"
2836
- }), S.map((e, t) => /* @__PURE__ */ p("div", {
2933
+ }), C.map((e, t) => /* @__PURE__ */ m("div", {
2837
2934
  role: "option",
2838
- "aria-selected": st === t,
2935
+ "aria-selected": ot === t,
2839
2936
  tabIndex: 0,
2840
- className: `sdk-dropup-item ${st === t ? "active" : ""}`,
2841
- onClick: () => _i(t),
2842
- onKeyDown: zi(() => _i(t)),
2843
- children: [/* @__PURE__ */ f("span", { children: e.label }), st === t && /* @__PURE__ */ f(_, {
2937
+ className: `sdk-dropup-item ${ot === t ? "active" : ""}`,
2938
+ onClick: () => xi(t),
2939
+ onKeyDown: Ui(() => xi(t)),
2940
+ children: [/* @__PURE__ */ p("span", { children: e.label }), ot === t && /* @__PURE__ */ p(y, {
2844
2941
  size: 12,
2845
2942
  "aria-hidden": "true"
2846
2943
  })]
2847
2944
  }, t))]
2848
2945
  })]
2849
2946
  }),
2850
- I.enablePiP && !Y && /* @__PURE__ */ f("button", {
2851
- className: `sdk-desktop-icon-btn${yn ? " active" : ""}`,
2947
+ I.enablePiP && !Y && /* @__PURE__ */ p("button", {
2948
+ className: `sdk-desktop-icon-btn${bn ? " active" : ""}`,
2852
2949
  onClick: (e) => {
2853
- e.stopPropagation(), bi();
2950
+ e.stopPropagation(), wi();
2854
2951
  },
2855
2952
  "data-tooltip": "Picture-in-Picture",
2856
- "aria-label": yn ? "Exit picture-in-picture" : "Enter picture-in-picture",
2857
- "aria-pressed": yn,
2858
- children: /* @__PURE__ */ f(xe, {
2953
+ "aria-label": bn ? "Exit picture-in-picture" : "Enter picture-in-picture",
2954
+ "aria-pressed": bn,
2955
+ children: /* @__PURE__ */ p(ye, {
2859
2956
  size: 20,
2860
2957
  "aria-hidden": "true"
2861
2958
  })
2862
2959
  }),
2863
- et === "button" && /* @__PURE__ */ f("button", {
2960
+ $e === "button" && /* @__PURE__ */ p("button", {
2864
2961
  className: "sdk-desktop-icon-btn",
2865
2962
  onClick: (e) => {
2866
- e.stopPropagation(), pi();
2963
+ e.stopPropagation(), _i();
2867
2964
  },
2868
- "data-tooltip": Ii ? "Unmute" : "Mute",
2869
- "aria-label": Ii ? "Unmute" : "Mute",
2870
- "aria-pressed": Ii,
2871
- children: Ri()
2965
+ "data-tooltip": Bi ? "Unmute" : "Mute",
2966
+ "aria-label": Bi ? "Unmute" : "Mute",
2967
+ "aria-pressed": Bi,
2968
+ children: Hi()
2872
2969
  }),
2873
- qe && /* @__PURE__ */ f("button", {
2970
+ Ke && /* @__PURE__ */ p("button", {
2874
2971
  className: "sdk-desktop-icon-btn",
2875
2972
  onClick: (e) => {
2876
- e.stopPropagation(), Si();
2973
+ e.stopPropagation(), Ei();
2877
2974
  },
2878
- "data-tooltip": fn || mn ? "Exit fullscreen" : "Fullscreen",
2879
- "aria-label": fn || mn ? "Exit fullscreen" : "Enter fullscreen",
2880
- "aria-pressed": fn || mn,
2881
- children: f(fn ? be : ye, {
2975
+ "data-tooltip": pn || hn ? "Exit fullscreen" : "Fullscreen",
2976
+ "aria-label": pn || hn ? "Exit fullscreen" : "Enter fullscreen",
2977
+ "aria-pressed": pn || hn,
2978
+ children: p(pn ? ve : _e, {
2882
2979
  size: 20,
2883
2980
  "aria-hidden": "true"
2884
2981
  })
@@ -2890,16 +2987,16 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2890
2987
  })
2891
2988
  ] })]
2892
2989
  }),
2893
- xn && (() => {
2990
+ Sn && (() => {
2894
2991
  let e = R.find((e) => $ >= e.startTime && $ < e.endTime), t = e ? e.endTime - e.startTime : B, n = e ? Math.max(0, $ - e.startTime) : V($);
2895
- return ee(/* @__PURE__ */ p("div", {
2896
- className: `gb-pip-overlay${Ni ? "" : " gb-pip-paused"}`,
2992
+ return f(/* @__PURE__ */ m("div", {
2993
+ className: `gb-pip-overlay${Li ? "" : " gb-pip-paused"}`,
2897
2994
  children: [
2898
- /* @__PURE__ */ f("div", {}),
2899
- /* @__PURE__ */ p("div", {
2995
+ /* @__PURE__ */ p("div", {}),
2996
+ /* @__PURE__ */ m("div", {
2900
2997
  className: "gb-pip-center",
2901
2998
  children: [
2902
- /* @__PURE__ */ f("button", {
2999
+ /* @__PURE__ */ p("button", {
2903
3000
  className: "gb-pip-btn",
2904
3001
  onClick: () => Z(H(Math.max(0, V($) - 10)), {
2905
3002
  eventType: "fast_backward",
@@ -2907,28 +3004,28 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2907
3004
  }),
2908
3005
  "aria-label": "Rewind 10 seconds",
2909
3006
  disabled: Y,
2910
- children: /* @__PURE__ */ f(Ce, {
3007
+ children: /* @__PURE__ */ p(xe, {
2911
3008
  size: 20,
2912
3009
  "aria-hidden": "true"
2913
3010
  })
2914
3011
  }),
2915
- /* @__PURE__ */ f("button", {
3012
+ /* @__PURE__ */ p("button", {
2916
3013
  className: "gb-pip-btn gb-pip-play",
2917
- onClick: ui,
2918
- "aria-label": Cn ? "Replay" : Ni ? "Pause" : "Play",
2919
- children: Cn ? /* @__PURE__ */ f(Ce, {
3014
+ onClick: mi,
3015
+ "aria-label": wn ? "Replay" : Li ? "Pause" : "Play",
3016
+ children: wn ? /* @__PURE__ */ p(xe, {
2920
3017
  size: 24,
2921
3018
  "aria-hidden": "true"
2922
- }) : Ni ? /* @__PURE__ */ f(v, {
3019
+ }) : Li ? /* @__PURE__ */ p(b, {
2923
3020
  size: 24,
2924
3021
  "aria-hidden": "true"
2925
- }) : /* @__PURE__ */ f(Se, {
3022
+ }) : /* @__PURE__ */ p(be, {
2926
3023
  size: 24,
2927
3024
  "aria-hidden": "true",
2928
3025
  style: { marginLeft: 2 }
2929
3026
  })
2930
3027
  }),
2931
- /* @__PURE__ */ f("button", {
3028
+ /* @__PURE__ */ p("button", {
2932
3029
  className: "gb-pip-btn",
2933
3030
  onClick: () => Z(H(Math.min(B, V($) + 10)), {
2934
3031
  eventType: "fast_forward",
@@ -2936,23 +3033,23 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2936
3033
  }),
2937
3034
  "aria-label": "Skip forward 10 seconds",
2938
3035
  disabled: Y,
2939
- children: /* @__PURE__ */ f(we, {
3036
+ children: /* @__PURE__ */ p(Se, {
2940
3037
  size: 20,
2941
3038
  "aria-hidden": "true"
2942
3039
  })
2943
3040
  })
2944
3041
  ]
2945
3042
  }),
2946
- /* @__PURE__ */ p("div", {
3043
+ /* @__PURE__ */ m("div", {
2947
3044
  className: "gb-pip-bottom",
2948
- children: [/* @__PURE__ */ f("div", {
3045
+ children: [/* @__PURE__ */ p("div", {
2949
3046
  className: "gb-pip-progress",
2950
- onClick: xi,
2951
- children: /* @__PURE__ */ f("div", {
3047
+ onClick: Ti,
3048
+ children: /* @__PURE__ */ p("div", {
2952
3049
  className: "gb-pip-progress-fill",
2953
3050
  style: { width: `${t ? n / t * 100 : 0}%` }
2954
3051
  })
2955
- }), /* @__PURE__ */ p("div", {
3052
+ }), /* @__PURE__ */ m("div", {
2956
3053
  className: "gb-pip-time",
2957
3054
  children: [
2958
3055
  Q(n),
@@ -2962,30 +3059,30 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2962
3059
  })]
2963
3060
  })
2964
3061
  ]
2965
- }), xn.document.body);
3062
+ }), Sn.document.body);
2966
3063
  })()
2967
3064
  ]
2968
3065
  });
2969
- }, Ge = "https://dev-api.go-boss.com";
2970
- function Ke(e) {
3066
+ }, We = "https://dev-api.go-boss.com";
3067
+ function Ge(e) {
2971
3068
  return {
2972
3069
  "x-player-key": e,
2973
3070
  "Content-Type": "application/json"
2974
3071
  };
2975
3072
  }
2976
- async function qe(e, t = Ge, n = {}) {
3073
+ async function Ke(e, t = We, n = {}) {
2977
3074
  let r = await fetch(`${t}/api/player/sdk/init`, {
2978
3075
  method: "POST",
2979
- headers: Ke(e),
3076
+ headers: Ge(e),
2980
3077
  body: JSON.stringify({ videoUrl: n.videoUrl })
2981
3078
  });
2982
3079
  if (!r.ok) throw Error(`SDK init failed: ${r.status}`);
2983
3080
  return await r.json();
2984
3081
  }
2985
- async function Je(e, t, n = Ge) {
3082
+ async function qe(e, t, n = We) {
2986
3083
  let { sessionId: r, videoId: i, videoTitle: a, videoUrl: o, contentDurationSec: s } = t, c = await fetch(`${n}/api/player/sdk/session/start`, {
2987
3084
  method: "POST",
2988
- headers: Ke(e),
3085
+ headers: Ge(e),
2989
3086
  body: JSON.stringify({
2990
3087
  sessionId: r,
2991
3088
  videoId: i,
@@ -2996,22 +3093,22 @@ async function Je(e, t, n = Ge) {
2996
3093
  });
2997
3094
  if (!c.ok) throw Error(`Session start failed: ${c.status}`);
2998
3095
  }
2999
- async function Ye(e, t, n, r, i = Ge) {
3096
+ async function Je(e, t, n, r, i = We) {
3000
3097
  let a = {
3001
3098
  sessionId: t,
3002
3099
  currentTime: n,
3003
3100
  duration: r
3004
3101
  }, o = await fetch(`${i}/api/player/sdk/session/heartbeat`, {
3005
3102
  method: "POST",
3006
- headers: Ke(e),
3103
+ headers: Ge(e),
3007
3104
  body: JSON.stringify(a)
3008
3105
  });
3009
3106
  if (!o.ok) throw Error(`Heartbeat failed: ${o.status}`);
3010
3107
  }
3011
- async function Xe(e, t, n = 0, r = 0, i = Ge) {
3108
+ async function Ye(e, t, n = 0, r = 0, i = We) {
3012
3109
  let a = await fetch(`${i}/api/player/sdk/session/end`, {
3013
3110
  method: "POST",
3014
- headers: Ke(e),
3111
+ headers: Ge(e),
3015
3112
  body: JSON.stringify({
3016
3113
  sessionId: t,
3017
3114
  currentTime: n,
@@ -3020,18 +3117,18 @@ async function Xe(e, t, n = 0, r = 0, i = Ge) {
3020
3117
  });
3021
3118
  if (!a.ok) throw Error(`Session end failed: ${a.status}`);
3022
3119
  }
3023
- async function Ze(e, t, n = Ge) {
3120
+ async function Xe(e, t, n = We) {
3024
3121
  let r = await fetch(`${n}/api/player/sdk/events`, {
3025
3122
  method: "POST",
3026
- headers: Ke(e),
3123
+ headers: Ge(e),
3027
3124
  body: JSON.stringify(t)
3028
3125
  });
3029
3126
  if (!r.ok) throw Error(`Event ${t.eventType} failed: ${r.status}`);
3030
3127
  }
3031
- function Qe(e, t, n = 0, r = 0, i = Ge) {
3128
+ function Ze(e, t, n = 0, r = 0, i = We) {
3032
3129
  fetch(`${i}/api/player/sdk/session/end`, {
3033
3130
  method: "POST",
3034
- headers: Ke(e),
3131
+ headers: Ge(e),
3035
3132
  body: JSON.stringify({
3036
3133
  sessionId: t,
3037
3134
  currentTime: n,
@@ -3042,10 +3139,10 @@ function Qe(e, t, n = 0, r = 0, i = Ge) {
3042
3139
  }
3043
3140
  //#endregion
3044
3141
  //#region src/delegate.ts
3045
- function x() {
3142
+ function S() {
3046
3143
  if (!(typeof screen > "u")) return screen.orientation?.type ?? void 0;
3047
3144
  }
3048
- var $e = class {
3145
+ var Qe = class {
3049
3146
  constructor() {
3050
3147
  this.autoplay = !1, this.keyMoments = [], this.isPlaybackActive = !1, this.hasFinished = !1, this.hasDismissed = !1, this.lastCurrentTime = 0, this.lastDuration = 0, this.lastWatchDuration = 0, this.prevSpeed = 1, this.pendingSeek = null;
3051
3148
  }
@@ -3107,10 +3204,10 @@ var $e = class {
3107
3204
  break;
3108
3205
  }
3109
3206
  case "fullscreen_enter":
3110
- this.call("playerDidEnterFullscreen", x());
3207
+ this.call("playerDidEnterFullscreen", S());
3111
3208
  break;
3112
3209
  case "fullscreen_exit":
3113
- this.call("playerDidExitFullscreen", x());
3210
+ this.call("playerDidExitFullscreen", S());
3114
3211
  break;
3115
3212
  case "key_moments": {
3116
3213
  let t = e.momentTitle ?? "", n = e.momentTime ?? e.currentTime, r = this.keyMoments, i = r.findIndex((e) => t && e.title === t || e.startTime === n), a = i >= 0 ? r[i] : void 0;
@@ -3157,7 +3254,7 @@ var $e = class {
3157
3254
  console.error(`[PlayerSDK Delegate] ${String(e)} callback failed:`, t);
3158
3255
  }
3159
3256
  }
3160
- }, et = {
3257
+ }, $e = {
3161
3258
  subtitles: "subtitle_support",
3162
3259
  ads: "ad_support",
3163
3260
  chapterMarkers: "key_moments",
@@ -3171,7 +3268,7 @@ var $e = class {
3171
3268
  screenRecordingPrevention: "screen_recording_prevention",
3172
3269
  signalStrength: "signal_strength"
3173
3270
  };
3174
- function tt(e) {
3271
+ function et(e) {
3175
3272
  let t = {
3176
3273
  m3u8_playback: !0,
3177
3274
  subtitle_support: !1,
@@ -3187,10 +3284,10 @@ function tt(e) {
3187
3284
  signal_strength: !1,
3188
3285
  ad_support: !1
3189
3286
  };
3190
- for (let [n, r] of Object.entries(et)) n in e && (t[r] = e[n]);
3287
+ for (let [n, r] of Object.entries($e)) n in e && (t[r] = e[n]);
3191
3288
  return t;
3192
3289
  }
3193
- function nt(e) {
3290
+ function tt(e) {
3194
3291
  if (!e) return (e) => e;
3195
3292
  let t = [];
3196
3293
  for (let n of e.split(",")) {
@@ -3210,12 +3307,12 @@ function nt(e) {
3210
3307
  return e;
3211
3308
  };
3212
3309
  }
3213
- function rt(e) {
3310
+ function nt(e) {
3214
3311
  let t = e.replace("#", "");
3215
3312
  return t.length === 6 ? `${parseInt(t.substring(0, 2), 16)}, ${parseInt(t.substring(2, 4), 16)}, ${parseInt(t.substring(4, 6), 16)}` : "99, 102, 241";
3216
3313
  }
3217
- var it = 30 * 1e3;
3218
- function at(e, t) {
3314
+ var rt = 30 * 1e3;
3315
+ function it(e, t) {
3219
3316
  switch (e.eventType) {
3220
3317
  case "pause": return {
3221
3318
  eventType: "pause",
@@ -3309,141 +3406,141 @@ function at(e, t) {
3309
3406
  default: return null;
3310
3407
  }
3311
3408
  }
3312
- function ot({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i = "#6366f1", firebaseConfig: a, proxyDomains: s, apiBaseUrl: l, adTrackingUrl: ee, overlayAdUrl: te, videoId: ne, title: m, watermark: ie, autoplay: h = !1, muted: ae = !1, autoFullscreen: oe = !1, enableControls: se = !0, enableSkipAd: ce, skipAdAfterSeconds: le, chaptersDisplayMode: ue = "strip", volumeControlType: g = "slider", subtitleStyle: de, drmConfig: fe, onAnalyticsEvent: pe, delegate: _, onKeyMomentsLoaded: me, initialTime: he, onTimeUpdate: ge }) {
3313
- let [_e, ve] = d([]), [ye, be] = d(0), [v] = d(() => new $e());
3409
+ function at({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i = "#6366f1", firebaseConfig: a, proxyDomains: s, apiBaseUrl: l, adTrackingUrl: f, overlayAdUrl: ee, videoId: te, title: h, watermark: g, autoplay: _ = !1, muted: re = !1, autoFullscreen: ie = !1, enableControls: ae = !0, enableSkipAd: oe, skipAdAfterSeconds: se, chaptersDisplayMode: ce = "strip", volumeControlType: v = "slider", subtitleStyle: le, drmConfig: ue, onAnalyticsEvent: de, delegate: y, onKeyMomentsLoaded: fe, initialTime: pe, onTimeUpdate: me }) {
3410
+ let [he, ge] = d([]), [_e, ve] = d(0), [b] = d(() => new Qe());
3314
3411
  c(() => {
3315
- v.setDelegate(_), v.setAutoplay(h);
3412
+ b.setDelegate(y), b.setAutoplay(_);
3316
3413
  }, [
3317
- v,
3318
- _,
3319
- h
3320
- ]), c(() => () => v.notifyDismissed(), [v]);
3321
- let xe = Array.isArray(t) ? t : [{
3414
+ b,
3415
+ y,
3416
+ _
3417
+ ]), c(() => () => b.notifyDismissed(), [b]);
3418
+ let ye = Array.isArray(t) ? t : [{
3322
3419
  label: "Default",
3323
3420
  url: t
3324
- }], Se = xe[ye]?.url ?? xe[0]?.url ?? "", [Ce, we] = d("loading"), [Te, Ee] = d(null), [De, Oe] = d(0), [ke, Ae] = d("network"), je = u(null), Me = u(!1), y = u(""), Ne = u(!1), Pe = u(!1), Fe = u(void 0), Ie = u(!1), Le = u(it), b = u(null), Re = u(0), ze = u(null), Be = u({
3421
+ }], be = ye[_e]?.url ?? ye[0]?.url ?? "", [xe, Se] = d("loading"), [Ce, we] = d(null), [Te, Ee] = d(0), [De, Oe] = d("network"), ke = u(null), Ae = u(!1), je = u(""), Me = u(!1), Ne = u(!1), Pe = u(void 0), Fe = u(!1), Ie = u(rt), x = u(null), Le = u(0), Re = u(null), ze = u({
3325
3422
  currentTime: 0,
3326
3423
  duration: 0
3327
- }), Ve = u(() => {}), He = Se.split("/").filter(Boolean), Ue = ne || (He[He.length - 1] ?? "").replace(/\.m3u8.*$/, "") || "video", Ge = u(Se);
3424
+ }), Be = u(() => {}), Ve = be.split("/").filter(Boolean), He = te || (Ve[Ve.length - 1] ?? "").replace(/\.m3u8.*$/, "") || "video", We = u(be);
3328
3425
  c(() => {
3329
- Ge.current = Se;
3330
- }, [Se]);
3331
- let Ke = o(() => nt(s), [s])(), x = rt(i);
3426
+ We.current = be;
3427
+ }, [be]);
3428
+ let Ge = o(() => tt(s), [s])(), S = nt(i);
3332
3429
  c(() => {
3333
- document.documentElement.style.setProperty("--accent-indigo", i), document.documentElement.style.setProperty("--accent-indigo-rgb", x);
3334
- }, [i, x]), c(() => {
3430
+ document.documentElement.style.setProperty("--accent-indigo", i), document.documentElement.style.setProperty("--accent-indigo-rgb", S);
3431
+ }, [i, S]), c(() => {
3335
3432
  let t = !1;
3336
- return qe(e, l, { videoUrl: Ge.current }).then((e) => {
3433
+ return Ke(e, l, { videoUrl: We.current }).then((e) => {
3337
3434
  if (t) return;
3338
- je.current = e;
3435
+ ke.current = e;
3339
3436
  let { features: n, planTier: r, heartbeatIntervalSeconds: i } = e.result.data;
3340
- Le.current = typeof i == "number" && i > 0 ? i * 1e3 : it;
3437
+ Ie.current = typeof i == "number" && i > 0 ? i * 1e3 : rt;
3341
3438
  let a = {
3342
3439
  package: r,
3343
3440
  is_active: !0,
3344
- features: tt(n),
3441
+ features: et(n),
3345
3442
  limits: { streaming_minutes: 0 }
3346
3443
  };
3347
- console.log("[SDK] Player key validated. Features:", a.features), Ee(a), we("ready");
3444
+ console.log("[SDK] Player key validated. Features:", a.features), we(a), Se("ready");
3348
3445
  }).catch((e) => {
3349
3446
  if (t) return;
3350
3447
  console.error("[SDK] Player key validation failed:", e);
3351
3448
  let n = e.message ?? "";
3352
- Ae(/init failed: 4\d\d/.test(n) ? "auth" : "network"), we("error");
3449
+ Oe(/init failed: 4\d\d/.test(n) ? "auth" : "network"), Se("error");
3353
3450
  }), () => {
3354
- t = !0, b.current &&= (clearTimeout(b.current), null), Re.current = 0, ze.current = null, we("loading"), Ee(null), Ne.current = !1, y.current = "", Pe.current = !1, Fe.current = void 0;
3451
+ t = !0, x.current &&= (clearTimeout(x.current), null), Le.current = 0, Re.current = null, Se("loading"), we(null), Me.current = !1, je.current = "", Ne.current = !1, Pe.current = void 0;
3355
3452
  };
3356
3453
  }, [
3357
3454
  e,
3358
3455
  l,
3359
- De
3456
+ Te
3360
3457
  ]);
3361
- let et = o(() => {
3362
- b.current && (clearTimeout(b.current), b.current = null, ze.current !== null && (Re.current += Date.now() - ze.current, ze.current = null));
3363
- }, []), ot = o(() => {
3364
- b.current &&= (clearTimeout(b.current), null), Re.current = 0, ze.current = null;
3365
- }, []), S = o(() => {
3366
- if (b.current || !y.current) return;
3367
- ze.current = Date.now();
3368
- let t = Le.current - Re.current;
3369
- b.current = setTimeout(() => {
3370
- b.current = null, Re.current = 0, ze.current = null;
3371
- let { currentTime: t, duration: n } = Be.current;
3372
- console.log(`[SDK] Heartbeat timer fired — ${Le.current / 1e3}s of real content elapsed`), Ye(e, y.current, t, n, l).catch((e) => console.warn("[SDK] Heartbeat failed:", e.message)), Ve.current();
3458
+ let $e = o(() => {
3459
+ x.current && (clearTimeout(x.current), x.current = null, Re.current !== null && (Le.current += Date.now() - Re.current, Re.current = null));
3460
+ }, []), at = o(() => {
3461
+ x.current &&= (clearTimeout(x.current), null), Le.current = 0, Re.current = null;
3462
+ }, []), C = o(() => {
3463
+ if (x.current || !je.current) return;
3464
+ Re.current = Date.now();
3465
+ let t = Ie.current - Le.current;
3466
+ x.current = setTimeout(() => {
3467
+ x.current = null, Le.current = 0, Re.current = null;
3468
+ let { currentTime: t, duration: n } = ze.current;
3469
+ console.log(`[SDK] Heartbeat timer fired — ${Ie.current / 1e3}s of real content elapsed`), Je(e, je.current, t, n, l).catch((e) => console.warn("[SDK] Heartbeat failed:", e.message)), Be.current();
3373
3470
  }, t);
3374
3471
  }, [e, l]);
3375
3472
  c(() => {
3376
- Ve.current = S;
3377
- }, [S]);
3378
- let st = u(!0);
3473
+ Be.current = C;
3474
+ }, [C]);
3475
+ let ot = u(!0);
3379
3476
  c(() => {
3380
- if (st.current) {
3381
- st.current = !1;
3477
+ if (ot.current) {
3478
+ ot.current = !1;
3382
3479
  return;
3383
3480
  }
3384
- Ie.current = !0, Fe.current = void 0, et();
3385
- }, [ye, et]), c(() => {
3481
+ Fe.current = !0, Pe.current = void 0, $e();
3482
+ }, [_e, $e]), c(() => {
3386
3483
  let t = () => {
3387
- if (v.notifyDismissed(), !y.current) return;
3388
- Pe.current = !0, ot();
3389
- let { currentTime: t, duration: n } = Be.current;
3390
- Qe(e, y.current, t, n, l);
3484
+ if (b.notifyDismissed(), !je.current) return;
3485
+ Ne.current = !0, at();
3486
+ let { currentTime: t, duration: n } = ze.current;
3487
+ Ze(e, je.current, t, n, l);
3391
3488
  };
3392
3489
  return window.addEventListener("beforeunload", t), () => {
3393
- window.removeEventListener("beforeunload", t), ot();
3490
+ window.removeEventListener("beforeunload", t), at();
3394
3491
  };
3395
3492
  }, [
3396
3493
  e,
3397
3494
  l,
3398
- ot,
3399
- v
3495
+ at,
3496
+ b
3400
3497
  ]);
3401
- let ct = o((t) => {
3498
+ let st = o((t) => {
3402
3499
  let n = t;
3403
- if (t.currentTime !== void 0 && (Be.current = {
3500
+ if (t.currentTime !== void 0 && (ze.current = {
3404
3501
  currentTime: t.currentTime,
3405
3502
  duration: t.duration
3406
- }), t.eventType === "session_start" && !Ne.current && (Ne.current = !0, Pe.current = !1, y.current = typeof n.sessionId == "string" ? n.sessionId : "", Je(e, {
3407
- sessionId: y.current,
3408
- videoId: Ue,
3409
- videoTitle: m,
3410
- videoUrl: Ge.current,
3503
+ }), t.eventType === "session_start" && !Me.current && (Me.current = !0, Ne.current = !1, je.current = typeof n.sessionId == "string" ? n.sessionId : "", qe(e, {
3504
+ sessionId: je.current,
3505
+ videoId: He,
3506
+ videoTitle: h,
3507
+ videoUrl: We.current,
3411
3508
  contentDurationSec: t.duration
3412
- }, l).catch((e) => console.warn("[SDK] Session start failed:", e.message)), Me.current || S()), t.eventType === "play" && Ne.current && !Me.current && !Ie.current && S(), t.eventType === "pause" && et(), t.eventType === "buffering_start" && et(), t.eventType === "buffering_end" && Ne.current && !Me.current && (Ie.current = !1, S()), t.eventType === "ended" && (ot(), y.current)) {
3413
- Pe.current = !0;
3414
- let { currentTime: t, duration: n } = Be.current;
3415
- Xe(e, y.current, t, n, l).catch((e) => console.warn("[SDK] Session end failed:", e.message));
3509
+ }, l).catch((e) => console.warn("[SDK] Session start failed:", e.message)), Ae.current || C()), t.eventType === "play" && Me.current && !Ae.current && !Fe.current && C(), t.eventType === "pause" && $e(), t.eventType === "buffering_start" && $e(), t.eventType === "buffering_end" && Me.current && !Ae.current && (Fe.current = !1, C()), t.eventType === "ended" && (at(), je.current)) {
3510
+ Ne.current = !0;
3511
+ let { currentTime: t, duration: n } = ze.current;
3512
+ Ye(e, je.current, t, n, l).catch((e) => console.warn("[SDK] Session end failed:", e.message));
3416
3513
  }
3417
- if (Ne.current && y.current && !Pe.current) {
3418
- let n = at(t, Fe.current);
3419
- n && Ze(e, {
3514
+ if (Me.current && je.current && !Ne.current) {
3515
+ let n = it(t, Pe.current);
3516
+ n && Xe(e, {
3420
3517
  eventType: n.eventType,
3421
- sessionId: y.current,
3518
+ sessionId: je.current,
3422
3519
  currentTime: t.currentTime ?? 0,
3423
- videoId: Ue,
3424
- videoTitle: m,
3520
+ videoId: He,
3521
+ videoTitle: h,
3425
3522
  ...n.extras
3426
3523
  }, l).catch((e) => console.warn(`[SDK] Event ${n.eventType} failed:`, e.message));
3427
3524
  }
3428
- t.eventType === "quality_change" && t.rendition && (Fe.current = t.rendition), console.log("[SDK Analytics]", t), v.handleAnalyticsEvent(t), pe?.(t);
3525
+ t.eventType === "quality_change" && t.rendition && (Pe.current = t.rendition), console.log("[SDK Analytics]", t), b.handleAnalyticsEvent(t), de?.(t);
3429
3526
  }, [
3430
3527
  e,
3431
3528
  l,
3432
- Ue,
3433
- m,
3434
- S,
3435
- et,
3436
- ot,
3437
- pe,
3438
- v
3439
- ]), lt = o((e) => {
3440
- Me.current = e, e ? (et(), console.log("[SDK] Ad break started — heartbeat timer paused")) : (Ne.current && S(), console.log("[SDK] Ad break ended — heartbeat timer resumed"));
3441
- }, [et, S]), ut = o((e) => {
3442
- v.setKeyMoments(e), ve(e), me?.(e);
3443
- }, [me, v]), dt = o((e) => {
3444
- v.handleTimeUpdate(e), ge?.(e);
3445
- }, [ge, v]);
3446
- if (Ce === "loading") return /* @__PURE__ */ p("div", {
3529
+ He,
3530
+ h,
3531
+ C,
3532
+ $e,
3533
+ at,
3534
+ de,
3535
+ b
3536
+ ]), ct = o((e) => {
3537
+ Ae.current = e, e ? ($e(), console.log("[SDK] Ad break started — heartbeat timer paused")) : (Me.current && C(), console.log("[SDK] Ad break ended — heartbeat timer resumed"));
3538
+ }, [$e, C]), lt = o((e) => {
3539
+ b.setKeyMoments(e), ge(e), fe?.(e);
3540
+ }, [fe, b]), ut = o((e) => {
3541
+ b.handleTimeUpdate(e), me?.(e);
3542
+ }, [me, b]);
3543
+ if (xe === "loading") return /* @__PURE__ */ m("div", {
3447
3544
  style: {
3448
3545
  width: "100%",
3449
3546
  aspectRatio: "16 / 9",
@@ -3453,20 +3550,20 @@ function ot({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i =
3453
3550
  alignItems: "center",
3454
3551
  justifyContent: "center"
3455
3552
  },
3456
- children: [/* @__PURE__ */ f("style", { children: "@keyframes boss-sdk-spin{to{transform:rotate(360deg)}}" }), /* @__PURE__ */ f("div", { style: {
3553
+ children: [/* @__PURE__ */ p("style", { children: "@keyframes boss-sdk-spin{to{transform:rotate(360deg)}}" }), /* @__PURE__ */ p("div", { style: {
3457
3554
  width: 60,
3458
3555
  height: 60,
3459
3556
  borderRadius: "50%",
3460
- border: `4px solid rgba(${x}, 0.1)`,
3557
+ border: `4px solid rgba(${S}, 0.1)`,
3461
3558
  borderLeftColor: i,
3462
- borderRightColor: `rgba(${x}, 0.2)`,
3463
- filter: `drop-shadow(0 0 10px rgba(${x}, 0.5))`,
3559
+ borderRightColor: `rgba(${S}, 0.2)`,
3560
+ filter: `drop-shadow(0 0 10px rgba(${S}, 0.5))`,
3464
3561
  animation: "boss-sdk-spin 1s linear infinite"
3465
3562
  } })]
3466
3563
  });
3467
- if (Ce === "error") {
3468
- let e = ke === "auth";
3469
- return /* @__PURE__ */ f("div", {
3564
+ if (xe === "error") {
3565
+ let e = De === "auth";
3566
+ return /* @__PURE__ */ p("div", {
3470
3567
  style: {
3471
3568
  width: "100%",
3472
3569
  aspectRatio: "16 / 9",
@@ -3478,57 +3575,57 @@ function ot({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i =
3478
3575
  flexDirection: "column",
3479
3576
  gap: 20
3480
3577
  },
3481
- children: /* @__PURE__ */ f(re, {
3578
+ children: /* @__PURE__ */ p(ne, {
3482
3579
  title: e ? "Invalid Player Key" : "Something Went Wrong",
3483
3580
  subtitle: e ? "Your player key is invalid or expired.\nPlease check your configuration." : "We encountered an error while connecting.\nPlease try again.",
3484
- onRetry: () => Oe((e) => e + 1)
3581
+ onRetry: () => Ee((e) => e + 1)
3485
3582
  })
3486
3583
  });
3487
3584
  }
3488
- return /* @__PURE__ */ f(We, {
3489
- src: Se,
3490
- sources: xe,
3491
- activeSourceIndex: ye,
3492
- onSourceChange: (e) => be(e),
3585
+ return /* @__PURE__ */ p(Ue, {
3586
+ src: be,
3587
+ sources: ye,
3588
+ activeSourceIndex: _e,
3589
+ onSourceChange: (e) => ve(e),
3493
3590
  subtitles: n,
3494
- keyMoments: _e,
3591
+ keyMoments: he,
3495
3592
  themeColor: i,
3496
3593
  firebaseConfig: a,
3497
- resolvedEntitlement: Te,
3594
+ resolvedEntitlement: Ce,
3498
3595
  licenseKey: r,
3499
- title: m,
3500
- watermark: ie,
3501
- autoplay: h,
3502
- muted: ae,
3503
- autoFullscreen: oe,
3504
- enableControls: se,
3505
- enableSkipAd: ce,
3506
- skipAdAfterSeconds: le,
3507
- chaptersDisplayMode: ue,
3508
- volumeControlType: g,
3509
- subtitleStyle: de,
3510
- drmConfig: fe,
3511
- overlayAdUrl: te,
3512
- adTrackingUrl: ee,
3513
- videoId: Ue,
3514
- urlTransformer: Ke,
3515
- onAnalyticsEvent: ct,
3516
- onAdBreakChange: lt,
3517
- onKeyMomentsLoaded: ut,
3518
- initialTime: he,
3519
- onTimeUpdate: dt
3596
+ title: h,
3597
+ watermark: g,
3598
+ autoplay: _,
3599
+ muted: re,
3600
+ autoFullscreen: ie,
3601
+ enableControls: ae,
3602
+ enableSkipAd: oe,
3603
+ skipAdAfterSeconds: se,
3604
+ chaptersDisplayMode: ce,
3605
+ volumeControlType: v,
3606
+ subtitleStyle: le,
3607
+ drmConfig: ue,
3608
+ overlayAdUrl: ee,
3609
+ adTrackingUrl: f,
3610
+ videoId: He,
3611
+ urlTransformer: Ge,
3612
+ onAnalyticsEvent: st,
3613
+ onAdBreakChange: ct,
3614
+ onKeyMomentsLoaded: lt,
3615
+ initialTime: pe,
3616
+ onTimeUpdate: ut
3520
3617
  });
3521
3618
  }
3522
3619
  //#endregion
3523
3620
  //#region src/create-player.ts
3524
- function S(e, t) {
3525
- let n = ne(e), r = t;
3526
- return n.render(i(ot, r)), {
3621
+ function C(e, t) {
3622
+ let n = te(e), r = t;
3623
+ return n.render(i(at, r)), {
3527
3624
  update(e) {
3528
3625
  r = {
3529
3626
  ...r,
3530
3627
  ...e
3531
- }, n.render(i(ot, r));
3628
+ }, n.render(i(at, r));
3532
3629
  },
3533
3630
  destroy() {
3534
3631
  n.unmount();
@@ -3536,6 +3633,6 @@ function S(e, t) {
3536
3633
  };
3537
3634
  }
3538
3635
  //#endregion
3539
- export { ot as BossVideoPlayer, e as FirebaseAnalyticsProvider, t as VideoPlayerSDK, We as WebVideoPlayer, S as createPlayer, Xe as endSession, qe as initSdk, Ze as sendEvent, Ye as sendHeartbeat, Je as startSession };
3636
+ export { at as BossVideoPlayer, e as FirebaseAnalyticsProvider, t as VideoPlayerSDK, Ue as WebVideoPlayer, C as createPlayer, Ye as endSession, Ke as initSdk, Xe as sendEvent, Je as sendHeartbeat, qe as startSession };
3540
3637
 
3541
3638
  //# sourceMappingURL=index.js.map