markdown-flow-ui 0.2.25-dev.3 → 0.2.25-dev.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,79 +1,78 @@
1
- import { jsxs as Ge, jsx as u, Fragment as Yr } from "react/jsx-runtime";
2
- import { memo as Gr, useMemo as d, useId as $r, useRef as m, useCallback as r, useState as p, useEffect as s, useLayoutEffect as Un } from "react";
3
- import { isSandboxInteractionMessage as zr } from "../../lib/sandboxInteraction.es.js";
1
+ import { jsxs as Ge, jsx as u, Fragment as Ur } from "react/jsx-runtime";
2
+ import { memo as Hr, useMemo as f, useId as Yr, useRef as m, useCallback as r, useState as p, useEffect as s, useLayoutEffect as Gr } from "react";
3
+ import { isSandboxInteractionMessage as $r } from "../../lib/sandboxInteraction.es.js";
4
4
  import { cn as we } from "../../lib/utils.es.js";
5
- import { useResolvedDirection as Xr } from "../../lib/useResolvedDirection.es.js";
6
- import { getMarkdownFlowDirection as Jr, getMarkdownFlowLanguage as Wr } from "../../lib/locale.es.js";
7
- import jr from "../ui/loading-overlay-card.es.js";
8
- import Qr from "../ContentRender/ContentRender.es.js";
9
- import Ln from "../ContentRender/IframeSandbox.es.js";
5
+ import { useResolvedDirection as zr } from "../../lib/useResolvedDirection.es.js";
6
+ import { getMarkdownFlowDirection as Xr, getMarkdownFlowLanguage as Jr } from "../../lib/locale.es.js";
7
+ import Wr from "../ui/loading-overlay-card.es.js";
8
+ import jr from "../ContentRender/ContentRender.es.js";
9
+ import kn from "../ContentRender/IframeSandbox.es.js";
10
10
  import "../ui/inputGroup/input-group.es.js";
11
- import { isMobileDevice as Zr, isLandscapeViewport as Nn, subscribeMobileDeviceChange as eo } from "../../lib/mobileDevice.es.js";
12
- import to from "./Player.es.js";
13
- import no from "./MarkdownSlideScaling.es.js";
14
- import ro from "./SubtitleOverlay.es.js";
15
- import oo from "./useSlide.es.js";
16
- import io from "./useWakePlayerFromIframe.es.js";
17
- import { PlayerKeyboardShortcutContext as lo } from "./utils/playerKeyboardShortcutContext.es.js";
18
- import { activatePlayerKeyboardShortcutOwner as ao } from "./utils/playerKeyboardShortcuts.es.js";
19
- import { DEFAULT_MOBILE_VIEW_MODE as St, resolveMobileViewModeState as so } from "./utils/mobileScreenMode.es.js";
20
- import { shouldRenderInteractionOverlay as co, clampInteractionOverlayDragOffset as Dn, shouldPresentInteractionOverlay as uo } from "./utils/interactionPlayback.es.js";
21
- import { resolveMarkdownScalingMode as fo } from "./utils/markdownScaling.es.js";
22
- import { shouldWakePlayerControlsAfterNavigation as Yt } from "./utils/playerNavigationContext.es.js";
23
- import { shouldAutoAdvanceIntoAppendedMarker as mo } from "./utils/appendedMarkerAdvance.es.js";
24
- import { resolveRequestedStepNavigation as po } from "./utils/requestedStepNavigation.es.js";
25
- import { resolvePendingStepAudioKey as yo, hasUnplayedStepAudio as ho } from "./utils/stepAudioProgress.es.js";
26
- import { getPlaybackSequenceTransition as go, shouldStartDefaultAudioSequence as vo } from "./utils/playbackSequence.es.js";
27
- import { hasResolvedInteractionElement as So, canReachSubtitleJumpTarget as Bn } from "./utils/subtitleJumpNavigation.es.js";
28
- import { resolvePlayerCustomActionElement as Io, getPlayerCustomActionCount as bo } from "./utils/playerCustomActions.es.js";
29
- import { createPlaybackTimeStore as Ao } from "./utils/playbackTimeStore.es.js";
30
- import { resolveSlideInteractionState as wo } from "./utils/interactionResolution.es.js";
31
- import { shouldUseAutoAdvanceToggle as xo } from "./utils/playerToggleMode.es.js";
32
- import { DEFAULT_IMAGE_ONLY_VISUAL_READY_TIMEOUT_MS as Co, areImageOnlyStepIframeVisualsReady as Eo } from "./utils/imageOnlyStepVisualReady.es.js";
11
+ import { isMobileDevice as Qr, isLandscapeViewport as Fn, subscribeMobileDeviceChange as Zr } from "../../lib/mobileDevice.es.js";
12
+ import eo from "./Player.es.js";
13
+ import to from "./MarkdownSlideScaling.es.js";
14
+ import no from "./SubtitleOverlay.es.js";
15
+ import ro from "./useSlide.es.js";
16
+ import oo from "./useWakePlayerFromIframe.es.js";
17
+ import { PlayerKeyboardShortcutContext as io } from "./utils/playerKeyboardShortcutContext.es.js";
18
+ import { activatePlayerKeyboardShortcutOwner as lo } from "./utils/playerKeyboardShortcuts.es.js";
19
+ import { DEFAULT_MOBILE_VIEW_MODE as St, resolveMobileViewModeState as ao } from "./utils/mobileScreenMode.es.js";
20
+ import { shouldRenderInteractionOverlay as so, clampInteractionOverlayDragOffset as Ln, shouldPresentInteractionOverlay as co } from "./utils/interactionPlayback.es.js";
21
+ import { resolveMarkdownScalingMode as uo } from "./utils/markdownScaling.es.js";
22
+ import { shouldWakePlayerControlsAfterNavigation as Gt } from "./utils/playerNavigationContext.es.js";
23
+ import { shouldAutoAdvanceIntoAppendedMarker as fo } from "./utils/appendedMarkerAdvance.es.js";
24
+ import { resolvePendingStepAudioKey as mo, hasUnplayedStepAudio as po } from "./utils/stepAudioProgress.es.js";
25
+ import { getPlaybackSequenceTransition as yo, shouldStartDefaultAudioSequence as ho } from "./utils/playbackSequence.es.js";
26
+ import { hasResolvedInteractionElement as go, canReachSubtitleJumpTarget as Dn } from "./utils/subtitleJumpNavigation.es.js";
27
+ import { resolvePlayerCustomActionElement as vo, getPlayerCustomActionCount as So } from "./utils/playerCustomActions.es.js";
28
+ import { createPlaybackTimeStore as Io } from "./utils/playbackTimeStore.es.js";
29
+ import { resolveSlideInteractionState as bo } from "./utils/interactionResolution.es.js";
30
+ import { shouldUseAutoAdvanceToggle as Ao } from "./utils/playerToggleMode.es.js";
31
+ import { DEFAULT_IMAGE_ONLY_VISUAL_READY_TIMEOUT_MS as wo, areImageOnlyStepIframeVisualsReady as xo } from "./utils/imageOnlyStepVisualReady.es.js";
33
32
  import { resolveSilentStepAutoAdvanceBehavior as Po } from "./utils/silentStepAutoAdvance.es.js";
34
- import { resolveSlidePlayerVisibility as To, resolveSlidePlayerLayoutState as Ro } from "./utils/playerVisibility.es.js";
35
- import { getSlideLocaleTexts as _o, DEFAULT_SLIDE_BUFFERING_TEXTS as Oo } from "./slideI18n.es.js";
33
+ import { resolveSlidePlayerVisibility as Co, resolveSlidePlayerLayoutState as Eo } from "./utils/playerVisibility.es.js";
34
+ import { getSlideLocaleTexts as To, DEFAULT_SLIDE_BUFFERING_TEXTS as Ro } from "./slideI18n.es.js";
36
35
  /* empty css */
37
- import Gt from "../../node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js";
38
- import Mo from "../../node_modules/lucide-react/dist/esm/icons/chevron-left.es.js";
39
- const ko = 2e3, Fo = 300, Lo = 160, No = 16, Vn = 3e3, It = {
36
+ import $t from "../../node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js";
37
+ import _o from "../../node_modules/lucide-react/dist/esm/icons/chevron-left.es.js";
38
+ const Oo = 2e3, Mo = 300, ko = 160, Fo = 16, Nn = 3e3, It = {
40
39
  x: 0,
41
40
  y: 0
42
- }, zt = 0.5, Do = typeof window > "u" ? s : Un, Bo = [
41
+ }, Xt = 0.5, Lo = typeof window > "u" ? s : Gr, Do = [
43
42
  "button",
44
43
  "input",
45
44
  "textarea",
46
45
  '[contenteditable=""]',
47
46
  '[contenteditable="true"]',
48
47
  '[contenteditable="plaintext-only"]'
49
- ].join(", "), Xt = "waitingForAudio", Vo = ({
48
+ ].join(", "), Jt = "waitingForAudio", No = ({
50
49
  x: c,
51
- y: f
50
+ y: d
52
51
  }) => ({
53
52
  x: Number(c.toFixed(2)),
54
- y: Number(f.toFixed(2))
55
- }), Kn = (c) => Math.abs(c) >= zt, qn = (c, f) => Math.abs(c.x - f.x) < zt && Math.abs(c.y - f.y) < zt, Ko = (c, f) => typeof c == "string" ? c : c[f] ?? c[Xt] ?? Oo[f], qo = (c, f) => typeof c == "string" ? c : {
56
- ...f,
53
+ y: Number(d.toFixed(2))
54
+ }), Bn = (c) => Math.abs(c) >= Xt, Vn = (c, d) => Math.abs(c.x - d.x) < Xt && Math.abs(c.y - d.y) < Xt, Bo = (c, d) => typeof c == "string" ? c : c[d] ?? c[Jt] ?? Ro[d], Vo = (c, d) => typeof c == "string" ? c : {
55
+ ...d,
57
56
  ...c
58
- }, Uo = (c, f) => f ? c !== "loadingAudio" : !1, Hn = Gr(
57
+ }, Ko = (c, d) => d ? c !== "loadingAudio" : !1, Kn = Hr(
59
58
  ({
60
59
  content: c,
61
- title: f,
62
- dragHandleAriaLabel: Y,
60
+ title: d,
61
+ dragHandleAriaLabel: G,
63
62
  locale: xe,
64
- dir: G,
65
- lang: $,
66
- defaultButtonText: Ce,
63
+ dir: $,
64
+ lang: z,
65
+ defaultButtonText: Pe,
67
66
  defaultInputText: ae,
68
67
  defaultSelectedValues: $e,
69
68
  confirmButtonText: bt,
70
- copyButtonText: z,
69
+ copyButtonText: X,
71
70
  copiedButtonText: At,
72
- onSend: Ee,
71
+ onSend: Ce,
73
72
  onDragHandlePointerCancel: ze,
74
73
  onDragHandlePointerDown: Xe,
75
74
  onDragHandlePointerMove: Je,
76
- onDragHandlePointerUp: Pe,
75
+ onDragHandlePointerUp: Ee,
77
76
  readonly: We = !1
78
77
  }) => /* @__PURE__ */ Ge("div", { className: "slide-player__interaction-card", children: [
79
78
  /* @__PURE__ */ u(
@@ -81,200 +80,194 @@ const ko = 2e3, Fo = 300, Lo = 160, No = 16, Vn = 3e3, It = {
81
80
  {
82
81
  type: "button",
83
82
  className: "slide-player__interaction-drag-handle",
84
- "aria-label": Y,
83
+ "aria-label": G,
85
84
  onPointerCancel: ze,
86
85
  onPointerDown: Xe,
87
86
  onPointerMove: Je,
88
- onPointerUp: Pe,
87
+ onPointerUp: Ee,
89
88
  children: /* @__PURE__ */ Ge("span", { className: "slide-player__interaction-drag-handle-icon", children: [
90
- /* @__PURE__ */ u(Gt, { "aria-hidden": "true" }),
91
- /* @__PURE__ */ u(Gt, { "aria-hidden": "true" }),
92
- /* @__PURE__ */ u(Gt, { "aria-hidden": "true" })
89
+ /* @__PURE__ */ u($t, { "aria-hidden": "true" }),
90
+ /* @__PURE__ */ u($t, { "aria-hidden": "true" }),
91
+ /* @__PURE__ */ u($t, { "aria-hidden": "true" })
93
92
  ] })
94
93
  }
95
94
  ),
96
- /* @__PURE__ */ u("div", { className: "slide-player__interaction-header", children: /* @__PURE__ */ u("p", { className: "slide-player__interaction-title", children: f }) }),
95
+ /* @__PURE__ */ u("div", { className: "slide-player__interaction-header", children: /* @__PURE__ */ u("p", { className: "slide-player__interaction-title", children: d }) }),
97
96
  /* @__PURE__ */ u("div", { className: "slide-player__interaction-body", children: /* @__PURE__ */ u(
98
- Qr,
97
+ jr,
99
98
  {
100
99
  content: c,
101
100
  locale: xe,
102
- dir: G,
103
- lang: $,
104
- defaultButtonText: Ce,
101
+ dir: $,
102
+ lang: z,
103
+ defaultButtonText: Pe,
105
104
  defaultInputText: ae,
106
105
  defaultSelectedValues: $e,
107
106
  confirmButtonText: bt,
108
- copyButtonText: z,
107
+ copyButtonText: X,
109
108
  copiedButtonText: At,
110
- onSend: Ee,
109
+ onSend: Ce,
111
110
  readonly: We,
112
111
  sandboxMode: "content"
113
112
  }
114
113
  ) })
115
114
  ] })
116
115
  );
117
- Hn.displayName = "InteractionOverlayCard";
118
- const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
119
- const G = f[xe];
120
- return Y.sequence_number === G?.sequence_number && Y.type === G?.type && Y.content === G?.content;
121
- }), $t = (c) => c instanceof HTMLElement && !!c.closest(Bo), _i = ({
116
+ Kn.displayName = "InteractionOverlayCard";
117
+ const qo = (c, d) => c.length === d.length && c.every((G, xe) => {
118
+ const $ = d[xe];
119
+ return G.sequence_number === $?.sequence_number && G.type === $?.type && G.content === $?.content;
120
+ }), zt = (c) => c instanceof HTMLElement && !!c.closest(Do), Ei = ({
122
121
  elementList: c = [],
123
- locale: f,
124
- playerEnabled: Y,
122
+ locale: d,
123
+ playerEnabled: G,
125
124
  playerControlsVisibility: xe,
126
- playerClassName: G,
127
- fullscreenHeader: $,
128
- playerCustomActions: Ce,
125
+ playerClassName: $,
126
+ fullscreenHeader: z,
127
+ playerCustomActions: Pe,
129
128
  playerCustomActionPauseOnActive: ae = !0,
130
129
  bufferingText: $e,
131
130
  interactionTitle: bt,
132
- interactionTexts: z,
131
+ interactionTexts: X,
133
132
  playerTexts: At,
134
- playerAutoHideDelay: Ee = 3e3,
135
- markerAutoAdvanceDelay: ze = ko,
133
+ playerAutoHideDelay: Ce = 3e3,
134
+ markerAutoAdvanceDelay: ze = Oo,
136
135
  interactionDefaultValueOptions: Xe,
137
136
  onSend: Je,
138
- onPlayerVisibilityChange: Pe,
137
+ onPlayerVisibilityChange: Ee,
139
138
  onMobileViewModeChange: We,
140
- onStepChange: Jt,
141
- onPlaybackPositionChange: Wt,
142
- playbackResumeRequest: se = null,
143
- requestedStepIndex: jt,
144
- enableKeyboardShortcuts: ce = !0,
145
- enableIframeScaling: Yn = !0,
146
- enableMarkdownScaling: Gn = !0,
139
+ onStepChange: Wt,
140
+ onPlaybackCheckpoint: qn,
141
+ playbackRestoreRequest: q = null,
142
+ enableKeyboardShortcuts: se = !0,
143
+ enableIframeScaling: Un = !0,
144
+ enableMarkdownScaling: Hn = !0,
147
145
  disableLoadingOverlay: F = !1,
148
- className: $n,
149
- dir: zn,
150
- lang: Xn,
151
- onPointerDown: Qt,
152
- onFocusCapture: Zt,
153
- ...Jn
146
+ className: Yn,
147
+ dir: Gn,
148
+ lang: $n,
149
+ onPointerDown: jt,
150
+ onFocusCapture: Qt,
151
+ ...zn
154
152
  }) => {
155
- const X = zn ?? Jr(f), Te = Xn ?? Wr(f), K = d(() => _o(f), [f]), Wn = d(
156
- () => qo(
153
+ const J = Gn ?? Xr(d), Te = $n ?? Jr(d), U = f(() => To(d), [d]), Xn = f(
154
+ () => Vo(
157
155
  $e,
158
- K.bufferingText
156
+ U.bufferingText
159
157
  ),
160
- [$e, K.bufferingText]
158
+ [$e, U.bufferingText]
161
159
  ), {
162
- playerEnabled: jn,
163
- playerControlsVisibility: J
164
- } = To({
165
- playerEnabled: Y,
160
+ playerEnabled: Jn,
161
+ playerControlsVisibility: W
162
+ } = Co({
163
+ playerEnabled: G,
166
164
  playerControlsVisibility: xe
167
- }), je = $r(), ue = m(null), { resolvedDirection: Qn } = Xr(ue, X), wt = m(null), Qe = m(null), en = m(null), de = m(null), Ze = m(!1), Re = m(null), et = m(null), W = m(null), _e = m(null), Oe = m(null), fe = m(null), Me = m(null), tn = m([]), ke = m(!1), j = m(null), Fe = m(null), nn = m(0), rn = m(null), on = m(null), ln = m({
165
+ }), je = Yr(), ce = m(null), { resolvedDirection: Wn } = zr(ce, J), wt = m(null), Qe = m(null), Zt = m(null), ue = m(null), Ze = m(!1), Re = m(null), et = m(null), j = m(null), _e = m(null), Oe = m(null), de = m(null), Me = m(null), en = m([]), ke = m(!1), Q = m(null), Fe = m(null), tn = m(0), xt = m(null), nn = m({
168
166
  markerCount: 0,
169
167
  currentIndex: -1,
170
168
  canGoNext: !1
171
- }), xt = m(!1), {
169
+ }), Pt = m(!1), {
172
170
  currentElementList: T,
173
- stepElementLists: an,
174
- slideElementList: b,
171
+ stepElementLists: rn,
172
+ slideElementList: E,
175
173
  currentIndex: a,
176
- audioList: h,
177
- audioSlideIndexes: tt,
178
- currentAudioSequenceIndexes: nt,
179
- currentStepHasSpeakableElement: A,
180
- currentInteractionElement: y,
181
- canGoPrev: Zn,
174
+ audioList: y,
175
+ audioSlideIndexes: Z,
176
+ currentAudioSequenceIndexes: tt,
177
+ currentStepHasSpeakableElement: b,
178
+ currentInteractionElement: h,
179
+ canGoPrev: jn,
182
180
  canGoNext: R,
183
- handlePrev: sn,
181
+ handlePrev: on,
184
182
  handleNext: L,
185
- handleGoTo: rt
186
- } = oo(c), ot = m(null), me = d(
187
- () => po({
188
- currentStepIndex: a,
189
- requestedStepIndex: jt,
190
- slideStepCount: b.length
191
- }),
192
- [a, jt, b.length]
193
- ), Le = d(() => {
183
+ handleGoTo: nt
184
+ } = ro(c), Le = f(() => {
194
185
  if (!(a < 0))
195
- return b[a];
196
- }, [a, b]), pe = d(
186
+ return E[a];
187
+ }, [a, E]), fe = f(
197
188
  () => T.map(
198
189
  (e, t) => `${e.sequence_number ?? `${e.type}-${t}`}:${String(e.is_new ?? "")}`
199
190
  ),
200
191
  [T]
201
- ), er = b.filter(
192
+ ), Qn = E.filter(
202
193
  (e) => e.is_renderable !== !1
203
- ).length === 1, w = jn && (b.length > 0 || h.length > 0 || !!y), tr = d(
194
+ ).length === 1, A = Jn && (E.length > 0 || y.length > 0 || !!h), Zn = f(
204
195
  () => ({
205
- enabled: ce,
196
+ enabled: se,
206
197
  ownerId: je
207
198
  }),
208
- [ce, je]
209
- ), q = r(() => {
210
- !ce || !w || ao(je);
211
- }, [ce, je, w]), _ = d(
212
- () => nt.map((e) => h[e]?.audioKey).filter((e) => !!e),
213
- [h, nt]
214
- ), [nr, Ne] = p(!0), [it, ye] = p(!1), [Ct, cn] = p(!0), [De, un] = p(!0), [C, U] = p(null), [rr, dn] = p(null), [or, x] = p(!1), [ir, Et] = p(Xt), [O, lt] = p(!1), at = m(/* @__PURE__ */ new Set()), [lr, st] = p(!1), [fn, ar] = p(!0), [Pt, Tt] = p(!1), [S, Rt] = p(), [he, ct] = p(!1), [mn, ut] = p(!1), [E, _t] = p(
199
+ [se, je]
200
+ ), H = r(() => {
201
+ !se || !A || lo(je);
202
+ }, [se, je, A]), _ = f(
203
+ () => tt.map((e) => y[e]?.audioKey).filter((e) => !!e),
204
+ [y, tt]
205
+ ), [er, De] = p(!0), [rt, me] = p(!1), [Ct, Et] = p(!0), [Ne, ln] = p(!0), [x, N] = p(null), [ot, an] = p(null), Be = m(
206
+ null
207
+ ), sn = m(null), [tr, cn] = p(null), [nr, w] = p(!1), [rr, Tt] = p(Jt), [O, it] = p(!1), lt = m(/* @__PURE__ */ new Set()), [or, at] = p(!1), [un, ir] = p(!0), [Rt, _t] = p(!1), [S, Ot] = p(), [pe, st] = p(!1), [dn, ct] = p(!1), [P, Mt] = p(
215
208
  It
216
- ), [Ot, Mt] = p(!1), [
217
- sr,
218
- ge
219
- ] = p(0), [pn, cr] = p(!1), D = d(() => Zr(), []), [dt, kt] = p(
209
+ ), [kt, Ft] = p(!1), [
210
+ lr,
211
+ ye
212
+ ] = p(0), [fn, ar] = p(!1), B = f(() => Qr(), []), [ut, Lt] = p(
220
213
  St
221
- ), [yn, Ft] = p(!1), [ur, hn] = p(
222
- () => D ? Nn() : !1
223
- ), Q = d(() => Ao(), []), {
224
- effectiveMobileViewMode: Z,
225
- isImmersiveMobileFullscreen: ve,
226
- isNativeMobileFullscreen: gn,
227
- shouldRotateFullscreenViewport: dr
228
- } = d(
229
- () => so({
230
- hasManualMobileViewMode: yn,
231
- isMobileDevice: D,
232
- mobileViewMode: dt
214
+ ), [mn, Dt] = p(!1), [sr, pn] = p(
215
+ () => B ? Fn() : !1
216
+ ), he = f(() => Io(), []), {
217
+ effectiveMobileViewMode: ee,
218
+ isImmersiveMobileFullscreen: ge,
219
+ isNativeMobileFullscreen: yn,
220
+ shouldRotateFullscreenViewport: cr
221
+ } = f(
222
+ () => ao({
223
+ hasManualMobileViewMode: mn,
224
+ isMobileDevice: B,
225
+ mobileViewMode: ut
233
226
  }),
234
227
  [
235
- yn,
236
- D,
237
- ur,
238
- dt
228
+ mn,
229
+ B,
230
+ sr,
231
+ ut
239
232
  ]
240
- ), vn = m(Z), {
241
- controlsVisible: B,
242
- layoutReserved: ft
243
- } = Ro({
244
- isAutoVisible: nr,
245
- playerControlsVisibility: J,
246
- shouldMountPlayer: w
247
- }), fr = ve && B, mr = ve && ft, pr = ve || gn, Sn = pn && !D, yr = r(
233
+ ), hn = m(ee), {
234
+ controlsVisible: V,
235
+ layoutReserved: dt
236
+ } = Eo({
237
+ isAutoVisible: er,
238
+ playerControlsVisibility: W,
239
+ shouldMountPlayer: A
240
+ }), ur = ge && V, dr = ge && dt, fr = ge || yn, gn = fn && !B, mr = r(
248
241
  (e) => {
249
- Ft(!0), kt(e);
242
+ Dt(!0), Lt(e);
250
243
  },
251
244
  []
252
- ), In = r(() => {
253
- Ft(!1), kt(St);
254
- }, []), hr = r(() => {
255
- In(), $?.onBack?.();
256
- }, [$, In]), M = r(() => {
257
- W.current !== null && (window.clearTimeout(W.current), W.current = null);
245
+ ), vn = r(() => {
246
+ Dt(!1), Lt(St);
247
+ }, []), pr = r(() => {
248
+ vn(), z?.onBack?.();
249
+ }, [z, vn]), M = r(() => {
250
+ j.current !== null && (window.clearTimeout(j.current), j.current = null);
258
251
  }, []), k = r(() => {
259
252
  _e.current !== null && (window.clearTimeout(_e.current), _e.current = null);
260
- }, []), mt = r(() => {
261
- M(), k(), ct(!1), ge(0);
262
- }, [M, k]), pt = r(
253
+ }, []), ft = r(() => {
254
+ M(), k(), st(!1), ye(0);
255
+ }, [M, k]), mt = r(
263
256
  (e) => {
264
- e && mt(), Tt(e);
257
+ e && ft(), _t(e);
265
258
  },
266
- [mt]
267
- ), bn = r(() => {
268
- mt(), Tt((e) => !e);
269
- }, [mt]), ee = r(() => {
270
- _t(
259
+ [ft]
260
+ ), Sn = r(() => {
261
+ ft(), _t((e) => !e);
262
+ }, [ft]), te = r(() => {
263
+ Mt(
271
264
  (e) => e.x === It.x && e.y === It.y ? e : It
272
- ), Mt(!1), Me.current = null, fe.current = null;
273
- }, []), { mountedStepStates: gr, currentMountedStateIndex: vr } = d(() => {
265
+ ), Ft(!1), Me.current = null, de.current = null;
266
+ }, []), { mountedStepStates: yr, currentMountedStateIndex: hr } = f(() => {
274
267
  const e = [], t = /* @__PURE__ */ new Map();
275
- return an.forEach((n, i) => {
268
+ return rn.forEach((n, i) => {
276
269
  const l = e.findIndex(
277
- (o) => Ho(
270
+ (o) => qo(
278
271
  o.elementList,
279
272
  n
280
273
  )
@@ -291,214 +284,232 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
291
284
  mountedStepStates: e,
292
285
  currentMountedStateIndex: a >= 0 ? t.get(a) ?? -1 : -1
293
286
  };
294
- }, [a, an]), An = d(() => String(a), [a]), P = d(() => C ? h.findIndex(
295
- (e) => (e.audioKey ?? "") === C
296
- ) : -1, [h, C]), te = d(
297
- () => P >= 0 ? h[P] : void 0,
298
- [h, P]
299
- ), Sr = te?.element?.subtitle_cues ?? [], yt = d(
287
+ }, [a, rn]), In = f(() => String(a), [a]), C = f(() => x ? y.findIndex(
288
+ (e) => (e.audioKey ?? "") === x
289
+ ) : -1, [y, x]), pt = f(
290
+ () => C >= 0 ? y[C] : void 0,
291
+ [y, C]
292
+ );
293
+ s(() => {
294
+ if (!q || q.id === sn.current)
295
+ return;
296
+ const e = y.findIndex(
297
+ (n) => n.audioKey === q.audioKey
298
+ );
299
+ if (e < 0)
300
+ return;
301
+ const t = Z[e];
302
+ t != null && (sn.current = q.id, Et(!0), N(q.audioKey), Be.current = q, an(q), a !== t && nt(t));
303
+ }, [
304
+ y,
305
+ Z,
306
+ a,
307
+ nt,
308
+ q
309
+ ]);
310
+ const gr = pt?.element?.subtitle_cues ?? [], yt = f(
300
311
  () => _[0] ?? "none",
301
312
  [_]
302
- ), Lt = d(
313
+ ), Nt = f(
303
314
  () => ({
304
- currentElement: Io({
305
- currentAudioIndex: P,
306
- currentAudioSequenceIndexes: nt,
307
- audioList: h,
315
+ currentElement: vo({
316
+ currentAudioIndex: C,
317
+ currentAudioSequenceIndexes: tt,
318
+ audioList: y,
308
319
  currentInteractionElement: S,
309
320
  currentStepElement: Le
310
321
  }),
311
322
  currentIndex: a,
312
323
  currentStepElement: Le,
313
- isActive: Pt,
314
- setActive: pt,
315
- toggleActive: bn
324
+ isActive: Rt,
325
+ setActive: mt,
326
+ toggleActive: Sn
316
327
  }),
317
328
  [
318
329
  S,
319
- h,
320
- P,
321
- nt,
330
+ y,
331
+ C,
332
+ tt,
322
333
  a,
323
334
  Le,
324
- Pt,
325
- pt,
326
- bn
335
+ Rt,
336
+ mt,
337
+ Sn
327
338
  ]
328
- ), ht = d(
329
- () => bo(
330
- Ce,
331
- Lt
339
+ ), ht = f(
340
+ () => So(
341
+ Pe,
342
+ Nt
332
343
  ),
333
- [Lt, Ce]
334
- ), Nt = ht > 0, Dt = Nt && Pt, Ir = d(
344
+ [Nt, Pe]
345
+ ), Bt = ht > 0, Vt = Bt && Rt, vr = f(
335
346
  () => ({
336
347
  "--slide-player-custom-action-count": String(ht),
337
348
  "--slide-player-mobile-control-count": String(
338
349
  ht + 4
339
350
  ),
340
- "--slide-interaction-drag-x": `${E.x}px`,
341
- "--slide-interaction-drag-y": `${E.y}px`
351
+ "--slide-interaction-drag-x": `${P.x}px`,
352
+ "--slide-interaction-drag-y": `${P.y}px`
342
353
  }),
343
354
  [
344
- E.x,
345
- E.y,
355
+ P.x,
356
+ P.y,
346
357
  ht
347
358
  ]
348
- ), wn = _.length > 0, xn = d(() => y ? `${y.sequence_number ?? "none"}:${String(
349
- y.content ?? ""
350
- )}` : "none", [y]), Be = d(
351
- () => [An, xn].join("|"),
352
- [xn, An]
353
- ), br = d(
359
+ ), bn = _.length > 0, An = f(() => h ? `${h.sequence_number ?? "none"}:${String(
360
+ h.content ?? ""
361
+ )}` : "none", [h]), ve = f(
362
+ () => [In, An].join("|"),
363
+ [An, In]
364
+ ), Sr = f(
354
365
  () => [
355
- Be,
356
- te?.audioKey ?? "none",
357
- String(P)
366
+ ve,
367
+ pt?.audioKey ?? "none",
368
+ String(C)
358
369
  ].join("|"),
359
- [P, te?.audioKey, Be]
360
- ), Cn = !!d(() => !yt || yt === "none" ? "" : h.find(
370
+ [C, pt?.audioKey, ve]
371
+ ), wn = !!f(() => !yt || yt === "none" ? "" : y.find(
361
372
  (t) => t.audioKey === yt
362
- )?.audioUrl?.trim() ?? "", [h, yt]), ne = ae && Dt, Ve = d(
363
- () => xo({
373
+ )?.audioUrl?.trim() ?? "", [y, yt]), ne = ae && Vt, Ve = f(
374
+ () => Ao({
364
375
  canGoNext: R,
365
- currentAudioIndex: P,
366
- currentStepHasSpeakableElement: A,
367
- hasInteraction: !!y
376
+ currentAudioIndex: C,
377
+ currentStepHasSpeakableElement: b,
378
+ hasInteraction: !!h
368
379
  }),
369
380
  [
370
381
  R,
371
- P,
372
- y,
373
- A
382
+ C,
383
+ h,
384
+ b
374
385
  ]
375
- ), En = d(
386
+ ), xn = f(
376
387
  () => Po({
377
388
  currentElementList: T,
378
- currentStepHasSpeakableElement: A,
379
- currentInteractionElement: y,
389
+ currentStepHasSpeakableElement: b,
390
+ currentInteractionElement: h,
380
391
  markerAutoAdvanceDelay: ze
381
392
  }),
382
393
  [
383
394
  T,
384
- y,
385
- A,
395
+ h,
396
+ b,
386
397
  ze
387
398
  ]
388
- ), Pn = En.delayMs, Ke = En.usesImageOnlyDelay, Bt = d(
389
- () => `${a}:${pe.join("|")}`,
390
- [a, pe]
391
- ), [Ar, wr] = p(null), Tn = !Ke || Ar === Bt, V = r(() => {
392
- de.current !== null && (window.clearTimeout(de.current), de.current = null);
399
+ ), Pn = xn.delayMs, Ke = xn.usesImageOnlyDelay, Kt = f(
400
+ () => `${a}:${fe.join("|")}`,
401
+ [a, fe]
402
+ ), [Ir, br] = p(null), Cn = !Ke || Ir === Kt, K = r(() => {
403
+ ue.current !== null && (window.clearTimeout(ue.current), ue.current = null);
393
404
  }, []), Se = r(() => {
394
405
  Re.current !== null && (window.clearTimeout(Re.current), Re.current = null);
395
- }, []), H = r(() => {
406
+ }, []), Y = r(() => {
396
407
  et.current !== null && (window.clearTimeout(et.current), et.current = null);
397
- }, []), N = r(
408
+ }, []), D = r(
398
409
  (e = {}) => {
399
- Se(), M(), k(), H(), U(null), Q.reset(), x(!1), Et(Xt), lt(!1), at.current = /* @__PURE__ */ new Set(), st(!1), dn(null), e.preservePendingSubtitleJump || (Fe.current = null), Rt(void 0), ct(!1), ge(0);
410
+ Se(), M(), k(), Y(), N(null), he.reset(), w(!1), Tt(Jt), it(!1), lt.current = /* @__PURE__ */ new Set(), at(!1), cn(null), e.preservePendingSubtitleJump || (Fe.current = null), Ot(void 0), st(!1), ye(0);
400
411
  },
401
412
  [
402
413
  Se,
403
- H,
414
+ Y,
404
415
  M,
405
416
  k,
406
- Q
417
+ he
407
418
  ]
408
419
  ), gt = r(
409
420
  (e) => {
410
- nn.current += 1, dn({
421
+ tn.current += 1, cn({
411
422
  ...e,
412
- id: nn.current
423
+ id: tn.current
413
424
  });
414
425
  },
415
426
  []
416
427
  ), Ie = r(() => {
417
- const e = yo(
428
+ const e = mo(
418
429
  _,
419
- at.current
430
+ lt.current
420
431
  );
421
- return e ? (U(e), !0) : !1;
432
+ return e ? (N(e), !0) : !1;
422
433
  }, [_]), qe = r(() => {
423
- M(), k(), ct(!1), ge(0), !Ie() && R && L();
434
+ M(), k(), st(!1), ye(0), !Ie() && R && L();
424
435
  }, [
425
436
  R,
426
437
  M,
427
438
  k,
428
439
  L,
429
440
  Ie
430
- ]), Rn = r(
441
+ ]), En = r(
431
442
  (e) => {
432
443
  if (k(), !e)
433
444
  return;
434
445
  const t = () => {
435
- _e.current = null, ge(
436
- Lo
437
- ), ct(!0), j.current = null;
446
+ _e.current = null, ye(
447
+ ko
448
+ ), st(!0), Q.current = null;
438
449
  };
439
450
  _e.current = window.setTimeout(
440
451
  t,
441
- Fo
452
+ Mo
442
453
  );
443
454
  },
444
455
  [k]
445
- ), Vt = r(
446
- () => Ze.current || !!ue.current?.querySelector(".slide-player__controls:hover"),
456
+ ), qt = r(
457
+ () => Ze.current || !!ce.current?.querySelector(".slide-player__controls:hover"),
447
458
  []
448
459
  ), g = r(
449
- (e = it) => {
450
- !w || J === "hidden" || (Ne(!0), V(), !(J === "visible" || !e || Ee <= 0 || Vt()) && (de.current = window.setTimeout(() => {
451
- if (Vt()) {
452
- de.current = null;
460
+ (e = rt) => {
461
+ !A || W === "hidden" || (De(!0), K(), !(W === "visible" || !e || Ce <= 0 || qt()) && (ue.current = window.setTimeout(() => {
462
+ if (qt()) {
463
+ ue.current = null;
453
464
  return;
454
465
  }
455
- Ne(!1), de.current = null;
456
- }, Ee)));
466
+ De(!1), ue.current = null;
467
+ }, Ce)));
457
468
  },
458
469
  [
459
- V,
460
- it,
461
- Vt,
462
- Ee,
463
- J,
464
- w
470
+ K,
471
+ rt,
472
+ qt,
473
+ Ce,
474
+ W,
475
+ A
465
476
  ]
466
- ), Ue = !!So(y), re = !!y && !Ue, xr = r((e) => {
467
- cn(e);
477
+ ), Ue = !!go(h), re = !!h && !Ue, Ar = r((e) => {
478
+ Et(e);
468
479
  }, []), be = r(
469
480
  (e) => {
470
- e && cn(e.shouldContinuePlayback);
481
+ e && Et(e.shouldContinuePlayback);
471
482
  },
472
483
  []
473
484
  );
474
485
  s(() => {
475
- un(Ct);
486
+ ln(Ct);
476
487
  }, [a, Ct, ae]), s(() => {
477
- ae && pt(!1);
488
+ ae && mt(!1);
478
489
  }, [
479
490
  a,
480
491
  ae,
481
- pt
492
+ mt
482
493
  ]), s(() => {
483
- Nt || Tt(!1);
484
- }, [Nt]), s(() => () => {
485
- Se(), H(), V(), M(), k();
494
+ Bt || _t(!1);
495
+ }, [Bt]), s(() => () => {
496
+ Se(), Y(), K(), M(), k();
486
497
  }, [
487
498
  Se,
488
- H,
499
+ Y,
489
500
  M,
490
501
  k,
491
- V
502
+ K
492
503
  ]), s(() => {
493
504
  if (!Ke) {
494
- H();
505
+ Y();
495
506
  return;
496
507
  }
497
508
  let e = !1, t = null, n = null;
498
509
  const i = () => {
499
510
  n?.(), n = null;
500
511
  }, l = () => {
501
- e || (i(), H(), wr(Bt));
512
+ e || (i(), Y(), br(Kt));
502
513
  }, o = () => {
503
514
  if (e)
504
515
  return;
@@ -511,7 +522,7 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
511
522
  const I = Array.from(
512
523
  v.querySelectorAll("iframe")
513
524
  );
514
- if (I.length === 0 || Eo(I)) {
525
+ if (I.length === 0 || xo(I)) {
515
526
  l();
516
527
  return;
517
528
  }
@@ -519,7 +530,7 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
519
530
  e || (t !== null && window.cancelAnimationFrame(t), t = window.requestAnimationFrame(() => {
520
531
  t = null, o();
521
532
  }));
522
- }, Ht = (ie, Ae, le) => {
533
+ }, Yt = (ie, Ae, le) => {
523
534
  ie.addEventListener(Ae, le, { once: !0 }), oe.push(
524
535
  () => ie.removeEventListener(Ae, le)
525
536
  );
@@ -527,11 +538,11 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
527
538
  I.forEach((ie) => {
528
539
  const Ae = ie.contentDocument;
529
540
  if (!Ae || Ae.readyState !== "complete") {
530
- Ht(ie, "load", Ye);
541
+ Yt(ie, "load", Ye);
531
542
  return;
532
543
  }
533
544
  Array.from(Ae.images).filter((le) => !le.complete).forEach((le) => {
534
- Ht(le, "load", Ye), Ht(le, "error", Ye);
545
+ Yt(le, "load", Ye), Yt(le, "error", Ye);
535
546
  });
536
547
  }), n = () => {
537
548
  oe.forEach((ie) => ie());
@@ -541,36 +552,36 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
541
552
  t = null, o();
542
553
  }), et.current = window.setTimeout(() => {
543
554
  l();
544
- }, Co), () => {
545
- e = !0, i(), H(), t !== null && window.cancelAnimationFrame(t);
555
+ }, wo), () => {
556
+ e = !0, i(), Y(), t !== null && window.cancelAnimationFrame(t);
546
557
  };
547
558
  }, [
548
- H,
559
+ Y,
549
560
  T,
550
561
  a,
551
- Bt,
562
+ Kt,
552
563
  Ke
553
- ]), s(() => (Pe?.(B), () => {
554
- Pe?.(!1);
555
- }), [Pe, B]), s(() => {
556
- B || (Ze.current = !1);
557
- }, [B]), s(() => {
558
- D || dt === St || (Ft(!1), kt(St));
559
- }, [D, dt]), s(() => {
560
- if (!D) {
561
- hn(!1);
564
+ ]), s(() => (Ee?.(V), () => {
565
+ Ee?.(!1);
566
+ }), [Ee, V]), s(() => {
567
+ V || (Ze.current = !1);
568
+ }, [V]), s(() => {
569
+ B || ut === St || (Dt(!1), Lt(St));
570
+ }, [B, ut]), s(() => {
571
+ if (!B) {
572
+ pn(!1);
562
573
  return;
563
574
  }
564
575
  const e = () => {
565
- hn(Nn()), ee();
576
+ pn(Fn()), te();
566
577
  }, t = () => {
567
- ee();
578
+ te();
568
579
  };
569
580
  e(), window.addEventListener("orientationchange", t), window.screen?.orientation?.addEventListener?.(
570
581
  "change",
571
582
  t
572
583
  );
573
- const n = eo(
584
+ const n = Zr(
574
585
  e
575
586
  );
576
587
  return () => {
@@ -579,145 +590,133 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
579
590
  t
580
591
  );
581
592
  };
582
- }, [D, ee]), s(() => {
583
- We?.(Z);
584
- }, [Z, We]), s(() => {
585
- vn.current !== Z && ee(), vn.current = Z;
586
- }, [Z, ee]), Un(() => {
587
- if (!me) {
588
- ot.current = null;
589
- return;
590
- }
591
- if (!me.isAvailable) {
592
- ot.current = null;
593
- return;
594
- }
595
- const { targetStepIndex: e } = me;
596
- ot.current !== e && (ot.current = e, rt(e));
597
- }, [rt, me]), s(() => {
598
- me?.isPending || Jt?.(Le, a);
599
- }, [
600
- a,
601
- Le,
602
- Jt,
603
- me?.isPending
604
- ]), s(() => {
605
- const e = ln.current, t = mo(
593
+ }, [B, te]), s(() => {
594
+ We?.(ee);
595
+ }, [ee, We]), s(() => {
596
+ hn.current !== ee && te(), hn.current = ee;
597
+ }, [ee, te]), s(() => {
598
+ Wt?.(Le, a);
599
+ }, [a, Le, Wt]), s(() => {
600
+ const e = nn.current, t = fo(
606
601
  {
607
602
  previousMarkerCount: e.markerCount,
608
- nextMarkerCount: b.length,
603
+ nextMarkerCount: E.length,
609
604
  previousIndex: e.currentIndex,
610
605
  previousCanGoNext: e.canGoNext,
611
606
  nextCanGoNext: R,
612
- currentAudioKey: C,
607
+ currentAudioKey: x,
613
608
  hasCompletedCurrentStepAudio: O,
614
609
  hasResolvedCurrentInteraction: Ue,
615
- currentStepHasSpeakableElement: A,
616
- currentInteractionElement: y,
617
- isAutoAdvanceEnabled: De,
610
+ currentStepHasSpeakableElement: b,
611
+ currentInteractionElement: h,
612
+ isAutoAdvanceEnabled: Ne,
618
613
  shouldUseSilentStepAutoAdvanceToggle: Ve
619
614
  }
620
615
  );
621
- ln.current = {
622
- markerCount: b.length,
616
+ nn.current = {
617
+ markerCount: E.length,
623
618
  currentIndex: a,
624
619
  canGoNext: R
625
620
  }, t && L();
626
621
  }, [
627
622
  R,
628
- C,
623
+ x,
629
624
  a,
630
- y,
631
- A,
625
+ h,
626
+ b,
632
627
  L,
633
628
  O,
634
629
  Ue,
635
- De,
630
+ Ne,
636
631
  Ve,
637
- b.length
632
+ E.length
638
633
  ]), s(() => {
639
- if (!w || J === "hidden") {
640
- V(), Ne(!1);
634
+ if (!A || W === "hidden") {
635
+ K(), De(!1);
641
636
  return;
642
637
  }
643
- if (J === "visible") {
644
- V(), Ne(!0);
638
+ if (W === "visible") {
639
+ K(), De(!0);
645
640
  return;
646
641
  }
647
- it || g(!0);
642
+ rt || g(!0);
648
643
  }, [
649
- V,
650
- it,
651
- J,
652
- w,
644
+ K,
645
+ rt,
646
+ W,
647
+ A,
653
648
  g
654
649
  ]), s(() => {
655
650
  if (typeof window > "u")
656
651
  return;
657
652
  const e = (t) => {
658
- t.origin === window.location.origin && zr(t.data) && t.data.eventType === "click" && w && (q(), ye(!0), g(!0));
653
+ t.origin === window.location.origin && $r(t.data) && t.data.eventType === "click" && A && (H(), me(!0), g(!0));
659
654
  };
660
655
  return window.addEventListener("message", e), () => {
661
656
  window.removeEventListener("message", e);
662
657
  };
663
- }, [q, w, g]), io({
664
- sectionRef: ue,
665
- enabled: w,
666
- keyboardShortcutsEnabled: ce,
667
- onKeyboardShortcut: q,
658
+ }, [H, A, g]), oo({
659
+ sectionRef: ce,
660
+ enabled: A,
661
+ keyboardShortcutsEnabled: se,
662
+ onKeyboardShortcut: H,
668
663
  onWake: () => {
669
- q(), ye(!0), g(!0);
664
+ H(), me(!0), g(!0);
670
665
  }
671
666
  }), s(() => {
672
- if (!w) {
673
- N();
667
+ if (!A) {
668
+ D();
669
+ return;
670
+ }
671
+ if (Be.current) {
672
+ xt.current = ve;
674
673
  return;
675
674
  }
676
- const { hasPlaybackContextChanged: e, shouldInitializeAudioSequence: t } = go({
677
- previousResetKey: on.current,
678
- nextResetKey: Be,
679
- currentAudioKey: C,
675
+ const { hasPlaybackContextChanged: e, shouldInitializeAudioSequence: t } = yo({
676
+ previousResetKey: xt.current,
677
+ nextResetKey: ve,
678
+ currentAudioKey: x,
680
679
  hasCompletedCurrentStepAudio: O
681
680
  });
682
- on.current = Be;
683
- const n = j.current === a && !!y, i = uo({
684
- hasInteraction: !!y,
681
+ xt.current = ve;
682
+ const n = Q.current === a && !!h, i = co({
683
+ hasInteraction: !!h,
685
684
  shouldBlockPlaybackForInteraction: re,
686
685
  shouldOpenInteractionOverlayAfterAudio: n,
687
686
  hasPlaybackContextChanged: e,
688
687
  hasResolvedCurrentInteraction: Ue,
689
- currentStepHasSpeakableElement: A,
690
- isPlayerCustomActionActive: Dt
688
+ currentStepHasSpeakableElement: b,
689
+ isPlayerCustomActionActive: Vt
691
690
  }), l = Fe.current, o = l?.slideIndex === a;
692
- if (e && N({
691
+ if (e && D({
693
692
  preservePendingSubtitleJump: o
694
- }), !(T.length === 0 && !y) && !ne) {
695
- if (l?.slideIndex === a && Bn({
693
+ }), !(T.length === 0 && !h) && !ne) {
694
+ if (l?.slideIndex === a && Dn({
696
695
  currentIndex: a,
697
696
  resolvedCurrentInteractionElement: S,
698
- slideElementList: b,
697
+ slideElementList: E,
699
698
  targetSlideIndex: l.slideIndex
700
699
  })) {
701
- Fe.current = null, xt.current = !0, U(l.audioKey), gt({
700
+ Fe.current = null, Pt.current = !0, N(l.audioKey), gt({
702
701
  audioIndex: l.audioIndex,
703
702
  timeMs: l.timeMs
704
703
  });
705
704
  return;
706
705
  }
707
- if (y && Rt(y), i) {
708
- Rn(y);
706
+ if (h && Ot(h), i) {
707
+ En(h);
709
708
  return;
710
709
  }
711
- if (k(), j.current = null, !re && t && !Ie()) {
712
- if (A) {
710
+ if (k(), Q.current = null, !re && t && !Ie()) {
711
+ if (b) {
713
712
  if (F) {
714
- x(!1);
713
+ w(!1);
715
714
  return;
716
715
  }
717
- x(!0);
716
+ w(!0);
718
717
  return;
719
718
  }
720
- if (R && !(Ve && !De) && !(Ke && !Tn))
719
+ if (R && !(Ve && !Ne) && !(Ke && !Cn))
721
720
  return Re.current = window.setTimeout(() => {
722
721
  Re.current = null, L();
723
722
  }, Pn), () => {
@@ -731,103 +730,105 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
731
730
  Se,
732
731
  T.length,
733
732
  a,
734
- y,
735
- C,
736
- Be,
737
- A,
733
+ h,
734
+ x,
735
+ ve,
736
+ b,
738
737
  Ke,
739
- Tn,
738
+ Cn,
740
739
  Pn,
741
740
  L,
742
741
  O,
743
742
  F,
744
- De,
743
+ Ne,
745
744
  Ue,
746
- Dt,
745
+ Vt,
747
746
  re,
748
747
  k,
749
- N,
748
+ D,
750
749
  gt,
751
- Rn,
752
- w,
753
- b,
750
+ En,
751
+ A,
752
+ E,
754
753
  Ie,
755
754
  ne,
756
755
  Ve
757
756
  ]), s(() => {
758
- if (F || ne || !A || re) {
759
- x(!1);
757
+ if (F || ne || !b || re) {
758
+ w(!1);
760
759
  return;
761
760
  }
762
761
  if (O) {
763
- x(!1);
762
+ w(!1);
764
763
  return;
765
764
  }
766
- if (wn) {
767
- x(!1);
765
+ if (bn) {
766
+ w(!1);
768
767
  return;
769
768
  }
770
- Et("waitingForAudio"), x(!0);
769
+ Tt("waitingForAudio"), w(!0);
771
770
  }, [
772
- wn,
773
- A,
771
+ bn,
772
+ b,
774
773
  O,
775
774
  F,
776
775
  ne,
777
776
  re
778
777
  ]), s(() => {
779
- O && ho(
778
+ O && po(
780
779
  _,
781
- at.current
782
- ) && lt(!1);
780
+ lt.current
781
+ ) && it(!1);
783
782
  }, [_, O]), s(() => {
784
- const e = xt.current;
785
- xt.current = !1, vo({
786
- currentAudioKey: C,
783
+ if (Be.current)
784
+ return;
785
+ const e = Pt.current;
786
+ Pt.current = !1, ho({
787
+ currentAudioKey: x,
787
788
  currentAudioSequenceLength: _.length,
788
- currentStepHasSpeakableElement: A,
789
+ currentStepHasSpeakableElement: b,
789
790
  hasCompletedCurrentStepAudio: O,
790
791
  shouldBlockPlaybackForInteraction: re,
791
792
  shouldPausePlaybackForCustomAction: ne,
792
793
  shouldSkipDefaultAudioStart: e
793
794
  }) && Ie();
794
795
  }, [
795
- C,
796
+ x,
796
797
  _,
797
- A,
798
+ b,
798
799
  O,
799
800
  ne,
800
801
  re,
801
802
  Ie
802
803
  ]), s(() => {
803
- !C || P >= 0 || U(null);
804
- }, [P, C]), s(() => {
805
- P >= 0 || Q.reset();
806
- }, [P, Q]), s(() => {
807
- st(!1);
808
- }, [br]);
804
+ !x || C >= 0 || N(null);
805
+ }, [C, x]), s(() => {
806
+ C >= 0 || he.reset();
807
+ }, [C, he]), s(() => {
808
+ at(!1);
809
+ }, [Sr]);
809
810
  const {
810
- interactionDefaults: _n,
811
- interactionDefaultSelectedValues: Cr,
812
- hasResolvedInteractionInput: On,
813
- isInteractionReadonly: Er,
814
- shouldAutoContinueInteraction: Mn
815
- } = d(
816
- () => wo(S, {
811
+ interactionDefaults: Tn,
812
+ interactionDefaultSelectedValues: wr,
813
+ hasResolvedInteractionInput: Rn,
814
+ isInteractionReadonly: xr,
815
+ shouldAutoContinueInteraction: _n
816
+ } = f(
817
+ () => bo(S, {
817
818
  interactionDefaultValueOptions: Xe
818
819
  }),
819
820
  [S, Xe]
820
- ), Pr = !!S?.readonly || Er, He = co({
821
+ ), Pr = !!S?.readonly || xr, He = so({
821
822
  hasActiveInteraction: !!S,
822
- isInteractionOverlayOpen: he
823
- }), Tr = r(
823
+ isInteractionOverlayOpen: pe
824
+ }), Cr = r(
824
825
  (e) => {
825
826
  const n = [
826
827
  ...e.selectedValues ?? [],
827
828
  e.inputText?.trim() ?? "",
828
829
  e.buttonText?.trim() ?? ""
829
830
  ].filter(Boolean).join(", ");
830
- Rt((i) => !i || !n ? i : {
831
+ Ot((i) => !i || !n ? i : {
831
832
  ...i,
832
833
  user_input: n
833
834
  }), Je?.(e, S), qe();
@@ -836,18 +837,18 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
836
837
  );
837
838
  s(() => {
838
839
  const e = () => {
839
- cr(document.fullscreenElement === ue.current);
840
+ ar(document.fullscreenElement === ce.current);
840
841
  };
841
842
  return e(), document.addEventListener("fullscreenchange", e), () => {
842
843
  document.removeEventListener("fullscreenchange", e);
843
844
  };
844
845
  }, []), s(() => {
845
- S && he || ut(!1);
846
- }, [S, he]), s(() => {
847
- ee();
848
- }, [S, ee]), s(() => {
846
+ S && pe || ct(!1);
847
+ }, [S, pe]), s(() => {
848
+ te();
849
+ }, [S, te]), s(() => {
849
850
  if (!He) {
850
- ge(0);
851
+ ye(0);
851
852
  return;
852
853
  }
853
854
  const e = Oe.current;
@@ -857,8 +858,8 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
857
858
  const i = Math.ceil(
858
859
  e.getBoundingClientRect().height
859
860
  );
860
- ge(
861
- i + No
861
+ ye(
862
+ i + Fo
862
863
  );
863
864
  };
864
865
  if (t(), typeof ResizeObserver > "u")
@@ -870,67 +871,67 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
870
871
  n.disconnect();
871
872
  };
872
873
  }, [He]), s(() => {
873
- if (M(), !!he) {
874
- if (Mn)
875
- return W.current = window.setTimeout(() => {
876
- W.current = null, qe();
877
- }, Vn), () => {
874
+ if (M(), !!pe) {
875
+ if (_n)
876
+ return j.current = window.setTimeout(() => {
877
+ j.current = null, qe();
878
+ }, Nn), () => {
878
879
  M();
879
880
  };
880
- if (!(mn || !On))
881
- return W.current = window.setTimeout(() => {
882
- W.current = null, qe();
883
- }, Vn), () => {
881
+ if (!(dn || !Rn))
882
+ return j.current = window.setTimeout(() => {
883
+ j.current = null, qe();
884
+ }, Nn), () => {
884
885
  M();
885
886
  };
886
887
  }
887
888
  }, [
888
889
  M,
889
890
  qe,
890
- mn,
891
- On,
892
- he,
893
- Mn
891
+ dn,
892
+ Rn,
893
+ pe,
894
+ _n
894
895
  ]);
895
- const Rr = (e, t = {}) => e ? e.type === "slot" ? /* @__PURE__ */ u(Yr, { children: e.content }) : e.type === "html" ? /* @__PURE__ */ u(
896
- Ln,
896
+ const Er = (e, t = {}) => e ? e.type === "slot" ? /* @__PURE__ */ u(Ur, { children: e.content }) : e.type === "html" ? /* @__PURE__ */ u(
897
+ kn,
897
898
  {
898
899
  className: "content-render-iframe",
899
900
  disableLoadingOverlay: F,
900
901
  hideFullScreen: !0,
901
- locale: f,
902
- dir: X,
902
+ locale: d,
903
+ dir: J,
903
904
  lang: Te,
904
905
  mode: "blackboard",
905
906
  replaceRootScreenHeightWithFull: t.replaceRootScreenHeightWithFull,
906
907
  type: "sandbox",
907
908
  content: e.content,
908
- enableScaling: Yn
909
+ enableScaling: Un
909
910
  }
910
911
  ) : /* @__PURE__ */ u(
911
- Ln,
912
+ kn,
912
913
  {
913
914
  className: "content-render-iframe",
914
915
  disableLoadingOverlay: F,
915
916
  hideFullScreen: !0,
916
- locale: f,
917
- dir: X,
917
+ locale: d,
918
+ dir: J,
918
919
  lang: Te,
919
920
  mode: "blackboard",
920
921
  type: "markdown",
921
922
  content: e.content
922
923
  }
923
- ) : null, _r = (e = [], t = !1) => {
924
+ ) : null, Tr = (e = [], t = !1) => {
924
925
  if (e.length === 0)
925
926
  return null;
926
927
  const n = e.filter(
927
928
  (o) => o.is_renderable !== !1
928
- ).length, i = t && Gn ? fo(e) : "disabled", l = e.reduce(
929
+ ).length, i = t && Hn ? uo(e) : "disabled", l = e.reduce(
929
930
  (o, v, I) => v.is_renderable !== !1 ? I : o,
930
931
  -1
931
932
  );
932
933
  return /* @__PURE__ */ u(
933
- no,
934
+ to,
934
935
  {
935
936
  className: "slide-stage__content flex w-full flex-col gap-4",
936
937
  mode: i,
@@ -939,14 +940,14 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
939
940
  return /* @__PURE__ */ u(
940
941
  "div",
941
942
  {
942
- ref: t && v === l ? en : null,
943
+ ref: t && v === l ? Zt : null,
943
944
  "aria-hidden": I || void 0,
944
945
  className: we(
945
946
  "w-full shrink-0",
946
947
  n === 1 && o.is_renderable !== !1 && "slide-element--single",
947
948
  I ? "pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0" : o.is_renderable === !1 && "hidden"
948
949
  ),
949
- children: Rr(o, {
950
+ children: Er(o, {
950
951
  replaceRootScreenHeightWithFull: n === 1 && o.type === "html" && o.is_renderable !== !1
951
952
  })
952
953
  },
@@ -955,8 +956,8 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
955
956
  })
956
957
  }
957
958
  );
958
- }, Or = r(() => {
959
- const e = ue.current;
959
+ }, Rr = r(() => {
960
+ const e = ce.current;
960
961
  if (e) {
961
962
  if (document.fullscreenElement === e) {
962
963
  document.exitFullscreen().catch(() => {
@@ -966,162 +967,133 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
966
967
  e.requestFullscreen?.().catch(() => {
967
968
  });
968
969
  }
969
- }, []), kn = r(() => {
970
+ }, []), On = r(() => {
970
971
  const e = Qe.current;
971
972
  e && e.scrollTo({
972
973
  top: e.scrollHeight,
973
974
  behavior: "smooth"
974
975
  });
975
- }, []), Kt = r(
976
- (e) => Bn({
976
+ }, []), Ut = r(
977
+ (e) => Dn({
977
978
  currentIndex: a,
978
979
  resolvedCurrentInteractionElement: S,
979
- slideElementList: b,
980
- targetSlideIndex: tt[e.audioIndex]
980
+ slideElementList: E,
981
+ targetSlideIndex: Z[e.audioIndex]
981
982
  }),
982
983
  [
983
984
  S,
984
- tt,
985
+ Z,
985
986
  a,
986
- b
987
+ E
987
988
  ]
988
- ), qt = r(
989
+ ), _r = r(
989
990
  (e, t) => {
990
- const i = h[e.audioIndex]?.audioKey, l = tt[e.audioIndex];
991
- return !i || l == null || !Kt(e) ? !1 : (be(t), j.current = null, x(!1), lt(!1), st(!1), Yt(t) && (ye(!0), g(!0)), l === a ? (Fe.current = null, N(), U(i), gt(e), !0) : (ke.current = !0, N(), Fe.current = {
991
+ const i = y[e.audioIndex]?.audioKey, l = Z[e.audioIndex];
992
+ return !i || l == null || !Ut(e) ? !1 : (be(t), Q.current = null, w(!1), it(!1), at(!1), Gt(t) && (me(!0), g(!0)), l === a ? (Fe.current = null, D(), N(i), gt(e), !0) : (ke.current = !0, D(), Fe.current = {
992
993
  audioIndex: e.audioIndex,
993
994
  audioKey: i,
994
995
  slideIndex: l,
995
996
  timeMs: e.timeMs
996
- }, rt(l), !0));
997
+ }, nt(l), !0));
997
998
  },
998
999
  [
999
- h,
1000
- tt,
1001
- Kt,
1000
+ y,
1001
+ Z,
1002
+ Ut,
1002
1003
  a,
1003
- rt,
1004
+ nt,
1004
1005
  gt,
1005
- N,
1006
+ D,
1006
1007
  g,
1007
1008
  be
1008
1009
  ]
1009
- );
1010
- s(() => {
1011
- if (!se || se.id === rn.current)
1012
- return;
1013
- const e = h.findIndex(
1014
- (n) => n.audioKey === se.audioKey
1015
- );
1016
- if (e < 0)
1017
- return;
1018
- qt(
1019
- {
1020
- audioIndex: e,
1021
- timeMs: se.timeMs
1022
- },
1023
- {
1024
- shouldContinuePlayback: !1,
1025
- shouldWakeControls: !1
1026
- }
1027
- ) && (rn.current = se.id);
1028
- }, [h, qt, se]);
1029
- const Mr = r(
1030
- (e) => {
1031
- Q.setTime(e), te?.audioKey && Wt?.({
1032
- audioKey: te.audioKey,
1033
- element: te.element,
1034
- timeMs: e
1035
- });
1036
- },
1037
- [te, Wt, Q]
1038
- ), kr = r(
1010
+ ), Or = r(
1039
1011
  (e) => {
1040
- be(e), ke.current = !0, j.current = null, x(!1), Yt(e) && (ye(!0), g(!0)), N(), sn();
1012
+ be(e), ke.current = !0, Q.current = null, w(!1), Gt(e) && (me(!0), g(!0)), D(), on();
1041
1013
  },
1042
1014
  [
1043
- sn,
1044
- N,
1015
+ on,
1016
+ D,
1045
1017
  g,
1046
1018
  be
1047
1019
  ]
1048
- ), Fr = r(
1020
+ ), Mr = r(
1049
1021
  (e) => {
1050
- be(e), ke.current = !0, j.current = null, x(!1), Yt(e) && (ye(!0), g(!0)), N(), L();
1022
+ be(e), ke.current = !0, Q.current = null, w(!1), Gt(e) && (me(!0), g(!0)), D(), L();
1051
1023
  },
1052
1024
  [
1053
1025
  L,
1054
- N,
1026
+ D,
1055
1027
  g,
1056
1028
  be
1057
1029
  ]
1058
- ), Lr = r(
1030
+ ), kr = r(
1059
1031
  ({
1060
1032
  loading: e,
1061
1033
  reason: t
1062
1034
  }) => {
1063
1035
  if (F) {
1064
- x(!1);
1036
+ w(!1);
1065
1037
  return;
1066
1038
  }
1067
- if (!A || O) {
1068
- x(!1);
1039
+ if (!b || O) {
1040
+ w(!1);
1069
1041
  return;
1070
1042
  }
1071
- e && t && Et(t), x(Uo(t, e));
1043
+ e && t && Tt(t), w(Ko(t, e));
1072
1044
  },
1073
1045
  [
1074
- A,
1046
+ b,
1075
1047
  O,
1076
1048
  F
1077
1049
  ]
1078
1050
  );
1079
1051
  s(() => {
1080
- F && x(!1);
1052
+ F && w(!1);
1081
1053
  }, [F]);
1082
- const Nr = r(
1054
+ const Fr = r(
1083
1055
  (e) => {
1084
- const t = h[e]?.audioKey;
1085
- if (!t || !C || t !== C)
1056
+ const t = y[e]?.audioKey;
1057
+ if (!t || !x || t !== x)
1086
1058
  return;
1087
- at.current.add(t);
1059
+ lt.current.add(t);
1088
1060
  const n = _.findIndex(
1089
1061
  (o) => o === t
1090
1062
  );
1091
1063
  if (n < 0) {
1092
- U(null);
1064
+ N(null);
1093
1065
  return;
1094
1066
  }
1095
1067
  const i = n + 1, l = _[i];
1096
1068
  if (l) {
1097
- U(l);
1069
+ N(l);
1098
1070
  return;
1099
1071
  }
1100
- if (U(null), lt(!0), x(!1), R) {
1101
- const o = a + 1, v = b[o];
1102
- Cn && v?.type === "interaction" && (j.current = o), L();
1072
+ if (N(null), it(!0), w(!1), R) {
1073
+ const o = a + 1, v = E[o];
1074
+ wn && v?.type === "interaction" && (Q.current = o), L();
1103
1075
  return;
1104
1076
  }
1105
1077
  },
1106
1078
  [
1107
- h,
1079
+ y,
1108
1080
  R,
1109
1081
  a,
1110
- C,
1082
+ x,
1111
1083
  _,
1112
1084
  L,
1113
- Cn,
1114
- b
1085
+ wn,
1086
+ E
1115
1087
  ]
1116
- ), Dr = r(() => {
1117
- Ze.current = !0, V(), w && Ne(!0);
1118
- }, [V, w]), Br = r(() => {
1088
+ ), Lr = r(() => {
1089
+ Ze.current = !0, K(), A && De(!0);
1090
+ }, [K, A]), Dr = r(() => {
1119
1091
  Ze.current = !1, g(!0);
1120
- }, [g]), Ut = r(
1092
+ }, [g]), Ht = r(
1121
1093
  (e) => {
1122
- e.stopPropagation(), B && g(!0);
1094
+ e.stopPropagation(), V && g(!0);
1123
1095
  },
1124
- [B, g]
1096
+ [V, g]
1125
1097
  ), vt = r(
1126
1098
  (e, t) => {
1127
1099
  const n = wt.current;
@@ -1137,79 +1109,79 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
1137
1109
  },
1138
1110
  []
1139
1111
  );
1140
- Do(() => {
1112
+ Lo(() => {
1141
1113
  const e = Oe.current;
1142
1114
  if (!He || !e) {
1143
- fe.current = null;
1115
+ de.current = null;
1144
1116
  return;
1145
1117
  }
1146
- const t = fe.current, n = e.getBoundingClientRect();
1147
- if (!t || Ot) {
1148
- fe.current = {
1118
+ const t = de.current, n = e.getBoundingClientRect();
1119
+ if (!t || kt) {
1120
+ de.current = {
1149
1121
  left: n.left,
1150
1122
  top: n.top
1151
1123
  };
1152
1124
  return;
1153
1125
  }
1154
1126
  const i = t.left - n.left, l = t.top - n.top;
1155
- if (!Kn(i) && !Kn(l)) {
1156
- fe.current = {
1127
+ if (!Bn(i) && !Bn(l)) {
1128
+ de.current = {
1157
1129
  left: n.left,
1158
1130
  top: n.top
1159
1131
  };
1160
1132
  return;
1161
1133
  }
1162
1134
  const o = {
1163
- x: E.x + i,
1164
- y: E.y + l
1135
+ x: P.x + i,
1136
+ y: P.y + l
1165
1137
  }, v = vt(
1166
1138
  e,
1167
- E
1168
- ), I = Vo(
1169
- v ? Dn(o, v) : o
1139
+ P
1140
+ ), I = No(
1141
+ v ? Ln(o, v) : o
1170
1142
  );
1171
- fe.current = {
1172
- left: n.left + I.x - E.x,
1173
- top: n.top + I.y - E.y
1174
- }, qn(
1143
+ de.current = {
1144
+ left: n.left + I.x - P.x,
1145
+ top: n.top + I.y - P.y
1146
+ }, Vn(
1175
1147
  I,
1176
- E
1177
- ) || _t(
1178
- (oe) => qn(oe, I) ? oe : I
1148
+ P
1149
+ ) || Mt(
1150
+ (oe) => Vn(oe, I) ? oe : I
1179
1151
  );
1180
1152
  }, [
1181
1153
  vt,
1182
- E,
1183
- Ot,
1184
- ft,
1154
+ P,
1155
+ kt,
1156
+ dt,
1185
1157
  He
1186
1158
  ]);
1187
- const Vr = r(
1159
+ const Nr = r(
1188
1160
  (e) => {
1189
- if (Ut(e), e.button !== 0 || !e.currentTarget.isConnected || !Oe.current)
1161
+ if (Ht(e), e.button !== 0 || !e.currentTarget.isConnected || !Oe.current)
1190
1162
  return;
1191
1163
  const t = vt(
1192
1164
  Oe.current,
1193
- E
1165
+ P
1194
1166
  );
1195
1167
  t && (e.preventDefault(), e.currentTarget.hasPointerCapture?.(e.pointerId) !== !0 && e.currentTarget.setPointerCapture(e.pointerId), Me.current = {
1196
1168
  pointerId: e.pointerId,
1197
1169
  startClientX: e.clientX,
1198
1170
  startClientY: e.clientY,
1199
- startOffset: E,
1171
+ startOffset: P,
1200
1172
  bounds: t
1201
- }, Mt(!0));
1173
+ }, Ft(!0));
1202
1174
  },
1203
1175
  [
1204
1176
  vt,
1205
- E,
1206
- Ut
1177
+ P,
1178
+ Ht
1207
1179
  ]
1208
- ), Kr = r(
1180
+ ), Br = r(
1209
1181
  (e) => {
1210
1182
  const t = Me.current;
1211
- !t || t.pointerId !== e.pointerId || (e.preventDefault(), e.stopPropagation(), _t(
1212
- Dn(
1183
+ !t || t.pointerId !== e.pointerId || (e.preventDefault(), e.stopPropagation(), Mt(
1184
+ Ln(
1213
1185
  {
1214
1186
  x: t.startOffset.x + e.clientX - t.startClientX,
1215
1187
  y: t.startOffset.y + e.clientY - t.startClientY
@@ -1219,33 +1191,33 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
1219
1191
  ));
1220
1192
  },
1221
1193
  []
1222
- ), Fn = r(
1194
+ ), Mn = r(
1223
1195
  (e) => {
1224
1196
  const t = Me.current;
1225
- !t || t.pointerId !== e.pointerId || (e.stopPropagation(), e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), Me.current = null, Mt(!1));
1197
+ !t || t.pointerId !== e.pointerId || (e.stopPropagation(), e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), Me.current = null, Ft(!1));
1226
1198
  },
1227
1199
  []
1228
- ), qr = r(
1200
+ ), Vr = r(
1229
1201
  (e) => {
1230
- q(), Qt?.(e);
1202
+ H(), jt?.(e);
1231
1203
  },
1232
- [q, Qt]
1233
- ), Ur = r(
1204
+ [H, jt]
1205
+ ), Kr = r(
1234
1206
  (e) => {
1235
- q(), Zt?.(e);
1207
+ H(), Qt?.(e);
1236
1208
  },
1237
- [q, Zt]
1238
- ), Hr = r(() => {
1239
- ye(!0), g(!0);
1209
+ [H, Qt]
1210
+ ), qr = r(() => {
1211
+ me(!0), g(!0);
1240
1212
  }, [g]);
1241
1213
  return s(() => {
1242
- const e = tn.current, i = (e.length > 0 && e.length < pe.length && e.every((o, v) => o === pe[v]) ? T.slice(e.length) : []).some(
1214
+ const e = en.current, i = (e.length > 0 && e.length < fe.length && e.every((o, v) => o === fe[v]) ? T.slice(e.length) : []).some(
1243
1215
  (o) => o.is_new === !1
1244
1216
  );
1245
- if (tn.current = pe, !i)
1217
+ if (en.current = fe, !i)
1246
1218
  return;
1247
1219
  const l = window.requestAnimationFrame(() => {
1248
- const o = Qe.current, v = en.current;
1220
+ const o = Qe.current, v = Zt.current;
1249
1221
  if (!o || !v)
1250
1222
  return;
1251
1223
  const I = o.getBoundingClientRect(), oe = v.getBoundingClientRect(), Ye = o.scrollTop + (oe.top - I.top);
@@ -1257,35 +1229,35 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
1257
1229
  return () => {
1258
1230
  window.cancelAnimationFrame(l);
1259
1231
  };
1260
- }, [T, pe]), s(() => {
1232
+ }, [T, fe]), s(() => {
1261
1233
  if (!ke.current || (ke.current = !1, T.length === 0))
1262
1234
  return;
1263
1235
  const e = window.requestAnimationFrame(() => {
1264
- kn();
1236
+ On();
1265
1237
  });
1266
1238
  return () => {
1267
1239
  window.cancelAnimationFrame(e);
1268
1240
  };
1269
- }, [T, kn]), /* @__PURE__ */ Ge(
1241
+ }, [T, On]), /* @__PURE__ */ Ge(
1270
1242
  "section",
1271
1243
  {
1272
- ref: ue,
1244
+ ref: ce,
1273
1245
  className: we(
1274
1246
  "relative h-full w-full",
1275
- D && "slide--mobile-device",
1276
- Sn && "slide--browser-fullscreen",
1277
- ve && "slide--mobile-landscape",
1278
- gn && "slide--mobile-landscape-native",
1279
- $n
1247
+ B && "slide--mobile-device",
1248
+ gn && "slide--browser-fullscreen",
1249
+ ge && "slide--mobile-landscape",
1250
+ yn && "slide--mobile-landscape-native",
1251
+ Yn
1280
1252
  ),
1281
- dir: X,
1253
+ dir: J,
1282
1254
  lang: Te,
1283
- onClick: Hr,
1284
- onFocusCapture: Ur,
1285
- onPointerDown: qr,
1286
- ...Jn,
1255
+ onClick: qr,
1256
+ onFocusCapture: Kr,
1257
+ onPointerDown: Vr,
1258
+ ...zn,
1287
1259
  children: [
1288
- pr ? /* @__PURE__ */ u(
1260
+ fr ? /* @__PURE__ */ u(
1289
1261
  "div",
1290
1262
  {
1291
1263
  "aria-hidden": "true",
@@ -1298,20 +1270,20 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
1298
1270
  ref: wt,
1299
1271
  className: we(
1300
1272
  "slide__viewport relative h-full min-h-0 w-full",
1301
- ve && "slide__viewport--mobile-landscape",
1302
- ve && !dr && "slide__viewport--mobile-landscape-native"
1273
+ ge && "slide__viewport--mobile-landscape",
1274
+ ge && !cr && "slide__viewport--mobile-landscape-native"
1303
1275
  ),
1304
1276
  children: [
1305
- fr ? /* @__PURE__ */ Ge("div", { className: "slide-landscape-header", children: [
1277
+ ur ? /* @__PURE__ */ Ge("div", { className: "slide-landscape-header", children: [
1306
1278
  /* @__PURE__ */ u(
1307
1279
  "button",
1308
1280
  {
1309
- "aria-label": $?.backAriaLabel ?? K.fullscreenBackAriaLabel,
1281
+ "aria-label": z?.backAriaLabel ?? U.fullscreenBackAriaLabel,
1310
1282
  className: "slide-landscape-header__back",
1311
- onClick: hr,
1283
+ onClick: pr,
1312
1284
  type: "button",
1313
1285
  children: /* @__PURE__ */ u(
1314
- Mo,
1286
+ _o,
1315
1287
  {
1316
1288
  className: "slide-landscape-header__icon h-6 w-6",
1317
1289
  strokeWidth: 2.25
@@ -1319,19 +1291,19 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
1319
1291
  )
1320
1292
  }
1321
1293
  ),
1322
- $?.content ? /* @__PURE__ */ u("div", { className: "min-w-0 flex-1 overflow-hidden", children: $.content }) : null
1294
+ z?.content ? /* @__PURE__ */ u("div", { className: "min-w-0 flex-1 overflow-hidden", children: z.content }) : null
1323
1295
  ] }) : null,
1324
1296
  /* @__PURE__ */ u(
1325
1297
  "div",
1326
1298
  {
1327
1299
  className: we(
1328
1300
  "h-full min-h-0 w-full",
1329
- mr && "slide__viewport-content--with-header",
1330
- er ? "slide-content--single" : "grid gap-4"
1301
+ dr && "slide__viewport-content--with-header",
1302
+ Qn ? "slide-content--single" : "grid gap-4"
1331
1303
  ),
1332
- children: T.length > 0 ? /* @__PURE__ */ u("div", { className: "slide-stage", children: /* @__PURE__ */ u("div", { ref: Qe, className: "slide-stage__layer w-full", children: gr.map(
1304
+ children: T.length > 0 ? /* @__PURE__ */ u("div", { className: "slide-stage", children: /* @__PURE__ */ u("div", { ref: Qe, className: "slide-stage__layer w-full", children: yr.map(
1333
1305
  (e, t) => {
1334
- const n = t === vr;
1306
+ const n = t === hr;
1335
1307
  return /* @__PURE__ */ u(
1336
1308
  "div",
1337
1309
  {
@@ -1339,7 +1311,7 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
1339
1311
  "aria-hidden": !n || void 0,
1340
1312
  className: "w-full h-full",
1341
1313
  style: { display: n ? void 0 : "none" },
1342
- children: _r(
1314
+ children: Tr(
1343
1315
  e.elementList,
1344
1316
  n
1345
1317
  )
@@ -1350,24 +1322,24 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
1350
1322
  ) }) }) : null
1351
1323
  }
1352
1324
  ),
1353
- or ? /* @__PURE__ */ u(
1354
- jr,
1325
+ nr ? /* @__PURE__ */ u(
1326
+ Wr,
1355
1327
  {
1356
- message: Ko(
1357
- Wn,
1358
- ir
1328
+ message: Bo(
1329
+ Xn,
1330
+ rr
1359
1331
  ),
1360
1332
  className: "absolute left-1/2 top-1/2 z-[3] -translate-x-1/2 -translate-y-1/2"
1361
1333
  }
1362
1334
  ) : null,
1363
1335
  /* @__PURE__ */ u(
1364
- ro,
1336
+ no,
1365
1337
  {
1366
- extraBottomOffset: sr,
1367
- hasPlayerGap: ft,
1368
- isEnabled: fn && lr,
1369
- playbackTimeStore: Q,
1370
- subtitleCues: Sr
1338
+ extraBottomOffset: lr,
1339
+ hasPlayerGap: dt,
1340
+ isEnabled: un && or,
1341
+ playbackTimeStore: he,
1342
+ subtitleCues: gr
1371
1343
  }
1372
1344
  ),
1373
1345
  He ? /* @__PURE__ */ u(
@@ -1377,98 +1349,117 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
1377
1349
  "data-player-keyboard-shortcuts-ignore": "true",
1378
1350
  className: we(
1379
1351
  "slide-interaction-overlay",
1380
- ft ? "slide-interaction-overlay--with-player" : "slide-interaction-overlay--standalone",
1381
- Ot && "slide-interaction-overlay--dragging"
1352
+ dt ? "slide-interaction-overlay--with-player" : "slide-interaction-overlay--standalone",
1353
+ kt && "slide-interaction-overlay--dragging"
1382
1354
  ),
1383
- onClick: Ut,
1355
+ onClick: Ht,
1384
1356
  onPointerDownCapture: (e) => {
1385
- $t(e.target) && ut(!0);
1357
+ zt(e.target) && ct(!0);
1386
1358
  },
1387
1359
  onFocusCapture: (e) => {
1388
- $t(e.target) && ut(!0);
1360
+ zt(e.target) && ct(!0);
1389
1361
  },
1390
1362
  onInputCapture: (e) => {
1391
- $t(e.target) && ut(!0);
1363
+ zt(e.target) && ct(!0);
1392
1364
  },
1393
- style: Ir,
1365
+ style: vr,
1394
1366
  children: /* @__PURE__ */ u(
1395
- Hn,
1367
+ Kn,
1396
1368
  {
1397
- dir: X,
1369
+ dir: J,
1398
1370
  lang: Te,
1399
1371
  content: String(S?.content ?? ""),
1400
- dragHandleAriaLabel: z?.dragHandleAriaLabel ?? K.interactionTexts.dragHandleAriaLabel,
1401
- locale: f,
1402
- defaultButtonText: _n.buttonText ?? "",
1403
- defaultInputText: _n.inputText ?? "",
1404
- defaultSelectedValues: Cr,
1405
- confirmButtonText: z?.confirmButtonText ?? K.interactionTexts.confirmButtonText,
1406
- copyButtonText: z?.copyButtonText ?? K.interactionTexts.copyButtonText,
1407
- copiedButtonText: z?.copiedButtonText ?? K.interactionTexts.copiedButtonText,
1408
- onSend: Tr,
1409
- onDragHandlePointerCancel: Fn,
1410
- onDragHandlePointerDown: Vr,
1411
- onDragHandlePointerMove: Kr,
1412
- onDragHandlePointerUp: Fn,
1372
+ dragHandleAriaLabel: X?.dragHandleAriaLabel ?? U.interactionTexts.dragHandleAriaLabel,
1373
+ locale: d,
1374
+ defaultButtonText: Tn.buttonText ?? "",
1375
+ defaultInputText: Tn.inputText ?? "",
1376
+ defaultSelectedValues: wr,
1377
+ confirmButtonText: X?.confirmButtonText ?? U.interactionTexts.confirmButtonText,
1378
+ copyButtonText: X?.copyButtonText ?? U.interactionTexts.copyButtonText,
1379
+ copiedButtonText: X?.copiedButtonText ?? U.interactionTexts.copiedButtonText,
1380
+ onSend: Cr,
1381
+ onDragHandlePointerCancel: Mn,
1382
+ onDragHandlePointerDown: Nr,
1383
+ onDragHandlePointerMove: Br,
1384
+ onDragHandlePointerUp: Mn,
1413
1385
  readonly: Pr,
1414
- title: z?.title ?? bt ?? K.interactionTexts.title
1386
+ title: X?.title ?? bt ?? U.interactionTexts.title
1415
1387
  }
1416
1388
  )
1417
1389
  }
1418
1390
  ) : null,
1419
- w ? /* @__PURE__ */ u(
1420
- lo.Provider,
1391
+ A ? /* @__PURE__ */ u(
1392
+ io.Provider,
1421
1393
  {
1422
- value: tr,
1394
+ value: Zn,
1423
1395
  children: /* @__PURE__ */ u(
1424
- to,
1396
+ eo,
1425
1397
  {
1426
- dir: X === "auto" ? Qn : X,
1398
+ dir: J === "auto" ? Wn : J,
1427
1399
  lang: Te,
1428
- audioList: h,
1400
+ audioList: y,
1429
1401
  className: we(
1430
1402
  "absolute left-1/2 z-[2] -translate-x-1/2",
1431
- Sn ? "bottom-3" : "-bottom-3",
1432
- G,
1433
- !B && "pointer-events-none opacity-0"
1403
+ gn ? "bottom-3" : "-bottom-3",
1404
+ $,
1405
+ !V && "pointer-events-none opacity-0"
1434
1406
  ),
1435
- currentAudioIndex: P,
1407
+ currentAudioIndex: C,
1436
1408
  defaultPlaying: Ct,
1437
- enableKeyboardShortcuts: ce,
1409
+ enableKeyboardShortcuts: se,
1438
1410
  isPlaybackPaused: ne,
1439
- isAutoAdvanceEnabled: De,
1440
- locale: f,
1441
- isInteractionOpen: he,
1442
- isSubtitleEnabled: fn,
1443
- onAutoAdvanceToggle: un,
1444
- onLoadingChange: Lr,
1411
+ isAutoAdvanceEnabled: Ne,
1412
+ locale: d,
1413
+ isInteractionOpen: pe,
1414
+ isSubtitleEnabled: un,
1415
+ onAutoAdvanceToggle: ln,
1416
+ onLoadingChange: kr,
1445
1417
  onPlaybackStarted: () => {
1446
- st(!0);
1418
+ at(!0);
1419
+ },
1420
+ onPlaybackCheckpoint: ({ audioKey: e, isComplete: t, timeMs: n }) => {
1421
+ const i = y.findIndex(
1422
+ (o) => o.audioKey === e
1423
+ ), l = i >= 0 ? y[i] : void 0;
1424
+ !l?.audioKey || !l.element || qn?.({
1425
+ audioKey: l.audioKey,
1426
+ element: l.element,
1427
+ isComplete: t,
1428
+ stepIndex: Z[i] ?? a,
1429
+ timeMs: n
1430
+ });
1447
1431
  },
1448
- onPlaybackPreferenceChange: xr,
1449
- onPlaybackTimeChange: Mr,
1432
+ onPlaybackPreferenceChange: Ar,
1433
+ onPlaybackTimeChange: he.setTime,
1450
1434
  onSubtitleToggle: () => {
1451
- ar((e) => !e);
1435
+ ir((e) => !e);
1452
1436
  },
1453
1437
  nextDisabled: !R,
1454
- onEnded: Nr,
1455
- onFullscreen: Or,
1456
- isFullscreen: pn,
1457
- mobileViewMode: Z,
1438
+ onEnded: Fr,
1439
+ onFullscreen: Rr,
1440
+ isFullscreen: fn,
1441
+ mobileViewMode: ee,
1458
1442
  settingsPortalContainer: wt.current,
1459
- onMobileViewModeChange: yr,
1460
- onControlsPointerEnter: Dr,
1461
- onControlsPointerLeave: Br,
1462
- onNext: Fr,
1463
- onPrev: kr,
1464
- onSubtitleJump: qt,
1465
- canJumpToSubtitleTarget: Kt,
1466
- prevDisabled: !Zn,
1467
- showControls: B,
1468
- subtitleSeekRequest: rr,
1443
+ onMobileViewModeChange: mr,
1444
+ onControlsPointerEnter: Lr,
1445
+ onControlsPointerLeave: Dr,
1446
+ onNext: Mr,
1447
+ onPrev: Or,
1448
+ onSubtitleJump: _r,
1449
+ canJumpToSubtitleTarget: Ut,
1450
+ prevDisabled: !jn,
1451
+ showControls: V,
1452
+ subtitleSeekRequest: tr,
1453
+ playbackRestoreRequest: ot && ot.audioKey === pt?.audioKey ? {
1454
+ id: ot.id,
1455
+ timeMs: ot.timeMs
1456
+ } : null,
1457
+ onPlaybackRestoreComplete: (e) => {
1458
+ Be.current?.id === e && (Be.current = null, an(null));
1459
+ },
1469
1460
  texts: At,
1470
- customActionContext: Lt,
1471
- customActions: Ce,
1461
+ customActionContext: Nt,
1462
+ customActions: Pe,
1472
1463
  useAutoAdvanceToggle: Ve
1473
1464
  }
1474
1465
  )
@@ -1482,6 +1473,6 @@ const Ho = (c, f) => c.length === f.length && c.every((Y, xe) => {
1482
1473
  );
1483
1474
  };
1484
1475
  export {
1485
- _i as default
1476
+ Ei as default
1486
1477
  };
1487
1478
  //# sourceMappingURL=Slide.es.js.map