@factorialco/f0-react 12.13.0 → 12.14.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-BZgITTo2.js → ArchiveThumbnail-CgaNJ6v9.js} +4 -4
- package/dist/{ArchiveViewer-BHu224N3.js → ArchiveViewer-Uohl6wf1.js} +2 -2
- package/dist/{ChatPostComposerDialog-CsxxDqxh.js → ChatPostComposerDialog-Cr6Ci2dz.js} +2 -2
- package/dist/{CoachmarkProvider-9PVhiN-N.js → CoachmarkProvider-Cfb6WvLp.js} +22331 -22330
- package/dist/{CodeThumbnail-ChpXV1S-.js → CodeThumbnail-CFNKh12S.js} +1 -1
- package/dist/{CodeViewer-BKw04W0G.js → CodeViewer-C4XxNdq4.js} +5 -5
- package/dist/{DocumentToolbar-mB3bK8uS.js → DocumentToolbar-CcEggNyX.js} +1 -1
- package/dist/{DocxViewer-Dr8WXU1s.js → DocxViewer-DIiFGMl7.js} +1 -1
- package/dist/Ellipsis-CBouJQYY.js +34 -0
- package/dist/{F0AiProcessingOverlay-BUynKfyI.js → F0AiProcessingOverlay-wFS85Arm.js} +1396 -1342
- package/dist/{F0Alert-ALRcL0Af.js → F0Alert-DRK5Na7T.js} +1 -1
- package/dist/F0AudioPlayer-Ds4txTh4.js +2 -0
- package/dist/{F0CanvasPanel-D1QmpvzX.js → F0CanvasPanel-CbJxX6Qv.js} +8632 -7464
- package/dist/{F0DocumentViewer-CEuF9b_u.js → F0DocumentViewer-B2_6INMo.js} +1 -1
- package/dist/{F0DocumentViewer-ChCqzIK3.js → F0DocumentViewer-B6ccmcTZ.js} +2 -2
- package/dist/{F0Map-CWhV5A03.js → F0Map-BkrkSniz.js} +16 -16
- package/dist/F0Text-CXHuzMbj.js +14 -0
- package/dist/F0VideoPlayer-5bnm6ryg.js +1 -0
- package/dist/{F0VideoPlayer-wTc25_qN.js → F0VideoPlayer-BkRdc58E.js} +303 -303
- package/dist/{HtmlViewer-Uxb8n2vn.js → HtmlViewer-qkAWMkJy.js} +3 -3
- package/dist/{Map-95w5slTZ.js → Map-CZcZoNEa.js} +29 -28
- package/dist/{PdfThumbnail-BYrhsyMw.js → PdfThumbnail-RTw1aKm_.js} +1 -1
- package/dist/{PdfViewer-DUxhQr-O.js → PdfViewer-m56GqoJt.js} +2 -2
- package/dist/{SheetViewer-C9Rbh_xJ.js → SheetViewer-C80n4nta.js} +2 -2
- package/dist/{TextViewer-DP9lYxAB.js → TextViewer-BINEouL8.js} +1 -1
- package/dist/ai.d.ts +2 -2
- package/dist/ai.js +3 -3
- package/dist/component-status.js +1 -1
- package/dist/experimental.d.ts +2 -2
- package/dist/experimental.js +5072 -5152
- package/dist/{exports-cxvNeHfV.d.ts → exports-BGemf1WM.d.ts} +13 -11
- package/dist/f0.d.ts +6 -6
- package/dist/f0.js +382 -381
- package/dist/{highlight-Bjt-wXg6.js → highlight-BNASV9vz.js} +6 -6
- package/dist/{index-DF8ubeg6.d.ts → index-BkCnaiJG.d.ts} +326 -10
- package/dist/localized-CnKvEJya.js +73 -0
- package/dist/{maplibre-tJ3UolSF.js → maplibre-DTAAiC-N.js} +1 -1
- package/dist/{pdfWorker-BBnYtb1A.js → pdfWorker-D16_euGm.js} +1 -1
- package/dist/{types-oJKIDe-E.d.ts → types-C2gKTwyT.d.ts} +2 -300
- package/package.json +1 -1
- package/dist/F0AudioPlayer-Cd9nIQX5.js +0 -2
- package/dist/F0AudioPlayer-vRJmmSpp.js +0 -1175
- package/dist/F0VideoPlayer-DUw-DouS.js +0 -1
- package/dist/localized-BrUgGMzm.js +0 -46
|
@@ -1,1175 +0,0 @@
|
|
|
1
|
-
import { a as e, r as t } from "./i18n-provider-Bdgo-LeP.js";
|
|
2
|
-
import { n } from "./skeleton-AC0Fb8zj.js";
|
|
3
|
-
import { L as r, R as i } from "./tooltip-BX4dSfeL.js";
|
|
4
|
-
import { U as a, h as o, t as s } from "./F0Button-d91IgOnc.js";
|
|
5
|
-
import { Co as c, Ls as l, So as u, Va as d } from "./F0CanvasPanel-D1QmpvzX.js";
|
|
6
|
-
import { o as f, t as p } from "./F0Icon-DmCBV0gK.js";
|
|
7
|
-
import { t as m } from "./Check-DAp9gCRh.js";
|
|
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 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
|
-
import * as N from "react";
|
|
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
|
-
//#region src/blocks/F0AudioPlayer/utils.ts
|
|
17
|
-
var le = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWith("data-"))), W = (e) => {
|
|
18
|
-
(!Number.isFinite(e) || e < 0) && (e = 0);
|
|
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
|
-
return n > 0 ? `${n}:${a(r)}:${a(i)}` : `${r}:${a(i)}`;
|
|
21
|
-
}, ue = (e) => e.map((e, t) => ({
|
|
22
|
-
start: e.startTime,
|
|
23
|
-
cueIndex: t
|
|
24
|
-
})).filter((e) => typeof e.start == "number" && Number.isFinite(e.start)).sort((e, t) => e.start - t.start), de = (e, t) => {
|
|
25
|
-
let n = 0, r = e.length - 1, i = -1;
|
|
26
|
-
for (; n <= r;) {
|
|
27
|
-
let a = n + r >> 1, o = e[a];
|
|
28
|
-
if (o === void 0) break;
|
|
29
|
-
o.start <= t ? (i = o.cueIndex, n = a + 1) : r = a - 1;
|
|
30
|
-
}
|
|
31
|
-
return i;
|
|
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([
|
|
94
|
-
"captions",
|
|
95
|
-
"subtitles",
|
|
96
|
-
"descriptions",
|
|
97
|
-
"metadata"
|
|
98
|
-
]), fe = (e) => K.has(e), q = (e, t) => {
|
|
99
|
-
let n = e.querySelectorAll("track");
|
|
100
|
-
for (let e of Array.from(n)) if (e.track === t) return !1;
|
|
101
|
-
return !0;
|
|
102
|
-
}, pe = (e) => {
|
|
103
|
-
let t = e.cues;
|
|
104
|
-
if (!t || t.length === 0) return "";
|
|
105
|
-
let n = [];
|
|
106
|
-
for (let e of Array.from(t)) {
|
|
107
|
-
let t = e.text;
|
|
108
|
-
typeof t == "string" && t.trim() && n.push(t.trim());
|
|
109
|
-
}
|
|
110
|
-
return n.join("\n");
|
|
111
|
-
}, me = (e, t, n) => {
|
|
112
|
-
let [r, i] = B();
|
|
113
|
-
return L(() => {
|
|
114
|
-
if (!n) {
|
|
115
|
-
i(void 0);
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
let t = e.current;
|
|
119
|
-
if (!t) return;
|
|
120
|
-
let r = t.textTracks, a = () => {
|
|
121
|
-
let e = Array.from(r).filter((e) => fe(e.kind));
|
|
122
|
-
e.sort((e, n) => Number(q(t, n)) - Number(q(t, e)));
|
|
123
|
-
for (let t of e) {
|
|
124
|
-
t.mode === "disabled" && (t.mode = "hidden");
|
|
125
|
-
let e = pe(t);
|
|
126
|
-
if (e) {
|
|
127
|
-
i(e);
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
a();
|
|
133
|
-
let o = [], s = (e) => {
|
|
134
|
-
if (typeof e.addEventListener != "function") return;
|
|
135
|
-
let t = () => a();
|
|
136
|
-
e.addEventListener("cuechange", t), o.push(() => e.removeEventListener("cuechange", t));
|
|
137
|
-
};
|
|
138
|
-
Array.from(r).forEach(s);
|
|
139
|
-
let c = (e) => {
|
|
140
|
-
e.track && s(e.track), a();
|
|
141
|
-
}, l = typeof r.addEventListener == "function";
|
|
142
|
-
return l && r.addEventListener("addtrack", c), () => {
|
|
143
|
-
l && r.removeEventListener("addtrack", c), o.forEach((e) => e());
|
|
144
|
-
};
|
|
145
|
-
}, [
|
|
146
|
-
e,
|
|
147
|
-
n,
|
|
148
|
-
t
|
|
149
|
-
]), r;
|
|
150
|
-
}, he = ["PageUp", "PageDown"], J = [
|
|
151
|
-
"ArrowUp",
|
|
152
|
-
"ArrowDown",
|
|
153
|
-
"ArrowLeft",
|
|
154
|
-
"ArrowRight"
|
|
155
|
-
], Y = {
|
|
156
|
-
"from-left": [
|
|
157
|
-
"Home",
|
|
158
|
-
"PageDown",
|
|
159
|
-
"ArrowDown",
|
|
160
|
-
"ArrowLeft"
|
|
161
|
-
],
|
|
162
|
-
"from-right": [
|
|
163
|
-
"Home",
|
|
164
|
-
"PageDown",
|
|
165
|
-
"ArrowDown",
|
|
166
|
-
"ArrowRight"
|
|
167
|
-
],
|
|
168
|
-
"from-bottom": [
|
|
169
|
-
"Home",
|
|
170
|
-
"PageDown",
|
|
171
|
-
"ArrowDown",
|
|
172
|
-
"ArrowLeft"
|
|
173
|
-
],
|
|
174
|
-
"from-top": [
|
|
175
|
-
"Home",
|
|
176
|
-
"PageDown",
|
|
177
|
-
"ArrowUp",
|
|
178
|
-
"ArrowLeft"
|
|
179
|
-
]
|
|
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({
|
|
182
|
-
prop: u,
|
|
183
|
-
defaultProp: l,
|
|
184
|
-
onChange: (e) => {
|
|
185
|
-
[...g.current][v.current]?.focus(), d(e);
|
|
186
|
-
}
|
|
187
|
-
}), S = N.useRef(b);
|
|
188
|
-
function C(e) {
|
|
189
|
-
O(e, Re(b, e));
|
|
190
|
-
}
|
|
191
|
-
function w(e) {
|
|
192
|
-
O(e, v.current);
|
|
193
|
-
}
|
|
194
|
-
function E() {
|
|
195
|
-
let e = S.current[v.current];
|
|
196
|
-
b[v.current] !== e && f(b);
|
|
197
|
-
}
|
|
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]);
|
|
200
|
-
x((e = []) => {
|
|
201
|
-
let r = Fe(e, l, t);
|
|
202
|
-
if (Ve(r, c * a)) {
|
|
203
|
-
v.current = r.indexOf(l);
|
|
204
|
-
let t = String(r) !== String(e);
|
|
205
|
-
return t && n && f(r), t ? r : e;
|
|
206
|
-
}
|
|
207
|
-
return e;
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
return /* @__PURE__ */ H(ye, {
|
|
211
|
-
scope: e.__scopeSlider,
|
|
212
|
-
name: n,
|
|
213
|
-
disabled: s,
|
|
214
|
-
min: r,
|
|
215
|
-
max: i,
|
|
216
|
-
valueIndexToChangeRef: v,
|
|
217
|
-
thumbs: g.current,
|
|
218
|
-
values: b,
|
|
219
|
-
orientation: o,
|
|
220
|
-
form: m,
|
|
221
|
-
children: /* @__PURE__ */ H(ge.Provider, {
|
|
222
|
-
scope: e.__scopeSlider,
|
|
223
|
-
children: /* @__PURE__ */ H(ge.Slot, {
|
|
224
|
-
scope: e.__scopeSlider,
|
|
225
|
-
children: /* @__PURE__ */ H(y, {
|
|
226
|
-
"aria-disabled": s,
|
|
227
|
-
"data-disabled": s ? "" : void 0,
|
|
228
|
-
...h,
|
|
229
|
-
ref: t,
|
|
230
|
-
onPointerDown: D(h.onPointerDown, () => {
|
|
231
|
-
s || (S.current = b);
|
|
232
|
-
}),
|
|
233
|
-
min: r,
|
|
234
|
-
max: i,
|
|
235
|
-
inverted: p,
|
|
236
|
-
onSlideStart: s ? void 0 : C,
|
|
237
|
-
onSlideMove: s ? void 0 : w,
|
|
238
|
-
onSlideEnd: s ? void 0 : E,
|
|
239
|
-
onHomeKeyDown: () => !s && O(r, 0, { commit: !0 }),
|
|
240
|
-
onEndKeyDown: () => !s && O(i, b.length - 1, { commit: !0 }),
|
|
241
|
-
onStepKeyDown: ({ event: e, direction: t }) => {
|
|
242
|
-
if (!s) {
|
|
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 });
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
})
|
|
248
|
-
})
|
|
249
|
-
})
|
|
250
|
-
});
|
|
251
|
-
});
|
|
252
|
-
be.displayName = X;
|
|
253
|
-
var [xe, Se] = ve(X, {
|
|
254
|
-
startEdge: "left",
|
|
255
|
-
endEdge: "right",
|
|
256
|
-
size: "width",
|
|
257
|
-
direction: 1
|
|
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;
|
|
260
|
-
function v(e) {
|
|
261
|
-
let t = m.current || d.getBoundingClientRect(), i = He([0, t.width], _ ? [n, r] : [r, n]);
|
|
262
|
-
return m.current = t, i(e - t.left);
|
|
263
|
-
}
|
|
264
|
-
return /* @__PURE__ */ H(xe, {
|
|
265
|
-
scope: e.__scopeSlider,
|
|
266
|
-
startEdge: _ ? "left" : "right",
|
|
267
|
-
endEdge: _ ? "right" : "left",
|
|
268
|
-
direction: _ ? 1 : -1,
|
|
269
|
-
size: "width",
|
|
270
|
-
children: /* @__PURE__ */ H(Te, {
|
|
271
|
-
dir: h,
|
|
272
|
-
"data-orientation": "horizontal",
|
|
273
|
-
...u,
|
|
274
|
-
ref: p,
|
|
275
|
-
style: {
|
|
276
|
-
...u.style,
|
|
277
|
-
"--radix-slider-thumb-transform": "translateX(-50%)"
|
|
278
|
-
},
|
|
279
|
-
onSlideStart: (e) => {
|
|
280
|
-
let t = v(e.clientX);
|
|
281
|
-
o?.(t);
|
|
282
|
-
},
|
|
283
|
-
onSlideMove: (e) => {
|
|
284
|
-
let t = v(e.clientX);
|
|
285
|
-
s?.(t);
|
|
286
|
-
},
|
|
287
|
-
onSlideEnd: () => {
|
|
288
|
-
m.current = void 0, c?.();
|
|
289
|
-
},
|
|
290
|
-
onStepKeyDown: (e) => {
|
|
291
|
-
let t = Y[_ ? "from-left" : "from-right"].includes(e.key);
|
|
292
|
-
l?.({
|
|
293
|
-
event: e,
|
|
294
|
-
direction: t ? -1 : 1
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
})
|
|
298
|
-
});
|
|
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;
|
|
301
|
-
function m(e) {
|
|
302
|
-
let t = f.current || u.current.getBoundingClientRect(), i = He([0, t.height], p ? [r, n] : [n, r]);
|
|
303
|
-
return f.current = t, i(e - t.top);
|
|
304
|
-
}
|
|
305
|
-
return /* @__PURE__ */ H(xe, {
|
|
306
|
-
scope: e.__scopeSlider,
|
|
307
|
-
startEdge: p ? "bottom" : "top",
|
|
308
|
-
endEdge: p ? "top" : "bottom",
|
|
309
|
-
size: "height",
|
|
310
|
-
direction: p ? 1 : -1,
|
|
311
|
-
children: /* @__PURE__ */ H(Te, {
|
|
312
|
-
"data-orientation": "vertical",
|
|
313
|
-
...l,
|
|
314
|
-
ref: d,
|
|
315
|
-
style: {
|
|
316
|
-
...l.style,
|
|
317
|
-
"--radix-slider-thumb-transform": "translateY(50%)"
|
|
318
|
-
},
|
|
319
|
-
onSlideStart: (e) => {
|
|
320
|
-
let t = m(e.clientY);
|
|
321
|
-
a?.(t);
|
|
322
|
-
},
|
|
323
|
-
onSlideMove: (e) => {
|
|
324
|
-
let t = m(e.clientY);
|
|
325
|
-
o?.(t);
|
|
326
|
-
},
|
|
327
|
-
onSlideEnd: () => {
|
|
328
|
-
f.current = void 0, s?.();
|
|
329
|
-
},
|
|
330
|
-
onStepKeyDown: (e) => {
|
|
331
|
-
let t = Y[p ? "from-bottom" : "from-top"].includes(e.key);
|
|
332
|
-
c?.({
|
|
333
|
-
event: e,
|
|
334
|
-
direction: t ? -1 : 1
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
})
|
|
338
|
-
});
|
|
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, {
|
|
342
|
-
...l,
|
|
343
|
-
ref: t,
|
|
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());
|
|
346
|
-
}),
|
|
347
|
-
onPointerDown: D(e.onPointerDown, (e) => {
|
|
348
|
-
let t = e.target;
|
|
349
|
-
t.setPointerCapture(e.pointerId), e.preventDefault(), u.thumbs.has(t) ? t.focus() : r(e);
|
|
350
|
-
}),
|
|
351
|
-
onPointerMove: D(e.onPointerMove, (e) => {
|
|
352
|
-
e.target.hasPointerCapture(e.pointerId) && i(e);
|
|
353
|
-
}),
|
|
354
|
-
onPointerUp: D(e.onPointerUp, (e) => {
|
|
355
|
-
let t = e.target;
|
|
356
|
-
t.hasPointerCapture(e.pointerId) && (t.releasePointerCapture(e.pointerId), a(e));
|
|
357
|
-
})
|
|
358
|
-
});
|
|
359
|
-
}), Ee = "SliderTrack", De = N.forwardRef((e, t) => {
|
|
360
|
-
let { __scopeSlider: n, ...r } = e, i = $(Ee, n);
|
|
361
|
-
return /* @__PURE__ */ H(A.span, {
|
|
362
|
-
"data-disabled": i.disabled ? "" : void 0,
|
|
363
|
-
"data-orientation": i.orientation,
|
|
364
|
-
...r,
|
|
365
|
-
ref: t
|
|
366
|
-
});
|
|
367
|
-
});
|
|
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, {
|
|
372
|
-
"data-orientation": i.orientation,
|
|
373
|
-
"data-disabled": i.disabled ? "" : void 0,
|
|
374
|
-
...r,
|
|
375
|
-
ref: s,
|
|
376
|
-
style: {
|
|
377
|
-
...e.style,
|
|
378
|
-
[a.startEdge]: u + "%",
|
|
379
|
-
[a.endEdge]: d + "%"
|
|
380
|
-
}
|
|
381
|
-
});
|
|
382
|
-
});
|
|
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, {
|
|
387
|
-
...e,
|
|
388
|
-
ref: a,
|
|
389
|
-
index: o
|
|
390
|
-
});
|
|
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;
|
|
393
|
-
return N.useEffect(() => {
|
|
394
|
-
if (c) return o.thumbs.add(c), () => {
|
|
395
|
-
o.thumbs.delete(c);
|
|
396
|
-
};
|
|
397
|
-
}, [c, o.thumbs]), /* @__PURE__ */ U("span", {
|
|
398
|
-
style: {
|
|
399
|
-
transform: "var(--radix-slider-thumb-transform)",
|
|
400
|
-
position: "absolute",
|
|
401
|
-
[s.startEdge]: `calc(${m}% + ${_}px)`
|
|
402
|
-
},
|
|
403
|
-
children: [/* @__PURE__ */ H(ge.ItemSlot, {
|
|
404
|
-
scope: e.__scopeSlider,
|
|
405
|
-
children: /* @__PURE__ */ H(A.span, {
|
|
406
|
-
role: "slider",
|
|
407
|
-
"aria-label": e["aria-label"] || h,
|
|
408
|
-
"aria-valuemin": o.min,
|
|
409
|
-
"aria-valuenow": p,
|
|
410
|
-
"aria-valuemax": o.max,
|
|
411
|
-
"aria-orientation": o.orientation,
|
|
412
|
-
"data-orientation": o.orientation,
|
|
413
|
-
"data-disabled": o.disabled ? "" : void 0,
|
|
414
|
-
tabIndex: o.disabled ? void 0 : 0,
|
|
415
|
-
...a,
|
|
416
|
-
ref: u,
|
|
417
|
-
style: p === void 0 ? { display: "none" } : e.style,
|
|
418
|
-
onFocus: D(e.onFocus, () => {
|
|
419
|
-
o.valueIndexToChangeRef.current = r;
|
|
420
|
-
})
|
|
421
|
-
})
|
|
422
|
-
}), d && /* @__PURE__ */ H(Pe, {
|
|
423
|
-
name: i ?? (o.name ? o.name + (o.values.length > 1 ? "[]" : "") : void 0),
|
|
424
|
-
form: o.form,
|
|
425
|
-
value: p
|
|
426
|
-
}, r)]
|
|
427
|
-
});
|
|
428
|
-
});
|
|
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);
|
|
432
|
-
return N.useEffect(() => {
|
|
433
|
-
let e = i.current;
|
|
434
|
-
if (!e) return;
|
|
435
|
-
let n = window.HTMLInputElement.prototype, r = Object.getOwnPropertyDescriptor(n, "value").set;
|
|
436
|
-
if (o !== t && r) {
|
|
437
|
-
let n = new Event("input", { bubbles: !0 });
|
|
438
|
-
r.call(e, t), e.dispatchEvent(n);
|
|
439
|
-
}
|
|
440
|
-
}, [o, t]), /* @__PURE__ */ H(A.input, {
|
|
441
|
-
style: { display: "none" },
|
|
442
|
-
...n,
|
|
443
|
-
ref: a,
|
|
444
|
-
defaultValue: t
|
|
445
|
-
});
|
|
446
|
-
});
|
|
447
|
-
Pe.displayName = Ne;
|
|
448
|
-
function Fe(e = [], t, n) {
|
|
449
|
-
let r = [...e];
|
|
450
|
-
return r[n] = t, r.sort((e, t) => e - t);
|
|
451
|
-
}
|
|
452
|
-
function Ie(e, t, n) {
|
|
453
|
-
let r = 100 / (n - t) * (e - t);
|
|
454
|
-
return _(r, [0, 100]);
|
|
455
|
-
}
|
|
456
|
-
function Le(e, t) {
|
|
457
|
-
if (t > 2) return `Value ${e + 1} of ${t}`;
|
|
458
|
-
if (t === 2) return ["Minimum", "Maximum"][e];
|
|
459
|
-
}
|
|
460
|
-
function Re(e, t) {
|
|
461
|
-
if (e.length === 1) return 0;
|
|
462
|
-
let n = e.map((e) => Math.abs(e - t)), r = Math.min(...n);
|
|
463
|
-
return n.indexOf(r);
|
|
464
|
-
}
|
|
465
|
-
function ze(e, t, n) {
|
|
466
|
-
let r = e / 2;
|
|
467
|
-
return (r - He([0, 50], [0, r])(t) * n) * n;
|
|
468
|
-
}
|
|
469
|
-
function Be(e) {
|
|
470
|
-
return e.slice(0, -1).map((t, n) => e[n + 1] - t);
|
|
471
|
-
}
|
|
472
|
-
function Ve(e, t) {
|
|
473
|
-
if (t > 0) {
|
|
474
|
-
let n = Be(e);
|
|
475
|
-
return Math.min(...n) >= t;
|
|
476
|
-
}
|
|
477
|
-
return !0;
|
|
478
|
-
}
|
|
479
|
-
function He(e, t) {
|
|
480
|
-
return (n) => {
|
|
481
|
-
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
482
|
-
let r = (t[1] - t[0]) / (e[1] - e[0]);
|
|
483
|
-
return t[0] + r * (n - e[0]);
|
|
484
|
-
};
|
|
485
|
-
}
|
|
486
|
-
function Ue(e) {
|
|
487
|
-
return (String(e).split(".")[1] || "").length;
|
|
488
|
-
}
|
|
489
|
-
function We(e, t) {
|
|
490
|
-
let n = 10 ** t;
|
|
491
|
-
return Math.round(e * n) / n;
|
|
492
|
-
}
|
|
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(() => {
|
|
496
|
-
let e = g.current;
|
|
497
|
-
if (!e) return;
|
|
498
|
-
let t = () => v(e.clientWidth);
|
|
499
|
-
t();
|
|
500
|
-
let n = new ResizeObserver(t);
|
|
501
|
-
return n.observe(e), () => n.disconnect();
|
|
502
|
-
}, []);
|
|
503
|
-
let y = _ > 0 ? `${Math.round(_ * p / 100)}px` : `${p}%`, b = I((e) => {
|
|
504
|
-
let [t] = e;
|
|
505
|
-
t !== void 0 && u.current && l(t);
|
|
506
|
-
}, []), x = I((e) => {
|
|
507
|
-
let [t] = e;
|
|
508
|
-
t === void 0 || u.current || o(t);
|
|
509
|
-
}, [o]), S = I(() => {
|
|
510
|
-
u.current = !0;
|
|
511
|
-
}, []), C = I(() => {
|
|
512
|
-
u.current = !1, l(null);
|
|
513
|
-
}, []), w = I(() => {
|
|
514
|
-
u.current && (u.current = !1, l(null), c !== null && o(c));
|
|
515
|
-
}, [c, o]);
|
|
516
|
-
return /* @__PURE__ */ U(Ye, {
|
|
517
|
-
value: [f],
|
|
518
|
-
onValueChange: b,
|
|
519
|
-
onValueCommit: x,
|
|
520
|
-
onPointerDown: S,
|
|
521
|
-
onPointerCancel: C,
|
|
522
|
-
onLostPointerCapture: w,
|
|
523
|
-
min: 0,
|
|
524
|
-
max: d || 1,
|
|
525
|
-
step: 1,
|
|
526
|
-
disabled: h,
|
|
527
|
-
className: r("group relative flex w-full touch-none select-none items-center py-2", a && "opacity-50"),
|
|
528
|
-
children: [
|
|
529
|
-
/* @__PURE__ */ U(Xe, {
|
|
530
|
-
ref: g,
|
|
531
|
-
className: "relative h-2 grow overflow-hidden rounded bg-f1-background-tertiary",
|
|
532
|
-
children: [/* @__PURE__ */ H("span", {
|
|
533
|
-
"aria-hidden": !0,
|
|
534
|
-
className: "absolute h-full bg-f1-background-secondary",
|
|
535
|
-
style: { width: `${m}%` }
|
|
536
|
-
}), /* @__PURE__ */ H("span", {
|
|
537
|
-
"aria-hidden": !0,
|
|
538
|
-
className: "absolute h-full bg-f1-background-selected-bold",
|
|
539
|
-
style: { width: `${p}%` }
|
|
540
|
-
})]
|
|
541
|
-
}),
|
|
542
|
-
h ? null : /* @__PURE__ */ H("span", {
|
|
543
|
-
"aria-hidden": !0,
|
|
544
|
-
style: { left: y },
|
|
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")
|
|
546
|
-
}),
|
|
547
|
-
/* @__PURE__ */ H(Qe, {
|
|
548
|
-
"aria-label": s.audioPlayer.seek,
|
|
549
|
-
"aria-valuetext": s.t("audioPlayer.position", {
|
|
550
|
-
current: W(f),
|
|
551
|
-
total: W(d)
|
|
552
|
-
}),
|
|
553
|
-
className: "block size-3 opacity-0 focus-visible:outline-none"
|
|
554
|
-
})
|
|
555
|
-
]
|
|
556
|
-
});
|
|
557
|
-
};
|
|
558
|
-
//#endregion
|
|
559
|
-
//#region src/blocks/F0AudioPlayer/components/LanguageSelect.tsx
|
|
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, {
|
|
563
|
-
open: a,
|
|
564
|
-
onOpenChange: o,
|
|
565
|
-
children: [/* @__PURE__ */ H(C, {
|
|
566
|
-
asChild: !0,
|
|
567
|
-
children: /* @__PURE__ */ H(s, {
|
|
568
|
-
variant: "outline",
|
|
569
|
-
size: "sm",
|
|
570
|
-
label: l,
|
|
571
|
-
"aria-label": `${i}: ${l}`,
|
|
572
|
-
tooltip: i
|
|
573
|
-
})
|
|
574
|
-
}), /* @__PURE__ */ H(O, {
|
|
575
|
-
align: "end",
|
|
576
|
-
sideOffset: 4,
|
|
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"),
|
|
578
|
-
role: "menu",
|
|
579
|
-
"aria-label": i,
|
|
580
|
-
onKeyDown: (e) => {
|
|
581
|
-
let t = Array.from(e.currentTarget.querySelectorAll("[role=\"menuitemradio\"]"));
|
|
582
|
-
if (t.length === 0) return;
|
|
583
|
-
let n = t.indexOf(document.activeElement), r;
|
|
584
|
-
switch (e.key) {
|
|
585
|
-
case "ArrowDown":
|
|
586
|
-
r = n < 0 ? 0 : (n + 1) % t.length;
|
|
587
|
-
break;
|
|
588
|
-
case "ArrowUp":
|
|
589
|
-
r = n <= 0 ? t.length - 1 : n - 1;
|
|
590
|
-
break;
|
|
591
|
-
case "Home":
|
|
592
|
-
r = 0;
|
|
593
|
-
break;
|
|
594
|
-
case "End":
|
|
595
|
-
r = t.length - 1;
|
|
596
|
-
break;
|
|
597
|
-
default: return;
|
|
598
|
-
}
|
|
599
|
-
e.preventDefault(), t[r]?.focus();
|
|
600
|
-
},
|
|
601
|
-
children: t.map((t) => {
|
|
602
|
-
let i = t.locale === e;
|
|
603
|
-
return /* @__PURE__ */ U("button", {
|
|
604
|
-
type: "button",
|
|
605
|
-
role: "menuitemradio",
|
|
606
|
-
"aria-checked": i,
|
|
607
|
-
className: r("relative flex items-center rounded-xs py-1.5 pl-8 pr-3", "cursor-pointer border-none bg-transparent text-left text-sm font-medium", "text-f1-foreground transition-colors hover:bg-f1-background-secondary", "focus-visible:bg-f1-background-secondary focus-visible:outline-none", "[&_svg]:h-3.5 [&_svg]:w-3.5"),
|
|
608
|
-
onClick: () => {
|
|
609
|
-
n(t.locale), o(!1);
|
|
610
|
-
},
|
|
611
|
-
children: [i ? /* @__PURE__ */ H("span", {
|
|
612
|
-
className: "absolute left-2.5 inline-flex items-center",
|
|
613
|
-
children: /* @__PURE__ */ H(m, {})
|
|
614
|
-
}) : null, M(t)]
|
|
615
|
-
}, t.locale);
|
|
616
|
-
})
|
|
617
|
-
})]
|
|
618
|
-
});
|
|
619
|
-
}
|
|
620
|
-
//#endregion
|
|
621
|
-
//#region src/blocks/F0AudioPlayer/components/PlaybackTime.tsx
|
|
622
|
-
var tt = f({
|
|
623
|
-
base: "shrink-0 font-medium tabular-nums text-f1-foreground-secondary",
|
|
624
|
-
variants: { size: {
|
|
625
|
-
sm: "text-xs",
|
|
626
|
-
md: "text-sm"
|
|
627
|
-
} }
|
|
628
|
-
}), nt = ({ currentTime: e, duration: t, size: n = "md" }) => /* @__PURE__ */ U("span", {
|
|
629
|
-
className: tt({ size: n }),
|
|
630
|
-
children: [
|
|
631
|
-
W(e),
|
|
632
|
-
" / ",
|
|
633
|
-
W(t)
|
|
634
|
-
]
|
|
635
|
-
}), rt = ({ isPlaying: e, disabled: n, size: a = "md", onToggle: o }) => {
|
|
636
|
-
let s = t(), l = e ? c : u;
|
|
637
|
-
return /* @__PURE__ */ H("button", {
|
|
638
|
-
type: "button",
|
|
639
|
-
"aria-label": e ? s.audioPlayer.pause : s.audioPlayer.play,
|
|
640
|
-
disabled: n,
|
|
641
|
-
onClick: o,
|
|
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()),
|
|
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
|
|
650
|
-
});
|
|
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, {
|
|
679
|
-
asChild: !0,
|
|
680
|
-
children: /* @__PURE__ */ H(s, {
|
|
681
|
-
variant: "ghost",
|
|
682
|
-
size: "sm",
|
|
683
|
-
icon: l,
|
|
684
|
-
label: f.audioPlayer.options,
|
|
685
|
-
hideLabel: !0,
|
|
686
|
-
disabled: a
|
|
687
|
-
})
|
|
688
|
-
}), /* @__PURE__ */ U(v, {
|
|
689
|
-
align: "end",
|
|
690
|
-
className: "flex min-w-44 flex-col gap-0.5",
|
|
691
|
-
children: [
|
|
692
|
-
m ? /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(S, {
|
|
693
|
-
className: "text-f1-foreground-secondary",
|
|
694
|
-
children: f.audioPlayer.playbackSpeed
|
|
695
|
-
}), n.map((t) => {
|
|
696
|
-
let n = t === e;
|
|
697
|
-
return /* @__PURE__ */ U(x, {
|
|
698
|
-
onSelect: () => i(t),
|
|
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"),
|
|
700
|
-
children: [/* @__PURE__ */ U("span", {
|
|
701
|
-
className: "relative",
|
|
702
|
-
children: [t, "x"]
|
|
703
|
-
}), n ? /* @__PURE__ */ H("span", {
|
|
704
|
-
className: "relative flex text-f1-icon-selected",
|
|
705
|
-
children: /* @__PURE__ */ H(p, {
|
|
706
|
-
icon: h,
|
|
707
|
-
size: "md"
|
|
708
|
-
})
|
|
709
|
-
}) : null]
|
|
710
|
-
}, t);
|
|
711
|
-
})] }) : null,
|
|
712
|
-
g ? /* @__PURE__ */ U(V, { children: [
|
|
713
|
-
m ? /* @__PURE__ */ H(b, {}) : null,
|
|
714
|
-
/* @__PURE__ */ H(S, {
|
|
715
|
-
className: "text-f1-foreground-secondary",
|
|
716
|
-
children: f.audioPlayer.audio
|
|
717
|
-
}),
|
|
718
|
-
c.map((e) => {
|
|
719
|
-
let t = e.locale === u;
|
|
720
|
-
return /* @__PURE__ */ U(x, {
|
|
721
|
-
onSelect: () => d?.(e.locale),
|
|
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"),
|
|
723
|
-
children: [/* @__PURE__ */ H("span", {
|
|
724
|
-
className: "relative",
|
|
725
|
-
children: M(e)
|
|
726
|
-
}), t ? /* @__PURE__ */ H("span", {
|
|
727
|
-
className: "relative flex text-f1-icon-selected",
|
|
728
|
-
children: /* @__PURE__ */ H(p, {
|
|
729
|
-
icon: h,
|
|
730
|
-
size: "md"
|
|
731
|
-
})
|
|
732
|
-
}) : null]
|
|
733
|
-
}, e.locale);
|
|
734
|
-
})
|
|
735
|
-
] }) : null,
|
|
736
|
-
o.length > 0 ? /* @__PURE__ */ U(V, { children: [m || g ? /* @__PURE__ */ H(b, {}) : null, o.map((e) => /* @__PURE__ */ U(x, {
|
|
737
|
-
onSelect: () => e.onClick(),
|
|
738
|
-
className: r("gap-2 px-3 text-sm", e.critical ? "text-f1-foreground-critical" : "text-f1-foreground"),
|
|
739
|
-
children: [e.icon ? /* @__PURE__ */ H("span", {
|
|
740
|
-
className: r("relative flex", e.critical ? "text-f1-icon-critical" : "text-f1-icon"),
|
|
741
|
-
children: /* @__PURE__ */ H(p, {
|
|
742
|
-
icon: e.icon,
|
|
743
|
-
size: "md"
|
|
744
|
-
})
|
|
745
|
-
}) : null, /* @__PURE__ */ H("span", {
|
|
746
|
-
className: "relative",
|
|
747
|
-
children: e.label
|
|
748
|
-
})]
|
|
749
|
-
}, e.label))] }) : null
|
|
750
|
-
]
|
|
751
|
-
})] });
|
|
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) => {
|
|
754
|
-
s?.current && (s.current[n] = e);
|
|
755
|
-
}, [s, n]), p = I(() => {
|
|
756
|
-
l !== void 0 && o?.(l);
|
|
757
|
-
}, [o, l]);
|
|
758
|
-
return /* @__PURE__ */ H("li", {
|
|
759
|
-
ref: f,
|
|
760
|
-
children: u ? /* @__PURE__ */ H("button", {
|
|
761
|
-
type: "button",
|
|
762
|
-
onClick: p,
|
|
763
|
-
"aria-current": a || void 0,
|
|
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, {
|
|
767
|
-
as: "span",
|
|
768
|
-
variant: "body",
|
|
769
|
-
content: e.text
|
|
770
|
-
})
|
|
771
|
-
}) : /* @__PURE__ */ H("div", {
|
|
772
|
-
className: st(a),
|
|
773
|
-
children: /* @__PURE__ */ H(d, {
|
|
774
|
-
as: "span",
|
|
775
|
-
variant: "body",
|
|
776
|
-
content: e.text
|
|
777
|
-
})
|
|
778
|
-
})
|
|
779
|
-
});
|
|
780
|
-
}), lt = F(function({ cues: e, activeIndex: n, onSeek: r, cueRefs: i }) {
|
|
781
|
-
let a = t();
|
|
782
|
-
return /* @__PURE__ */ U(V, { children: [r ? /* @__PURE__ */ H("p", {
|
|
783
|
-
className: "sr-only",
|
|
784
|
-
children: a.audioPlayer.transcriptHint
|
|
785
|
-
}) : null, /* @__PURE__ */ H("ol", {
|
|
786
|
-
className: "flex list-none flex-col gap-1 p-0",
|
|
787
|
-
children: e.map((e, t) => /* @__PURE__ */ H(ct, {
|
|
788
|
-
cue: e,
|
|
789
|
-
index: t,
|
|
790
|
-
isActive: t === n,
|
|
791
|
-
onSeek: r,
|
|
792
|
-
cueRefs: i
|
|
793
|
-
}, t))
|
|
794
|
-
})] });
|
|
795
|
-
});
|
|
796
|
-
//#endregion
|
|
797
|
-
//#region src/blocks/F0AudioPlayer/useAudioLanguage.ts
|
|
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);
|
|
800
|
-
return {
|
|
801
|
-
languages: n,
|
|
802
|
-
activeLocale: a,
|
|
803
|
-
resolvedSrc: ie(e, a) ?? "",
|
|
804
|
-
setLocale: i
|
|
805
|
-
};
|
|
806
|
-
}
|
|
807
|
-
function dt(e) {
|
|
808
|
-
if (!e) return;
|
|
809
|
-
let t = e.currentTime, n = !e.paused, r = () => {
|
|
810
|
-
e.currentTime = t, n && e.play().catch(() => {}), e.removeEventListener("loadedmetadata", r);
|
|
811
|
-
};
|
|
812
|
-
e.addEventListener("loadedmetadata", r);
|
|
813
|
-
}
|
|
814
|
-
//#endregion
|
|
815
|
-
//#region src/blocks/F0AudioPlayer/usePlayerController.ts
|
|
816
|
-
var ft = (e) => {
|
|
817
|
-
let { src: t, duration: n, playing: r, onPlayingChange: i, playbackRates: a = [
|
|
818
|
-
1,
|
|
819
|
-
1.5,
|
|
820
|
-
2
|
|
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 () => {
|
|
822
|
-
if (f && !b.current) {
|
|
823
|
-
b.current = !0;
|
|
824
|
-
try {
|
|
825
|
-
g(await f());
|
|
826
|
-
} catch {
|
|
827
|
-
x.current = !1, d?.(null);
|
|
828
|
-
} finally {
|
|
829
|
-
b.current = !1;
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
}, [f, d]), w = G(m, {
|
|
833
|
-
onPlay: I(() => {
|
|
834
|
-
S.current = !1, o?.();
|
|
835
|
-
}, [o]),
|
|
836
|
-
onPause: s,
|
|
837
|
-
onSeek: c,
|
|
838
|
-
onTimeUpdate: l,
|
|
839
|
-
onEnded: u,
|
|
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) => {
|
|
848
|
-
let t = m.current, n = Math.max(e, 0);
|
|
849
|
-
t && h && t.readyState >= t.HAVE_METADATA ? T(n) : (_.current = n, y(n));
|
|
850
|
-
}, [T, h]);
|
|
851
|
-
L(() => {
|
|
852
|
-
let e = m.current;
|
|
853
|
-
if (!e) return;
|
|
854
|
-
let t = () => {
|
|
855
|
-
let e = _.current;
|
|
856
|
-
e !== null && (_.current = null, y(null), T(e));
|
|
857
|
-
};
|
|
858
|
-
return e.addEventListener("loadedmetadata", t), () => e.removeEventListener("loadedmetadata", t);
|
|
859
|
-
}, [T]), L(() => {
|
|
860
|
-
p !== void 0 && g(p);
|
|
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();
|
|
866
|
-
}, [
|
|
867
|
-
w,
|
|
868
|
-
h,
|
|
869
|
-
f,
|
|
870
|
-
C
|
|
871
|
-
]);
|
|
872
|
-
L(() => {
|
|
873
|
-
r !== void 0 && (r && !w.isPlaying ? !h && f ? (x.current = !0, C()) : w.play() : !r && w.isPlaying && w.pause());
|
|
874
|
-
}, [
|
|
875
|
-
r,
|
|
876
|
-
w,
|
|
877
|
-
h,
|
|
878
|
-
f,
|
|
879
|
-
C
|
|
880
|
-
]);
|
|
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;
|
|
886
|
-
return {
|
|
887
|
-
audioRef: m,
|
|
888
|
-
currentSrc: h,
|
|
889
|
-
pendingTime: v,
|
|
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,
|
|
900
|
-
playbackRates: a
|
|
901
|
-
};
|
|
902
|
-
}, pt = /* @__PURE__ */ new Set([
|
|
903
|
-
"ArrowUp",
|
|
904
|
-
"ArrowDown",
|
|
905
|
-
"PageUp",
|
|
906
|
-
"PageDown",
|
|
907
|
-
"Home",
|
|
908
|
-
"End",
|
|
909
|
-
" "
|
|
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({
|
|
912
|
-
...e,
|
|
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,
|
|
918
|
-
G,
|
|
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;
|
|
925
|
-
if (!e) return;
|
|
926
|
-
let t = () => {
|
|
927
|
-
J.current = !0;
|
|
928
|
-
}, n = (e) => {
|
|
929
|
-
pt.has(e.key) && t();
|
|
930
|
-
}, r = (n) => {
|
|
931
|
-
e.contains(n.target) || t();
|
|
932
|
-
}, i = e.parentElement;
|
|
933
|
-
return e.addEventListener("wheel", t, { passive: !0 }), e.addEventListener("touchmove", t, { passive: !0 }), e.addEventListener("keydown", n), i?.addEventListener("pointerdown", r), () => {
|
|
934
|
-
e.removeEventListener("wheel", t), e.removeEventListener("touchmove", t), e.removeEventListener("keydown", n), i?.removeEventListener("pointerdown", r);
|
|
935
|
-
};
|
|
936
|
-
}, [W]);
|
|
937
|
-
let X = R(() => {
|
|
938
|
-
if (ee) return y ?? [];
|
|
939
|
-
let e = [];
|
|
940
|
-
return se && e.push({
|
|
941
|
-
value: "summary",
|
|
942
|
-
label: w.audioPlayer.summary,
|
|
943
|
-
content: /* @__PURE__ */ H("p", {
|
|
944
|
-
className: "whitespace-pre-line",
|
|
945
|
-
children: se
|
|
946
|
-
})
|
|
947
|
-
}), W && e.push({
|
|
948
|
-
value: "transcription",
|
|
949
|
-
label: w.audioPlayer.transcription,
|
|
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", {
|
|
956
|
-
className: "whitespace-pre-line",
|
|
957
|
-
children: V
|
|
958
|
-
})
|
|
959
|
-
}), e;
|
|
960
|
-
}, [
|
|
961
|
-
ee,
|
|
962
|
-
y,
|
|
963
|
-
se,
|
|
964
|
-
W,
|
|
965
|
-
F,
|
|
966
|
-
V,
|
|
967
|
-
q,
|
|
968
|
-
K,
|
|
969
|
-
Y,
|
|
970
|
-
w.audioPlayer.summary,
|
|
971
|
-
w.audioPlayer.transcription
|
|
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({
|
|
973
|
-
prop: b,
|
|
974
|
-
defaultProp: x,
|
|
975
|
-
onChange: S
|
|
976
|
-
});
|
|
977
|
-
L(() => {
|
|
978
|
-
if (!Q || q < 0 || J.current) return;
|
|
979
|
-
let e = pe.current, t = he.current[q];
|
|
980
|
-
if (!e || !t) return;
|
|
981
|
-
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = r.top - n.top, a = r.bottom - n.bottom;
|
|
982
|
-
i >= 0 && a <= 0 || e.scrollTo({
|
|
983
|
-
top: e.scrollTop + (i < 0 ? i : a),
|
|
984
|
-
behavior: k ? "auto" : "smooth"
|
|
985
|
-
});
|
|
986
|
-
}, [
|
|
987
|
-
q,
|
|
988
|
-
Q,
|
|
989
|
-
k
|
|
990
|
-
]);
|
|
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", {
|
|
993
|
-
ref: n,
|
|
994
|
-
role: "group",
|
|
995
|
-
"aria-label": h ?? i,
|
|
996
|
-
"data-audio-transcription": ge,
|
|
997
|
-
className: r("flex flex-col gap-2.5 rounded-2xl border border-solid border-f1-border-secondary bg-f1-background p-3", u),
|
|
998
|
-
...O,
|
|
999
|
-
children: [
|
|
1000
|
-
/* @__PURE__ */ H("audio", {
|
|
1001
|
-
ref: D.audioRef,
|
|
1002
|
-
src: D.currentSrc,
|
|
1003
|
-
preload: f ?? (typeof E.resolvedSrc == "function" ? "none" : "metadata"),
|
|
1004
|
-
autoPlay: p
|
|
1005
|
-
}),
|
|
1006
|
-
/* @__PURE__ */ U("div", {
|
|
1007
|
-
className: "flex items-start justify-between gap-2",
|
|
1008
|
-
children: [/* @__PURE__ */ U("div", {
|
|
1009
|
-
className: "flex min-w-0 flex-1 items-center gap-2.5",
|
|
1010
|
-
children: [/* @__PURE__ */ H(rt, {
|
|
1011
|
-
isPlaying: D.isPlaying,
|
|
1012
|
-
disabled: m,
|
|
1013
|
-
size: g,
|
|
1014
|
-
onToggle: D.toggle
|
|
1015
|
-
}), /* @__PURE__ */ U("div", {
|
|
1016
|
-
className: "flex min-w-0 flex-col",
|
|
1017
|
-
children: [/* @__PURE__ */ H("span", {
|
|
1018
|
-
className: "truncate text-base font-medium text-f1-foreground",
|
|
1019
|
-
children: i
|
|
1020
|
-
}), c ? /* @__PURE__ */ H("span", {
|
|
1021
|
-
className: "truncate text-base text-f1-foreground-secondary",
|
|
1022
|
-
children: c
|
|
1023
|
-
}) : null]
|
|
1024
|
-
})]
|
|
1025
|
-
}), _e || D.playbackRates.length > 0 || E.languages.length > 1 || l ? /* @__PURE__ */ U("div", {
|
|
1026
|
-
className: "flex shrink-0 items-center gap-2",
|
|
1027
|
-
children: [_e ? /* @__PURE__ */ H(s, {
|
|
1028
|
-
variant: "outline",
|
|
1029
|
-
size: "sm",
|
|
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,
|
|
1037
|
-
disabled: m,
|
|
1038
|
-
extraItems: l,
|
|
1039
|
-
audioLanguages: E.languages,
|
|
1040
|
-
audioLanguage: E.activeLocale,
|
|
1041
|
-
onAudioLanguageChange: A
|
|
1042
|
-
}) : null]
|
|
1043
|
-
}) : null]
|
|
1044
|
-
}),
|
|
1045
|
-
/* @__PURE__ */ U("div", {
|
|
1046
|
-
className: "flex w-full items-center gap-2",
|
|
1047
|
-
children: [/* @__PURE__ */ H($e, {
|
|
1048
|
-
currentTime: D.currentTime,
|
|
1049
|
-
duration: D.duration,
|
|
1050
|
-
buffered: D.buffered,
|
|
1051
|
-
disabled: m,
|
|
1052
|
-
onSeek: Y
|
|
1053
|
-
}), /* @__PURE__ */ H(nt, {
|
|
1054
|
-
currentTime: D.currentTime,
|
|
1055
|
-
duration: D.duration,
|
|
1056
|
-
size: g
|
|
1057
|
-
})]
|
|
1058
|
-
}),
|
|
1059
|
-
_e ? /* @__PURE__ */ U(a.div, {
|
|
1060
|
-
role: "region",
|
|
1061
|
-
"aria-label": Z ? Z.label : w.audioPlayer.details,
|
|
1062
|
-
initial: !1,
|
|
1063
|
-
animate: {
|
|
1064
|
-
height: Q ? "auto" : 0,
|
|
1065
|
-
marginTop: Q ? 0 : "-0.625rem",
|
|
1066
|
-
opacity: +!!Q,
|
|
1067
|
-
visibility: Q ? "visible" : "hidden"
|
|
1068
|
-
},
|
|
1069
|
-
transition: {
|
|
1070
|
-
duration: k ? 0 : .15,
|
|
1071
|
-
ease: [
|
|
1072
|
-
.165,
|
|
1073
|
-
.84,
|
|
1074
|
-
.44,
|
|
1075
|
-
1
|
|
1076
|
-
]
|
|
1077
|
-
},
|
|
1078
|
-
className: "overflow-hidden",
|
|
1079
|
-
children: [
|
|
1080
|
-
j.length > 1 && M ? /* @__PURE__ */ H("div", {
|
|
1081
|
-
className: "flex justify-end pb-2.5",
|
|
1082
|
-
children: /* @__PURE__ */ H(et, {
|
|
1083
|
-
value: M,
|
|
1084
|
-
options: j,
|
|
1085
|
-
onChange: ne,
|
|
1086
|
-
kind: w.audioPlayer.language
|
|
1087
|
-
})
|
|
1088
|
-
}) : null,
|
|
1089
|
-
Z ? null : /* @__PURE__ */ H(at, {
|
|
1090
|
-
fullWidth: !0,
|
|
1091
|
-
ariaLabel: w.audioPlayer.details,
|
|
1092
|
-
value: xe,
|
|
1093
|
-
onChange: be,
|
|
1094
|
-
items: X.map((e) => ({
|
|
1095
|
-
value: e.value,
|
|
1096
|
-
label: e.label
|
|
1097
|
-
}))
|
|
1098
|
-
}),
|
|
1099
|
-
/* @__PURE__ */ H("div", {
|
|
1100
|
-
className: Z ? void 0 : "pt-2.5",
|
|
1101
|
-
children: /* @__PURE__ */ H(re, {
|
|
1102
|
-
viewportRef: pe,
|
|
1103
|
-
style: { "--audio-details-max-h": `${C}px` },
|
|
1104
|
-
className: "[&_[data-scroll-container]]:max-h-[var(--audio-details-max-h)]",
|
|
1105
|
-
children: /* @__PURE__ */ H("div", {
|
|
1106
|
-
className: "break-words pr-1 text-base text-f1-foreground",
|
|
1107
|
-
children: Se
|
|
1108
|
-
})
|
|
1109
|
-
})
|
|
1110
|
-
})
|
|
1111
|
-
]
|
|
1112
|
-
}) : null
|
|
1113
|
-
]
|
|
1114
|
-
});
|
|
1115
|
-
});
|
|
1116
|
-
mt.displayName = "F0AudioPlayerCard";
|
|
1117
|
-
//#endregion
|
|
1118
|
-
//#region src/blocks/F0AudioPlayer/F0AudioPlayer.tsx
|
|
1119
|
-
var ht = f({
|
|
1120
|
-
base: "flex w-full items-center",
|
|
1121
|
-
variants: { size: {
|
|
1122
|
-
sm: "gap-2",
|
|
1123
|
-
md: "gap-3"
|
|
1124
|
-
} }
|
|
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({
|
|
1127
|
-
...e,
|
|
1128
|
-
src: p.resolvedSrc
|
|
1129
|
-
}), h = le(e), g = (e) => {
|
|
1130
|
-
dt(m.audioRef.current), p.setLocale(e);
|
|
1131
|
-
};
|
|
1132
|
-
return /* @__PURE__ */ U("div", {
|
|
1133
|
-
ref: n,
|
|
1134
|
-
role: "group",
|
|
1135
|
-
"aria-label": c ?? f.audioPlayer.label,
|
|
1136
|
-
className: r(ht({ size: l }), d),
|
|
1137
|
-
...h,
|
|
1138
|
-
children: [
|
|
1139
|
-
/* @__PURE__ */ H("audio", {
|
|
1140
|
-
ref: m.audioRef,
|
|
1141
|
-
src: m.currentSrc,
|
|
1142
|
-
preload: a ?? (typeof p.resolvedSrc == "function" ? "none" : "metadata"),
|
|
1143
|
-
autoPlay: o
|
|
1144
|
-
}),
|
|
1145
|
-
/* @__PURE__ */ H(rt, {
|
|
1146
|
-
isPlaying: m.isPlaying,
|
|
1147
|
-
disabled: s,
|
|
1148
|
-
size: l,
|
|
1149
|
-
onToggle: m.toggle
|
|
1150
|
-
}),
|
|
1151
|
-
/* @__PURE__ */ H($e, {
|
|
1152
|
-
currentTime: m.currentTime,
|
|
1153
|
-
duration: m.duration,
|
|
1154
|
-
buffered: m.buffered,
|
|
1155
|
-
disabled: s,
|
|
1156
|
-
onSeek: m.seek
|
|
1157
|
-
}),
|
|
1158
|
-
/* @__PURE__ */ H(nt, {
|
|
1159
|
-
currentTime: m.currentTime,
|
|
1160
|
-
duration: m.duration,
|
|
1161
|
-
size: l
|
|
1162
|
-
}),
|
|
1163
|
-
p.languages.length > 1 && p.activeLocale ? /* @__PURE__ */ H(et, {
|
|
1164
|
-
value: p.activeLocale,
|
|
1165
|
-
options: p.languages,
|
|
1166
|
-
onChange: g,
|
|
1167
|
-
kind: f.audioPlayer.audio
|
|
1168
|
-
}) : null
|
|
1169
|
-
]
|
|
1170
|
-
});
|
|
1171
|
-
});
|
|
1172
|
-
gt.displayName = "F0AudioPlayer";
|
|
1173
|
-
var _t = n("F0AudioPlayer", e(gt)), vt = n("F0AudioPlayerCard", e(mt));
|
|
1174
|
-
//#endregion
|
|
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 };
|