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