@factorialco/f0-react 12.12.0 → 12.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ArchiveThumbnail-b34U-zTc.js → ArchiveThumbnail-BZgITTo2.js} +4 -4
- package/dist/{ArchiveViewer-BpmryW7A.js → ArchiveViewer-BHu224N3.js} +2 -2
- package/dist/{ChatPostComposerDialog-Cr207fXs.js → ChatPostComposerDialog-CsxxDqxh.js} +2 -2
- package/dist/{CoachmarkProvider-CsytVD-X.js → CoachmarkProvider-9PVhiN-N.js} +17650 -17650
- package/dist/{CodeThumbnail-8NiQ3uzU.js → CodeThumbnail-ChpXV1S-.js} +1 -1
- package/dist/{CodeViewer-BNZqt-5s.js → CodeViewer-BKw04W0G.js} +5 -5
- package/dist/{DocumentToolbar-DUe9R1rU.js → DocumentToolbar-mB3bK8uS.js} +1 -1
- package/dist/{DocxViewer-BUMy2iL7.js → DocxViewer-Dr8WXU1s.js} +1 -1
- package/dist/{F0AiProcessingOverlay-CiUTeBwG.js → F0AiProcessingOverlay-BUynKfyI.js} +542 -542
- package/dist/{F0Alert-Ca8sBfXN.js → F0Alert-ALRcL0Af.js} +10 -10
- package/dist/F0AudioPlayer-Cd9nIQX5.js +2 -0
- package/dist/{F0AudioPlayer-BefDLQA2.js → F0AudioPlayer-vRJmmSpp.js} +423 -331
- package/dist/{F0CanvasPanel-BOo_mxBl.js → F0CanvasPanel-D1QmpvzX.js} +799 -780
- package/dist/{F0DocumentViewer-CaYAO9ok.js → F0DocumentViewer-CEuF9b_u.js} +1 -1
- package/dist/{F0DocumentViewer-h0XY5tgT.js → F0DocumentViewer-ChCqzIK3.js} +2 -2
- package/dist/{F0Map-b1uYlF_H.js → F0Map-CWhV5A03.js} +10 -10
- package/dist/F0VideoPlayer-DUw-DouS.js +1 -0
- package/dist/{F0VideoPlayer-D85XCpqh.js → F0VideoPlayer-wTc25_qN.js} +62 -62
- package/dist/{HtmlViewer-DxOnMV30.js → HtmlViewer-Uxb8n2vn.js} +3 -3
- package/dist/{Map-BOMgctnS.js → Map-95w5slTZ.js} +9 -9
- package/dist/{PdfThumbnail-98PDy4ud.js → PdfThumbnail-BYrhsyMw.js} +1 -1
- package/dist/{PdfViewer-nBnKrTYD.js → PdfViewer-DUxhQr-O.js} +5 -5
- package/dist/{SheetViewer-CD9SHbXJ.js → SheetViewer-C9Rbh_xJ.js} +12 -12
- package/dist/{TextViewer-DxRBCXzV.js → TextViewer-DP9lYxAB.js} +1 -1
- package/dist/ai.js +3 -3
- package/dist/component-status.js +1 -1
- package/dist/experimental.d.ts +14 -2
- package/dist/experimental.js +4984 -4897
- package/dist/f0.d.ts +6 -127
- package/dist/f0.js +171 -172
- package/dist/{highlight-CqFL-_MG.js → highlight-Bjt-wXg6.js} +7 -7
- package/dist/{maplibre-Ip4Qe9dM.js → maplibre-tJ3UolSF.js} +1 -1
- package/dist/{pdfWorker-DMjHHAyP.js → pdfWorker-BBnYtb1A.js} +1 -1
- package/dist/{types-geibVrTM.d.ts → types-oJKIDe-E.d.ts} +122 -1
- package/package.json +1 -1
- package/dist/F0AudioPlayer-CNb4kXOk.js +0 -3
- package/dist/F0SegmentedControl-DXoAzTmH.js +0 -103
- package/dist/F0VideoPlayer-_zLFiEIp.js +0 -1
|
@@ -2,26 +2,26 @@ import { a as e, r as t } from "./i18n-provider-Bdgo-LeP.js";
|
|
|
2
2
|
import { n } from "./skeleton-AC0Fb8zj.js";
|
|
3
3
|
import { L as r, R as i } from "./tooltip-BX4dSfeL.js";
|
|
4
4
|
import { U as a, h as o, t as s } from "./F0Button-d91IgOnc.js";
|
|
5
|
-
import {
|
|
5
|
+
import { Co as c, Ls as l, So as u, Va as d } from "./F0CanvasPanel-D1QmpvzX.js";
|
|
6
6
|
import { o as f, t as p } from "./F0Icon-DmCBV0gK.js";
|
|
7
7
|
import { t as m } from "./Check-DAp9gCRh.js";
|
|
8
8
|
import { a as h, i as g, r as _ } from "./dist-CFY0KELA.js";
|
|
9
|
-
import { A as v, H as y, L as b, M as x, N as S, a as C, ct as w, ft as
|
|
10
|
-
import { n as
|
|
11
|
-
import { n as
|
|
12
|
-
import { i as
|
|
9
|
+
import { A as v, H as y, L as b, M as x, N as S, a as C, ct as w, ft as T, gt as E, ht as D, i as O, k, lt as A, mt as ee, st as j, t as te, tt as ne } from "./popover-ics24JxK.js";
|
|
10
|
+
import { n as re } from "./scrollarea-cxaFAWG5.js";
|
|
11
|
+
import { i as ie, n as ae, r as M, t as oe } from "./localized-BrUgGMzm.js";
|
|
12
|
+
import { i as se, r as ce } from "./dist-DtILhk4w.js";
|
|
13
13
|
import * as N from "react";
|
|
14
|
-
import { forwardRef as
|
|
15
|
-
import { Fragment as
|
|
14
|
+
import { forwardRef as P, memo as F, useCallback as I, useEffect as L, useMemo as R, useRef as z, useState as B } from "react";
|
|
15
|
+
import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
16
16
|
//#region src/blocks/F0AudioPlayer/utils.ts
|
|
17
|
-
var
|
|
17
|
+
var le = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWith("data-"))), W = (e) => {
|
|
18
18
|
(!Number.isFinite(e) || e < 0) && (e = 0);
|
|
19
19
|
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60, a = (e) => String(e).padStart(2, "0");
|
|
20
20
|
return n > 0 ? `${n}:${a(r)}:${a(i)}` : `${r}:${a(i)}`;
|
|
21
|
-
},
|
|
21
|
+
}, ue = (e) => e.map((e, t) => ({
|
|
22
22
|
start: e.startTime,
|
|
23
23
|
cueIndex: t
|
|
24
|
-
})).filter((e) => typeof e.start == "number" && Number.isFinite(e.start)).sort((e, t) => e.start - t.start),
|
|
24
|
+
})).filter((e) => typeof e.start == "number" && Number.isFinite(e.start)).sort((e, t) => e.start - t.start), de = (e, t) => {
|
|
25
25
|
let n = 0, r = e.length - 1, i = -1;
|
|
26
26
|
for (; n <= r;) {
|
|
27
27
|
let a = n + r >> 1, o = e[a];
|
|
@@ -29,16 +29,77 @@ var ue = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWit
|
|
|
29
29
|
o.start <= t ? (i = o.cueIndex, n = a + 1) : r = a - 1;
|
|
30
30
|
}
|
|
31
31
|
return i;
|
|
32
|
-
},
|
|
32
|
+
}, G = (e, t = {}, n = 0) => {
|
|
33
|
+
let r = z(t);
|
|
34
|
+
r.current = t;
|
|
35
|
+
let i = z(n);
|
|
36
|
+
i.current = n;
|
|
37
|
+
let [a, o] = B(!1), [s, c] = B(0), [l, u] = B(n), [d, f] = B(0), [p, m] = B(1), [h, g] = B(!0), [_, v] = B(null);
|
|
38
|
+
L(() => {
|
|
39
|
+
let t = e.current;
|
|
40
|
+
if (!t) return;
|
|
41
|
+
let n = () => {
|
|
42
|
+
u(Number.isFinite(t.duration) ? t.duration : i.current), g(!1);
|
|
43
|
+
}, a = () => {
|
|
44
|
+
c(t.currentTime), r.current.onTimeUpdate?.(t.currentTime);
|
|
45
|
+
}, s = () => {
|
|
46
|
+
o(!0), r.current.onPlay?.();
|
|
47
|
+
}, l = () => {
|
|
48
|
+
o(!1), r.current.onPause?.();
|
|
49
|
+
}, d = () => {
|
|
50
|
+
o(!1), r.current.onEnded?.();
|
|
51
|
+
}, p = () => {
|
|
52
|
+
t.buffered.length > 0 && f(t.buffered.end(t.buffered.length - 1));
|
|
53
|
+
}, h = () => g(!0), _ = () => g(!1), y = () => m(t.playbackRate), b = () => {
|
|
54
|
+
v(t.error), g(!1), r.current.onError?.(t.error);
|
|
55
|
+
};
|
|
56
|
+
return t.addEventListener("loadedmetadata", n), t.addEventListener("timeupdate", a), t.addEventListener("play", s), t.addEventListener("pause", l), t.addEventListener("ended", d), t.addEventListener("progress", p), t.addEventListener("waiting", h), t.addEventListener("canplay", _), t.addEventListener("ratechange", y), t.addEventListener("error", b), t.readyState >= 1 && n(), () => {
|
|
57
|
+
t.removeEventListener("loadedmetadata", n), t.removeEventListener("timeupdate", a), t.removeEventListener("play", s), t.removeEventListener("pause", l), t.removeEventListener("ended", d), t.removeEventListener("progress", p), t.removeEventListener("waiting", h), t.removeEventListener("canplay", _), t.removeEventListener("ratechange", y), t.removeEventListener("error", b);
|
|
58
|
+
};
|
|
59
|
+
}, [e]);
|
|
60
|
+
let y = I(() => {
|
|
61
|
+
e.current?.play().catch(() => {});
|
|
62
|
+
}, [e]), b = I(() => {
|
|
63
|
+
e.current?.pause();
|
|
64
|
+
}, [e]);
|
|
65
|
+
return {
|
|
66
|
+
isPlaying: a,
|
|
67
|
+
currentTime: s,
|
|
68
|
+
duration: l,
|
|
69
|
+
buffered: d,
|
|
70
|
+
playbackRate: p,
|
|
71
|
+
isLoading: h,
|
|
72
|
+
error: _,
|
|
73
|
+
play: y,
|
|
74
|
+
pause: b,
|
|
75
|
+
toggle: I(() => {
|
|
76
|
+
a ? b() : y();
|
|
77
|
+
}, [
|
|
78
|
+
a,
|
|
79
|
+
y,
|
|
80
|
+
b
|
|
81
|
+
]),
|
|
82
|
+
seek: I((t) => {
|
|
83
|
+
let n = e.current;
|
|
84
|
+
if (!n) return;
|
|
85
|
+
let i = Number.isFinite(n.duration) ? n.duration : t, a = Math.min(Math.max(t, 0), i);
|
|
86
|
+
n.currentTime = a, c(a), r.current.onSeek?.(a);
|
|
87
|
+
}, [e]),
|
|
88
|
+
setPlaybackRate: I((t) => {
|
|
89
|
+
let n = e.current;
|
|
90
|
+
n && (n.playbackRate = t, m(t));
|
|
91
|
+
}, [e])
|
|
92
|
+
};
|
|
93
|
+
}, K = /* @__PURE__ */ new Set([
|
|
33
94
|
"captions",
|
|
34
95
|
"subtitles",
|
|
35
96
|
"descriptions",
|
|
36
97
|
"metadata"
|
|
37
|
-
]),
|
|
98
|
+
]), fe = (e) => K.has(e), q = (e, t) => {
|
|
38
99
|
let n = e.querySelectorAll("track");
|
|
39
100
|
for (let e of Array.from(n)) if (e.track === t) return !1;
|
|
40
101
|
return !0;
|
|
41
|
-
},
|
|
102
|
+
}, pe = (e) => {
|
|
42
103
|
let t = e.cues;
|
|
43
104
|
if (!t || t.length === 0) return "";
|
|
44
105
|
let n = [];
|
|
@@ -47,9 +108,9 @@ var ue = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWit
|
|
|
47
108
|
typeof t == "string" && t.trim() && n.push(t.trim());
|
|
48
109
|
}
|
|
49
110
|
return n.join("\n");
|
|
50
|
-
},
|
|
51
|
-
let [r, i] =
|
|
52
|
-
return
|
|
111
|
+
}, me = (e, t, n) => {
|
|
112
|
+
let [r, i] = B();
|
|
113
|
+
return L(() => {
|
|
53
114
|
if (!n) {
|
|
54
115
|
i(void 0);
|
|
55
116
|
return;
|
|
@@ -57,11 +118,11 @@ var ue = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWit
|
|
|
57
118
|
let t = e.current;
|
|
58
119
|
if (!t) return;
|
|
59
120
|
let r = t.textTracks, a = () => {
|
|
60
|
-
let e = Array.from(r).filter((e) =>
|
|
61
|
-
e.sort((e, n) => Number(
|
|
121
|
+
let e = Array.from(r).filter((e) => fe(e.kind));
|
|
122
|
+
e.sort((e, n) => Number(q(t, n)) - Number(q(t, e)));
|
|
62
123
|
for (let t of e) {
|
|
63
124
|
t.mode === "disabled" && (t.mode = "hidden");
|
|
64
|
-
let e =
|
|
125
|
+
let e = pe(t);
|
|
65
126
|
if (e) {
|
|
66
127
|
i(e);
|
|
67
128
|
return;
|
|
@@ -86,12 +147,12 @@ var ue = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWit
|
|
|
86
147
|
n,
|
|
87
148
|
t
|
|
88
149
|
]), r;
|
|
89
|
-
},
|
|
150
|
+
}, he = ["PageUp", "PageDown"], J = [
|
|
90
151
|
"ArrowUp",
|
|
91
152
|
"ArrowDown",
|
|
92
153
|
"ArrowLeft",
|
|
93
154
|
"ArrowRight"
|
|
94
|
-
],
|
|
155
|
+
], Y = {
|
|
95
156
|
"from-left": [
|
|
96
157
|
"Home",
|
|
97
158
|
"PageDown",
|
|
@@ -116,8 +177,8 @@ var ue = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWit
|
|
|
116
177
|
"ArrowUp",
|
|
117
178
|
"ArrowLeft"
|
|
118
179
|
]
|
|
119
|
-
},
|
|
120
|
-
let { name: n, min: r = 0, max: i = 100, step: a = 1, orientation: o = "horizontal", disabled: s = !1, minStepsBetweenThumbs: c = 0, defaultValue: l = [r], value: u, onValueChange: d = () => {}, onValueCommit: f = () => {}, inverted: p = !1, form: m, ...h } = e, g = N.useRef(/* @__PURE__ */ new Set()), v = N.useRef(0), y = o === "horizontal" ?
|
|
180
|
+
}, X = "Slider", [ge, _e, Z] = w(X), [ve, Q] = ee(X, [Z]), [ye, $] = ve(X), be = N.forwardRef((e, t) => {
|
|
181
|
+
let { name: n, min: r = 0, max: i = 100, step: a = 1, orientation: o = "horizontal", disabled: s = !1, minStepsBetweenThumbs: c = 0, defaultValue: l = [r], value: u, onValueChange: d = () => {}, onValueCommit: f = () => {}, inverted: p = !1, form: m, ...h } = e, g = N.useRef(/* @__PURE__ */ new Set()), v = N.useRef(0), y = o === "horizontal" ? Ce : we, [b = [], x] = T({
|
|
121
182
|
prop: u,
|
|
122
183
|
defaultProp: l,
|
|
123
184
|
onChange: (e) => {
|
|
@@ -125,20 +186,20 @@ var ue = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWit
|
|
|
125
186
|
}
|
|
126
187
|
}), S = N.useRef(b);
|
|
127
188
|
function C(e) {
|
|
128
|
-
|
|
189
|
+
O(e, Re(b, e));
|
|
129
190
|
}
|
|
130
191
|
function w(e) {
|
|
131
|
-
|
|
192
|
+
O(e, v.current);
|
|
132
193
|
}
|
|
133
|
-
function
|
|
194
|
+
function E() {
|
|
134
195
|
let e = S.current[v.current];
|
|
135
196
|
b[v.current] !== e && f(b);
|
|
136
197
|
}
|
|
137
|
-
function
|
|
138
|
-
let o =
|
|
198
|
+
function O(e, t, { commit: n } = { commit: !1 }) {
|
|
199
|
+
let o = Ue(a), s = We(Math.round((e - r) / a) * a + r, o), l = _(s, [r, i]);
|
|
139
200
|
x((e = []) => {
|
|
140
|
-
let r =
|
|
141
|
-
if (
|
|
201
|
+
let r = Fe(e, l, t);
|
|
202
|
+
if (Ve(r, c * a)) {
|
|
142
203
|
v.current = r.indexOf(l);
|
|
143
204
|
let t = String(r) !== String(e);
|
|
144
205
|
return t && n && f(r), t ? r : e;
|
|
@@ -146,7 +207,7 @@ var ue = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWit
|
|
|
146
207
|
return e;
|
|
147
208
|
});
|
|
148
209
|
}
|
|
149
|
-
return /* @__PURE__ */
|
|
210
|
+
return /* @__PURE__ */ H(ye, {
|
|
150
211
|
scope: e.__scopeSlider,
|
|
151
212
|
name: n,
|
|
152
213
|
disabled: s,
|
|
@@ -157,16 +218,16 @@ var ue = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWit
|
|
|
157
218
|
values: b,
|
|
158
219
|
orientation: o,
|
|
159
220
|
form: m,
|
|
160
|
-
children: /* @__PURE__ */
|
|
221
|
+
children: /* @__PURE__ */ H(ge.Provider, {
|
|
161
222
|
scope: e.__scopeSlider,
|
|
162
|
-
children: /* @__PURE__ */
|
|
223
|
+
children: /* @__PURE__ */ H(ge.Slot, {
|
|
163
224
|
scope: e.__scopeSlider,
|
|
164
|
-
children: /* @__PURE__ */
|
|
225
|
+
children: /* @__PURE__ */ H(y, {
|
|
165
226
|
"aria-disabled": s,
|
|
166
227
|
"data-disabled": s ? "" : void 0,
|
|
167
228
|
...h,
|
|
168
229
|
ref: t,
|
|
169
|
-
onPointerDown:
|
|
230
|
+
onPointerDown: D(h.onPointerDown, () => {
|
|
170
231
|
s || (S.current = b);
|
|
171
232
|
}),
|
|
172
233
|
min: r,
|
|
@@ -174,13 +235,13 @@ var ue = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWit
|
|
|
174
235
|
inverted: p,
|
|
175
236
|
onSlideStart: s ? void 0 : C,
|
|
176
237
|
onSlideMove: s ? void 0 : w,
|
|
177
|
-
onSlideEnd: s ? void 0 :
|
|
178
|
-
onHomeKeyDown: () => !s &&
|
|
179
|
-
onEndKeyDown: () => !s &&
|
|
238
|
+
onSlideEnd: s ? void 0 : E,
|
|
239
|
+
onHomeKeyDown: () => !s && O(r, 0, { commit: !0 }),
|
|
240
|
+
onEndKeyDown: () => !s && O(i, b.length - 1, { commit: !0 }),
|
|
180
241
|
onStepKeyDown: ({ event: e, direction: t }) => {
|
|
181
242
|
if (!s) {
|
|
182
|
-
let n =
|
|
183
|
-
|
|
243
|
+
let n = he.includes(e.key) || e.shiftKey && J.includes(e.key) ? 10 : 1, r = v.current, i = b[r];
|
|
244
|
+
O(i + a * n * t, r, { commit: !0 });
|
|
184
245
|
}
|
|
185
246
|
}
|
|
186
247
|
})
|
|
@@ -188,25 +249,25 @@ var ue = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWit
|
|
|
188
249
|
})
|
|
189
250
|
});
|
|
190
251
|
});
|
|
191
|
-
|
|
192
|
-
var [
|
|
252
|
+
be.displayName = X;
|
|
253
|
+
var [xe, Se] = ve(X, {
|
|
193
254
|
startEdge: "left",
|
|
194
255
|
endEdge: "right",
|
|
195
256
|
size: "width",
|
|
196
257
|
direction: 1
|
|
197
|
-
}),
|
|
198
|
-
let { min: n, max: r, dir: i, inverted: a, onSlideStart: o, onSlideMove: s, onSlideEnd: c, onStepKeyDown: l, ...u } = e, [d, f] = N.useState(null), p =
|
|
258
|
+
}), Ce = N.forwardRef((e, t) => {
|
|
259
|
+
let { min: n, max: r, dir: i, inverted: a, onSlideStart: o, onSlideMove: s, onSlideEnd: c, onStepKeyDown: l, ...u } = e, [d, f] = N.useState(null), p = E(t, (e) => f(e)), m = N.useRef(void 0), h = j(i), g = h === "ltr", _ = g && !a || !g && a;
|
|
199
260
|
function v(e) {
|
|
200
|
-
let t = m.current || d.getBoundingClientRect(), i =
|
|
261
|
+
let t = m.current || d.getBoundingClientRect(), i = He([0, t.width], _ ? [n, r] : [r, n]);
|
|
201
262
|
return m.current = t, i(e - t.left);
|
|
202
263
|
}
|
|
203
|
-
return /* @__PURE__ */
|
|
264
|
+
return /* @__PURE__ */ H(xe, {
|
|
204
265
|
scope: e.__scopeSlider,
|
|
205
266
|
startEdge: _ ? "left" : "right",
|
|
206
267
|
endEdge: _ ? "right" : "left",
|
|
207
268
|
direction: _ ? 1 : -1,
|
|
208
269
|
size: "width",
|
|
209
|
-
children: /* @__PURE__ */
|
|
270
|
+
children: /* @__PURE__ */ H(Te, {
|
|
210
271
|
dir: h,
|
|
211
272
|
"data-orientation": "horizontal",
|
|
212
273
|
...u,
|
|
@@ -227,7 +288,7 @@ var [be, xe] = Z(J, {
|
|
|
227
288
|
m.current = void 0, c?.();
|
|
228
289
|
},
|
|
229
290
|
onStepKeyDown: (e) => {
|
|
230
|
-
let t =
|
|
291
|
+
let t = Y[_ ? "from-left" : "from-right"].includes(e.key);
|
|
231
292
|
l?.({
|
|
232
293
|
event: e,
|
|
233
294
|
direction: t ? -1 : 1
|
|
@@ -235,19 +296,19 @@ var [be, xe] = Z(J, {
|
|
|
235
296
|
}
|
|
236
297
|
})
|
|
237
298
|
});
|
|
238
|
-
}),
|
|
239
|
-
let { min: n, max: r, inverted: i, onSlideStart: a, onSlideMove: o, onSlideEnd: s, onStepKeyDown: c, ...l } = e, u = N.useRef(null), d =
|
|
299
|
+
}), we = N.forwardRef((e, t) => {
|
|
300
|
+
let { min: n, max: r, inverted: i, onSlideStart: a, onSlideMove: o, onSlideEnd: s, onStepKeyDown: c, ...l } = e, u = N.useRef(null), d = E(t, u), f = N.useRef(void 0), p = !i;
|
|
240
301
|
function m(e) {
|
|
241
|
-
let t = f.current || u.current.getBoundingClientRect(), i =
|
|
302
|
+
let t = f.current || u.current.getBoundingClientRect(), i = He([0, t.height], p ? [r, n] : [n, r]);
|
|
242
303
|
return f.current = t, i(e - t.top);
|
|
243
304
|
}
|
|
244
|
-
return /* @__PURE__ */
|
|
305
|
+
return /* @__PURE__ */ H(xe, {
|
|
245
306
|
scope: e.__scopeSlider,
|
|
246
307
|
startEdge: p ? "bottom" : "top",
|
|
247
308
|
endEdge: p ? "top" : "bottom",
|
|
248
309
|
size: "height",
|
|
249
310
|
direction: p ? 1 : -1,
|
|
250
|
-
children: /* @__PURE__ */
|
|
311
|
+
children: /* @__PURE__ */ H(Te, {
|
|
251
312
|
"data-orientation": "vertical",
|
|
252
313
|
...l,
|
|
253
314
|
ref: d,
|
|
@@ -267,7 +328,7 @@ var [be, xe] = Z(J, {
|
|
|
267
328
|
f.current = void 0, s?.();
|
|
268
329
|
},
|
|
269
330
|
onStepKeyDown: (e) => {
|
|
270
|
-
let t =
|
|
331
|
+
let t = Y[p ? "from-bottom" : "from-top"].includes(e.key);
|
|
271
332
|
c?.({
|
|
272
333
|
event: e,
|
|
273
334
|
direction: t ? -1 : 1
|
|
@@ -275,39 +336,39 @@ var [be, xe] = Z(J, {
|
|
|
275
336
|
}
|
|
276
337
|
})
|
|
277
338
|
});
|
|
278
|
-
}),
|
|
279
|
-
let { __scopeSlider: n, onSlideStart: r, onSlideMove: i, onSlideEnd: a, onHomeKeyDown: o, onEndKeyDown: s, onStepKeyDown: c, ...l } = e, u = $(
|
|
280
|
-
return /* @__PURE__ */
|
|
339
|
+
}), Te = N.forwardRef((e, t) => {
|
|
340
|
+
let { __scopeSlider: n, onSlideStart: r, onSlideMove: i, onSlideEnd: a, onHomeKeyDown: o, onEndKeyDown: s, onStepKeyDown: c, ...l } = e, u = $(X, n);
|
|
341
|
+
return /* @__PURE__ */ H(A.span, {
|
|
281
342
|
...l,
|
|
282
343
|
ref: t,
|
|
283
|
-
onKeyDown:
|
|
284
|
-
e.key === "Home" ? (o(e), e.preventDefault()) : e.key === "End" ? (s(e), e.preventDefault()) :
|
|
344
|
+
onKeyDown: D(e.onKeyDown, (e) => {
|
|
345
|
+
e.key === "Home" ? (o(e), e.preventDefault()) : e.key === "End" ? (s(e), e.preventDefault()) : he.concat(J).includes(e.key) && (c(e), e.preventDefault());
|
|
285
346
|
}),
|
|
286
|
-
onPointerDown:
|
|
347
|
+
onPointerDown: D(e.onPointerDown, (e) => {
|
|
287
348
|
let t = e.target;
|
|
288
349
|
t.setPointerCapture(e.pointerId), e.preventDefault(), u.thumbs.has(t) ? t.focus() : r(e);
|
|
289
350
|
}),
|
|
290
|
-
onPointerMove:
|
|
351
|
+
onPointerMove: D(e.onPointerMove, (e) => {
|
|
291
352
|
e.target.hasPointerCapture(e.pointerId) && i(e);
|
|
292
353
|
}),
|
|
293
|
-
onPointerUp:
|
|
354
|
+
onPointerUp: D(e.onPointerUp, (e) => {
|
|
294
355
|
let t = e.target;
|
|
295
356
|
t.hasPointerCapture(e.pointerId) && (t.releasePointerCapture(e.pointerId), a(e));
|
|
296
357
|
})
|
|
297
358
|
});
|
|
298
|
-
}),
|
|
299
|
-
let { __scopeSlider: n, ...r } = e, i = $(
|
|
300
|
-
return /* @__PURE__ */
|
|
359
|
+
}), Ee = "SliderTrack", De = N.forwardRef((e, t) => {
|
|
360
|
+
let { __scopeSlider: n, ...r } = e, i = $(Ee, n);
|
|
361
|
+
return /* @__PURE__ */ H(A.span, {
|
|
301
362
|
"data-disabled": i.disabled ? "" : void 0,
|
|
302
363
|
"data-orientation": i.orientation,
|
|
303
364
|
...r,
|
|
304
365
|
ref: t
|
|
305
366
|
});
|
|
306
367
|
});
|
|
307
|
-
|
|
308
|
-
var
|
|
309
|
-
let { __scopeSlider: n, ...r } = e, i = $(
|
|
310
|
-
return /* @__PURE__ */
|
|
368
|
+
De.displayName = Ee;
|
|
369
|
+
var Oe = "SliderRange", ke = N.forwardRef((e, t) => {
|
|
370
|
+
let { __scopeSlider: n, ...r } = e, i = $(Oe, n), a = Se(Oe, n), o = N.useRef(null), s = E(t, o), c = i.values.length, l = i.values.map((e) => Ie(e, i.min, i.max)), u = c > 1 ? Math.min(...l) : 0, d = 100 - Math.max(...l);
|
|
371
|
+
return /* @__PURE__ */ H(A.span, {
|
|
311
372
|
"data-orientation": i.orientation,
|
|
312
373
|
"data-disabled": i.disabled ? "" : void 0,
|
|
313
374
|
...r,
|
|
@@ -319,29 +380,29 @@ var De = "SliderRange", Oe = N.forwardRef((e, t) => {
|
|
|
319
380
|
}
|
|
320
381
|
});
|
|
321
382
|
});
|
|
322
|
-
|
|
323
|
-
var
|
|
324
|
-
let n =
|
|
325
|
-
return /* @__PURE__ */
|
|
383
|
+
ke.displayName = Oe;
|
|
384
|
+
var Ae = "SliderThumb", je = N.forwardRef((e, t) => {
|
|
385
|
+
let n = _e(e.__scopeSlider), [r, i] = N.useState(null), a = E(t, (e) => i(e)), o = N.useMemo(() => r ? n().findIndex((e) => e.ref.current === r) : -1, [n, r]);
|
|
386
|
+
return /* @__PURE__ */ H(Me, {
|
|
326
387
|
...e,
|
|
327
388
|
ref: a,
|
|
328
389
|
index: o
|
|
329
390
|
});
|
|
330
|
-
}),
|
|
331
|
-
let { __scopeSlider: n, index: r, name: i, ...a } = e, o = $(
|
|
391
|
+
}), Me = N.forwardRef((e, t) => {
|
|
392
|
+
let { __scopeSlider: n, index: r, name: i, ...a } = e, o = $(Ae, n), s = Se(Ae, n), [c, l] = N.useState(null), u = E(t, (e) => l(e)), d = !c || o.form || !!c.closest("form"), f = ne(c), p = o.values[r], m = p === void 0 ? 0 : Ie(p, o.min, o.max), h = Le(r, o.values.length), g = f?.[s.size], _ = g ? ze(g, m, s.direction) : 0;
|
|
332
393
|
return N.useEffect(() => {
|
|
333
394
|
if (c) return o.thumbs.add(c), () => {
|
|
334
395
|
o.thumbs.delete(c);
|
|
335
396
|
};
|
|
336
|
-
}, [c, o.thumbs]), /* @__PURE__ */
|
|
397
|
+
}, [c, o.thumbs]), /* @__PURE__ */ U("span", {
|
|
337
398
|
style: {
|
|
338
399
|
transform: "var(--radix-slider-thumb-transform)",
|
|
339
400
|
position: "absolute",
|
|
340
401
|
[s.startEdge]: `calc(${m}% + ${_}px)`
|
|
341
402
|
},
|
|
342
|
-
children: [/* @__PURE__ */
|
|
403
|
+
children: [/* @__PURE__ */ H(ge.ItemSlot, {
|
|
343
404
|
scope: e.__scopeSlider,
|
|
344
|
-
children: /* @__PURE__ */
|
|
405
|
+
children: /* @__PURE__ */ H(A.span, {
|
|
345
406
|
role: "slider",
|
|
346
407
|
"aria-label": e["aria-label"] || h,
|
|
347
408
|
"aria-valuemin": o.min,
|
|
@@ -354,20 +415,20 @@ var ke = "SliderThumb", Ae = N.forwardRef((e, t) => {
|
|
|
354
415
|
...a,
|
|
355
416
|
ref: u,
|
|
356
417
|
style: p === void 0 ? { display: "none" } : e.style,
|
|
357
|
-
onFocus:
|
|
418
|
+
onFocus: D(e.onFocus, () => {
|
|
358
419
|
o.valueIndexToChangeRef.current = r;
|
|
359
420
|
})
|
|
360
421
|
})
|
|
361
|
-
}), d && /* @__PURE__ */
|
|
422
|
+
}), d && /* @__PURE__ */ H(Pe, {
|
|
362
423
|
name: i ?? (o.name ? o.name + (o.values.length > 1 ? "[]" : "") : void 0),
|
|
363
424
|
form: o.form,
|
|
364
425
|
value: p
|
|
365
426
|
}, r)]
|
|
366
427
|
});
|
|
367
428
|
});
|
|
368
|
-
|
|
369
|
-
var
|
|
370
|
-
let i = N.useRef(null), a =
|
|
429
|
+
je.displayName = Ae;
|
|
430
|
+
var Ne = "RadioBubbleInput", Pe = N.forwardRef(({ __scopeSlider: e, value: t, ...n }, r) => {
|
|
431
|
+
let i = N.useRef(null), a = E(i, r), o = g(t);
|
|
371
432
|
return N.useEffect(() => {
|
|
372
433
|
let e = i.current;
|
|
373
434
|
if (!e) return;
|
|
@@ -376,62 +437,62 @@ var Me = "RadioBubbleInput", Ne = N.forwardRef(({ __scopeSlider: e, value: t, ..
|
|
|
376
437
|
let n = new Event("input", { bubbles: !0 });
|
|
377
438
|
r.call(e, t), e.dispatchEvent(n);
|
|
378
439
|
}
|
|
379
|
-
}, [o, t]), /* @__PURE__ */
|
|
440
|
+
}, [o, t]), /* @__PURE__ */ H(A.input, {
|
|
380
441
|
style: { display: "none" },
|
|
381
442
|
...n,
|
|
382
443
|
ref: a,
|
|
383
444
|
defaultValue: t
|
|
384
445
|
});
|
|
385
446
|
});
|
|
386
|
-
|
|
387
|
-
function
|
|
447
|
+
Pe.displayName = Ne;
|
|
448
|
+
function Fe(e = [], t, n) {
|
|
388
449
|
let r = [...e];
|
|
389
450
|
return r[n] = t, r.sort((e, t) => e - t);
|
|
390
451
|
}
|
|
391
|
-
function
|
|
452
|
+
function Ie(e, t, n) {
|
|
392
453
|
let r = 100 / (n - t) * (e - t);
|
|
393
454
|
return _(r, [0, 100]);
|
|
394
455
|
}
|
|
395
|
-
function
|
|
456
|
+
function Le(e, t) {
|
|
396
457
|
if (t > 2) return `Value ${e + 1} of ${t}`;
|
|
397
458
|
if (t === 2) return ["Minimum", "Maximum"][e];
|
|
398
459
|
}
|
|
399
|
-
function
|
|
460
|
+
function Re(e, t) {
|
|
400
461
|
if (e.length === 1) return 0;
|
|
401
462
|
let n = e.map((e) => Math.abs(e - t)), r = Math.min(...n);
|
|
402
463
|
return n.indexOf(r);
|
|
403
464
|
}
|
|
404
|
-
function
|
|
465
|
+
function ze(e, t, n) {
|
|
405
466
|
let r = e / 2;
|
|
406
|
-
return (r -
|
|
467
|
+
return (r - He([0, 50], [0, r])(t) * n) * n;
|
|
407
468
|
}
|
|
408
|
-
function
|
|
469
|
+
function Be(e) {
|
|
409
470
|
return e.slice(0, -1).map((t, n) => e[n + 1] - t);
|
|
410
471
|
}
|
|
411
|
-
function
|
|
472
|
+
function Ve(e, t) {
|
|
412
473
|
if (t > 0) {
|
|
413
|
-
let n =
|
|
474
|
+
let n = Be(e);
|
|
414
475
|
return Math.min(...n) >= t;
|
|
415
476
|
}
|
|
416
477
|
return !0;
|
|
417
478
|
}
|
|
418
|
-
function
|
|
479
|
+
function He(e, t) {
|
|
419
480
|
return (n) => {
|
|
420
481
|
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
421
482
|
let r = (t[1] - t[0]) / (e[1] - e[0]);
|
|
422
483
|
return t[0] + r * (n - e[0]);
|
|
423
484
|
};
|
|
424
485
|
}
|
|
425
|
-
function
|
|
486
|
+
function Ue(e) {
|
|
426
487
|
return (String(e).split(".")[1] || "").length;
|
|
427
488
|
}
|
|
428
|
-
function
|
|
489
|
+
function We(e, t) {
|
|
429
490
|
let n = 10 ** t;
|
|
430
491
|
return Math.round(e * n) / n;
|
|
431
492
|
}
|
|
432
|
-
var
|
|
433
|
-
let s = t(), [c, l] =
|
|
434
|
-
|
|
493
|
+
var Ge = be, Ke = De, qe = ke, Je = je, Ye = Ge, Xe = Ke, Ze = qe, Qe = Je, $e = ({ currentTime: e, duration: n, buffered: i = 0, disabled: a, onSeek: o }) => {
|
|
494
|
+
let s = t(), [c, l] = B(null), u = z(!1), d = n > 0 ? n : 0, f = c ?? e, p = d > 0 ? Math.min(Math.max(f, 0), d) / d * 100 : 0, m = d > 0 ? Math.min(i / d * 100, 100) : 0, h = a || d === 0, g = z(null), [_, v] = B(0);
|
|
495
|
+
L(() => {
|
|
435
496
|
let e = g.current;
|
|
436
497
|
if (!e) return;
|
|
437
498
|
let t = () => v(e.clientWidth);
|
|
@@ -439,20 +500,20 @@ var We = ye, Ge = Ee, Ke = Oe, qe = Ae, Je = We, Ye = Ge, Xe = Ke, Ze = qe, Qe =
|
|
|
439
500
|
let n = new ResizeObserver(t);
|
|
440
501
|
return n.observe(e), () => n.disconnect();
|
|
441
502
|
}, []);
|
|
442
|
-
let y = _ > 0 ? `${Math.round(_ * p / 100)}px` : `${p}%`, b =
|
|
503
|
+
let y = _ > 0 ? `${Math.round(_ * p / 100)}px` : `${p}%`, b = I((e) => {
|
|
443
504
|
let [t] = e;
|
|
444
505
|
t !== void 0 && u.current && l(t);
|
|
445
|
-
}, []), x =
|
|
506
|
+
}, []), x = I((e) => {
|
|
446
507
|
let [t] = e;
|
|
447
508
|
t === void 0 || u.current || o(t);
|
|
448
|
-
}, [o]), S =
|
|
509
|
+
}, [o]), S = I(() => {
|
|
449
510
|
u.current = !0;
|
|
450
|
-
}, []), C =
|
|
511
|
+
}, []), C = I(() => {
|
|
451
512
|
u.current = !1, l(null);
|
|
452
|
-
}, []), w =
|
|
513
|
+
}, []), w = I(() => {
|
|
453
514
|
u.current && (u.current = !1, l(null), c !== null && o(c));
|
|
454
515
|
}, [c, o]);
|
|
455
|
-
return /* @__PURE__ */
|
|
516
|
+
return /* @__PURE__ */ U(Ye, {
|
|
456
517
|
value: [f],
|
|
457
518
|
onValueChange: b,
|
|
458
519
|
onValueCommit: x,
|
|
@@ -465,29 +526,29 @@ var We = ye, Ge = Ee, Ke = Oe, qe = Ae, Je = We, Ye = Ge, Xe = Ke, Ze = qe, Qe =
|
|
|
465
526
|
disabled: h,
|
|
466
527
|
className: r("group relative flex w-full touch-none select-none items-center py-2", a && "opacity-50"),
|
|
467
528
|
children: [
|
|
468
|
-
/* @__PURE__ */
|
|
529
|
+
/* @__PURE__ */ U(Xe, {
|
|
469
530
|
ref: g,
|
|
470
531
|
className: "relative h-2 grow overflow-hidden rounded bg-f1-background-tertiary",
|
|
471
|
-
children: [/* @__PURE__ */
|
|
532
|
+
children: [/* @__PURE__ */ H("span", {
|
|
472
533
|
"aria-hidden": !0,
|
|
473
534
|
className: "absolute h-full bg-f1-background-secondary",
|
|
474
535
|
style: { width: `${m}%` }
|
|
475
|
-
}), /* @__PURE__ */
|
|
536
|
+
}), /* @__PURE__ */ H("span", {
|
|
476
537
|
"aria-hidden": !0,
|
|
477
538
|
className: "absolute h-full bg-f1-background-selected-bold",
|
|
478
539
|
style: { width: `${p}%` }
|
|
479
540
|
})]
|
|
480
541
|
}),
|
|
481
|
-
h ? null : /* @__PURE__ */
|
|
542
|
+
h ? null : /* @__PURE__ */ H("span", {
|
|
482
543
|
"aria-hidden": !0,
|
|
483
544
|
style: { left: y },
|
|
484
545
|
className: r("pointer-events-none absolute top-1/2 size-3 -translate-x-1/2 -translate-y-1/2 rounded-full bg-f1-background-selected-bold opacity-0 transition-opacity", "group-hover:opacity-100 group-has-[:focus-visible]:opacity-100", "group-has-[:focus-visible]:ring-1 group-has-[:focus-visible]:ring-f1-special-ring group-has-[:focus-visible]:ring-offset-1")
|
|
485
546
|
}),
|
|
486
|
-
/* @__PURE__ */
|
|
547
|
+
/* @__PURE__ */ H(Qe, {
|
|
487
548
|
"aria-label": s.audioPlayer.seek,
|
|
488
549
|
"aria-valuetext": s.t("audioPlayer.position", {
|
|
489
|
-
current:
|
|
490
|
-
total:
|
|
550
|
+
current: W(f),
|
|
551
|
+
total: W(d)
|
|
491
552
|
}),
|
|
492
553
|
className: "block size-3 opacity-0 focus-visible:outline-none"
|
|
493
554
|
})
|
|
@@ -496,21 +557,21 @@ var We = ye, Ge = Ee, Ke = Oe, qe = Ae, Je = We, Ye = Ge, Xe = Ke, Ze = qe, Qe =
|
|
|
496
557
|
};
|
|
497
558
|
//#endregion
|
|
498
559
|
//#region src/blocks/F0AudioPlayer/components/LanguageSelect.tsx
|
|
499
|
-
function
|
|
500
|
-
let [a, o] =
|
|
501
|
-
return /* @__PURE__ */
|
|
560
|
+
function et({ value: e, options: t, onChange: n, kind: i }) {
|
|
561
|
+
let [a, o] = B(!1), c = t.find((t) => t.locale === e), l = c ? M(c) : e;
|
|
562
|
+
return /* @__PURE__ */ U(te, {
|
|
502
563
|
open: a,
|
|
503
564
|
onOpenChange: o,
|
|
504
|
-
children: [/* @__PURE__ */
|
|
565
|
+
children: [/* @__PURE__ */ H(C, {
|
|
505
566
|
asChild: !0,
|
|
506
|
-
children: /* @__PURE__ */
|
|
567
|
+
children: /* @__PURE__ */ H(s, {
|
|
507
568
|
variant: "outline",
|
|
508
569
|
size: "sm",
|
|
509
570
|
label: l,
|
|
510
571
|
"aria-label": `${i}: ${l}`,
|
|
511
572
|
tooltip: i
|
|
512
573
|
})
|
|
513
|
-
}), /* @__PURE__ */
|
|
574
|
+
}), /* @__PURE__ */ H(O, {
|
|
514
575
|
align: "end",
|
|
515
576
|
sideOffset: 4,
|
|
516
577
|
className: r("flex w-auto min-w-[8rem] flex-col gap-0.5 rounded-md border", "border-solid border-f1-border-secondary bg-f1-background p-1 shadow-md"),
|
|
@@ -539,7 +600,7 @@ function $e({ value: e, options: t, onChange: n, kind: i }) {
|
|
|
539
600
|
},
|
|
540
601
|
children: t.map((t) => {
|
|
541
602
|
let i = t.locale === e;
|
|
542
|
-
return /* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ U("button", {
|
|
543
604
|
type: "button",
|
|
544
605
|
role: "menuitemradio",
|
|
545
606
|
"aria-checked": i,
|
|
@@ -547,9 +608,9 @@ function $e({ value: e, options: t, onChange: n, kind: i }) {
|
|
|
547
608
|
onClick: () => {
|
|
548
609
|
n(t.locale), o(!1);
|
|
549
610
|
},
|
|
550
|
-
children: [i ? /* @__PURE__ */
|
|
611
|
+
children: [i ? /* @__PURE__ */ H("span", {
|
|
551
612
|
className: "absolute left-2.5 inline-flex items-center",
|
|
552
|
-
children: /* @__PURE__ */
|
|
613
|
+
children: /* @__PURE__ */ H(m, {})
|
|
553
614
|
}) : null, M(t)]
|
|
554
615
|
}, t.locale);
|
|
555
616
|
})
|
|
@@ -558,82 +619,113 @@ function $e({ value: e, options: t, onChange: n, kind: i }) {
|
|
|
558
619
|
}
|
|
559
620
|
//#endregion
|
|
560
621
|
//#region src/blocks/F0AudioPlayer/components/PlaybackTime.tsx
|
|
561
|
-
var
|
|
622
|
+
var tt = f({
|
|
562
623
|
base: "shrink-0 font-medium tabular-nums text-f1-foreground-secondary",
|
|
563
624
|
variants: { size: {
|
|
564
625
|
sm: "text-xs",
|
|
565
626
|
md: "text-sm"
|
|
566
627
|
} }
|
|
567
|
-
}),
|
|
568
|
-
className:
|
|
628
|
+
}), nt = ({ currentTime: e, duration: t, size: n = "md" }) => /* @__PURE__ */ U("span", {
|
|
629
|
+
className: tt({ size: n }),
|
|
569
630
|
children: [
|
|
570
|
-
|
|
631
|
+
W(e),
|
|
571
632
|
" / ",
|
|
572
|
-
|
|
633
|
+
W(t)
|
|
573
634
|
]
|
|
574
|
-
}),
|
|
575
|
-
let s = t(),
|
|
576
|
-
return /* @__PURE__ */
|
|
635
|
+
}), rt = ({ isPlaying: e, disabled: n, size: a = "md", onToggle: o }) => {
|
|
636
|
+
let s = t(), l = e ? c : u;
|
|
637
|
+
return /* @__PURE__ */ H("button", {
|
|
577
638
|
type: "button",
|
|
578
639
|
"aria-label": e ? s.audioPlayer.pause : s.audioPlayer.play,
|
|
579
640
|
disabled: n,
|
|
580
641
|
onClick: o,
|
|
581
642
|
className: r("flex shrink-0 items-center justify-center rounded-xl border border-solid border-f1-border-secondary bg-f1-background-inverse-secondary text-f1-foreground-secondary transition-colors dark:bg-f1-background-tertiary", "hover:bg-f1-background-secondary disabled:cursor-not-allowed disabled:opacity-50", a === "sm" ? "size-8" : "size-10", i()),
|
|
582
|
-
children: /* @__PURE__ */
|
|
643
|
+
children: /* @__PURE__ */ H(l, { className: a === "sm" ? "size-5" : "size-6" })
|
|
644
|
+
});
|
|
645
|
+
}, it = ({ items: e, value: t, onChange: n, disabled: a = !1, fullWidth: o = !1, hideLabels: s = !1, ariaLabel: c, ariaLabelledBy: l }) => {
|
|
646
|
+
let [u, d] = T({
|
|
647
|
+
prop: t,
|
|
648
|
+
defaultProp: e[0]?.value ?? "",
|
|
649
|
+
onChange: n
|
|
583
650
|
});
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
651
|
+
return /* @__PURE__ */ H(ce, {
|
|
652
|
+
type: "single",
|
|
653
|
+
value: u,
|
|
654
|
+
onValueChange: (e) => {
|
|
655
|
+
e !== "" && d(e);
|
|
656
|
+
},
|
|
657
|
+
disabled: a,
|
|
658
|
+
"aria-label": c,
|
|
659
|
+
"aria-labelledby": l,
|
|
660
|
+
className: r("inline-flex items-center rounded-md bg-f1-background-secondary p-0.5 gap-0.5", o && "w-full"),
|
|
661
|
+
children: e.map((e) => /* @__PURE__ */ U(se, {
|
|
662
|
+
value: e.value,
|
|
663
|
+
disabled: a || e.disabled,
|
|
664
|
+
className: r("relative flex flex-1 items-center justify-center gap-1.5 whitespace-nowrap rounded font-medium transition-all", "text-f1-foreground-secondary", "hover:text-f1-foreground hover:bg-f1-background-hover", "disabled:pointer-events-none disabled:text-f1-foreground-disabled", "data-[state=on]:bg-f1-background data-[state=on]:text-f1-foreground data-[state=on]:shadow", i(), "h-8 px-3 text-base", o && "w-full"),
|
|
665
|
+
children: [e.icon ? /* @__PURE__ */ H(p, {
|
|
666
|
+
icon: e.icon,
|
|
667
|
+
size: "md"
|
|
668
|
+
}) : null, s && e.icon ? /* @__PURE__ */ H("span", {
|
|
669
|
+
className: "sr-only",
|
|
670
|
+
children: e.label
|
|
671
|
+
}) : e.label]
|
|
672
|
+
}, e.value))
|
|
673
|
+
});
|
|
674
|
+
};
|
|
675
|
+
it.displayName = "F0SegmentedControl";
|
|
676
|
+
var at = n("F0SegmentedControl", it), ot = ({ playbackRate: e, playbackRates: n, onRateChange: i, disabled: a, extraItems: o = [], audioLanguages: c = [], audioLanguage: u, onAudioLanguageChange: d }) => {
|
|
677
|
+
let f = t(), m = n.length > 0, g = c.length > 1;
|
|
678
|
+
return /* @__PURE__ */ U(k, { children: [/* @__PURE__ */ H(y, {
|
|
587
679
|
asChild: !0,
|
|
588
|
-
children: /* @__PURE__ */
|
|
680
|
+
children: /* @__PURE__ */ H(s, {
|
|
589
681
|
variant: "ghost",
|
|
590
682
|
size: "sm",
|
|
591
|
-
icon:
|
|
683
|
+
icon: l,
|
|
592
684
|
label: f.audioPlayer.options,
|
|
593
685
|
hideLabel: !0,
|
|
594
686
|
disabled: a
|
|
595
687
|
})
|
|
596
|
-
}), /* @__PURE__ */
|
|
688
|
+
}), /* @__PURE__ */ U(v, {
|
|
597
689
|
align: "end",
|
|
598
690
|
className: "flex min-w-44 flex-col gap-0.5",
|
|
599
691
|
children: [
|
|
600
|
-
m ? /* @__PURE__ */
|
|
692
|
+
m ? /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(S, {
|
|
601
693
|
className: "text-f1-foreground-secondary",
|
|
602
694
|
children: f.audioPlayer.playbackSpeed
|
|
603
695
|
}), n.map((t) => {
|
|
604
696
|
let n = t === e;
|
|
605
|
-
return /* @__PURE__ */
|
|
697
|
+
return /* @__PURE__ */ U(x, {
|
|
606
698
|
onSelect: () => i(t),
|
|
607
699
|
className: r("justify-between gap-3 px-3 text-sm text-f1-foreground", n && "before:absolute before:inset-x-1 before:inset-y-0 before:rounded before:bg-f1-background-selected-bold/10 before:content-[''] dark:before:bg-f1-background-selected-bold/20"),
|
|
608
|
-
children: [/* @__PURE__ */
|
|
700
|
+
children: [/* @__PURE__ */ U("span", {
|
|
609
701
|
className: "relative",
|
|
610
702
|
children: [t, "x"]
|
|
611
|
-
}), n ? /* @__PURE__ */
|
|
703
|
+
}), n ? /* @__PURE__ */ H("span", {
|
|
612
704
|
className: "relative flex text-f1-icon-selected",
|
|
613
|
-
children: /* @__PURE__ */
|
|
705
|
+
children: /* @__PURE__ */ H(p, {
|
|
614
706
|
icon: h,
|
|
615
707
|
size: "md"
|
|
616
708
|
})
|
|
617
709
|
}) : null]
|
|
618
710
|
}, t);
|
|
619
711
|
})] }) : null,
|
|
620
|
-
g ? /* @__PURE__ */
|
|
621
|
-
m ? /* @__PURE__ */
|
|
622
|
-
/* @__PURE__ */
|
|
712
|
+
g ? /* @__PURE__ */ U(V, { children: [
|
|
713
|
+
m ? /* @__PURE__ */ H(b, {}) : null,
|
|
714
|
+
/* @__PURE__ */ H(S, {
|
|
623
715
|
className: "text-f1-foreground-secondary",
|
|
624
716
|
children: f.audioPlayer.audio
|
|
625
717
|
}),
|
|
626
|
-
|
|
718
|
+
c.map((e) => {
|
|
627
719
|
let t = e.locale === u;
|
|
628
|
-
return /* @__PURE__ */
|
|
720
|
+
return /* @__PURE__ */ U(x, {
|
|
629
721
|
onSelect: () => d?.(e.locale),
|
|
630
722
|
className: r("justify-between gap-3 px-3 text-sm text-f1-foreground", t && "before:absolute before:inset-x-1 before:inset-y-0 before:rounded before:bg-f1-background-selected-bold/10 before:content-[''] dark:before:bg-f1-background-selected-bold/20"),
|
|
631
|
-
children: [/* @__PURE__ */
|
|
723
|
+
children: [/* @__PURE__ */ H("span", {
|
|
632
724
|
className: "relative",
|
|
633
725
|
children: M(e)
|
|
634
|
-
}), t ? /* @__PURE__ */
|
|
726
|
+
}), t ? /* @__PURE__ */ H("span", {
|
|
635
727
|
className: "relative flex text-f1-icon-selected",
|
|
636
|
-
children: /* @__PURE__ */
|
|
728
|
+
children: /* @__PURE__ */ H(p, {
|
|
637
729
|
icon: h,
|
|
638
730
|
size: "md"
|
|
639
731
|
})
|
|
@@ -641,58 +733,58 @@ var et = f({
|
|
|
641
733
|
}, e.locale);
|
|
642
734
|
})
|
|
643
735
|
] }) : null,
|
|
644
|
-
o.length > 0 ? /* @__PURE__ */
|
|
736
|
+
o.length > 0 ? /* @__PURE__ */ U(V, { children: [m || g ? /* @__PURE__ */ H(b, {}) : null, o.map((e) => /* @__PURE__ */ U(x, {
|
|
645
737
|
onSelect: () => e.onClick(),
|
|
646
738
|
className: r("gap-2 px-3 text-sm", e.critical ? "text-f1-foreground-critical" : "text-f1-foreground"),
|
|
647
|
-
children: [e.icon ? /* @__PURE__ */
|
|
739
|
+
children: [e.icon ? /* @__PURE__ */ H("span", {
|
|
648
740
|
className: r("relative flex", e.critical ? "text-f1-icon-critical" : "text-f1-icon"),
|
|
649
|
-
children: /* @__PURE__ */
|
|
741
|
+
children: /* @__PURE__ */ H(p, {
|
|
650
742
|
icon: e.icon,
|
|
651
743
|
size: "md"
|
|
652
744
|
})
|
|
653
|
-
}) : null, /* @__PURE__ */
|
|
745
|
+
}) : null, /* @__PURE__ */ H("span", {
|
|
654
746
|
className: "relative",
|
|
655
747
|
children: e.label
|
|
656
748
|
})]
|
|
657
749
|
}, e.label))] }) : null
|
|
658
750
|
]
|
|
659
751
|
})] });
|
|
660
|
-
},
|
|
661
|
-
let c = t(), { startTime:
|
|
752
|
+
}, st = (e) => r("block w-full rounded px-2 py-1 text-left transition-colors", e ? "bg-f1-background-selected-secondary font-medium" : "bg-transparent"), ct = F(function({ cue: e, index: n, isActive: a, onSeek: o, cueRefs: s }) {
|
|
753
|
+
let c = t(), { startTime: l } = e, u = o && l !== void 0, f = I((e) => {
|
|
662
754
|
s?.current && (s.current[n] = e);
|
|
663
|
-
}, [s, n]), p =
|
|
664
|
-
|
|
665
|
-
}, [o,
|
|
666
|
-
return /* @__PURE__ */
|
|
755
|
+
}, [s, n]), p = I(() => {
|
|
756
|
+
l !== void 0 && o?.(l);
|
|
757
|
+
}, [o, l]);
|
|
758
|
+
return /* @__PURE__ */ H("li", {
|
|
667
759
|
ref: f,
|
|
668
|
-
children:
|
|
760
|
+
children: u ? /* @__PURE__ */ H("button", {
|
|
669
761
|
type: "button",
|
|
670
762
|
onClick: p,
|
|
671
763
|
"aria-current": a || void 0,
|
|
672
|
-
title: c.t("audioPlayer.jumpTo", { time:
|
|
673
|
-
className: r(
|
|
674
|
-
children: /* @__PURE__ */
|
|
764
|
+
title: c.t("audioPlayer.jumpTo", { time: W(l) }),
|
|
765
|
+
className: r(st(a), i(), !a && "hover:bg-f1-background-secondary"),
|
|
766
|
+
children: /* @__PURE__ */ H(d, {
|
|
675
767
|
as: "span",
|
|
676
768
|
variant: "body",
|
|
677
769
|
content: e.text
|
|
678
770
|
})
|
|
679
|
-
}) : /* @__PURE__ */
|
|
680
|
-
className:
|
|
681
|
-
children: /* @__PURE__ */
|
|
771
|
+
}) : /* @__PURE__ */ H("div", {
|
|
772
|
+
className: st(a),
|
|
773
|
+
children: /* @__PURE__ */ H(d, {
|
|
682
774
|
as: "span",
|
|
683
775
|
variant: "body",
|
|
684
776
|
content: e.text
|
|
685
777
|
})
|
|
686
778
|
})
|
|
687
779
|
});
|
|
688
|
-
}),
|
|
780
|
+
}), lt = F(function({ cues: e, activeIndex: n, onSeek: r, cueRefs: i }) {
|
|
689
781
|
let a = t();
|
|
690
|
-
return /* @__PURE__ */
|
|
782
|
+
return /* @__PURE__ */ U(V, { children: [r ? /* @__PURE__ */ H("p", {
|
|
691
783
|
className: "sr-only",
|
|
692
784
|
children: a.audioPlayer.transcriptHint
|
|
693
|
-
}) : null, /* @__PURE__ */
|
|
785
|
+
}) : null, /* @__PURE__ */ H("ol", {
|
|
694
786
|
className: "flex list-none flex-col gap-1 p-0",
|
|
695
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
787
|
+
children: e.map((e, t) => /* @__PURE__ */ H(ct, {
|
|
696
788
|
cue: e,
|
|
697
789
|
index: t,
|
|
698
790
|
isActive: t === n,
|
|
@@ -703,16 +795,16 @@ var et = f({
|
|
|
703
795
|
});
|
|
704
796
|
//#endregion
|
|
705
797
|
//#region src/blocks/F0AudioPlayer/useAudioLanguage.ts
|
|
706
|
-
function
|
|
707
|
-
let n =
|
|
798
|
+
function ut(e, t) {
|
|
799
|
+
let n = R(() => oe(e), [e]), [r, i] = B(() => ae(n, t)), a = n.some((e) => e.locale === r) ? r : ae(n, t);
|
|
708
800
|
return {
|
|
709
801
|
languages: n,
|
|
710
802
|
activeLocale: a,
|
|
711
|
-
resolvedSrc:
|
|
803
|
+
resolvedSrc: ie(e, a) ?? "",
|
|
712
804
|
setLocale: i
|
|
713
805
|
};
|
|
714
806
|
}
|
|
715
|
-
function
|
|
807
|
+
function dt(e) {
|
|
716
808
|
if (!e) return;
|
|
717
809
|
let t = e.currentTime, n = !e.paused, r = () => {
|
|
718
810
|
e.currentTime = t, n && e.play().catch(() => {}), e.removeEventListener("loadedmetadata", r);
|
|
@@ -721,12 +813,12 @@ function ct(e) {
|
|
|
721
813
|
}
|
|
722
814
|
//#endregion
|
|
723
815
|
//#region src/blocks/F0AudioPlayer/usePlayerController.ts
|
|
724
|
-
var
|
|
816
|
+
var ft = (e) => {
|
|
725
817
|
let { src: t, duration: n, playing: r, onPlayingChange: i, playbackRates: a = [
|
|
726
818
|
1,
|
|
727
819
|
1.5,
|
|
728
820
|
2
|
|
729
|
-
], onPlay: o, onPause: s, onSeek: c, onTimeUpdate: l, onEnded: u, onError: d } = e, f = typeof t == "function" ? t : void 0, p = typeof t == "function" ? void 0 : t, m =
|
|
821
|
+
], onPlay: o, onPause: s, onSeek: c, onTimeUpdate: l, onEnded: u, onError: d } = e, f = typeof t == "function" ? t : void 0, p = typeof t == "function" ? void 0 : t, m = z(null), [h, g] = B(p), _ = z(null), [v, y] = B(null), b = z(!1), x = z(!1), S = z(!1), C = I(async () => {
|
|
730
822
|
if (f && !b.current) {
|
|
731
823
|
b.current = !0;
|
|
732
824
|
try {
|
|
@@ -737,77 +829,77 @@ var lt = (e) => {
|
|
|
737
829
|
b.current = !1;
|
|
738
830
|
}
|
|
739
831
|
}
|
|
740
|
-
}, [f, d]), w =
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
}, [
|
|
745
|
-
d,
|
|
746
|
-
f,
|
|
747
|
-
C
|
|
748
|
-
]), T = j(m, {
|
|
749
|
-
onPlay: w,
|
|
832
|
+
}, [f, d]), w = G(m, {
|
|
833
|
+
onPlay: I(() => {
|
|
834
|
+
S.current = !1, o?.();
|
|
835
|
+
}, [o]),
|
|
750
836
|
onPause: s,
|
|
751
837
|
onSeek: c,
|
|
752
838
|
onTimeUpdate: l,
|
|
753
839
|
onEnded: u,
|
|
754
|
-
onError:
|
|
755
|
-
|
|
840
|
+
onError: I((e) => {
|
|
841
|
+
d?.(e), f && !S.current && (S.current = !0, x.current = !0, g(void 0), C());
|
|
842
|
+
}, [
|
|
843
|
+
d,
|
|
844
|
+
f,
|
|
845
|
+
C
|
|
846
|
+
])
|
|
847
|
+
}, n ?? 0), T = w.seek, E = I((e) => {
|
|
756
848
|
let t = m.current, n = Math.max(e, 0);
|
|
757
|
-
t && h && t.readyState >= t.HAVE_METADATA ?
|
|
758
|
-
}, [
|
|
759
|
-
|
|
849
|
+
t && h && t.readyState >= t.HAVE_METADATA ? T(n) : (_.current = n, y(n));
|
|
850
|
+
}, [T, h]);
|
|
851
|
+
L(() => {
|
|
760
852
|
let e = m.current;
|
|
761
853
|
if (!e) return;
|
|
762
854
|
let t = () => {
|
|
763
855
|
let e = _.current;
|
|
764
|
-
e !== null && (_.current = null, y(null),
|
|
856
|
+
e !== null && (_.current = null, y(null), T(e));
|
|
765
857
|
};
|
|
766
858
|
return e.addEventListener("loadedmetadata", t), () => e.removeEventListener("loadedmetadata", t);
|
|
767
|
-
}, [
|
|
859
|
+
}, [T]), L(() => {
|
|
768
860
|
p !== void 0 && g(p);
|
|
769
|
-
}, [p]),
|
|
770
|
-
h && x.current && (x.current = !1,
|
|
771
|
-
}, [h,
|
|
772
|
-
let
|
|
773
|
-
!
|
|
861
|
+
}, [p]), L(() => {
|
|
862
|
+
h && x.current && (x.current = !1, w.play());
|
|
863
|
+
}, [h, w]);
|
|
864
|
+
let D = I(() => {
|
|
865
|
+
!w.isPlaying && !h && f ? (x.current = !0, C()) : w.toggle();
|
|
774
866
|
}, [
|
|
775
|
-
|
|
867
|
+
w,
|
|
776
868
|
h,
|
|
777
869
|
f,
|
|
778
870
|
C
|
|
779
871
|
]);
|
|
780
|
-
|
|
781
|
-
r !== void 0 && (r && !
|
|
872
|
+
L(() => {
|
|
873
|
+
r !== void 0 && (r && !w.isPlaying ? !h && f ? (x.current = !0, C()) : w.play() : !r && w.isPlaying && w.pause());
|
|
782
874
|
}, [
|
|
783
875
|
r,
|
|
784
|
-
|
|
876
|
+
w,
|
|
785
877
|
h,
|
|
786
878
|
f,
|
|
787
879
|
C
|
|
788
880
|
]);
|
|
789
|
-
let
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
}, [
|
|
793
|
-
let
|
|
881
|
+
let O = z(w.isPlaying);
|
|
882
|
+
L(() => {
|
|
883
|
+
O.current !== w.isPlaying && (O.current = w.isPlaying, i?.(w.isPlaying));
|
|
884
|
+
}, [w.isPlaying, i]);
|
|
885
|
+
let k = v !== null && w.duration > 0 ? Math.min(v, w.duration) : null;
|
|
794
886
|
return {
|
|
795
887
|
audioRef: m,
|
|
796
888
|
currentSrc: h,
|
|
797
889
|
pendingTime: v,
|
|
798
|
-
isPlaying:
|
|
799
|
-
currentTime:
|
|
800
|
-
duration:
|
|
801
|
-
buffered:
|
|
802
|
-
playbackRate:
|
|
803
|
-
isLoading:
|
|
804
|
-
error:
|
|
805
|
-
toggle:
|
|
806
|
-
seek:
|
|
807
|
-
setPlaybackRate:
|
|
890
|
+
isPlaying: w.isPlaying,
|
|
891
|
+
currentTime: k ?? w.currentTime,
|
|
892
|
+
duration: w.duration,
|
|
893
|
+
buffered: w.buffered,
|
|
894
|
+
playbackRate: w.playbackRate,
|
|
895
|
+
isLoading: w.isLoading,
|
|
896
|
+
error: w.error,
|
|
897
|
+
toggle: D,
|
|
898
|
+
seek: E,
|
|
899
|
+
setPlaybackRate: w.setPlaybackRate,
|
|
808
900
|
playbackRates: a
|
|
809
901
|
};
|
|
810
|
-
},
|
|
902
|
+
}, pt = /* @__PURE__ */ new Set([
|
|
811
903
|
"ArrowUp",
|
|
812
904
|
"ArrowDown",
|
|
813
905
|
"PageUp",
|
|
@@ -815,26 +907,26 @@ var lt = (e) => {
|
|
|
815
907
|
"Home",
|
|
816
908
|
"End",
|
|
817
909
|
" "
|
|
818
|
-
]),
|
|
819
|
-
let { title: i, subtitle: c, actions: l, className: u, src: d, preload: f, autoPlay: p = !1, disabled: m = !1, ariaLabel: h, size: g = "md", content: _, defaultLanguage: v, details: y, expanded: b, defaultExpanded: x = !1, onExpandedChange: S, detailsMaxHeight: C = 200 } = e, w = t(),
|
|
910
|
+
]), mt = P((e, n) => {
|
|
911
|
+
let { title: i, subtitle: c, actions: l, className: u, src: d, preload: f, autoPlay: p = !1, disabled: m = !1, ariaLabel: h, size: g = "md", content: _, defaultLanguage: v, details: y, expanded: b, defaultExpanded: x = !1, onExpandedChange: S, detailsMaxHeight: C = 200 } = e, w = t(), E = ut(d, v), D = ft({
|
|
820
912
|
...e,
|
|
821
|
-
src:
|
|
822
|
-
}),
|
|
823
|
-
|
|
824
|
-
},
|
|
913
|
+
src: E.resolvedSrc
|
|
914
|
+
}), O = le(e), k = o(), A = (e) => {
|
|
915
|
+
dt(D.audioRef.current), E.setLocale(e);
|
|
916
|
+
}, ee = !_ && !!(y && y.length > 0), j = R(() => oe(_?.summary, _?.transcription), [_?.summary, _?.transcription]), [te, ne] = B(() => ae(j, v)), M = j.some((e) => e.locale === te) ? te : ae(j, v), se = ie(_?.summary, M), ce = ie(_?.transcription, M), N = me(D.audioRef, D.currentSrc, !ce), P = ce ?? N, F = Array.isArray(P) ? P : void 0, V = typeof P == "string" ? P : void 0, W = !!(V || F?.length), G = R(() => F ? ue(F) : [], [F]), K = G.length > 0, fe = D.pendingTime ?? D.currentTime, q = R(() => K ? de(G, fe) : -1, [
|
|
917
|
+
K,
|
|
825
918
|
G,
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
let e = q.current;
|
|
919
|
+
fe
|
|
920
|
+
]), pe = z(null), he = z([]), J = z(!1), Y = I((e) => {
|
|
921
|
+
J.current = !1, D.seek(e);
|
|
922
|
+
}, [D.seek]);
|
|
923
|
+
L(() => {
|
|
924
|
+
let e = pe.current;
|
|
833
925
|
if (!e) return;
|
|
834
926
|
let t = () => {
|
|
835
927
|
J.current = !0;
|
|
836
928
|
}, n = (e) => {
|
|
837
|
-
|
|
929
|
+
pt.has(e.key) && t();
|
|
838
930
|
}, r = (n) => {
|
|
839
931
|
e.contains(n.target) || t();
|
|
840
932
|
}, i = e.parentElement;
|
|
@@ -842,140 +934,140 @@ var lt = (e) => {
|
|
|
842
934
|
e.removeEventListener("wheel", t), e.removeEventListener("touchmove", t), e.removeEventListener("keydown", n), i?.removeEventListener("pointerdown", r);
|
|
843
935
|
};
|
|
844
936
|
}, [W]);
|
|
845
|
-
let X =
|
|
846
|
-
if (
|
|
937
|
+
let X = R(() => {
|
|
938
|
+
if (ee) return y ?? [];
|
|
847
939
|
let e = [];
|
|
848
|
-
return
|
|
940
|
+
return se && e.push({
|
|
849
941
|
value: "summary",
|
|
850
942
|
label: w.audioPlayer.summary,
|
|
851
|
-
content: /* @__PURE__ */
|
|
943
|
+
content: /* @__PURE__ */ H("p", {
|
|
852
944
|
className: "whitespace-pre-line",
|
|
853
|
-
children:
|
|
945
|
+
children: se
|
|
854
946
|
})
|
|
855
947
|
}), W && e.push({
|
|
856
948
|
value: "transcription",
|
|
857
949
|
label: w.audioPlayer.transcription,
|
|
858
|
-
content:
|
|
859
|
-
cues:
|
|
860
|
-
activeIndex:
|
|
861
|
-
onSeek:
|
|
862
|
-
cueRefs:
|
|
863
|
-
}) : /* @__PURE__ */
|
|
950
|
+
content: F ? /* @__PURE__ */ H(lt, {
|
|
951
|
+
cues: F,
|
|
952
|
+
activeIndex: q,
|
|
953
|
+
onSeek: K ? Y : void 0,
|
|
954
|
+
cueRefs: he
|
|
955
|
+
}) : /* @__PURE__ */ H("p", {
|
|
864
956
|
className: "whitespace-pre-line",
|
|
865
|
-
children:
|
|
957
|
+
children: V
|
|
866
958
|
})
|
|
867
959
|
}), e;
|
|
868
960
|
}, [
|
|
869
|
-
|
|
961
|
+
ee,
|
|
870
962
|
y,
|
|
871
|
-
|
|
963
|
+
se,
|
|
872
964
|
W,
|
|
873
|
-
|
|
874
|
-
|
|
965
|
+
F,
|
|
966
|
+
V,
|
|
967
|
+
q,
|
|
875
968
|
K,
|
|
876
|
-
G,
|
|
877
969
|
Y,
|
|
878
970
|
w.audioPlayer.summary,
|
|
879
971
|
w.audioPlayer.transcription
|
|
880
|
-
]),
|
|
972
|
+
]), ge = W ? "available" : "missing", _e = X.length > 0, Z = X.length === 1 ? X[0] : void 0, ve = (e) => Z?.value === "transcription" ? e ? w.audioPlayer.hideTranscription : w.audioPlayer.viewTranscription : Z?.value === "summary" ? e ? w.audioPlayer.hideSummary : w.audioPlayer.viewSummary : e ? w.audioPlayer.hideDetail : w.audioPlayer.viewDetail, [Q = !1, ye] = T({
|
|
881
973
|
prop: b,
|
|
882
974
|
defaultProp: x,
|
|
883
975
|
onChange: S
|
|
884
976
|
});
|
|
885
|
-
|
|
886
|
-
if (
|
|
887
|
-
let e =
|
|
977
|
+
L(() => {
|
|
978
|
+
if (!Q || q < 0 || J.current) return;
|
|
979
|
+
let e = pe.current, t = he.current[q];
|
|
888
980
|
if (!e || !t) return;
|
|
889
981
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = r.top - n.top, a = r.bottom - n.bottom;
|
|
890
982
|
i >= 0 && a <= 0 || e.scrollTo({
|
|
891
983
|
top: e.scrollTop + (i < 0 ? i : a),
|
|
892
|
-
behavior:
|
|
984
|
+
behavior: k ? "auto" : "smooth"
|
|
893
985
|
});
|
|
894
986
|
}, [
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
987
|
+
q,
|
|
988
|
+
Q,
|
|
989
|
+
k
|
|
898
990
|
]);
|
|
899
|
-
let [be
|
|
900
|
-
return /* @__PURE__ */
|
|
991
|
+
let [$, be] = B(X[0]?.value), xe = X.some((e) => e.value === $) ? $ : X[0]?.value, Se = X.find((e) => e.value === xe)?.content;
|
|
992
|
+
return /* @__PURE__ */ U("div", {
|
|
901
993
|
ref: n,
|
|
902
994
|
role: "group",
|
|
903
995
|
"aria-label": h ?? i,
|
|
904
|
-
"data-audio-transcription":
|
|
996
|
+
"data-audio-transcription": ge,
|
|
905
997
|
className: r("flex flex-col gap-2.5 rounded-2xl border border-solid border-f1-border-secondary bg-f1-background p-3", u),
|
|
906
|
-
...
|
|
998
|
+
...O,
|
|
907
999
|
children: [
|
|
908
|
-
/* @__PURE__ */
|
|
909
|
-
ref:
|
|
910
|
-
src:
|
|
911
|
-
preload: f ?? (typeof
|
|
1000
|
+
/* @__PURE__ */ H("audio", {
|
|
1001
|
+
ref: D.audioRef,
|
|
1002
|
+
src: D.currentSrc,
|
|
1003
|
+
preload: f ?? (typeof E.resolvedSrc == "function" ? "none" : "metadata"),
|
|
912
1004
|
autoPlay: p
|
|
913
1005
|
}),
|
|
914
|
-
/* @__PURE__ */
|
|
1006
|
+
/* @__PURE__ */ U("div", {
|
|
915
1007
|
className: "flex items-start justify-between gap-2",
|
|
916
|
-
children: [/* @__PURE__ */
|
|
1008
|
+
children: [/* @__PURE__ */ U("div", {
|
|
917
1009
|
className: "flex min-w-0 flex-1 items-center gap-2.5",
|
|
918
|
-
children: [/* @__PURE__ */
|
|
919
|
-
isPlaying:
|
|
1010
|
+
children: [/* @__PURE__ */ H(rt, {
|
|
1011
|
+
isPlaying: D.isPlaying,
|
|
920
1012
|
disabled: m,
|
|
921
1013
|
size: g,
|
|
922
|
-
onToggle:
|
|
923
|
-
}), /* @__PURE__ */
|
|
1014
|
+
onToggle: D.toggle
|
|
1015
|
+
}), /* @__PURE__ */ U("div", {
|
|
924
1016
|
className: "flex min-w-0 flex-col",
|
|
925
|
-
children: [/* @__PURE__ */
|
|
1017
|
+
children: [/* @__PURE__ */ H("span", {
|
|
926
1018
|
className: "truncate text-base font-medium text-f1-foreground",
|
|
927
1019
|
children: i
|
|
928
|
-
}), c ? /* @__PURE__ */
|
|
1020
|
+
}), c ? /* @__PURE__ */ H("span", {
|
|
929
1021
|
className: "truncate text-base text-f1-foreground-secondary",
|
|
930
1022
|
children: c
|
|
931
1023
|
}) : null]
|
|
932
1024
|
})]
|
|
933
|
-
}),
|
|
1025
|
+
}), _e || D.playbackRates.length > 0 || E.languages.length > 1 || l ? /* @__PURE__ */ U("div", {
|
|
934
1026
|
className: "flex shrink-0 items-center gap-2",
|
|
935
|
-
children: [
|
|
1027
|
+
children: [_e ? /* @__PURE__ */ H(s, {
|
|
936
1028
|
variant: "outline",
|
|
937
1029
|
size: "sm",
|
|
938
|
-
label: ve(
|
|
939
|
-
onClick: () => ye(
|
|
940
|
-
"aria-expanded":
|
|
941
|
-
}) : null,
|
|
942
|
-
playbackRate:
|
|
943
|
-
playbackRates:
|
|
944
|
-
onRateChange:
|
|
1030
|
+
label: ve(Q),
|
|
1031
|
+
onClick: () => ye(!Q),
|
|
1032
|
+
"aria-expanded": Q
|
|
1033
|
+
}) : null, D.playbackRates.length > 0 || E.languages.length > 1 || l ? /* @__PURE__ */ H(ot, {
|
|
1034
|
+
playbackRate: D.playbackRate,
|
|
1035
|
+
playbackRates: D.playbackRates,
|
|
1036
|
+
onRateChange: D.setPlaybackRate,
|
|
945
1037
|
disabled: m,
|
|
946
1038
|
extraItems: l,
|
|
947
|
-
audioLanguages:
|
|
948
|
-
audioLanguage:
|
|
949
|
-
onAudioLanguageChange:
|
|
1039
|
+
audioLanguages: E.languages,
|
|
1040
|
+
audioLanguage: E.activeLocale,
|
|
1041
|
+
onAudioLanguageChange: A
|
|
950
1042
|
}) : null]
|
|
951
1043
|
}) : null]
|
|
952
1044
|
}),
|
|
953
|
-
/* @__PURE__ */
|
|
1045
|
+
/* @__PURE__ */ U("div", {
|
|
954
1046
|
className: "flex w-full items-center gap-2",
|
|
955
|
-
children: [/* @__PURE__ */
|
|
956
|
-
currentTime:
|
|
957
|
-
duration:
|
|
958
|
-
buffered:
|
|
1047
|
+
children: [/* @__PURE__ */ H($e, {
|
|
1048
|
+
currentTime: D.currentTime,
|
|
1049
|
+
duration: D.duration,
|
|
1050
|
+
buffered: D.buffered,
|
|
959
1051
|
disabled: m,
|
|
960
1052
|
onSeek: Y
|
|
961
|
-
}), /* @__PURE__ */
|
|
962
|
-
currentTime:
|
|
963
|
-
duration:
|
|
1053
|
+
}), /* @__PURE__ */ H(nt, {
|
|
1054
|
+
currentTime: D.currentTime,
|
|
1055
|
+
duration: D.duration,
|
|
964
1056
|
size: g
|
|
965
1057
|
})]
|
|
966
1058
|
}),
|
|
967
|
-
|
|
1059
|
+
_e ? /* @__PURE__ */ U(a.div, {
|
|
968
1060
|
role: "region",
|
|
969
|
-
"aria-label":
|
|
1061
|
+
"aria-label": Z ? Z.label : w.audioPlayer.details,
|
|
970
1062
|
initial: !1,
|
|
971
1063
|
animate: {
|
|
972
|
-
height:
|
|
973
|
-
marginTop:
|
|
974
|
-
opacity:
|
|
975
|
-
visibility:
|
|
1064
|
+
height: Q ? "auto" : 0,
|
|
1065
|
+
marginTop: Q ? 0 : "-0.625rem",
|
|
1066
|
+
opacity: +!!Q,
|
|
1067
|
+
visibility: Q ? "visible" : "hidden"
|
|
976
1068
|
},
|
|
977
1069
|
transition: {
|
|
978
|
-
duration:
|
|
1070
|
+
duration: k ? 0 : .15,
|
|
979
1071
|
ease: [
|
|
980
1072
|
.165,
|
|
981
1073
|
.84,
|
|
@@ -985,34 +1077,34 @@ var lt = (e) => {
|
|
|
985
1077
|
},
|
|
986
1078
|
className: "overflow-hidden",
|
|
987
1079
|
children: [
|
|
988
|
-
|
|
1080
|
+
j.length > 1 && M ? /* @__PURE__ */ H("div", {
|
|
989
1081
|
className: "flex justify-end pb-2.5",
|
|
990
|
-
children: /* @__PURE__ */
|
|
991
|
-
value:
|
|
992
|
-
options:
|
|
993
|
-
onChange:
|
|
1082
|
+
children: /* @__PURE__ */ H(et, {
|
|
1083
|
+
value: M,
|
|
1084
|
+
options: j,
|
|
1085
|
+
onChange: ne,
|
|
994
1086
|
kind: w.audioPlayer.language
|
|
995
1087
|
})
|
|
996
1088
|
}) : null,
|
|
997
|
-
|
|
1089
|
+
Z ? null : /* @__PURE__ */ H(at, {
|
|
998
1090
|
fullWidth: !0,
|
|
999
1091
|
ariaLabel: w.audioPlayer.details,
|
|
1000
|
-
value:
|
|
1001
|
-
onChange:
|
|
1092
|
+
value: xe,
|
|
1093
|
+
onChange: be,
|
|
1002
1094
|
items: X.map((e) => ({
|
|
1003
1095
|
value: e.value,
|
|
1004
1096
|
label: e.label
|
|
1005
1097
|
}))
|
|
1006
1098
|
}),
|
|
1007
|
-
/* @__PURE__ */
|
|
1008
|
-
className:
|
|
1009
|
-
children: /* @__PURE__ */
|
|
1010
|
-
viewportRef:
|
|
1099
|
+
/* @__PURE__ */ H("div", {
|
|
1100
|
+
className: Z ? void 0 : "pt-2.5",
|
|
1101
|
+
children: /* @__PURE__ */ H(re, {
|
|
1102
|
+
viewportRef: pe,
|
|
1011
1103
|
style: { "--audio-details-max-h": `${C}px` },
|
|
1012
1104
|
className: "[&_[data-scroll-container]]:max-h-[var(--audio-details-max-h)]",
|
|
1013
|
-
children: /* @__PURE__ */
|
|
1105
|
+
children: /* @__PURE__ */ H("div", {
|
|
1014
1106
|
className: "break-words pr-1 text-base text-f1-foreground",
|
|
1015
|
-
children:
|
|
1107
|
+
children: Se
|
|
1016
1108
|
})
|
|
1017
1109
|
})
|
|
1018
1110
|
})
|
|
@@ -1021,54 +1113,54 @@ var lt = (e) => {
|
|
|
1021
1113
|
]
|
|
1022
1114
|
});
|
|
1023
1115
|
});
|
|
1024
|
-
|
|
1116
|
+
mt.displayName = "F0AudioPlayerCard";
|
|
1025
1117
|
//#endregion
|
|
1026
1118
|
//#region src/blocks/F0AudioPlayer/F0AudioPlayer.tsx
|
|
1027
|
-
var
|
|
1119
|
+
var ht = f({
|
|
1028
1120
|
base: "flex w-full items-center",
|
|
1029
1121
|
variants: { size: {
|
|
1030
1122
|
sm: "gap-2",
|
|
1031
1123
|
md: "gap-3"
|
|
1032
1124
|
} }
|
|
1033
|
-
}),
|
|
1034
|
-
let { src: i, preload: a, autoPlay: o = !1, disabled: s = !1, ariaLabel: c, size: l = "md", defaultLanguage: u, className: d } = e, f = t(), p =
|
|
1125
|
+
}), gt = P((e, n) => {
|
|
1126
|
+
let { src: i, preload: a, autoPlay: o = !1, disabled: s = !1, ariaLabel: c, size: l = "md", defaultLanguage: u, className: d } = e, f = t(), p = ut(i, u), m = ft({
|
|
1035
1127
|
...e,
|
|
1036
1128
|
src: p.resolvedSrc
|
|
1037
|
-
}), h =
|
|
1038
|
-
|
|
1129
|
+
}), h = le(e), g = (e) => {
|
|
1130
|
+
dt(m.audioRef.current), p.setLocale(e);
|
|
1039
1131
|
};
|
|
1040
|
-
return /* @__PURE__ */
|
|
1132
|
+
return /* @__PURE__ */ U("div", {
|
|
1041
1133
|
ref: n,
|
|
1042
1134
|
role: "group",
|
|
1043
1135
|
"aria-label": c ?? f.audioPlayer.label,
|
|
1044
|
-
className: r(
|
|
1136
|
+
className: r(ht({ size: l }), d),
|
|
1045
1137
|
...h,
|
|
1046
1138
|
children: [
|
|
1047
|
-
/* @__PURE__ */
|
|
1139
|
+
/* @__PURE__ */ H("audio", {
|
|
1048
1140
|
ref: m.audioRef,
|
|
1049
1141
|
src: m.currentSrc,
|
|
1050
1142
|
preload: a ?? (typeof p.resolvedSrc == "function" ? "none" : "metadata"),
|
|
1051
1143
|
autoPlay: o
|
|
1052
1144
|
}),
|
|
1053
|
-
/* @__PURE__ */
|
|
1145
|
+
/* @__PURE__ */ H(rt, {
|
|
1054
1146
|
isPlaying: m.isPlaying,
|
|
1055
1147
|
disabled: s,
|
|
1056
1148
|
size: l,
|
|
1057
1149
|
onToggle: m.toggle
|
|
1058
1150
|
}),
|
|
1059
|
-
/* @__PURE__ */
|
|
1151
|
+
/* @__PURE__ */ H($e, {
|
|
1060
1152
|
currentTime: m.currentTime,
|
|
1061
1153
|
duration: m.duration,
|
|
1062
1154
|
buffered: m.buffered,
|
|
1063
1155
|
disabled: s,
|
|
1064
1156
|
onSeek: m.seek
|
|
1065
1157
|
}),
|
|
1066
|
-
/* @__PURE__ */
|
|
1158
|
+
/* @__PURE__ */ H(nt, {
|
|
1067
1159
|
currentTime: m.currentTime,
|
|
1068
1160
|
duration: m.duration,
|
|
1069
1161
|
size: l
|
|
1070
1162
|
}),
|
|
1071
|
-
p.languages.length > 1 && p.activeLocale ? /* @__PURE__ */
|
|
1163
|
+
p.languages.length > 1 && p.activeLocale ? /* @__PURE__ */ H(et, {
|
|
1072
1164
|
value: p.activeLocale,
|
|
1073
1165
|
options: p.languages,
|
|
1074
1166
|
onChange: g,
|
|
@@ -1077,7 +1169,7 @@ var ft = f({
|
|
|
1077
1169
|
]
|
|
1078
1170
|
});
|
|
1079
1171
|
});
|
|
1080
|
-
|
|
1081
|
-
var
|
|
1172
|
+
gt.displayName = "F0AudioPlayer";
|
|
1173
|
+
var _t = n("F0AudioPlayer", e(gt)), vt = n("F0AudioPlayerCard", e(mt));
|
|
1082
1174
|
//#endregion
|
|
1083
|
-
export { Ze as a,
|
|
1175
|
+
export { Ze as a, me as c, Ye as i, G as l, vt as n, Qe as o, at as r, Xe as s, _t as t, W as u };
|