markdown-flow-ui 0.1.112-beta.2 → 0.1.112-beta.3

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