markdown-flow-ui 0.2.22-dev.1 → 0.2.22

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 (63) hide show
  1. package/dist/_virtual/index.es8.js +2 -2
  2. package/dist/_virtual/index.es9.js +2 -2
  3. package/dist/_virtual/index8.cjs +1 -1
  4. package/dist/_virtual/index9.cjs +1 -1
  5. package/dist/assets/markdown-flow-ui.css +1 -1
  6. package/dist/components/Slide/Player.cjs +1 -1
  7. package/dist/components/Slide/Player.cjs.map +1 -1
  8. package/dist/components/Slide/Player.d.ts +1 -3
  9. package/dist/components/Slide/Player.es.js +488 -457
  10. package/dist/components/Slide/Player.es.js.map +1 -1
  11. package/dist/components/Slide/Slide.cjs +1 -1
  12. package/dist/components/Slide/Slide.cjs.map +1 -1
  13. package/dist/components/Slide/Slide.es.js +660 -664
  14. package/dist/components/Slide/Slide.es.js.map +1 -1
  15. package/dist/components/Slide/SubtitleOverlay.cjs +1 -1
  16. package/dist/components/Slide/SubtitleOverlay.cjs.map +1 -1
  17. package/dist/components/Slide/SubtitleOverlay.d.ts +1 -2
  18. package/dist/components/Slide/SubtitleOverlay.es.js +18 -20
  19. package/dist/components/Slide/SubtitleOverlay.es.js.map +1 -1
  20. package/dist/components/Slide/slideI18n.cjs.map +1 -1
  21. package/dist/components/Slide/slideI18n.d.ts +0 -1
  22. package/dist/components/Slide/slideI18n.es.js.map +1 -1
  23. package/dist/components/Slide/utils/interactionPlayback.cjs +1 -1
  24. package/dist/components/Slide/utils/interactionPlayback.cjs.map +1 -1
  25. package/dist/components/Slide/utils/interactionPlayback.d.ts +1 -2
  26. package/dist/components/Slide/utils/interactionPlayback.es.js +7 -8
  27. package/dist/components/Slide/utils/interactionPlayback.es.js.map +1 -1
  28. package/dist/components/Slide/utils/playerCustomActions.cjs +1 -1
  29. package/dist/components/Slide/utils/playerCustomActions.cjs.map +1 -1
  30. package/dist/components/Slide/utils/playerCustomActions.d.ts +1 -1
  31. package/dist/components/Slide/utils/playerCustomActions.es.js +14 -18
  32. package/dist/components/Slide/utils/playerCustomActions.es.js.map +1 -1
  33. package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs +1 -1
  34. package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.map +1 -1
  35. package/dist/components/Slide/utils/playerKeyboardShortcuts.d.ts +1 -1
  36. package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js +2 -0
  37. package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js.map +1 -1
  38. package/dist/components/Slide/utils/playerVisibility.cjs +1 -1
  39. package/dist/components/Slide/utils/playerVisibility.cjs.map +1 -1
  40. package/dist/components/Slide/utils/playerVisibility.d.ts +10 -0
  41. package/dist/components/Slide/utils/playerVisibility.es.js +14 -6
  42. package/dist/components/Slide/utils/playerVisibility.es.js.map +1 -1
  43. package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs +1 -1
  44. package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  45. package/dist/node_modules/classnames/index.cjs +1 -1
  46. package/dist/node_modules/classnames/index.es.js +1 -1
  47. package/dist/node_modules/cose-base/cose-base.cjs +1 -1
  48. package/dist/node_modules/cose-base/cose-base.cjs.map +1 -1
  49. package/dist/node_modules/cose-base/cose-base.es.js +1 -1
  50. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs +1 -1
  51. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs.map +1 -1
  52. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.es.js +1 -1
  53. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs +1 -1
  54. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs.map +1 -1
  55. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.es.js +1 -1
  56. package/dist/node_modules/layout-base/layout-base.cjs +1 -1
  57. package/dist/node_modules/layout-base/layout-base.cjs.map +1 -1
  58. package/dist/node_modules/layout-base/layout-base.es.js +1 -1
  59. package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.cjs +7 -0
  60. package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.cjs.map +1 -0
  61. package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js +29 -0
  62. package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js.map +1 -0
  63. package/package.json +1 -1
@@ -1,78 +1,78 @@
1
- import { jsxs as Ue, jsx as u, Fragment as Lr } from "react/jsx-runtime";
2
- import { memo as Dr, useMemo as f, useId as Nr, useRef as m, useCallback as r, useState as p, useEffect as a, useLayoutEffect as Br } from "react";
3
- import { isSandboxInteractionMessage as Vr } from "../../lib/sandboxInteraction.es.js";
1
+ import { jsxs as Ue, jsx as u, Fragment as Fr } from "react/jsx-runtime";
2
+ import { memo as Lr, useMemo as f, useId as Dr, useRef as m, useCallback as r, useState as p, useEffect as s, useLayoutEffect as Nr } from "react";
3
+ import { isSandboxInteractionMessage as Br } from "../../lib/sandboxInteraction.es.js";
4
4
  import { cn as Ie } from "../../lib/utils.es.js";
5
- import { useResolvedDirection as qr } from "../../lib/useResolvedDirection.es.js";
6
- import { getMarkdownFlowDirection as Kr, getMarkdownFlowLanguage as Ur } from "../../lib/locale.es.js";
7
- import Hr from "../ui/loading-overlay-card.es.js";
8
- import Yr from "../ContentRender/ContentRender.es.js";
9
- import Tn from "../ContentRender/IframeSandbox.es.js";
5
+ import { useResolvedDirection as Vr } from "../../lib/useResolvedDirection.es.js";
6
+ import { getMarkdownFlowDirection as qr, getMarkdownFlowLanguage as Kr } from "../../lib/locale.es.js";
7
+ import Ur from "../ui/loading-overlay-card.es.js";
8
+ import Hr from "../ContentRender/ContentRender.es.js";
9
+ import En from "../ContentRender/IframeSandbox.es.js";
10
10
  import "../ui/inputGroup/input-group.es.js";
11
- import { isMobileDevice as Gr, isLandscapeViewport as Pn, subscribeMobileDeviceChange as $r } from "../../lib/mobileDevice.es.js";
12
- import zr from "./Player.es.js";
13
- import Xr from "./MarkdownSlideScaling.es.js";
14
- import Jr from "./SubtitleOverlay.es.js";
15
- import Wr from "./useSlide.es.js";
16
- import jr from "./useWakePlayerFromIframe.es.js";
17
- import { PlayerKeyboardShortcutContext as Qr } from "./utils/playerKeyboardShortcutContext.es.js";
18
- import { activatePlayerKeyboardShortcutOwner as Zr } from "./utils/playerKeyboardShortcuts.es.js";
19
- import { DEFAULT_MOBILE_VIEW_MODE as mt, resolveMobileViewModeState as eo } from "./utils/mobileScreenMode.es.js";
20
- import { shouldRenderInteractionOverlay as to, clampInteractionOverlayDragOffset as Rn, shouldPresentInteractionOverlay as no } from "./utils/interactionPlayback.es.js";
21
- import { resolveMarkdownScalingMode as ro } from "./utils/markdownScaling.es.js";
22
- import { shouldWakePlayerControlsAfterNavigation as Bt } from "./utils/playerNavigationContext.es.js";
23
- import { shouldAutoAdvanceIntoAppendedMarker as oo } from "./utils/appendedMarkerAdvance.es.js";
24
- import { resolvePendingStepAudioKey as io, hasUnplayedStepAudio as lo } from "./utils/stepAudioProgress.es.js";
25
- import { getPlaybackSequenceTransition as ao, shouldStartDefaultAudioSequence as so } from "./utils/playbackSequence.es.js";
26
- import { hasResolvedInteractionElement as co, canReachSubtitleJumpTarget as _n } from "./utils/subtitleJumpNavigation.es.js";
27
- import { resolvePlayerCustomActionElement as uo, getPlayerCustomActionCount as fo } from "./utils/playerCustomActions.es.js";
28
- import { createPlaybackTimeStore as mo } from "./utils/playbackTimeStore.es.js";
29
- import { resolveSlideInteractionState as po } from "./utils/interactionResolution.es.js";
30
- import { shouldUseAutoAdvanceToggle as yo } from "./utils/playerToggleMode.es.js";
31
- import { DEFAULT_IMAGE_ONLY_VISUAL_READY_TIMEOUT_MS as ho, areImageOnlyStepIframeVisualsReady as go } from "./utils/imageOnlyStepVisualReady.es.js";
32
- import { resolveSilentStepAutoAdvanceBehavior as vo } from "./utils/silentStepAutoAdvance.es.js";
33
- import { resolveSlidePlayerVisibility as So } from "./utils/playerVisibility.es.js";
11
+ import { isMobileDevice as Yr, isLandscapeViewport as Tn, subscribeMobileDeviceChange as Gr } from "../../lib/mobileDevice.es.js";
12
+ import $r from "./Player.es.js";
13
+ import zr from "./MarkdownSlideScaling.es.js";
14
+ import Xr from "./SubtitleOverlay.es.js";
15
+ import Jr from "./useSlide.es.js";
16
+ import Wr from "./useWakePlayerFromIframe.es.js";
17
+ import { PlayerKeyboardShortcutContext as jr } from "./utils/playerKeyboardShortcutContext.es.js";
18
+ import { activatePlayerKeyboardShortcutOwner as Qr } from "./utils/playerKeyboardShortcuts.es.js";
19
+ import { DEFAULT_MOBILE_VIEW_MODE as dt, resolveMobileViewModeState as Zr } from "./utils/mobileScreenMode.es.js";
20
+ import { shouldRenderInteractionOverlay as eo, clampInteractionOverlayDragOffset as Cn, shouldPresentInteractionOverlay as to } from "./utils/interactionPlayback.es.js";
21
+ import { resolveMarkdownScalingMode as no } from "./utils/markdownScaling.es.js";
22
+ import { shouldWakePlayerControlsAfterNavigation as Lt } from "./utils/playerNavigationContext.es.js";
23
+ import { shouldAutoAdvanceIntoAppendedMarker as ro } from "./utils/appendedMarkerAdvance.es.js";
24
+ import { resolvePendingStepAudioKey as oo, hasUnplayedStepAudio as io } from "./utils/stepAudioProgress.es.js";
25
+ import { getPlaybackSequenceTransition as lo, shouldStartDefaultAudioSequence as ao } from "./utils/playbackSequence.es.js";
26
+ import { hasResolvedInteractionElement as so, canReachSubtitleJumpTarget as Pn } from "./utils/subtitleJumpNavigation.es.js";
27
+ import { resolvePlayerCustomActionElement as co, getPlayerCustomActionCount as uo } from "./utils/playerCustomActions.es.js";
28
+ import { createPlaybackTimeStore as fo } from "./utils/playbackTimeStore.es.js";
29
+ import { resolveSlideInteractionState as mo } from "./utils/interactionResolution.es.js";
30
+ import { shouldUseAutoAdvanceToggle as po } from "./utils/playerToggleMode.es.js";
31
+ import { DEFAULT_IMAGE_ONLY_VISUAL_READY_TIMEOUT_MS as yo, areImageOnlyStepIframeVisualsReady as ho } from "./utils/imageOnlyStepVisualReady.es.js";
32
+ import { resolveSilentStepAutoAdvanceBehavior as go } from "./utils/silentStepAutoAdvance.es.js";
33
+ import { resolveSlidePlayerVisibility as vo, resolveSlidePlayerLayoutState as So } from "./utils/playerVisibility.es.js";
34
34
  import { getSlideLocaleTexts as Io, DEFAULT_SLIDE_BUFFERING_TEXTS as bo } from "./slideI18n.es.js";
35
35
  /* empty css */
36
- import Vt from "../../node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js";
36
+ import Dt from "../../node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js";
37
37
  import Ao from "../../node_modules/lucide-react/dist/esm/icons/chevron-left.es.js";
38
- const wo = 2e3, xo = 300, Eo = 160, Co = 16, On = 3e3, pt = {
38
+ const wo = 2e3, xo = 300, Eo = 160, To = 16, Rn = 3e3, ft = {
39
39
  x: 0,
40
40
  y: 0
41
- }, Kt = 0.5, To = typeof window > "u" ? a : Br, Po = [
41
+ }, Bt = 0.5, Co = typeof window > "u" ? s : Nr, Po = [
42
42
  "button",
43
43
  "input",
44
44
  "textarea",
45
45
  '[contenteditable=""]',
46
46
  '[contenteditable="true"]',
47
47
  '[contenteditable="plaintext-only"]'
48
- ].join(", "), Ut = "waitingForAudio", Ro = ({
48
+ ].join(", "), Vt = "waitingForAudio", Ro = ({
49
49
  x: c,
50
50
  y: d
51
51
  }) => ({
52
52
  x: Number(c.toFixed(2)),
53
53
  y: Number(d.toFixed(2))
54
- }), Mn = (c) => Math.abs(c) >= Kt, kn = (c, d) => Math.abs(c.x - d.x) < Kt && Math.abs(c.y - d.y) < Kt, _o = (c, d) => typeof c == "string" ? c : c[d] ?? c[Ut] ?? bo[d], Oo = (c, d) => typeof c == "string" ? c : {
54
+ }), _n = (c) => Math.abs(c) >= Bt, On = (c, d) => Math.abs(c.x - d.x) < Bt && Math.abs(c.y - d.y) < Bt, _o = (c, d) => typeof c == "string" ? c : c[d] ?? c[Vt] ?? bo[d], Oo = (c, d) => typeof c == "string" ? c : {
55
55
  ...d,
56
56
  ...c
57
- }, Mo = (c, d) => d ? c !== "loadingAudio" : !1, Fn = Dr(
57
+ }, Mo = (c, d) => d ? c !== "loadingAudio" : !1, Mn = Lr(
58
58
  ({
59
59
  content: c,
60
60
  title: d,
61
- dragHandleAriaLabel: G,
61
+ dragHandleAriaLabel: Y,
62
62
  locale: be,
63
- dir: $,
64
- lang: z,
65
- defaultButtonText: Ae,
63
+ dir: G,
64
+ lang: $,
65
+ defaultButtonText: oe,
66
66
  defaultInputText: ie,
67
67
  defaultSelectedValues: He,
68
- confirmButtonText: yt,
69
- copyButtonText: X,
70
- copiedButtonText: ht,
71
- onSend: we,
68
+ confirmButtonText: mt,
69
+ copyButtonText: z,
70
+ copiedButtonText: pt,
71
+ onSend: Ae,
72
72
  onDragHandlePointerCancel: Ye,
73
73
  onDragHandlePointerDown: Ge,
74
74
  onDragHandlePointerMove: $e,
75
- onDragHandlePointerUp: xe,
75
+ onDragHandlePointerUp: we,
76
76
  readonly: ze = !1
77
77
  }) => /* @__PURE__ */ Ue("div", { className: "slide-player__interaction-card", children: [
78
78
  /* @__PURE__ */ u(
@@ -80,181 +80,179 @@ const wo = 2e3, xo = 300, Eo = 160, Co = 16, On = 3e3, pt = {
80
80
  {
81
81
  type: "button",
82
82
  className: "slide-player__interaction-drag-handle",
83
- "aria-label": G,
83
+ "aria-label": Y,
84
84
  onPointerCancel: Ye,
85
85
  onPointerDown: Ge,
86
86
  onPointerMove: $e,
87
- onPointerUp: xe,
87
+ onPointerUp: we,
88
88
  children: /* @__PURE__ */ Ue("span", { className: "slide-player__interaction-drag-handle-icon", children: [
89
- /* @__PURE__ */ u(Vt, { "aria-hidden": "true" }),
90
- /* @__PURE__ */ u(Vt, { "aria-hidden": "true" }),
91
- /* @__PURE__ */ u(Vt, { "aria-hidden": "true" })
89
+ /* @__PURE__ */ u(Dt, { "aria-hidden": "true" }),
90
+ /* @__PURE__ */ u(Dt, { "aria-hidden": "true" }),
91
+ /* @__PURE__ */ u(Dt, { "aria-hidden": "true" })
92
92
  ] })
93
93
  }
94
94
  ),
95
95
  /* @__PURE__ */ u("div", { className: "slide-player__interaction-header", children: /* @__PURE__ */ u("p", { className: "slide-player__interaction-title", children: d }) }),
96
96
  /* @__PURE__ */ u("div", { className: "slide-player__interaction-body", children: /* @__PURE__ */ u(
97
- Yr,
97
+ Hr,
98
98
  {
99
99
  content: c,
100
100
  locale: be,
101
- dir: $,
102
- lang: z,
103
- defaultButtonText: Ae,
101
+ dir: G,
102
+ lang: $,
103
+ defaultButtonText: oe,
104
104
  defaultInputText: ie,
105
105
  defaultSelectedValues: He,
106
- confirmButtonText: yt,
107
- copyButtonText: X,
108
- copiedButtonText: ht,
109
- onSend: we,
106
+ confirmButtonText: mt,
107
+ copyButtonText: z,
108
+ copiedButtonText: pt,
109
+ onSend: Ae,
110
110
  readonly: ze,
111
111
  sandboxMode: "content"
112
112
  }
113
113
  ) })
114
114
  ] })
115
115
  );
116
- Fn.displayName = "InteractionOverlayCard";
117
- const ko = (c, d) => c.length === d.length && c.every((G, be) => {
118
- const $ = d[be];
119
- return G.sequence_number === $?.sequence_number && G.type === $?.type && G.content === $?.content;
120
- }), qt = (c) => c instanceof HTMLElement && !!c.closest(Po), Si = ({
116
+ Mn.displayName = "InteractionOverlayCard";
117
+ const ko = (c, d) => c.length === d.length && c.every((Y, be) => {
118
+ const G = d[be];
119
+ return Y.sequence_number === G?.sequence_number && Y.type === G?.type && Y.content === G?.content;
120
+ }), Nt = (c) => c instanceof HTMLElement && !!c.closest(Po), Si = ({
121
121
  elementList: c = [],
122
122
  locale: d,
123
- playerEnabled: G,
123
+ playerEnabled: Y,
124
124
  playerControlsVisibility: be,
125
- playerClassName: $,
126
- fullscreenHeader: z,
127
- playerCustomActions: Ae,
125
+ playerClassName: G,
126
+ fullscreenHeader: $,
127
+ playerCustomActions: oe,
128
128
  playerCustomActionPauseOnActive: ie = !0,
129
129
  bufferingText: He,
130
- interactionTitle: yt,
131
- interactionTexts: X,
132
- playerTexts: ht,
133
- playerAutoHideDelay: we = 3e3,
130
+ interactionTitle: mt,
131
+ interactionTexts: z,
132
+ playerTexts: pt,
133
+ playerAutoHideDelay: Ae = 3e3,
134
134
  markerAutoAdvanceDelay: Ye = wo,
135
135
  interactionDefaultValueOptions: Ge,
136
136
  onSend: $e,
137
- onPlayerVisibilityChange: xe,
137
+ onPlayerVisibilityChange: we,
138
138
  onMobileViewModeChange: ze,
139
- onStepChange: Ht,
139
+ onStepChange: qt,
140
140
  enableKeyboardShortcuts: le = !0,
141
- enableIframeScaling: Ln = !0,
142
- enableMarkdownScaling: Dn = !0,
143
- disableLoadingOverlay: L = !1,
144
- className: Nn,
145
- dir: Bn,
146
- lang: Vn,
147
- onPointerDown: Yt,
148
- onFocusCapture: Gt,
149
- ...qn
141
+ enableIframeScaling: kn = !0,
142
+ enableMarkdownScaling: Fn = !0,
143
+ disableLoadingOverlay: M = !1,
144
+ className: Ln,
145
+ dir: Dn,
146
+ lang: Nn,
147
+ onPointerDown: Kt,
148
+ onFocusCapture: Ut,
149
+ ...Bn
150
150
  }) => {
151
- const J = Bn ?? Kr(d), Ee = Vn ?? Ur(d), q = f(() => Io(d), [d]), Kn = f(
151
+ const X = Dn ?? qr(d), xe = Nn ?? Kr(d), q = f(() => Io(d), [d]), Vn = f(
152
152
  () => Oo(
153
153
  He,
154
154
  q.bufferingText
155
155
  ),
156
156
  [He, q.bufferingText]
157
157
  ), {
158
- playerEnabled: Un,
159
- playerControlsVisibility: K
160
- } = So({
161
- playerEnabled: G,
158
+ playerEnabled: qn,
159
+ playerControlsVisibility: J
160
+ } = vo({
161
+ playerEnabled: Y,
162
162
  playerControlsVisibility: be
163
- }), Xe = Nr(), ae = m(null), { resolvedDirection: Hn } = qr(ae, J), gt = m(null), Je = m(null), $t = m(null), se = m(null), We = m(!1), Ce = m(null), je = m(null), W = m(null), Te = m(null), Pe = m(null), ce = m(null), Re = m(null), zt = m([]), _e = m(!1), j = m(null), Oe = m(null), Xt = m(0), Jt = m(null), Wt = m({
163
+ }), Xe = Dr(), ae = m(null), { resolvedDirection: Kn } = Vr(ae, X), yt = m(null), Je = m(null), Ht = m(null), se = m(null), We = m(!1), Ee = m(null), je = m(null), W = m(null), Te = m(null), Ce = m(null), ce = m(null), Pe = m(null), Yt = m([]), Re = m(!1), j = m(null), _e = m(null), Gt = m(0), $t = m(null), zt = m({
164
164
  markerCount: 0,
165
165
  currentIndex: -1,
166
166
  canGoNext: !1
167
- }), vt = m(!1), {
168
- currentElementList: R,
169
- stepElementLists: jt,
170
- slideElementList: P,
171
- currentIndex: s,
167
+ }), ht = m(!1), {
168
+ currentElementList: P,
169
+ stepElementLists: Xt,
170
+ slideElementList: C,
171
+ currentIndex: a,
172
172
  audioList: S,
173
173
  audioSlideIndexes: Qe,
174
174
  currentAudioSequenceIndexes: Ze,
175
- currentStepHasSpeakableElement: A,
175
+ currentStepHasSpeakableElement: b,
176
176
  currentInteractionElement: y,
177
- canGoPrev: Yn,
178
- canGoNext: _,
179
- handlePrev: Qt,
180
- handleNext: D,
181
- handleGoTo: Zt
182
- } = Wr(c), Me = f(() => {
183
- if (!(s < 0))
184
- return P[s];
185
- }, [s, P]), ue = f(
186
- () => R.map(
177
+ canGoPrev: Un,
178
+ canGoNext: R,
179
+ handlePrev: Jt,
180
+ handleNext: k,
181
+ handleGoTo: Wt
182
+ } = Jr(c), Oe = f(() => {
183
+ if (!(a < 0))
184
+ return C[a];
185
+ }, [a, C]), ue = f(
186
+ () => P.map(
187
187
  (e, t) => `${e.sequence_number ?? `${e.type}-${t}`}:${String(e.is_new ?? "")}`
188
188
  ),
189
- [R]
190
- ), Gn = P.filter(
189
+ [P]
190
+ ), Hn = C.filter(
191
191
  (e) => e.is_renderable !== !1
192
- ).length === 1, h = Un && (P.length > 0 || S.length > 0 || !!y), $n = f(
192
+ ).length === 1, A = qn && (C.length > 0 || S.length > 0 || !!y), Yn = f(
193
193
  () => ({
194
194
  enabled: le,
195
195
  ownerId: Xe
196
196
  }),
197
197
  [le, Xe]
198
- ), U = r(() => {
199
- !le || !h || Zr(Xe);
200
- }, [le, Xe, h]), O = f(
198
+ ), K = r(() => {
199
+ !le || !A || Qr(Xe);
200
+ }, [le, Xe, A]), _ = f(
201
201
  () => Ze.map((e) => S[e]?.audioKey).filter((e) => !!e),
202
202
  [S, Ze]
203
- ), [zn, ke] = p(!0), [et, de] = p(!1), [St, en] = p(!0), [Fe, tn] = p(!0), [x, H] = p(null), [Xn, nn] = p(null), [Jn, w] = p(!1), [Wn, It] = p(Ut), [M, tt] = p(!1), nt = m(/* @__PURE__ */ new Set()), [jn, rt] = p(!1), [rn, Qn] = p(!0), [bt, At] = p(!1), [I, wt] = p(), [fe, ot] = p(!1), [on, it] = p(!1), [E, xt] = p(
204
- pt
205
- ), [Et, Ct] = p(!1), [
206
- Zn,
207
- me
208
- ] = p(0), [ln, er] = p(!1), B = f(() => Gr(), []), [lt, Tt] = p(
209
- mt
210
- ), [an, Pt] = p(!1), [tr, sn] = p(
211
- () => B ? Pn() : !1
212
- ), pe = f(() => mo(), []), {
203
+ ), [Gn, Me] = p(!0), [et, de] = p(!1), [gt, jt] = p(!0), [ke, Qt] = p(!0), [x, U] = p(null), [$n, Zt] = p(null), [zn, w] = p(!1), [Xn, vt] = p(Vt), [O, tt] = p(!1), nt = m(/* @__PURE__ */ new Set()), [Jn, rt] = p(!1), [en, Wn] = p(!0), [St, It] = p(!1), [h, bt] = p(), [fe, ot] = p(!1), [tn, it] = p(!1), [E, At] = p(
204
+ ft
205
+ ), [wt, xt] = p(!1), [
206
+ jn,
207
+ Fe
208
+ ] = p(0), [nn, Qn] = p(!1), N = f(() => Yr(), []), [lt, Et] = p(
209
+ dt
210
+ ), [rn, Tt] = p(!1), [Zn, on] = p(
211
+ () => N ? Tn() : !1
212
+ ), me = f(() => fo(), []), {
213
213
  effectiveMobileViewMode: Q,
214
- isImmersiveMobileFullscreen: ye,
215
- isNativeMobileFullscreen: cn,
216
- shouldRotateFullscreenViewport: nr
214
+ isImmersiveMobileFullscreen: pe,
215
+ isNativeMobileFullscreen: ln,
216
+ shouldRotateFullscreenViewport: er
217
217
  } = f(
218
- () => eo({
219
- hasManualMobileViewMode: an,
220
- isMobileDevice: B,
218
+ () => Zr({
219
+ hasManualMobileViewMode: rn,
220
+ isMobileDevice: N,
221
221
  mobileViewMode: lt
222
222
  }),
223
223
  [
224
- an,
225
- B,
226
- tr,
224
+ rn,
225
+ N,
226
+ Zn,
227
227
  lt
228
228
  ]
229
- ), un = m(Q), C = h && K !== "hidden" && (K === "visible" || zn), rr = ye && C, or = ye && C, ir = ye || cn, dn = ln && !B, lr = r(
229
+ ), an = m(Q), {
230
+ controlsVisible: B,
231
+ layoutReserved: at
232
+ } = So({
233
+ isAutoVisible: Gn,
234
+ playerControlsVisibility: J,
235
+ shouldMountPlayer: A
236
+ }), tr = pe && B, nr = pe && at, rr = pe || ln, sn = nn && !N, or = r(
230
237
  (e) => {
231
- Pt(!0), Tt(e);
238
+ Tt(!0), Et(e);
232
239
  },
233
240
  []
234
- ), fn = r(() => {
235
- Pt(!1), Tt(mt);
236
- }, []), ar = r(() => {
237
- fn(), z?.onBack?.();
238
- }, [z, fn]), k = r(() => {
239
- W.current !== null && (window.clearTimeout(W.current), W.current = null);
240
- }, []), F = r(() => {
241
- Te.current !== null && (window.clearTimeout(Te.current), Te.current = null);
242
- }, []), at = r(() => {
243
- k(), F(), ot(!1), me(0);
244
- }, [k, F]), st = r(
245
- (e) => {
246
- e && at(), At(e);
247
- },
248
- [at]
249
- ), mn = r(() => {
250
- at(), At((e) => !e);
251
- }, [at]), Z = r(() => {
252
- xt(
253
- (e) => e.x === pt.x && e.y === pt.y ? e : pt
254
- ), Ct(!1), Re.current = null, ce.current = null;
255
- }, []), { mountedStepStates: sr, currentMountedStateIndex: cr } = f(() => {
241
+ ), cn = r(() => {
242
+ Tt(!1), Et(dt);
243
+ }, []), ir = r(() => {
244
+ cn(), $?.onBack?.();
245
+ }, [$, cn]), un = r((e) => {
246
+ It(e);
247
+ }, []), dn = r(() => {
248
+ It((e) => !e);
249
+ }, []), Z = r(() => {
250
+ At(
251
+ (e) => e.x === ft.x && e.y === ft.y ? e : ft
252
+ ), xt(!1), Pe.current = null, ce.current = null;
253
+ }, []), { mountedStepStates: lr, currentMountedStateIndex: ar } = f(() => {
256
254
  const e = [], t = /* @__PURE__ */ new Map();
257
- return jt.forEach((n, i) => {
255
+ return Xt.forEach((n, i) => {
258
256
  const l = e.findIndex(
259
257
  (o) => ko(
260
258
  o.elementList,
@@ -271,53 +269,53 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
271
269
  }), t.set(i, e.length - 1);
272
270
  }), {
273
271
  mountedStepStates: e,
274
- currentMountedStateIndex: s >= 0 ? t.get(s) ?? -1 : -1
272
+ currentMountedStateIndex: a >= 0 ? t.get(a) ?? -1 : -1
275
273
  };
276
- }, [s, jt]), pn = f(() => String(s), [s]), T = f(() => x ? S.findIndex(
274
+ }, [a, Xt]), fn = f(() => String(a), [a]), T = f(() => x ? S.findIndex(
277
275
  (e) => (e.audioKey ?? "") === x
278
- ) : -1, [S, x]), Rt = f(
276
+ ) : -1, [S, x]), Ct = f(
279
277
  () => T >= 0 ? S[T] : void 0,
280
278
  [S, T]
281
- ), ur = Rt?.element?.subtitle_cues ?? [], ct = f(
282
- () => O[0] ?? "none",
283
- [O]
284
- ), _t = f(
279
+ ), sr = Ct?.element?.subtitle_cues ?? [], st = f(
280
+ () => _[0] ?? "none",
281
+ [_]
282
+ ), Pt = f(
285
283
  () => ({
286
- currentElement: uo({
284
+ currentElement: co({
287
285
  currentAudioIndex: T,
288
286
  currentAudioSequenceIndexes: Ze,
289
287
  audioList: S,
290
- currentInteractionElement: I,
291
- currentStepElement: Me
288
+ currentInteractionElement: h,
289
+ currentStepElement: Oe
292
290
  }),
293
- currentIndex: s,
294
- currentStepElement: Me,
295
- isActive: bt,
296
- setActive: st,
297
- toggleActive: mn
291
+ currentIndex: a,
292
+ currentStepElement: Oe,
293
+ isActive: St,
294
+ setActive: un,
295
+ toggleActive: dn
298
296
  }),
299
297
  [
300
- I,
298
+ h,
301
299
  S,
302
300
  T,
303
301
  Ze,
304
- s,
305
- Me,
306
- bt,
307
- st,
308
- mn
302
+ a,
303
+ Oe,
304
+ St,
305
+ un,
306
+ dn
309
307
  ]
310
- ), ut = f(
311
- () => fo(
312
- Ae,
313
- _t
308
+ ), Rt = f(
309
+ () => uo(
310
+ oe,
311
+ Pt
314
312
  ),
315
- [_t, Ae]
316
- ), Ot = ut > 0, Mt = Ot && bt, dr = f(
313
+ [Pt, oe]
314
+ ), cr = f(
317
315
  () => ({
318
- "--slide-player-custom-action-count": String(ut),
316
+ "--slide-player-custom-action-count": String(Rt),
319
317
  "--slide-player-mobile-control-count": String(
320
- ut + 4
318
+ Rt + 4
321
319
  ),
322
320
  "--slide-interaction-drag-x": `${E.x}px`,
323
321
  "--slide-interaction-drag-y": `${E.y}px`
@@ -325,96 +323,100 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
325
323
  [
326
324
  E.x,
327
325
  E.y,
328
- ut
326
+ Rt
329
327
  ]
330
- ), yn = O.length > 0, hn = f(() => y ? `${y.sequence_number ?? "none"}:${String(
328
+ ), mn = _.length > 0, pn = f(() => y ? `${y.sequence_number ?? "none"}:${String(
331
329
  y.content ?? ""
332
330
  )}` : "none", [y]), Le = f(
333
- () => [pn, hn].join("|"),
334
- [hn, pn]
335
- ), fr = f(
331
+ () => [fn, pn].join("|"),
332
+ [pn, fn]
333
+ ), ur = f(
336
334
  () => [
337
335
  Le,
338
- Rt?.audioKey ?? "none",
336
+ Ct?.audioKey ?? "none",
339
337
  String(T)
340
338
  ].join("|"),
341
- [T, Rt?.audioKey, Le]
342
- ), gn = !!f(() => !ct || ct === "none" ? "" : S.find(
343
- (t) => t.audioKey === ct
344
- )?.audioUrl?.trim() ?? "", [S, ct]), ee = ie && Mt, De = f(
345
- () => yo({
346
- canGoNext: _,
339
+ [T, Ct?.audioKey, Le]
340
+ ), yn = !!f(() => !st || st === "none" ? "" : S.find(
341
+ (t) => t.audioKey === st
342
+ )?.audioUrl?.trim() ?? "", [S, st]), ee = ie && !!oe && St, De = f(
343
+ () => po({
344
+ canGoNext: R,
347
345
  currentAudioIndex: T,
348
- currentStepHasSpeakableElement: A,
346
+ currentStepHasSpeakableElement: b,
349
347
  hasInteraction: !!y
350
348
  }),
351
349
  [
352
- _,
350
+ R,
353
351
  T,
354
352
  y,
355
- A
353
+ b
356
354
  ]
357
- ), vn = f(
358
- () => vo({
359
- currentElementList: R,
360
- currentStepHasSpeakableElement: A,
355
+ ), hn = f(
356
+ () => go({
357
+ currentElementList: P,
358
+ currentStepHasSpeakableElement: b,
361
359
  currentInteractionElement: y,
362
360
  markerAutoAdvanceDelay: Ye
363
361
  }),
364
362
  [
365
- R,
363
+ P,
366
364
  y,
367
- A,
365
+ b,
368
366
  Ye
369
367
  ]
370
- ), Sn = vn.delayMs, Ne = vn.usesImageOnlyDelay, kt = f(
371
- () => `${s}:${ue.join("|")}`,
372
- [s, ue]
373
- ), [mr, pr] = p(null), In = !Ne || mr === kt, V = r(() => {
368
+ ), gn = hn.delayMs, Ne = hn.usesImageOnlyDelay, _t = f(
369
+ () => `${a}:${ue.join("|")}`,
370
+ [a, ue]
371
+ ), [dr, fr] = p(null), vn = !Ne || dr === _t, V = r(() => {
374
372
  se.current !== null && (window.clearTimeout(se.current), se.current = null);
375
- }, []), he = r(() => {
376
- Ce.current !== null && (window.clearTimeout(Ce.current), Ce.current = null);
377
- }, []), Y = r(() => {
373
+ }, []), F = r(() => {
374
+ W.current !== null && (window.clearTimeout(W.current), W.current = null);
375
+ }, []), L = r(() => {
376
+ Te.current !== null && (window.clearTimeout(Te.current), Te.current = null);
377
+ }, []), ye = r(() => {
378
+ Ee.current !== null && (window.clearTimeout(Ee.current), Ee.current = null);
379
+ }, []), H = r(() => {
378
380
  je.current !== null && (window.clearTimeout(je.current), je.current = null);
379
- }, []), N = r(
381
+ }, []), D = r(
380
382
  (e = {}) => {
381
- he(), k(), F(), Y(), H(null), pe.reset(), w(!1), It(Ut), tt(!1), nt.current = /* @__PURE__ */ new Set(), rt(!1), nn(null), e.preservePendingSubtitleJump || (Oe.current = null), wt(void 0), ot(!1), me(0);
383
+ ye(), F(), L(), H(), U(null), me.reset(), w(!1), vt(Vt), tt(!1), nt.current = /* @__PURE__ */ new Set(), rt(!1), Zt(null), e.preservePendingSubtitleJump || (_e.current = null), bt(void 0), ot(!1), Fe(0);
382
384
  },
383
385
  [
384
- he,
385
- Y,
386
- k,
386
+ ye,
387
+ H,
387
388
  F,
388
- pe
389
+ L,
390
+ me
389
391
  ]
390
- ), dt = r(
392
+ ), ct = r(
391
393
  (e) => {
392
- Xt.current += 1, nn({
394
+ Gt.current += 1, Zt({
393
395
  ...e,
394
- id: Xt.current
396
+ id: Gt.current
395
397
  });
396
398
  },
397
399
  []
398
- ), ge = r(() => {
399
- const e = io(
400
- O,
400
+ ), he = r(() => {
401
+ const e = oo(
402
+ _,
401
403
  nt.current
402
404
  );
403
- return e ? (H(e), !0) : !1;
404
- }, [O]), Be = r(() => {
405
- k(), F(), ot(!1), me(0), !ge() && _ && D();
405
+ return e ? (U(e), !0) : !1;
406
+ }, [_]), Be = r(() => {
407
+ F(), L(), ot(!1), Fe(0), !he() && R && k();
406
408
  }, [
407
- _,
408
- k,
409
+ R,
409
410
  F,
410
- D,
411
- ge
412
- ]), bn = r(
411
+ L,
412
+ k,
413
+ he
414
+ ]), Sn = r(
413
415
  (e) => {
414
- if (F(), !e)
416
+ if (L(), !e)
415
417
  return;
416
418
  const t = () => {
417
- Te.current = null, me(
419
+ Te.current = null, Fe(
418
420
  Eo
419
421
  ), ot(!0), j.current = null;
420
422
  };
@@ -423,64 +425,58 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
423
425
  xo
424
426
  );
425
427
  },
426
- [F]
427
- ), Ft = r(
428
+ [L]
429
+ ), Ot = r(
428
430
  () => We.current || !!ae.current?.querySelector(".slide-player__controls:hover"),
429
431
  []
430
432
  ), g = r(
431
433
  (e = et) => {
432
- !h || K === "hidden" || (ke(!0), V(), !(K === "visible" || !e || we <= 0 || Ft()) && (se.current = window.setTimeout(() => {
433
- if (Ft()) {
434
+ !A || J === "hidden" || (Me(!0), V(), !(J === "visible" || !e || Ae <= 0 || Ot()) && (se.current = window.setTimeout(() => {
435
+ if (Ot()) {
434
436
  se.current = null;
435
437
  return;
436
438
  }
437
- ke(!1), se.current = null;
438
- }, we)));
439
+ Me(!1), se.current = null;
440
+ }, Ae)));
439
441
  },
440
442
  [
441
443
  V,
442
444
  et,
443
- Ft,
444
- we,
445
- K,
446
- h
445
+ Ot,
446
+ Ae,
447
+ J,
448
+ A
447
449
  ]
448
- ), Ve = !!co(y), te = !!y && !Ve, yr = r((e) => {
449
- en(e);
450
+ ), Ve = !!so(y), ge = !!y && !Ve, mr = r((e) => {
451
+ jt(e);
450
452
  }, []), ve = r(
451
453
  (e) => {
452
- e && en(e.shouldContinuePlayback);
454
+ e && jt(e.shouldContinuePlayback);
453
455
  },
454
456
  []
455
457
  );
456
- a(() => {
457
- tn(St);
458
- }, [s, St, ie]), a(() => {
459
- ie && st(!1);
460
- }, [
461
- s,
462
- ie,
463
- st
464
- ]), a(() => {
465
- Ot || At(!1);
466
- }, [Ot]), a(() => () => {
467
- he(), Y(), V(), k(), F();
458
+ s(() => {
459
+ Qt(gt);
460
+ }, [a, gt, ie]), s(() => {
461
+ ie && It(!1);
462
+ }, [a, ie]), s(() => () => {
463
+ ye(), H(), V(), F(), L();
468
464
  }, [
469
- he,
470
- Y,
471
- k,
465
+ ye,
466
+ H,
472
467
  F,
468
+ L,
473
469
  V
474
- ]), a(() => {
470
+ ]), s(() => {
475
471
  if (!Ne) {
476
- Y();
472
+ H();
477
473
  return;
478
474
  }
479
475
  let e = !1, t = null, n = null;
480
476
  const i = () => {
481
477
  n?.(), n = null;
482
478
  }, l = () => {
483
- e || (i(), Y(), pr(kt));
479
+ e || (i(), H(), fr(_t));
484
480
  }, o = () => {
485
481
  if (e)
486
482
  return;
@@ -490,61 +486,61 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
490
486
  );
491
487
  if (!v)
492
488
  return;
493
- const b = Array.from(
489
+ const I = Array.from(
494
490
  v.querySelectorAll("iframe")
495
491
  );
496
- if (b.length === 0 || go(b)) {
492
+ if (I.length === 0 || ho(I)) {
497
493
  l();
498
494
  return;
499
495
  }
500
- const ne = [], Ke = () => {
496
+ const te = [], Ke = () => {
501
497
  e || (t !== null && window.cancelAnimationFrame(t), t = window.requestAnimationFrame(() => {
502
498
  t = null, o();
503
499
  }));
504
- }, Nt = (re, Se, oe) => {
505
- re.addEventListener(Se, oe, { once: !0 }), ne.push(
506
- () => re.removeEventListener(Se, oe)
500
+ }, Ft = (ne, Se, re) => {
501
+ ne.addEventListener(Se, re, { once: !0 }), te.push(
502
+ () => ne.removeEventListener(Se, re)
507
503
  );
508
504
  };
509
- b.forEach((re) => {
510
- const Se = re.contentDocument;
505
+ I.forEach((ne) => {
506
+ const Se = ne.contentDocument;
511
507
  if (!Se || Se.readyState !== "complete") {
512
- Nt(re, "load", Ke);
508
+ Ft(ne, "load", Ke);
513
509
  return;
514
510
  }
515
- Array.from(Se.images).filter((oe) => !oe.complete).forEach((oe) => {
516
- Nt(oe, "load", Ke), Nt(oe, "error", Ke);
511
+ Array.from(Se.images).filter((re) => !re.complete).forEach((re) => {
512
+ Ft(re, "load", Ke), Ft(re, "error", Ke);
517
513
  });
518
514
  }), n = () => {
519
- ne.forEach((re) => re());
515
+ te.forEach((ne) => ne());
520
516
  };
521
517
  };
522
518
  return t = window.requestAnimationFrame(() => {
523
519
  t = null, o();
524
520
  }), je.current = window.setTimeout(() => {
525
521
  l();
526
- }, ho), () => {
527
- e = !0, i(), Y(), t !== null && window.cancelAnimationFrame(t);
522
+ }, yo), () => {
523
+ e = !0, i(), H(), t !== null && window.cancelAnimationFrame(t);
528
524
  };
529
525
  }, [
530
- Y,
531
- R,
532
- s,
533
- kt,
526
+ H,
527
+ P,
528
+ a,
529
+ _t,
534
530
  Ne
535
- ]), a(() => (xe?.(C), () => {
536
- xe?.(!1);
537
- }), [xe, C]), a(() => {
538
- C || (We.current = !1);
539
- }, [C]), a(() => {
540
- B || lt === mt || (Pt(!1), Tt(mt));
541
- }, [B, lt]), a(() => {
542
- if (!B) {
543
- sn(!1);
531
+ ]), s(() => (we?.(B), () => {
532
+ we?.(!1);
533
+ }), [we, B]), s(() => {
534
+ B || (We.current = !1);
535
+ }, [B]), s(() => {
536
+ N || lt === dt || (Tt(!1), Et(dt));
537
+ }, [N, lt]), s(() => {
538
+ if (!N) {
539
+ on(!1);
544
540
  return;
545
541
  }
546
542
  const e = () => {
547
- sn(Pn()), Z();
543
+ on(Tn()), Z();
548
544
  }, t = () => {
549
545
  Z();
550
546
  };
@@ -552,7 +548,7 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
552
548
  "change",
553
549
  t
554
550
  );
555
- const n = $r(
551
+ const n = Gr(
556
552
  e
557
553
  );
558
554
  return () => {
@@ -561,270 +557,268 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
561
557
  t
562
558
  );
563
559
  };
564
- }, [B, Z]), a(() => {
560
+ }, [N, Z]), s(() => {
565
561
  ze?.(Q);
566
- }, [Q, ze]), a(() => {
567
- un.current !== Q && Z(), un.current = Q;
568
- }, [Q, Z]), a(() => {
569
- Ht?.(Me, s);
570
- }, [s, Me, Ht]), a(() => {
571
- const e = Wt.current, t = oo(
562
+ }, [Q, ze]), s(() => {
563
+ an.current !== Q && Z(), an.current = Q;
564
+ }, [Q, Z]), s(() => {
565
+ qt?.(Oe, a);
566
+ }, [a, Oe, qt]), s(() => {
567
+ const e = zt.current, t = ro(
572
568
  {
573
569
  previousMarkerCount: e.markerCount,
574
- nextMarkerCount: P.length,
570
+ nextMarkerCount: C.length,
575
571
  previousIndex: e.currentIndex,
576
572
  previousCanGoNext: e.canGoNext,
577
- nextCanGoNext: _,
573
+ nextCanGoNext: R,
578
574
  currentAudioKey: x,
579
- hasCompletedCurrentStepAudio: M,
575
+ hasCompletedCurrentStepAudio: O,
580
576
  hasResolvedCurrentInteraction: Ve,
581
- currentStepHasSpeakableElement: A,
577
+ currentStepHasSpeakableElement: b,
582
578
  currentInteractionElement: y,
583
- isAutoAdvanceEnabled: Fe,
579
+ isAutoAdvanceEnabled: ke,
584
580
  shouldUseSilentStepAutoAdvanceToggle: De
585
581
  }
586
582
  );
587
- Wt.current = {
588
- markerCount: P.length,
589
- currentIndex: s,
590
- canGoNext: _
591
- }, t && D();
583
+ zt.current = {
584
+ markerCount: C.length,
585
+ currentIndex: a,
586
+ canGoNext: R
587
+ }, t && k();
592
588
  }, [
593
- _,
589
+ R,
594
590
  x,
595
- s,
591
+ a,
596
592
  y,
597
- A,
598
- D,
599
- M,
593
+ b,
594
+ k,
595
+ O,
600
596
  Ve,
601
- Fe,
597
+ ke,
602
598
  De,
603
- P.length
604
- ]), a(() => {
605
- if (!h || K === "hidden") {
606
- V(), ke(!1);
599
+ C.length
600
+ ]), s(() => {
601
+ if (!A || J === "hidden") {
602
+ V(), Me(!1);
607
603
  return;
608
604
  }
609
- if (K === "visible") {
610
- V(), ke(!0);
605
+ if (J === "visible") {
606
+ V(), Me(!0);
611
607
  return;
612
608
  }
613
609
  et || g(!0);
614
610
  }, [
615
611
  V,
616
612
  et,
617
- K,
618
- h,
613
+ J,
614
+ A,
619
615
  g
620
- ]), a(() => {
616
+ ]), s(() => {
621
617
  if (typeof window > "u")
622
618
  return;
623
619
  const e = (t) => {
624
- t.origin === window.location.origin && Vr(t.data) && t.data.eventType === "click" && h && (U(), de(!0), g(!0));
620
+ t.origin === window.location.origin && Br(t.data) && t.data.eventType === "click" && A && (K(), de(!0), g(!0));
625
621
  };
626
622
  return window.addEventListener("message", e), () => {
627
623
  window.removeEventListener("message", e);
628
624
  };
629
- }, [U, h, g]), jr({
625
+ }, [K, A, g]), Wr({
630
626
  sectionRef: ae,
631
- enabled: h,
627
+ enabled: A,
632
628
  keyboardShortcutsEnabled: le,
633
- onKeyboardShortcut: U,
629
+ onKeyboardShortcut: K,
634
630
  onWake: () => {
635
- U(), de(!0), g(!0);
631
+ K(), de(!0), g(!0);
636
632
  }
637
- }), a(() => {
638
- if (!h) {
639
- N();
633
+ }), s(() => {
634
+ if (!A) {
635
+ D();
640
636
  return;
641
637
  }
642
- const { hasPlaybackContextChanged: e, shouldInitializeAudioSequence: t } = ao({
643
- previousResetKey: Jt.current,
638
+ const { hasPlaybackContextChanged: e, shouldInitializeAudioSequence: t } = lo({
639
+ previousResetKey: $t.current,
644
640
  nextResetKey: Le,
645
641
  currentAudioKey: x,
646
- hasCompletedCurrentStepAudio: M
642
+ hasCompletedCurrentStepAudio: O
647
643
  });
648
- Jt.current = Le;
649
- const n = j.current === s && !!y, i = no({
644
+ $t.current = Le;
645
+ const n = j.current === a && !!y, i = to({
650
646
  hasInteraction: !!y,
651
- shouldBlockPlaybackForInteraction: te,
647
+ shouldBlockPlaybackForInteraction: ge,
652
648
  shouldOpenInteractionOverlayAfterAudio: n,
653
649
  hasPlaybackContextChanged: e,
654
650
  hasResolvedCurrentInteraction: Ve,
655
- currentStepHasSpeakableElement: A,
656
- isPlayerCustomActionActive: Mt
657
- }), l = Oe.current, o = l?.slideIndex === s;
658
- if (e && N({
651
+ currentStepHasSpeakableElement: b
652
+ }), l = _e.current, o = l?.slideIndex === a;
653
+ if (e && D({
659
654
  preservePendingSubtitleJump: o
660
- }), !(R.length === 0 && !y) && !ee) {
661
- if (l?.slideIndex === s && _n({
662
- currentIndex: s,
663
- resolvedCurrentInteractionElement: I,
664
- slideElementList: P,
655
+ }), !(P.length === 0 && !y) && !ee) {
656
+ if (l?.slideIndex === a && Pn({
657
+ currentIndex: a,
658
+ resolvedCurrentInteractionElement: h,
659
+ slideElementList: C,
665
660
  targetSlideIndex: l.slideIndex
666
661
  })) {
667
- Oe.current = null, vt.current = !0, H(l.audioKey), dt({
662
+ _e.current = null, ht.current = !0, U(l.audioKey), ct({
668
663
  audioIndex: l.audioIndex,
669
664
  timeMs: l.timeMs
670
665
  });
671
666
  return;
672
667
  }
673
- if (y && wt(y), i) {
674
- bn(y);
668
+ if (y && bt(y), i) {
669
+ Sn(y);
675
670
  return;
676
671
  }
677
- if (F(), j.current = null, !te && t && !ge()) {
678
- if (A) {
679
- if (L) {
672
+ if (L(), j.current = null, !!t && !he()) {
673
+ if (b) {
674
+ if (M) {
680
675
  w(!1);
681
676
  return;
682
677
  }
683
678
  w(!0);
684
679
  return;
685
680
  }
686
- if (_ && !(De && !Fe) && !(Ne && !In))
687
- return Ce.current = window.setTimeout(() => {
688
- Ce.current = null, D();
689
- }, Sn), () => {
690
- he();
681
+ if (R && !(De && !ke) && !(Ne && !vn))
682
+ return Ee.current = window.setTimeout(() => {
683
+ Ee.current = null, k();
684
+ }, gn), () => {
685
+ ye();
691
686
  };
692
687
  }
693
688
  }
694
689
  }, [
695
- I,
696
- _,
697
- he,
698
- R.length,
699
- s,
690
+ h,
691
+ R,
692
+ ye,
693
+ P.length,
694
+ a,
700
695
  y,
701
696
  x,
702
697
  Le,
703
- A,
698
+ b,
704
699
  Ne,
705
- In,
706
- Sn,
707
- D,
700
+ vn,
701
+ gn,
702
+ k,
703
+ O,
708
704
  M,
709
- L,
710
- Fe,
705
+ ke,
711
706
  Ve,
712
- Mt,
713
- te,
714
- F,
715
- N,
716
- dt,
717
- bn,
718
- h,
719
- P,
720
707
  ge,
708
+ L,
709
+ D,
710
+ ct,
711
+ Sn,
712
+ A,
713
+ C,
714
+ he,
721
715
  ee,
722
716
  De
723
- ]), a(() => {
724
- if (L || ee || !A || te) {
717
+ ]), s(() => {
718
+ if (M || ee || !b || ge) {
725
719
  w(!1);
726
720
  return;
727
721
  }
728
- if (M) {
722
+ if (O) {
729
723
  w(!1);
730
724
  return;
731
725
  }
732
- if (yn) {
726
+ if (mn) {
733
727
  w(!1);
734
728
  return;
735
729
  }
736
- It("waitingForAudio"), w(!0);
730
+ vt("waitingForAudio"), w(!0);
737
731
  }, [
738
- yn,
739
- A,
732
+ mn,
733
+ b,
734
+ O,
740
735
  M,
741
- L,
742
736
  ee,
743
- te
744
- ]), a(() => {
745
- M && lo(
746
- O,
737
+ ge
738
+ ]), s(() => {
739
+ O && io(
740
+ _,
747
741
  nt.current
748
742
  ) && tt(!1);
749
- }, [O, M]), a(() => {
750
- const e = vt.current;
751
- vt.current = !1, so({
743
+ }, [_, O]), s(() => {
744
+ const e = ht.current;
745
+ ht.current = !1, ao({
752
746
  currentAudioKey: x,
753
- currentAudioSequenceLength: O.length,
754
- currentStepHasSpeakableElement: A,
755
- hasCompletedCurrentStepAudio: M,
756
- shouldBlockPlaybackForInteraction: te,
747
+ currentAudioSequenceLength: _.length,
748
+ currentStepHasSpeakableElement: b,
749
+ hasCompletedCurrentStepAudio: O,
750
+ shouldBlockPlaybackForInteraction: ge,
757
751
  shouldPausePlaybackForCustomAction: ee,
758
752
  shouldSkipDefaultAudioStart: e
759
- }) && ge();
753
+ }) && he();
760
754
  }, [
761
755
  x,
756
+ _,
757
+ b,
762
758
  O,
763
- A,
764
- M,
765
759
  ee,
766
- te,
767
- ge
768
- ]), a(() => {
769
- !x || T >= 0 || H(null);
770
- }, [T, x]), a(() => {
771
- T >= 0 || pe.reset();
772
- }, [T, pe]), a(() => {
760
+ ge,
761
+ he
762
+ ]), s(() => {
763
+ !x || T >= 0 || U(null);
764
+ }, [T, x]), s(() => {
765
+ T >= 0 || me.reset();
766
+ }, [T, me]), s(() => {
773
767
  rt(!1);
774
- }, [fr]);
768
+ }, [ur]);
775
769
  const {
776
- interactionDefaults: An,
777
- interactionDefaultSelectedValues: hr,
778
- hasResolvedInteractionInput: wn,
779
- isInteractionReadonly: gr,
780
- shouldAutoContinueInteraction: xn
770
+ interactionDefaults: In,
771
+ interactionDefaultSelectedValues: pr,
772
+ hasResolvedInteractionInput: bn,
773
+ isInteractionReadonly: yr,
774
+ shouldAutoContinueInteraction: An
781
775
  } = f(
782
- () => po(I, {
776
+ () => mo(h, {
783
777
  interactionDefaultValueOptions: Ge
784
778
  }),
785
- [I, Ge]
786
- ), vr = !!I?.readonly || gr, qe = to({
787
- hasActiveInteraction: !!I,
779
+ [h, Ge]
780
+ ), hr = !!h?.readonly || yr, qe = eo({
781
+ hasActiveInteraction: !!h,
788
782
  isInteractionOverlayOpen: fe
789
- }), Sr = r(
783
+ }), gr = r(
790
784
  (e) => {
791
785
  const n = [
792
786
  ...e.selectedValues ?? [],
793
787
  e.inputText?.trim() ?? "",
794
788
  e.buttonText?.trim() ?? ""
795
789
  ].filter(Boolean).join(", ");
796
- wt((i) => !i || !n ? i : {
790
+ bt((i) => !i || !n ? i : {
797
791
  ...i,
798
792
  user_input: n
799
- }), $e?.(e, I), Be();
793
+ }), $e?.(e, h), Be();
800
794
  },
801
- [I, Be, $e]
795
+ [h, Be, $e]
802
796
  );
803
- a(() => {
797
+ s(() => {
804
798
  const e = () => {
805
- er(document.fullscreenElement === ae.current);
799
+ Qn(document.fullscreenElement === ae.current);
806
800
  };
807
801
  return e(), document.addEventListener("fullscreenchange", e), () => {
808
802
  document.removeEventListener("fullscreenchange", e);
809
803
  };
810
- }, []), a(() => {
811
- I && fe || it(!1);
812
- }, [I, fe]), a(() => {
804
+ }, []), s(() => {
805
+ h && fe || it(!1);
806
+ }, [h, fe]), s(() => {
813
807
  Z();
814
- }, [I, Z]), a(() => {
808
+ }, [h, Z]), s(() => {
815
809
  if (!qe) {
816
- me(0);
810
+ Fe(0);
817
811
  return;
818
812
  }
819
- const e = Pe.current;
813
+ const e = Ce.current;
820
814
  if (!e)
821
815
  return;
822
816
  const t = () => {
823
817
  const i = Math.ceil(
824
818
  e.getBoundingClientRect().height
825
819
  );
826
- me(
827
- i + Co
820
+ Fe(
821
+ i + To
828
822
  );
829
823
  };
830
824
  if (t(), typeof ResizeObserver > "u")
@@ -835,84 +829,84 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
835
829
  return n.observe(e), () => {
836
830
  n.disconnect();
837
831
  };
838
- }, [qe]), a(() => {
839
- if (k(), !!fe) {
840
- if (xn)
832
+ }, [qe]), s(() => {
833
+ if (F(), !!fe) {
834
+ if (An)
841
835
  return W.current = window.setTimeout(() => {
842
836
  W.current = null, Be();
843
- }, On), () => {
844
- k();
837
+ }, Rn), () => {
838
+ F();
845
839
  };
846
- if (!(on || !wn))
840
+ if (!(tn || !bn))
847
841
  return W.current = window.setTimeout(() => {
848
842
  W.current = null, Be();
849
- }, On), () => {
850
- k();
843
+ }, Rn), () => {
844
+ F();
851
845
  };
852
846
  }
853
847
  }, [
854
- k,
848
+ F,
855
849
  Be,
856
- on,
857
- wn,
850
+ tn,
851
+ bn,
858
852
  fe,
859
- xn
853
+ An
860
854
  ]);
861
- const Ir = (e, t = {}) => e ? e.type === "slot" ? /* @__PURE__ */ u(Lr, { children: e.content }) : e.type === "html" ? /* @__PURE__ */ u(
862
- Tn,
855
+ const vr = (e, t = {}) => e ? e.type === "slot" ? /* @__PURE__ */ u(Fr, { children: e.content }) : e.type === "html" ? /* @__PURE__ */ u(
856
+ En,
863
857
  {
864
858
  className: "content-render-iframe",
865
- disableLoadingOverlay: L,
859
+ disableLoadingOverlay: M,
866
860
  hideFullScreen: !0,
867
861
  locale: d,
868
- dir: J,
869
- lang: Ee,
862
+ dir: X,
863
+ lang: xe,
870
864
  mode: "blackboard",
871
865
  replaceRootScreenHeightWithFull: t.replaceRootScreenHeightWithFull,
872
866
  type: "sandbox",
873
867
  content: e.content,
874
- enableScaling: Ln
868
+ enableScaling: kn
875
869
  }
876
870
  ) : /* @__PURE__ */ u(
877
- Tn,
871
+ En,
878
872
  {
879
873
  className: "content-render-iframe",
880
- disableLoadingOverlay: L,
874
+ disableLoadingOverlay: M,
881
875
  hideFullScreen: !0,
882
876
  locale: d,
883
- dir: J,
884
- lang: Ee,
877
+ dir: X,
878
+ lang: xe,
885
879
  mode: "blackboard",
886
880
  type: "markdown",
887
881
  content: e.content
888
882
  }
889
- ) : null, br = (e = [], t = !1) => {
883
+ ) : null, Sr = (e = [], t = !1) => {
890
884
  if (e.length === 0)
891
885
  return null;
892
886
  const n = e.filter(
893
887
  (o) => o.is_renderable !== !1
894
- ).length, i = t && Dn ? ro(e) : "disabled", l = e.reduce(
895
- (o, v, b) => v.is_renderable !== !1 ? b : o,
888
+ ).length, i = t && Fn ? no(e) : "disabled", l = e.reduce(
889
+ (o, v, I) => v.is_renderable !== !1 ? I : o,
896
890
  -1
897
891
  );
898
892
  return /* @__PURE__ */ u(
899
- Xr,
893
+ zr,
900
894
  {
901
895
  className: "slide-stage__content flex w-full flex-col gap-4",
902
896
  mode: i,
903
897
  children: e.map((o, v) => {
904
- const b = o.type === "html" && o.is_renderable === !1;
898
+ const I = o.type === "html" && o.is_renderable === !1;
905
899
  return /* @__PURE__ */ u(
906
900
  "div",
907
901
  {
908
- ref: t && v === l ? $t : null,
909
- "aria-hidden": b || void 0,
902
+ ref: t && v === l ? Ht : null,
903
+ "aria-hidden": I || void 0,
910
904
  className: Ie(
911
905
  "w-full shrink-0",
912
906
  n === 1 && o.is_renderable !== !1 && "slide-element--single",
913
- b ? "pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0" : o.is_renderable === !1 && "hidden"
907
+ I ? "pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0" : o.is_renderable === !1 && "hidden"
914
908
  ),
915
- children: Ir(o, {
909
+ children: vr(o, {
916
910
  replaceRootScreenHeightWithFull: n === 1 && o.type === "html" && o.is_renderable !== !1
917
911
  })
918
912
  },
@@ -921,7 +915,7 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
921
915
  })
922
916
  }
923
917
  );
924
- }, Ar = r(() => {
918
+ }, Ir = r(() => {
925
919
  const e = ae.current;
926
920
  if (e) {
927
921
  if (document.fullscreenElement === e) {
@@ -932,136 +926,138 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
932
926
  e.requestFullscreen?.().catch(() => {
933
927
  });
934
928
  }
935
- }, []), En = r(() => {
929
+ }, []), wn = r(() => {
936
930
  const e = Je.current;
937
931
  e && e.scrollTo({
938
932
  top: e.scrollHeight,
939
933
  behavior: "smooth"
940
934
  });
941
- }, []), Lt = r(
942
- (e) => _n({
943
- currentIndex: s,
944
- resolvedCurrentInteractionElement: I,
945
- slideElementList: P,
935
+ }, []), Mt = r(
936
+ (e) => Pn({
937
+ currentIndex: a,
938
+ resolvedCurrentInteractionElement: h,
939
+ slideElementList: C,
946
940
  targetSlideIndex: Qe[e.audioIndex]
947
941
  }),
948
942
  [
949
- I,
943
+ h,
950
944
  Qe,
951
- s,
952
- P
945
+ a,
946
+ C
953
947
  ]
954
- ), wr = r(
948
+ ), br = r(
955
949
  (e, t) => {
956
950
  const i = S[e.audioIndex]?.audioKey, l = Qe[e.audioIndex];
957
- return !i || l == null || !Lt(e) ? !1 : (ve(t), j.current = null, w(!1), tt(!1), rt(!1), Bt(t) && (de(!0), g(!0)), l === s ? (Oe.current = null, N(), H(i), dt(e), !0) : (_e.current = !0, N(), Oe.current = {
951
+ return !i || l == null || !Mt(e) ? !1 : (ve(t), j.current = null, w(!1), tt(!1), rt(!1), Lt(t) && (de(!0), g(!0)), l === a ? (_e.current = null, D(), U(i), ct(e), !0) : (Re.current = !0, D(), _e.current = {
958
952
  audioIndex: e.audioIndex,
959
953
  audioKey: i,
960
954
  slideIndex: l,
961
955
  timeMs: e.timeMs
962
- }, Zt(l), !0));
956
+ }, Wt(l), !0));
963
957
  },
964
958
  [
965
959
  S,
966
960
  Qe,
967
- Lt,
968
- s,
969
- Zt,
970
- dt,
971
- N,
961
+ Mt,
962
+ a,
963
+ Wt,
964
+ ct,
965
+ D,
972
966
  g,
973
967
  ve
974
968
  ]
975
- ), xr = r(
969
+ ), Ar = r(
976
970
  (e) => {
977
- ve(e), _e.current = !0, j.current = null, w(!1), Bt(e) && (de(!0), g(!0)), N(), Qt();
971
+ ve(e), Re.current = !0, j.current = null, w(!1), Lt(e) && (de(!0), g(!0)), D(), Jt();
978
972
  },
979
973
  [
980
- Qt,
981
- N,
974
+ Jt,
975
+ D,
982
976
  g,
983
977
  ve
984
978
  ]
985
- ), Er = r(
979
+ ), wr = r(
986
980
  (e) => {
987
- ve(e), _e.current = !0, j.current = null, w(!1), Bt(e) && (de(!0), g(!0)), N(), D();
981
+ ve(e), Re.current = !0, j.current = null, w(!1), Lt(e) && (de(!0), g(!0)), D(), k();
988
982
  },
989
983
  [
984
+ k,
990
985
  D,
991
- N,
992
986
  g,
993
987
  ve
994
988
  ]
995
- ), Cr = r(
989
+ ), xr = r(
996
990
  ({
997
991
  loading: e,
998
992
  reason: t
999
993
  }) => {
1000
- if (L) {
994
+ if (M) {
1001
995
  w(!1);
1002
996
  return;
1003
997
  }
1004
- if (!A || M) {
998
+ if (!b || O) {
1005
999
  w(!1);
1006
1000
  return;
1007
1001
  }
1008
- e && t && It(t), w(Mo(t, e));
1002
+ e && t && vt(t), w(Mo(t, e));
1009
1003
  },
1010
1004
  [
1011
- A,
1012
- M,
1013
- L
1005
+ b,
1006
+ O,
1007
+ M
1014
1008
  ]
1015
1009
  );
1016
- a(() => {
1017
- L && w(!1);
1018
- }, [L]);
1019
- const Tr = r(
1010
+ s(() => {
1011
+ M && w(!1);
1012
+ }, [M]);
1013
+ const Er = r(
1020
1014
  (e) => {
1021
1015
  const t = S[e]?.audioKey;
1022
1016
  if (!t || !x || t !== x)
1023
1017
  return;
1024
1018
  nt.current.add(t);
1025
- const n = O.findIndex(
1019
+ const n = _.findIndex(
1026
1020
  (o) => o === t
1027
1021
  );
1028
1022
  if (n < 0) {
1029
- H(null);
1023
+ U(null);
1030
1024
  return;
1031
1025
  }
1032
- const i = n + 1, l = O[i];
1026
+ const i = n + 1, l = _[i];
1033
1027
  if (l) {
1034
- H(l);
1028
+ U(l);
1035
1029
  return;
1036
1030
  }
1037
- if (H(null), tt(!0), w(!1), _) {
1038
- const o = s + 1, v = P[o];
1039
- gn && v?.type === "interaction" && (j.current = o), D();
1031
+ if (U(null), tt(!0), w(!1), R) {
1032
+ const o = a + 1, v = C[o];
1033
+ yn && v?.type === "interaction" && (j.current = o), k();
1040
1034
  return;
1041
1035
  }
1042
1036
  },
1043
1037
  [
1044
1038
  S,
1045
- _,
1046
- s,
1039
+ R,
1040
+ a,
1047
1041
  x,
1048
- O,
1049
- D,
1050
- gn,
1051
- P
1042
+ _,
1043
+ k,
1044
+ yn,
1045
+ C
1052
1046
  ]
1053
- ), Pr = r(() => {
1054
- We.current = !0, V(), h && ke(!0);
1055
- }, [V, h]), Rr = r(() => {
1047
+ ), Tr = r(() => {
1048
+ h && ot((e) => !e);
1049
+ }, [h]), Cr = r(() => {
1050
+ We.current = !0, V(), A && Me(!0);
1051
+ }, [V, A]), Pr = r(() => {
1056
1052
  We.current = !1, g(!0);
1057
- }, [g]), Dt = r(
1053
+ }, [g]), kt = r(
1058
1054
  (e) => {
1059
- e.stopPropagation(), C && g(!0);
1055
+ e.stopPropagation(), B && g(!0);
1060
1056
  },
1061
- [C, g]
1062
- ), ft = r(
1057
+ [B, g]
1058
+ ), ut = r(
1063
1059
  (e, t) => {
1064
- const n = gt.current;
1060
+ const n = yt.current;
1065
1061
  if (!n)
1066
1062
  return null;
1067
1063
  const i = e.getBoundingClientRect(), l = n.getBoundingClientRect();
@@ -1074,14 +1070,14 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
1074
1070
  },
1075
1071
  []
1076
1072
  );
1077
- To(() => {
1078
- const e = Pe.current;
1073
+ Co(() => {
1074
+ const e = Ce.current;
1079
1075
  if (!qe || !e) {
1080
1076
  ce.current = null;
1081
1077
  return;
1082
1078
  }
1083
1079
  const t = ce.current, n = e.getBoundingClientRect();
1084
- if (!t || Et) {
1080
+ if (!t || wt) {
1085
1081
  ce.current = {
1086
1082
  left: n.left,
1087
1083
  top: n.top
@@ -1089,7 +1085,7 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
1089
1085
  return;
1090
1086
  }
1091
1087
  const i = t.left - n.left, l = t.top - n.top;
1092
- if (!Mn(i) && !Mn(l)) {
1088
+ if (!_n(i) && !_n(l)) {
1093
1089
  ce.current = {
1094
1090
  left: n.left,
1095
1091
  top: n.top
@@ -1099,55 +1095,54 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
1099
1095
  const o = {
1100
1096
  x: E.x + i,
1101
1097
  y: E.y + l
1102
- }, v = ft(
1098
+ }, v = ut(
1103
1099
  e,
1104
1100
  E
1105
- ), b = Ro(
1106
- v ? Rn(o, v) : o
1101
+ ), I = Ro(
1102
+ v ? Cn(o, v) : o
1107
1103
  );
1108
1104
  ce.current = {
1109
- left: n.left + b.x - E.x,
1110
- top: n.top + b.y - E.y
1111
- }, kn(
1112
- b,
1105
+ left: n.left + I.x - E.x,
1106
+ top: n.top + I.y - E.y
1107
+ }, On(
1108
+ I,
1113
1109
  E
1114
- ) || xt(
1115
- (ne) => kn(ne, b) ? ne : b
1110
+ ) || At(
1111
+ (te) => On(te, I) ? te : I
1116
1112
  );
1117
1113
  }, [
1118
- ft,
1114
+ ut,
1119
1115
  E,
1120
- Et,
1121
- C,
1122
- h,
1116
+ wt,
1117
+ at,
1123
1118
  qe
1124
1119
  ]);
1125
- const _r = r(
1120
+ const Rr = r(
1126
1121
  (e) => {
1127
- if (Dt(e), e.button !== 0 || !e.currentTarget.isConnected || !Pe.current)
1122
+ if (kt(e), e.button !== 0 || !e.currentTarget.isConnected || !Ce.current)
1128
1123
  return;
1129
- const t = ft(
1130
- Pe.current,
1124
+ const t = ut(
1125
+ Ce.current,
1131
1126
  E
1132
1127
  );
1133
- t && (e.preventDefault(), e.currentTarget.hasPointerCapture?.(e.pointerId) !== !0 && e.currentTarget.setPointerCapture(e.pointerId), Re.current = {
1128
+ t && (e.preventDefault(), e.currentTarget.hasPointerCapture?.(e.pointerId) !== !0 && e.currentTarget.setPointerCapture(e.pointerId), Pe.current = {
1134
1129
  pointerId: e.pointerId,
1135
1130
  startClientX: e.clientX,
1136
1131
  startClientY: e.clientY,
1137
1132
  startOffset: E,
1138
1133
  bounds: t
1139
- }, Ct(!0));
1134
+ }, xt(!0));
1140
1135
  },
1141
1136
  [
1142
- ft,
1137
+ ut,
1143
1138
  E,
1144
- Dt
1139
+ kt
1145
1140
  ]
1146
- ), Or = r(
1141
+ ), _r = r(
1147
1142
  (e) => {
1148
- const t = Re.current;
1149
- !t || t.pointerId !== e.pointerId || (e.preventDefault(), e.stopPropagation(), xt(
1150
- Rn(
1143
+ const t = Pe.current;
1144
+ !t || t.pointerId !== e.pointerId || (e.preventDefault(), e.stopPropagation(), At(
1145
+ Cn(
1151
1146
  {
1152
1147
  x: t.startOffset.x + e.clientX - t.startClientX,
1153
1148
  y: t.startOffset.y + e.clientY - t.startClientY
@@ -1157,36 +1152,36 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
1157
1152
  ));
1158
1153
  },
1159
1154
  []
1160
- ), Cn = r(
1155
+ ), xn = r(
1161
1156
  (e) => {
1162
- const t = Re.current;
1163
- !t || t.pointerId !== e.pointerId || (e.stopPropagation(), e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), Re.current = null, Ct(!1));
1157
+ const t = Pe.current;
1158
+ !t || t.pointerId !== e.pointerId || (e.stopPropagation(), e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), Pe.current = null, xt(!1));
1164
1159
  },
1165
1160
  []
1166
- ), Mr = r(
1161
+ ), Or = r(
1167
1162
  (e) => {
1168
- U(), Yt?.(e);
1163
+ K(), Kt?.(e);
1169
1164
  },
1170
- [U, Yt]
1171
- ), kr = r(
1165
+ [K, Kt]
1166
+ ), Mr = r(
1172
1167
  (e) => {
1173
- U(), Gt?.(e);
1168
+ K(), Ut?.(e);
1174
1169
  },
1175
- [U, Gt]
1176
- ), Fr = r(() => {
1170
+ [K, Ut]
1171
+ ), kr = r(() => {
1177
1172
  de(!0), g(!0);
1178
1173
  }, [g]);
1179
- return a(() => {
1180
- const e = zt.current, i = (e.length > 0 && e.length < ue.length && e.every((o, v) => o === ue[v]) ? R.slice(e.length) : []).some(
1174
+ return s(() => {
1175
+ const e = Yt.current, i = (e.length > 0 && e.length < ue.length && e.every((o, v) => o === ue[v]) ? P.slice(e.length) : []).some(
1181
1176
  (o) => o.is_new === !1
1182
1177
  );
1183
- if (zt.current = ue, !i)
1178
+ if (Yt.current = ue, !i)
1184
1179
  return;
1185
1180
  const l = window.requestAnimationFrame(() => {
1186
- const o = Je.current, v = $t.current;
1181
+ const o = Je.current, v = Ht.current;
1187
1182
  if (!o || !v)
1188
1183
  return;
1189
- const b = o.getBoundingClientRect(), ne = v.getBoundingClientRect(), Ke = o.scrollTop + (ne.top - b.top);
1184
+ const I = o.getBoundingClientRect(), te = v.getBoundingClientRect(), Ke = o.scrollTop + (te.top - I.top);
1190
1185
  o.scrollTo({
1191
1186
  top: Math.max(Ke, 0),
1192
1187
  behavior: "smooth"
@@ -1195,35 +1190,35 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
1195
1190
  return () => {
1196
1191
  window.cancelAnimationFrame(l);
1197
1192
  };
1198
- }, [R, ue]), a(() => {
1199
- if (!_e.current || (_e.current = !1, R.length === 0))
1193
+ }, [P, ue]), s(() => {
1194
+ if (!Re.current || (Re.current = !1, P.length === 0))
1200
1195
  return;
1201
1196
  const e = window.requestAnimationFrame(() => {
1202
- En();
1197
+ wn();
1203
1198
  });
1204
1199
  return () => {
1205
1200
  window.cancelAnimationFrame(e);
1206
1201
  };
1207
- }, [R, En]), /* @__PURE__ */ Ue(
1202
+ }, [P, wn]), /* @__PURE__ */ Ue(
1208
1203
  "section",
1209
1204
  {
1210
1205
  ref: ae,
1211
1206
  className: Ie(
1212
1207
  "relative h-full w-full",
1213
- B && "slide--mobile-device",
1214
- dn && "slide--browser-fullscreen",
1215
- ye && "slide--mobile-landscape",
1216
- cn && "slide--mobile-landscape-native",
1217
- Nn
1208
+ N && "slide--mobile-device",
1209
+ sn && "slide--browser-fullscreen",
1210
+ pe && "slide--mobile-landscape",
1211
+ ln && "slide--mobile-landscape-native",
1212
+ Ln
1218
1213
  ),
1219
- dir: J,
1220
- lang: Ee,
1221
- onClick: Fr,
1222
- onFocusCapture: kr,
1223
- onPointerDown: Mr,
1224
- ...qn,
1214
+ dir: X,
1215
+ lang: xe,
1216
+ onClick: kr,
1217
+ onFocusCapture: Mr,
1218
+ onPointerDown: Or,
1219
+ ...Bn,
1225
1220
  children: [
1226
- ir ? /* @__PURE__ */ u(
1221
+ rr ? /* @__PURE__ */ u(
1227
1222
  "div",
1228
1223
  {
1229
1224
  "aria-hidden": "true",
@@ -1233,20 +1228,20 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
1233
1228
  /* @__PURE__ */ Ue(
1234
1229
  "div",
1235
1230
  {
1236
- ref: gt,
1231
+ ref: yt,
1237
1232
  className: Ie(
1238
1233
  "slide__viewport relative h-full min-h-0 w-full",
1239
- ye && "slide__viewport--mobile-landscape",
1240
- ye && !nr && "slide__viewport--mobile-landscape-native"
1234
+ pe && "slide__viewport--mobile-landscape",
1235
+ pe && !er && "slide__viewport--mobile-landscape-native"
1241
1236
  ),
1242
1237
  children: [
1243
- rr ? /* @__PURE__ */ Ue("div", { className: "slide-landscape-header", children: [
1238
+ tr ? /* @__PURE__ */ Ue("div", { className: "slide-landscape-header", children: [
1244
1239
  /* @__PURE__ */ u(
1245
1240
  "button",
1246
1241
  {
1247
- "aria-label": z?.backAriaLabel ?? q.fullscreenBackAriaLabel,
1242
+ "aria-label": $?.backAriaLabel ?? q.fullscreenBackAriaLabel,
1248
1243
  className: "slide-landscape-header__back",
1249
- onClick: ar,
1244
+ onClick: ir,
1250
1245
  type: "button",
1251
1246
  children: /* @__PURE__ */ u(
1252
1247
  Ao,
@@ -1257,19 +1252,19 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
1257
1252
  )
1258
1253
  }
1259
1254
  ),
1260
- z?.content ? /* @__PURE__ */ u("div", { className: "min-w-0 flex-1 overflow-hidden", children: z.content }) : null
1255
+ $?.content ? /* @__PURE__ */ u("div", { className: "min-w-0 flex-1 overflow-hidden", children: $.content }) : null
1261
1256
  ] }) : null,
1262
1257
  /* @__PURE__ */ u(
1263
1258
  "div",
1264
1259
  {
1265
1260
  className: Ie(
1266
1261
  "h-full min-h-0 w-full",
1267
- or && "slide__viewport-content--with-header",
1268
- Gn ? "slide-content--single" : "grid gap-4"
1262
+ nr && "slide__viewport-content--with-header",
1263
+ Hn ? "slide-content--single" : "grid gap-4"
1269
1264
  ),
1270
- children: R.length > 0 ? /* @__PURE__ */ u("div", { className: "slide-stage", children: /* @__PURE__ */ u("div", { ref: Je, className: "slide-stage__layer w-full", children: sr.map(
1265
+ children: P.length > 0 ? /* @__PURE__ */ u("div", { className: "slide-stage", children: /* @__PURE__ */ u("div", { ref: Je, className: "slide-stage__layer w-full", children: lr.map(
1271
1266
  (e, t) => {
1272
- const n = t === cr;
1267
+ const n = t === ar;
1273
1268
  return /* @__PURE__ */ u(
1274
1269
  "div",
1275
1270
  {
@@ -1277,7 +1272,7 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
1277
1272
  "aria-hidden": !n || void 0,
1278
1273
  className: "w-full h-full",
1279
1274
  style: { display: n ? void 0 : "none" },
1280
- children: br(
1275
+ children: Sr(
1281
1276
  e.elementList,
1282
1277
  n
1283
1278
  )
@@ -1288,126 +1283,127 @@ const ko = (c, d) => c.length === d.length && c.every((G, be) => {
1288
1283
  ) }) }) : null
1289
1284
  }
1290
1285
  ),
1291
- Jn ? /* @__PURE__ */ u(
1292
- Hr,
1286
+ zn ? /* @__PURE__ */ u(
1287
+ Ur,
1293
1288
  {
1294
1289
  message: _o(
1295
- Kn,
1296
- Wn
1290
+ Vn,
1291
+ Xn
1297
1292
  ),
1298
1293
  className: "absolute left-1/2 top-1/2 z-[3] -translate-x-1/2 -translate-y-1/2"
1299
1294
  }
1300
1295
  ) : null,
1301
1296
  /* @__PURE__ */ u(
1302
- Jr,
1297
+ Xr,
1303
1298
  {
1304
- extraBottomOffset: Zn,
1305
- hasPlayerGap: C,
1306
- isEnabled: rn && jn,
1307
- isPlayerHidden: h && !C,
1308
- playbackTimeStore: pe,
1309
- subtitleCues: ur
1299
+ extraBottomOffset: jn,
1300
+ hasPlayerGap: at,
1301
+ isEnabled: en && Jn,
1302
+ playbackTimeStore: me,
1303
+ subtitleCues: sr
1310
1304
  }
1311
1305
  ),
1312
1306
  qe ? /* @__PURE__ */ u(
1313
1307
  "div",
1314
1308
  {
1315
- ref: Pe,
1309
+ ref: Ce,
1316
1310
  "data-player-keyboard-shortcuts-ignore": "true",
1317
1311
  className: Ie(
1318
1312
  "slide-interaction-overlay",
1319
- C && h ? "slide-interaction-overlay--with-player" : "slide-interaction-overlay--standalone",
1320
- Et && "slide-interaction-overlay--dragging"
1313
+ at ? "slide-interaction-overlay--with-player" : "slide-interaction-overlay--standalone",
1314
+ wt && "slide-interaction-overlay--dragging"
1321
1315
  ),
1322
- onClick: Dt,
1316
+ onClick: kt,
1323
1317
  onPointerDownCapture: (e) => {
1324
- qt(e.target) && it(!0);
1318
+ Nt(e.target) && it(!0);
1325
1319
  },
1326
1320
  onFocusCapture: (e) => {
1327
- qt(e.target) && it(!0);
1321
+ Nt(e.target) && it(!0);
1328
1322
  },
1329
1323
  onInputCapture: (e) => {
1330
- qt(e.target) && it(!0);
1324
+ Nt(e.target) && it(!0);
1331
1325
  },
1332
- style: dr,
1326
+ style: cr,
1333
1327
  children: /* @__PURE__ */ u(
1334
- Fn,
1328
+ Mn,
1335
1329
  {
1336
- dir: J,
1337
- lang: Ee,
1338
- content: String(I?.content ?? ""),
1339
- dragHandleAriaLabel: X?.dragHandleAriaLabel ?? q.interactionTexts.dragHandleAriaLabel,
1330
+ dir: X,
1331
+ lang: xe,
1332
+ content: String(h?.content ?? ""),
1333
+ dragHandleAriaLabel: z?.dragHandleAriaLabel ?? q.interactionTexts.dragHandleAriaLabel,
1340
1334
  locale: d,
1341
- defaultButtonText: An.buttonText ?? "",
1342
- defaultInputText: An.inputText ?? "",
1343
- defaultSelectedValues: hr,
1344
- confirmButtonText: X?.confirmButtonText ?? q.interactionTexts.confirmButtonText,
1345
- copyButtonText: X?.copyButtonText ?? q.interactionTexts.copyButtonText,
1346
- copiedButtonText: X?.copiedButtonText ?? q.interactionTexts.copiedButtonText,
1347
- onSend: Sr,
1348
- onDragHandlePointerCancel: Cn,
1349
- onDragHandlePointerDown: _r,
1350
- onDragHandlePointerMove: Or,
1351
- onDragHandlePointerUp: Cn,
1352
- readonly: vr,
1353
- title: X?.title ?? yt ?? q.interactionTexts.title
1335
+ defaultButtonText: In.buttonText ?? "",
1336
+ defaultInputText: In.inputText ?? "",
1337
+ defaultSelectedValues: pr,
1338
+ confirmButtonText: z?.confirmButtonText ?? q.interactionTexts.confirmButtonText,
1339
+ copyButtonText: z?.copyButtonText ?? q.interactionTexts.copyButtonText,
1340
+ copiedButtonText: z?.copiedButtonText ?? q.interactionTexts.copiedButtonText,
1341
+ onSend: gr,
1342
+ onDragHandlePointerCancel: xn,
1343
+ onDragHandlePointerDown: Rr,
1344
+ onDragHandlePointerMove: _r,
1345
+ onDragHandlePointerUp: xn,
1346
+ readonly: hr,
1347
+ title: z?.title ?? mt ?? q.interactionTexts.title
1354
1348
  }
1355
1349
  )
1356
1350
  }
1357
1351
  ) : null,
1358
- h ? /* @__PURE__ */ u(
1359
- Qr.Provider,
1352
+ A ? /* @__PURE__ */ u(
1353
+ jr.Provider,
1360
1354
  {
1361
- value: $n,
1355
+ value: Yn,
1362
1356
  children: /* @__PURE__ */ u(
1363
- zr,
1357
+ $r,
1364
1358
  {
1365
- dir: J === "auto" ? Hn : J,
1366
- lang: Ee,
1359
+ dir: X === "auto" ? Kn : X,
1360
+ lang: xe,
1367
1361
  audioList: S,
1368
1362
  className: Ie(
1369
1363
  "absolute left-1/2 z-[2] -translate-x-1/2",
1370
- dn ? "bottom-3" : "-bottom-3",
1371
- $,
1372
- !C && "pointer-events-none opacity-0"
1364
+ sn ? "bottom-3" : "-bottom-3",
1365
+ G,
1366
+ !B && "pointer-events-none opacity-0"
1373
1367
  ),
1374
1368
  currentAudioIndex: T,
1375
- defaultPlaying: St,
1369
+ defaultPlaying: gt,
1376
1370
  enableKeyboardShortcuts: le,
1377
1371
  isPlaybackPaused: ee,
1378
- isAutoAdvanceEnabled: Fe,
1372
+ isAutoAdvanceEnabled: ke,
1379
1373
  locale: d,
1374
+ hasInteraction: !!h,
1380
1375
  isInteractionOpen: fe,
1381
- isSubtitleEnabled: rn,
1382
- onAutoAdvanceToggle: tn,
1383
- onLoadingChange: Cr,
1376
+ isSubtitleEnabled: en,
1377
+ onAutoAdvanceToggle: Qt,
1378
+ onLoadingChange: xr,
1384
1379
  onPlaybackStarted: () => {
1385
1380
  rt(!0);
1386
1381
  },
1387
- onPlaybackPreferenceChange: yr,
1388
- onPlaybackTimeChange: pe.setTime,
1382
+ onPlaybackPreferenceChange: mr,
1383
+ onPlaybackTimeChange: me.setTime,
1389
1384
  onSubtitleToggle: () => {
1390
- Qn((e) => !e);
1385
+ Wn((e) => !e);
1391
1386
  },
1392
- nextDisabled: !_,
1393
- onEnded: Tr,
1394
- onFullscreen: Ar,
1395
- isFullscreen: ln,
1387
+ nextDisabled: !R,
1388
+ onEnded: Er,
1389
+ onFullscreen: Ir,
1390
+ isFullscreen: nn,
1396
1391
  mobileViewMode: Q,
1397
- settingsPortalContainer: gt.current,
1398
- onMobileViewModeChange: lr,
1399
- onControlsPointerEnter: Pr,
1400
- onControlsPointerLeave: Rr,
1401
- onNext: Er,
1402
- onPrev: xr,
1403
- onSubtitleJump: wr,
1404
- canJumpToSubtitleTarget: Lt,
1405
- prevDisabled: !Yn,
1406
- showControls: C,
1407
- subtitleSeekRequest: Xn,
1408
- texts: ht,
1409
- customActionContext: _t,
1410
- customActions: Ae,
1392
+ settingsPortalContainer: yt.current,
1393
+ onMobileViewModeChange: or,
1394
+ onControlsPointerEnter: Cr,
1395
+ onControlsPointerLeave: Pr,
1396
+ onInteractionToggle: Tr,
1397
+ onNext: wr,
1398
+ onPrev: Ar,
1399
+ onSubtitleJump: br,
1400
+ canJumpToSubtitleTarget: Mt,
1401
+ prevDisabled: !Un,
1402
+ showControls: B,
1403
+ subtitleSeekRequest: $n,
1404
+ texts: pt,
1405
+ customActionContext: Pt,
1406
+ customActions: oe,
1411
1407
  useAutoAdvanceToggle: De
1412
1408
  }
1413
1409
  )