markdown-flow-ui 0.1.100-beta.2 → 0.1.100-beta.21

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 (90) hide show
  1. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.cjs.js +1 -1
  2. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.es.js +1 -1
  3. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.cjs.js +1 -1
  4. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
  5. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.cjs.js +1 -1
  6. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.es.js +1 -1
  7. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.cjs.js +1 -1
  8. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.es.js +1 -1
  9. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-custom-variable.cjs.js +1 -1
  10. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-custom-variable.es.js +1 -1
  11. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-interaction.cjs.js +1 -1
  12. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-interaction.es.js +1 -1
  13. package/dist/_virtual/index.cjs3.js +1 -1
  14. package/dist/_virtual/index.cjs4.js +1 -1
  15. package/dist/_virtual/index.es3.js +4 -5
  16. package/dist/_virtual/index.es3.js.map +1 -1
  17. package/dist/_virtual/index.es4.js +5 -4
  18. package/dist/_virtual/index.es4.js.map +1 -1
  19. package/dist/assets/markdown-flow-ui.css +1 -1
  20. package/dist/components/ContentRender/ContentRender.cjs.js +2 -2
  21. package/dist/components/ContentRender/ContentRender.cjs.js.map +1 -1
  22. package/dist/components/ContentRender/ContentRender.d.ts +13 -10
  23. package/dist/components/ContentRender/ContentRender.es.js +175 -158
  24. package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
  25. package/dist/components/ContentRender/IframeSandbox.cjs.js +3 -3
  26. package/dist/components/ContentRender/IframeSandbox.cjs.js.map +1 -1
  27. package/dist/components/ContentRender/IframeSandbox.d.ts +1 -0
  28. package/dist/components/ContentRender/IframeSandbox.es.js +331 -202
  29. package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
  30. package/dist/components/ContentRender/SandboxApp.cjs.js +3 -3
  31. package/dist/components/ContentRender/SandboxApp.cjs.js.map +1 -1
  32. package/dist/components/ContentRender/SandboxApp.d.ts +4 -0
  33. package/dist/components/ContentRender/SandboxApp.es.js +144 -111
  34. package/dist/components/ContentRender/SandboxApp.es.js.map +1 -1
  35. package/dist/components/ContentRender/plugins/CustomVariable.cjs.js +1 -1
  36. package/dist/components/ContentRender/plugins/CustomVariable.cjs.js.map +1 -1
  37. package/dist/components/ContentRender/plugins/CustomVariable.es.js +68 -64
  38. package/dist/components/ContentRender/plugins/CustomVariable.es.js.map +1 -1
  39. package/dist/components/MarkdownFlow/MarkdownFlow.cjs.js +1 -1
  40. package/dist/components/MarkdownFlow/MarkdownFlow.cjs.js.map +1 -1
  41. package/dist/components/MarkdownFlow/MarkdownFlow.d.ts +3 -0
  42. package/dist/components/MarkdownFlow/MarkdownFlow.es.js +19 -16
  43. package/dist/components/MarkdownFlow/MarkdownFlow.es.js.map +1 -1
  44. package/dist/components/Slide/Player.cjs.js +1 -1
  45. package/dist/components/Slide/Player.cjs.js.map +1 -1
  46. package/dist/components/Slide/Player.d.ts +1 -0
  47. package/dist/components/Slide/Player.es.js +208 -168
  48. package/dist/components/Slide/Player.es.js.map +1 -1
  49. package/dist/components/Slide/Slide.cjs.js +1 -1
  50. package/dist/components/Slide/Slide.cjs.js.map +1 -1
  51. package/dist/components/Slide/Slide.d.ts +13 -0
  52. package/dist/components/Slide/Slide.es.js +374 -255
  53. package/dist/components/Slide/Slide.es.js.map +1 -1
  54. package/dist/components/Slide/Slide.stories.d.ts +21 -1
  55. package/dist/components/Slide/index.d.ts +3 -3
  56. package/dist/components/Slide/types.d.ts +6 -6
  57. package/dist/components/Slide/useSlide.cjs.js +1 -1
  58. package/dist/components/Slide/useSlide.cjs.js.map +1 -1
  59. package/dist/components/Slide/useSlide.d.ts +4 -1
  60. package/dist/components/Slide/useSlide.es.js +115 -81
  61. package/dist/components/Slide/useSlide.es.js.map +1 -1
  62. package/dist/components/Slide/useWakePlayerFromIframe.cjs.js +2 -0
  63. package/dist/components/Slide/useWakePlayerFromIframe.cjs.js.map +1 -0
  64. package/dist/components/Slide/useWakePlayerFromIframe.d.ts +7 -0
  65. package/dist/components/Slide/useWakePlayerFromIframe.es.js +89 -0
  66. package/dist/components/Slide/useWakePlayerFromIframe.es.js.map +1 -0
  67. package/dist/components/index.d.ts +4 -2
  68. package/dist/components/ui/inputGroup/textarea.cjs.js +1 -1
  69. package/dist/components/ui/inputGroup/textarea.es.js +1 -1
  70. package/dist/index.cjs.js +1 -1
  71. package/dist/index.es.js +24 -22
  72. package/dist/lib/interaction-defaults.cjs.js +2 -0
  73. package/dist/lib/interaction-defaults.cjs.js.map +1 -0
  74. package/dist/lib/interaction-defaults.es.js +106 -0
  75. package/dist/lib/interaction-defaults.es.js.map +1 -0
  76. package/dist/lib/sandboxInteraction.cjs.js +2 -0
  77. package/dist/lib/sandboxInteraction.cjs.js.map +1 -0
  78. package/dist/lib/sandboxInteraction.d.ts +8 -0
  79. package/dist/lib/sandboxInteraction.es.js +12 -0
  80. package/dist/lib/sandboxInteraction.es.js.map +1 -0
  81. package/dist/markdown-flow-ui-lib.css +1 -1
  82. package/dist/renderer.cjs.js +1 -1
  83. package/dist/renderer.d.ts +5 -3
  84. package/dist/renderer.es.js +18 -16
  85. package/package.json +17 -2
  86. package/dist/components/Slide/interaction-defaults.cjs.js +0 -2
  87. package/dist/components/Slide/interaction-defaults.cjs.js.map +0 -1
  88. package/dist/components/Slide/interaction-defaults.es.js +0 -85
  89. package/dist/components/Slide/interaction-defaults.es.js.map +0 -1
  90. /package/dist/{components/Slide → lib}/interaction-defaults.d.ts +0 -0
@@ -1,14 +1,19 @@
1
1
  import { j as r } from "../../_virtual/jsx-runtime.es.js";
2
- import { useRef as o, useState as te, useMemo as ne, useEffect as v, useCallback as a } from "react";
3
- import { cn as Z } from "../../lib/utils.es.js";
2
+ import { useRef as i, useState as fe, useMemo as de, useEffect as R, useCallback as o } from "react";
3
+ import { cn as G } from "../../lib/utils.es.js";
4
4
  /* empty css */
5
- import se from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
6
- import le from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
7
- import ce from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
8
- import ue from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
9
- import ae from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/maximize.es.js";
10
- import ie from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
11
- const oe = () => /* @__PURE__ */ r.jsxs(
5
+ import me from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
6
+ import pe from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
7
+ import he from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
8
+ import ge from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
9
+ import ye from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/maximize.es.js";
10
+ import _e from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
11
+ const J = /* @__PURE__ */ new Set(), Q = (g) => {
12
+ if (typeof document > "u" || !g || J.has(g))
13
+ return;
14
+ const v = document.createElement("link");
15
+ v.rel = "preload", v.as = "audio", v.href = g, /^https?:/i.test(g) && (v.crossOrigin = "anonymous"), document.head.appendChild(v), J.add(g);
16
+ }, Se = () => /* @__PURE__ */ r.jsxs(
12
17
  "svg",
13
18
  {
14
19
  xmlns: "http://www.w3.org/2000/svg",
@@ -27,7 +32,7 @@ const oe = () => /* @__PURE__ */ r.jsxs(
27
32
  /* @__PURE__ */ r.jsx("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
28
33
  ]
29
34
  }
30
- ), fe = () => /* @__PURE__ */ r.jsxs(
35
+ ), be = () => /* @__PURE__ */ r.jsxs(
31
36
  "svg",
32
37
  {
33
38
  xmlns: "http://www.w3.org/2000/svg",
@@ -46,240 +51,275 @@ const oe = () => /* @__PURE__ */ r.jsxs(
46
51
  /* @__PURE__ */ r.jsx("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
47
52
  ]
48
53
  }
49
- ), Se = ({
50
- audioList: $ = [],
51
- className: H,
52
- currentAudioIndex: t = -1,
53
- defaultPlaying: s = !0,
54
- onPrev: U,
55
- onNext: B,
56
- onFullscreen: K,
57
- onEnded: W,
58
- onPlayRequest: R,
59
- onInteractionToggle: z,
60
- hasInteraction: G = !1,
61
- isInteractionOpen: J = !1,
62
- prevDisabled: O = !1,
63
- nextDisabled: P = !1,
64
- showControls: Q = !0,
65
- ...X
54
+ ), Me = ({
55
+ audioList: g = [],
56
+ className: v,
57
+ currentAudioIndex: c = -1,
58
+ defaultPlaying: d = !0,
59
+ onLoadingChange: F,
60
+ onPrev: X,
61
+ onNext: Y,
62
+ onFullscreen: q,
63
+ onEnded: K,
64
+ onPlayRequest: T,
65
+ onInteractionToggle: D,
66
+ hasInteraction: I = !1,
67
+ isInteractionOpen: ee = !1,
68
+ prevDisabled: re = !1,
69
+ nextDisabled: te = !1,
70
+ showControls: ne = !0,
71
+ ...se
66
72
  }) => {
67
- const p = o(null), y = o(null), F = o(null), _ = o(0), f = o(null), A = o(void 0), C = o([]), m = o(!1), n = o(!1), i = o(null), h = o(!1), [M, l] = te(s), d = t >= 0 ? $[t] : void 0, j = d?.audioUrl, g = ne(
68
- () => [...d?.audioSegments ?? []].sort(
69
- (e, u) => e.segment_index - u.segment_index
73
+ const y = i(null), x = i(null), L = i(null), j = i(0), f = i(null), Z = i(void 0), E = i([]), B = i(!1), a = i(!1), N = i(null), h = i(!1), s = i(!1), p = i(null), _ = i(!1), [V, u] = fe(d), m = c >= 0 ? g[c] : void 0, k = m?.audioUrl, S = de(
74
+ () => [...m?.audioSegments ?? []].sort(
75
+ (e, l) => e.segment_index - l.segment_index
70
76
  ),
71
- [d?.audioSegments]
72
- ), V = `${t}:${d?.serialNumber ?? "none"}:${j ?? ""}`;
73
- v(() => {
74
- A.current = d;
75
- }, [d]), v(() => {
76
- C.current = g;
77
- }, [g]);
78
- const L = a((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), S = a(() => {
79
- const e = p.current;
80
- e && (n.current = !1, i.current = null, m.current = !1, h.current = !1, e.pause(), e.removeAttribute("src"), e.load(), y.current = null, _.current = 0, f.current = null, l(!1));
81
- }, [t]), b = a(
77
+ [m?.audioSegments]
78
+ ), P = `${c}:${m?.audioKey ?? "none"}`;
79
+ R(() => {
80
+ Z.current = m;
81
+ }, [m]), R(() => {
82
+ E.current = S;
83
+ }, [S]), R(() => {
84
+ const e = m?.audioUrl, l = c >= 0 ? g[c + 1]?.audioUrl : void 0;
85
+ Q(e), Q(l);
86
+ }, [g, m?.audioUrl, c]);
87
+ const t = o(
82
88
  (e) => {
83
- const u = p.current;
84
- if (!u)
89
+ B.current !== e && (B.current = e, F?.(e));
90
+ },
91
+ [F]
92
+ ), H = o((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), $ = o(() => {
93
+ const e = f.current;
94
+ return e == null || e <= 0 ? 0 : E.current.slice(0, e).reduce(
95
+ (l, n) => l + Math.max(Number(n.duration_ms ?? 0), 0),
96
+ 0
97
+ ) / 1e3;
98
+ }, []), M = o(() => {
99
+ const e = y.current;
100
+ e && (s.current = !1, a.current = !1, N.current = null, p.current = null, h.current = !1, _.current = !1, e.pause(), e.removeAttribute("src"), e.load(), x.current = null, j.current = 0, f.current = null, u(!1), t(!1));
101
+ }, [t]), b = o(
102
+ (e) => {
103
+ const l = y.current;
104
+ if (!l)
85
105
  return !1;
86
- const c = u.play();
87
- return c && typeof c.then == "function" && c.then(() => {
88
- n.current = !1, h.current = !1;
89
- }).catch((w) => {
90
- l(!1);
106
+ const n = l.play();
107
+ return n && typeof n.then == "function" && n.then(() => {
108
+ s.current = !1, _.current = !1;
109
+ }).catch((C) => {
110
+ u(!1);
91
111
  }), !0;
92
112
  },
93
- [t]
94
- ), x = a(
95
- (e, u) => {
96
- const c = p.current, w = C.current[e];
97
- if (!c || !w)
113
+ [c]
114
+ ), A = o(
115
+ (e, l) => {
116
+ const n = y.current, C = E.current[e];
117
+ if (!n || !C)
98
118
  return !1;
99
- const N = L(w.audio_data);
100
- _.current = e, f.current = null, m.current = !1, h.current = !0, n.current = s;
101
- const k = y.current !== N;
102
- return k && (c.pause(), c.removeAttribute("src"), c.load(), y.current = N, c.src = N, c.load()), i.current = 0, c.readyState > 0 && (c.currentTime = 0, i.current = null), s ? k ? !0 : b(`start-segment:${u}`) : (n.current = !1, h.current = !1, c.pause(), l(!1), !0);
119
+ const w = H(C.audio_data);
120
+ j.current = e, f.current = null, h.current = !1, _.current = !0;
121
+ const W = d && !a.current;
122
+ s.current = W, t(!1);
123
+ const O = x.current !== w;
124
+ return N.current = "segment", O && (n.pause(), n.removeAttribute("src"), n.load(), x.current = w, n.src = w, n.load()), p.current = 0, n.readyState > 0 && (n.currentTime = 0, p.current = null), W ? O ? !0 : b(`start-segment:${l}`) : (s.current = !1, _.current = !1, n.pause(), u(!1), !0);
125
+ },
126
+ [d, H, b, t]
127
+ ), U = o(
128
+ (e) => {
129
+ s.current = !1, h.current = !1, _.current = !1, u(!1), t(!1), c >= 0 && K?.(c);
103
130
  },
104
- [t, s, L, b]
105
- ), E = a(() => {
106
- n.current = !1, m.current = !1, h.current = !1, l(!1), t >= 0 && W?.(t);
107
- }, [t, W]), T = a(() => {
108
- const e = _.current + 1, u = C.current, c = u[e], w = A.current, N = u.some((k) => k.is_final);
109
- if (c) {
110
- x(e, "ended");
131
+ [c, K, t]
132
+ ), z = o(() => {
133
+ const e = j.current + 1, l = E.current, n = l[e], C = Z.current, w = l.some((W) => W.is_final);
134
+ if (n) {
135
+ A(e, "ended");
111
136
  return;
112
137
  }
113
- if (w?.isAudioStreaming || !N) {
114
- _.current = e, f.current = e, m.current = !0, n.current = s, l(s);
138
+ if (C?.isAudioStreaming || !w) {
139
+ j.current = e, f.current = e, h.current = !0, s.current = d, u(!1), t(!0);
115
140
  return;
116
141
  }
117
- E("segments-completed");
118
- }, [
119
- t,
120
- s,
121
- E,
122
- x
123
- ]);
124
- v(() => {
125
- if (F.current === V)
142
+ U("segments-completed");
143
+ }, [d, U, A, t]);
144
+ R(() => {
145
+ if (L.current === P)
126
146
  return;
127
- F.current = V, _.current = 0, f.current = null, m.current = !1, n.current = !1, h.current = !1, y.current = null;
128
- const e = p.current;
129
- e && (e.pause(), e.removeAttribute("src"), e.load(), l(!1));
147
+ L.current = P, j.current = 0, f.current = null, h.current = !1, a.current = !1, s.current = !1, _.current = !1, N.current = null, x.current = null, t(!1);
148
+ const e = y.current;
149
+ e && (e.pause(), e.removeAttribute("src"), e.load(), u(!1));
130
150
  }, [
131
- t,
132
- V,
133
- g.length,
134
- j
135
- ]), v(() => {
136
- const e = p.current;
151
+ c,
152
+ P,
153
+ S.length,
154
+ k,
155
+ t
156
+ ]), R(() => {
157
+ const e = y.current;
137
158
  if (e) {
138
- if (!d) {
139
- S();
159
+ if (!m) {
160
+ M();
140
161
  return;
141
162
  }
142
- if (j) {
143
- const u = y.current !== j;
144
- if (u && (e.pause(), e.removeAttribute("src"), e.load(), y.current = j, e.src = j, e.load()), i.current = 0, e.readyState > 0 && (e.currentTime = 0, i.current = null), n.current = s, m.current = !1, h.current = !1, !s) {
145
- n.current = !1, e.pause(), l(!1);
163
+ if (k) {
164
+ const l = x.current !== k, n = d && !a.current;
165
+ if (N.current === "segment" && !!x.current && f.current === null) {
166
+ if (!n) {
167
+ s.current = !1, e.pause(), u(!1);
168
+ return;
169
+ }
170
+ e.paused && (s.current = !0, b("keep-segment-source"));
146
171
  return;
147
172
  }
148
- u || b("sync-url");
173
+ if (l) {
174
+ const w = f.current !== null ? $() : 0;
175
+ e.pause(), e.removeAttribute("src"), e.load(), x.current = k, N.current = "url", e.src = k, e.load(), p.current = w, e.readyState > 0 && (e.currentTime = w, p.current = null);
176
+ }
177
+ if (s.current = n, h.current = !1, _.current = !1, t(!1), !n) {
178
+ s.current = !1, e.pause(), u(!1);
179
+ return;
180
+ }
181
+ l || b("sync-url");
149
182
  return;
150
183
  }
151
184
  if (f.current !== null) {
152
- if (f.current < g.length) {
153
- x(f.current, "wait-resume");
185
+ if (f.current < S.length) {
186
+ if (a.current) {
187
+ u(!1), t(!1);
188
+ return;
189
+ }
190
+ A(f.current, "wait-resume");
154
191
  return;
155
192
  }
156
- m.current = !0, n.current = s, l(s);
193
+ h.current = !0, s.current = d && !a.current, u(!1), t(!a.current);
157
194
  return;
158
195
  }
159
- if (!g.length) {
160
- if (d.isAudioStreaming) {
161
- f.current = _.current, m.current = !0, n.current = s, l(s);
196
+ if (!S.length) {
197
+ if (m.isAudioStreaming) {
198
+ f.current = j.current, h.current = !0, s.current = d && !a.current, u(!1), t(!a.current);
162
199
  return;
163
200
  }
164
- S();
201
+ M();
165
202
  return;
166
203
  }
167
- if (!y.current) {
168
- x(
204
+ if (!x.current) {
205
+ A(
169
206
  Math.min(
170
- _.current,
171
- g.length - 1
207
+ j.current,
208
+ S.length - 1
172
209
  ),
173
210
  "effect-init"
174
211
  );
175
212
  return;
176
213
  }
177
- if (!s) {
178
- n.current = !1, e.pause(), l(!1);
214
+ if (!d || a.current) {
215
+ s.current = !1, e.pause(), u(!1);
179
216
  return;
180
217
  }
181
- e.paused && (n.current = !0, b("sync-paused-retry"));
218
+ e.paused && (s.current = !0, b("sync-paused-retry"));
182
219
  }
183
220
  }, [
184
- d,
185
- t,
186
- g,
187
- j,
188
- s,
221
+ m,
222
+ c,
189
223
  S,
190
- x,
191
- b
192
- ]), v(() => S, [S]);
193
- const Y = a(() => {
194
- l(!0);
195
- }, [t]), q = a(() => {
196
- m.current || h.current || l(!1);
197
- }, [t]), D = a(() => {
198
- const e = p.current;
199
- e && i.current !== null && (e.currentTime = i.current, i.current = null), !(!n.current || !s) && b("canplay");
200
- }, [t, s, b]), I = a(() => {
201
- const e = p.current;
202
- e && i.current !== null && (e.currentTime = i.current, i.current = null);
203
- }, [t]), ee = a(() => {
204
- if (h.current = !1, A.current?.audioUrl || C.current.length === 0) {
205
- E("url-ended");
224
+ k,
225
+ d,
226
+ M,
227
+ A,
228
+ b,
229
+ $,
230
+ t
231
+ ]), R(() => M, [M]);
232
+ const ue = o(() => {
233
+ u(!0), t(!1);
234
+ }, [t]), le = o(() => {
235
+ h.current || _.current || u(!1);
236
+ }, [c]), ce = o(() => {
237
+ const e = y.current;
238
+ e && p.current !== null && (e.currentTime = p.current, p.current = null), !(!s.current || !d) && b("canplay");
239
+ }, [c, d, b]), ae = o(() => {
240
+ const e = y.current;
241
+ e && p.current !== null && (e.currentTime = p.current, p.current = null);
242
+ }, [c]), ie = o(() => {
243
+ const e = N.current === "url" || E.current.length === 0;
244
+ if (_.current = !1, e) {
245
+ U("url-ended");
206
246
  return;
207
247
  }
208
- T();
209
- }, [t, E, T]), re = a(() => {
210
- l(!1);
248
+ z();
249
+ }, [U, z]), oe = o(() => {
250
+ u(!1), t(!1);
211
251
  }, [t]);
212
- return /* @__PURE__ */ r.jsxs("div", { className: Z("slide-player", H), ...X, children: [
252
+ return /* @__PURE__ */ r.jsxs("div", { className: G("slide-player", v), ...se, children: [
213
253
  /* @__PURE__ */ r.jsx(
214
254
  "audio",
215
255
  {
216
- ref: p,
217
- preload: "metadata",
256
+ ref: y,
257
+ preload: "auto",
218
258
  playsInline: !0,
219
- onLoadedMetadata: I,
220
- onCanPlay: D,
221
- onPlay: Y,
222
- onPause: q,
223
- onEnded: ee,
224
- onError: re
259
+ onLoadedMetadata: ae,
260
+ onCanPlay: ce,
261
+ onPlay: ue,
262
+ onPause: le,
263
+ onEnded: ie,
264
+ onError: oe
225
265
  }
226
266
  ),
227
- Q ? /* @__PURE__ */ r.jsxs("div", { className: "slide-player__controls", children: [
267
+ ne ? /* @__PURE__ */ r.jsxs("div", { className: "slide-player__controls", children: [
228
268
  /* @__PURE__ */ r.jsxs("div", { className: "slide-player__group", children: [
229
269
  /* @__PURE__ */ r.jsx("button", { "aria-label": "More options", className: "hidden", type: "button", children: /* @__PURE__ */ r.jsx(
230
- se,
270
+ me,
231
271
  {
232
272
  className: "slide-player__icon",
233
273
  strokeWidth: 2.25
234
274
  }
235
275
  ) }),
236
- /* @__PURE__ */ r.jsx("button", { "aria-label": "Volume", className: "hidden", type: "button", children: /* @__PURE__ */ r.jsx(le, { className: "slide-player__icon", strokeWidth: 2.25 }) }),
276
+ /* @__PURE__ */ r.jsx("button", { "aria-label": "Volume", className: "hidden", type: "button", children: /* @__PURE__ */ r.jsx(pe, { className: "slide-player__icon", strokeWidth: 2.25 }) }),
237
277
  /* @__PURE__ */ r.jsx(
238
278
  "button",
239
279
  {
240
280
  "aria-label": "Rewind",
241
281
  className: "slide-player__action",
242
- disabled: O,
243
- onClick: U,
282
+ disabled: re,
283
+ onClick: X,
244
284
  type: "button",
245
- children: /* @__PURE__ */ r.jsx(ce, { className: "slide-player__icon", strokeWidth: 2.25 })
285
+ children: /* @__PURE__ */ r.jsx(he, { className: "slide-player__icon", strokeWidth: 2.25 })
246
286
  }
247
287
  ),
248
288
  /* @__PURE__ */ r.jsx(
249
289
  "button",
250
290
  {
251
- "aria-label": M ? "Pause" : "Play",
291
+ "aria-label": V ? "Pause" : "Play",
252
292
  className: "slide-player__toggle",
253
293
  onClick: () => {
254
- const e = p.current;
255
- if (!(!e || !d)) {
294
+ const e = y.current;
295
+ if (!(!e || !m)) {
256
296
  if (f.current !== null) {
257
- if (M) {
258
- n.current = !1, f.current = null, m.current = !1, l(!1), e.pause();
297
+ if (V) {
298
+ s.current = !1, a.current = !0, f.current = null, h.current = !1, u(!1), t(!1), e.pause();
259
299
  return;
260
300
  }
261
- R?.(), n.current = !0, l(!0);
301
+ T?.(), a.current = !1, s.current = !0, t(!0);
262
302
  return;
263
303
  }
264
- if (!e.src && g.length > 0) {
265
- R?.(), x(
304
+ if (!e.src && S.length > 0) {
305
+ T?.(), a.current = !1, A(
266
306
  Math.min(
267
- _.current,
268
- g.length - 1
307
+ j.current,
308
+ S.length - 1
269
309
  ),
270
310
  "toggle"
271
311
  );
272
312
  return;
273
313
  }
274
314
  if (e.paused) {
275
- R?.(), n.current = !0, b("toggle-resume");
315
+ T?.(), a.current = !1, s.current = !0, b("toggle-resume");
276
316
  return;
277
317
  }
278
- n.current = !1, e.pause();
318
+ s.current = !1, a.current = !0, e.pause();
279
319
  }
280
320
  },
281
321
  type: "button",
282
- children: M ? /* @__PURE__ */ r.jsx(oe, {}) : /* @__PURE__ */ r.jsx(fe, {})
322
+ children: V ? /* @__PURE__ */ r.jsx(Se, {}) : /* @__PURE__ */ r.jsx(be, {})
283
323
  }
284
324
  ),
285
325
  /* @__PURE__ */ r.jsx(
@@ -287,10 +327,10 @@ const oe = () => /* @__PURE__ */ r.jsxs(
287
327
  {
288
328
  "aria-label": "Forward",
289
329
  className: "slide-player__action",
290
- disabled: P,
291
- onClick: B,
330
+ disabled: te,
331
+ onClick: Y,
292
332
  type: "button",
293
- children: /* @__PURE__ */ r.jsx(ue, { className: "slide-player__icon", strokeWidth: 2.25 })
333
+ children: /* @__PURE__ */ r.jsx(ge, { className: "slide-player__icon", strokeWidth: 2.25 })
294
334
  }
295
335
  ),
296
336
  /* @__PURE__ */ r.jsx(
@@ -298,9 +338,9 @@ const oe = () => /* @__PURE__ */ r.jsxs(
298
338
  {
299
339
  "aria-label": "Fullscreen",
300
340
  className: "hidden",
301
- onClick: K,
341
+ onClick: q,
302
342
  type: "button",
303
- children: /* @__PURE__ */ r.jsx(ae, { className: "slide-player__icon", strokeWidth: 2.25 })
343
+ children: /* @__PURE__ */ r.jsx(ye, { className: "slide-player__icon", strokeWidth: 2.25 })
304
344
  }
305
345
  )
306
346
  ] }),
@@ -309,20 +349,20 @@ const oe = () => /* @__PURE__ */ r.jsxs(
309
349
  "button",
310
350
  {
311
351
  "aria-label": "Notes",
312
- className: Z(
352
+ className: G(
313
353
  "slide-player__action",
314
- J && "slide-player__action--active"
354
+ ee && "slide-player__action--active"
315
355
  ),
316
- disabled: !G,
317
- onClick: z,
356
+ disabled: !I,
357
+ onClick: D,
318
358
  type: "button",
319
- children: /* @__PURE__ */ r.jsx(ie, { className: "slide-player__icon", strokeWidth: 2.25 })
359
+ children: /* @__PURE__ */ r.jsx(_e, { className: "slide-player__icon", strokeWidth: 2.25 })
320
360
  }
321
361
  ) })
322
362
  ] }) : null
323
363
  ] });
324
364
  };
325
365
  export {
326
- Se as default
366
+ Me as default
327
367
  };
328
368
  //# sourceMappingURL=Player.es.js.map