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