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