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