markdown-flow-ui 0.2.26-dev.4 → 0.2.26-dev.5
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/assets/markdown-flow-ui.css +1 -1
- package/dist/components/Slide/Player.cjs +1 -1
- package/dist/components/Slide/Player.cjs.map +1 -1
- package/dist/components/Slide/Player.d.ts +2 -0
- package/dist/components/Slide/Player.es.js +308 -299
- package/dist/components/Slide/Player.es.js.map +1 -1
- package/dist/components/Slide/Slide.cjs +1 -1
- package/dist/components/Slide/Slide.cjs.map +1 -1
- package/dist/components/Slide/Slide.d.ts +2 -0
- package/dist/components/Slide/Slide.es.js +414 -411
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/locales/slide.json.cjs +1 -1
- package/dist/components/Slide/locales/slide.json.d.ts +5 -0
- package/dist/components/Slide/locales/slide.json.es.js +5 -5
- package/dist/components/Slide/slideI18n.cjs.map +1 -1
- package/dist/components/Slide/slideI18n.d.ts +1 -0
- package/dist/components/Slide/slideI18n.es.js.map +1 -1
- package/dist/markdown-flow-ui.css +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import _r, { memo as Mr, useId as wr, useContext as Tr, useRef as i, useState as Ge, useMemo as ce, useCallback as u, useEffect as
|
|
1
|
+
import { jsxs as H, jsx as s, Fragment as Pt } from "react/jsx-runtime";
|
|
2
|
+
import _r, { memo as Mr, useId as wr, useContext as Tr, useRef as i, useState as Ge, useMemo as ce, useCallback as u, useEffect as m } from "react";
|
|
3
3
|
import { getMarkdownFlowDirection as kr, getMarkdownFlowLanguage as vr } from "../../lib/locale.es.js";
|
|
4
4
|
import { useDetachedLanguage as Lr } from "../../lib/useDetachedLanguage.es.js";
|
|
5
5
|
import { useResolvedDirection as Ar } from "../../lib/useResolvedDirection.es.js";
|
|
@@ -12,14 +12,14 @@ import { PlayerKeyboardShortcutContext as Fr } from "./utils/playerKeyboardShort
|
|
|
12
12
|
import { activatePlayerKeyboardShortcutOwner as Ur, registerPlayerKeyboardShortcutOwner as Br, isActivePlayerKeyboardShortcutOwner as Wr, getPlayerKeyboardShortcutAction as Or, shouldIgnorePlayerKeyboardShortcutEvent as Rr } from "./utils/playerKeyboardShortcuts.es.js";
|
|
13
13
|
import { resolveAudioPlaybackSourceType as Vr } from "./utils/playbackSource.es.js";
|
|
14
14
|
import { shouldKeepPlayingAfterNavigation as Ir } from "./utils/playbackPreference.es.js";
|
|
15
|
-
import { toPlayerCustomActionList as
|
|
15
|
+
import { toPlayerCustomActionList as $r } from "./utils/playerCustomActions.es.js";
|
|
16
16
|
import { suppressPlayerControlsWakeAfterNavigation as Qe } from "./utils/playerNavigationContext.es.js";
|
|
17
17
|
import { isPlaybackTimeCoveredBySegments as Xe, resolveSegmentSeekTarget as Zt } from "./utils/segmentSeek.es.js";
|
|
18
18
|
import { getSortedAudioSegments as jt } from "./utils/audioSegments.es.js";
|
|
19
|
-
import { getSubtitleCueJumpTarget as
|
|
19
|
+
import { getSubtitleCueJumpTarget as Hr, shouldClearSubtitleCueJumpTarget as Dr } from "./utils/subtitleCue.es.js";
|
|
20
20
|
/* empty css */
|
|
21
|
-
import
|
|
22
|
-
import
|
|
21
|
+
import Jr from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
|
|
22
|
+
import Pr from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
|
|
23
23
|
import Zr from "../../node_modules/lucide-react/dist/esm/icons/skip-back.es.js";
|
|
24
24
|
import jr from "../../node_modules/lucide-react/dist/esm/icons/skip-forward.es.js";
|
|
25
25
|
import zr from "../../node_modules/lucide-react/dist/esm/icons/rewind.es.js";
|
|
@@ -28,29 +28,29 @@ import Gr from "../../node_modules/lucide-react/dist/esm/icons/captions.es.js";
|
|
|
28
28
|
import Qr from "../../node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
|
|
29
29
|
import Xr from "../../node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
|
|
30
30
|
import qr from "../../node_modules/lucide-react/dist/esm/icons/maximize.es.js";
|
|
31
|
-
const zt = /* @__PURE__ */ new Map(), Yt = (
|
|
32
|
-
if (typeof window > "u" || !
|
|
31
|
+
const zt = /* @__PURE__ */ new Map(), Yt = (d) => {
|
|
32
|
+
if (typeof window > "u" || !d || zt.has(d))
|
|
33
33
|
return;
|
|
34
34
|
const p = window.document.createElement("audio");
|
|
35
|
-
p.preload = "auto", p.setAttribute("playsinline", "true"), p.src =
|
|
36
|
-
}, en = (
|
|
37
|
-
const T =
|
|
35
|
+
p.preload = "auto", p.setAttribute("playsinline", "true"), p.src = d, p.load(), zt.set(d, p);
|
|
36
|
+
}, en = (d, p) => p !== null && p.audioList === d && p.subtitleCueLists.length === d.length && d.every((l, w) => {
|
|
37
|
+
const T = l.element?.subtitle_cues;
|
|
38
38
|
return p.subtitleCueLists[w] === T && p.subtitleCueLengths[w] === (T?.length ?? 0);
|
|
39
|
-
}), tn = (
|
|
40
|
-
const p =
|
|
41
|
-
(
|
|
39
|
+
}), tn = (d) => {
|
|
40
|
+
const p = d.map(
|
|
41
|
+
(l) => l.element?.subtitle_cues
|
|
42
42
|
);
|
|
43
43
|
return {
|
|
44
|
-
audioList:
|
|
44
|
+
audioList: d,
|
|
45
45
|
subtitleCueLists: p,
|
|
46
46
|
subtitleCueLengths: p.map(
|
|
47
|
-
(
|
|
47
|
+
(l) => l?.length ?? 0
|
|
48
48
|
),
|
|
49
|
-
tracks: p.map((
|
|
50
|
-
subtitleCues:
|
|
49
|
+
tracks: p.map((l) => ({
|
|
50
|
+
subtitleCues: l ?? []
|
|
51
51
|
}))
|
|
52
52
|
};
|
|
53
|
-
}, rn = () => /* @__PURE__ */
|
|
53
|
+
}, rn = () => /* @__PURE__ */ H(
|
|
54
54
|
"svg",
|
|
55
55
|
{
|
|
56
56
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -69,7 +69,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
69
69
|
/* @__PURE__ */ s("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
|
|
70
70
|
]
|
|
71
71
|
}
|
|
72
|
-
), nn = () => /* @__PURE__ */
|
|
72
|
+
), nn = () => /* @__PURE__ */ H(
|
|
73
73
|
"svg",
|
|
74
74
|
{
|
|
75
75
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -88,21 +88,21 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
88
88
|
/* @__PURE__ */ s("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
|
|
89
89
|
]
|
|
90
90
|
}
|
|
91
|
-
),
|
|
91
|
+
), j = {
|
|
92
92
|
fullscreen: "F",
|
|
93
93
|
next: "→",
|
|
94
94
|
nextSubtitle: "Shift+→",
|
|
95
95
|
previous: "←",
|
|
96
96
|
previousSubtitle: "Shift+←",
|
|
97
97
|
subtitle: "C"
|
|
98
|
-
}, un = 250,
|
|
99
|
-
audioList:
|
|
98
|
+
}, un = 250, an = 15e3, ln = (d, p) => d ? `${d} (${p})` : p, sn = ({
|
|
99
|
+
audioList: d = [],
|
|
100
100
|
className: p,
|
|
101
|
-
currentAudioIndex:
|
|
101
|
+
currentAudioIndex: l = -1,
|
|
102
102
|
defaultPlaying: w = !0,
|
|
103
103
|
isPlaybackPaused: T = !1,
|
|
104
|
-
isAutoAdvanceEnabled:
|
|
105
|
-
useAutoAdvanceToggle:
|
|
104
|
+
isAutoAdvanceEnabled: z = !0,
|
|
105
|
+
useAutoAdvanceToggle: O = !1,
|
|
106
106
|
onLoadingChange: qe,
|
|
107
107
|
onPlaybackPreferenceChange: et,
|
|
108
108
|
onPlaybackStarted: tt,
|
|
@@ -115,13 +115,13 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
115
115
|
onNext: Me,
|
|
116
116
|
onSubtitleJump: we,
|
|
117
117
|
canJumpToSubtitleTarget: Be,
|
|
118
|
-
onFullscreen:
|
|
118
|
+
onFullscreen: de,
|
|
119
119
|
isFullscreen: rt = !1,
|
|
120
120
|
mobileViewMode: Gt = Er,
|
|
121
121
|
settingsPortalContainer: Qt,
|
|
122
122
|
onMobileViewModeChange: nt,
|
|
123
123
|
onEnded: ut,
|
|
124
|
-
onAutoAdvanceToggle:
|
|
124
|
+
onAutoAdvanceToggle: at,
|
|
125
125
|
onInteractionToggle: on,
|
|
126
126
|
hasInteraction: fn,
|
|
127
127
|
isInteractionOpen: Te = !1,
|
|
@@ -131,10 +131,10 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
131
131
|
showControls: Ve = !0,
|
|
132
132
|
onControlsPointerEnter: Xt,
|
|
133
133
|
onControlsPointerLeave: qt,
|
|
134
|
-
slideProgress:
|
|
134
|
+
slideProgress: N = null,
|
|
135
135
|
enableKeyboardShortcuts: er = !0,
|
|
136
|
-
subtitleSeekRequest:
|
|
137
|
-
customActions:
|
|
136
|
+
subtitleSeekRequest: D = null,
|
|
137
|
+
customActions: lt,
|
|
138
138
|
customActionContext: it,
|
|
139
139
|
locale: ke,
|
|
140
140
|
texts: st,
|
|
@@ -142,22 +142,22 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
142
142
|
onPointerDown: ot,
|
|
143
143
|
...Ie
|
|
144
144
|
}) => {
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
), he = i(!1), gt = i(!1), v = i(!1),
|
|
148
|
-
}), Ce = i(null), ge = i(null), yt = i(null),
|
|
145
|
+
const $e = Ie.dir ?? kr(ke), ft = Ie.lang ?? vr(ke), tr = wr(), dt = Tr(Fr), g = i(null), { resolvedDirection: mt, readDirection: pt } = Ar(g, $e), ve = mt === "rtl", rr = Lr(g, ft), ht = i(Te), R = i(null), Le = i(null), F = i(0), h = i(null), me = i(void 0), k = i([]), pe = i(
|
|
146
|
+
O ? z : w
|
|
147
|
+
), he = i(!1), gt = i(!1), v = i(!1), W = i(null), Y = i(null), E = i(!1), c = i(!1), x = i(null), U = i(!1), G = i(null), Ae = i(0), St = i(() => {
|
|
148
|
+
}), Ce = i(null), ge = i(null), yt = i(null), Q = i(null), bt = i(0), He = i(!1), De = i(!1), _t = i(ne), Mt = i(() => 0), wt = i(null), V = i("unknown"), [xe, S] = Ge(w), [Tt, ue] = Ge(!1), [ae, nr] = Ge({
|
|
149
149
|
next: !1,
|
|
150
150
|
previous: !1
|
|
151
|
-
}),
|
|
151
|
+
}), X = dt?.ownerId ?? tr, I = er && (dt?.enabled ?? !0), f = l >= 0 ? d[l] : void 0, A = f?.audioUrl, kt = f?.audioSegments, ur = kt?.length ?? 0, B = ce(
|
|
152
152
|
() => jt(f),
|
|
153
153
|
[f, ur, kt]
|
|
154
154
|
);
|
|
155
155
|
let Ne = wt.current;
|
|
156
|
-
en(
|
|
157
|
-
const vt = Ne.tracks,
|
|
158
|
-
() =>
|
|
159
|
-
[it,
|
|
160
|
-
), Lt =
|
|
156
|
+
en(d, Ne) || (Ne = tn(d), wt.current = Ne);
|
|
157
|
+
const vt = Ne.tracks, Je = ce(
|
|
158
|
+
() => $r(lt, it),
|
|
159
|
+
[it, lt]
|
|
160
|
+
), Lt = Je.length + 6, ar = ce(
|
|
161
161
|
() => ({
|
|
162
162
|
"--slide-player-mobile-control-count": String(Lt)
|
|
163
163
|
}),
|
|
@@ -168,43 +168,43 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
168
168
|
...st
|
|
169
169
|
}),
|
|
170
170
|
[ke, st]
|
|
171
|
-
),
|
|
171
|
+
), Pe = ce(() => f ? f.audioKey ?? `${String(f.sequenceNumber ?? "none")}:${String(f.audioUrl ?? "")}` : "none", [f]), lr = O ? z : xe, At = O ? z ? o.pauseAutoplayLabel : o.playAutoplayLabel : xe ? o.pauseLabel : o.playLabel, Ct = rt ? o.exitFullscreenLabel : o.enterFullscreenLabel, q = u(
|
|
172
172
|
(e, t, r) => ({
|
|
173
173
|
ariaKeyShortcuts: I ? r : void 0,
|
|
174
|
-
title: I ?
|
|
174
|
+
title: I ? ln(e, t) : e
|
|
175
175
|
}),
|
|
176
176
|
[I]
|
|
177
|
-
), xt =
|
|
177
|
+
), xt = q(
|
|
178
178
|
o.subtitleToggleAriaLabel,
|
|
179
|
-
|
|
179
|
+
j.subtitle,
|
|
180
180
|
"c"
|
|
181
|
-
), Nt =
|
|
181
|
+
), Nt = q(
|
|
182
182
|
o.previousLabel,
|
|
183
|
-
ve ?
|
|
183
|
+
ve ? j.next : j.previous,
|
|
184
184
|
ve ? "ArrowRight" : "ArrowLeft"
|
|
185
|
-
), Et =
|
|
185
|
+
), Et = q(
|
|
186
186
|
o.previousSubtitleLabel,
|
|
187
|
-
|
|
187
|
+
j.previousSubtitle,
|
|
188
188
|
"Shift+ArrowLeft"
|
|
189
|
-
), Kt =
|
|
189
|
+
), Kt = q(
|
|
190
190
|
At,
|
|
191
191
|
o.playbackShortcutLabel,
|
|
192
192
|
"Space"
|
|
193
|
-
), Ft =
|
|
193
|
+
), Ft = q(
|
|
194
194
|
o.nextLabel,
|
|
195
|
-
ve ?
|
|
195
|
+
ve ? j.previous : j.next,
|
|
196
196
|
ve ? "ArrowLeft" : "ArrowRight"
|
|
197
|
-
), Ut =
|
|
197
|
+
), Ut = q(
|
|
198
198
|
o.nextSubtitleLabel,
|
|
199
|
-
|
|
199
|
+
j.nextSubtitle,
|
|
200
200
|
"Shift+ArrowRight"
|
|
201
|
-
), Bt =
|
|
201
|
+
), Bt = q(
|
|
202
202
|
Ct,
|
|
203
|
-
|
|
203
|
+
j.fullscreen,
|
|
204
204
|
"f"
|
|
205
205
|
), Ee = u(() => {
|
|
206
|
-
I && Ur(
|
|
207
|
-
}, [
|
|
206
|
+
I && Ur(X);
|
|
207
|
+
}, [X, I]), ir = u(
|
|
208
208
|
(e) => {
|
|
209
209
|
Ee(), ot?.(e);
|
|
210
210
|
},
|
|
@@ -215,21 +215,21 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
215
215
|
},
|
|
216
216
|
[Ee, ct]
|
|
217
217
|
);
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}, [f]),
|
|
221
|
-
pe.current =
|
|
222
|
-
}, [w,
|
|
218
|
+
m(() => {
|
|
219
|
+
me.current = f;
|
|
220
|
+
}, [f]), m(() => {
|
|
221
|
+
pe.current = O ? z : w;
|
|
222
|
+
}, [w, z, O]), m(() => {
|
|
223
223
|
Ve || ue(!1);
|
|
224
|
-
}, [Ve]),
|
|
224
|
+
}, [Ve]), m(() => {
|
|
225
225
|
!ht.current && Te && ue(!1), ht.current = Te;
|
|
226
|
-
}, [Te]),
|
|
227
|
-
k.current =
|
|
228
|
-
}, [
|
|
229
|
-
const e = f?.audioUrl, t =
|
|
226
|
+
}, [Te]), m(() => {
|
|
227
|
+
k.current = B;
|
|
228
|
+
}, [B]), m(() => {
|
|
229
|
+
const e = f?.audioUrl, t = l >= 0 ? d[l + 1]?.audioUrl : void 0;
|
|
230
230
|
Yt(e), Yt(t);
|
|
231
|
-
}, [
|
|
232
|
-
const
|
|
231
|
+
}, [d, f?.audioUrl, l]);
|
|
232
|
+
const a = u(
|
|
233
233
|
(e, t = null) => {
|
|
234
234
|
gt.current === e && (!e || t === null) || (gt.current = e, qe?.({
|
|
235
235
|
loading: e,
|
|
@@ -237,25 +237,25 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
237
237
|
}));
|
|
238
238
|
},
|
|
239
239
|
[qe]
|
|
240
|
-
),
|
|
240
|
+
), $ = u(
|
|
241
241
|
(e) => {
|
|
242
242
|
pe.current = e, et?.(e);
|
|
243
243
|
},
|
|
244
244
|
[et]
|
|
245
|
-
),
|
|
245
|
+
), ee = u(() => O ? {
|
|
246
246
|
shouldContinuePlayback: pe.current
|
|
247
247
|
} : {
|
|
248
248
|
shouldContinuePlayback: Ir({
|
|
249
249
|
defaultPlaying: pe.current,
|
|
250
250
|
isPausedByUser: v.current
|
|
251
251
|
})
|
|
252
|
-
}, [
|
|
252
|
+
}, [O]), Wt = u((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), J = u(() => w && !T && !v.current && V.current !== "blocked", [w, T]), Ot = u((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), Rt = u(() => {
|
|
253
253
|
const e = h.current;
|
|
254
254
|
return e == null || e <= 0 ? 0 : k.current.slice(0, e).reduce(
|
|
255
255
|
(t, r) => t + Math.max(Number(r.duration_ms ?? 0), 0),
|
|
256
256
|
0
|
|
257
257
|
) / 1e3;
|
|
258
|
-
}, []),
|
|
258
|
+
}, []), te = u((e) => e <= 0 ? 0 : k.current.slice(0, e).reduce(
|
|
259
259
|
(t, r) => t + Math.max(Number(r.duration_ms ?? 0), 0),
|
|
260
260
|
0
|
|
261
261
|
), []), Ke = u(
|
|
@@ -266,23 +266,23 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
266
266
|
[T]
|
|
267
267
|
), Se = u(
|
|
268
268
|
(e, t, r = {}) => {
|
|
269
|
-
const n =
|
|
270
|
-
currentAudioIndex:
|
|
269
|
+
const n = Hr({
|
|
270
|
+
currentAudioIndex: l,
|
|
271
271
|
currentTimeMs: t,
|
|
272
272
|
direction: e,
|
|
273
273
|
excludeTarget: r.excludeTarget,
|
|
274
274
|
tracks: vt
|
|
275
275
|
});
|
|
276
276
|
return !n || !Ke(
|
|
277
|
-
|
|
277
|
+
d[n.audioIndex],
|
|
278
278
|
n.timeMs
|
|
279
|
-
) || n.audioIndex !==
|
|
279
|
+
) || n.audioIndex !== l && (!we || Be && !Be(n)) ? null : n;
|
|
280
280
|
},
|
|
281
281
|
[
|
|
282
|
-
|
|
282
|
+
d,
|
|
283
283
|
Be,
|
|
284
284
|
Ke,
|
|
285
|
-
|
|
285
|
+
l,
|
|
286
286
|
we,
|
|
287
287
|
vt
|
|
288
288
|
]
|
|
@@ -302,111 +302,111 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
302
302
|
},
|
|
303
303
|
[Se]
|
|
304
304
|
);
|
|
305
|
-
|
|
305
|
+
m(() => {
|
|
306
306
|
St.current = Ze, Ze(Ae.current, !0);
|
|
307
307
|
}, [Ze]);
|
|
308
|
-
const
|
|
308
|
+
const P = u(() => {
|
|
309
309
|
const e = g.current;
|
|
310
|
-
return e ?
|
|
311
|
-
}, [
|
|
312
|
-
|
|
310
|
+
return e ? W.current === "segment" ? te(F.current) + Math.max(e.currentTime, 0) * 1e3 : x.current !== null && e.readyState === 0 ? x.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : h.current != null ? te(h.current) : 0;
|
|
311
|
+
}, [te]);
|
|
312
|
+
m(() => {
|
|
313
313
|
_t.current = ne;
|
|
314
|
-
}, [ne]),
|
|
315
|
-
Mt.current =
|
|
316
|
-
}, [
|
|
317
|
-
const
|
|
314
|
+
}, [ne]), m(() => {
|
|
315
|
+
Mt.current = P;
|
|
316
|
+
}, [P]);
|
|
317
|
+
const K = u(
|
|
318
318
|
(e) => {
|
|
319
319
|
const t = Math.max(e, 0);
|
|
320
|
-
Ae.current !== t && (Ae.current = t,
|
|
321
|
-
currentAudioIndex:
|
|
320
|
+
Ae.current !== t && (Ae.current = t, Dr({
|
|
321
|
+
currentAudioIndex: l,
|
|
322
322
|
currentTimeMs: t,
|
|
323
323
|
target: ge.current
|
|
324
324
|
}) && (ge.current = null), be?.(t), St.current(t));
|
|
325
325
|
},
|
|
326
|
-
[
|
|
326
|
+
[l, be]
|
|
327
327
|
), y = u(() => {
|
|
328
|
-
|
|
329
|
-
}, [
|
|
328
|
+
K(P());
|
|
329
|
+
}, [P, K]), Z = u(
|
|
330
330
|
(e = !1, t = !1) => {
|
|
331
331
|
const r = Le.current;
|
|
332
332
|
if (!ne || !r)
|
|
333
333
|
return;
|
|
334
334
|
const n = Date.now();
|
|
335
|
-
!e && n - bt.current < 5e3 || (bt.current = n,
|
|
335
|
+
!e && n - bt.current < 5e3 || (bt.current = n, He.current = t, ne({
|
|
336
336
|
audioKey: r,
|
|
337
337
|
isComplete: t,
|
|
338
|
-
timeMs:
|
|
338
|
+
timeMs: P()
|
|
339
339
|
}));
|
|
340
340
|
},
|
|
341
|
-
[
|
|
341
|
+
[P, ne]
|
|
342
342
|
);
|
|
343
|
-
|
|
343
|
+
m(
|
|
344
344
|
() => () => {
|
|
345
|
-
|
|
345
|
+
He.current || _t.current?.({
|
|
346
346
|
audioKey: Le.current ?? "none",
|
|
347
347
|
isComplete: !1,
|
|
348
348
|
timeMs: Mt.current()
|
|
349
349
|
});
|
|
350
350
|
},
|
|
351
351
|
[]
|
|
352
|
-
),
|
|
353
|
-
|
|
354
|
-
}, [
|
|
352
|
+
), m(() => {
|
|
353
|
+
He.current = !1;
|
|
354
|
+
}, [l]);
|
|
355
355
|
const M = u(() => {
|
|
356
|
-
typeof window > "u" ||
|
|
356
|
+
typeof window > "u" || G.current === null || (window.cancelAnimationFrame(G.current), G.current = null);
|
|
357
357
|
}, []), Vt = u(() => {
|
|
358
|
-
if (typeof window > "u" ||
|
|
358
|
+
if (typeof window > "u" || G.current !== null)
|
|
359
359
|
return;
|
|
360
360
|
const e = () => {
|
|
361
361
|
y();
|
|
362
362
|
const t = g.current;
|
|
363
363
|
if (!t || t.paused || t.ended) {
|
|
364
|
-
|
|
364
|
+
G.current = null;
|
|
365
365
|
return;
|
|
366
366
|
}
|
|
367
|
-
|
|
367
|
+
G.current = window.requestAnimationFrame(e);
|
|
368
368
|
};
|
|
369
|
-
|
|
370
|
-
}, [y]),
|
|
369
|
+
G.current = window.requestAnimationFrame(e);
|
|
370
|
+
}, [y]), le = u(() => {
|
|
371
371
|
const e = g.current;
|
|
372
|
-
e && (M(), c.current = !1, v.current = !1, he.current = !1,
|
|
373
|
-
}, [
|
|
372
|
+
e && (M(), c.current = !1, v.current = !1, he.current = !1, W.current = null, x.current = null, E.current = !1, U.current = !1, Y.current = null, e.pause(), e.removeAttribute("src"), e.load(), R.current = null, F.current = 0, h.current = null, K(0), S(!1), a(!1));
|
|
373
|
+
}, [K, M, a]), L = u(
|
|
374
374
|
(e) => {
|
|
375
375
|
const t = g.current;
|
|
376
376
|
if (!t)
|
|
377
377
|
return !1;
|
|
378
378
|
const r = t.play();
|
|
379
379
|
return r && typeof r.then == "function" && r.then(() => {
|
|
380
|
-
V.current === "unknown" && (V.current = "auto"), c.current = !1,
|
|
380
|
+
V.current === "unknown" && (V.current = "auto"), c.current = !1, U.current = !1;
|
|
381
381
|
}).catch((n) => {
|
|
382
|
-
V.current === "unknown" && Wt(n) && (V.current = "blocked", c.current = !1,
|
|
382
|
+
V.current === "unknown" && Wt(n) && (V.current = "blocked", c.current = !1, a(!1)), U.current = !1, S(!1);
|
|
383
383
|
}), !0;
|
|
384
384
|
},
|
|
385
|
-
[Wt,
|
|
385
|
+
[Wt, a]
|
|
386
386
|
), C = u(
|
|
387
387
|
(e, t, r = {}) => {
|
|
388
388
|
const n = g.current, b = k.current[e];
|
|
389
389
|
if (!n || !b)
|
|
390
390
|
return !1;
|
|
391
|
-
const
|
|
391
|
+
const re = Ot(b.audio_data), Ye = Math.max(
|
|
392
392
|
Number(r.seekTimeSeconds ?? 0),
|
|
393
393
|
0
|
|
394
394
|
);
|
|
395
|
-
|
|
396
|
-
|
|
395
|
+
F.current = e, h.current = null, E.current = !1, U.current = !0, Y.current = "segment", K(
|
|
396
|
+
te(e) + Ye * 1e3
|
|
397
397
|
);
|
|
398
|
-
const
|
|
399
|
-
c.current =
|
|
400
|
-
const br = R.current !==
|
|
401
|
-
return
|
|
398
|
+
const Jt = r.shouldResume ?? J();
|
|
399
|
+
c.current = Jt, a(!1);
|
|
400
|
+
const br = R.current !== re;
|
|
401
|
+
return W.current = "segment", br && (n.pause(), n.removeAttribute("src"), n.load(), R.current = re, n.src = re, n.load()), x.current = Ye, n.readyState > 0 && (n.currentTime = Ye, x.current = null), Jt ? L(`start-segment:${t}`) : (c.current = !1, U.current = !1, n.pause(), S(!1), !0);
|
|
402
402
|
},
|
|
403
403
|
[
|
|
404
|
-
|
|
404
|
+
J,
|
|
405
405
|
Ot,
|
|
406
|
-
|
|
407
|
-
|
|
406
|
+
te,
|
|
407
|
+
K,
|
|
408
408
|
L,
|
|
409
|
-
|
|
409
|
+
a
|
|
410
410
|
]
|
|
411
411
|
), ie = u(
|
|
412
412
|
(e, t) => {
|
|
@@ -414,22 +414,22 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
414
414
|
if (!r)
|
|
415
415
|
return !1;
|
|
416
416
|
const n = Math.max(Number(t), 0) / 1e3;
|
|
417
|
-
return R.current !== e && (r.pause(), r.removeAttribute("src"), r.load(), R.current = e,
|
|
417
|
+
return R.current !== e && (r.pause(), r.removeAttribute("src"), r.load(), R.current = e, W.current = "url", Y.current = "url", r.src = e, r.load()), x.current = n, K(n * 1e3), r.readyState > 0 && (r.currentTime = n, x.current = null), !0;
|
|
418
418
|
},
|
|
419
|
-
[
|
|
419
|
+
[K]
|
|
420
420
|
), Fe = u(
|
|
421
421
|
(e) => {
|
|
422
422
|
const t = g.current;
|
|
423
423
|
if (!t || !f || T)
|
|
424
424
|
return !1;
|
|
425
|
-
const r = Math.max(Number(e), 0), n = !t.paused && !t.ended || c.current ||
|
|
425
|
+
const r = Math.max(Number(e), 0), n = !t.paused && !t.ended || c.current || U.current || h.current !== null && pe.current && !v.current, b = Xe(
|
|
426
426
|
k.current,
|
|
427
427
|
r
|
|
428
428
|
) ? Zt(
|
|
429
429
|
k.current,
|
|
430
430
|
r
|
|
431
431
|
) : null;
|
|
432
|
-
return Ce.current = null, M(), c.current = n,
|
|
432
|
+
return Ce.current = null, M(), c.current = n, a(!1), n && (V.current = "manual", v.current = !1, $(!0)), b && (W.current === "segment" || !A) ? C(
|
|
433
433
|
b.segmentIndex,
|
|
434
434
|
"subtitle-seek-segment",
|
|
435
435
|
{
|
|
@@ -446,8 +446,8 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
446
446
|
C,
|
|
447
447
|
M,
|
|
448
448
|
L,
|
|
449
|
-
|
|
450
|
-
|
|
449
|
+
a,
|
|
450
|
+
$
|
|
451
451
|
]
|
|
452
452
|
), It = u(
|
|
453
453
|
(e) => {
|
|
@@ -460,7 +460,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
460
460
|
k.current,
|
|
461
461
|
r
|
|
462
462
|
) : null;
|
|
463
|
-
return c.current = !0,
|
|
463
|
+
return c.current = !0, a(!1), n && (W.current === "segment" || !A) ? C(n.segmentIndex, "restore", {
|
|
464
464
|
seekTimeSeconds: n.segmentTimeSeconds,
|
|
465
465
|
shouldResume: !0
|
|
466
466
|
}) : !A || !ie(A, r) ? !1 : (L("restore"), !0);
|
|
@@ -471,111 +471,111 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
471
471
|
ie,
|
|
472
472
|
C,
|
|
473
473
|
L,
|
|
474
|
-
|
|
474
|
+
a
|
|
475
475
|
]
|
|
476
476
|
), ye = u(
|
|
477
477
|
(e) => {
|
|
478
478
|
const t = Se(
|
|
479
479
|
e,
|
|
480
|
-
|
|
480
|
+
P(),
|
|
481
481
|
{
|
|
482
482
|
excludeTarget: e === "previous" ? ge.current : null
|
|
483
483
|
}
|
|
484
484
|
);
|
|
485
485
|
if (t === null)
|
|
486
486
|
return !1;
|
|
487
|
-
if (t.audioIndex ===
|
|
487
|
+
if (t.audioIndex === l) {
|
|
488
488
|
const n = Fe(t.timeMs);
|
|
489
489
|
return n && (ge.current = t), n;
|
|
490
490
|
}
|
|
491
491
|
const r = !!we?.(
|
|
492
492
|
t,
|
|
493
|
-
Qe(
|
|
493
|
+
Qe(ee())
|
|
494
494
|
);
|
|
495
495
|
return r && (ge.current = t), r;
|
|
496
496
|
},
|
|
497
497
|
[
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
498
|
+
l,
|
|
499
|
+
P,
|
|
500
|
+
ee,
|
|
501
501
|
Se,
|
|
502
502
|
we,
|
|
503
503
|
Fe
|
|
504
504
|
]
|
|
505
505
|
), se = u(
|
|
506
506
|
(e) => {
|
|
507
|
-
M(), c.current = !1,
|
|
507
|
+
M(), c.current = !1, E.current = !1, U.current = !1, y(), S(!1), a(!1), l >= 0 && ut?.(l);
|
|
508
508
|
},
|
|
509
509
|
[
|
|
510
|
-
|
|
510
|
+
l,
|
|
511
511
|
ut,
|
|
512
512
|
M,
|
|
513
513
|
y,
|
|
514
|
-
|
|
514
|
+
a
|
|
515
515
|
]
|
|
516
516
|
), Ue = u(
|
|
517
517
|
(e) => {
|
|
518
518
|
const t = g.current;
|
|
519
|
-
return !t ||
|
|
519
|
+
return !t || W.current !== "url" || !Kr({
|
|
520
520
|
currentTimeSeconds: Math.max(t.currentTime, 0),
|
|
521
521
|
durationSeconds: t.duration
|
|
522
522
|
}) ? !1 : (c.current = !1, t.pause(), se(e), !0);
|
|
523
523
|
},
|
|
524
524
|
[se]
|
|
525
|
-
),
|
|
526
|
-
const e =
|
|
525
|
+
), $t = u(() => {
|
|
526
|
+
const e = F.current + 1, t = k.current, r = t[e], n = me.current, b = t.some((re) => re.is_final);
|
|
527
527
|
if (r) {
|
|
528
528
|
C(e, "ended");
|
|
529
529
|
return;
|
|
530
530
|
}
|
|
531
531
|
if (n?.isAudioStreaming || !b) {
|
|
532
|
-
|
|
532
|
+
F.current = e, h.current = e, E.current = !0, c.current = w, K(te(e)), S(!1), a(!0, "waitingForMoreAudio");
|
|
533
533
|
return;
|
|
534
534
|
}
|
|
535
535
|
se("segments-completed");
|
|
536
536
|
}, [
|
|
537
537
|
w,
|
|
538
538
|
se,
|
|
539
|
-
|
|
540
|
-
|
|
539
|
+
te,
|
|
540
|
+
K,
|
|
541
541
|
C,
|
|
542
|
-
|
|
542
|
+
a
|
|
543
543
|
]);
|
|
544
|
-
|
|
545
|
-
if (Le.current ===
|
|
544
|
+
m(() => {
|
|
545
|
+
if (Le.current === Pe)
|
|
546
546
|
return;
|
|
547
|
-
|
|
547
|
+
Z(!0), Le.current = Pe, F.current = 0, h.current = null, E.current = !1, v.current = !1, he.current = !1, c.current = !1, U.current = !1, W.current = null, Y.current = null, R.current = null, M(), K(0), a(!1);
|
|
548
548
|
const e = g.current;
|
|
549
|
-
e && (
|
|
549
|
+
e && (De.current = !0, e.pause(), e.removeAttribute("src"), e.load(), De.current = !1, S(!1));
|
|
550
550
|
}, [
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
551
|
+
l,
|
|
552
|
+
Pe,
|
|
553
|
+
B.length,
|
|
554
554
|
A,
|
|
555
|
-
|
|
556
|
-
|
|
555
|
+
Z,
|
|
556
|
+
K,
|
|
557
557
|
M,
|
|
558
|
-
|
|
559
|
-
]),
|
|
558
|
+
a
|
|
559
|
+
]), m(() => {
|
|
560
560
|
const e = g.current;
|
|
561
561
|
if (e) {
|
|
562
562
|
if (T) {
|
|
563
|
-
he.current = !!(
|
|
563
|
+
he.current = !!(me.current && !v.current && (!e.paused || c.current || h.current !== null)), c.current = !1, a(!1), e.pause(), S(!1);
|
|
564
564
|
return;
|
|
565
565
|
}
|
|
566
|
-
if (!(!he.current || !
|
|
566
|
+
if (!(!he.current || !me.current || v.current)) {
|
|
567
567
|
if (he.current = !1, h.current !== null) {
|
|
568
568
|
if (h.current < k.current.length) {
|
|
569
569
|
C(h.current, "external-resume");
|
|
570
570
|
return;
|
|
571
571
|
}
|
|
572
|
-
c.current = !0,
|
|
572
|
+
c.current = !0, a(!0, "waitingForMoreAudio");
|
|
573
573
|
return;
|
|
574
574
|
}
|
|
575
575
|
if (!R.current && k.current.length > 0) {
|
|
576
576
|
C(
|
|
577
577
|
Math.min(
|
|
578
|
-
|
|
578
|
+
F.current,
|
|
579
579
|
k.current.length - 1
|
|
580
580
|
),
|
|
581
581
|
"external-resume-init"
|
|
@@ -589,35 +589,35 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
589
589
|
T,
|
|
590
590
|
C,
|
|
591
591
|
L,
|
|
592
|
-
|
|
593
|
-
]),
|
|
592
|
+
a
|
|
593
|
+
]), m(() => {
|
|
594
594
|
const e = g.current;
|
|
595
595
|
if (!e)
|
|
596
596
|
return;
|
|
597
597
|
if (!f) {
|
|
598
|
-
|
|
598
|
+
le();
|
|
599
599
|
return;
|
|
600
600
|
}
|
|
601
|
-
if (_ && _.id !==
|
|
601
|
+
if (_ && _.id !== Q.current)
|
|
602
602
|
return;
|
|
603
603
|
if (T) {
|
|
604
|
-
c.current = !1,
|
|
604
|
+
c.current = !1, a(!1), e.pause(), S(!1);
|
|
605
605
|
return;
|
|
606
606
|
}
|
|
607
607
|
const t = Vr({
|
|
608
|
-
activeSourceType:
|
|
608
|
+
activeSourceType: W.current,
|
|
609
609
|
hasAudioUrl: !!A,
|
|
610
|
-
segmentCount:
|
|
611
|
-
preferredSourceType:
|
|
610
|
+
segmentCount: B.length,
|
|
611
|
+
preferredSourceType: Y.current,
|
|
612
612
|
waitingSegmentIndex: h.current
|
|
613
613
|
});
|
|
614
|
-
if (t &&
|
|
615
|
-
const r = R.current !== A, n =
|
|
614
|
+
if (t && Y.current !== t && (Y.current = t), t === "url" && A) {
|
|
615
|
+
const r = R.current !== A, n = J();
|
|
616
616
|
if (r) {
|
|
617
617
|
const b = h.current !== null ? Rt() : 0;
|
|
618
618
|
ie(A, b * 1e3);
|
|
619
619
|
}
|
|
620
|
-
if (c.current = n,
|
|
620
|
+
if (c.current = n, E.current = !1, U.current = !1, a(!1), !n) {
|
|
621
621
|
c.current = !1, e.pause(), S(!1);
|
|
622
622
|
return;
|
|
623
623
|
}
|
|
@@ -625,37 +625,37 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
625
625
|
return;
|
|
626
626
|
}
|
|
627
627
|
if (t === "segment" && h.current !== null) {
|
|
628
|
-
if (h.current <
|
|
628
|
+
if (h.current < B.length) {
|
|
629
629
|
if (v.current) {
|
|
630
|
-
S(!1),
|
|
630
|
+
S(!1), a(!1);
|
|
631
631
|
return;
|
|
632
632
|
}
|
|
633
633
|
C(h.current, "wait-resume");
|
|
634
634
|
return;
|
|
635
635
|
}
|
|
636
|
-
|
|
636
|
+
E.current = !0, c.current = J(), S(!1), a(J());
|
|
637
637
|
return;
|
|
638
638
|
}
|
|
639
|
-
if (t === "segment" && !
|
|
639
|
+
if (t === "segment" && !B.length) {
|
|
640
640
|
if (f.isAudioStreaming) {
|
|
641
|
-
h.current =
|
|
641
|
+
h.current = F.current, E.current = !0, c.current = J(), S(!1), a(J());
|
|
642
642
|
return;
|
|
643
643
|
}
|
|
644
|
-
|
|
644
|
+
le();
|
|
645
645
|
return;
|
|
646
646
|
}
|
|
647
647
|
if (t === "segment" && !R.current) {
|
|
648
648
|
C(
|
|
649
649
|
Math.min(
|
|
650
|
-
|
|
651
|
-
|
|
650
|
+
F.current,
|
|
651
|
+
B.length - 1
|
|
652
652
|
),
|
|
653
653
|
"effect-init"
|
|
654
654
|
);
|
|
655
655
|
return;
|
|
656
656
|
}
|
|
657
657
|
if (t !== "segment") {
|
|
658
|
-
|
|
658
|
+
le();
|
|
659
659
|
return;
|
|
660
660
|
}
|
|
661
661
|
if (!w || v.current) {
|
|
@@ -665,201 +665,201 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
665
665
|
e.paused && (c.current = !0, L("sync-paused-retry"));
|
|
666
666
|
}, [
|
|
667
667
|
f,
|
|
668
|
-
|
|
669
|
-
|
|
668
|
+
l,
|
|
669
|
+
B,
|
|
670
670
|
A,
|
|
671
671
|
w,
|
|
672
672
|
T,
|
|
673
673
|
_,
|
|
674
|
-
|
|
675
|
-
|
|
674
|
+
J,
|
|
675
|
+
le,
|
|
676
676
|
ie,
|
|
677
677
|
C,
|
|
678
678
|
L,
|
|
679
679
|
Rt,
|
|
680
|
-
|
|
681
|
-
]),
|
|
682
|
-
if (
|
|
680
|
+
a
|
|
681
|
+
]), m(() => {
|
|
682
|
+
if (!D || D.id === yt.current || D.audioIndex !== l)
|
|
683
683
|
return;
|
|
684
|
-
const e =
|
|
685
|
-
Ke(e,
|
|
684
|
+
const e = d[D.audioIndex];
|
|
685
|
+
Ke(e, D.timeMs) && (yt.current = D.id, Fe(D.timeMs));
|
|
686
686
|
}, [
|
|
687
|
-
|
|
687
|
+
d,
|
|
688
688
|
Ke,
|
|
689
|
-
|
|
689
|
+
l,
|
|
690
690
|
Fe,
|
|
691
|
-
|
|
692
|
-
]),
|
|
693
|
-
if (!(!_ || _.id ===
|
|
691
|
+
D
|
|
692
|
+
]), m(() => {
|
|
693
|
+
if (!(!_ || _.id === Q.current || l < 0)) {
|
|
694
694
|
if (It(_.timeMs)) {
|
|
695
|
-
|
|
695
|
+
Q.current = _.id, oe?.(_.id);
|
|
696
696
|
return;
|
|
697
697
|
}
|
|
698
|
-
f?.isAudioStreaming || (
|
|
698
|
+
f?.isAudioStreaming || (Q.current = _.id, oe?.(_.id));
|
|
699
699
|
}
|
|
700
700
|
}, [
|
|
701
701
|
f?.isAudioStreaming,
|
|
702
|
-
|
|
702
|
+
l,
|
|
703
703
|
oe,
|
|
704
704
|
_,
|
|
705
705
|
It
|
|
706
|
-
]),
|
|
707
|
-
if (!_ || _.id ===
|
|
706
|
+
]), m(() => {
|
|
707
|
+
if (!_ || _.id === Q.current || l < 0 || !f?.isAudioStreaming)
|
|
708
708
|
return;
|
|
709
709
|
const e = window.setTimeout(() => {
|
|
710
|
-
_.id !==
|
|
711
|
-
},
|
|
710
|
+
_.id !== Q.current && (Q.current = _.id, oe?.(_.id));
|
|
711
|
+
}, an);
|
|
712
712
|
return () => {
|
|
713
713
|
window.clearTimeout(e);
|
|
714
714
|
};
|
|
715
715
|
}, [
|
|
716
716
|
f?.isAudioStreaming,
|
|
717
|
-
|
|
717
|
+
l,
|
|
718
718
|
oe,
|
|
719
719
|
_
|
|
720
|
-
]),
|
|
720
|
+
]), m(() => le, [le]), m(() => M, [M]);
|
|
721
721
|
const cr = u(() => {
|
|
722
|
-
y(), Vt(), S(!0),
|
|
722
|
+
y(), Vt(), S(!0), a(!1), tt?.();
|
|
723
723
|
}, [
|
|
724
724
|
tt,
|
|
725
725
|
Vt,
|
|
726
726
|
y,
|
|
727
|
-
|
|
727
|
+
a
|
|
728
728
|
]), or = u(() => {
|
|
729
|
-
|
|
730
|
-
}, [
|
|
729
|
+
De.current || E.current || U.current || (M(), y(), Z(!0), S(!1));
|
|
730
|
+
}, [Z, M, y]), fr = u(() => {
|
|
731
731
|
const e = g.current;
|
|
732
732
|
e && x.current !== null && (e.currentTime = x.current, x.current = null), y(), !Ue("canplay-seek-finished") && (!c.current || !w || L("canplay"));
|
|
733
733
|
}, [
|
|
734
|
-
|
|
734
|
+
l,
|
|
735
735
|
w,
|
|
736
736
|
Ue,
|
|
737
737
|
y,
|
|
738
738
|
L
|
|
739
|
-
]),
|
|
739
|
+
]), dr = u(() => {
|
|
740
740
|
const e = g.current;
|
|
741
741
|
e && x.current !== null && (e.currentTime = x.current, x.current = null), y(), Ue("metadata-seek-finished");
|
|
742
|
-
}, [
|
|
743
|
-
y(),
|
|
744
|
-
}, [
|
|
745
|
-
|
|
746
|
-
}, [
|
|
747
|
-
if (
|
|
748
|
-
|
|
742
|
+
}, [l, Ue, y]), mr = u(() => {
|
|
743
|
+
y(), Z();
|
|
744
|
+
}, [Z, y]), pr = u(() => {
|
|
745
|
+
E.current || a(!0, "loadingAudio");
|
|
746
|
+
}, [a]), hr = u(() => {
|
|
747
|
+
if (E.current) {
|
|
748
|
+
a(!0, "waitingForMoreAudio");
|
|
749
749
|
return;
|
|
750
750
|
}
|
|
751
|
-
|
|
752
|
-
}, [
|
|
751
|
+
a(!0, "loadingAudio");
|
|
752
|
+
}, [a]), Ht = u(() => {
|
|
753
753
|
y();
|
|
754
754
|
}, [y]), gr = u(() => {
|
|
755
|
-
const e =
|
|
756
|
-
(
|
|
755
|
+
const e = me.current, t = W.current === "url" || k.current.length === 0, r = !!k.current[F.current + 1], n = k.current.some(
|
|
756
|
+
(re) => re.is_final
|
|
757
757
|
), b = !!e?.isAudioStreaming;
|
|
758
|
-
if (
|
|
758
|
+
if (Z(
|
|
759
759
|
!0,
|
|
760
760
|
t || !b && !r && n
|
|
761
|
-
), M(),
|
|
761
|
+
), M(), U.current = !1, t) {
|
|
762
762
|
se("url-ended");
|
|
763
763
|
return;
|
|
764
764
|
}
|
|
765
|
-
|
|
765
|
+
$t();
|
|
766
766
|
}, [
|
|
767
|
-
|
|
767
|
+
Z,
|
|
768
768
|
se,
|
|
769
|
-
|
|
769
|
+
$t,
|
|
770
770
|
M
|
|
771
771
|
]), Sr = u(() => {
|
|
772
|
-
M(), y(), S(!1),
|
|
773
|
-
}, [M, y,
|
|
772
|
+
M(), y(), S(!1), a(!1);
|
|
773
|
+
}, [M, y, a]), yr = u(
|
|
774
774
|
(e) => {
|
|
775
775
|
nt?.(e), ue(!1);
|
|
776
776
|
},
|
|
777
777
|
[nt]
|
|
778
778
|
), je = u(() => {
|
|
779
|
-
if (
|
|
780
|
-
const t = !
|
|
781
|
-
return
|
|
779
|
+
if (O) {
|
|
780
|
+
const t = !z;
|
|
781
|
+
return $(t), at?.(t), !0;
|
|
782
782
|
}
|
|
783
783
|
const e = g.current;
|
|
784
|
-
return T || !e || !f ? !1 : h.current !== null ? xe ? (
|
|
784
|
+
return T || !e || !f ? !1 : h.current !== null ? xe ? ($(!1), c.current = !1, v.current = !0, h.current = null, E.current = !1, S(!1), a(!1), e.pause(), !0) : ($(!0), V.current = "manual", v.current = !1, c.current = !0, a(!0, "waitingForMoreAudio"), !0) : !e.src && B.length > 0 ? ($(!0), V.current = "manual", v.current = !1, C(
|
|
785
785
|
Math.min(
|
|
786
|
-
|
|
787
|
-
|
|
786
|
+
F.current,
|
|
787
|
+
B.length - 1
|
|
788
788
|
),
|
|
789
789
|
"toggle"
|
|
790
|
-
), !0) : e.paused ? (
|
|
790
|
+
), !0) : e.paused ? ($(!0), V.current = "manual", v.current = !1, c.current = !0, L("toggle-resume"), !0) : ($(!1), c.current = !1, v.current = !0, e.pause(), !0);
|
|
791
791
|
}, [
|
|
792
792
|
f,
|
|
793
|
-
|
|
794
|
-
|
|
793
|
+
B.length,
|
|
794
|
+
z,
|
|
795
795
|
T,
|
|
796
796
|
xe,
|
|
797
|
-
|
|
797
|
+
at,
|
|
798
798
|
C,
|
|
799
799
|
L,
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
800
|
+
a,
|
|
801
|
+
$,
|
|
802
|
+
O
|
|
803
803
|
]);
|
|
804
|
-
|
|
804
|
+
m(() => {
|
|
805
805
|
if (I)
|
|
806
|
-
return Br(
|
|
807
|
-
}, [
|
|
806
|
+
return Br(X);
|
|
807
|
+
}, [X, I]);
|
|
808
808
|
const ze = ce(
|
|
809
809
|
() => ({
|
|
810
|
-
fullscreen: () =>
|
|
810
|
+
fullscreen: () => de ? (de(), !0) : !1,
|
|
811
811
|
next: () => Me ? (Re || Me(
|
|
812
|
-
Qe(
|
|
812
|
+
Qe(ee())
|
|
813
813
|
), !0) : !1,
|
|
814
|
-
nextSubtitle: () =>
|
|
814
|
+
nextSubtitle: () => ae.next ? ye("next") : !0,
|
|
815
815
|
previous: () => _e ? (Oe || _e(
|
|
816
|
-
Qe(
|
|
816
|
+
Qe(ee())
|
|
817
817
|
), !0) : !1,
|
|
818
|
-
previousSubtitle: () =>
|
|
818
|
+
previousSubtitle: () => ae.previous ? ye("previous") : !0,
|
|
819
819
|
subtitle: () => fe ? (fe(), !0) : !1,
|
|
820
820
|
togglePlayback: () => (je(), !0)
|
|
821
821
|
}),
|
|
822
822
|
[
|
|
823
|
-
|
|
823
|
+
ee,
|
|
824
824
|
ye,
|
|
825
825
|
Re,
|
|
826
|
-
|
|
826
|
+
de,
|
|
827
827
|
Me,
|
|
828
828
|
_e,
|
|
829
829
|
fe,
|
|
830
830
|
Oe,
|
|
831
|
-
|
|
832
|
-
|
|
831
|
+
ae.next,
|
|
832
|
+
ae.previous,
|
|
833
833
|
je
|
|
834
834
|
]
|
|
835
|
-
),
|
|
836
|
-
return
|
|
837
|
-
|
|
838
|
-
}, [ze]),
|
|
835
|
+
), Dt = i(ze);
|
|
836
|
+
return m(() => {
|
|
837
|
+
Dt.current = ze;
|
|
838
|
+
}, [ze]), m(() => {
|
|
839
839
|
if (!I || typeof document > "u")
|
|
840
840
|
return;
|
|
841
841
|
const e = (t) => {
|
|
842
|
-
if (!Wr(
|
|
842
|
+
if (!Wr(X))
|
|
843
843
|
return;
|
|
844
844
|
const r = Or(t, pt());
|
|
845
845
|
if (!r || Rr(t, r))
|
|
846
846
|
return;
|
|
847
847
|
let n = !1;
|
|
848
|
-
const b =
|
|
848
|
+
const b = Dt.current[r];
|
|
849
849
|
n = b(), n && t.preventDefault();
|
|
850
850
|
};
|
|
851
851
|
return document.addEventListener("keydown", e), () => {
|
|
852
852
|
document.removeEventListener("keydown", e);
|
|
853
853
|
};
|
|
854
|
-
}, [
|
|
854
|
+
}, [X, pt, I]), m(() => {
|
|
855
855
|
be?.(Ae.current);
|
|
856
|
-
}, [be]), /* @__PURE__ */
|
|
856
|
+
}, [be]), /* @__PURE__ */ H(
|
|
857
857
|
"div",
|
|
858
858
|
{
|
|
859
859
|
...Ie,
|
|
860
|
-
dir:
|
|
860
|
+
dir: $e,
|
|
861
861
|
lang: ft,
|
|
862
|
-
"data-slide-player-shortcut-owner":
|
|
862
|
+
"data-slide-player-shortcut-owner": X,
|
|
863
863
|
className: Cr("slide-player", p),
|
|
864
864
|
onFocusCapture: sr,
|
|
865
865
|
onPointerDown: ir,
|
|
@@ -871,24 +871,24 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
871
871
|
preload: "auto",
|
|
872
872
|
playsInline: !0,
|
|
873
873
|
onLoadStart: pr,
|
|
874
|
-
onLoadedMetadata:
|
|
874
|
+
onLoadedMetadata: dr,
|
|
875
875
|
onCanPlay: fr,
|
|
876
876
|
onPlay: cr,
|
|
877
877
|
onPause: or,
|
|
878
878
|
onWaiting: hr,
|
|
879
|
-
onSeeking:
|
|
880
|
-
onSeeked:
|
|
881
|
-
onTimeUpdate:
|
|
879
|
+
onSeeking: Ht,
|
|
880
|
+
onSeeked: Ht,
|
|
881
|
+
onTimeUpdate: mr,
|
|
882
882
|
onEnded: gr,
|
|
883
883
|
onError: Sr
|
|
884
884
|
}
|
|
885
885
|
),
|
|
886
|
-
Ve ? /* @__PURE__ */
|
|
886
|
+
Ve ? /* @__PURE__ */ H(Pt, { children: [
|
|
887
887
|
/* @__PURE__ */ s(
|
|
888
888
|
xr,
|
|
889
889
|
{
|
|
890
890
|
container: Qt,
|
|
891
|
-
dir:
|
|
891
|
+
dir: $e ?? mt,
|
|
892
892
|
lang: rr,
|
|
893
893
|
labels: {
|
|
894
894
|
closeSettings: o.closeSettingsLabel,
|
|
@@ -910,15 +910,15 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
910
910
|
viewMode: Gt
|
|
911
911
|
}
|
|
912
912
|
),
|
|
913
|
-
/* @__PURE__ */
|
|
913
|
+
/* @__PURE__ */ H(
|
|
914
914
|
"div",
|
|
915
915
|
{
|
|
916
916
|
className: "slide-player__controls",
|
|
917
917
|
onPointerEnter: Xt,
|
|
918
918
|
onPointerLeave: qt,
|
|
919
|
-
style:
|
|
919
|
+
style: ar,
|
|
920
920
|
children: [
|
|
921
|
-
/* @__PURE__ */
|
|
921
|
+
/* @__PURE__ */ H("div", { className: "slide-player__group", children: [
|
|
922
922
|
/* @__PURE__ */ s(
|
|
923
923
|
"button",
|
|
924
924
|
{
|
|
@@ -931,7 +931,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
931
931
|
},
|
|
932
932
|
type: "button",
|
|
933
933
|
children: /* @__PURE__ */ s(
|
|
934
|
-
|
|
934
|
+
Jr,
|
|
935
935
|
{
|
|
936
936
|
className: "slide-player__icon",
|
|
937
937
|
strokeWidth: 2.25
|
|
@@ -945,7 +945,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
945
945
|
"aria-label": o.volumeAriaLabel,
|
|
946
946
|
className: "hidden",
|
|
947
947
|
type: "button",
|
|
948
|
-
children: /* @__PURE__ */ s(
|
|
948
|
+
children: /* @__PURE__ */ s(Pr, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
949
949
|
}
|
|
950
950
|
),
|
|
951
951
|
/* @__PURE__ */ s(
|
|
@@ -959,7 +959,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
959
959
|
},
|
|
960
960
|
title: Kt.title,
|
|
961
961
|
type: "button",
|
|
962
|
-
children:
|
|
962
|
+
children: lr ? /* @__PURE__ */ s(rn, {}) : /* @__PURE__ */ s(nn, {})
|
|
963
963
|
}
|
|
964
964
|
),
|
|
965
965
|
/* @__PURE__ */ s(
|
|
@@ -970,7 +970,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
970
970
|
className: "slide-player__action slide-player__action--prev",
|
|
971
971
|
disabled: Oe,
|
|
972
972
|
onClick: () => {
|
|
973
|
-
_e?.(
|
|
973
|
+
_e?.(ee());
|
|
974
974
|
},
|
|
975
975
|
title: Nt.title,
|
|
976
976
|
type: "button",
|
|
@@ -985,7 +985,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
985
985
|
className: "slide-player__action slide-player__action--next",
|
|
986
986
|
disabled: Re,
|
|
987
987
|
onClick: () => {
|
|
988
|
-
Me?.(
|
|
988
|
+
Me?.(ee());
|
|
989
989
|
},
|
|
990
990
|
title: Ft.title,
|
|
991
991
|
type: "button",
|
|
@@ -1004,7 +1004,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
1004
1004
|
"aria-keyshortcuts": Et.ariaKeyShortcuts,
|
|
1005
1005
|
"aria-label": o.previousSubtitleLabel,
|
|
1006
1006
|
className: "slide-player__action slide-player__action--prev-subtitle",
|
|
1007
|
-
disabled: !
|
|
1007
|
+
disabled: !ae.previous,
|
|
1008
1008
|
onClick: () => {
|
|
1009
1009
|
ye("previous");
|
|
1010
1010
|
},
|
|
@@ -1019,7 +1019,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
1019
1019
|
"aria-keyshortcuts": Ut.ariaKeyShortcuts,
|
|
1020
1020
|
"aria-label": o.nextSubtitleLabel,
|
|
1021
1021
|
className: "slide-player__action slide-player__action--next-subtitle",
|
|
1022
|
-
disabled: !
|
|
1022
|
+
disabled: !ae.next,
|
|
1023
1023
|
onClick: () => {
|
|
1024
1024
|
ye("next");
|
|
1025
1025
|
},
|
|
@@ -1053,13 +1053,13 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
1053
1053
|
)
|
|
1054
1054
|
}
|
|
1055
1055
|
),
|
|
1056
|
-
|
|
1056
|
+
de ? /* @__PURE__ */ s(
|
|
1057
1057
|
"button",
|
|
1058
1058
|
{
|
|
1059
1059
|
"aria-label": Ct,
|
|
1060
1060
|
"aria-keyshortcuts": Bt.ariaKeyShortcuts,
|
|
1061
1061
|
className: "slide-player__action slide-player__action--fullscreen",
|
|
1062
|
-
onClick:
|
|
1062
|
+
onClick: de,
|
|
1063
1063
|
title: Bt.title,
|
|
1064
1064
|
type: "button",
|
|
1065
1065
|
children: rt ? /* @__PURE__ */ s(
|
|
@@ -1078,31 +1078,40 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
1078
1078
|
}
|
|
1079
1079
|
) : null
|
|
1080
1080
|
] }),
|
|
1081
|
-
|
|
1081
|
+
Je.length > 0 ? /* @__PURE__ */ H(Pt, { children: [
|
|
1082
1082
|
/* @__PURE__ */ s("div", { className: "slide-player__separator" }),
|
|
1083
|
-
/* @__PURE__ */ s("div", { className: "slide-player__group slide-player__group--custom-actions", children:
|
|
1083
|
+
/* @__PURE__ */ s("div", { className: "slide-player__group slide-player__group--custom-actions", children: Je.map((e, t) => /* @__PURE__ */ s(_r.Fragment, { children: e }, `custom-action-${t}`)) })
|
|
1084
1084
|
] }) : null
|
|
1085
1085
|
]
|
|
1086
1086
|
}
|
|
1087
1087
|
),
|
|
1088
|
-
|
|
1088
|
+
N && (N.totalSteps > 1 || N.isGenerating) ? /* @__PURE__ */ s(
|
|
1089
1089
|
"div",
|
|
1090
1090
|
{
|
|
1091
|
-
"aria-label":
|
|
1091
|
+
"aria-label": N.ariaLabel,
|
|
1092
1092
|
className: "slide-player__slide-progress",
|
|
1093
1093
|
role: "navigation",
|
|
1094
|
-
children:
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1094
|
+
children: /* @__PURE__ */ H("div", { className: "slide-player__slide-progress-track", children: [
|
|
1095
|
+
Array.from(
|
|
1096
|
+
{ length: N.totalSteps },
|
|
1097
|
+
(e, t) => /* @__PURE__ */ s(
|
|
1098
|
+
"button",
|
|
1099
|
+
{
|
|
1100
|
+
"aria-current": t === N.currentIndex ? "step" : void 0,
|
|
1101
|
+
"aria-label": `${N.ariaLabel} ${t + 1}`,
|
|
1102
|
+
className: "slide-player__slide-progress-segment",
|
|
1103
|
+
"data-state": t < N.currentIndex ? "completed" : t === N.currentIndex ? "current" : "upcoming",
|
|
1104
|
+
onClick: () => N.onNavigate?.(t),
|
|
1105
|
+
type: "button"
|
|
1106
|
+
},
|
|
1107
|
+
t
|
|
1108
|
+
)
|
|
1109
|
+
),
|
|
1110
|
+
N.isGenerating ? /* @__PURE__ */ H("span", { className: "slide-player__slide-progress-generating", children: [
|
|
1111
|
+
/* @__PURE__ */ s("span", { "aria-hidden": "true" }),
|
|
1112
|
+
N.generatingLabel
|
|
1113
|
+
] }) : null
|
|
1114
|
+
] })
|
|
1106
1115
|
}
|
|
1107
1116
|
) : null
|
|
1108
1117
|
] }) : null
|