markdown-flow-ui 0.2.1 → 0.2.2

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