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