markdown-flow-ui 0.2.2 → 0.2.3-dev.2

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