markdown-flow-ui 0.1.114 → 0.1.115-beta.1

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 (55) hide show
  1. package/dist/_virtual/index.cjs10.js +1 -1
  2. package/dist/_virtual/index.cjs7.js +1 -1
  3. package/dist/_virtual/index.cjs8.js +1 -1
  4. package/dist/_virtual/index.cjs9.js +1 -1
  5. package/dist/_virtual/index.es10.js +2 -2
  6. package/dist/_virtual/index.es7.js +2 -3
  7. package/dist/_virtual/index.es7.js.map +1 -1
  8. package/dist/_virtual/index.es8.js +3 -2
  9. package/dist/_virtual/index.es8.js.map +1 -1
  10. package/dist/_virtual/index.es9.js +2 -2
  11. package/dist/assets/markdown-flow-ui.css +1 -1
  12. package/dist/components/Slide/Player.cjs.js +1 -1
  13. package/dist/components/Slide/Player.cjs.js.map +1 -1
  14. package/dist/components/Slide/Player.d.ts +5 -1
  15. package/dist/components/Slide/Player.es.js +230 -217
  16. package/dist/components/Slide/Player.es.js.map +1 -1
  17. package/dist/components/Slide/Slide.cjs.js +1 -1
  18. package/dist/components/Slide/Slide.cjs.js.map +1 -1
  19. package/dist/components/Slide/Slide.d.ts +4 -2
  20. package/dist/components/Slide/Slide.es.js +453 -456
  21. package/dist/components/Slide/Slide.es.js.map +1 -1
  22. package/dist/components/Slide/Slide.stories.d.ts +1 -0
  23. package/dist/components/Slide/constants.cjs.js +1 -1
  24. package/dist/components/Slide/constants.cjs.js.map +1 -1
  25. package/dist/components/Slide/constants.es.js +2 -3
  26. package/dist/components/Slide/constants.es.js.map +1 -1
  27. package/dist/components/Slide/useSlide.cjs.js +1 -1
  28. package/dist/components/Slide/useSlide.cjs.js.map +1 -1
  29. package/dist/components/Slide/useSlide.d.ts +5 -0
  30. package/dist/components/Slide/useSlide.es.js +84 -77
  31. package/dist/components/Slide/useSlide.es.js.map +1 -1
  32. package/dist/components/Slide/useSlide.test.d.ts +1 -0
  33. package/dist/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.cjs.js +1 -1
  34. package/dist/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.cjs.js.map +1 -1
  35. package/dist/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  36. package/dist/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs.js +1 -1
  37. package/dist/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js +1 -1
  38. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-YG6GDRKO.cjs.js +1 -1
  39. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-YG6GDRKO.es.js +1 -1
  40. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-S3R3BYOJ.cjs.js +1 -1
  41. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-S3R3BYOJ.es.js +1 -1
  42. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.cjs.js +1 -1
  43. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.es.js +1 -1
  44. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-LVOFAZNH.cjs.js +1 -1
  45. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-LVOFAZNH.es.js +1 -1
  46. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.cjs.js +1 -1
  47. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.es.js +1 -1
  48. package/dist/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.cjs.js +1 -1
  49. package/dist/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.es.js +1 -1
  50. package/dist/markdown-flow-ui-lib.css +1 -1
  51. package/package.json +1 -1
  52. package/dist/components/Slide/SlideFullscreenHint.cjs.js +0 -2
  53. package/dist/components/Slide/SlideFullscreenHint.cjs.js.map +0 -1
  54. package/dist/components/Slide/SlideFullscreenHint.es.js +0 -42
  55. package/dist/components/Slide/SlideFullscreenHint.es.js.map +0 -1
@@ -1,160 +1,160 @@
1
1
  import { j as n } from "../../_virtual/jsx-runtime.es.js";
2
- import { memo as mn, useRef as p, useMemo as c, useState as m, useCallback as r, useEffect as l } from "react";
3
- import { isSandboxInteractionMessage as pn } from "../../lib/sandboxInteraction.es.js";
2
+ import { memo as pn, useRef as p, useMemo as c, useState as m, useCallback as r, useEffect as s } from "react";
3
+ import { isSandboxInteractionMessage as hn } from "../../lib/sandboxInteraction.es.js";
4
4
  import { cn as J } from "../../lib/utils.es.js";
5
- import hn from "../ui/loading-overlay-card.es.js";
6
- import vn from "../ContentRender/ContentRender.es.js";
7
- import At from "../ContentRender/IframeSandbox.es.js";
5
+ import vn from "../ui/loading-overlay-card.es.js";
6
+ import yn from "../ContentRender/ContentRender.es.js";
7
+ import wt from "../ContentRender/IframeSandbox.es.js";
8
8
  import "../ui/inputGroup/input-group.es.js";
9
- import { getInteractionDefaultValues as yn, getInteractionDefaultSelectedValues as Sn } from "../../lib/interaction-defaults.es.js";
10
- import { isMobileDevice as bn, isLandscapeViewport as wt, subscribeMobileDeviceChange as gn } from "../../lib/mobileDevice.es.js";
9
+ import { getInteractionDefaultValues as gn, getInteractionDefaultSelectedValues as Sn } from "../../lib/interaction-defaults.es.js";
10
+ import { isMobileDevice as bn, isLandscapeViewport as It, subscribeMobileDeviceChange as An } from "../../lib/mobileDevice.es.js";
11
11
  import xn from "./Player.es.js";
12
- import In from "./SubtitleOverlay.es.js";
13
- import { DEFAULT_SLIDE_PLAYER_TEXTS as An } from "./constants.es.js";
14
- import wn from "./SlideFullscreenHint.es.js";
15
- import _n from "./useSlide.es.js";
16
- import En from "./useWakePlayerFromIframe.es.js";
17
- import { DEFAULT_MOBILE_VIEW_MODE as we, resolveMobileViewModeState as Tn } from "./utils/mobileScreenMode.es.js";
18
- import { shouldPresentInteractionOverlay as Cn } from "./utils/interactionPlayback.es.js";
19
- import { shouldAutoAdvanceIntoAppendedMarker as Pn } from "./utils/appendedMarkerAdvance.es.js";
20
- import { getPlaybackSequenceTransition as Mn } from "./utils/playbackSequence.es.js";
21
- import { resolvePlayerCustomActionElement as Rn, getPlayerCustomActionCount as Fn } from "./utils/playerCustomActions.es.js";
22
- import { createPlaybackTimeStore as kn } from "./utils/playbackTimeStore.es.js";
23
- import { shouldUseAutoAdvanceToggle as Nn } from "./utils/playerToggleMode.es.js";
12
+ import wn from "./SubtitleOverlay.es.js";
13
+ import In from "./useSlide.es.js";
14
+ import _n from "./useWakePlayerFromIframe.es.js";
15
+ import { DEFAULT_MOBILE_VIEW_MODE as we, resolveMobileViewModeState as En } from "./utils/mobileScreenMode.es.js";
16
+ import { shouldPresentInteractionOverlay as Tn } from "./utils/interactionPlayback.es.js";
17
+ import { shouldAutoAdvanceIntoAppendedMarker as Rn } from "./utils/appendedMarkerAdvance.es.js";
18
+ import { getPlaybackSequenceTransition as Cn } from "./utils/playbackSequence.es.js";
19
+ import { resolvePlayerCustomActionElement as Pn, getPlayerCustomActionCount as Mn } from "./utils/playerCustomActions.es.js";
20
+ import { createPlaybackTimeStore as Fn } from "./utils/playbackTimeStore.es.js";
21
+ import { shouldUseAutoAdvanceToggle as kn } from "./utils/playerToggleMode.es.js";
24
22
  /* empty css */
25
23
  import Bn from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/chevron-left.es.js";
26
- const On = 2e3, jn = 300, Ln = 160, Kn = 16, _t = mn(
24
+ const Nn = 2e3, On = 300, jn = 160, Ln = 16, Ve = "waitingForAudio", _t = {
25
+ waitingForAudio: "Waiting for current slide audio...",
26
+ loadingAudio: "Loading current slide audio...",
27
+ waitingForMoreAudio: "Waiting for more current slide audio..."
28
+ }, Kn = (x, k) => typeof x == "string" ? x : x[k] ?? x[Ve] ?? _t[k], Et = pn(
27
29
  ({
28
- content: K,
29
- title: V,
30
- defaultButtonText: I,
30
+ content: x,
31
+ title: k,
32
+ defaultButtonText: w,
31
33
  defaultInputText: Q,
32
- defaultSelectedValues: A,
33
- confirmButtonText: q,
34
+ defaultSelectedValues: I,
35
+ confirmButtonText: V,
34
36
  copyButtonText: Z,
35
- copiedButtonText: _e,
36
- onSend: Ee,
37
- readonly: H = !1
37
+ copiedButtonText: Ie,
38
+ onSend: _e,
39
+ readonly: D = !1
38
40
  }) => /* @__PURE__ */ n.jsxs("div", { className: "slide-player__interaction-card", children: [
39
- /* @__PURE__ */ n.jsx("div", { className: "slide-player__interaction-header", children: /* @__PURE__ */ n.jsx("p", { className: "slide-player__interaction-title", children: V }) }),
41
+ /* @__PURE__ */ n.jsx("div", { className: "slide-player__interaction-header", children: /* @__PURE__ */ n.jsx("p", { className: "slide-player__interaction-title", children: k }) }),
40
42
  /* @__PURE__ */ n.jsx("div", { className: "slide-player__interaction-body", children: /* @__PURE__ */ n.jsx(
41
- vn,
43
+ yn,
42
44
  {
43
- content: K,
44
- defaultButtonText: I,
45
+ content: x,
46
+ defaultButtonText: w,
45
47
  defaultInputText: Q,
46
- defaultSelectedValues: A,
47
- confirmButtonText: q,
48
+ defaultSelectedValues: I,
49
+ confirmButtonText: V,
48
50
  copyButtonText: Z,
49
- copiedButtonText: _e,
50
- onSend: Ee,
51
- readonly: H,
51
+ copiedButtonText: Ie,
52
+ onSend: _e,
53
+ readonly: D,
52
54
  enableTypewriter: !1,
53
55
  sandboxMode: "content"
54
56
  }
55
57
  ) })
56
58
  ] })
57
59
  );
58
- _t.displayName = "InteractionOverlayCard";
59
- const Vn = (K, V) => K.length === V.length && K.every((I, Q) => {
60
- const A = V[Q];
61
- return I.sequence_number === A?.sequence_number && I.type === A?.type && I.content === A?.content;
62
- }), pr = ({
63
- elementList: K = [],
64
- showPlayer: V = !0,
65
- playerAlwaysVisible: I = !1,
60
+ Et.displayName = "InteractionOverlayCard";
61
+ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
62
+ const I = k[Q];
63
+ return w.sequence_number === I?.sequence_number && w.type === I?.type && w.content === I?.content;
64
+ }), fr = ({
65
+ elementList: x = [],
66
+ showPlayer: k = !0,
67
+ playerAlwaysVisible: w = !1,
66
68
  playerClassName: Q,
67
- fullscreenHeader: A,
68
- playerCustomActions: q,
69
+ fullscreenHeader: I,
70
+ playerCustomActions: V,
69
71
  playerCustomActionPauseOnActive: Z = !0,
70
- bufferingText: _e = "Buffering...",
71
- interactionTitle: Ee,
72
- interactionTexts: H,
73
- playerTexts: qe,
74
- playerAutoHideDelay: Te = 3e3,
75
- markerAutoAdvanceDelay: He = On,
72
+ bufferingText: Ie = _t,
73
+ interactionTitle: _e,
74
+ interactionTexts: D,
75
+ playerTexts: Tt,
76
+ playerAutoHideDelay: Ee = 3e3,
77
+ markerAutoAdvanceDelay: De = Nn,
76
78
  interactionDefaultValueOptions: de,
77
- onSend: De,
78
- onPlayerVisibilityChange: Ce,
79
+ onSend: qe,
80
+ onPlayerVisibilityChange: Te,
79
81
  onMobileViewModeChange: Ue,
80
82
  onStepChange: ze,
81
- enableIframeScaling: Et = !0,
82
- disableLoadingOverlay: E = !1,
83
- className: Tt,
84
- onPointerDown: $e,
85
- ...Ct
83
+ enableIframeScaling: Rt = !0,
84
+ disableLoadingOverlay: T = !1,
85
+ className: Ct,
86
+ onPointerDown: Ge,
87
+ ...Pt
86
88
  }) => {
87
- const fe = p(null), Ge = p(null), Pe = p(null), We = p(null), ee = p(null), te = p(null), ne = p(null), re = p(null), Ye = p(null), Xe = p([]), me = p(!1), D = p(null), Je = p(null), Qe = p({
89
+ const fe = p(null), He = p(null), Re = p(null), We = p(null), ee = p(null), te = p(null), ne = p(null), re = p(null), $e = p(null), Ye = p([]), me = p(!1), q = p(null), Xe = p(null), Je = p({
88
90
  markerCount: 0,
89
91
  currentIndex: -1,
90
92
  canGoNext: !1
91
93
  }), {
92
- currentElementList: k,
93
- stepElementLists: Ze,
94
+ currentElementList: B,
95
+ stepElementLists: Qe,
94
96
  slideElementList: N,
95
97
  currentIndex: d,
96
98
  audioList: h,
97
99
  currentAudioSequenceIndexes: pe,
98
- currentStepHasSpeakableElement: b,
99
- currentInteractionElement: a,
100
- canGoPrev: Pt,
101
- canGoNext: x,
102
- handlePrev: et,
103
- handleNext: T
104
- } = _n(K), oe = c(() => {
100
+ currentStepHasSpeakableElement: S,
101
+ currentInteractionElement: u,
102
+ canGoPrev: Mt,
103
+ canGoNext: A,
104
+ handlePrev: Ze,
105
+ handleNext: R
106
+ } = In(x), oe = c(() => {
105
107
  if (!(d < 0))
106
108
  return N[d];
107
- }, [d, N]), Mt = N.filter(
109
+ }, [d, N]), Ft = N.filter(
108
110
  (e) => e.is_renderable !== !1
109
- ).length === 1, w = V && (N.length > 0 || h.length > 0 || !!a), C = c(
111
+ ).length === 1, _ = k && (N.length > 0 || h.length > 0 || !!u), C = c(
110
112
  () => pe.map((e) => h[e]?.audioKey).filter((e) => !!e),
111
113
  [h, pe]
112
- ), [tt, he] = m(!0), [ve, se] = m(!1), [le, nt] = m(!0), [v, U] = m(null), [Rt, y] = m(!1), [P, rt] = m(!1), [Ft, Me] = m(!1), [ot, kt] = m(!0), [Re, Fe] = m(!1), [o, ke] = m(), [ye, Se] = m(!1), [
113
- Nt,
114
- ie
115
- ] = m(0), [Bt, Ot] = m(!1), M = c(() => bn(), []), [be, Ne] = m(
114
+ ), [et, he] = m(!0), [ve, se] = m(!1), [ie, tt] = m(!0), [v, U] = m(null), [kt, y] = m(!1), [Bt, Ce] = m(Ve), [P, nt] = m(!1), [Nt, Pe] = m(!1), [rt, Ot] = m(!0), [Me, Fe] = m(!1), [o, ke] = m(), [ye, ge] = m(!1), [
115
+ jt,
116
+ le
117
+ ] = m(0), [ot, Lt] = m(!1), O = c(() => bn(), []), [Se, Be] = m(
116
118
  we
117
- ), [st, Be] = m(!1), [Oe, lt] = m(
118
- () => M ? wt() : !1
119
- ), [jt, ge] = m(!1), z = c(() => kn(), []), {
120
- effectiveMobileViewMode: O,
121
- isImmersiveMobileFullscreen: $,
122
- isNativeMobileFullscreen: it,
123
- shouldRotateFullscreenViewport: Lt
119
+ ), [st, Ne] = m(!1), [Kt, it] = m(
120
+ () => O ? It() : !1
121
+ ), z = c(() => Fn(), []), {
122
+ effectiveMobileViewMode: G,
123
+ isImmersiveMobileFullscreen: H,
124
+ isNativeMobileFullscreen: lt,
125
+ shouldRotateFullscreenViewport: Vt
124
126
  } = c(
125
- () => Tn({
127
+ () => En({
126
128
  hasManualMobileViewMode: st,
127
- isMobileDevice: M,
128
- mobileViewMode: be
129
+ isMobileDevice: O,
130
+ mobileViewMode: Se
129
131
  }),
130
132
  [
131
133
  st,
132
- M,
133
- Oe,
134
- be
134
+ O,
135
+ Kt,
136
+ Se
135
137
  ]
136
- ), ct = p(O), R = w && (I || tt), Kt = $ && R, Vt = $ && R, qt = $ || it, Ht = qe?.fullscreenHintText ?? An.fullscreenHintText, Dt = r(
138
+ ), Dt = p(G), M = _ && (w || et), qt = H && M, Ut = H && M, zt = H || lt, ct = ot && !O, Gt = r(
137
139
  (e) => {
138
- Be(!0), Ne(e);
140
+ Ne(!0), Be(e);
139
141
  },
140
142
  []
141
- ), ut = r(() => {
142
- Be(!1), Ne(we);
143
- }, []), Ut = r(() => {
144
- ut(), A?.onBack?.();
145
- }, [A, ut]), zt = r(() => {
146
- ge(!1);
147
- }, []), at = r((e) => {
143
+ ), at = r(() => {
144
+ Ne(!1), Be(we);
145
+ }, []), Ht = r(() => {
146
+ at(), I?.onBack?.();
147
+ }, [I, at]), ut = r((e) => {
148
148
  Fe(e);
149
149
  }, []), dt = r(() => {
150
150
  Fe((e) => !e);
151
- }, []), { mountedStepStates: $t, currentMountedStateIndex: Gt } = c(() => {
151
+ }, []), { mountedStepStates: Wt, currentMountedStateIndex: $t } = c(() => {
152
152
  const e = [], t = /* @__PURE__ */ new Map();
153
- return Ze.forEach((s, f) => {
153
+ return Qe.forEach((l, f) => {
154
154
  const i = e.findIndex(
155
- (u) => Vn(
156
- u.elementList,
157
- s
155
+ (a) => Vn(
156
+ a.elementList,
157
+ l
158
158
  )
159
159
  );
160
160
  if (i >= 0) {
@@ -162,25 +162,25 @@ const Vn = (K, V) => K.length === V.length && K.every((I, Q) => {
162
162
  return;
163
163
  }
164
164
  e.push({
165
- elementList: s,
165
+ elementList: l,
166
166
  sourceStepIndexes: [f]
167
167
  }), t.set(f, e.length - 1);
168
168
  }), {
169
169
  mountedStepStates: e,
170
170
  currentMountedStateIndex: d >= 0 ? t.get(d) ?? -1 : -1
171
171
  };
172
- }, [d, Ze]), ft = c(() => String(d), [d]), S = c(() => v ? h.findIndex(
172
+ }, [d, Qe]), ft = c(() => String(d), [d]), g = c(() => v ? h.findIndex(
173
173
  (e) => (e.audioKey ?? "") === v
174
- ) : -1, [h, v]), je = c(
175
- () => S >= 0 ? h[S] : void 0,
176
- [h, S]
177
- ), Wt = je?.element?.subtitle_cues ?? [], xe = c(
174
+ ) : -1, [h, v]), Oe = c(
175
+ () => g >= 0 ? h[g] : void 0,
176
+ [h, g]
177
+ ), Yt = Oe?.element?.subtitle_cues ?? [], be = c(
178
178
  () => C[0] ?? "none",
179
179
  [C]
180
- ), Le = c(
180
+ ), je = c(
181
181
  () => ({
182
- currentElement: Rn({
183
- currentAudioIndex: S,
182
+ currentElement: Pn({
183
+ currentAudioIndex: g,
184
184
  currentAudioSequenceIndexes: pe,
185
185
  audioList: h,
186
186
  currentInteractionElement: o,
@@ -188,280 +188,271 @@ const Vn = (K, V) => K.length === V.length && K.every((I, Q) => {
188
188
  }),
189
189
  currentIndex: d,
190
190
  currentStepElement: oe,
191
- isActive: Re,
192
- setActive: at,
191
+ isActive: Me,
192
+ setActive: ut,
193
193
  toggleActive: dt
194
194
  }),
195
195
  [
196
196
  o,
197
197
  h,
198
- S,
198
+ g,
199
199
  pe,
200
200
  d,
201
201
  oe,
202
- Re,
203
- at,
202
+ Me,
203
+ ut,
204
204
  dt
205
205
  ]
206
- ), Ke = c(
207
- () => Fn(
208
- q,
209
- Le
206
+ ), Le = c(
207
+ () => Mn(
208
+ V,
209
+ je
210
210
  ),
211
- [Le, q]
212
- ), Yt = c(
211
+ [je, V]
212
+ ), Xt = c(
213
213
  () => ({
214
- "--slide-player-custom-action-count": String(Ke),
214
+ "--slide-player-custom-action-count": String(Le),
215
215
  "--slide-player-mobile-control-count": String(
216
- Ke + 4
216
+ Le + 4
217
217
  )
218
218
  }),
219
- [Ke]
220
- ), mt = C.length > 0, pt = c(() => a ? `${a.sequence_number ?? "none"}:${String(
221
- a.content ?? ""
222
- )}` : "none", [a]), ce = c(
219
+ [Le]
220
+ ), mt = C.length > 0, pt = c(() => u ? `${u.sequence_number ?? "none"}:${String(
221
+ u.content ?? ""
222
+ )}` : "none", [u]), ce = c(
223
223
  () => [ft, pt].join("|"),
224
224
  [pt, ft]
225
- ), Xt = c(
225
+ ), Jt = c(
226
226
  () => [
227
227
  ce,
228
- je?.audioKey ?? "none",
229
- String(S)
228
+ Oe?.audioKey ?? "none",
229
+ String(g)
230
230
  ].join("|"),
231
- [S, je?.audioKey, ce]
232
- ), ht = !!c(() => !xe || xe === "none" ? "" : h.find(
233
- (t) => t.audioKey === xe
234
- )?.audioUrl?.trim() ?? "", [h, xe]), j = Z && !!q && Re, ue = c(
235
- () => Nn({
236
- canGoNext: x,
237
- currentAudioIndex: S,
238
- currentStepHasSpeakableElement: b,
239
- hasInteraction: !!a
231
+ [g, Oe?.audioKey, ce]
232
+ ), ht = !!c(() => !be || be === "none" ? "" : h.find(
233
+ (t) => t.audioKey === be
234
+ )?.audioUrl?.trim() ?? "", [h, be]), L = Z && !!V && Me, ae = c(
235
+ () => kn({
236
+ canGoNext: A,
237
+ currentAudioIndex: g,
238
+ currentStepHasSpeakableElement: S,
239
+ hasInteraction: !!u
240
240
  }),
241
241
  [
242
- x,
243
- S,
244
- a,
245
- b
242
+ A,
243
+ g,
244
+ u,
245
+ S
246
246
  ]
247
- ), L = r(() => {
247
+ ), K = r(() => {
248
248
  ee.current !== null && (window.clearTimeout(ee.current), ee.current = null);
249
- }, []), B = r(() => {
249
+ }, []), j = r(() => {
250
250
  ne.current !== null && (window.clearTimeout(ne.current), ne.current = null);
251
251
  }, []), F = r(() => {
252
252
  re.current !== null && (window.clearTimeout(re.current), re.current = null);
253
- }, []), G = r(() => {
254
- te.current !== null && (window.clearTimeout(te.current), te.current = null);
255
253
  }, []), W = r(() => {
256
- G(), B(), F(), U(null), z.reset(), y(!1), rt(!1), Me(!1), ke(void 0), Se(!1), ie(0);
254
+ te.current !== null && (window.clearTimeout(te.current), te.current = null);
255
+ }, []), $ = r(() => {
256
+ W(), j(), F(), U(null), z.reset(), y(!1), Ce(Ve), nt(!1), Pe(!1), ke(void 0), ge(!1), le(0);
257
257
  }, [
258
- G,
259
- B,
258
+ W,
259
+ j,
260
260
  F,
261
261
  z
262
262
  ]), Y = r(() => {
263
263
  const e = C[0];
264
264
  return e ? (U(e), !0) : !1;
265
- }, [C]), Ie = r(() => {
266
- B(), F(), Se(!1), ie(0), !Y() && x && T();
265
+ }, [C]), Ae = r(() => {
266
+ j(), F(), ge(!1), le(0), !Y() && A && R();
267
267
  }, [
268
- x,
269
- B,
268
+ A,
269
+ j,
270
270
  F,
271
- T,
271
+ R,
272
272
  Y
273
273
  ]), vt = r(
274
274
  (e) => {
275
275
  if (F(), !e)
276
276
  return;
277
277
  const t = () => {
278
- re.current = null, ie(
279
- Ln
280
- ), Se(!0), D.current = null;
278
+ re.current = null, le(
279
+ jn
280
+ ), ge(!0), q.current = null;
281
281
  };
282
282
  re.current = window.setTimeout(
283
283
  t,
284
- jn
284
+ On
285
285
  );
286
286
  },
287
287
  [F]
288
- ), g = r(
288
+ ), b = r(
289
289
  (e = ve) => {
290
- w && (he(!0), L(), !(I || !e || Te <= 0) && (ee.current = window.setTimeout(() => {
290
+ _ && (he(!0), K(), !(w || !e || Ee <= 0) && (ee.current = window.setTimeout(() => {
291
291
  he(!1), ee.current = null;
292
- }, Te)));
292
+ }, Ee)));
293
293
  },
294
294
  [
295
- L,
295
+ K,
296
296
  ve,
297
- I,
298
- Te,
299
- w
297
+ w,
298
+ Ee,
299
+ _
300
300
  ]
301
- ), ae = !!(a?.readonly || a?.user_input?.trim()), X = !!a && !ae;
302
- l(() => {
303
- nt(!0), Z && Fe(!1);
304
- }, [d, Z]), l(() => () => {
305
- G(), L(), B(), F();
301
+ ), ue = !!(u?.readonly || u?.user_input?.trim()), X = !!u && !ue;
302
+ s(() => {
303
+ tt(!0), Z && Fe(!1);
304
+ }, [d, Z]), s(() => () => {
305
+ W(), K(), j(), F();
306
306
  }, [
307
- G,
308
- B,
307
+ W,
308
+ j,
309
309
  F,
310
- L
311
- ]), l(() => (Ce?.(R), () => {
312
- Ce?.(!1);
313
- }), [Ce, R]), l(() => {
314
- M || be === we || (Be(!1), Ne(we));
315
- }, [M, be]), l(() => {
316
- if (!M) {
317
- lt(!1);
310
+ K
311
+ ]), s(() => (Te?.(M), () => {
312
+ Te?.(!1);
313
+ }), [Te, M]), s(() => {
314
+ O || Se === we || (Ne(!1), Be(we));
315
+ }, [O, Se]), s(() => {
316
+ if (!O) {
317
+ it(!1);
318
318
  return;
319
319
  }
320
320
  const e = () => {
321
- lt(wt());
321
+ it(It());
322
322
  };
323
- return e(), gn(e);
324
- }, [M]), l(() => {
325
- Ue?.(O);
326
- }, [O, Ue]), l(() => {
327
- const s = ct.current !== "fullscreen" && O === "fullscreen" && !Oe;
328
- if (ct.current = O, !M) {
329
- ge(!1);
330
- return;
331
- }
332
- if (s) {
333
- ge(!0);
334
- return;
335
- }
336
- O !== "fullscreen" && ge(!1);
337
- }, [O, M, Oe]), l(() => {
323
+ return e(), An(e);
324
+ }, [O]), s(() => {
325
+ Ue?.(G);
326
+ }, [G, Ue]), s(() => {
327
+ Dt.current = G;
328
+ }, [G]), s(() => {
338
329
  ze?.(oe, d);
339
- }, [d, oe, ze]), l(() => {
340
- const e = Qe.current, t = Pn(
330
+ }, [d, oe, ze]), s(() => {
331
+ const e = Je.current, t = Rn(
341
332
  {
342
333
  previousMarkerCount: e.markerCount,
343
334
  nextMarkerCount: N.length,
344
335
  previousIndex: e.currentIndex,
345
336
  previousCanGoNext: e.canGoNext,
346
- nextCanGoNext: x,
337
+ nextCanGoNext: A,
347
338
  currentAudioKey: v,
348
339
  hasCompletedCurrentStepAudio: P,
349
- hasResolvedCurrentInteraction: ae,
350
- currentStepHasSpeakableElement: b,
351
- currentInteractionElement: a,
352
- isAutoAdvanceEnabled: le,
353
- shouldUseSilentStepAutoAdvanceToggle: ue
340
+ hasResolvedCurrentInteraction: ue,
341
+ currentStepHasSpeakableElement: S,
342
+ currentInteractionElement: u,
343
+ isAutoAdvanceEnabled: ie,
344
+ shouldUseSilentStepAutoAdvanceToggle: ae
354
345
  }
355
346
  );
356
- Qe.current = {
347
+ Je.current = {
357
348
  markerCount: N.length,
358
349
  currentIndex: d,
359
- canGoNext: x
360
- }, t && T();
350
+ canGoNext: A
351
+ }, t && R();
361
352
  }, [
362
- x,
353
+ A,
363
354
  v,
364
355
  d,
365
- a,
366
- b,
367
- T,
356
+ u,
357
+ S,
358
+ R,
368
359
  P,
369
- ae,
370
- le,
371
360
  ue,
361
+ ie,
362
+ ae,
372
363
  N.length
373
- ]), l(() => {
374
- if (!w) {
375
- L(), he(!1);
364
+ ]), s(() => {
365
+ if (!_) {
366
+ K(), he(!1);
376
367
  return;
377
368
  }
378
- if (I) {
379
- L(), he(!0);
369
+ if (w) {
370
+ K(), he(!0);
380
371
  return;
381
372
  }
382
- ve || g(!0);
373
+ ve || b(!0);
383
374
  }, [
384
- L,
375
+ K,
385
376
  ve,
386
- I,
387
377
  w,
388
- g
389
- ]), l(() => {
378
+ _,
379
+ b
380
+ ]), s(() => {
390
381
  if (typeof window > "u")
391
382
  return;
392
383
  const e = (t) => {
393
- t.origin === window.location.origin && pn(t.data) && t.data.eventType === "click" && w && (se(!0), g(!0));
384
+ t.origin === window.location.origin && hn(t.data) && t.data.eventType === "click" && _ && (se(!0), b(!0));
394
385
  };
395
386
  return window.addEventListener("message", e), () => {
396
387
  window.removeEventListener("message", e);
397
388
  };
398
- }, [w, g]), En({
389
+ }, [_, b]), _n({
399
390
  sectionRef: fe,
400
- enabled: w,
391
+ enabled: _,
401
392
  onWake: () => {
402
- se(!0), g(!0);
393
+ se(!0), b(!0);
403
394
  }
404
- }), l(() => {
405
- const { hasPlaybackContextChanged: e, shouldInitializeAudioSequence: t } = Mn({
406
- previousResetKey: Je.current,
395
+ }), s(() => {
396
+ const { hasPlaybackContextChanged: e, shouldInitializeAudioSequence: t } = Cn({
397
+ previousResetKey: Xe.current,
407
398
  nextResetKey: ce,
408
399
  currentAudioKey: v,
409
400
  hasCompletedCurrentStepAudio: P
410
401
  });
411
- Je.current = ce;
412
- const s = D.current === d && !!a, f = Cn({
413
- hasInteraction: !!a,
402
+ Xe.current = ce;
403
+ const l = q.current === d && !!u, f = Tn({
404
+ hasInteraction: !!u,
414
405
  shouldBlockPlaybackForInteraction: X,
415
- shouldOpenInteractionOverlayAfterAudio: s,
406
+ shouldOpenInteractionOverlayAfterAudio: l,
416
407
  hasPlaybackContextChanged: e,
417
- hasResolvedCurrentInteraction: ae,
418
- currentStepHasSpeakableElement: b
408
+ hasResolvedCurrentInteraction: ue,
409
+ currentStepHasSpeakableElement: S
419
410
  });
420
- if (e && W(), !(k.length === 0 && !a) && !j) {
421
- if (a && ke(a), f) {
422
- vt(a);
411
+ if (e && $(), !(B.length === 0 && !u) && !L) {
412
+ if (u && ke(u), f) {
413
+ vt(u);
423
414
  return;
424
415
  }
425
- if (F(), D.current = null, !!t && !Y()) {
426
- if (b) {
427
- if (E) {
416
+ if (F(), q.current = null, !!t && !Y()) {
417
+ if (S) {
418
+ if (T) {
428
419
  y(!1);
429
420
  return;
430
421
  }
431
422
  y(!0);
432
423
  return;
433
424
  }
434
- if (x && !(ue && !le))
425
+ if (A && !(ae && !ie))
435
426
  return te.current = window.setTimeout(() => {
436
- te.current = null, T();
437
- }, He), () => {
438
- G();
427
+ te.current = null, R();
428
+ }, De), () => {
429
+ W();
439
430
  };
440
431
  }
441
432
  }
442
433
  }, [
443
- x,
444
- G,
445
- k.length,
446
- a,
434
+ A,
435
+ W,
436
+ B.length,
437
+ u,
447
438
  v,
448
439
  ce,
449
- b,
450
- He,
451
- T,
440
+ S,
441
+ De,
442
+ R,
452
443
  P,
453
- E,
454
- le,
455
- ae,
444
+ T,
445
+ ie,
446
+ ue,
456
447
  X,
457
448
  F,
458
- W,
449
+ $,
459
450
  vt,
460
451
  Y,
461
- j,
462
- ue
463
- ]), l(() => {
464
- if (E || j || !b || X) {
452
+ L,
453
+ ae
454
+ ]), s(() => {
455
+ if (T || L || !S || X) {
465
456
  y(!1);
466
457
  return;
467
458
  }
@@ -473,41 +464,41 @@ const Vn = (K, V) => K.length === V.length && K.every((I, Q) => {
473
464
  y(!1);
474
465
  return;
475
466
  }
476
- y(!0);
467
+ Ce("waitingForAudio"), y(!0);
477
468
  }, [
478
469
  mt,
479
- b,
470
+ S,
480
471
  P,
481
- E,
482
- j,
472
+ T,
473
+ L,
483
474
  X
484
- ]), l(() => {
485
- v || C.length === 0 || j || !b || X || P || Y();
475
+ ]), s(() => {
476
+ v || C.length === 0 || L || !S || X || P || Y();
486
477
  }, [
487
478
  v,
488
479
  C,
489
- b,
480
+ S,
490
481
  P,
491
- j,
482
+ L,
492
483
  X,
493
484
  Y
494
- ]), l(() => {
495
- !v || S >= 0 || U(null);
496
- }, [S, v]), l(() => {
497
- S >= 0 || z.reset();
498
- }, [S, z]), l(() => {
499
- Me(!1);
500
- }, [Xt]);
485
+ ]), s(() => {
486
+ !v || g >= 0 || U(null);
487
+ }, [g, v]), s(() => {
488
+ g >= 0 || z.reset();
489
+ }, [g, z]), s(() => {
490
+ Pe(!1);
491
+ }, [Jt]);
501
492
  const yt = c(() => {
502
493
  if (!o)
503
494
  return {};
504
495
  const e = !!o.user_input?.trim();
505
- return yn(
496
+ return gn(
506
497
  typeof o.content == "string" ? o.content : void 0,
507
498
  o.user_input,
508
499
  e ? void 0 : de
509
500
  );
510
- }, [o, de]), Jt = c(() => {
501
+ }, [o, de]), Qt = c(() => {
511
502
  if (!o)
512
503
  return;
513
504
  const e = !!o.user_input?.trim();
@@ -516,115 +507,115 @@ const Vn = (K, V) => K.length === V.length && K.every((I, Q) => {
516
507
  o.user_input,
517
508
  e ? void 0 : de
518
509
  );
519
- }, [o, de]), St = !!o?.user_input?.trim(), bt = !!o?.readonly || St, gt = bt || St, Ve = !!o && ye, Qt = r(
510
+ }, [o, de]), gt = !!o?.user_input?.trim(), St = !!o?.readonly || gt, bt = St || gt, Ke = !!o && ye, Zt = r(
520
511
  (e) => {
521
- const s = [
512
+ const l = [
522
513
  ...e.selectedValues ?? [],
523
514
  e.inputText?.trim() ?? "",
524
515
  e.buttonText?.trim() ?? ""
525
516
  ].filter(Boolean).join(", ");
526
- ke((f) => !f || !s ? f : {
517
+ ke((f) => !f || !l ? f : {
527
518
  ...f,
528
- user_input: s
529
- }), De?.(e, o), Ie();
519
+ user_input: l
520
+ }), qe?.(e, o), Ae();
530
521
  },
531
- [o, Ie, De]
522
+ [o, Ae, qe]
532
523
  );
533
- l(() => {
524
+ s(() => {
534
525
  const e = () => {
535
- Ot(document.fullscreenElement === fe.current);
526
+ Lt(document.fullscreenElement === fe.current);
536
527
  };
537
528
  return e(), document.addEventListener("fullscreenchange", e), () => {
538
529
  document.removeEventListener("fullscreenchange", e);
539
530
  };
540
- }, []), l(() => {
541
- if (!Ve) {
542
- ie(0);
531
+ }, []), s(() => {
532
+ if (!Ke) {
533
+ le(0);
543
534
  return;
544
535
  }
545
- const e = Ye.current;
536
+ const e = $e.current;
546
537
  if (!e)
547
538
  return;
548
539
  const t = () => {
549
540
  const f = Math.ceil(
550
541
  e.getBoundingClientRect().height
551
542
  );
552
- ie(
553
- f + Kn
543
+ le(
544
+ f + Ln
554
545
  );
555
546
  };
556
547
  if (t(), typeof ResizeObserver > "u")
557
548
  return;
558
- const s = new ResizeObserver(() => {
549
+ const l = new ResizeObserver(() => {
559
550
  t();
560
551
  });
561
- return s.observe(e), () => {
562
- s.disconnect();
552
+ return l.observe(e), () => {
553
+ l.disconnect();
563
554
  };
564
- }, [Ve]), l(() => {
565
- if (B(), !(!ye || !gt))
555
+ }, [Ke]), s(() => {
556
+ if (j(), !(!ye || !bt))
566
557
  return ne.current = window.setTimeout(() => {
567
- ne.current = null, Ie();
558
+ ne.current = null, Ae();
568
559
  }, 2e3), () => {
569
- B();
560
+ j();
570
561
  };
571
562
  }, [
572
- B,
573
- Ie,
563
+ j,
564
+ Ae,
574
565
  ye,
575
- gt
566
+ bt
576
567
  ]);
577
- const Zt = (e, t = {}) => e ? e.type === "slot" ? /* @__PURE__ */ n.jsx(n.Fragment, { children: e.content }) : e.type === "html" ? /* @__PURE__ */ n.jsx(
578
- At,
568
+ const en = (e, t = {}) => e ? e.type === "slot" ? /* @__PURE__ */ n.jsx(n.Fragment, { children: e.content }) : e.type === "html" ? /* @__PURE__ */ n.jsx(
569
+ wt,
579
570
  {
580
571
  className: "content-render-iframe",
581
- disableLoadingOverlay: E,
572
+ disableLoadingOverlay: T,
582
573
  hideFullScreen: !0,
583
574
  mode: "blackboard",
584
575
  replaceRootScreenHeightWithFull: t.replaceRootScreenHeightWithFull,
585
576
  type: "sandbox",
586
577
  content: e.content,
587
- enableScaling: Et
578
+ enableScaling: Rt
588
579
  }
589
580
  ) : /* @__PURE__ */ n.jsx(
590
- At,
581
+ wt,
591
582
  {
592
583
  className: "content-render-iframe",
593
- disableLoadingOverlay: E,
584
+ disableLoadingOverlay: T,
594
585
  hideFullScreen: !0,
595
586
  mode: "blackboard",
596
587
  type: "markdown",
597
588
  content: e.content
598
589
  }
599
- ) : null, en = (e = [], t = !1) => {
590
+ ) : null, tn = (e = [], t = !1) => {
600
591
  if (e.length === 0)
601
592
  return null;
602
- const s = e.filter(
593
+ const l = e.filter(
603
594
  (i) => i.is_renderable !== !1
604
595
  ).length, f = e.reduce(
605
- (i, u, _) => u.is_renderable !== !1 ? _ : i,
596
+ (i, a, E) => a.is_renderable !== !1 ? E : i,
606
597
  -1
607
598
  );
608
- return /* @__PURE__ */ n.jsx("div", { className: "slide-stage__content flex w-full flex-col gap-4", children: e.map((i, u) => {
609
- const _ = i.type === "html" && i.is_renderable === !1;
599
+ return /* @__PURE__ */ n.jsx("div", { className: "slide-stage__content flex w-full flex-col gap-4", children: e.map((i, a) => {
600
+ const E = i.type === "html" && i.is_renderable === !1;
610
601
  return /* @__PURE__ */ n.jsx(
611
602
  "div",
612
603
  {
613
- ref: t && u === f ? We : null,
614
- "aria-hidden": _ || void 0,
604
+ ref: t && a === f ? We : null,
605
+ "aria-hidden": E || void 0,
615
606
  className: J(
616
607
  "w-full shrink-0",
617
- s === 1 && i.is_renderable !== !1 && "slide-element--single",
618
- _ ? "pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0" : i.is_renderable === !1 && "hidden"
608
+ l === 1 && i.is_renderable !== !1 && "slide-element--single",
609
+ E ? "pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0" : i.is_renderable === !1 && "hidden"
619
610
  ),
620
- children: Zt(i, {
621
- replaceRootScreenHeightWithFull: s === 1 && i.type === "html" && i.is_renderable !== !1
611
+ children: en(i, {
612
+ replaceRootScreenHeightWithFull: l === 1 && i.type === "html" && i.is_renderable !== !1
622
613
  })
623
614
  },
624
- i.sequence_number ?? `${i.type}-${u}`
615
+ i.sequence_number ?? `${i.type}-${a}`
625
616
  );
626
617
  }) });
627
- }, tn = r(() => {
618
+ }, nn = r(() => {
628
619
  const e = fe.current;
629
620
  if (e) {
630
621
  if (document.fullscreenElement === e) {
@@ -635,133 +626,137 @@ const Vn = (K, V) => K.length === V.length && K.every((I, Q) => {
635
626
  e.requestFullscreen?.().catch(() => {
636
627
  });
637
628
  }
638
- }, []), xt = r(() => {
639
- const e = Pe.current;
629
+ }, []), At = r(() => {
630
+ const e = Re.current;
640
631
  e && e.scrollTo({
641
632
  top: e.scrollHeight,
642
633
  behavior: "smooth"
643
634
  });
644
- }, []), nn = r(() => {
645
- me.current = !0, D.current = null, se(!0), y(!1), g(!0), W(), et();
646
- }, [et, W, g]), rn = r(() => {
647
- me.current = !0, D.current = null, se(!0), y(!1), g(!0), W(), T();
648
- }, [T, W, g]), on = r(
649
- (e) => {
650
- if (E) {
635
+ }, []), rn = r(() => {
636
+ me.current = !0, q.current = null, se(!0), y(!1), b(!0), $(), Ze();
637
+ }, [Ze, $, b]), on = r(() => {
638
+ me.current = !0, q.current = null, se(!0), y(!1), b(!0), $(), R();
639
+ }, [R, $, b]), sn = r(
640
+ ({
641
+ loading: e,
642
+ reason: t
643
+ }) => {
644
+ if (T) {
651
645
  y(!1);
652
646
  return;
653
647
  }
654
- if (!b || P) {
648
+ if (!S || P) {
655
649
  y(!1);
656
650
  return;
657
651
  }
658
- y(e);
652
+ e && t && Ce(t), y(e);
659
653
  },
660
654
  [
661
- b,
655
+ S,
662
656
  P,
663
- E
657
+ T
664
658
  ]
665
659
  );
666
- l(() => {
667
- E && y(!1);
668
- }, [E]);
669
- const sn = r(
660
+ s(() => {
661
+ T && y(!1);
662
+ }, [T]);
663
+ const ln = r(
670
664
  (e) => {
671
665
  const t = h[e]?.audioKey;
672
666
  if (!t || !v || t !== v)
673
667
  return;
674
- const s = C.findIndex(
675
- (u) => u === t
668
+ const l = C.findIndex(
669
+ (a) => a === t
676
670
  );
677
- if (s < 0) {
671
+ if (l < 0) {
678
672
  U(null);
679
673
  return;
680
674
  }
681
- const f = s + 1, i = C[f];
675
+ const f = l + 1, i = C[f];
682
676
  if (i) {
683
677
  U(i);
684
678
  return;
685
679
  }
686
- if (U(null), rt(!0), y(!1), x) {
687
- const u = d + 1, _ = N[u];
688
- ht && _?.type === "interaction" && (D.current = u), T();
680
+ if (U(null), nt(!0), y(!1), A) {
681
+ const a = d + 1, E = N[a];
682
+ ht && E?.type === "interaction" && (q.current = a), R();
689
683
  }
690
684
  },
691
685
  [
692
686
  h,
693
- x,
687
+ A,
694
688
  d,
695
689
  v,
696
690
  C,
697
- T,
691
+ R,
698
692
  ht,
699
693
  N
700
694
  ]
701
- ), ln = r(() => {
702
- o && Se((e) => !e);
703
- }, [o]), It = r(
695
+ ), cn = r(() => {
696
+ o && ge((e) => !e);
697
+ }, [o]), xt = r(
704
698
  (e) => {
705
- e.stopPropagation(), R && g(!0);
699
+ e.stopPropagation(), M && b(!0);
706
700
  },
707
- [tt, g]
708
- ), cn = r(
701
+ [et, b]
702
+ ), an = r(
709
703
  (e) => {
710
- $e?.(e);
704
+ Ge?.(e);
711
705
  },
712
- [$e]
706
+ [Ge]
713
707
  ), un = r(() => {
714
- se(!0), g(!0);
715
- }, [g]), Ae = c(
716
- () => k.map(
708
+ se(!0), b(!0);
709
+ }, [b]), xe = c(
710
+ () => B.map(
717
711
  (e, t) => `${e.sequence_number ?? `${e.type}-${t}`}:${String(e.is_new ?? "")}`
718
712
  ),
719
- [k]
713
+ [B]
720
714
  );
721
- return l(() => {
722
- const e = Xe.current, f = (e.length > 0 && e.length < Ae.length && e.every((u, _) => u === Ae[_]) ? k.slice(e.length) : []).some(
723
- (u) => u.is_new === !1
715
+ return s(() => {
716
+ const e = Ye.current, f = (e.length > 0 && e.length < xe.length && e.every((a, E) => a === xe[E]) ? B.slice(e.length) : []).some(
717
+ (a) => a.is_new === !1
724
718
  );
725
- if (Xe.current = Ae, !f)
719
+ if (Ye.current = xe, !f)
726
720
  return;
727
721
  const i = window.requestAnimationFrame(() => {
728
- const u = Pe.current, _ = We.current;
729
- if (!u || !_)
722
+ const a = Re.current, E = We.current;
723
+ if (!a || !E)
730
724
  return;
731
- const an = u.getBoundingClientRect(), dn = _.getBoundingClientRect(), fn = u.scrollTop + (dn.top - an.top);
732
- u.scrollTo({
733
- top: Math.max(fn, 0),
725
+ const dn = a.getBoundingClientRect(), fn = E.getBoundingClientRect(), mn = a.scrollTop + (fn.top - dn.top);
726
+ a.scrollTo({
727
+ top: Math.max(mn, 0),
734
728
  behavior: "smooth"
735
729
  });
736
730
  });
737
731
  return () => {
738
732
  window.cancelAnimationFrame(i);
739
733
  };
740
- }, [k, Ae]), l(() => {
741
- if (!me.current || (me.current = !1, k.length === 0))
734
+ }, [B, xe]), s(() => {
735
+ if (!me.current || (me.current = !1, B.length === 0))
742
736
  return;
743
737
  const e = window.requestAnimationFrame(() => {
744
- xt();
738
+ At();
745
739
  });
746
740
  return () => {
747
741
  window.cancelAnimationFrame(e);
748
742
  };
749
- }, [k, xt]), /* @__PURE__ */ n.jsxs(
743
+ }, [B, At]), /* @__PURE__ */ n.jsxs(
750
744
  "section",
751
745
  {
752
746
  ref: fe,
753
747
  className: J(
754
748
  "relative h-full w-full",
755
- M && "slide--mobile-device",
756
- $ && "slide--mobile-landscape",
757
- it && "slide--mobile-landscape-native",
758
- Tt
749
+ O && "slide--mobile-device",
750
+ ct && "slide--browser-fullscreen",
751
+ H && "slide--mobile-landscape",
752
+ lt && "slide--mobile-landscape-native",
753
+ Ct
759
754
  ),
760
755
  onClick: un,
761
- onPointerDown: cn,
762
- ...Ct,
756
+ onPointerDown: an,
757
+ ...Pt,
763
758
  children: [
764
- qt ? /* @__PURE__ */ n.jsx(
759
+ zt ? /* @__PURE__ */ n.jsx(
765
760
  "div",
766
761
  {
767
762
  "aria-hidden": "true",
@@ -771,46 +766,52 @@ const Vn = (K, V) => K.length === V.length && K.every((I, Q) => {
771
766
  /* @__PURE__ */ n.jsxs(
772
767
  "div",
773
768
  {
774
- ref: Ge,
769
+ ref: He,
775
770
  className: J(
776
771
  "slide__viewport relative h-full min-h-0 w-full",
777
- $ && "slide__viewport--mobile-landscape",
778
- $ && !Lt && "slide__viewport--mobile-landscape-native"
772
+ H && "slide__viewport--mobile-landscape",
773
+ H && !Vt && "slide__viewport--mobile-landscape-native"
779
774
  ),
780
775
  children: [
781
- Kt ? /* @__PURE__ */ n.jsxs("div", { className: "slide-landscape-header", children: [
776
+ qt ? /* @__PURE__ */ n.jsxs("div", { className: "slide-landscape-header", children: [
782
777
  /* @__PURE__ */ n.jsx(
783
778
  "button",
784
779
  {
785
- "aria-label": A?.backAriaLabel ?? "Back",
780
+ "aria-label": I?.backAriaLabel ?? "Back",
786
781
  className: "slide-landscape-header__back",
787
- onClick: Ut,
782
+ onClick: Ht,
788
783
  type: "button",
789
- children: /* @__PURE__ */ n.jsx(Bn, { className: "h-6 w-6 text-white", strokeWidth: 2.25 })
784
+ children: /* @__PURE__ */ n.jsx(
785
+ Bn,
786
+ {
787
+ className: "slide-landscape-header__icon h-6 w-6",
788
+ strokeWidth: 2.25
789
+ }
790
+ )
790
791
  }
791
792
  ),
792
- A?.content ? /* @__PURE__ */ n.jsx("div", { className: "min-w-0 flex-1 overflow-hidden", children: A.content }) : null
793
+ I?.content ? /* @__PURE__ */ n.jsx("div", { className: "min-w-0 flex-1 overflow-hidden", children: I.content }) : null
793
794
  ] }) : null,
794
795
  /* @__PURE__ */ n.jsx(
795
796
  "div",
796
797
  {
797
798
  className: J(
798
799
  "h-full min-h-0 w-full",
799
- Vt && "slide__viewport-content--with-header",
800
- Mt ? "slide-content--single" : "grid gap-4"
800
+ Ut && "slide__viewport-content--with-header",
801
+ Ft ? "slide-content--single" : "grid gap-4"
801
802
  ),
802
- children: k.length > 0 ? /* @__PURE__ */ n.jsx("div", { className: "slide-stage", children: /* @__PURE__ */ n.jsx("div", { ref: Pe, className: "slide-stage__layer w-full", children: $t.map(
803
+ children: B.length > 0 ? /* @__PURE__ */ n.jsx("div", { className: "slide-stage", children: /* @__PURE__ */ n.jsx("div", { ref: Re, className: "slide-stage__layer w-full", children: Wt.map(
803
804
  (e, t) => {
804
- const s = t === Gt;
805
+ const l = t === $t;
805
806
  return /* @__PURE__ */ n.jsx(
806
807
  "div",
807
808
  {
808
- "aria-hidden": !s || void 0,
809
+ "aria-hidden": !l || void 0,
809
810
  className: "w-full h-full",
810
- style: { display: s ? void 0 : "none" },
811
- children: en(
811
+ style: { display: l ? void 0 : "none" },
812
+ children: tn(
812
813
  e.elementList,
813
- s
814
+ l
814
815
  )
815
816
  },
816
817
  e.sourceStepIndexes[0] ?? t
@@ -819,101 +820,97 @@ const Vn = (K, V) => K.length === V.length && K.every((I, Q) => {
819
820
  ) }) }) : null
820
821
  }
821
822
  ),
822
- Rt ? /* @__PURE__ */ n.jsx(
823
- hn,
823
+ kt ? /* @__PURE__ */ n.jsx(
824
+ vn,
824
825
  {
825
- message: _e,
826
+ message: Kn(
827
+ Ie,
828
+ Bt
829
+ ),
826
830
  className: "absolute left-1/2 top-1/2 z-[3] -translate-x-1/2 -translate-y-1/2"
827
831
  }
828
832
  ) : null,
829
833
  /* @__PURE__ */ n.jsx(
830
834
  wn,
831
835
  {
832
- onClose: zt,
833
- open: jt,
834
- text: Ht
835
- }
836
- ),
837
- /* @__PURE__ */ n.jsx(
838
- In,
839
- {
840
- extraBottomOffset: Nt,
841
- hasPlayerGap: R,
842
- isEnabled: ot && Ft,
843
- isPlayerHidden: w && !R,
836
+ extraBottomOffset: jt,
837
+ hasPlayerGap: M,
838
+ isEnabled: rt && Nt,
839
+ isPlayerHidden: _ && !M,
844
840
  playbackTimeStore: z,
845
- subtitleCues: Wt
841
+ subtitleCues: Yt
846
842
  }
847
843
  ),
848
- Ve ? /* @__PURE__ */ n.jsx(
844
+ Ke ? /* @__PURE__ */ n.jsx(
849
845
  "div",
850
846
  {
851
- ref: Ye,
847
+ ref: $e,
852
848
  className: J(
853
849
  "slide-interaction-overlay",
854
- R && w ? "slide-interaction-overlay--with-player" : "slide-interaction-overlay--standalone"
850
+ M && _ ? "slide-interaction-overlay--with-player" : "slide-interaction-overlay--standalone"
855
851
  ),
856
- onClick: It,
857
- onPointerDown: It,
858
- style: Yt,
852
+ onClick: xt,
853
+ onPointerDown: xt,
854
+ style: Xt,
859
855
  children: /* @__PURE__ */ n.jsx(
860
- _t,
856
+ Et,
861
857
  {
862
858
  content: String(o?.content ?? ""),
863
859
  defaultButtonText: yt.buttonText ?? "",
864
860
  defaultInputText: yt.inputText ?? "",
865
- defaultSelectedValues: Jt,
866
- confirmButtonText: H?.confirmButtonText,
867
- copyButtonText: H?.copyButtonText,
868
- copiedButtonText: H?.copiedButtonText,
869
- onSend: Qt,
870
- readonly: bt,
871
- title: H?.title ?? Ee ?? "Submit the content below to continue."
861
+ defaultSelectedValues: Qt,
862
+ confirmButtonText: D?.confirmButtonText,
863
+ copyButtonText: D?.copyButtonText,
864
+ copiedButtonText: D?.copiedButtonText,
865
+ onSend: Zt,
866
+ readonly: St,
867
+ title: D?.title ?? _e ?? "Submit the content below to continue."
872
868
  }
873
869
  )
874
870
  }
875
871
  ) : null,
876
- w ? /* @__PURE__ */ n.jsx(
872
+ _ ? /* @__PURE__ */ n.jsx(
877
873
  xn,
878
874
  {
879
875
  audioList: h,
880
876
  className: J(
881
- "absolute left-1/2 bottom-6 z-[2] -translate-x-1/2",
877
+ "absolute left-1/2 z-[2] -translate-x-1/2",
878
+ ct ? "bottom-3" : "-bottom-3",
882
879
  Q,
883
- !R && "pointer-events-none opacity-0"
880
+ !M && "pointer-events-none opacity-0"
884
881
  ),
885
- currentAudioIndex: S,
882
+ currentAudioIndex: g,
886
883
  defaultPlaying: !0,
887
- isPlaybackPaused: j,
888
- isAutoAdvanceEnabled: le,
884
+ isPlaybackPaused: L,
885
+ isAutoAdvanceEnabled: ie,
889
886
  hasInteraction: !!o,
890
887
  isInteractionOpen: ye,
891
- isSubtitleEnabled: ot,
892
- onAutoAdvanceToggle: nt,
893
- onLoadingChange: on,
888
+ isSubtitleEnabled: rt,
889
+ onAutoAdvanceToggle: tt,
890
+ onLoadingChange: sn,
894
891
  onPlaybackStarted: () => {
895
- Me(!0);
892
+ Pe(!0);
896
893
  },
897
894
  onPlaybackTimeChange: z.setTime,
898
895
  onSubtitleToggle: () => {
899
- kt((e) => !e);
896
+ Ot((e) => !e);
900
897
  },
901
- nextDisabled: !x,
902
- onEnded: sn,
903
- onFullscreen: tn,
904
- isFullscreen: Bt,
905
- mobileViewMode: O,
906
- settingsPortalContainer: Ge.current,
907
- onMobileViewModeChange: Dt,
908
- onInteractionToggle: ln,
909
- onNext: rn,
910
- onPrev: nn,
911
- prevDisabled: !Pt,
912
- showControls: R,
913
- texts: qe,
914
- customActionContext: Le,
915
- customActions: q,
916
- useAutoAdvanceToggle: ue
898
+ nextDisabled: !A,
899
+ onEnded: ln,
900
+ onFullscreen: nn,
901
+ isFullscreen: ot,
902
+ mobileViewMode: G,
903
+ settingsPortalContainer: He.current,
904
+ onMobileViewModeChange: Gt,
905
+ onInteractionToggle: cn,
906
+ onNext: on,
907
+ onPrev: rn,
908
+ prevDisabled: !Mt,
909
+ showControls: M,
910
+ texts: Tt,
911
+ customActionContext: je,
912
+ customActions: V,
913
+ useAutoAdvanceToggle: ae
917
914
  }
918
915
  ) : null
919
916
  ]
@@ -924,6 +921,6 @@ const Vn = (K, V) => K.length === V.length && K.every((I, Q) => {
924
921
  );
925
922
  };
926
923
  export {
927
- pr as default
924
+ fr as default
928
925
  };
929
926
  //# sourceMappingURL=Slide.es.js.map