markdown-flow-ui 0.1.124 → 0.1.126

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.
Files changed (43) hide show
  1. package/dist/components/Slide/MobilePlayerSettingsSheet.cjs.js +1 -1
  2. package/dist/components/Slide/MobilePlayerSettingsSheet.cjs.js.map +1 -1
  3. package/dist/components/Slide/MobilePlayerSettingsSheet.d.ts +2 -0
  4. package/dist/components/Slide/MobilePlayerSettingsSheet.es.js +7 -6
  5. package/dist/components/Slide/MobilePlayerSettingsSheet.es.js.map +1 -1
  6. package/dist/components/Slide/Player.cjs.js +1 -1
  7. package/dist/components/Slide/Player.cjs.js.map +1 -1
  8. package/dist/components/Slide/Player.d.ts +39 -1
  9. package/dist/components/Slide/Player.es.js +599 -469
  10. package/dist/components/Slide/Player.es.js.map +1 -1
  11. package/dist/components/Slide/Slide.cjs.js +1 -1
  12. package/dist/components/Slide/Slide.cjs.js.map +1 -1
  13. package/dist/components/Slide/Slide.d.ts +13 -0
  14. package/dist/components/Slide/Slide.es.js +535 -506
  15. package/dist/components/Slide/Slide.es.js.map +1 -1
  16. package/dist/components/Slide/constants.cjs.js +1 -1
  17. package/dist/components/Slide/constants.cjs.js.map +1 -1
  18. package/dist/components/Slide/constants.d.ts +13 -0
  19. package/dist/components/Slide/constants.es.js +13 -0
  20. package/dist/components/Slide/constants.es.js.map +1 -1
  21. package/dist/components/Slide/useWakePlayerFromIframe.cjs.js +1 -1
  22. package/dist/components/Slide/useWakePlayerFromIframe.cjs.js.map +1 -1
  23. package/dist/components/Slide/useWakePlayerFromIframe.d.ts +14 -1
  24. package/dist/components/Slide/useWakePlayerFromIframe.es.js +73 -39
  25. package/dist/components/Slide/useWakePlayerFromIframe.es.js.map +1 -1
  26. package/dist/components/Slide/utils/playerKeyboardShortcutContext.cjs.js +2 -0
  27. package/dist/components/Slide/utils/playerKeyboardShortcutContext.cjs.js.map +1 -0
  28. package/dist/components/Slide/utils/playerKeyboardShortcutContext.d.ts +5 -0
  29. package/dist/components/Slide/utils/playerKeyboardShortcutContext.es.js +6 -0
  30. package/dist/components/Slide/utils/playerKeyboardShortcutContext.es.js.map +1 -0
  31. package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.js +2 -0
  32. package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.js.map +1 -0
  33. package/dist/components/Slide/utils/playerKeyboardShortcuts.d.ts +19 -0
  34. package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js +58 -0
  35. package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js.map +1 -0
  36. package/dist/components/Slide/utils/playerKeyboardShortcuts.test.d.ts +1 -0
  37. package/dist/components/Slide/utils/playerNavigationContext.cjs.js +2 -0
  38. package/dist/components/Slide/utils/playerNavigationContext.cjs.js.map +1 -0
  39. package/dist/components/Slide/utils/playerNavigationContext.d.ts +7 -0
  40. package/dist/components/Slide/utils/playerNavigationContext.es.js +9 -0
  41. package/dist/components/Slide/utils/playerNavigationContext.es.js.map +1 -0
  42. package/dist/components/Slide/utils/playerNavigationContext.test.d.ts +1 -0
  43. package/package.json +2 -1
@@ -1,29 +1,32 @@
1
- import { j as t } from "../../_virtual/jsx-runtime.es.js";
2
- import sr, { memo as lr, useRef as a, useState as Ce, useMemo as Y, useEffect as x, useCallback as u } from "react";
3
- import { cn as Le } from "../../lib/utils.es.js";
4
- import ar from "./MobilePlayerSettingsSheet.es.js";
5
- import { DEFAULT_SLIDE_PLAYER_TEXTS as cr } from "./constants.es.js";
6
- import { DEFAULT_MOBILE_VIEW_MODE as ir } from "./utils/mobileScreenMode.es.js";
7
- import { hasReachedAudioEnd as or } from "./utils/audioCompletion.es.js";
8
- import { resolveAudioPlaybackSourceType as fr } from "./utils/playbackSource.es.js";
9
- import { shouldKeepPlayingAfterNavigation as dr } from "./utils/playbackPreference.es.js";
10
- import { toPlayerCustomActionList as mr } from "./utils/playerCustomActions.es.js";
1
+ import { j as n } from "../../_virtual/jsx-runtime.es.js";
2
+ import Rr, { memo as Er, useId as Cr, useContext as Nr, useRef as c, useState as nr, useMemo as G, useCallback as t, useEffect as m } from "react";
3
+ import { cn as ur } from "../../lib/utils.es.js";
4
+ import vr from "./MobilePlayerSettingsSheet.es.js";
5
+ import { DEFAULT_SLIDE_PLAYER_TEXTS as Tr } from "./constants.es.js";
6
+ import { DEFAULT_MOBILE_VIEW_MODE as Kr } from "./utils/mobileScreenMode.es.js";
7
+ import { hasReachedAudioEnd as Pr } from "./utils/audioCompletion.es.js";
8
+ import { PlayerKeyboardShortcutContext as Ur } from "./utils/playerKeyboardShortcutContext.es.js";
9
+ import { activatePlayerKeyboardShortcutOwner as Fr, registerPlayerKeyboardShortcutOwner as Wr, isActivePlayerKeyboardShortcutOwner as Or, getPlayerKeyboardShortcutAction as Br, shouldIgnorePlayerKeyboardShortcutEvent as Vr } from "./utils/playerKeyboardShortcuts.es.js";
10
+ import { resolveAudioPlaybackSourceType as Hr } from "./utils/playbackSource.es.js";
11
+ import { shouldKeepPlayingAfterNavigation as $r } from "./utils/playbackPreference.es.js";
12
+ import { toPlayerCustomActionList as Zr } from "./utils/playerCustomActions.es.js";
13
+ import { suppressPlayerControlsWakeAfterNavigation as ar } from "./utils/playerNavigationContext.es.js";
11
14
  /* empty css */
12
- import pr from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
13
- import hr from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
14
- import yr from "../../node_modules/lucide-react/dist/esm/icons/captions.es.js";
15
- import gr from "../../node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
16
- import _r from "../../node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
17
- import br from "../../node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
18
- import xr from "../../node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
19
- import Sr from "../../node_modules/lucide-react/dist/esm/icons/maximize.es.js";
20
- import wr from "../../node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
21
- const ve = /* @__PURE__ */ new Map(), Fe = (R) => {
22
- if (typeof window > "u" || !R || ve.has(R))
15
+ import qr from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
16
+ import zr from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
17
+ import Yr from "../../node_modules/lucide-react/dist/esm/icons/captions.es.js";
18
+ import Dr from "../../node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
19
+ import Xr from "../../node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
20
+ import Gr from "../../node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
21
+ import Jr from "../../node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
22
+ import Qr from "../../node_modules/lucide-react/dist/esm/icons/maximize.es.js";
23
+ import Ir from "../../node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
24
+ const sr = /* @__PURE__ */ new Map(), lr = (k) => {
25
+ if (typeof window > "u" || !k || sr.has(k))
23
26
  return;
24
- const U = window.document.createElement("audio");
25
- U.preload = "auto", U.setAttribute("playsinline", "true"), U.src = R, U.load(), ve.set(R, U);
26
- }, Mr = () => /* @__PURE__ */ t.jsxs(
27
+ const j = window.document.createElement("audio");
28
+ j.preload = "auto", j.setAttribute("playsinline", "true"), j.src = k, j.load(), sr.set(k, j);
29
+ }, et = () => /* @__PURE__ */ n.jsxs(
27
30
  "svg",
28
31
  {
29
32
  xmlns: "http://www.w3.org/2000/svg",
@@ -32,17 +35,17 @@ const ve = /* @__PURE__ */ new Map(), Fe = (R) => {
32
35
  viewBox: "0 0 34 34",
33
36
  fill: "none",
34
37
  children: [
35
- /* @__PURE__ */ t.jsx(
38
+ /* @__PURE__ */ n.jsx(
36
39
  "path",
37
40
  {
38
41
  d: "M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z",
39
42
  fill: "#0A0A0A"
40
43
  }
41
44
  ),
42
- /* @__PURE__ */ t.jsx("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
45
+ /* @__PURE__ */ n.jsx("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
43
46
  ]
44
47
  }
45
- ), kr = () => /* @__PURE__ */ t.jsxs(
48
+ ), rt = () => /* @__PURE__ */ n.jsxs(
46
49
  "svg",
47
50
  {
48
51
  xmlns: "http://www.w3.org/2000/svg",
@@ -51,320 +54,372 @@ const ve = /* @__PURE__ */ new Map(), Fe = (R) => {
51
54
  viewBox: "0 0 34 34",
52
55
  fill: "none",
53
56
  children: [
54
- /* @__PURE__ */ t.jsx(
57
+ /* @__PURE__ */ n.jsx(
55
58
  "path",
56
59
  {
57
60
  d: "M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z",
58
61
  fill: "#0A0A0A"
59
62
  }
60
63
  ),
61
- /* @__PURE__ */ t.jsx("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
64
+ /* @__PURE__ */ n.jsx("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
62
65
  ]
63
66
  }
64
- ), jr = ({
65
- audioList: R = [],
66
- className: U,
67
- currentAudioIndex: m = -1,
67
+ ), J = {
68
+ fullscreen: "F",
69
+ next: "→",
70
+ notes: "N",
71
+ playback: "Space",
72
+ previous: "←",
73
+ subtitle: "C"
74
+ }, tt = (k, j) => k ? `${k} (${j})` : j, nt = ({
75
+ audioList: k = [],
76
+ className: j,
77
+ currentAudioIndex: h = -1,
68
78
  defaultPlaying: g = !0,
69
- isPlaybackPaused: P = !1,
70
- isAutoAdvanceEnabled: $ = !0,
71
- useAutoAdvanceToggle: T = !1,
72
- onLoadingChange: le,
73
- onPlaybackPreferenceChange: ae,
74
- onPlaybackStarted: ce,
75
- onPlaybackTimeChange: G,
76
- onSubtitleToggle: ie,
77
- onPrev: Ue,
78
- onNext: Pe,
79
- onFullscreen: oe,
80
- isFullscreen: fe = !1,
81
- mobileViewMode: We = ir,
82
- settingsPortalContainer: Ve,
83
- onMobileViewModeChange: de,
84
- onEnded: me,
85
- onAutoAdvanceToggle: Be,
86
- onInteractionToggle: Ze,
87
- hasInteraction: $e = !1,
88
- isInteractionOpen: D = !1,
89
- isSubtitleEnabled: re = !0,
90
- prevDisabled: He = !1,
91
- nextDisabled: Ke = !1,
92
- showControls: te = !0,
93
- customActions: pe,
94
- customActionContext: he,
95
- texts: ye,
96
- ...Oe
79
+ isPlaybackPaused: K = !1,
80
+ isAutoAdvanceEnabled: O = !0,
81
+ useAutoAdvanceToggle: N = !1,
82
+ onLoadingChange: xe,
83
+ onPlaybackPreferenceChange: ke,
84
+ onPlaybackStarted: Me,
85
+ onPlaybackTimeChange: ne,
86
+ onSubtitleToggle: Q,
87
+ onPrev: ue,
88
+ onNext: ae,
89
+ onFullscreen: I,
90
+ isFullscreen: Le = !1,
91
+ mobileViewMode: cr = Kr,
92
+ settingsPortalContainer: or,
93
+ onMobileViewModeChange: Ae,
94
+ onEnded: je,
95
+ onAutoAdvanceToggle: Re,
96
+ onInteractionToggle: se,
97
+ hasInteraction: me = !1,
98
+ isInteractionOpen: ee = !1,
99
+ isSubtitleEnabled: pe = !0,
100
+ prevDisabled: he = !1,
101
+ nextDisabled: ye = !1,
102
+ showControls: be = !0,
103
+ enableKeyboardShortcuts: ir = !0,
104
+ customActions: Ee,
105
+ customActionContext: Ce,
106
+ texts: Ne,
107
+ onFocusCapture: ve,
108
+ onPointerDown: Te,
109
+ ...fr
97
110
  }) => {
98
- const p = a(null), ge = a(D), C = a(null), _e = a(null), S = a(0), c = a(null), J = a(void 0), j = a([]), Q = a(
99
- T ? $ : g
100
- ), X = a(!1), be = a(!1), h = a(!1), L = a(null), H = a(null), _ = a(!1), s = a(!1), y = a(null), w = a(!1), W = a(null), ne = a(0), v = a("unknown"), [ue, o] = Ce(g), [xe, K] = Ce(!1), f = m >= 0 ? R[m] : void 0, V = f?.audioUrl, M = Y(
101
- () => [...f?.audioSegments ?? []].sort(
111
+ const dr = Cr(), Ke = Nr(Ur), y = c(null), Pe = c(ee), P = c(null), Ue = c(null), R = c(0), o = c(null), le = c(void 0), v = c([]), ce = c(
112
+ N ? O : g
113
+ ), re = c(!1), Fe = c(!1), b = c(!1), U = c(null), q = c(null), _ = c(!1), s = c(!1), S = c(null), E = c(!1), B = c(null), Se = c(0), F = c("unknown"), [oe, f] = nr(g), [We, z] = nr(!1), V = Ke?.ownerId ?? dr, T = ir && (Ke?.enabled ?? !0), d = h >= 0 ? k[h] : void 0, H = d?.audioUrl, M = G(
114
+ () => [...d?.audioSegments ?? []].sort(
102
115
  (e, r) => e.segment_index - r.segment_index
103
116
  ),
104
- [f?.audioSegments]
105
- ), Se = Y(
106
- () => mr(pe, he),
107
- [he, pe]
108
- ), we = Se.length + 5, qe = Y(
117
+ [d?.audioSegments]
118
+ ), Oe = G(
119
+ () => Zr(Ee, Ce),
120
+ [Ce, Ee]
121
+ ), Be = Oe.length + 5, mr = G(
109
122
  () => ({
110
- "--slide-player-mobile-control-count": String(we)
123
+ "--slide-player-mobile-control-count": String(Be)
111
124
  }),
112
- [we]
113
- ), B = Y(
125
+ [Be]
126
+ ), l = G(
114
127
  () => ({
115
- ...cr,
116
- ...ye
128
+ ...Tr,
129
+ ...Ne
117
130
  }),
118
- [ye]
119
- ), se = Y(() => f ? f.audioKey ?? `${String(f.sequenceNumber ?? "none")}:${String(f.audioUrl ?? "")}` : "none", [f]), ze = T ? $ : ue, De = T ? $ ? "Pause autoplay" : "Play autoplay" : ue ? "Pause" : "Play";
120
- x(() => {
121
- J.current = f;
122
- }, [f]), x(() => {
123
- Q.current = T ? $ : g;
124
- }, [g, $, T]), x(() => {
125
- te || K(!1);
126
- }, [te]), x(() => {
127
- !ge.current && D && K(!1), ge.current = D;
128
- }, [D]), x(() => {
129
- j.current = M;
130
- }, [M]), x(() => {
131
- const e = f?.audioUrl, r = m >= 0 ? R[m + 1]?.audioUrl : void 0;
132
- Fe(e), Fe(r);
133
- }, [R, f?.audioUrl, m]);
134
- const n = u(
131
+ [Ne]
132
+ ), ge = G(() => d ? d.audioKey ?? `${String(d.sequenceNumber ?? "none")}:${String(d.audioUrl ?? "")}` : "none", [d]), pr = N ? O : oe, Ve = N ? O ? l.pauseAutoplayLabel : l.playAutoplayLabel : oe ? l.pauseLabel : l.playLabel, He = Le ? l.exitFullscreenLabel : l.enterFullscreenLabel, Y = t(
133
+ (e, r, a) => ({
134
+ ariaKeyShortcuts: T ? a : void 0,
135
+ title: T ? tt(e, r) : e
136
+ }),
137
+ [T]
138
+ ), $e = Y(
139
+ l.subtitleToggleAriaLabel,
140
+ J.subtitle,
141
+ "c"
142
+ ), Ze = Y(
143
+ l.previousLabel,
144
+ J.previous,
145
+ "ArrowLeft"
146
+ ), qe = Y(
147
+ Ve,
148
+ J.playback,
149
+ "Space"
150
+ ), ze = Y(
151
+ l.nextLabel,
152
+ J.next,
153
+ "ArrowRight"
154
+ ), Ye = Y(
155
+ He,
156
+ J.fullscreen,
157
+ "f"
158
+ ), De = Y(
159
+ l.notesLabel,
160
+ J.notes,
161
+ "n"
162
+ ), ie = t(() => {
163
+ T && Fr(V);
164
+ }, [V, T]), hr = t(
165
+ (e) => {
166
+ ie(), Te?.(e);
167
+ },
168
+ [ie, Te]
169
+ ), yr = t(
170
+ (e) => {
171
+ ie(), ve?.(e);
172
+ },
173
+ [ie, ve]
174
+ );
175
+ m(() => {
176
+ le.current = d;
177
+ }, [d]), m(() => {
178
+ ce.current = N ? O : g;
179
+ }, [g, O, N]), m(() => {
180
+ be || z(!1);
181
+ }, [be]), m(() => {
182
+ !Pe.current && ee && z(!1), Pe.current = ee;
183
+ }, [ee]), m(() => {
184
+ v.current = M;
185
+ }, [M]), m(() => {
186
+ const e = d?.audioUrl, r = h >= 0 ? k[h + 1]?.audioUrl : void 0;
187
+ lr(e), lr(r);
188
+ }, [k, d?.audioUrl, h]);
189
+ const u = t(
135
190
  (e, r = null) => {
136
- be.current === e && (!e || r === null) || (be.current = e, le?.({
191
+ Fe.current === e && (!e || r === null) || (Fe.current = e, xe?.({
137
192
  loading: e,
138
193
  reason: e ? r : null
139
194
  }));
140
195
  },
141
- [le]
142
- ), O = u(
196
+ [xe]
197
+ ), $ = t(
143
198
  (e) => {
144
- Q.current = e, ae?.(e);
199
+ ce.current = e, ke?.(e);
145
200
  },
146
- [ae]
147
- ), Me = u(() => T ? {
148
- shouldContinuePlayback: Q.current
201
+ [ke]
202
+ ), te = t(() => N ? {
203
+ shouldContinuePlayback: ce.current
149
204
  } : {
150
- shouldContinuePlayback: dr({
151
- defaultPlaying: Q.current,
152
- isPausedByUser: h.current
205
+ shouldContinuePlayback: $r({
206
+ defaultPlaying: ce.current,
207
+ isPausedByUser: b.current
153
208
  })
154
- }, [T]), ke = u((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), F = u(() => g && !P && !h.current && v.current !== "blocked", [g, P]), je = u((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), Ee = u(() => {
155
- const e = c.current;
156
- return e == null || e <= 0 ? 0 : j.current.slice(0, e).reduce(
157
- (r, l) => r + Math.max(Number(l.duration_ms ?? 0), 0),
209
+ }, [N]), Xe = t((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), W = t(() => g && !K && !b.current && F.current !== "blocked", [g, K]), Ge = t((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), Je = t(() => {
210
+ const e = o.current;
211
+ return e == null || e <= 0 ? 0 : v.current.slice(0, e).reduce(
212
+ (r, a) => r + Math.max(Number(a.duration_ms ?? 0), 0),
158
213
  0
159
214
  ) / 1e3;
160
- }, []), Z = u((e) => e <= 0 ? 0 : j.current.slice(0, e).reduce(
161
- (r, l) => r + Math.max(Number(l.duration_ms ?? 0), 0),
215
+ }, []), Z = t((e) => e <= 0 ? 0 : v.current.slice(0, e).reduce(
216
+ (r, a) => r + Math.max(Number(a.duration_ms ?? 0), 0),
162
217
  0
163
- ), []), Ne = u(() => {
164
- const e = p.current;
165
- return e ? L.current === "segment" ? Z(S.current) + Math.max(e.currentTime, 0) * 1e3 : y.current !== null && e.readyState === 0 ? y.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : c.current != null ? Z(c.current) : 0;
166
- }, [Z]), b = u(
218
+ ), []), Qe = t(() => {
219
+ const e = y.current;
220
+ return e ? U.current === "segment" ? Z(R.current) + Math.max(e.currentTime, 0) * 1e3 : S.current !== null && e.readyState === 0 ? S.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : o.current != null ? Z(o.current) : 0;
221
+ }, [Z]), w = t(
167
222
  (e) => {
168
223
  const r = Math.max(e, 0);
169
- ne.current !== r && (ne.current = r, G?.(r));
224
+ Se.current !== r && (Se.current = r, ne?.(r));
170
225
  },
171
- [G]
172
- ), i = u(() => {
173
- b(Ne());
174
- }, [Ne, b]), d = u(() => {
175
- typeof window > "u" || W.current === null || (window.cancelAnimationFrame(W.current), W.current = null);
176
- }, []), Ae = u(() => {
177
- if (typeof window > "u" || W.current !== null)
226
+ [ne]
227
+ ), i = t(() => {
228
+ w(Qe());
229
+ }, [Qe, w]), p = t(() => {
230
+ typeof window > "u" || B.current === null || (window.cancelAnimationFrame(B.current), B.current = null);
231
+ }, []), Ie = t(() => {
232
+ if (typeof window > "u" || B.current !== null)
178
233
  return;
179
234
  const e = () => {
180
235
  i();
181
- const r = p.current;
236
+ const r = y.current;
182
237
  if (!r || r.paused || r.ended) {
183
- W.current = null;
238
+ B.current = null;
184
239
  return;
185
240
  }
186
- W.current = window.requestAnimationFrame(e);
241
+ B.current = window.requestAnimationFrame(e);
187
242
  };
188
- W.current = window.requestAnimationFrame(e);
189
- }, [i]), q = u(() => {
190
- const e = p.current;
191
- e && (d(), s.current = !1, h.current = !1, X.current = !1, L.current = null, y.current = null, _.current = !1, w.current = !1, H.current = null, e.pause(), e.removeAttribute("src"), e.load(), C.current = null, S.current = 0, c.current = null, b(0), o(!1), n(!1));
192
- }, [b, d, n]), k = u(
243
+ B.current = window.requestAnimationFrame(e);
244
+ }, [i]), D = t(() => {
245
+ const e = y.current;
246
+ e && (p(), s.current = !1, b.current = !1, re.current = !1, U.current = null, S.current = null, _.current = !1, E.current = !1, q.current = null, e.pause(), e.removeAttribute("src"), e.load(), P.current = null, R.current = 0, o.current = null, w(0), f(!1), u(!1));
247
+ }, [w, p, u]), L = t(
193
248
  (e) => {
194
- const r = p.current;
249
+ const r = y.current;
195
250
  if (!r)
196
251
  return !1;
197
- const l = r.play();
198
- return l && typeof l.then == "function" && l.then(() => {
199
- v.current === "unknown" && (v.current = "auto"), s.current = !1, w.current = !1;
200
- }).catch((N) => {
201
- v.current === "unknown" && ke(N) && (v.current = "blocked", s.current = !1, n(!1)), w.current = !1, o(!1);
252
+ const a = r.play();
253
+ return a && typeof a.then == "function" && a.then(() => {
254
+ F.current === "unknown" && (F.current = "auto"), s.current = !1, E.current = !1;
255
+ }).catch((x) => {
256
+ F.current === "unknown" && Xe(x) && (F.current = "blocked", s.current = !1, u(!1)), E.current = !1, f(!1);
202
257
  }), !0;
203
258
  },
204
- [ke, n]
205
- ), E = u(
259
+ [Xe, u]
260
+ ), C = t(
206
261
  (e, r) => {
207
- const l = p.current, N = j.current[e];
208
- if (!l || !N)
262
+ const a = y.current, x = v.current[e];
263
+ if (!a || !x)
209
264
  return !1;
210
- const A = je(N.audio_data);
211
- S.current = e, c.current = null, _.current = !1, w.current = !0, H.current = "segment", b(Z(e));
212
- const ee = F();
213
- s.current = ee, n(!1);
214
- const ur = C.current !== A;
215
- return L.current = "segment", ur && (l.pause(), l.removeAttribute("src"), l.load(), C.current = A, l.src = A, l.load()), y.current = 0, l.readyState > 0 && (l.currentTime = 0, y.current = null), ee ? k(`start-segment:${r}`) : (s.current = !1, w.current = !1, l.pause(), o(!1), !0);
265
+ const A = Ge(x.audio_data);
266
+ R.current = e, o.current = null, _.current = !1, E.current = !0, q.current = "segment", w(Z(e));
267
+ const de = W();
268
+ s.current = de, u(!1);
269
+ const jr = P.current !== A;
270
+ return U.current = "segment", jr && (a.pause(), a.removeAttribute("src"), a.load(), P.current = A, a.src = A, a.load()), S.current = 0, a.readyState > 0 && (a.currentTime = 0, S.current = null), de ? L(`start-segment:${r}`) : (s.current = !1, E.current = !1, a.pause(), f(!1), !0);
216
271
  },
217
272
  [
218
- F,
219
- je,
273
+ W,
274
+ Ge,
220
275
  Z,
221
- b,
222
- k,
223
- n
276
+ w,
277
+ L,
278
+ u
224
279
  ]
225
- ), z = u(
280
+ ), X = t(
226
281
  (e) => {
227
- d(), s.current = !1, _.current = !1, w.current = !1, i(), o(!1), n(!1), m >= 0 && me?.(m);
282
+ p(), s.current = !1, _.current = !1, E.current = !1, i(), f(!1), u(!1), h >= 0 && je?.(h);
228
283
  },
229
284
  [
230
- m,
231
- me,
232
- d,
285
+ h,
286
+ je,
287
+ p,
233
288
  i,
234
- n
289
+ u
235
290
  ]
236
- ), I = u(
291
+ ), fe = t(
237
292
  (e) => {
238
- const r = p.current;
239
- return !r || L.current !== "url" || !or({
293
+ const r = y.current;
294
+ return !r || U.current !== "url" || !Pr({
240
295
  currentTimeSeconds: Math.max(r.currentTime, 0),
241
296
  durationSeconds: r.duration
242
- }) ? !1 : (s.current = !1, r.pause(), z(e), !0);
297
+ }) ? !1 : (s.current = !1, r.pause(), X(e), !0);
243
298
  },
244
- [z]
245
- ), Re = u(() => {
246
- const e = S.current + 1, r = j.current, l = r[e], N = J.current, A = r.some((ee) => ee.is_final);
247
- if (l) {
248
- E(e, "ended");
299
+ [X]
300
+ ), er = t(() => {
301
+ const e = R.current + 1, r = v.current, a = r[e], x = le.current, A = r.some((de) => de.is_final);
302
+ if (a) {
303
+ C(e, "ended");
249
304
  return;
250
305
  }
251
- if (N?.isAudioStreaming || !A) {
252
- S.current = e, c.current = e, _.current = !0, s.current = g, b(Z(e)), o(!1), n(!0, "waitingForMoreAudio");
306
+ if (x?.isAudioStreaming || !A) {
307
+ R.current = e, o.current = e, _.current = !0, s.current = g, w(Z(e)), f(!1), u(!0, "waitingForMoreAudio");
253
308
  return;
254
309
  }
255
- z("segments-completed");
310
+ X("segments-completed");
256
311
  }, [
257
312
  g,
258
- z,
313
+ X,
259
314
  Z,
260
- b,
261
- E,
262
- n
315
+ w,
316
+ C,
317
+ u
263
318
  ]);
264
- x(() => {
265
- if (_e.current === se)
319
+ m(() => {
320
+ if (Ue.current === ge)
266
321
  return;
267
- _e.current = se, S.current = 0, c.current = null, _.current = !1, h.current = !1, X.current = !1, s.current = !1, w.current = !1, L.current = null, H.current = null, C.current = null, d(), b(0), n(!1);
268
- const e = p.current;
269
- e && (e.pause(), e.removeAttribute("src"), e.load(), o(!1));
322
+ Ue.current = ge, R.current = 0, o.current = null, _.current = !1, b.current = !1, re.current = !1, s.current = !1, E.current = !1, U.current = null, q.current = null, P.current = null, p(), w(0), u(!1);
323
+ const e = y.current;
324
+ e && (e.pause(), e.removeAttribute("src"), e.load(), f(!1));
270
325
  }, [
271
- m,
272
- se,
326
+ h,
327
+ ge,
273
328
  M.length,
274
- V,
275
- b,
276
- d,
277
- n
278
- ]), x(() => {
279
- const e = p.current;
329
+ H,
330
+ w,
331
+ p,
332
+ u
333
+ ]), m(() => {
334
+ const e = y.current;
280
335
  if (e) {
281
- if (P) {
282
- X.current = !!(J.current && !h.current && (!e.paused || s.current || c.current !== null)), s.current = !1, n(!1), e.pause(), o(!1);
336
+ if (K) {
337
+ re.current = !!(le.current && !b.current && (!e.paused || s.current || o.current !== null)), s.current = !1, u(!1), e.pause(), f(!1);
283
338
  return;
284
339
  }
285
- if (!(!X.current || !J.current || h.current)) {
286
- if (X.current = !1, c.current !== null) {
287
- if (c.current < j.current.length) {
288
- E(c.current, "external-resume");
340
+ if (!(!re.current || !le.current || b.current)) {
341
+ if (re.current = !1, o.current !== null) {
342
+ if (o.current < v.current.length) {
343
+ C(o.current, "external-resume");
289
344
  return;
290
345
  }
291
- s.current = !0, n(!0, "waitingForMoreAudio");
346
+ s.current = !0, u(!0, "waitingForMoreAudio");
292
347
  return;
293
348
  }
294
- if (!C.current && j.current.length > 0) {
295
- E(
349
+ if (!P.current && v.current.length > 0) {
350
+ C(
296
351
  Math.min(
297
- S.current,
298
- j.current.length - 1
352
+ R.current,
353
+ v.current.length - 1
299
354
  ),
300
355
  "external-resume-init"
301
356
  );
302
357
  return;
303
358
  }
304
- e.paused && (s.current = !0, k("external-resume"));
359
+ e.paused && (s.current = !0, L("external-resume"));
305
360
  }
306
361
  }
307
362
  }, [
308
- P,
309
- E,
310
- k,
311
- n
312
- ]), x(() => {
313
- const e = p.current;
363
+ K,
364
+ C,
365
+ L,
366
+ u
367
+ ]), m(() => {
368
+ const e = y.current;
314
369
  if (!e)
315
370
  return;
316
- if (!f) {
317
- q();
371
+ if (!d) {
372
+ D();
318
373
  return;
319
374
  }
320
- if (P) {
321
- s.current = !1, n(!1), e.pause(), o(!1);
375
+ if (K) {
376
+ s.current = !1, u(!1), e.pause(), f(!1);
322
377
  return;
323
378
  }
324
- const r = fr({
325
- activeSourceType: L.current,
326
- hasAudioUrl: !!V,
379
+ const r = Hr({
380
+ activeSourceType: U.current,
381
+ hasAudioUrl: !!H,
327
382
  segmentCount: M.length,
328
- preferredSourceType: H.current,
329
- waitingSegmentIndex: c.current
383
+ preferredSourceType: q.current,
384
+ waitingSegmentIndex: o.current
330
385
  });
331
- if (r && H.current !== r && (H.current = r), r === "url" && V) {
332
- const l = C.current !== V, N = F();
333
- if (l) {
334
- const A = c.current !== null ? Ee() : 0;
335
- e.pause(), e.removeAttribute("src"), e.load(), C.current = V, L.current = "url", e.src = V, e.load(), y.current = A, b(A * 1e3), e.readyState > 0 && (e.currentTime = A, y.current = null);
386
+ if (r && q.current !== r && (q.current = r), r === "url" && H) {
387
+ const a = P.current !== H, x = W();
388
+ if (a) {
389
+ const A = o.current !== null ? Je() : 0;
390
+ e.pause(), e.removeAttribute("src"), e.load(), P.current = H, U.current = "url", e.src = H, e.load(), S.current = A, w(A * 1e3), e.readyState > 0 && (e.currentTime = A, S.current = null);
336
391
  }
337
- if (s.current = N, _.current = !1, w.current = !1, n(!1), !N) {
338
- s.current = !1, e.pause(), o(!1);
392
+ if (s.current = x, _.current = !1, E.current = !1, u(!1), !x) {
393
+ s.current = !1, e.pause(), f(!1);
339
394
  return;
340
395
  }
341
- k(l ? "sync-url-init" : "sync-url");
396
+ L(a ? "sync-url-init" : "sync-url");
342
397
  return;
343
398
  }
344
- if (r === "segment" && c.current !== null) {
345
- if (c.current < M.length) {
346
- if (h.current) {
347
- o(!1), n(!1);
399
+ if (r === "segment" && o.current !== null) {
400
+ if (o.current < M.length) {
401
+ if (b.current) {
402
+ f(!1), u(!1);
348
403
  return;
349
404
  }
350
- E(c.current, "wait-resume");
405
+ C(o.current, "wait-resume");
351
406
  return;
352
407
  }
353
- _.current = !0, s.current = F(), o(!1), n(F());
408
+ _.current = !0, s.current = W(), f(!1), u(W());
354
409
  return;
355
410
  }
356
411
  if (r === "segment" && !M.length) {
357
- if (f.isAudioStreaming) {
358
- c.current = S.current, _.current = !0, s.current = F(), o(!1), n(F());
412
+ if (d.isAudioStreaming) {
413
+ o.current = R.current, _.current = !0, s.current = W(), f(!1), u(W());
359
414
  return;
360
415
  }
361
- q();
416
+ D();
362
417
  return;
363
418
  }
364
- if (r === "segment" && !C.current) {
365
- E(
419
+ if (r === "segment" && !P.current) {
420
+ C(
366
421
  Math.min(
367
- S.current,
422
+ R.current,
368
423
  M.length - 1
369
424
  ),
370
425
  "effect-init"
@@ -372,283 +427,358 @@ const ve = /* @__PURE__ */ new Map(), Fe = (R) => {
372
427
  return;
373
428
  }
374
429
  if (r !== "segment") {
375
- q();
430
+ D();
376
431
  return;
377
432
  }
378
- if (!g || h.current) {
379
- s.current = !1, e.pause(), o(!1);
433
+ if (!g || b.current) {
434
+ s.current = !1, e.pause(), f(!1);
380
435
  return;
381
436
  }
382
- e.paused && (s.current = !0, k("sync-paused-retry"));
437
+ e.paused && (s.current = !0, L("sync-paused-retry"));
383
438
  }, [
384
- f,
385
- m,
439
+ d,
440
+ h,
386
441
  M,
387
- V,
442
+ H,
388
443
  g,
389
- P,
390
- F,
391
- b,
392
- q,
393
- E,
394
- k,
395
- Ee,
396
- n
397
- ]), x(() => q, [q]), x(() => d, [d]);
398
- const Xe = u(() => {
399
- i(), Ae(), o(!0), n(!1), ce?.();
444
+ K,
445
+ W,
446
+ w,
447
+ D,
448
+ C,
449
+ L,
450
+ Je,
451
+ u
452
+ ]), m(() => D, [D]), m(() => p, [p]);
453
+ const br = t(() => {
454
+ i(), Ie(), f(!0), u(!1), Me?.();
400
455
  }, [
401
- ce,
402
- Ae,
456
+ Me,
457
+ Ie,
403
458
  i,
404
- n
405
- ]), Ye = u(() => {
406
- _.current || w.current || (d(), i(), o(!1));
407
- }, [m, d, i]), Ge = u(() => {
408
- const e = p.current;
409
- e && y.current !== null && (e.currentTime = y.current, y.current = null), i(), !I("canplay-seek-finished") && (!s.current || !g || k("canplay"));
459
+ u
460
+ ]), Sr = t(() => {
461
+ _.current || E.current || (p(), i(), f(!1));
462
+ }, [h, p, i]), gr = t(() => {
463
+ const e = y.current;
464
+ e && S.current !== null && (e.currentTime = S.current, S.current = null), i(), !fe("canplay-seek-finished") && (!s.current || !g || L("canplay"));
410
465
  }, [
411
- m,
466
+ h,
412
467
  g,
413
- I,
468
+ fe,
414
469
  i,
415
- k
416
- ]), Je = u(() => {
417
- const e = p.current;
418
- e && y.current !== null && (e.currentTime = y.current, y.current = null), i(), I("metadata-seek-finished");
419
- }, [m, I, i]), Qe = u(() => {
470
+ L
471
+ ]), _r = t(() => {
472
+ const e = y.current;
473
+ e && S.current !== null && (e.currentTime = S.current, S.current = null), i(), fe("metadata-seek-finished");
474
+ }, [h, fe, i]), wr = t(() => {
420
475
  i();
421
- }, [i]), Ie = u(() => {
422
- _.current || n(!0, "loadingAudio");
423
- }, [n]), er = u(() => {
476
+ }, [i]), xr = t(() => {
477
+ _.current || u(!0, "loadingAudio");
478
+ }, [u]), kr = t(() => {
424
479
  if (_.current) {
425
- n(!0, "waitingForMoreAudio");
480
+ u(!0, "waitingForMoreAudio");
426
481
  return;
427
482
  }
428
- n(!0, "loadingAudio");
429
- }, [n]), Te = u(() => {
483
+ u(!0, "loadingAudio");
484
+ }, [u]), rr = t(() => {
430
485
  i();
431
- }, [i]), rr = u(() => {
432
- const e = L.current === "url" || j.current.length === 0;
433
- if (d(), w.current = !1, e) {
434
- z("url-ended");
486
+ }, [i]), Mr = t(() => {
487
+ const e = U.current === "url" || v.current.length === 0;
488
+ if (p(), E.current = !1, e) {
489
+ X("url-ended");
435
490
  return;
436
491
  }
437
- Re();
438
- }, [z, Re, d]), tr = u(() => {
439
- d(), i(), o(!1), n(!1);
440
- }, [d, i, n]), nr = u(
492
+ er();
493
+ }, [X, er, p]), Lr = t(() => {
494
+ p(), i(), f(!1), u(!1);
495
+ }, [p, i, u]), Ar = t(
441
496
  (e) => {
442
- de?.(e), K(!1);
497
+ Ae?.(e), z(!1);
443
498
  },
444
- [de]
445
- );
446
- return x(() => {
447
- G?.(ne.current);
448
- }, [G]), /* @__PURE__ */ t.jsxs("div", { className: Le("slide-player", U), ...Oe, children: [
449
- /* @__PURE__ */ t.jsx(
450
- "audio",
451
- {
452
- ref: p,
453
- preload: "auto",
454
- playsInline: !0,
455
- onLoadStart: Ie,
456
- onLoadedMetadata: Je,
457
- onCanPlay: Ge,
458
- onPlay: Xe,
459
- onPause: Ye,
460
- onWaiting: er,
461
- onSeeking: Te,
462
- onSeeked: Te,
463
- onTimeUpdate: Qe,
464
- onEnded: rr,
465
- onError: tr
466
- }
467
- ),
468
- te ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
469
- /* @__PURE__ */ t.jsx(
470
- ar,
471
- {
472
- container: Ve,
473
- labels: {
474
- fullscreen: B.fullscreenLabel,
475
- nonFullscreen: B.nonFullscreenLabel,
476
- screen: B.screenLabel,
477
- subtitle: B.subtitleLabel,
478
- subtitleToggle: B.subtitleToggleAriaLabel,
479
- title: B.settingsTitle
480
- },
481
- isSubtitleEnabled: re,
482
- onClose: () => K(!1),
483
- onOpenChange: K,
484
- onSubtitleToggle: ie ?? (() => {
485
- }),
486
- onViewModeChange: nr,
487
- open: xe,
488
- viewMode: We
489
- }
499
+ [Ae]
500
+ ), _e = t(() => {
501
+ if (N) {
502
+ const r = !O;
503
+ return $(r), Re?.(r), !0;
504
+ }
505
+ const e = y.current;
506
+ return K || !e || !d ? !1 : o.current !== null ? oe ? ($(!1), s.current = !1, b.current = !0, o.current = null, _.current = !1, f(!1), u(!1), e.pause(), !0) : ($(!0), F.current = "manual", b.current = !1, s.current = !0, u(!0, "waitingForMoreAudio"), !0) : !e.src && M.length > 0 ? ($(!0), F.current = "manual", b.current = !1, C(
507
+ Math.min(
508
+ R.current,
509
+ M.length - 1
490
510
  ),
491
- /* @__PURE__ */ t.jsxs("div", { className: "slide-player__controls", style: qe, children: [
492
- /* @__PURE__ */ t.jsxs("div", { className: "slide-player__group", children: [
493
- /* @__PURE__ */ t.jsx(
494
- "button",
511
+ "toggle"
512
+ ), !0) : e.paused ? ($(!0), F.current = "manual", b.current = !1, s.current = !0, L("toggle-resume"), !0) : ($(!1), s.current = !1, b.current = !0, e.pause(), !0);
513
+ }, [
514
+ d,
515
+ M.length,
516
+ O,
517
+ K,
518
+ oe,
519
+ Re,
520
+ C,
521
+ L,
522
+ u,
523
+ $,
524
+ N
525
+ ]);
526
+ m(() => {
527
+ if (T)
528
+ return Wr(V);
529
+ }, [V, T]);
530
+ const we = G(
531
+ () => ({
532
+ fullscreen: () => I ? (I(), !0) : !1,
533
+ interaction: () => se ? (me && se(), !0) : !1,
534
+ next: () => ae ? (ye || ae(
535
+ ar(te())
536
+ ), !0) : !1,
537
+ previous: () => ue ? (he || ue(
538
+ ar(te())
539
+ ), !0) : !1,
540
+ subtitle: () => Q ? (Q(), !0) : !1,
541
+ togglePlayback: () => (_e(), !0)
542
+ }),
543
+ [
544
+ te,
545
+ me,
546
+ ye,
547
+ I,
548
+ se,
549
+ ae,
550
+ ue,
551
+ Q,
552
+ he,
553
+ _e
554
+ ]
555
+ ), tr = c(we);
556
+ return m(() => {
557
+ tr.current = we;
558
+ }, [we]), m(() => {
559
+ if (!T || typeof document > "u")
560
+ return;
561
+ const e = (r) => {
562
+ if (!Or(V))
563
+ return;
564
+ const a = Br(r);
565
+ if (!a || Vr(r, a))
566
+ return;
567
+ let x = !1;
568
+ const A = tr.current[a];
569
+ x = A(), x && r.preventDefault();
570
+ };
571
+ return document.addEventListener("keydown", e), () => {
572
+ document.removeEventListener("keydown", e);
573
+ };
574
+ }, [V, T]), m(() => {
575
+ ne?.(Se.current);
576
+ }, [ne]), /* @__PURE__ */ n.jsxs(
577
+ "div",
578
+ {
579
+ ...fr,
580
+ "data-slide-player-shortcut-owner": V,
581
+ className: ur("slide-player", j),
582
+ onFocusCapture: yr,
583
+ onPointerDown: hr,
584
+ children: [
585
+ /* @__PURE__ */ n.jsx(
586
+ "audio",
587
+ {
588
+ ref: y,
589
+ preload: "auto",
590
+ playsInline: !0,
591
+ onLoadStart: xr,
592
+ onLoadedMetadata: _r,
593
+ onCanPlay: gr,
594
+ onPlay: br,
595
+ onPause: Sr,
596
+ onWaiting: kr,
597
+ onSeeking: rr,
598
+ onSeeked: rr,
599
+ onTimeUpdate: wr,
600
+ onEnded: Mr,
601
+ onError: Lr
602
+ }
603
+ ),
604
+ be ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
605
+ /* @__PURE__ */ n.jsx(
606
+ vr,
495
607
  {
496
- "aria-expanded": xe,
497
- "aria-haspopup": "dialog",
498
- "aria-label": "More options",
499
- className: "slide-player__action slide-player__action--mobile-more",
500
- onClick: () => {
501
- K((e) => !e);
608
+ container: or,
609
+ labels: {
610
+ closeSettings: l.closeSettingsLabel,
611
+ fullscreen: l.fullscreenLabel,
612
+ nonFullscreen: l.nonFullscreenLabel,
613
+ screen: l.screenLabel,
614
+ screenMode: l.screenModeLabel,
615
+ subtitle: l.subtitleLabel,
616
+ subtitleToggle: l.subtitleToggleAriaLabel,
617
+ title: l.settingsTitle
502
618
  },
503
- type: "button",
504
- children: /* @__PURE__ */ t.jsx(
505
- pr,
506
- {
507
- className: "slide-player__icon",
508
- strokeWidth: 2.25
509
- }
510
- )
619
+ isSubtitleEnabled: pe,
620
+ onClose: () => z(!1),
621
+ onOpenChange: z,
622
+ onSubtitleToggle: Q ?? (() => {
623
+ }),
624
+ onViewModeChange: Ar,
625
+ open: We,
626
+ viewMode: cr
511
627
  }
512
628
  ),
513
- /* @__PURE__ */ t.jsx("button", { "aria-label": "Volume", className: "hidden", type: "button", children: /* @__PURE__ */ t.jsx(hr, { className: "slide-player__icon", strokeWidth: 2.25 }) }),
514
- /* @__PURE__ */ t.jsx(
515
- "button",
516
- {
517
- "aria-label": B.subtitleToggleAriaLabel,
518
- "aria-pressed": re,
519
- className: "slide-player__action slide-player__action--subtitle",
520
- onClick: ie,
521
- type: "button",
522
- children: re ? /* @__PURE__ */ t.jsx(yr, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ t.jsx(
523
- gr,
629
+ /* @__PURE__ */ n.jsxs("div", { className: "slide-player__controls", style: mr, children: [
630
+ /* @__PURE__ */ n.jsxs("div", { className: "slide-player__group", children: [
631
+ /* @__PURE__ */ n.jsx(
632
+ "button",
524
633
  {
525
- className: "slide-player__icon",
526
- strokeWidth: 2.25
634
+ "aria-expanded": We,
635
+ "aria-haspopup": "dialog",
636
+ "aria-label": l.moreOptionsAriaLabel,
637
+ className: "slide-player__action slide-player__action--mobile-more",
638
+ onClick: () => {
639
+ z((e) => !e);
640
+ },
641
+ type: "button",
642
+ children: /* @__PURE__ */ n.jsx(
643
+ qr,
644
+ {
645
+ className: "slide-player__icon",
646
+ strokeWidth: 2.25
647
+ }
648
+ )
527
649
  }
528
- )
529
- }
530
- ),
531
- /* @__PURE__ */ t.jsx(
532
- "button",
533
- {
534
- "aria-label": "Rewind",
535
- className: "slide-player__action slide-player__action--prev",
536
- disabled: He,
537
- onClick: () => {
538
- Ue?.(Me());
539
- },
540
- type: "button",
541
- children: /* @__PURE__ */ t.jsx(_r, { className: "slide-player__icon", strokeWidth: 2.25 })
542
- }
543
- ),
544
- /* @__PURE__ */ t.jsx(
545
- "button",
546
- {
547
- "aria-label": De,
548
- className: "slide-player__toggle slide-player__toggle--playback",
549
- onClick: () => {
550
- if (T) {
551
- const r = !$;
552
- O(r), Be?.(r);
553
- return;
650
+ ),
651
+ /* @__PURE__ */ n.jsx(
652
+ "button",
653
+ {
654
+ "aria-label": l.volumeAriaLabel,
655
+ className: "hidden",
656
+ type: "button",
657
+ children: /* @__PURE__ */ n.jsx(zr, { className: "slide-player__icon", strokeWidth: 2.25 })
554
658
  }
555
- const e = p.current;
556
- if (!(P || !e || !f)) {
557
- if (c.current !== null) {
558
- if (ue) {
559
- O(!1), s.current = !1, h.current = !0, c.current = null, _.current = !1, o(!1), n(!1), e.pause();
560
- return;
659
+ ),
660
+ /* @__PURE__ */ n.jsx(
661
+ "button",
662
+ {
663
+ "aria-label": l.subtitleToggleAriaLabel,
664
+ "aria-keyshortcuts": $e.ariaKeyShortcuts,
665
+ "aria-pressed": pe,
666
+ className: "slide-player__action slide-player__action--subtitle",
667
+ onClick: Q,
668
+ title: $e.title,
669
+ type: "button",
670
+ children: pe ? /* @__PURE__ */ n.jsx(Yr, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ n.jsx(
671
+ Dr,
672
+ {
673
+ className: "slide-player__icon",
674
+ strokeWidth: 2.25
561
675
  }
562
- O(!0), v.current = "manual", h.current = !1, s.current = !0, n(!0, "waitingForMoreAudio");
563
- return;
564
- }
565
- if (!e.src && M.length > 0) {
566
- O(!0), v.current = "manual", h.current = !1, E(
567
- Math.min(
568
- S.current,
569
- M.length - 1
570
- ),
571
- "toggle"
572
- );
573
- return;
574
- }
575
- if (e.paused) {
576
- O(!0), v.current = "manual", h.current = !1, s.current = !0, k("toggle-resume");
577
- return;
578
- }
579
- O(!1), s.current = !1, h.current = !0, e.pause();
676
+ )
580
677
  }
581
- },
582
- type: "button",
583
- children: ze ? /* @__PURE__ */ t.jsx(Mr, {}) : /* @__PURE__ */ t.jsx(kr, {})
584
- }
585
- ),
586
- /* @__PURE__ */ t.jsx(
587
- "button",
588
- {
589
- "aria-label": "Forward",
590
- className: "slide-player__action slide-player__action--next",
591
- disabled: Ke,
592
- onClick: () => {
593
- Pe?.(Me());
594
- },
595
- type: "button",
596
- children: /* @__PURE__ */ t.jsx(br, { className: "slide-player__icon", strokeWidth: 2.25 })
597
- }
598
- ),
599
- oe ? /* @__PURE__ */ t.jsx(
600
- "button",
601
- {
602
- "aria-label": fe ? "Exit fullscreen" : "Enter fullscreen",
603
- className: "slide-player__action slide-player__action--fullscreen",
604
- onClick: oe,
605
- type: "button",
606
- children: fe ? /* @__PURE__ */ t.jsx(
607
- xr,
678
+ ),
679
+ /* @__PURE__ */ n.jsx(
680
+ "button",
608
681
  {
609
- className: "slide-player__icon",
610
- strokeWidth: 2.25
682
+ "aria-keyshortcuts": Ze.ariaKeyShortcuts,
683
+ "aria-label": l.previousLabel,
684
+ className: "slide-player__action slide-player__action--prev",
685
+ disabled: he,
686
+ onClick: () => {
687
+ ue?.(te());
688
+ },
689
+ title: Ze.title,
690
+ type: "button",
691
+ children: /* @__PURE__ */ n.jsx(Xr, { className: "slide-player__icon", strokeWidth: 2.25 })
611
692
  }
612
- ) : /* @__PURE__ */ t.jsx(
613
- Sr,
693
+ ),
694
+ /* @__PURE__ */ n.jsx(
695
+ "button",
614
696
  {
615
- className: "slide-player__icon",
616
- strokeWidth: 2.25
697
+ "aria-label": Ve,
698
+ "aria-keyshortcuts": qe.ariaKeyShortcuts,
699
+ className: "slide-player__toggle slide-player__toggle--playback",
700
+ onClick: () => {
701
+ _e();
702
+ },
703
+ title: qe.title,
704
+ type: "button",
705
+ children: pr ? /* @__PURE__ */ n.jsx(et, {}) : /* @__PURE__ */ n.jsx(rt, {})
706
+ }
707
+ ),
708
+ /* @__PURE__ */ n.jsx(
709
+ "button",
710
+ {
711
+ "aria-keyshortcuts": ze.ariaKeyShortcuts,
712
+ "aria-label": l.nextLabel,
713
+ className: "slide-player__action slide-player__action--next",
714
+ disabled: ye,
715
+ onClick: () => {
716
+ ae?.(te());
717
+ },
718
+ title: ze.title,
719
+ type: "button",
720
+ children: /* @__PURE__ */ n.jsx(Gr, { className: "slide-player__icon", strokeWidth: 2.25 })
617
721
  }
618
- )
619
- }
620
- ) : null
621
- ] }),
622
- /* @__PURE__ */ t.jsx("div", { className: "slide-player__separator" }),
623
- /* @__PURE__ */ t.jsxs("div", { className: "slide-player__group", children: [
624
- Se.map((e, r) => /* @__PURE__ */ t.jsx(sr.Fragment, { children: e }, `custom-action-${r}`)),
625
- /* @__PURE__ */ t.jsx(
626
- "button",
627
- {
628
- "aria-label": "Notes",
629
- className: Le(
630
- "slide-player__action slide-player__action--notes",
631
- D && "slide-player__action--active"
632
722
  ),
633
- disabled: !$e,
634
- onClick: Ze,
635
- type: "button",
636
- children: /* @__PURE__ */ t.jsx(
637
- wr,
723
+ I ? /* @__PURE__ */ n.jsx(
724
+ "button",
638
725
  {
639
- className: "slide-player__icon",
640
- strokeWidth: 2.25
726
+ "aria-label": He,
727
+ "aria-keyshortcuts": Ye.ariaKeyShortcuts,
728
+ className: "slide-player__action slide-player__action--fullscreen",
729
+ onClick: I,
730
+ title: Ye.title,
731
+ type: "button",
732
+ children: Le ? /* @__PURE__ */ n.jsx(
733
+ Jr,
734
+ {
735
+ className: "slide-player__icon",
736
+ strokeWidth: 2.25
737
+ }
738
+ ) : /* @__PURE__ */ n.jsx(
739
+ Qr,
740
+ {
741
+ className: "slide-player__icon",
742
+ strokeWidth: 2.25
743
+ }
744
+ )
745
+ }
746
+ ) : null
747
+ ] }),
748
+ /* @__PURE__ */ n.jsx("div", { className: "slide-player__separator" }),
749
+ /* @__PURE__ */ n.jsxs("div", { className: "slide-player__group", children: [
750
+ Oe.map((e, r) => /* @__PURE__ */ n.jsx(Rr.Fragment, { children: e }, `custom-action-${r}`)),
751
+ /* @__PURE__ */ n.jsx(
752
+ "button",
753
+ {
754
+ "aria-label": l.notesLabel,
755
+ "aria-keyshortcuts": De.ariaKeyShortcuts,
756
+ className: ur(
757
+ "slide-player__action slide-player__action--notes",
758
+ ee && "slide-player__action--active"
759
+ ),
760
+ disabled: !me,
761
+ onClick: se,
762
+ title: De.title,
763
+ type: "button",
764
+ children: /* @__PURE__ */ n.jsx(
765
+ Ir,
766
+ {
767
+ className: "slide-player__icon",
768
+ strokeWidth: 2.25
769
+ }
770
+ )
641
771
  }
642
772
  )
643
- }
644
- )
645
- ] })
646
- ] })
647
- ] }) : null
648
- ] });
649
- }, Er = lr(jr);
650
- Er.displayName = "Player";
773
+ ] })
774
+ ] })
775
+ ] }) : null
776
+ ]
777
+ }
778
+ );
779
+ }, ut = Er(nt);
780
+ ut.displayName = "Player";
651
781
  export {
652
- Er as default
782
+ ut as default
653
783
  };
654
784
  //# sourceMappingURL=Player.es.js.map