@vocalstack/player 0.1.0-alpha.46 → 0.1.0-alpha.47
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/core/sites.d.ts +1 -1
- package/dist/index.js +231 -213
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -86,7 +86,7 @@ function ao({ size: t = 12 }) {
|
|
|
86
86
|
/* @__PURE__ */ i("rect", { x: "13.75", y: "5", width: "3.75", height: "14", rx: "1.2" })
|
|
87
87
|
] });
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function Bn({ dark: t, height: e = 20, link: n = !0 }) {
|
|
90
90
|
const r = /* @__PURE__ */ i("img", { src: t ? eo : to, alt: "VocalStack", decoding: "sync", style: { height: e, width: "auto", display: "block" } });
|
|
91
91
|
return n ? /* @__PURE__ */ i("a", { href: Si, style: { display: "block" }, children: r }) : r;
|
|
92
92
|
}
|
|
@@ -1001,7 +1001,7 @@ function Rr({ open: t, onClose: e, value: n, onSelect: r, languages: s, searchPl
|
|
|
1001
1001
|
}, [s, h, l]), b = ze(
|
|
1002
1002
|
() => h ? [] : c.map((A) => m.find((w) => w.code === A)).filter((A) => !!A).sort((A, w) => A.label.localeCompare(w.label)),
|
|
1003
1003
|
[c, m, h]
|
|
1004
|
-
), C = ze(() => b.length ? m.filter((A) => !b.some((w) => w.code === A.code)) : m, [m, b]), D = p || h ? C.length : 12,
|
|
1004
|
+
), C = ze(() => b.length ? m.filter((A) => !b.some((w) => w.code === A.code)) : m, [m, b]), D = p || h ? C.length : 12, V = C, Y = C.length - Math.min(D, C.length), ee = (A, w = !1, _ = !1) => {
|
|
1005
1005
|
const O = !!u && !A.voice;
|
|
1006
1006
|
return /* @__PURE__ */ g(
|
|
1007
1007
|
"button",
|
|
@@ -1054,7 +1054,7 @@ function Rr({ open: t, onClose: e, value: n, onSelect: r, languages: s, searchPl
|
|
|
1054
1054
|
b.map((A) => ee(A, !0)),
|
|
1055
1055
|
/* @__PURE__ */ i("div", { className: "vs-picker__rule" })
|
|
1056
1056
|
] }),
|
|
1057
|
-
|
|
1057
|
+
V.map((A, w) => ee(A, !1, w >= D)),
|
|
1058
1058
|
Y > 0 && /* @__PURE__ */ g("button", { type: "button", className: "vs-picker__more vs-picker__more--btn", style: { background: "none", border: 0, cursor: "pointer", width: "100%", textAlign: "left" }, onClick: () => y(!0), children: [
|
|
1059
1059
|
"+ ",
|
|
1060
1060
|
Y,
|
|
@@ -1123,7 +1123,7 @@ function li({ src: t, setup: e, t: n, playing: r, seekN: s, onToggle: a, seekOve
|
|
|
1123
1123
|
c && /* @__PURE__ */ i("div", { className: `txyt__paused${r ? "" : " txyt__paused--on"}`, "aria-hidden": "true", children: /* @__PURE__ */ i("span", { className: "txyt__pausedplay", children: /* @__PURE__ */ i(Xt, { size: 44 }) }) })
|
|
1124
1124
|
] });
|
|
1125
1125
|
}
|
|
1126
|
-
const
|
|
1126
|
+
const Vi = [
|
|
1127
1127
|
{ id: "youtube", name: "YouTube", color: "#ff3b30", hosts: /(^|\.)(youtube\.com|youtu\.be|youtube-nocookie\.com)$/, glyph: "M21.6 7.2a2.7 2.7 0 0 0-1.9-1.9C18 4.8 12 4.8 12 4.8s-6 0-7.7.5a2.7 2.7 0 0 0-1.9 1.9C2 8.9 2 12 2 12s0 3.1.4 4.8a2.7 2.7 0 0 0 1.9 1.9c1.7.5 7.7.5 7.7.5s6 0 7.7-.5a2.7 2.7 0 0 0 1.9-1.9c.4-1.7.4-4.8.4-4.8s0-3.1-.4-4.8ZM10 15.1V8.9l5.3 3.1L10 15.1Z" },
|
|
1128
1128
|
{ id: "loom", name: "Loom", color: "#8f7bff", hosts: /(^|\.)loom\.com$/, glyph: "M21 11h-5.2l4.5-2.6-1-1.7-4.5 2.6 2.6-4.5-1.7-1-2.6 4.5V3h-2v5.3L8.5 3.8l-1.7 1 2.6 4.5-4.5-2.6-1 1.7L8.2 11H3v2h5.2l-4.5 2.6 1 1.7 4.5-2.6-2.6 4.5 1.7 1 2.6-4.5V21h2v-5.2l2.6 4.5 1.7-1-2.6-4.5 4.5 2.6 1-1.7-4.5-2.6H21v-2Zm-9 3.4a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8Z" },
|
|
1129
1129
|
{ id: "vimeo", name: "Vimeo", color: "#1ab7ea", hosts: /(^|\.)vimeo\.com$/, glyph: "M22 7.4c-.1 2-1.5 4.7-4.2 8.1-2.8 3.6-5.1 5.4-7 5.4-1.2 0-2.2-1.1-3-3.3L6.2 11.6C5.6 9.4 5 8.3 4.3 8.3c-.1 0-.6.3-1.4.9L2 8l2.7-2.4C5.9 4.6 6.8 4 7.4 4c1.4-.1 2.3.9 2.6 2.9.4 2.2.6 3.6.8 4.1.4 1.8.9 2.7 1.4 2.7.4 0 1-.6 1.8-1.9.8-1.2 1.2-2.2 1.3-2.8.1-1.1-.3-1.6-1.3-1.6-.5 0-.9.1-1.4.3.9-3 2.7-4.5 5.3-4.4 1.9.1 2.8 1.3 2.7 3.7Z" },
|
|
@@ -1137,8 +1137,26 @@ const Bi = [
|
|
|
1137
1137
|
{ id: "kick", name: "Kick", color: "#53fc18", hosts: /(^|\.)kick\.com$/, glyph: "M4 3h5.5v5H11V6h2V3h5.5v6.5h-2V11h-2v2h2v1.5h2V21H13v-3h-2v-2H9.5v5H4V3Z" },
|
|
1138
1138
|
{ id: "mixcloud", name: "Mixcloud", color: "#7f8cff", hosts: /(^|\.)mixcloud\.com$/, audioOnly: !0, glyph: "M17.5 9.5a5.5 5.5 0 0 0-10.6 1.2A3.8 3.8 0 0 0 7.3 18h10.2a4.25 4.25 0 0 0 0-8.5Z" },
|
|
1139
1139
|
{ id: "streamable", name: "Streamable", color: "#0f90fa", hosts: /(^|\.)streamable\.com$/, glyph: "M4 6.5A2.5 2.5 0 0 1 6.5 4h11A2.5 2.5 0 0 1 20 6.5v11a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 4 17.5v-11Zm6 2.3v6.4l5.2-3.2L10 8.8Z" },
|
|
1140
|
-
{ id: "bandcamp", name: "Bandcamp", color: "#1da0c3", hosts: /(^|\.)bandcamp\.com$/, audioOnly: !0, glyph: "M2 18 8.5 6H22l-6.5 12H2Z" }
|
|
1141
|
-
|
|
1140
|
+
{ id: "bandcamp", name: "Bandcamp", color: "#1da0c3", hosts: /(^|\.)bandcamp\.com$/, audioOnly: !0, glyph: "M2 18 8.5 6H22l-6.5 12H2Z" },
|
|
1141
|
+
{ id: "ted", name: "TED", color: "#e62b1e", hosts: /(^|\.)ted\.com$/, glyph: "M2 6h6.5v2.3H6.4V18H4V8.3H2V6Zm7.5 0h5.3v2.3h-2.9v2.6h2.6v2.3h-2.6v2.5h2.9V18H9.5V6Zm6.4 0h2.3A3.8 3.8 0 0 1 22 9.8v4.4a3.8 3.8 0 0 1-3.8 3.8h-2.3V6Zm2.4 2.3v7.4c.9 0 1.4-.7 1.4-1.6v-4.2c0-.9-.5-1.6-1.4-1.6Z" },
|
|
1142
|
+
{ id: "linkedin", name: "LinkedIn", color: "#0a66c2", hosts: /(^|\.)linkedin\.com$/, glyph: "M5 3.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5ZM3 9.5h4V21H3V9.5Zm6.5 0h3.8v1.6h.1c.5-1 1.8-2 3.8-2 4 0 4.8 2.6 4.8 6V21h-4v-5.2c0-1.2 0-2.8-1.7-2.8s-2 1.3-2 2.7V21h-4V9.5Z" },
|
|
1143
|
+
{ id: "archive", name: "Internet Archive", color: "#c8c8c8", hosts: /(^|\.)archive\.org$/, glyph: "M3 19h18v2H3v-2Zm1-2h16v1.2H4V17Zm1.5-9h2v8h-2V8Zm5.5 0h2v8h-2V8Zm5.5 0h2v8h-2V8ZM3 5.5 12 3l9 2.5V7H3V5.5Z" },
|
|
1144
|
+
{ id: "odysee", name: "Odysee", color: "#ef1970", hosts: /(^|\.)(odysee\.com|lbry\.tv)$/, glyph: "M12 3a9 9 0 1 1 0 18 9 9 0 0 1 0-18Zm0 4a5 5 0 1 0 0 10 5 5 0 0 0 0-10Z" },
|
|
1145
|
+
{ id: "niconico", name: "Niconico", color: "#e6e6e6", hosts: /(^|\.)(nicovideo\.jp|nico\.ms)$/, glyph: "M4 8h16a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2Zm3.5-5L11 7H9.3L6.5 4.2 7.5 3Zm9 0 1 1.2L14.7 7H13l3.5-4Z" },
|
|
1146
|
+
{ id: "vk", name: "VK", color: "#0077ff", hosts: /(^|\.)(vk\.com|vkvideo\.ru)$/, glyph: "M12.8 17.5c-5.5 0-8.6-3.8-8.8-10h2.8c.1 4.6 2.1 6.5 3.7 6.9V7.5h2.6v3.9c1.6-.2 3.3-2 3.8-3.9h2.6c-.4 2.4-2.2 4.2-3.4 4.9 1.3.6 3.3 2.1 4.1 5.1h-2.9c-.6-1.9-2.2-3.4-4.2-3.6v3.6h-.3Z" },
|
|
1147
|
+
{ id: "bitchute", name: "BitChute", color: "#ef4137", hosts: /(^|\.)bitchute\.com$/, glyph: "M12 3a9 9 0 1 1 0 18 9 9 0 0 1 0-18Zm-2 5.5v7l6-3.5-6-3.5Z" },
|
|
1148
|
+
{ id: "wistia", name: "Wistia", color: "#54bbff", hosts: /(^|\.)(wistia\.com|wistia\.net|wi\.st)$/, glyph: "M3 7h13l-2.5 4H3V7Zm0 6h15.5L21 9v4.5L18.5 17H3v-4Z" },
|
|
1149
|
+
{ id: "vidyard", name: "Vidyard", color: "#38c172", hosts: /(^|\.)vidyard\.com$/, glyph: "M3 5h4l5 9 5-9h4l-9 15L3 5Z" },
|
|
1150
|
+
{ id: "kaltura", name: "Kaltura", color: "#00a8e1", hosts: /(^|\.)kaltura\.com$/, glyph: "M5 4h3v7l6-7h4l-6.5 7.3L18.5 20h-4l-5-6.4L8 15.3V20H5V4Z" },
|
|
1151
|
+
{ id: "jwplayer", name: "JW Player", color: "#ff0046", hosts: /(^|\.)(jwplayer\.com|jwplatform\.com)$/, glyph: "M6 5h3v9.5a4 4 0 0 1-4 4H4v-2.8h1c.6 0 1-.5 1-1.2V5Zm5 0h3l1.5 7L17 5h3l-3 13h-3l-1.5-6.5L11.9 18H9.5L11 5Z" },
|
|
1152
|
+
{ id: "pinterest", name: "Pinterest", color: "#e60023", hosts: /(^|\.)(pinterest\.[a-z.]+|pin\.it)$/, glyph: "M12 2.5a9.5 9.5 0 0 0-3.5 18.3c-.1-.8-.2-2 0-2.9l1.3-5.4s-.3-.7-.3-1.6c0-1.5.9-2.7 2-2.7.9 0 1.4.7 1.4 1.6 0 1-.6 2.4-.9 3.7-.3 1.1.6 2 1.7 2 2 0 3.5-2.1 3.5-5.2 0-2.7-2-4.6-4.8-4.6-3.3 0-5.2 2.5-5.2 5 0 1 .4 2.1.9 2.7l.1.4-.3 1.3c0 .2-.2.3-.4.2-1.4-.7-2.3-2.7-2.3-4.4 0-3.6 2.6-6.9 7.5-6.9 3.9 0 7 2.8 7 6.6 0 3.9-2.5 7.1-5.9 7.1-1.2 0-2.2-.6-2.6-1.3l-.7 2.7c-.3 1-.9 2.2-1.4 2.9A9.5 9.5 0 1 0 12 2.5Z" },
|
|
1153
|
+
{ id: "bluesky", name: "Bluesky", color: "#1185fe", hosts: /(^|\.)bsky\.app$/, glyph: "M6.3 4.4c2.3 1.7 4.7 5.2 5.7 7 1-1.8 3.4-5.3 5.7-7 1.6-1.2 4.3-2.2 4.3.9 0 .6-.4 5.2-.6 5.9-.7 2.6-3.3 3.2-5.6 2.8 4 .7 5 2.9 2.8 5.2-4.2 4.3-6-1.1-6.5-2.5l-.1-.4-.1.4c-.5 1.4-2.3 6.8-6.5 2.5-2.2-2.3-1.2-4.5 2.8-5.2-2.3.4-4.9-.2-5.6-2.8C2.4 10.5 2 5.9 2 5.3c0-3.1 2.7-2.1 4.3-.9Z" },
|
|
1154
|
+
{ id: "gdrive", name: "Google Drive", color: "#34a853", hosts: /^drive\.google\.com$/, glyph: "M8.2 3h7.6l6.2 10.8-3.8 6.6H5.8L2 13.8 8.2 3Zm1.2 2L5 12.6h4.4L13.8 5H9.4Zm6.4 1.2-2.2 3.8 4 6.8 2.2-3.8-4-6.8ZM4.4 14.6l2.2 3.8h8.8l2.2-3.8H4.4Z" },
|
|
1155
|
+
{ id: "spreaker", name: "Spreaker", color: "#f5c300", hosts: /(^|\.)spreaker\.com$/, audioOnly: !0, glyph: "M12 9a3 3 0 1 1 0 6 3 3 0 0 1 0-6ZM6.3 6.3l1.4 1.4a6 6 0 0 0 0 8.6l-1.4 1.4a8 8 0 0 1 0-11.4Zm11.4 0a8 8 0 0 1 0 11.4l-1.4-1.4a6 6 0 0 0 0-8.6l1.4-1.4Z" },
|
|
1156
|
+
{ id: "iheart", name: "iHeartRadio", color: "#c6002b", hosts: /(^|\.)iheart\.com$/, audioOnly: !0, glyph: "M12 21s-7.5-4.6-9.4-9.4C1.2 8 3.4 4 7.3 4c2 0 3.6 1.1 4.7 2.6C13.1 5.1 14.7 4 16.7 4c3.9 0 6.1 4 4.7 7.6C19.5 16.4 12 21 12 21Z" },
|
|
1157
|
+
{ id: "audioboom", name: "Audioboom", color: "#1ea2e0", hosts: /(^|\.)audioboom\.com$/, audioOnly: !0, glyph: "M12 3a9 9 0 1 1 0 18 9 9 0 0 1 0-18Zm-4 6v6h2V9H8Zm3-2v10h2V7h-2Zm3 3v4h2v-4h-2Z" },
|
|
1158
|
+
{ id: "cnn", name: "CNN", color: "#cc0000", hosts: /(^|\.)cnn\.com$/, glyph: "M2 7h20v10H2V7Zm3.5 2.2a2.8 2.8 0 1 0 0 5.6h1.4v-1.6H5.6a1.2 1.2 0 1 1 0-2.4h1.3V9.2H5.5Zm3 0v5.6h1.6v-3.3l2.4 3.3H14V9.2h-1.6v3.3L10 9.2H8.5Zm6.2 0v5.6h1.6v-3.3l2.4 3.3h1.5V9.2h-1.6v3.3l-2.4-3.3h-1.5Z" }
|
|
1159
|
+
], bo = new Map(Vi.map((t) => [t.id, t]));
|
|
1142
1160
|
function Xu(t) {
|
|
1143
1161
|
return t ? bo.get(t) ?? null : null;
|
|
1144
1162
|
}
|
|
@@ -1153,7 +1171,7 @@ function Oo(t) {
|
|
|
1153
1171
|
}
|
|
1154
1172
|
function Pn(t) {
|
|
1155
1173
|
const e = Oo(t);
|
|
1156
|
-
return e ?
|
|
1174
|
+
return e ? Vi.find((n) => n.hosts.test(e)) ?? null : null;
|
|
1157
1175
|
}
|
|
1158
1176
|
function zt(t) {
|
|
1159
1177
|
try {
|
|
@@ -1163,7 +1181,7 @@ function zt(t) {
|
|
|
1163
1181
|
}
|
|
1164
1182
|
}
|
|
1165
1183
|
const un = (t) => Math.max(0, Math.floor(t));
|
|
1166
|
-
function
|
|
1184
|
+
function Bi(t) {
|
|
1167
1185
|
var n;
|
|
1168
1186
|
const e = /\/(?:share|embed)\/(?:[^/?#]*-)?([0-9a-f]{32})(?:[/?#]|$)/i.exec(((n = zt(t)) == null ? void 0 : n.pathname) ?? "");
|
|
1169
1187
|
return e ? e[1].toLowerCase() : null;
|
|
@@ -1204,7 +1222,7 @@ function Hi(t, e) {
|
|
|
1204
1222
|
const r = e.play ? 1 : 0;
|
|
1205
1223
|
switch (n.id) {
|
|
1206
1224
|
case "loom": {
|
|
1207
|
-
const u =
|
|
1225
|
+
const u = Bi(t);
|
|
1208
1226
|
if (!u) return null;
|
|
1209
1227
|
const d = new URLSearchParams({ hide_owner: "true", hide_share: "true", hide_title: "true", hideEmbedTopBar: "true", hide_speed: "true", muted: "true", autoplay: e.play ? "true" : "false", t: String(un(e.t)) });
|
|
1210
1228
|
return `https://www.loom.com/embed/${u}?${d}`;
|
|
@@ -1347,7 +1365,7 @@ function Po({ url: t, t: e, playing: n, seekN: r, onToggle: s }) {
|
|
|
1347
1365
|
if (!(!M || T.type !== "video" || T.id !== d)) {
|
|
1348
1366
|
o.current = T.instance;
|
|
1349
1367
|
try {
|
|
1350
|
-
T.instance.
|
|
1368
|
+
T.instance.setVolume(0), T.instance.unmute(), T.instance.setVolume(0), T.instance.seek(Math.max(0, l.current));
|
|
1351
1369
|
} catch {
|
|
1352
1370
|
}
|
|
1353
1371
|
u(!0);
|
|
@@ -1367,7 +1385,7 @@ function Po({ url: t, t: e, playing: n, seekN: r, onToggle: s }) {
|
|
|
1367
1385
|
const M = o.current;
|
|
1368
1386
|
if (!(!M || !c))
|
|
1369
1387
|
try {
|
|
1370
|
-
n ? M.play() : M.pause();
|
|
1388
|
+
n ? (M.setVolume(0), M.play()) : M.pause();
|
|
1371
1389
|
} catch {
|
|
1372
1390
|
}
|
|
1373
1391
|
}, [n, c]), S(() => {
|
|
@@ -1409,7 +1427,7 @@ function Qo(t) {
|
|
|
1409
1427
|
e && !r.includes("Signature=") && n.open("GET", r + (r.includes("?") ? "&" : "?") + e, !0);
|
|
1410
1428
|
};
|
|
1411
1429
|
}
|
|
1412
|
-
function
|
|
1430
|
+
function Vo(t) {
|
|
1413
1431
|
return (e, n) => {
|
|
1414
1432
|
let r = !0, s = null;
|
|
1415
1433
|
return (async () => {
|
|
@@ -1436,7 +1454,7 @@ function Bo(t) {
|
|
|
1436
1454
|
};
|
|
1437
1455
|
}
|
|
1438
1456
|
const on = /* @__PURE__ */ new Map();
|
|
1439
|
-
function
|
|
1457
|
+
function Bo(t) {
|
|
1440
1458
|
const [e, n] = k(() => t ? on.get(t) ?? null : null);
|
|
1441
1459
|
return S(() => {
|
|
1442
1460
|
if (!t) {
|
|
@@ -2149,18 +2167,18 @@ function It(t) {
|
|
|
2149
2167
|
const a = (e == null ? void 0 : e.name) ?? "";
|
|
2150
2168
|
return a === "TypeError" && /fetch|network|load failed/i.test(String((e == null ? void 0 : e.message) ?? "")) ? (typeof navigator < "u" && navigator.onLine !== !1 && Di(t instanceof Error ? t : new Error(String(t))), { message: Nr }) : gi[a] ? { message: gi[a] } : t instanceof Error && a === "Error" && !(t instanceof Ci) ? { message: t.message } : { message: xr };
|
|
2151
2169
|
}
|
|
2152
|
-
const qi = "https://api.vocalstack.com",
|
|
2170
|
+
const qi = "https://api.vocalstack.com", Vr = Oi(null);
|
|
2153
2171
|
function Wt() {
|
|
2154
|
-
const t = Ga(
|
|
2172
|
+
const t = Ga(Vr);
|
|
2155
2173
|
if (!t) throw new Error("VocalStack player hooks must be used inside <VocalStackPlayer> or <PlayerApiProvider>");
|
|
2156
2174
|
return t;
|
|
2157
2175
|
}
|
|
2158
2176
|
function xl(t) {
|
|
2159
|
-
return t.value ? /* @__PURE__ */ i(
|
|
2177
|
+
return t.value ? /* @__PURE__ */ i(Vr.Provider, { value: t.value, children: t.children }) : /* @__PURE__ */ i(Sl, { ...t });
|
|
2160
2178
|
}
|
|
2161
2179
|
function Sl({ children: t, ...e }) {
|
|
2162
2180
|
const n = Ki(e);
|
|
2163
|
-
return /* @__PURE__ */ i(
|
|
2181
|
+
return /* @__PURE__ */ i(Vr.Provider, { value: n, children: t });
|
|
2164
2182
|
}
|
|
2165
2183
|
const Dl = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
2166
2184
|
function Al(t) {
|
|
@@ -2365,7 +2383,7 @@ function Ql(t, e) {
|
|
|
2365
2383
|
A = !1, (K = l.current) == null || K.close(), l.current = null, d(!1);
|
|
2366
2384
|
};
|
|
2367
2385
|
}, [t, n, e.voice]);
|
|
2368
|
-
const [N, m] = k(!1), [b, C] = k(null), D = j(0), [
|
|
2386
|
+
const [N, m] = k(!1), [b, C] = k(null), D = j(0), [V, Y] = k(null), ee = Ke((A) => {
|
|
2369
2387
|
var te;
|
|
2370
2388
|
if (c.current = A, (te = l.current) == null || te.setLanguage(A), !t) return;
|
|
2371
2389
|
const w = r.current.client, _ = ++D.current;
|
|
@@ -2390,7 +2408,7 @@ function Ql(t, e) {
|
|
|
2390
2408
|
}
|
|
2391
2409
|
O && y();
|
|
2392
2410
|
}, [y]), F = Ke(() => h(null), []);
|
|
2393
|
-
return { model: s, connected: u, error: M, notFound: f, clearError: F, setLanguage: ee, mergeTranslations: I, translating: N, translateFailed: b, shownLang:
|
|
2411
|
+
return { model: s, connected: u, error: M, notFound: f, clearError: F, setLanguage: ee, mergeTranslations: I, translating: N, translateFailed: b, shownLang: V };
|
|
2394
2412
|
}
|
|
2395
2413
|
const pi = {
|
|
2396
2414
|
English: { vcFor: "Voice for", vcMute: "Mute", vcUnmute: "Unmute", vcMuted: "MUTED", vcShared: "Also used by", vcUsedBy: "Used by", vcUnknownSpk: "Unknown", vcUse: "Use this voice", vcGetting: "Downloading…", vcSample: "Here’s how it sounds.", vcPreview: "PREVIEW", vcMale: "Male", vcFemale: "Female", vcSynth: "SYNTHETIC", origAudio: "ORIGINAL AUDIO", vcCloned: "VOICES", vcBadge: "CLONED", vcNone: "TEXT ONLY", vcNoVoice: "No voice for ", vcSheet: "VOICE", vcNeutral: "SYNTHETIC VOICE", vcWarm: "SYNTHETIC VOICE", searchPlaceholder: "Search this broadcast", noise: "Audio unclear", newLines: "new", live: "LIVE", ended: "ENDED", waiting: "WAITING", corrected: "CORRECTED", hostLine: "Hosted by Marcus Reed · 4 speakers", langLabel: "LANGUAGE", langCount: "100+ languages", read: "Read", listen: "Listen", watch: "Watch", waitTitle: "The broadcast hasn’t started yet", waitBody: "The transcript appears here as soon as the host starts speaking.", english: "ENGLISH", playing: "Playing the live audio", ready: "Tap to start audio", readyNote: "Set your volume first", voiceMeta: "ORIGINAL AUDIO", voice: "Voice", sheetTitle: "APP LANGUAGE", done: "Done", search: "Search 100+ languages", sheetNote: "Follow along in your language.", moreLangs: "more", confTitle: "Some words weren't heard clearly", confBody: "The transcript marks words the model is unsure about with a dashed underline. The words keep their colour, so only the underline tells you where to look.", confMid: "Slightly unsure — probably right", confHigh: "Low confidence — may be wrong", settings: "BROADCAST", setOrig: "Show original language", setTheme: "Appearance", light: "Light", dark: "Dark", setConf: "Show uncertain words", setConfHint1: "Colours words the model is unsure about — ", setConfMid: "amber", setConfSep: " or ", setConfLow: "red", setConfHint2: "", behindLive: "TRANSLATION LATENCY", behindNote: "How far the translation trails the speaker right now.", shareLabel: "LIVE TRANSLATION LINK", copy: "Copy", copied: "Copied" },
|
|
@@ -2424,10 +2442,10 @@ function Tr(t) {
|
|
|
2424
2442
|
return "queued";
|
|
2425
2443
|
}
|
|
2426
2444
|
}
|
|
2427
|
-
function
|
|
2445
|
+
function Vl(t) {
|
|
2428
2446
|
return t ? t.progress ? { state: t.state, processedS: t.progress.processedS, totalS: t.progress.totalS ?? null, segmentsDone: t.progress.segmentsDone, segmentsTotal: t.progress.segmentsTotal ?? null, pct: t.progress.pct, error: t.error ?? null } : t.state ? { state: t.state, processedS: 0, totalS: null, segmentsDone: 0, segmentsTotal: null, pct: 0, error: t.error ?? null } : null : null;
|
|
2429
2447
|
}
|
|
2430
|
-
const
|
|
2448
|
+
const Bl = (t, e) => {
|
|
2431
2449
|
const n = (t == null ? void 0 : t.segmentsDone) ?? e, r = Math.max(n, (t == null ? void 0 : t.segmentsTotal) ?? n);
|
|
2432
2450
|
return `${n} / ${r} SEGMENTS`;
|
|
2433
2451
|
};
|
|
@@ -2446,14 +2464,14 @@ const Sr = [
|
|
|
2446
2464
|
{ key: "srt", name: "Subtitles", ext: "SRT / VTT", note: "Timed caption cues, ready for a video editor or a player.", icon: "M2.25 15.75V8.25A2.25 2.25 0 0 1 4.5 6h15a2.25 2.25 0 0 1 2.25 2.25v7.5A2.25 2.25 0 0 1 19.5 18h-15a2.25 2.25 0 0 1-2.25-2.25Zm4.5-4.5h4.5m-4.5 3h1.5m3 0h6m-3-3h3" },
|
|
2447
2465
|
{ key: "json", name: "JSON", ext: "JSON", note: "Word-level timings, confidence scores and speaker turns.", icon: "M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5" }
|
|
2448
2466
|
];
|
|
2449
|
-
function
|
|
2467
|
+
function Br(t) {
|
|
2450
2468
|
const e = document.createElement("a");
|
|
2451
2469
|
e.href = t, e.style.display = "none", document.body.appendChild(e), e.click(), e.remove();
|
|
2452
2470
|
}
|
|
2453
2471
|
async function Wl(t) {
|
|
2454
2472
|
const e = await fetch(t, { redirect: "manual" });
|
|
2455
2473
|
if (e.type !== "opaqueredirect" && !e.ok) throw await ta(e);
|
|
2456
|
-
|
|
2474
|
+
Br(t);
|
|
2457
2475
|
}
|
|
2458
2476
|
async function Fl(t, e, n, r = {}) {
|
|
2459
2477
|
var h, f;
|
|
@@ -2472,7 +2490,7 @@ async function Zl(t, e) {
|
|
|
2472
2490
|
if (Date.now() > u) throw new Error("The spoken track is taking too long; try again in a moment.");
|
|
2473
2491
|
await new Promise((d) => setTimeout(d, 4e3)), c = l(await o());
|
|
2474
2492
|
}
|
|
2475
|
-
|
|
2493
|
+
Br(po(t.origin, n, r, c.voiceKey, a));
|
|
2476
2494
|
}
|
|
2477
2495
|
const na = (t) => {
|
|
2478
2496
|
var e;
|
|
@@ -2559,12 +2577,12 @@ function Xl(t, e, n = 0) {
|
|
|
2559
2577
|
if (!d) return;
|
|
2560
2578
|
const ee = l();
|
|
2561
2579
|
s.scrollTop = h + (Y.clientY - M) / (ee.vis - ee.size) * ee.max, p();
|
|
2562
|
-
},
|
|
2580
|
+
}, V = () => {
|
|
2563
2581
|
d && (d = !1, a.style.cursor = "grab", p());
|
|
2564
2582
|
};
|
|
2565
|
-
return s.addEventListener("scroll", b, { passive: !0 }), a.addEventListener("pointerdown", C), a.addEventListener("pointermove", D), a.addEventListener("pointerup",
|
|
2583
|
+
return s.addEventListener("scroll", b, { passive: !0 }), a.addEventListener("pointerdown", C), a.addEventListener("pointermove", D), a.addEventListener("pointerup", V), a.addEventListener("pointercancel", V), typeof ResizeObserver < "u" && (y = new ResizeObserver(() => N()), y.observe(s)), r.current = () => N(), N(), () => {
|
|
2566
2584
|
r.current = () => {
|
|
2567
|
-
}, s.removeEventListener("scroll", b), a.removeEventListener("pointerdown", C), a.removeEventListener("pointermove", D), a.removeEventListener("pointerup",
|
|
2585
|
+
}, s.removeEventListener("scroll", b), a.removeEventListener("pointerdown", C), a.removeEventListener("pointermove", D), a.removeEventListener("pointerup", V), a.removeEventListener("pointercancel", V), y == null || y.disconnect(), clearTimeout(u);
|
|
2568
2586
|
};
|
|
2569
2587
|
}, []);
|
|
2570
2588
|
}
|
|
@@ -2627,9 +2645,9 @@ function ed({ chip: t, note: e, scrub: n, mute: r, voice: s, prev: a, play: o, n
|
|
|
2627
2645
|
function nc({ index: t, total: e, atLabel: n, durLabel: r, stepLabel: s, onSeek: a, onSeekFrac: o, onScrubStart: l, onScrubEnd: c, frac: u, glideMs: d = 260 }) {
|
|
2628
2646
|
const M = j(null), h = j(!1), [f, p] = k(null), y = Math.max(1, e), T = f ?? u, N = T != null ? Math.min(100, Math.max(0, T * 100)) : t / Math.max(1, y - 1) * 100, m = u != null && d > 0 && f == null ? `width ${d}ms linear, left ${d}ms linear` : "none", b = (D) => {
|
|
2629
2647
|
var I;
|
|
2630
|
-
const
|
|
2631
|
-
if (!
|
|
2632
|
-
const Y = Math.min(1, Math.max(0, (D.clientX -
|
|
2648
|
+
const V = (I = M.current) == null ? void 0 : I.getBoundingClientRect();
|
|
2649
|
+
if (!V) return;
|
|
2650
|
+
const Y = Math.min(1, Math.max(0, (D.clientX - V.left) / Math.max(1, V.width)));
|
|
2633
2651
|
if (o) {
|
|
2634
2652
|
p(Y), o(Y);
|
|
2635
2653
|
return;
|
|
@@ -2646,8 +2664,8 @@ function nc({ index: t, total: e, atLabel: n, durLabel: r, stepLabel: s, onSeek:
|
|
|
2646
2664
|
ref: M,
|
|
2647
2665
|
className: "rscrub__track",
|
|
2648
2666
|
onPointerDown: (D) => {
|
|
2649
|
-
var
|
|
2650
|
-
h.current = !0, (
|
|
2667
|
+
var V;
|
|
2668
|
+
h.current = !0, (V = M.current) == null || V.setPointerCapture(D.pointerId), l == null || l(), b(D), D.preventDefault();
|
|
2651
2669
|
},
|
|
2652
2670
|
onPointerMove: (D) => {
|
|
2653
2671
|
h.current && b(D);
|
|
@@ -2831,8 +2849,8 @@ function dc({ cast: t, voices: e, currentId: n, armedId: r = null, sampleId: s =
|
|
|
2831
2849
|
}, [d, M]);
|
|
2832
2850
|
const m = (D) => D === p.vcMale.toUpperCase() || D === p.vcFemale.toUpperCase(), b = (D) => {
|
|
2833
2851
|
if (D === p.vcSheet) return !0;
|
|
2834
|
-
const
|
|
2835
|
-
return
|
|
2852
|
+
const V = T[D];
|
|
2853
|
+
return V != null ? !V : !M || !m(D) ? !0 : D === (M === "female" ? p.vcFemale : p.vcMale).toUpperCase();
|
|
2836
2854
|
}, C = !!r && r !== n;
|
|
2837
2855
|
return /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
2838
2856
|
h && /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "flex-start", gap: 9, padding: "10px 11px", marginBottom: 10, borderRadius: 11, background: "var(--conf-low-soft)" }, children: [
|
|
@@ -2853,11 +2871,11 @@ function dc({ cast: t, voices: e, currentId: n, armedId: r = null, sampleId: s =
|
|
|
2853
2871
|
] })
|
|
2854
2872
|
] })
|
|
2855
2873
|
] }),
|
|
2856
|
-
y.map(({ v: D, headOn:
|
|
2874
|
+
y.map(({ v: D, headOn: V, head: Y, headCount: ee, rule: I }, F) => {
|
|
2857
2875
|
const A = oc(D), w = a === D.id, _ = b(Y), O = (u == null ? void 0 : u(D)) ?? null;
|
|
2858
2876
|
return /* @__PURE__ */ g(qa, { children: [
|
|
2859
|
-
|
|
2860
|
-
|
|
2877
|
+
V && Y === p.vcSheet && /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", padding: "14px 2px 6px", borderTop: F === 0 && !f ? "0" : "1px solid var(--hair)", userSelect: "none" }, children: /* @__PURE__ */ i("span", { style: { font: "600 9px var(--vs-font-mono)", letterSpacing: ".13em", color: "var(--ink-62)" }, children: Y }) }),
|
|
2878
|
+
V && Y !== p.vcSheet && /* @__PURE__ */ g(
|
|
2861
2879
|
"button",
|
|
2862
2880
|
{
|
|
2863
2881
|
type: "button",
|
|
@@ -2971,7 +2989,7 @@ function pc({ recordingId: t, lang: e, ended: n, cred: r, pickedVoice: s, senten
|
|
|
2971
2989
|
const K = `${t ?? ""}|${e ?? ""}|`;
|
|
2972
2990
|
for (const L of [...T.current]) L.startsWith(K) && T.current.delete(L);
|
|
2973
2991
|
y(null);
|
|
2974
|
-
}, [t, e]), C = !!d && (d.state === "queued" || d.state === "running") || h === N, D = (d == null ? void 0 : d.state) === "failed" ? d.error || "the render failed" : p,
|
|
2992
|
+
}, [t, e]), C = !!d && (d.state === "queued" || d.state === "running") || h === N, D = (d == null ? void 0 : d.state) === "failed" ? d.error || "the render failed" : p, V = (a == null ? void 0 : a.join(",")) ?? "", [Y, ee] = k(null), I = ze(() => new Set((d == null ? void 0 : d.clips) ?? []), [d]), F = ze(() => n && V ? V.split(",").map(Number).filter((K) => !I.has(K)) : [], [n, V, I]), A = j(null);
|
|
2975
2993
|
S(() => {
|
|
2976
2994
|
if (!n || !t || !e || !F.length) return;
|
|
2977
2995
|
const K = Y ?? F[0], L = F.find((pe) => pe >= K) ?? F[0], ie = `${t}|${e}|${M ?? ""}`, ne = A.current;
|
|
@@ -2995,9 +3013,9 @@ function pc({ recordingId: t, lang: e, ended: n, cred: r, pickedVoice: s, senten
|
|
|
2995
3013
|
}, [w, c, I]);
|
|
2996
3014
|
const O = ze(() => {
|
|
2997
3015
|
if (!t) return [];
|
|
2998
|
-
const K =
|
|
3016
|
+
const K = V ? V.split(",").map(Number).filter((ie) => !n || I.has(ie)) : void 0, L = d ?? (K != null && K.length && e ? { lang: e, voiceKey: s ?? "", clips: [], voice: null } : null);
|
|
2999
3017
|
return vo(L, t, o.origin, r, K);
|
|
3000
|
-
}, [d, t, o, r,
|
|
3018
|
+
}, [d, t, o, r, V, e, s, n, I]), te = ze(() => new Set(F), [F]);
|
|
3001
3019
|
return { listed: l, rows: u, track: d, renderVoiceId: M, rendering: C, failed: D, clips: O, requestRender: m, forget: b, reload: c, setNear: ee, missing: F.length, coming: te };
|
|
3002
3020
|
}
|
|
3003
3021
|
const mc = { share: X.share, delay: X.tabGauge, video: X.video, source: X.tabSources, script: X.tabScript, fix: X.tabFix, ending: X.tabEnding, summary: X.tabSummary, export: X.tabExport, settings: X.tabSettings, sources: X.tabSources, recs: X.mic };
|
|
@@ -3035,7 +3053,7 @@ function ia({ tabs: t, current: e, onPick: n, gap: r, fold: s = !0, side: a = !s
|
|
|
3035
3053
|
return s ? /* @__PURE__ */ g("button", { type: "button", role: "tab", "aria-selected": N, title: T.label, className: `tabbar__tab${N ? " is-on" : ""}`, style: { flex: b }, onClick: D, children: [
|
|
3036
3054
|
C && /* @__PURE__ */ i(oe, { d: C, size: 15, sw: T.sw ?? 2, style: { flex: "none" } }),
|
|
3037
3055
|
m && /* @__PURE__ */ i("span", { className: "tabbar__label", children: T.label })
|
|
3038
|
-
] }, T.key) : /* @__PURE__ */ i("div", { className: "tabbar__slot", "data-tab-cell": "", style: { flex: b }, onMouseEnter: (
|
|
3056
|
+
] }, T.key) : /* @__PURE__ */ i("div", { className: "tabbar__slot", "data-tab-cell": "", style: { flex: b }, onMouseEnter: (V) => f(V, T), onMouseMove: (V) => f(V, T), onClick: D, children: /* @__PURE__ */ g("button", { type: "button", role: "tab", "aria-selected": N, "aria-label": T.label, className: `tabbar__tab${N ? " is-on" : ""}${(c == null ? void 0 : c.k) === T.key ? " is-tip" : ""}`, children: [
|
|
3039
3057
|
C && /* @__PURE__ */ i(oe, { d: C, size: 15, sw: T.sw ?? 2, className: "tabbar__icon", style: { flex: "none", transform: N && !o ? "scale(1.12)" : "none" } }),
|
|
3040
3058
|
/* @__PURE__ */ i("span", { className: "tabbar__grow", "data-tab-lw": "", style: { gridTemplateColumns: m ? "1fr" : "0fr", marginLeft: m && C ? 6 : 0 }, children: /* @__PURE__ */ i("span", { className: "tabbar__label", "data-tab-l": "", style: { opacity: m ? 1 : 0, transform: m ? "none" : "translateX(-6px)" }, children: T.label }) })
|
|
3041
3059
|
] }) }, T.key);
|
|
@@ -3263,12 +3281,12 @@ function Oc(t) {
|
|
|
3263
3281
|
F.startsWith("--") && b.style.setProperty(F, C.getPropertyValue(F));
|
|
3264
3282
|
}
|
|
3265
3283
|
b.style.fontFamily = C.fontFamily, b.style.color = C.color;
|
|
3266
|
-
let D = N.el.parentElement,
|
|
3267
|
-
for (; D && !
|
|
3284
|
+
let D = N.el.parentElement, V = "";
|
|
3285
|
+
for (; D && !V; ) {
|
|
3268
3286
|
const I = getComputedStyle(D).backgroundColor;
|
|
3269
|
-
I && !/rgba?\(0, 0, 0, 0\)|transparent/.test(I) && !/\/ 0\.|, 0\.\d+\)$/.test(I) && (
|
|
3287
|
+
I && !/rgba?\(0, 0, 0, 0\)|transparent/.test(I) && !/\/ 0\.|, 0\.\d+\)$/.test(I) && (V = I), D = D.parentElement;
|
|
3270
3288
|
}
|
|
3271
|
-
b.style.background =
|
|
3289
|
+
b.style.background = V || getComputedStyle(document.body).backgroundColor, document.body.appendChild(b), N.orig = [...N.col.querySelectorAll("[data-panel-key]")].map((I) => [I, I.style.order]), N.snap = {}, N.orig.forEach(([I]) => {
|
|
3272
3290
|
N.snap[I.getAttribute("data-panel-key")] = I.getBoundingClientRect();
|
|
3273
3291
|
}), N.tabsSnap = ((ee = o(N)) == null ? void 0 : ee.getBoundingClientRect()) ?? null;
|
|
3274
3292
|
const Y = N.col.querySelector("[data-panel-grid]");
|
|
@@ -3277,7 +3295,7 @@ function Oc(t) {
|
|
|
3277
3295
|
const N = s;
|
|
3278
3296
|
if (!N || !N.on || N.px == null || N.py == null) return;
|
|
3279
3297
|
N.raf = 0, N.clone.style.transform = `translate3d(${N.px - N.x0}px,${N.py - N.y0}px,0)`;
|
|
3280
|
-
const m = e.current, b = N.key, C = o(N), D = m.seq.includes(b),
|
|
3298
|
+
const m = e.current, b = N.key, C = o(N), D = m.seq.includes(b), V = D || m.tabKeys.length > 1, Y = C && N.tabsSnap, ee = !Y || N.py < Y.top + Y.height / 2 ? V ? "pin" : null : "tabs";
|
|
3281
3299
|
let I = null;
|
|
3282
3300
|
if (ee === "pin") {
|
|
3283
3301
|
const A = m.seq.filter((_) => _ !== b).map((_) => N.snap[_]).filter(Boolean), w = N.grid ? A.filter((_) => _.bottom < N.py || _.top <= N.py && _.left + _.width / 2 < N.px).length : A.filter((_) => _.top + _.height / 2 < N.py).length;
|
|
@@ -3325,8 +3343,8 @@ function Oc(t) {
|
|
|
3325
3343
|
}
|
|
3326
3344
|
const b = m.closest("[data-panel-key]"), C = b == null ? void 0 : b.firstElementChild;
|
|
3327
3345
|
if (!b || !C || !e.current.tabbed || !e.current.pinnable.includes(b.getAttribute("data-panel-key")) || m.closest("[role=button],[role=tab],button,a,input,textarea,select,iframe,[data-pin-pill],[contenteditable=true]")) return a(null);
|
|
3328
|
-
const D = C.getBoundingClientRect(),
|
|
3329
|
-
a(N.clientY >= D.top && N.clientY <= D.top +
|
|
3346
|
+
const D = C.getBoundingClientRect(), V = parseFloat(getComputedStyle(b).getPropertyValue("--grip-h")) || 30;
|
|
3347
|
+
a(N.clientY >= D.top && N.clientY <= D.top + V ? b : null);
|
|
3330
3348
|
}, h = (N) => {
|
|
3331
3349
|
if (!r || N.button !== 0) return;
|
|
3332
3350
|
const m = d(r);
|
|
@@ -3350,13 +3368,13 @@ function Cc({ id: t, className: e, gap: n, hidden: r, plain: s, children: a }) {
|
|
|
3350
3368
|
const f = c.current, p = f == null ? void 0 : f.parentElement;
|
|
3351
3369
|
if (h.button !== 0 || !f || !p) return;
|
|
3352
3370
|
h.preventDefault();
|
|
3353
|
-
const y = h.currentTarget, T = getComputedStyle(p), N = p.clientWidth - parseFloat(T.paddingLeft) - parseFloat(T.paddingRight) - (parseFloat(T.columnGap) || 0), m = 320, b = 320, C = Math.max(m, N - b), D = h.clientX,
|
|
3354
|
-
let Y =
|
|
3371
|
+
const y = h.currentTarget, T = getComputedStyle(p), N = p.clientWidth - parseFloat(T.paddingLeft) - parseFloat(T.paddingRight) - (parseFloat(T.columnGap) || 0), m = 320, b = 320, C = Math.max(m, N - b), D = h.clientX, V = f.getBoundingClientRect().width;
|
|
3372
|
+
let Y = V;
|
|
3355
3373
|
y.classList.add("is-on");
|
|
3356
3374
|
const ee = { cur: document.body.style.cursor, sel: document.body.style.userSelect };
|
|
3357
3375
|
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
3358
3376
|
const I = (A) => {
|
|
3359
|
-
Y = Math.round(Math.min(C, Math.max(m,
|
|
3377
|
+
Y = Math.round(Math.min(C, Math.max(m, V + (D - A.clientX)))), f.style.flexBasis = `${Y}px`, document.documentElement.style.setProperty("--colw", `${Y}px`);
|
|
3360
3378
|
}, F = () => {
|
|
3361
3379
|
window.removeEventListener("pointermove", I), window.removeEventListener("pointerup", F), window.removeEventListener("pointercancel", F), document.body.style.cursor = ee.cur, document.body.style.userSelect = ee.sel, y.classList.remove("is-on"), l(Y);
|
|
3362
3380
|
};
|
|
@@ -3418,7 +3436,7 @@ function Ec(t) {
|
|
|
3418
3436
|
Hn() === "caf" && (C += `${C.includes("?") ? "&" : "?"}format=caf`);
|
|
3419
3437
|
const D = Date.now();
|
|
3420
3438
|
e.shareCode && C.includes("recording=") && (C += `&shareCode=${encodeURIComponent(e.shareCode)}`);
|
|
3421
|
-
const
|
|
3439
|
+
const V = async () => {
|
|
3422
3440
|
if (f.current !== b) return;
|
|
3423
3441
|
let Y;
|
|
3424
3442
|
try {
|
|
@@ -3436,7 +3454,7 @@ function Ec(t) {
|
|
|
3436
3454
|
return;
|
|
3437
3455
|
}
|
|
3438
3456
|
l(m.id), h.current = setTimeout(() => {
|
|
3439
|
-
|
|
3457
|
+
V();
|
|
3440
3458
|
}, Dc);
|
|
3441
3459
|
return;
|
|
3442
3460
|
}
|
|
@@ -3458,7 +3476,7 @@ function Ec(t) {
|
|
|
3458
3476
|
f.current === b && a(m.id);
|
|
3459
3477
|
}).catch(F);
|
|
3460
3478
|
};
|
|
3461
|
-
|
|
3479
|
+
V();
|
|
3462
3480
|
}, [t, p, e]);
|
|
3463
3481
|
return { armId: n, sampleId: s, dlId: o, error: c, clearError: () => u(null), arm: N, stop: y, reset: T };
|
|
3464
3482
|
}
|
|
@@ -3569,7 +3587,7 @@ function vi(t, e, n) {
|
|
|
3569
3587
|
for (let a = 0; a < n.length && n[a].start <= r; a++) s = a;
|
|
3570
3588
|
return s;
|
|
3571
3589
|
}
|
|
3572
|
-
function
|
|
3590
|
+
function Vt(t, e) {
|
|
3573
3591
|
var l;
|
|
3574
3592
|
const n = t.clipPos;
|
|
3575
3593
|
if (t.wordSync || t.timed || !n || !(n.dur > 0)) return t.t;
|
|
@@ -3598,7 +3616,7 @@ function $c({ ytId: t, title: e, t: n, playing: r, seekN: s, onToggle: a, onAd:
|
|
|
3598
3616
|
(ke = (G = f.current) == null ? void 0 : G.contentWindow) == null || ke.postMessage(JSON.stringify({ event: "command", func: W, args: ye }), "*");
|
|
3599
3617
|
} catch {
|
|
3600
3618
|
}
|
|
3601
|
-
}, D = j(null),
|
|
3619
|
+
}, D = j(null), V = j(!1), Y = j(!1), ee = j(!1), I = j(a);
|
|
3602
3620
|
I.current = a;
|
|
3603
3621
|
const F = j(d);
|
|
3604
3622
|
F.current = d;
|
|
@@ -3644,12 +3662,12 @@ function $c({ ytId: t, title: e, t: n, playing: r, seekN: s, onToggle: a, onAd:
|
|
|
3644
3662
|
const Q = j(!1), [H, E] = k(!1), x = (W) => {
|
|
3645
3663
|
const ye = Se.current;
|
|
3646
3664
|
return !!ye && (W < ye.start - 1 || W > ye.end + 5);
|
|
3647
|
-
},
|
|
3665
|
+
}, B = () => {
|
|
3648
3666
|
x(O.current) || C("seekTo", [O.current, !0]);
|
|
3649
3667
|
}, ce = () => K.current;
|
|
3650
3668
|
return S(() => {
|
|
3651
3669
|
const W = (ye) => {
|
|
3652
|
-
var Fe, Ae, he, _e,
|
|
3670
|
+
var Fe, Ae, he, _e, Ve, $, Me, ue, ae, fe, Ye, U, R, q, se, de;
|
|
3653
3671
|
if (ye.source !== ((Fe = f.current) == null ? void 0 : Fe.contentWindow) || typeof ye.data != "string") return;
|
|
3654
3672
|
let G = null;
|
|
3655
3673
|
try {
|
|
@@ -3657,9 +3675,9 @@ function $c({ ytId: t, title: e, t: n, playing: r, seekN: s, onToggle: a, onAd:
|
|
|
3657
3675
|
} catch {
|
|
3658
3676
|
return;
|
|
3659
3677
|
}
|
|
3660
|
-
(he = (Ae = G == null ? void 0 : G.info) == null ? void 0 : Ae.videoData) != null && he.isLive && (
|
|
3678
|
+
(he = (Ae = G == null ? void 0 : G.info) == null ? void 0 : Ae.videoData) != null && he.isLive && (V.current = !0);
|
|
3661
3679
|
const ke = (_e = G == null ? void 0 : G.info) == null ? void 0 : _e.duration;
|
|
3662
|
-
typeof ke == "number" && ke > 0 && !
|
|
3680
|
+
typeof ke == "number" && ke > 0 && !V.current && (D.current == null ? D.current = ke : (Y.current = Math.abs(ke - D.current) > 1.5, _())), (G == null ? void 0 : G.event) === "onReady" && ((!F.current || F.current.muted) && C("mute"), Te(), (Ve = F.current) == null || Ve.onInfo({ ready: !0 })), typeof (($ = G == null ? void 0 : G.info) == null ? void 0 : $.playerState) == "number" && (G.info.playerState !== L.current && (G.info.playerState === 1 || G.info.playerState === 2) && Te(), L.current = G.info.playerState, ne(G.info.playerState !== 1 && G.info.playerState !== 3), (Me = F.current) == null || Me.onInfo({ state: G.info.playerState }));
|
|
3663
3681
|
const Ie = (ue = G == null ? void 0 : G.info) == null ? void 0 : ue.progressState;
|
|
3664
3682
|
if (Ie && typeof Ie.seekableStart == "number" && typeof Ie.seekableEnd == "number" && Ie.seekableEnd > Ie.seekableStart) {
|
|
3665
3683
|
const Oe = Se.current == null;
|
|
@@ -3683,11 +3701,11 @@ function $c({ ytId: t, title: e, t: n, playing: r, seekN: s, onToggle: a, onAd:
|
|
|
3683
3701
|
return;
|
|
3684
3702
|
}
|
|
3685
3703
|
const W = ce();
|
|
3686
|
-
T && (W == null || Math.abs(W - O.current) > 1.5) &&
|
|
3704
|
+
T && (W == null || Math.abs(W - O.current) > 1.5) && B(), C(T ? "playVideo" : "pauseVideo");
|
|
3687
3705
|
}, [T, Z, H]), S(() => {
|
|
3688
3706
|
if (!Z || s === 0 || H || d) return;
|
|
3689
3707
|
const W = ce();
|
|
3690
|
-
(W == null || Math.abs(W - O.current) > 0.5) &&
|
|
3708
|
+
(W == null || Math.abs(W - O.current) > 0.5) && B(), T || C("pauseVideo");
|
|
3691
3709
|
}, [s, Z]), S(() => {
|
|
3692
3710
|
if (!Z) return;
|
|
3693
3711
|
let W = null, ye = 0;
|
|
@@ -3712,8 +3730,8 @@ function $c({ ytId: t, title: e, t: n, playing: r, seekN: s, onToggle: a, onAd:
|
|
|
3712
3730
|
const Qc = /* @__PURE__ */ g(be, { children: [
|
|
3713
3731
|
/* @__PURE__ */ i("rect", { x: "6.5", y: "5", width: "3.75", height: "14", rx: "1.2" }),
|
|
3714
3732
|
/* @__PURE__ */ i("rect", { x: "13.75", y: "5", width: "3.75", height: "14", rx: "1.2" })
|
|
3715
|
-
] }),
|
|
3716
|
-
function
|
|
3733
|
+
] }), Vc = /* @__PURE__ */ i("path", { d: "M7.5 5.6a1 1 0 0 1 1.52-.85l9.1 5.55a1 1 0 0 1 0 1.7l-9.1 5.55a1 1 0 0 1-1.52-.85V5.6Z" });
|
|
3734
|
+
function Bc({ player: t, size: e }) {
|
|
3717
3735
|
const n = t.muted ? "Unmute" : "Mute";
|
|
3718
3736
|
return /* @__PURE__ */ i("button", { type: "button", className: `mutebtn${e < 36 ? " mutebtn--sm" : e > 36 ? " mutebtn--lg" : ""}`, "aria-label": n, title: n, "aria-pressed": t.muted, onClick: t.toggleMute, children: /* @__PURE__ */ i(oe, { d: t.muted ? X.volumeOff : X.volume, size: 17, sw: 1.6, style: { color: t.muted ? "var(--ink-38)" : "var(--ink-70)" } }) });
|
|
3719
3737
|
}
|
|
@@ -3752,7 +3770,7 @@ function qc(t, e, n, r) {
|
|
|
3752
3770
|
N.current = n;
|
|
3753
3771
|
const m = j(r);
|
|
3754
3772
|
m.current = r;
|
|
3755
|
-
const [b, C] = k(!1), D = j(!1),
|
|
3773
|
+
const [b, C] = k(!1), D = j(!1), V = (Q) => {
|
|
3756
3774
|
D.current = Q, C(Q);
|
|
3757
3775
|
}, Y = (Q, H) => {
|
|
3758
3776
|
var E;
|
|
@@ -3775,16 +3793,16 @@ function qc(t, e, n, r) {
|
|
|
3775
3793
|
const H = () => {
|
|
3776
3794
|
const E = T.current, x = E.t + Math.min(1.2, (performance.now() - E.at) / 1e3);
|
|
3777
3795
|
if (m.current != null && x >= m.current) {
|
|
3778
|
-
|
|
3796
|
+
V(!0), Y("pauseVideo"), p(x);
|
|
3779
3797
|
return;
|
|
3780
3798
|
}
|
|
3781
3799
|
x > y.current && p(x), Q = requestAnimationFrame(H);
|
|
3782
3800
|
};
|
|
3783
3801
|
return Q = requestAnimationFrame(H), () => cancelAnimationFrame(Q);
|
|
3784
3802
|
}, [l]), S(() => {
|
|
3785
|
-
!b || r == null || r < f + 1.5 || (
|
|
3803
|
+
!b || r == null || r < f + 1.5 || (V(!1), Y("playVideo"));
|
|
3786
3804
|
}, [b, r, f]), S(() => {
|
|
3787
|
-
r == null && D.current && (
|
|
3805
|
+
r == null && D.current && (V(!1), Y("playVideo"));
|
|
3788
3806
|
}, [r]);
|
|
3789
3807
|
const w = t.length ? ((De = t[t.length - 1].words[t[t.length - 1].words.length - 1]) == null ? void 0 : De.end) ?? t[t.length - 1].start + 4 : 0, _ = e || w || 1, O = ze(() => {
|
|
3790
3808
|
if (!t.length) return 0;
|
|
@@ -3807,7 +3825,7 @@ function qc(t, e, n, r) {
|
|
|
3807
3825
|
}
|
|
3808
3826
|
Y("playVideo"), Z(3);
|
|
3809
3827
|
}, pe = () => {
|
|
3810
|
-
ie.current = !1, window.clearTimeout(ne.current), o.current = !1,
|
|
3828
|
+
ie.current = !1, window.clearTimeout(ne.current), o.current = !1, V(!1), Y("pauseVideo");
|
|
3811
3829
|
}, le = () => {
|
|
3812
3830
|
if (!a.current) {
|
|
3813
3831
|
o.current = !0;
|
|
@@ -3818,7 +3836,7 @@ function qc(t, e, n, r) {
|
|
|
3818
3836
|
return;
|
|
3819
3837
|
}
|
|
3820
3838
|
if (D.current) {
|
|
3821
|
-
|
|
3839
|
+
V(!1);
|
|
3822
3840
|
return;
|
|
3823
3841
|
}
|
|
3824
3842
|
f >= _ - 0.25 && L(0), J();
|
|
@@ -3836,7 +3854,7 @@ function qc(t, e, n, r) {
|
|
|
3836
3854
|
return { player: {
|
|
3837
3855
|
autoplay: async () => {
|
|
3838
3856
|
const Q = (E) => new Promise((x) => setTimeout(x, E)), H = async (E, x) => {
|
|
3839
|
-
for (let
|
|
3857
|
+
for (let B = 0; B < x / 250 && !E(); B++) await Q(250);
|
|
3840
3858
|
return E();
|
|
3841
3859
|
};
|
|
3842
3860
|
if (!await H(() => a.current, 1e4)) return null;
|
|
@@ -3893,7 +3911,7 @@ function Kc(t, e, n, r, s = 0, a = null) {
|
|
|
3893
3911
|
f.current = M;
|
|
3894
3912
|
const p = j(!1), [y, T] = k(null), [N, m] = k(!1), b = j(s);
|
|
3895
3913
|
b.current = s;
|
|
3896
|
-
const C = j(null), [D,
|
|
3914
|
+
const C = j(null), [D, V] = k(0);
|
|
3897
3915
|
S(() => {
|
|
3898
3916
|
m(!1);
|
|
3899
3917
|
const x = C.current;
|
|
@@ -3901,19 +3919,19 @@ function Kc(t, e, n, r, s = 0, a = null) {
|
|
|
3901
3919
|
c(!1), o.current = null;
|
|
3902
3920
|
return;
|
|
3903
3921
|
}
|
|
3904
|
-
const
|
|
3905
|
-
return
|
|
3906
|
-
m(!0),
|
|
3922
|
+
const B = _i(t), ce = b.current;
|
|
3923
|
+
return B.preload = "metadata", B.muted = f.current || p.current, B.onplay = () => c(!0), B.onpause = () => c(!1), B.onended = () => c(!1), B.onloadedmetadata = () => {
|
|
3924
|
+
m(!0), B.currentTime = ((x == null ? void 0 : x.t) ?? 0) + ce, x != null && x.playing && B.play().catch((W) => {
|
|
3907
3925
|
x.asked && (W == null ? void 0 : W.name) === "NotAllowedError" || T(It(W));
|
|
3908
3926
|
});
|
|
3909
|
-
},
|
|
3927
|
+
}, B.onerror = () => {
|
|
3910
3928
|
c(!1);
|
|
3911
|
-
const W =
|
|
3929
|
+
const W = B.error, ye = No(W, !1);
|
|
3912
3930
|
Mo(t).then((G) => {
|
|
3913
|
-
Sc(G == null ? void 0 : G.message) || Ai(W), o.current ===
|
|
3931
|
+
Sc(G == null ? void 0 : G.message) || Ai(W), o.current === B && (T({ message: (G == null ? void 0 : G.message) ?? ye }), G != null && G.permanent || (o.current = null));
|
|
3914
3932
|
});
|
|
3915
|
-
}, o.current =
|
|
3916
|
-
C.current = { t: Math.max(0,
|
|
3933
|
+
}, o.current = B, () => {
|
|
3934
|
+
C.current = { t: Math.max(0, B.currentTime - ce), playing: !B.paused && !B.ended }, B.pause(), B.onplay = B.onpause = B.onended = B.onloadedmetadata = B.onerror = null, o.current = null;
|
|
3917
3935
|
};
|
|
3918
3936
|
}, [t, D]), S(() => () => {
|
|
3919
3937
|
C.current = null;
|
|
@@ -3938,7 +3956,7 @@ function Kc(t, e, n, r, s = 0, a = null) {
|
|
|
3938
3956
|
}, [_, a, u]), S(() => {
|
|
3939
3957
|
if (!l) return;
|
|
3940
3958
|
let x = 0;
|
|
3941
|
-
const
|
|
3959
|
+
const B = () => {
|
|
3942
3960
|
const ce = o.current;
|
|
3943
3961
|
if (ce) {
|
|
3944
3962
|
const W = ce.currentTime - b.current;
|
|
@@ -3952,29 +3970,29 @@ function Kc(t, e, n, r, s = 0, a = null) {
|
|
|
3952
3970
|
}
|
|
3953
3971
|
d(W);
|
|
3954
3972
|
}
|
|
3955
|
-
x = requestAnimationFrame(
|
|
3973
|
+
x = requestAnimationFrame(B);
|
|
3956
3974
|
};
|
|
3957
|
-
return x = requestAnimationFrame(
|
|
3975
|
+
return x = requestAnimationFrame(B), () => cancelAnimationFrame(x);
|
|
3958
3976
|
}, [l]);
|
|
3959
3977
|
const L = ze(() => {
|
|
3960
3978
|
if (!n.length) return 0;
|
|
3961
3979
|
let x = 0;
|
|
3962
|
-
for (let
|
|
3980
|
+
for (let B = 0; B < n.length; B++) n[B].start <= u + 0.05 && (x = B);
|
|
3963
3981
|
return x;
|
|
3964
3982
|
}, [n, u]), [ie, ne] = k(0), Z = (x) => {
|
|
3965
|
-
const
|
|
3966
|
-
d(
|
|
3983
|
+
const B = w.current != null ? Math.min(x, Math.max(0, w.current - 0.5)) : x, ce = o.current;
|
|
3984
|
+
d(B), ce && (ce.currentTime = B + b.current), ne((W) => W + 1);
|
|
3967
3985
|
}, J = (x) => {
|
|
3968
3986
|
(x == null ? void 0 : x.name) !== "AbortError" && T(It(x));
|
|
3969
3987
|
}, pe = () => {
|
|
3970
|
-
var
|
|
3988
|
+
var B;
|
|
3971
3989
|
const x = o.current;
|
|
3972
3990
|
if (!x) {
|
|
3973
3991
|
if (!t && e) {
|
|
3974
|
-
C.current = (
|
|
3992
|
+
C.current = (B = C.current) != null && B.asked ? null : { t: u, playing: !0, asked: !0 };
|
|
3975
3993
|
return;
|
|
3976
3994
|
}
|
|
3977
|
-
t &&
|
|
3995
|
+
t && V((ce) => ce + 1), T({ message: e ? "The audio player is not ready yet — try again in a moment." : "There is no audio for this transcription." });
|
|
3978
3996
|
return;
|
|
3979
3997
|
}
|
|
3980
3998
|
if (l) {
|
|
@@ -3987,14 +4005,14 @@ function Kc(t, e, n, r, s = 0, a = null) {
|
|
|
3987
4005
|
}
|
|
3988
4006
|
x.currentTime < b.current && (x.currentTime = b.current), u >= I - 0.25 && Z(0), x.play().catch(J);
|
|
3989
4007
|
}, le = (x) => {
|
|
3990
|
-
const
|
|
3991
|
-
|
|
4008
|
+
const B = n[Math.max(0, Math.min(n.length - 1, x))];
|
|
4009
|
+
B && Z(B.start);
|
|
3992
4010
|
}, Te = (x) => Z(Math.max(0, Math.min(1, x)) * I), je = (x) => {
|
|
3993
|
-
const
|
|
3994
|
-
Z(
|
|
4011
|
+
const B = En(x, n, I);
|
|
4012
|
+
Z(B.t);
|
|
3995
4013
|
const ce = o.current;
|
|
3996
4014
|
if (ce) {
|
|
3997
|
-
if (!
|
|
4015
|
+
if (!B.playing) {
|
|
3998
4016
|
ce.pause();
|
|
3999
4017
|
return;
|
|
4000
4018
|
}
|
|
@@ -4002,8 +4020,8 @@ function Kc(t, e, n, r, s = 0, a = null) {
|
|
|
4002
4020
|
}
|
|
4003
4021
|
}, Se = (x) => Z(x.start), ve = (x) => {
|
|
4004
4022
|
le(x);
|
|
4005
|
-
const
|
|
4006
|
-
|
|
4023
|
+
const B = o.current;
|
|
4024
|
+
B && B.paused && B.play().catch(J);
|
|
4007
4025
|
}, we = j(!1), Ee = j(0), Re = () => {
|
|
4008
4026
|
var x;
|
|
4009
4027
|
l && ((x = o.current) == null || x.pause(), we.current = !0);
|
|
@@ -4016,17 +4034,17 @@ function Kc(t, e, n, r, s = 0, a = null) {
|
|
|
4016
4034
|
const x = o.current;
|
|
4017
4035
|
if (!x) return null;
|
|
4018
4036
|
x.currentTime < b.current && (x.currentTime = b.current);
|
|
4019
|
-
const
|
|
4037
|
+
const B = (ce) => {
|
|
4020
4038
|
f.current = ce, x.muted = ce || p.current, h(ce);
|
|
4021
4039
|
};
|
|
4022
4040
|
try {
|
|
4023
|
-
return
|
|
4041
|
+
return B(!1), await x.play(), !0;
|
|
4024
4042
|
} catch (ce) {
|
|
4025
4043
|
if ((ce == null ? void 0 : ce.name) !== "NotAllowedError")
|
|
4026
|
-
return
|
|
4044
|
+
return B(!0), null;
|
|
4027
4045
|
}
|
|
4028
4046
|
try {
|
|
4029
|
-
return
|
|
4047
|
+
return B(!0), await x.play(), !1;
|
|
4030
4048
|
} catch {
|
|
4031
4049
|
return null;
|
|
4032
4050
|
}
|
|
@@ -4052,10 +4070,10 @@ function Kc(t, e, n, r, s = 0, a = null) {
|
|
|
4052
4070
|
x && (x.pause(), x.currentTime = b.current), d(0);
|
|
4053
4071
|
},
|
|
4054
4072
|
videoAt: (x) => {
|
|
4055
|
-
const
|
|
4056
|
-
if (!
|
|
4073
|
+
const B = o.current;
|
|
4074
|
+
if (!B || B.paused || B.ended || we.current || Date.now() - Ee.current < 3e3) return;
|
|
4057
4075
|
const ce = x + b.current;
|
|
4058
|
-
Math.abs(
|
|
4076
|
+
Math.abs(B.currentTime - ce) <= 0.2 || (Ee.current = Date.now(), B.currentTime = ce);
|
|
4059
4077
|
},
|
|
4060
4078
|
engaged: l || u > 0,
|
|
4061
4079
|
prev: () => le(L - 1),
|
|
@@ -4068,8 +4086,8 @@ function Kc(t, e, n, r, s = 0, a = null) {
|
|
|
4068
4086
|
edgeWait: _,
|
|
4069
4087
|
wordSync: !0,
|
|
4070
4088
|
pause: () => {
|
|
4071
|
-
var x,
|
|
4072
|
-
K(!1), (x = C.current) != null && x.asked && (C.current = null), (
|
|
4089
|
+
var x, B;
|
|
4090
|
+
K(!1), (x = C.current) != null && x.asked && (C.current = null), (B = o.current) == null || B.pause();
|
|
4073
4091
|
},
|
|
4074
4092
|
setVolume: (x) => {
|
|
4075
4093
|
o.current && (o.current.volume = x);
|
|
@@ -4084,7 +4102,7 @@ function Jc(t, e, n, r, s, a, o = !1, l) {
|
|
|
4084
4102
|
c.current = l ?? c.current;
|
|
4085
4103
|
const u = j(null), [d, M] = k(!1), [h, f] = k(0), [p, y] = k(0), [T, N] = k(!1), m = j(T);
|
|
4086
4104
|
m.current = T;
|
|
4087
|
-
const [b, C] = k(null), [D,
|
|
4105
|
+
const [b, C] = k(null), [D, V] = k(null), [Y, ee] = k(null), [I, F] = k(null), A = j(I);
|
|
4088
4106
|
A.current = I;
|
|
4089
4107
|
const [w, _] = k(null), [O, te] = k(null), [K, L] = k(null), [ie, ne] = k(!1), Z = j(e);
|
|
4090
4108
|
Z.current = e;
|
|
@@ -4095,7 +4113,7 @@ function Jc(t, e, n, r, s, a, o = !1, l) {
|
|
|
4095
4113
|
const je = j(a);
|
|
4096
4114
|
je.current = a;
|
|
4097
4115
|
const Se = Ke((U) => {
|
|
4098
|
-
U.finite = !0, U.coming = (R) => c.current.has(R), U.readAhead = 6, U.readAheadS = 45, U.onWaiting = (R) =>
|
|
4116
|
+
U.finite = !0, U.coming = (R) => c.current.has(R), U.readAhead = 6, U.readAheadS = 45, U.onWaiting = (R) => V(R), U.onStarting = (R) => ee(R), U.onSentence = (R) => {
|
|
4099
4117
|
if (M(U.playing), R == null) return;
|
|
4100
4118
|
const q = Z.current.findIndex((se) => se.sentenceId === R);
|
|
4101
4119
|
q >= 0 && f(q);
|
|
@@ -4149,9 +4167,9 @@ function Jc(t, e, n, r, s, a, o = !1, l) {
|
|
|
4149
4167
|
var U;
|
|
4150
4168
|
(U = u.current) == null || U.stop(), u.current = null, ve.current = null;
|
|
4151
4169
|
}, []);
|
|
4152
|
-
const
|
|
4170
|
+
const B = w != null || O != null;
|
|
4153
4171
|
S(() => {
|
|
4154
|
-
if (!d && !
|
|
4172
|
+
if (!d && !B) {
|
|
4155
4173
|
_(null), te(null);
|
|
4156
4174
|
return;
|
|
4157
4175
|
}
|
|
@@ -4167,7 +4185,7 @@ function Jc(t, e, n, r, s, a, o = !1, l) {
|
|
|
4167
4185
|
U();
|
|
4168
4186
|
const R = setInterval(U, 100);
|
|
4169
4187
|
return () => clearInterval(R);
|
|
4170
|
-
}, [d,
|
|
4188
|
+
}, [d, B]);
|
|
4171
4189
|
const ce = ze(() => new Set(t.map((U) => U.sentenceId)), [t]), W = (U) => {
|
|
4172
4190
|
var q;
|
|
4173
4191
|
const R = (q = e[U]) == null ? void 0 : q.sentenceId;
|
|
@@ -4184,7 +4202,7 @@ function Jc(t, e, n, r, s, a, o = !1, l) {
|
|
|
4184
4202
|
var q, se, de;
|
|
4185
4203
|
const R = Math.max(0, Math.min(Math.max(0, e.length - 1), U));
|
|
4186
4204
|
f(R), Ae.current = R, y((Oe) => Oe + 1), (se = u.current) == null || se.seek(((q = e[R]) == null ? void 0 : q.sentenceId) ?? null), M(!!((de = u.current) != null && de.playing));
|
|
4187
|
-
},
|
|
4205
|
+
}, Ve = (U) => {
|
|
4188
4206
|
var R;
|
|
4189
4207
|
E(), F(null), (R = u.current) == null || R.startWithin(-1, 0), _e(U);
|
|
4190
4208
|
}, $ = (U) => {
|
|
@@ -4245,7 +4263,7 @@ function Jc(t, e, n, r, s, a, o = !1, l) {
|
|
|
4245
4263
|
var U, R, q;
|
|
4246
4264
|
E(), (U = u.current) == null || U.pause(), M(!1), f(0), _(null), (q = u.current) == null || q.seek(((R = e[0]) == null ? void 0 : R.sentenceId) ?? null);
|
|
4247
4265
|
},
|
|
4248
|
-
seekRow:
|
|
4266
|
+
seekRow: Ve,
|
|
4249
4267
|
resumeAt: (U) => {
|
|
4250
4268
|
H(U), t.some((R) => R.sentenceId >= (U.sentenceId ?? 0)) && (H(null), Q.current(U));
|
|
4251
4269
|
},
|
|
@@ -4289,11 +4307,11 @@ function Jc(t, e, n, r, s, a, o = !1, l) {
|
|
|
4289
4307
|
},
|
|
4290
4308
|
prev: () => {
|
|
4291
4309
|
const U = ye(G - 1, -1);
|
|
4292
|
-
U != null &&
|
|
4310
|
+
U != null && Ve(U);
|
|
4293
4311
|
},
|
|
4294
4312
|
next: () => {
|
|
4295
4313
|
const U = ye(G + 1, 1);
|
|
4296
|
-
U != null &&
|
|
4314
|
+
U != null && Ve(U);
|
|
4297
4315
|
},
|
|
4298
4316
|
hold: () => {
|
|
4299
4317
|
var U;
|
|
@@ -4332,11 +4350,11 @@ const Xc = () => {
|
|
|
4332
4350
|
}, eu = "The language this recording is read aloud in.", tu = { title: "READ IN", note: "The transcript and its voice switch to this language." };
|
|
4333
4351
|
function nu({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, langs: o, srcLang: l, canTranslate: c, pickedLang: u, setPickedLang: d, side: M, hearOriginal: h = !1, timed: f = !1, stockVoices: p = !1, stickyPicker: y = !1, pickerBusy: T = null, voiceSheet: N, forcedVoice: m = null }) {
|
|
4334
4352
|
var mn, xt, Nn, an;
|
|
4335
|
-
const { onAddVoice: b, onPickVoice: C, onSelectSpeaker: D, noCloneFor:
|
|
4353
|
+
const { onAddVoice: b, onPickVoice: C, onSelectSpeaker: D, noCloneFor: V, castNoClone: Y, castShort: ee, castBuilding: I, castWarn: F, badge: A, titleNode: w } = N ?? {}, _ = !!N, O = !!(N != null && N.pendingClones), [te, K] = $i(), [L, ie] = k(null), [ne, Z] = k(!1), [J, pe] = k(!1), [le, Te] = k(!1), [je, Se] = k(!1), ve = u ?? l, we = u === null, Ee = u != null || L != null, De = ((P) => !!P && !!(o != null && o.voice.includes(P)))(we ? l : ve) ? we ? l : ve : "en", Q = Ec(De), H = (N == null ? void 0 : N.cloneOn) ?? !0, [E, x] = k(0), B = j(H);
|
|
4336
4354
|
S(() => {
|
|
4337
|
-
|
|
4355
|
+
B.current !== H && (B.current = H, x((P) => P + 1));
|
|
4338
4356
|
}, [H]);
|
|
4339
|
-
const ce = gc(De, Ee || s || J, fc(e) * 1e3 + E, { id: t ?? null, shareCode: a.shareCode ?? null }), W = ze(() => ((ce == null ? void 0 : ce.voices) ?? []).filter((P) => _ || !P.cloned || P.speaker != null), [ce, _]), ye = W.length > 1, G = Dr(o, ve), ke = ea(), Ie = ze(() => Qi(o, "translation"), [o]), [Fe, Ae] = k(null), [he] = k(() => /* @__PURE__ */ new Set()), [_e,
|
|
4357
|
+
const ce = gc(De, Ee || s || J, fc(e) * 1e3 + E, { id: t ?? null, shareCode: a.shareCode ?? null }), W = ze(() => ((ce == null ? void 0 : ce.voices) ?? []).filter((P) => _ || !P.cloned || P.speaker != null), [ce, _]), ye = W.length > 1, G = Dr(o, ve), ke = ea(), Ie = ze(() => Qi(o, "translation"), [o]), [Fe, Ae] = k(null), [he] = k(() => /* @__PURE__ */ new Set()), [_e, Ve] = k({}), $ = ze(() => cc(n, e, ke.vcUnknownSpk), [n, e, ke]), Me = ye && $.filter((P) => P.key >= 0).length > 1, ue = Fe != null && $.some((P) => P.key === Fe) ? Fe : ((mn = $[0]) == null ? void 0 : mn.key) ?? null, ae = ze(() => {
|
|
4340
4358
|
const P = Ti($, W, H);
|
|
4341
4359
|
for (const [xe, Qe] of Object.entries(_e[De ?? ""] ?? {})) P.set(Number(xe), Qe);
|
|
4342
4360
|
return P;
|
|
@@ -4373,12 +4391,12 @@ function nu({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, lan
|
|
|
4373
4391
|
pause: () => {
|
|
4374
4392
|
Se(!1), $e.pause();
|
|
4375
4393
|
}
|
|
4376
|
-
}, st = () => Z(!0),
|
|
4394
|
+
}, st = () => Z(!0), Be = () => {
|
|
4377
4395
|
Z(!1), pe(le), Te(!1);
|
|
4378
4396
|
}, Mn = (P) => {
|
|
4379
4397
|
if (d(P), K(P), !((M || y) && !le)) {
|
|
4380
4398
|
if (P != null) {
|
|
4381
|
-
|
|
4399
|
+
Be();
|
|
4382
4400
|
return;
|
|
4383
4401
|
}
|
|
4384
4402
|
Q.reset(), Z(!1), pe(!1), Te(!1);
|
|
@@ -4402,11 +4420,11 @@ function nu({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, lan
|
|
|
4402
4420
|
}, gn = (P) => {
|
|
4403
4421
|
if (Q.reset(), pe(Me), (ve !== De || we) && d(De), Ne.forget(), Se(!0), Me && ue != null && De) {
|
|
4404
4422
|
const xe = new Map(ae);
|
|
4405
|
-
xe.set(ue, P),
|
|
4423
|
+
xe.set(ue, P), Ve((Qe) => ({ ...Qe, [De]: Object.fromEntries(xe) })), ie(null);
|
|
4406
4424
|
return;
|
|
4407
4425
|
}
|
|
4408
4426
|
ie(P);
|
|
4409
|
-
}, z = we ? { ...Dr(o, null), flag: /* @__PURE__ */ i(oe, { d: X.langAuto, size: 21, sw: 1.7, style: { color: "currentColor", display: "block" } }) } : G, Wn = c ? M ? /* @__PURE__ */ i("span", { className: "barchip", style: lt ? { background: "var(--brand-tint)", boxShadow: "0 0 0 1.5px var(--brand)" } : void 0, children: /* @__PURE__ */ i(Rn, { flag: z.flag, code: z.code, bordered: !1, onClick: tn, flagOnly: !0, label: z.label }) }) : /* @__PURE__ */ i(Rn, { flag: z.flag, code: z.code, bordered: !1, onClick: st, flagOnly: !0, label: z.label }) : null, Et = X.voiceClone, _t = Ee && (!!Ne.track || ut), Yt = it ? "var(--conf-low)" : _t || M && at ? "var(--brand)" : "var(--ink-55)", Ft = Yc({ on: Ee, want: je, relang: rt, playing: $e.playing, preparing: !!$e.preparing, starting: $e.starting }), [fn] = oa(Ft === "line", 400), qe = Ft === "asked" || Ft === "line" && fn, ot = ut || qe, nn = Ft === "asked" ? wi : $e.preparing ? `Speaking this line in ${(Le == null ? void 0 : Le.name) ?? "this voice"}…` : ut ? `Preparing this recording in ${(Le == null ? void 0 : Le.name) ?? "this voice"} — it will play as soon as it is ready` : it ? `This voice could not be prepared: ${it}` : se ? ye ? "Choose a voice" : Le ? Le.name : ke.vcNoVoice + G.label : `${ke.vcNoVoice}${G.label}`, mt = /* @__PURE__ */ i(Io, { open: ne, onClose:
|
|
4427
|
+
}, z = we ? { ...Dr(o, null), flag: /* @__PURE__ */ i(oe, { d: X.langAuto, size: 21, sw: 1.7, style: { color: "currentColor", display: "block" } }) } : G, Wn = c ? M ? /* @__PURE__ */ i("span", { className: "barchip", style: lt ? { background: "var(--brand-tint)", boxShadow: "0 0 0 1.5px var(--brand)" } : void 0, children: /* @__PURE__ */ i(Rn, { flag: z.flag, code: z.code, bordered: !1, onClick: tn, flagOnly: !0, label: z.label }) }) : /* @__PURE__ */ i(Rn, { flag: z.flag, code: z.code, bordered: !1, onClick: st, flagOnly: !0, label: z.label }) : null, Et = X.voiceClone, _t = Ee && (!!Ne.track || ut), Yt = it ? "var(--conf-low)" : _t || M && at ? "var(--brand)" : "var(--ink-55)", Ft = Yc({ on: Ee, want: je, relang: rt, playing: $e.playing, preparing: !!$e.preparing, starting: $e.starting }), [fn] = oa(Ft === "line", 400), qe = Ft === "asked" || Ft === "line" && fn, ot = ut || qe, nn = Ft === "asked" ? wi : $e.preparing ? `Speaking this line in ${(Le == null ? void 0 : Le.name) ?? "this voice"}…` : ut ? `Preparing this recording in ${(Le == null ? void 0 : Le.name) ?? "this voice"} — it will play as soon as it is ready` : it ? `This voice could not be prepared: ${it}` : se ? ye ? "Choose a voice" : Le ? Le.name : ke.vcNoVoice + G.label : `${ke.vcNoVoice}${G.label}`, mt = /* @__PURE__ */ i(Io, { open: ne, onClose: Be, keepOpen: (!!M || y) && !le, value: we ? null : ve, onSelect: Mn, languages: Ie, title: (M == null ? void 0 : M.title) ?? "SPOKEN LANGUAGE", note: (M == null ? void 0 : M.note) ?? eu, searchPlaceholder: ke.search, none: "Original", pinned: (we ? l : ve) ? [we ? l : ve] : [], recent: te, requireVoice: le, sticky: y, busy: T }), gt = ze(() => W.filter((P) => P.cloned && !P.auto), [W]), Zt = (P) => P.voiceId ? gt.find((xe) => xe.id === `clone:${P.voiceId}`) ?? null : null, dt = ze(() => $.filter((P) => P.key >= 0), [$]), rn = ze(() => {
|
|
4410
4428
|
const P = W.filter((Qe) => !Qe.cloned);
|
|
4411
4429
|
if (!Me) return [...P, ...s && dt.length === 1 ? gt.filter((Qe) => Qe.id === `clone:${dt[0].voiceId}`) : []];
|
|
4412
4430
|
const xe = [];
|
|
@@ -4447,7 +4465,7 @@ function nu({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, lan
|
|
|
4447
4465
|
onAdd: (P) => {
|
|
4448
4466
|
Q.reset(), b == null || b(P);
|
|
4449
4467
|
},
|
|
4450
|
-
noClone: ct && !Ze.some((P) => P.cloned) ? (
|
|
4468
|
+
noClone: ct && !Ze.some((P) => P.cloned) ? (V == null ? void 0 : V(ct, Ut(ct.key), wt)) ?? null : null,
|
|
4451
4469
|
usedBy: Me && ue != null ? (P) => {
|
|
4452
4470
|
const xe = $.filter((Qe) => Qe.key !== ue && ae.get(Qe.key) === P.id);
|
|
4453
4471
|
return xe.length ? xe.map((Qe) => Qe.name).join(", ") : null;
|
|
@@ -4510,7 +4528,7 @@ function nu({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, lan
|
|
|
4510
4528
|
armVoice: Q.arm,
|
|
4511
4529
|
resetPreview: Q.reset,
|
|
4512
4530
|
armedId: Q.armId,
|
|
4513
|
-
resetCast: () =>
|
|
4531
|
+
resetCast: () => Ve((P) => ({ ...P, [De ?? ""]: {} })),
|
|
4514
4532
|
readLang: typeof u == "string" && u !== l ? u : null,
|
|
4515
4533
|
readVoiceKey: m || (U ?? L ?? ((an = Ne.track) == null ? void 0 : an.voiceKey) ?? ""),
|
|
4516
4534
|
pickedVoiceKey: U ?? L ?? null,
|
|
@@ -4521,12 +4539,12 @@ function nu({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, lan
|
|
|
4521
4539
|
clips: Ne.clips,
|
|
4522
4540
|
setNear: Ne.setNear,
|
|
4523
4541
|
closePicker: () => {
|
|
4524
|
-
lt &&
|
|
4542
|
+
lt && Be();
|
|
4525
4543
|
},
|
|
4526
4544
|
langList: { value: we ? null : ve, onSelect: Mn, languages: Ie, searchPlaceholder: ke.search, none: "Original", pinned: (we ? l : ve) ? [we ? l : ve] : [], recent: te }
|
|
4527
4545
|
};
|
|
4528
4546
|
}
|
|
4529
|
-
function ru({ model: t, rows: e, player: n, fixed: r, applied: s, onFixOpen: a, onWord: o, onFix: l, fixMode: c, fixingId: u, marks: d = !0, fixBadges: M = !0, tail: h, tailFg: f, running: p, desk: y, feedRef: T, listener: N, showLabels: m, find: b, findOpen: C, lang: D, warm:
|
|
4547
|
+
function ru({ model: t, rows: e, player: n, fixed: r, applied: s, onFixOpen: a, onWord: o, onFix: l, fixMode: c, fixingId: u, marks: d = !0, fixBadges: M = !0, tail: h, tailFg: f, running: p, desk: y, feedRef: T, listener: N, showLabels: m, find: b, findOpen: C, lang: D, warm: V, onVisible: Y, wordHl: ee = !0 }) {
|
|
4530
4548
|
const { playing: I, engaged: F, t: A, idx: w, seekN: _, wordSync: O, clipPos: te } = n;
|
|
4531
4549
|
jc(!0, T);
|
|
4532
4550
|
const K = j(null);
|
|
@@ -4547,36 +4565,36 @@ function ru({ model: t, rows: e, player: n, fixed: r, applied: s, onFixOpen: a,
|
|
|
4547
4565
|
const G = ye.join(",");
|
|
4548
4566
|
G !== Se.current && (Se.current = G, Y(ye));
|
|
4549
4567
|
}, x = window.setTimeout(E, 120);
|
|
4550
|
-
let
|
|
4568
|
+
let B;
|
|
4551
4569
|
const ce = () => {
|
|
4552
|
-
window.clearTimeout(
|
|
4570
|
+
window.clearTimeout(B), B = window.setTimeout(E, 120);
|
|
4553
4571
|
};
|
|
4554
4572
|
return H.addEventListener("scroll", ce, { passive: !0 }), () => {
|
|
4555
|
-
window.clearTimeout(x), window.clearTimeout(
|
|
4573
|
+
window.clearTimeout(x), window.clearTimeout(B), H.removeEventListener("scroll", ce);
|
|
4556
4574
|
};
|
|
4557
4575
|
}, [e, Y, T]);
|
|
4558
4576
|
const ve = (H) => {
|
|
4559
4577
|
const E = T.current, x = je(H);
|
|
4560
4578
|
if (!E || !x) return;
|
|
4561
|
-
const
|
|
4562
|
-
E.scrollTop = Math.max(0, Math.min(ce,
|
|
4579
|
+
const B = x.getBoundingClientRect().top - E.getBoundingClientRect().top + E.scrollTop, ce = E.scrollHeight - E.clientHeight, W = wr(E), ye = Math.max(80, E.clientHeight - W.top - W.bottom), G = x.offsetHeight > ye ? 8 : (ye - x.offsetHeight) / 2;
|
|
4580
|
+
E.scrollTop = Math.max(0, Math.min(ce, B - W.top - G));
|
|
4563
4581
|
}, we = (H) => {
|
|
4564
4582
|
const E = T.current, x = je(H);
|
|
4565
4583
|
if (!E || !E.clientHeight || !E.offsetParent || !x) return 0;
|
|
4566
|
-
const
|
|
4567
|
-
return
|
|
4584
|
+
const B = x.getBoundingClientRect(), ce = E.getBoundingClientRect(), W = wr(E), ye = ce.top + W.top, G = ce.bottom - W.bottom;
|
|
4585
|
+
return B.height > G - ye ? B.top < ye - 4 ? -1 : B.top > G - 60 ? 1 : 0 : B.bottom < ye + 10 ? -1 : B.bottom > G - 4 ? 1 : 0;
|
|
4568
4586
|
}, Ee = (H) => {
|
|
4569
4587
|
pe.current = performance.now() + 420;
|
|
4570
4588
|
const E = T.current, x = je(H);
|
|
4571
4589
|
if (!E || !E.clientHeight || !x) return;
|
|
4572
|
-
const
|
|
4590
|
+
const B = x.getBoundingClientRect(), ce = E.getBoundingClientRect(), W = E.scrollHeight - E.clientHeight, ye = E.scrollTop, G = wr(E), ke = Math.max(80, E.clientHeight - G.top - G.bottom), Ie = B.height > ke ? 8 : (ke - B.height) / 2, Fe = Math.max(0, Math.min(W, ye + (B.top - ce.top) - G.top - Ie));
|
|
4573
4591
|
if (le.current && cancelAnimationFrame(le.current), Math.abs(Fe - ye) < 2) {
|
|
4574
4592
|
E.scrollTop = Fe, le.current = null;
|
|
4575
4593
|
return;
|
|
4576
4594
|
}
|
|
4577
4595
|
const Ae = performance.now(), he = 360, _e = () => {
|
|
4578
|
-
const
|
|
4579
|
-
E.scrollTop = ye + (Fe - ye) * (1 - Math.pow(1 -
|
|
4596
|
+
const Ve = Math.min(1, (performance.now() - Ae) / he);
|
|
4597
|
+
E.scrollTop = ye + (Fe - ye) * (1 - Math.pow(1 - Ve, 3)), le.current = Ve < 1 ? requestAnimationFrame(_e) : null;
|
|
4580
4598
|
};
|
|
4581
4599
|
le.current = requestAnimationFrame(_e);
|
|
4582
4600
|
};
|
|
@@ -4592,8 +4610,8 @@ function ru({ model: t, rows: e, player: n, fixed: r, applied: s, onFixOpen: a,
|
|
|
4592
4610
|
const H = () => {
|
|
4593
4611
|
const x = w !== Te.current;
|
|
4594
4612
|
Te.current = w;
|
|
4595
|
-
let
|
|
4596
|
-
x &&
|
|
4613
|
+
let B = performance.now() < pe.current ? 0 : we(w);
|
|
4614
|
+
x && B && !Re.current && (ve(w), B = 0), Re.current = B, J(B);
|
|
4597
4615
|
};
|
|
4598
4616
|
H();
|
|
4599
4617
|
const E = setInterval(H, 200);
|
|
@@ -4612,10 +4630,10 @@ function ru({ model: t, rows: e, player: n, fixed: r, applied: s, onFixOpen: a,
|
|
|
4612
4630
|
I && Z === -1 && Q("up"),
|
|
4613
4631
|
e.map((H, E) => {
|
|
4614
4632
|
var Me;
|
|
4615
|
-
const x = I && E === w,
|
|
4633
|
+
const x = I && E === w, B = F && E === w, ce = !!u && u === H.id, W = ne && !H.text.toLowerCase().includes(ne) && !(D && ((Me = H.translations[D]) != null && Me.toLowerCase().includes(ne))) ? 0.22 : !F || E <= w || ce ? 1 : 0.38, ye = N ? () => n.playRow(E) : c && l ? () => {
|
|
4616
4634
|
I && !x && n.seekRow(E), l(H);
|
|
4617
|
-
} : I && x ? void 0 : () => n.playRow(E), G = N ? null : rc(H, s, r), ke = !!G && (G.script > 0 || G.manual), Ie = y && !!a && L === H.id && !!G && !ke, Fe = $r(t, H.speaker), Ae = Qr(t, H.speaker), he = Ae.lane, _e = D && H.translations[D] && H.language !== D ? H.translations[D] : null,
|
|
4618
|
-
return /* @__PURE__ */ g("div", { "data-tx-row": E, "data-sentence": H.sentenceId, className: `txline${
|
|
4635
|
+
} : I && x ? void 0 : () => n.playRow(E), G = N ? null : rc(H, s, r), ke = !!G && (G.script > 0 || G.manual), Ie = y && !!a && L === H.id && !!G && !ke, Fe = $r(t, H.speaker), Ae = Qr(t, H.speaker), he = Ae.lane, _e = D && H.translations[D] && H.language !== D ? H.translations[D] : null, Ve = la(e, E, D), $ = B && !O && te ? Ri(Ve.map((ue) => ({ t: ue.text, sp: " " })), te) : null;
|
|
4636
|
+
return /* @__PURE__ */ g("div", { "data-tx-row": E, "data-sentence": H.sentenceId, className: `txline${V ? " txline--warm" : ""}${ce ? " txline--fixing" : ""}`, "aria-current": ce || void 0, style: { opacity: W }, onClick: ye, onMouseEnter: y && a ? () => ie(H.id) : void 0, onMouseLeave: y && a ? () => ie(null) : void 0, children: [
|
|
4619
4637
|
/* @__PURE__ */ g("div", { className: "txline__meta", children: [
|
|
4620
4638
|
/* @__PURE__ */ i("span", { className: "txline__at", children: jt(H.start) }),
|
|
4621
4639
|
m && H.speaker >= 0 && /* @__PURE__ */ g(be, { children: [
|
|
@@ -4627,8 +4645,8 @@ function ru({ model: t, rows: e, player: n, fixed: r, applied: s, onFixOpen: a,
|
|
|
4627
4645
|
G && M && /* @__PURE__ */ i(sc, { f: G, desk: y, onOpen: a ? () => a(H, !0) : void 0 }),
|
|
4628
4646
|
Ie && /* @__PURE__ */ i(ic, { alone: !0, onOpen: () => a == null ? void 0 : a(H, !1) })
|
|
4629
4647
|
] }),
|
|
4630
|
-
/* @__PURE__ */ i("div", { className: "txline__text", children:
|
|
4631
|
-
const fe = `${ue.seq}:${ue.idx}`, Ye = kl(ue.prob), U =
|
|
4648
|
+
/* @__PURE__ */ i("div", { className: "txline__text", children: Ve.map((ue, ae) => {
|
|
4649
|
+
const fe = `${ue.seq}:${ue.idx}`, Ye = kl(ue.prob), U = B && ee, R = U && (O ? A >= ue.start && (A < ue.end || ae === Ve.length - 1 || A < Ve[ae + 1].start) : ae === $), q = U && !R && (O ? ue.start > A : $ != null && ae > $), se = !_e && !N && (!!(r != null && r.has(fe)) || !!ue.script), de = !_e && !N && d && !!Ye && !se, Oe = de ? Ye === "low" ? "var(--conf-low-half)" : "var(--conf-mid-half)" : null, Ne = se ? "var(--brand)" : q ? "var(--ink-40)" : Oe ?? "var(--ink-96)";
|
|
4632
4650
|
return /* @__PURE__ */ g("span", { children: [
|
|
4633
4651
|
/* @__PURE__ */ i(
|
|
4634
4652
|
"span",
|
|
@@ -4812,12 +4830,12 @@ function cu(t) {
|
|
|
4812
4830
|
m(K, L, te), m(L, K, te);
|
|
4813
4831
|
}
|
|
4814
4832
|
}
|
|
4815
|
-
let
|
|
4833
|
+
let V = 0;
|
|
4816
4834
|
for (let w = r - 1; w >= 1; w -= 2) {
|
|
4817
4835
|
w === 6 && (w = 5);
|
|
4818
4836
|
for (let _ = 0; _ < r; _++) for (let O = 0; O < 2; O++) {
|
|
4819
4837
|
const te = w - O, K = w + 1 & 2 ? _ : r - 1 - _;
|
|
4820
|
-
!N[K][te] &&
|
|
4838
|
+
!N[K][te] && V < y.length * 8 && (T[K][te] = (y[V >>> 3] >>> 7 - (V & 7) & 1) !== 0, V++);
|
|
4821
4839
|
}
|
|
4822
4840
|
}
|
|
4823
4841
|
const Y = (w, _, O) => {
|
|
@@ -5029,7 +5047,7 @@ function Un({ t, mini: e }) {
|
|
|
5029
5047
|
}
|
|
5030
5048
|
function _r({ live: t, mini: e, desk: n, pct: r, mark: s }) {
|
|
5031
5049
|
return /* @__PURE__ */ g("div", { className: `gfull__brand${s ? " gfull__brand--mark" : ""}`, children: [
|
|
5032
|
-
/* @__PURE__ */ i("a", { href: Si, target: "_blank", rel: "noopener", style: { display: "block", lineHeight: 0 }, "aria-label": "VocalStack", title: "VocalStack", children: s ? /* @__PURE__ */ i(Yr, { dark: !0, size: 22 }) : /* @__PURE__ */ i(
|
|
5050
|
+
/* @__PURE__ */ i("a", { href: Si, target: "_blank", rel: "noopener", style: { display: "block", lineHeight: 0 }, "aria-label": "VocalStack", title: "VocalStack", children: s ? /* @__PURE__ */ i(Yr, { dark: !0, size: 22 }) : /* @__PURE__ */ i(Bn, { dark: !0, link: !1, height: e ? 11 : n ? 18 : 15 }) }),
|
|
5033
5051
|
t && /* @__PURE__ */ g("span", { className: "gfull__live", children: [
|
|
5034
5052
|
/* @__PURE__ */ i("i", {}),
|
|
5035
5053
|
"LIVE"
|
|
@@ -5064,7 +5082,7 @@ function gu({ pos: t, transport: e, chip: n, voices: r, onShare: s, onFull: a, c
|
|
|
5064
5082
|
] });
|
|
5065
5083
|
}
|
|
5066
5084
|
const fu = { color: "rgba(255,255,255,.4)" };
|
|
5067
|
-
function ha({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title: s, desk: a, pos: o, sub: l, wait: c, pct: u, mute: d, cc: M, ad: h, chip: f, transport: p, picker: y, sheet: T, voices: N, voicesBtn: m, sheetOpen: b, onShare: C, onSettings: D, paused:
|
|
5085
|
+
function ha({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title: s, desk: a, pos: o, sub: l, wait: c, pct: u, mute: d, cc: M, ad: h, chip: f, transport: p, picker: y, sheet: T, voices: N, voicesBtn: m, sheetOpen: b, onShare: C, onSettings: D, paused: V, copied: Y, onTouch: ee, onClose: I }) {
|
|
5068
5086
|
const [F, A] = k(() => !!vr());
|
|
5069
5087
|
S(() => {
|
|
5070
5088
|
const $ = () => A(!!vr());
|
|
@@ -5152,22 +5170,22 @@ function ha({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title:
|
|
|
5152
5170
|
const U = (de) => Math.round((de.getBoundingClientRect().top - $.getBoundingClientRect().top + $.scrollTop) / ae), R = Math.max(1, Math.round($.clientHeight / ae)), q = Me ? ue.length ? Math.floor(U(ue[ue.length - 1]) / R) * R * ae : 0 : Ye, se = Math.max(0, Math.min(Ye, q));
|
|
5153
5171
|
Math.abs(se - $.scrollTop) > 1 && ($.scrollTop = se);
|
|
5154
5172
|
}, [x, H]);
|
|
5155
|
-
const [
|
|
5173
|
+
const [B, ce] = k(!0), [W, ye] = k(!1), G = j(void 0);
|
|
5156
5174
|
S(() => () => window.clearTimeout(G.current), []);
|
|
5157
|
-
const ke =
|
|
5175
|
+
const ke = V != null && V.share ? V.share.url(B && V.share.at >= 1 ? Math.floor(V.share.at) : null) : "", Ie = ze(() => we && ke && !p.playing ? uu(ke) : "", [we, ke, p.playing]), Fe = () => {
|
|
5158
5176
|
var $;
|
|
5159
5177
|
($ = navigator.clipboard) == null || $.writeText(ke).then(() => {
|
|
5160
5178
|
ye(!0), window.clearTimeout(G.current), G.current = window.setTimeout(() => ye(!1), 1800);
|
|
5161
5179
|
}, () => {
|
|
5162
5180
|
});
|
|
5163
|
-
}, Ae = we && (
|
|
5181
|
+
}, Ae = we && (V == null ? void 0 : V.share) && /* @__PURE__ */ g("div", { className: "gfull__sharecard", onPointerDown: ($) => $.stopPropagation(), onClick: ($) => $.stopPropagation(), children: [
|
|
5164
5182
|
Ie && /* @__PURE__ */ i("div", { className: "gfull__shareqr", role: "img", "aria-label": "QR code for this link", style: { backgroundImage: `url("${Ie}")` } }),
|
|
5165
5183
|
/* @__PURE__ */ g("div", { className: "gfull__sharebody", children: [
|
|
5166
5184
|
/* @__PURE__ */ i("div", { className: "gfull__shareeyebrow", children: "SHARE THIS MOMENT" }),
|
|
5167
5185
|
/* @__PURE__ */ g("label", { className: "gfull__shareat", children: [
|
|
5168
|
-
/* @__PURE__ */ i("input", { type: "checkbox", checked:
|
|
5186
|
+
/* @__PURE__ */ i("input", { type: "checkbox", checked: B, onChange: ($) => ce($.target.checked), disabled: V.share.at < 1 }),
|
|
5169
5187
|
"Start at ",
|
|
5170
|
-
jt(Math.floor(
|
|
5188
|
+
jt(Math.floor(V.share.at))
|
|
5171
5189
|
] }),
|
|
5172
5190
|
/* @__PURE__ */ i("div", { className: "gfull__shareurl", children: /* @__PURE__ */ i("span", { children: ke.replace(/^https?:\/\//, "") }) }),
|
|
5173
5191
|
/* @__PURE__ */ g("div", { className: "gfull__shareacts", children: [
|
|
@@ -5186,7 +5204,7 @@ function ha({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title:
|
|
|
5186
5204
|
C && he("Share", X.share, 1.6, C),
|
|
5187
5205
|
ji() && !e && he(F ? "Exit full screen" : "Full screen", F ? du : ua, 1.7, () => _n(!F)),
|
|
5188
5206
|
I && he("Close player", X.close, 1.7, I)
|
|
5189
|
-
] }),
|
|
5207
|
+
] }), Ve = (d || M || D) && /* @__PURE__ */ g("div", { className: "gfull__top", children: [
|
|
5190
5208
|
d && he(d.muted ? "Unmute" : "Mute", d.muted ? X.volumeOff : X.volume, 1.6, d.onToggle),
|
|
5191
5209
|
M && he(M.on ? "Hide subtitles" : "Show subtitles", M.on ? X.cc : X.ccOff, 1.7, M.onToggle, void 0, 4),
|
|
5192
5210
|
D && he("Settings", X.cog, 1.6, D)
|
|
@@ -5215,17 +5233,17 @@ function ha({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title:
|
|
|
5215
5233
|
/* @__PURE__ */ g("div", { className: `gfull__frame${H ? " gfull__frame--land" : ""}`, children: [
|
|
5216
5234
|
r,
|
|
5217
5235
|
/* @__PURE__ */ i("div", { className: "gfull__shade", "aria-hidden": "true" }),
|
|
5218
|
-
|
|
5236
|
+
V && !h && /* @__PURE__ */ g("div", { className: `gfull__pausedinfo${p.playing ? "" : " gfull__pausedinfo--on"}`, "aria-hidden": p.playing, children: [
|
|
5219
5237
|
/* @__PURE__ */ g("div", { className: "gfull__pausedtext", children: [
|
|
5220
5238
|
/* @__PURE__ */ g("div", { className: "gfull__pausedhead", children: [
|
|
5221
5239
|
(Ee || ve) && /* @__PURE__ */ i("span", { className: "gfull__pausedmark", "aria-hidden": "true", children: /* @__PURE__ */ i(Yr, { dark: !0, size: 20 }) }),
|
|
5222
|
-
/* @__PURE__ */ i("div", { className: "gfull__pausedtitle", children:
|
|
5240
|
+
/* @__PURE__ */ i("div", { className: "gfull__pausedtitle", children: V.title })
|
|
5223
5241
|
] }),
|
|
5224
|
-
|
|
5242
|
+
V.summary && /* @__PURE__ */ i("div", { className: "gfull__pausedsum", children: V.summary })
|
|
5225
5243
|
] }),
|
|
5226
5244
|
Ae
|
|
5227
5245
|
] }),
|
|
5228
|
-
|
|
5246
|
+
Ve,
|
|
5229
5247
|
Y,
|
|
5230
5248
|
c ? typeof c == "string" ? /* @__PURE__ */ i("div", { className: "gfull__sub", "aria-live": "polite", children: /* @__PURE__ */ g("div", { className: "gfull__wait", children: [
|
|
5231
5249
|
/* @__PURE__ */ i("span", { className: "gfull__spin", "aria-hidden": "true" }),
|
|
@@ -5290,7 +5308,7 @@ function pu({ dark: t, back: e, home: n, live: r, title: s, badge: a, subline: o
|
|
|
5290
5308
|
return /* @__PURE__ */ g("div", { className: "ghead", children: [
|
|
5291
5309
|
e && /* @__PURE__ */ i("button", { type: "button", className: "ghead__back", "aria-label": "Back", title: "Back", onClick: e, children: /* @__PURE__ */ i(oe, { d: X.chevronLeft, size: 19, sw: 1.7 }) }),
|
|
5292
5310
|
r && /* @__PURE__ */ i("span", { className: "mark", children: /* @__PURE__ */ i(Yr, { dark: t, size: 30 }) }),
|
|
5293
|
-
/* @__PURE__ */ i("div", { style: { flex: 1, minWidth: 0, display: "flex" }, children: n ? /* @__PURE__ */ i("div", { className: "ghead__logo", children: /* @__PURE__ */ i(
|
|
5311
|
+
/* @__PURE__ */ i("div", { style: { flex: 1, minWidth: 0, display: "flex" }, children: n ? /* @__PURE__ */ i("div", { className: "ghead__logo", children: /* @__PURE__ */ i(Bn, { dark: t, height: 22 }) }) : /* @__PURE__ */ g("div", { className: "ghead__title", onClick: e, title: e ? "Back" : void 0, style: { cursor: e ? "pointer" : "default" }, children: [
|
|
5294
5312
|
/* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
5295
5313
|
/* @__PURE__ */ i("span", { className: "ghead__name", children: s }),
|
|
5296
5314
|
a
|
|
@@ -5401,7 +5419,7 @@ function zu({ options: t, onStarted: e, onReplay: n, onClose: r }) {
|
|
|
5401
5419
|
y.stopPropagation(), y.target === y.currentTarget && r();
|
|
5402
5420
|
}, children: /* @__PURE__ */ g("div", { className: "vsp-end__card", children: [
|
|
5403
5421
|
/* @__PURE__ */ i("button", { type: "button", className: "vsp-end__close", "aria-label": "Close", title: "Close", onClick: r, children: /* @__PURE__ */ i(oe, { d: X.close, size: 16, sw: 1.8 }) }),
|
|
5404
|
-
/* @__PURE__ */ i("div", { className: "vsp-end__brand", children: /* @__PURE__ */ i(
|
|
5422
|
+
/* @__PURE__ */ i("div", { className: "vsp-end__brand", children: /* @__PURE__ */ i(Bn, { dark: !0, link: !1, height: 16 }) }),
|
|
5405
5423
|
/* @__PURE__ */ i("div", { className: "vsp-end__title", children: t.title ?? "Transcribe and translate any video" }),
|
|
5406
5424
|
/* @__PURE__ */ i("div", { className: "vsp-end__note", children: t.note ?? "Paste a link from YouTube, Vimeo or any page with a video. It plays right here with subtitles and spoken translations." }),
|
|
5407
5425
|
/* @__PURE__ */ g("form", { className: "vsp-end__row", onSubmit: (y) => {
|
|
@@ -5487,33 +5505,33 @@ function bu(t, e) {
|
|
|
5487
5505
|
] }),
|
|
5488
5506
|
T
|
|
5489
5507
|
] })
|
|
5490
|
-
] }),
|
|
5508
|
+
] }), V = /* @__PURE__ */ g(be, { children: [
|
|
5491
5509
|
/* @__PURE__ */ i(en, { open: a === "lang", onClose: f, title: "LANGUAGE", kind: "picker", header: h.search, sticky: !0, children: /* @__PURE__ */ i(jr, { children: h.list }) }),
|
|
5492
5510
|
/* @__PURE__ */ i(en, { open: a === "settings", onClose: f, title: { main: "SETTINGS", lang: "LANGUAGE", subs: "SUBTITLES", audio: "AUDIO" }[l], titleNode: l === "main" ? void 0 : N, kind: l === "main" ? "settings" : "settings vs-sheet--page", sticky: !0, children: /* @__PURE__ */ i(jr, { children: D }) })
|
|
5493
5511
|
] });
|
|
5494
5512
|
return {
|
|
5495
5513
|
chip: y,
|
|
5496
|
-
sheets:
|
|
5514
|
+
sheets: V,
|
|
5497
5515
|
sheetOpen: a != null,
|
|
5498
5516
|
openSettings: () => {
|
|
5499
5517
|
c("main"), o((Y) => Y === "settings" ? null : "settings");
|
|
5500
5518
|
}
|
|
5501
5519
|
};
|
|
5502
5520
|
}
|
|
5503
|
-
const yt = (t, e = "nonzero") => /* @__PURE__ */ i("path", { d: t, fill: "currentColor", fillRule: e }),
|
|
5521
|
+
const yt = (t, e = "nonzero") => /* @__PURE__ */ i("path", { d: t, fill: "currentColor", fillRule: e }), Bt = (t) => /* @__PURE__ */ g(be, { children: [
|
|
5504
5522
|
/* @__PURE__ */ i("path", { d: "M6.5 2.75h7.25l4.75 4.75v12.25a1.5 1.5 0 0 1-1.5 1.5H6.5a1.5 1.5 0 0 1-1.5-1.5V4.25a1.5 1.5 0 0 1 1.5-1.5Z", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinejoin: "round" }),
|
|
5505
5523
|
/* @__PURE__ */ i("path", { d: "M13.75 2.75V7.5h4.75", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinejoin: "round" }),
|
|
5506
5524
|
/* @__PURE__ */ i("text", { x: "11.75", y: "17.4", textAnchor: "middle", fontSize: t.length > 3 ? 4.4 : 5.2, fontWeight: "800", fill: "currentColor", fontFamily: "inherit", letterSpacing: ".2", children: t })
|
|
5507
5525
|
] }), zi = [
|
|
5508
5526
|
{ name: "YouTube", tint: "#ff3b30", glyph: yt("M21.6 7.2a2.7 2.7 0 0 0-1.9-1.9C18 4.8 12 4.8 12 4.8s-6 0-7.7.5a2.7 2.7 0 0 0-1.9 1.9C2 8.9 2 12 2 12s0 3.1.4 4.8a2.7 2.7 0 0 0 1.9 1.9c1.7.5 7.7.5 7.7.5s6 0 7.7-.5a2.7 2.7 0 0 0 1.9-1.9c.4-1.7.4-4.8.4-4.8s0-3.1-.4-4.8ZM10 15.1V8.9l5.3 3.1L10 15.1Z", "evenodd") },
|
|
5509
|
-
{ name: "MP3", tint: "#f78472", glyph:
|
|
5527
|
+
{ name: "MP3", tint: "#f78472", glyph: Bt("MP3") },
|
|
5510
5528
|
{ name: "Vimeo", tint: "#1ab7ea", glyph: yt("M22 7.4c-.1 2-1.5 4.7-4.2 8.1-2.8 3.6-5.1 5.4-7 5.4-1.2 0-2.2-1.1-3-3.3L6.2 11.6C5.6 9.4 5 8.3 4.3 8.3c-.1 0-.6.3-1.4.9L2 8l2.7-2.4C5.9 4.6 6.8 4 7.4 4c1.4-.1 2.3.9 2.6 2.9.4 2.2.6 3.6.8 4.1.4 1.8.9 2.7 1.4 2.7.4 0 1-.6 1.8-1.9.8-1.2 1.2-2.2 1.3-2.8.1-1.1-.3-1.6-1.3-1.6-.5 0-.9.1-1.4.3.9-3 2.7-4.5 5.3-4.4 1.9.1 2.8 1.3 2.7 3.7Z") },
|
|
5511
5529
|
{ name: "Video", tint: "#55abe5", glyph: /* @__PURE__ */ g(be, { children: [
|
|
5512
5530
|
/* @__PURE__ */ i("rect", { x: "3", y: "5.5", width: "13", height: "13", rx: "2.5", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
5513
5531
|
yt("M16 10.2 21 7v10l-5-3.2v-3.6Z")
|
|
5514
5532
|
] }) },
|
|
5515
5533
|
{ name: "Twitch", tint: "#a970ff", glyph: yt("M5 2.5 3 6.5v13h4.5V22H10l2.5-2.5h3.8L21 14.8V2.5H5Zm14 11.4-2.9 2.9h-4.3L9.4 19.2v-2.4H6V4.5h13v9.4ZM15.2 7.4h1.9v5.2h-1.9V7.4Zm-5 0h1.9v5.2h-1.9V7.4Z", "evenodd") },
|
|
5516
|
-
{ name: "WAV", tint: "#7ee0b4", glyph:
|
|
5534
|
+
{ name: "WAV", tint: "#7ee0b4", glyph: Bt("WAV") },
|
|
5517
5535
|
{ name: "SoundCloud", tint: "#ff7a1a", glyph: /* @__PURE__ */ g(be, { children: [
|
|
5518
5536
|
yt("M11 8.6a5 5 0 0 1 7.8 3.1 3 3 0 0 1-.3 6H11V8.6Z"),
|
|
5519
5537
|
/* @__PURE__ */ i("rect", { x: "8.6", y: "9.4", width: "1.3", height: "8.3", rx: ".65", fill: "currentColor" }),
|
|
@@ -5521,11 +5539,11 @@ const yt = (t, e = "nonzero") => /* @__PURE__ */ i("path", { d: t, fill: "curren
|
|
|
5521
5539
|
/* @__PURE__ */ i("rect", { x: "3.8", y: "12.2", width: "1.3", height: "5.5", rx: ".65", fill: "currentColor" }),
|
|
5522
5540
|
/* @__PURE__ */ i("rect", { x: "1.4", y: "13.8", width: "1.3", height: "3.9", rx: ".65", fill: "currentColor" })
|
|
5523
5541
|
] }) },
|
|
5524
|
-
{ name: "MP4", tint: "#5b63d7", glyph:
|
|
5542
|
+
{ name: "MP4", tint: "#5b63d7", glyph: Bt("MP4") },
|
|
5525
5543
|
{ name: "TikTok", tint: "#25f4ee", glyph: yt("M16.6 2.5c.3 2.3 1.7 3.8 3.9 4v2.7a6.8 6.8 0 0 1-3.9-1.3v6.5a5.7 5.7 0 1 1-5.7-5.7l.9.1v2.8a2.9 2.9 0 1 0 2 2.8V2.5h2.8Z") },
|
|
5526
5544
|
{ name: "Audio", tint: "#f7c948", glyph: /* @__PURE__ */ i("g", { fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", children: /* @__PURE__ */ i("path", { d: "M3 10.5v3M6.5 7.5v9M10 4.5v15M13.5 8v8M17 6v12M20.5 10v4" }) }) },
|
|
5527
5545
|
{ name: "X", tint: "#e8eaf2", glyph: yt("M17.8 3h3.1l-6.7 7.7L22 21h-6.2l-4.8-6.3L5.5 21H2.4l7.2-8.2L2.1 3h6.3l4.4 5.8L17.8 3Zm-1.1 16.2h1.7L7.4 4.7H5.6l11.1 14.5Z") },
|
|
5528
|
-
{ name: "MOV", tint: "#55abe5", glyph:
|
|
5546
|
+
{ name: "MOV", tint: "#55abe5", glyph: Bt("MOV") },
|
|
5529
5547
|
{ name: "Facebook", tint: "#3b82f6", glyph: yt("M13.9 21.5v-8h2.7l.4-3.1h-3.1V8.4c0-.9.3-1.5 1.6-1.5H17V4.1c-.3 0-1.3-.1-2.4-.1-2.4 0-4 1.4-4 4.1v2.3H7.9v3.1h2.7v8h3.3Z") },
|
|
5530
5548
|
{ name: "Podcast", tint: "#c46bff", glyph: /* @__PURE__ */ g("g", { fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", children: [
|
|
5531
5549
|
/* @__PURE__ */ i("rect", { x: "9", y: "3", width: "6", height: "10.5", rx: "3" }),
|
|
@@ -5536,15 +5554,15 @@ const yt = (t, e = "nonzero") => /* @__PURE__ */ i("path", { d: t, fill: "curren
|
|
|
5536
5554
|
/* @__PURE__ */ i("circle", { cx: "12", cy: "12", r: "4" }),
|
|
5537
5555
|
/* @__PURE__ */ i("circle", { cx: "17.2", cy: "6.8", r: ".9", fill: "currentColor", stroke: "none" })
|
|
5538
5556
|
] }) },
|
|
5539
|
-
{ name: "M4A", tint: "#f78472", glyph:
|
|
5557
|
+
{ name: "M4A", tint: "#f78472", glyph: Bt("M4A") },
|
|
5540
5558
|
{ name: "Dailymotion", tint: "#4aa3ff", glyph: yt("M14.6 3.5h3.2V20h-3v-1.2a5.4 5.4 0 0 1-3.6 1.4c-3.3 0-5.9-2.7-5.9-6.1S7.9 8 11.2 8c1.3 0 2.5.4 3.4 1.2V3.5Zm-3.1 7.4a3.2 3.2 0 1 0 0 6.4 3.2 3.2 0 0 0 0-6.4Z", "evenodd") },
|
|
5541
5559
|
{ name: "Radio", tint: "#7ee0b4", glyph: /* @__PURE__ */ g("g", { fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", children: [
|
|
5542
5560
|
/* @__PURE__ */ i("circle", { cx: "12", cy: "12", r: "1.8", fill: "currentColor", stroke: "none" }),
|
|
5543
5561
|
/* @__PURE__ */ i("path", { d: "M8.5 15.5a5 5 0 0 1 0-7M15.5 8.5a5 5 0 0 1 0 7M5.6 18.4a9 9 0 0 1 0-12.8M18.4 5.6a9 9 0 0 1 0 12.8" })
|
|
5544
5562
|
] }) },
|
|
5545
|
-
{ name: "WEBM", tint: "#5b63d7", glyph:
|
|
5563
|
+
{ name: "WEBM", tint: "#5b63d7", glyph: Bt("WEBM") },
|
|
5546
5564
|
{ name: "Loom", tint: "#8f7bff", glyph: yt("M21 11h-5.2l4.5-2.6-1-1.7-4.5 2.6 2.6-4.5-1.7-1-2.6 4.5V3h-2v5.3L8.5 3.8l-1.7 1 2.6 4.5-4.5-2.6-1 1.7L8.2 11H3v2h5.2l-4.5 2.6 1 1.7 4.5-2.6-2.6 4.5 1.7 1 2.6-4.5V21h2v-5.2l2.6 4.5 1.7-1-2.6-4.5 4.5 2.6 1-1.7-4.5-2.6H21v-2Zm-9 3.4a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8Z", "evenodd") },
|
|
5547
|
-
{ name: "FLAC", tint: "#f7c948", glyph:
|
|
5565
|
+
{ name: "FLAC", tint: "#f7c948", glyph: Bt("FLAC") },
|
|
5548
5566
|
{ name: "Live", tint: "#ff5a5a", glyph: /* @__PURE__ */ g("g", { fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", children: [
|
|
5549
5567
|
/* @__PURE__ */ i("rect", { x: "3", y: "6", width: "18", height: "12", rx: "3" }),
|
|
5550
5568
|
/* @__PURE__ */ i("circle", { cx: "8", cy: "12", r: "1.6", fill: "currentColor", stroke: "none" }),
|
|
@@ -5623,7 +5641,7 @@ function _u({ poster: t, src: e }) {
|
|
|
5623
5641
|
}
|
|
5624
5642
|
const Yu = { live: !1, atEdge: !1, edgeFrac: null, pct: 0, atLabel: "0:00", labelAt: () => "0:00", endLabel: "0:00", onSeek: () => {
|
|
5625
5643
|
} };
|
|
5626
|
-
function
|
|
5644
|
+
function Vn({ idle: t, poster: e, src: n, title: r, page: s, onAct: a, children: o }) {
|
|
5627
5645
|
const l = bu(t.prefs, t.set), c = fa(), u = j(null), [d, M] = k(!1);
|
|
5628
5646
|
Jt(() => {
|
|
5629
5647
|
var T;
|
|
@@ -5655,7 +5673,7 @@ function ma({ connect: t, onClick: e, label: n }) {
|
|
|
5655
5673
|
}
|
|
5656
5674
|
function Uu({ idle: t, src: e, ask: n, connect: r, page: s, poster: a = null, onClear: o }) {
|
|
5657
5675
|
const l = () => r.start(e, n);
|
|
5658
|
-
return /* @__PURE__ */ g(
|
|
5676
|
+
return /* @__PURE__ */ g(Vn, { idle: t, poster: a, src: e, title: Lr(e), page: s, onAct: l, children: [
|
|
5659
5677
|
/* @__PURE__ */ i(ma, { connect: r, onClick: l, label: r.connected ? "Play with VocalStack" : "Connect to VocalStack" }),
|
|
5660
5678
|
!r.busy && /* @__PURE__ */ i("div", { className: "vsp-idle__note", children: r.connected ? `Plays ${Lr(e)} with subtitles and spoken translations.` : `Connect to play ${Lr(e)} with subtitles and spoken translations.` }),
|
|
5661
5679
|
o && !r.busy && /* @__PURE__ */ i("button", { type: "button", className: "vsp-idle__other", onClick: o, children: "Choose another video" })
|
|
@@ -5668,7 +5686,7 @@ function Ru({ idle: t, connect: e, page: n, poster: r = null, onPick: s }) {
|
|
|
5668
5686
|
s(p), e.start(p, !1);
|
|
5669
5687
|
};
|
|
5670
5688
|
if (!e.connected)
|
|
5671
|
-
return /* @__PURE__ */ g(
|
|
5689
|
+
return /* @__PURE__ */ g(Vn, { idle: t, poster: r, src: null, title: "VocalStack", page: n, onAct: e.connect, children: [
|
|
5672
5690
|
/* @__PURE__ */ i(ma, { connect: e, onClick: e.connect, label: "Connect to VocalStack" }),
|
|
5673
5691
|
!e.busy && /* @__PURE__ */ i("div", { className: "vsp-idle__note", children: "Connect your VocalStack account to watch any video with subtitles and spoken translations." })
|
|
5674
5692
|
] });
|
|
@@ -5682,7 +5700,7 @@ function Ru({ idle: t, connect: e, page: n, poster: r = null, onPick: s }) {
|
|
|
5682
5700
|
const T = /^https?:\/\//i.test(y) ? y : `https://${y}`;
|
|
5683
5701
|
s(T), e.start(T, !1);
|
|
5684
5702
|
};
|
|
5685
|
-
return /* @__PURE__ */ g(
|
|
5703
|
+
return /* @__PURE__ */ g(Vn, { idle: t, poster: r, src: null, title: "VocalStack", page: n, onAct: h, children: [
|
|
5686
5704
|
/* @__PURE__ */ i("form", { className: "vsp-idle__form", onSubmit: (p) => {
|
|
5687
5705
|
p.preventDefault(), M();
|
|
5688
5706
|
}, children: /* @__PURE__ */ g("span", { className: "vsp-idle__field", children: [
|
|
@@ -5698,7 +5716,7 @@ function Ru({ idle: t, connect: e, page: n, poster: r = null, onPick: s }) {
|
|
|
5698
5716
|
] });
|
|
5699
5717
|
}
|
|
5700
5718
|
function Pu({ idle: t, message: e, onRetry: n, page: r }) {
|
|
5701
|
-
return /* @__PURE__ */ g(
|
|
5719
|
+
return /* @__PURE__ */ g(Vn, { idle: t, poster: null, src: null, title: "VocalStack", page: r, onAct: n, children: [
|
|
5702
5720
|
/* @__PURE__ */ g("div", { className: "vsp-idle__err", role: "alert", children: [
|
|
5703
5721
|
/* @__PURE__ */ i(oe, { d: X.warn, size: 16, sw: 1.8 }),
|
|
5704
5722
|
e
|
|
@@ -5737,7 +5755,7 @@ function $u(t, e, n) {
|
|
|
5737
5755
|
}, [t, e, n]), r;
|
|
5738
5756
|
}
|
|
5739
5757
|
const Qu = 100, bi = (t) => t == null ? null : t ? "on" : "off";
|
|
5740
|
-
function
|
|
5758
|
+
function Vu(t) {
|
|
5741
5759
|
const e = t.syncUrl && typeof window < "u" ? new URLSearchParams(window.location.search) : null, n = { ...t.initial ?? {}, ...t.settings ?? {} }, r = (a) => a === "on" || a === "off" ? a : null, s = Number(e == null ? void 0 : e.get("t"));
|
|
5742
5760
|
return {
|
|
5743
5761
|
lang: (e == null ? void 0 : e.get("lang")) || n.lang || null,
|
|
@@ -5789,24 +5807,24 @@ const nd = Ka(function(e, n) {
|
|
|
5789
5807
|
S(() => {
|
|
5790
5808
|
c(null);
|
|
5791
5809
|
}, [e.id, e.src]);
|
|
5792
|
-
const T = e.src ?? l, N = !s.id && !!T && (l != null || o !== void 0), m = !s.id && !e.src && !l, b = Ki({ id: s.id, token: s.token, baseUrl: e.baseUrl, listen: s.listen }), { source: C, gone: D, error:
|
|
5810
|
+
const T = e.src ?? l, N = !s.id && !!T && (l != null || o !== void 0), m = !s.id && !e.src && !l, b = Ki({ id: s.id, token: s.token, baseUrl: e.baseUrl, listen: s.listen }), { source: C, gone: D, error: V, reload: Y } = Yl(b, s.id), ee = Ul(b, (C == null ? void 0 : C.recording.id) ?? null), I = ze(() => El(b, ee), [b, ee]);
|
|
5793
5811
|
S(() => {
|
|
5794
5812
|
var L;
|
|
5795
5813
|
C && ((L = e.onSource) == null || L.call(e, C));
|
|
5796
5814
|
}, [C]), S(() => {
|
|
5797
5815
|
var L;
|
|
5798
|
-
|
|
5799
|
-
}, [
|
|
5816
|
+
V && ((L = e.onError) == null || L.call(e, V));
|
|
5817
|
+
}, [V]);
|
|
5800
5818
|
const F = fa(e.desk), A = (e.layout ?? "embed") === "embed", w = e.appUrl ?? (e.endCard ? e.endCard.appUrl : void 0), _ = Ke((L) => a({ id: L.transcriptionId, token: null, listen: { transcriptionId: L.transcriptionId, recordingId: L.recordingId, token: L.token } }), []), O = Au(w, _), te = j(null);
|
|
5801
|
-
return S(() => (ki(A ? te.current : null), () => ki(null)), [A]), /* @__PURE__ */ i(xl, { value: I, children: /* @__PURE__ */ i("div", { ref: te, className: `vsp${A ? " vsp--embed" : ""}${e.className ? ` ${e.className}` : ""}`, "data-theme": (e.mode ?? "video") === "video" || e.dark ? "dark" : "light", "data-mode": (e.mode ?? "video") === "video" ? "video" : "transcript", children: m ? /* @__PURE__ */ i(Ru, { idle: f, connect: O, page: !A, poster: e.poster ?? null, onPick: c }) : N ? /* @__PURE__ */ i(Uu, { idle: f, src: T, ask: !l, connect: O, page: !A, poster: e.poster ?? null, onClear: l ? () => c(null) : void 0 }) : s.id ?
|
|
5819
|
+
return S(() => (ki(A ? te.current : null), () => ki(null)), [A]), /* @__PURE__ */ i(xl, { value: I, children: /* @__PURE__ */ i("div", { ref: te, className: `vsp${A ? " vsp--embed" : ""}${e.className ? ` ${e.className}` : ""}`, "data-theme": (e.mode ?? "video") === "video" || e.dark ? "dark" : "light", "data-mode": (e.mode ?? "video") === "video" ? "video" : "transcript", children: m ? /* @__PURE__ */ i(Ru, { idle: f, connect: O, page: !A, poster: e.poster ?? null, onPick: c }) : N ? /* @__PURE__ */ i(Uu, { idle: f, src: T, ask: !l, connect: O, page: !A, poster: e.poster ?? null, onClear: l ? () => c(null) : void 0 }) : s.id ? V && !C ? /* @__PURE__ */ i(Pu, { idle: f, message: V.message, onRetry: Y, page: !A }) : /* @__PURE__ */ i(Bu, { ...e, initial: { ...e.initial ?? {}, ...y }, startMuted: p === !0, handle: r, id: s.id, api: I, shared: C, gone: D, loadError: V, reread: Y, desk: F, dark: (e.mode ?? "video") === "video" || !!e.dark, onStarted: (L) => a({ id: L.transcriptionId, token: null, listen: { transcriptionId: L.transcriptionId, recordingId: L.recordingId, token: L.token } }) }, s.id) : /* @__PURE__ */ i("div", { className: "vsp-gate", "data-theme": "dark", children: /* @__PURE__ */ i("span", { className: "gfull__spin gfull__holdspin", "aria-label": "Loading" }) }) }) });
|
|
5802
5820
|
});
|
|
5803
|
-
function
|
|
5804
|
-
var js, zs, Is, bs, Os, Cs, xs, Ss, Ds, As, Es, _s, Ys, Us, Rs, Ps, $s, Qs,
|
|
5805
|
-
const { api: e, shared: n, gone: r, desk: s, dark: a } = t, o = t.id ?? "", l = ze(() =>
|
|
5821
|
+
function Bu(t) {
|
|
5822
|
+
var js, zs, Is, bs, Os, Cs, xs, Ss, Ds, As, Es, _s, Ys, Us, Rs, Ps, $s, Qs, Vs, Bs, Hs, Ws, Fs, Zs, Gs, qs, Ks, Js, Xs, ei, ti, ni, ri, si;
|
|
5823
|
+
const { api: e, shared: n, gone: r, desk: s, dark: a } = t, o = t.id ?? "", l = ze(() => Vu(t), []), u = (t.mode ?? "video") === "video", [d, M] = k(t.loadError);
|
|
5806
5824
|
S(() => {
|
|
5807
5825
|
t.loadError && M(t.loadError);
|
|
5808
5826
|
}, [t.loadError]);
|
|
5809
|
-
const [h, f] = k("none"), [p, y] = k(!1), [T, N] = k(""), [m, b] = Hc(), [C, D] = k(null), [
|
|
5827
|
+
const [h, f] = k("none"), [p, y] = k(!1), [T, N] = k(""), [m, b] = Hc(), [C, D] = k(null), [V, Y] = k(u ? "listen" : "read"), [ee, I] = k(!1), F = j(null), A = j(/* @__PURE__ */ new Map()), [w, _] = k("main"), O = (v) => {
|
|
5810
5828
|
const me = document.querySelector(".vs-sheet--settings"), Pe = me == null ? void 0 : me.parentElement;
|
|
5811
5829
|
me && Pe && w === "main" && v !== "main" && Pe.style.setProperty("--vs-sheet-top", `${Math.round(me.getBoundingClientRect().top - Pe.getBoundingClientRect().top)}px`), _(v);
|
|
5812
5830
|
};
|
|
@@ -5829,7 +5847,7 @@ function Vu(t) {
|
|
|
5829
5847
|
}, [E == null ? void 0 : E.voices]), S(() => {
|
|
5830
5848
|
(E == null ? void 0 : E.removeBackground) !== void 0 && H(E.removeBackground);
|
|
5831
5849
|
}, [E == null ? void 0 : E.removeBackground]);
|
|
5832
|
-
const x = { language: !0, subtitles: !0, audio: !0, export: !0, share: !0, fullscreen: !0, settings: !0, ...t.controls ?? {} },
|
|
5850
|
+
const x = { language: !0, subtitles: !0, audio: !0, export: !0, share: !0, fullscreen: !0, settings: !0, ...t.controls ?? {} }, B = u && !we;
|
|
5833
5851
|
S(() => {
|
|
5834
5852
|
if (!t.syncUrl) return;
|
|
5835
5853
|
const v = new URL(window.location.href);
|
|
@@ -5842,11 +5860,11 @@ function Vu(t) {
|
|
|
5842
5860
|
onFrame: (v) => {
|
|
5843
5861
|
v.type === "job.progress" && D({ state: v.state, processedS: v.processedS ?? 0, totalS: v.totalS ?? null, segmentsDone: v.segmentsDone ?? 0, segmentsTotal: v.segmentsTotal ?? null, pct: v.pct ?? 0, error: v.error ?? null });
|
|
5844
5862
|
}
|
|
5845
|
-
}), he = ze(() => yl(ce).filter((v) => !v.suppressed), [ce]), _e =
|
|
5863
|
+
}), he = ze(() => yl(ce).filter((v) => !v.suppressed), [ce]), _e = Vl((n == null ? void 0 : n.job) ?? null), Ve = ["done", "failed", "stopped"].includes(Tr((_e == null ? void 0 : _e.state) ?? ((js = n == null ? void 0 : n.job) == null ? void 0 : js.state))), $ = Ve ? _e : C ?? _e, Me = !!C && !["done", "failed", "stopped"].includes(Tr(C.state)), ue = j(0);
|
|
5846
5864
|
S(() => {
|
|
5847
|
-
!
|
|
5848
|
-
}, [
|
|
5849
|
-
const ae = Tr(($ == null ? void 0 : $.state) ?? ((zs = n == null ? void 0 : n.job) == null ? void 0 : zs.state) ?? (e.listen ? (L == null ? void 0 : L.state) === "finalized" ? "done" : L != null && L.state ? "transcribing" : void 0 : void 0)), fe = !!ie && (ae === "transcribing" || ae === "queued"), Ye = u && !r && (!n || (fe || ae === "cropping") && he.length === 0), U = fe ? ($ == null ? void 0 : $.pct) ?? 0 : 100, R = Hl(n == null ? void 0 : n.job, $) ?? (L == null ? void 0 : L.mediaDurationS) ?? null, q = ((Is = ce.segments.values().next().value) == null ? void 0 : Is.language) ?? (L == null ? void 0 : L.spokenLanguage) ?? null, se = n != null && n.sharedBy ? `Shared by ${n.sharedBy}` : "", de = ((Cs = (Os = (bs = n == null ? void 0 : n.job) == null ? void 0 : bs.source) == null ? void 0 : Os.name) == null ? void 0 : Cs.trim()) || null, Oe = n ? ((xs = n.name) == null ? void 0 : xs.trim()) || de : null, Ne = !!((Ss = n == null ? void 0 : n.job) != null && Ss.hasAudio), Le = (Ds = n == null ? void 0 : n.job) == null ? void 0 : Ds.source, Ce = !Ne && !!Le && (Le.kind !== "url" || Le.bytes != null) && (ae === "transcribing" || ae === "queued" || ae === "done"), He = ie && (n != null && n.allowDownload) && Ne ? fo(e.origin, ie, e.cred) : null, $e = !!Le && (Le.kind !== "url" || Le.bytes != null), ut = Hu(He && $e ? He : null), it = He && (!$e || ut === "yes") ? He : He && ut === "unknown" ? null : ie && (n != null && n.allowDownload) && (Ce || Ne && $e) ? xn(e.origin, ie, "source", e.cred) : null, pt = he[he.length - 1], Ge = pt ? ((As = pt.words[pt.words.length - 1]) == null ? void 0 : As.end) ?? pt.start : 0, rt = u && fe ? Math.max(Ge, ($ == null ? void 0 : $.processedS) ?? 0) : null, Mt = Kc(it, (Ne || Ce) && !!(n != null && n.allowDownload), he, R, Ce ? ((_s = (Es = n == null ? void 0 : n.job) == null ? void 0 : Es.crop) == null ? void 0 : _s.startS) ?? 0 : 0, rt), st = _o((Ys = n == null ? void 0 : n.job) == null ? void 0 : Ys.source),
|
|
5865
|
+
!Ve || !Me || Date.now() - ue.current < 1e4 || (ue.current = Date.now(), t.reread());
|
|
5866
|
+
}, [Ve, Me, C == null ? void 0 : C.state, C == null ? void 0 : C.processedS, o]);
|
|
5867
|
+
const ae = Tr(($ == null ? void 0 : $.state) ?? ((zs = n == null ? void 0 : n.job) == null ? void 0 : zs.state) ?? (e.listen ? (L == null ? void 0 : L.state) === "finalized" ? "done" : L != null && L.state ? "transcribing" : void 0 : void 0)), fe = !!ie && (ae === "transcribing" || ae === "queued"), Ye = u && !r && (!n || (fe || ae === "cropping") && he.length === 0), U = fe ? ($ == null ? void 0 : $.pct) ?? 0 : 100, R = Hl(n == null ? void 0 : n.job, $) ?? (L == null ? void 0 : L.mediaDurationS) ?? null, q = ((Is = ce.segments.values().next().value) == null ? void 0 : Is.language) ?? (L == null ? void 0 : L.spokenLanguage) ?? null, se = n != null && n.sharedBy ? `Shared by ${n.sharedBy}` : "", de = ((Cs = (Os = (bs = n == null ? void 0 : n.job) == null ? void 0 : bs.source) == null ? void 0 : Os.name) == null ? void 0 : Cs.trim()) || null, Oe = n ? ((xs = n.name) == null ? void 0 : xs.trim()) || de : null, Ne = !!((Ss = n == null ? void 0 : n.job) != null && Ss.hasAudio), Le = (Ds = n == null ? void 0 : n.job) == null ? void 0 : Ds.source, Ce = !Ne && !!Le && (Le.kind !== "url" || Le.bytes != null) && (ae === "transcribing" || ae === "queued" || ae === "done"), He = ie && (n != null && n.allowDownload) && Ne ? fo(e.origin, ie, e.cred) : null, $e = !!Le && (Le.kind !== "url" || Le.bytes != null), ut = Hu(He && $e ? He : null), it = He && (!$e || ut === "yes") ? He : He && ut === "unknown" ? null : ie && (n != null && n.allowDownload) && (Ce || Ne && $e) ? xn(e.origin, ie, "source", e.cred) : null, pt = he[he.length - 1], Ge = pt ? ((As = pt.words[pt.words.length - 1]) == null ? void 0 : As.end) ?? pt.start : 0, rt = u && fe ? Math.max(Ge, ($ == null ? void 0 : $.processedS) ?? 0) : null, Mt = Kc(it, (Ne || Ce) && !!(n != null && n.allowDownload), he, R, Ce ? ((_s = (Es = n == null ? void 0 : n.job) == null ? void 0 : Es.crop) == null ? void 0 : _s.startS) ?? 0 : 0, rt), st = _o((Ys = n == null ? void 0 : n.job) == null ? void 0 : Ys.source), Be = st && ((Us = Pn(st)) == null ? void 0 : Us.id) === "youtube" ? na(st) : null, Mn = Bo(Be), At = qc(he, R, ((Ps = (Rs = n == null ? void 0 : n.job) == null ? void 0 : Rs.crop) == null ? void 0 : Ps.startS) ?? 0, rt), Je = !!Be, lt = Je ? At.player : Mt, at = Ji(), tn = j(null), re = nu({ forcedVoice: t.voice ?? null, recordingId: ie, model: ce, rows: he, lenS: R, ended: !!ie && !fe, cred: e.cred, langs: at, srcLang: q, canTranslate: !!(n != null && n.allowTranslate), pickedLang: ne, setPickedLang: Z, side: s && !te ? tu : void 0, hearOriginal: B, timed: !!Be, stockVoices: u && !Re, stickyPicker: u, pickerBusy: tn.current }), gn = j(null);
|
|
5850
5868
|
S(() => {
|
|
5851
5869
|
!ie || gn.current === J || (gn.current = J, G(J));
|
|
5852
5870
|
}, [J, ie]);
|
|
@@ -5869,7 +5887,7 @@ function Vu(t) {
|
|
|
5869
5887
|
S(() => {
|
|
5870
5888
|
fe && !z.playing && Yt.current && (Yt.current.scrollTop = Yt.current.scrollHeight);
|
|
5871
5889
|
}, [fe, he.length]);
|
|
5872
|
-
const Ft = iu(Yt, he, p, T, y), fn = /* @__PURE__ */ i(su, { open: p, q: T, onQ: N, onClose: () => y(!1), hits: Ft, desk: s, inline: s }), qe = Wo({ name: n == null ? void 0 : n.name, sourceName: (Qs = ($s = n == null ? void 0 : n.job) == null ? void 0 : $s.source) == null ? void 0 : Qs.name, ytTitle: Mn, url: ((
|
|
5890
|
+
const Ft = iu(Yt, he, p, T, y), fn = /* @__PURE__ */ i(su, { open: p, q: T, onQ: N, onClose: () => y(!1), hits: Ft, desk: s, inline: s }), qe = Wo({ name: n == null ? void 0 : n.name, sourceName: (Qs = ($s = n == null ? void 0 : n.job) == null ? void 0 : $s.source) == null ? void 0 : Qs.name, ytTitle: Mn, url: ((Bs = (Vs = n == null ? void 0 : n.job) == null ? void 0 : Vs.source) == null ? void 0 : Bs.kind) === "url" ? n.job.source.url : t.src ?? null, id: o }), ot = !!(n != null && n.allowDownload), nn = !!(n != null && n.allowExport), mt = re.readLang, gt = mt ? ((Hs = at == null ? void 0 : at.languages.find((v) => v.code === mt)) == null ? void 0 : Hs.name) ?? mt.toUpperCase() : null, Zt = async () => {
|
|
5873
5891
|
if (ie)
|
|
5874
5892
|
try {
|
|
5875
5893
|
if (mt && re.canSpeak) {
|
|
@@ -5880,7 +5898,7 @@ function Vu(t) {
|
|
|
5880
5898
|
b(`Preparing ${qe} as MP3 — the download starts when it is ready.`), await Wl(xn(e.origin, ie, "delivery", e.cred)), b(`Downloading ${qe}.`);
|
|
5881
5899
|
return;
|
|
5882
5900
|
}
|
|
5883
|
-
|
|
5901
|
+
Br(xn(e.origin, ie, "source", e.cred)), b(`Downloading ${qe} — the full audio, since the transcript is still being written.`);
|
|
5884
5902
|
} catch (v) {
|
|
5885
5903
|
throw M(It(v)), v;
|
|
5886
5904
|
}
|
|
@@ -5890,7 +5908,7 @@ function Vu(t) {
|
|
|
5890
5908
|
return Fl(e, ie, v, { lang: mt }).then(() => b(fe ? `${me} exported${Pe} for the first ${he.length} segments — the rest is still transcribing.` : `${me} exported${Pe}.`)).catch((We) => {
|
|
5891
5909
|
throw M(It(We)), We;
|
|
5892
5910
|
});
|
|
5893
|
-
}, rn = fe ? "MORE TO COME…" : "END OF TRANSCRIPT", ct = fe ? "var(--brand)" : "var(--ink-28)", sn =
|
|
5911
|
+
}, rn = fe ? "MORE TO COME…" : "END OF TRANSCRIPT", ct = fe ? "var(--brand)" : "var(--ink-28)", sn = Bl($, he.length), bt = z.has && (!re.relang || !!Be), Ze = j(z);
|
|
5894
5912
|
Ze.current = z;
|
|
5895
5913
|
const Ut = `${J ?? ""}|${re.on ? "voice" : "source"}`, wt = j({ key: Ut, idx: 0, t: 0, playing: !1, until: 0 });
|
|
5896
5914
|
S(() => {
|
|
@@ -5904,7 +5922,7 @@ function Vu(t) {
|
|
|
5904
5922
|
v.until = 0;
|
|
5905
5923
|
return;
|
|
5906
5924
|
}
|
|
5907
|
-
!z.has || re.relang || (v.until = 0, Math.abs(z.t - v.t) > 0.5 && (z.seekFrac && z.dur > 0 ? z.seekFrac(v.t / z.dur) : z.seekRow(v.idx)), v.playing && !z.playing &&
|
|
5925
|
+
!z.has || re.relang || (v.until = 0, Math.abs(z.t - v.t) > 0.5 && (z.seekFrac && z.dur > 0 ? z.seekFrac(v.t / z.dur) : z.seekRow(v.idx)), v.playing && !z.playing && V === "listen" && (et.current = !0, z.toggle()));
|
|
5908
5926
|
}
|
|
5909
5927
|
});
|
|
5910
5928
|
const Rt = j(!1), et = j(!1);
|
|
@@ -5942,7 +5960,7 @@ function Vu(t) {
|
|
|
5942
5960
|
return;
|
|
5943
5961
|
}
|
|
5944
5962
|
et.current = !0, Ze.current.toggle();
|
|
5945
|
-
}, Nn = (v) => /* @__PURE__ */ i(
|
|
5963
|
+
}, Nn = (v) => /* @__PURE__ */ i(Bc, { player: z, size: v }), an = !!ie && !fe, [P, xe] = k(!1);
|
|
5946
5964
|
S(() => {
|
|
5947
5965
|
if (!Ie) {
|
|
5948
5966
|
xe(!1);
|
|
@@ -5951,13 +5969,13 @@ function Vu(t) {
|
|
|
5951
5969
|
const v = setTimeout(() => xe(!0), 180);
|
|
5952
5970
|
return () => clearTimeout(v);
|
|
5953
5971
|
}, [Ie]);
|
|
5954
|
-
const Qe = P ? Ae : J, St = ac(ie, J, he, ke), Pt = wc(vc(L), ie, re.readLang), Na = ot || nn, ya = (((Fs = (Ws = n == null ? void 0 : n.job) == null ? void 0 : Ws.crop) == null ? void 0 : Fs.startS) ?? 0) +
|
|
5972
|
+
const Qe = P ? Ae : J, St = ac(ie, J, he, ke), Pt = wc(vc(L), ie, re.readLang), Na = ot || nn, ya = (((Fs = (Ws = n == null ? void 0 : n.job) == null ? void 0 : Ws.crop) == null ? void 0 : Fs.startS) ?? 0) + Vt(z, he), vt = V === "listen", $t = vt && (!!Be || u), Ta = (v) => {
|
|
5955
5973
|
lt.pause(), re.player.pause(), Y(v), v === "read" && te && (cn(!1), K(!1));
|
|
5956
5974
|
};
|
|
5957
5975
|
S(() => {
|
|
5958
5976
|
vt || (lt.playing && lt.pause(), re.player.playing && re.player.pause());
|
|
5959
5977
|
}, [vt, lt.playing, re.player.playing]);
|
|
5960
|
-
const Ue = re.barChip, Gt = ea(Ue.label), Zr = /* @__PURE__ */ i(kr, { value:
|
|
5978
|
+
const Ue = re.barChip, Gt = ea(Ue.label), Zr = /* @__PURE__ */ i(kr, { value: V, onChange: Ta, bordered: !1, options: Nu(Gt, !!Be) }), qt = [...an ? [{ key: "summary", label: "Summary" }] : [], ...Na ? [{ key: "export", label: "Export" }] : []], Gr = (v) => /* @__PURE__ */ g(be, { children: [
|
|
5961
5979
|
v === "summary" && an && /* @__PURE__ */ i(Lc, { s: Pt }),
|
|
5962
5980
|
v === "export" && /* @__PURE__ */ i(Tc, { audio: ot ? { name: qe, meta: mt && re.canSpeak || Ne ? `MP3${R ? ` · ${jt(R)}` : ""}` : "ORIGINAL AUDIO", onClick: Zt } : null, formats: nn, onExport: dt })
|
|
5963
5981
|
] }), wa = (v) => /* @__PURE__ */ i(nc, { index: z.idx, total: Math.max(1, he.length), frac: z.dur > 0 ? Math.min(1, z.t / z.dur) : 0, glideMs: z.wordSync ? 0 : 220, atLabel: jt(z.t), durLabel: jt(z.dur), stepLabel: v ? `${z.idx + 1} / ${he.length}` : "", onSeek: re.relang ? Xc : z.seekRow, onSeekFrac: re.relang ? void 0 : z.seekFrac, onScrubStart: z.hold, onScrubEnd: z.release }), qr = {
|
|
@@ -5973,7 +5991,7 @@ function Vu(t) {
|
|
|
5973
5991
|
var me;
|
|
5974
5992
|
re.relang || (me = z.seekFrac) == null || me.call(z, v);
|
|
5975
5993
|
}
|
|
5976
|
-
}, [va, La] = oa(re.on && !!z.preparing && z.playing, 1500), qn = re.on && ((Zs = z.error) == null ? void 0 : Zs.code) === "voice_not_started", Kn = re.canSpeak && !re.error && !qn, yn = J ? ((Gs = at == null ? void 0 : at.languages.find((v) => v.code === J)) == null ? void 0 : Gs.name) ?? Ue.label : "", tt = te ? Uc({ lang: J, langName: yn, translating: Ie && !!J, translateFailed: Fe, voiceFailed: qn, relang: re.relang, starting: re.on ? z.starting : null, slowLine: va, lineSince: La }) : null, Jn = !!
|
|
5994
|
+
}, [va, La] = oa(re.on && !!z.preparing && z.playing, 1500), qn = re.on && ((Zs = z.error) == null ? void 0 : Zs.code) === "voice_not_started", Kn = re.canSpeak && !re.error && !qn, yn = J ? ((Gs = at == null ? void 0 : at.languages.find((v) => v.code === J)) == null ? void 0 : Gs.name) ?? Ue.label : "", tt = te ? Uc({ lang: J, langName: yn, translating: Ie && !!J, translateFailed: Fe, voiceFailed: qn, relang: re.relang, starting: re.on ? z.starting : null, slowLine: va, lineSince: La }) : null, Jn = !!Be && !!tt && (tt.kind === "translating" || tt.kind === "voice" && re.relang), Kr = !Jn || !tt ? null : tt.kind === "translating" ? `Translating into ${yn || "the new language"}…` : `Preparing the ${yn || "translated"} voice…`, Lt = !Jn && ((tt == null ? void 0 : tt.kind) === "voice" || (tt == null ? void 0 : tt.kind) === "starting"), Jr = Rr({ ...re.langList, keepOpen: !0, open: w === "lang", onClose: () => O("main") }), Xr = Ko(Q, re.on), ka = u && Xr.bed && ot && ie && (!fe || it) ? ai(e.origin, ie, e.cred) : null, es = al(ka, { t: Vt(z, he), playing: z.playing && !Lt && !(z.timed && z.preparing), muted: z.muted }), ja = u && Xr.speech && ot && ie && (!fe || it) ? ai(e.origin, ie, e.cred, "speech") : null, Xn = Wi(ja, { t: Vt(z, he), playing: !re.on && z.playing, muted: z.muted }), er = !re.on && Xn.on;
|
|
5977
5995
|
S(() => {
|
|
5978
5996
|
var v;
|
|
5979
5997
|
At.setVideoSound(!(Je && (re.on || er))), (v = Mt.silence) == null || v.call(Mt, !Je && er);
|
|
@@ -5989,7 +6007,7 @@ function Vu(t) {
|
|
|
5989
6007
|
z.pause(), Z(null), et.current = !0, lt.playRow(v);
|
|
5990
6008
|
}, ts = { prevOn: z.idx > 0, nextOn: z.idx < he.length - 1, onPrev: z.prev, onNext: z.next, playing: z.playing, playable: bt, playTitle: re.playTitle ?? (z.playing ? "Pause" : "Play"), onPlay: () => {
|
|
5991
6009
|
et.current = !0, z.toggle();
|
|
5992
|
-
}, busy: re.relang && !
|
|
6010
|
+
}, busy: re.relang && !Be || Lt };
|
|
5993
6011
|
fl(bt && vt ? { playing: z.playing, toggle: () => {
|
|
5994
6012
|
et.current = !0, z.toggle();
|
|
5995
6013
|
}, next: z.next, prev: z.prev } : null, Oe);
|
|
@@ -6003,16 +6021,16 @@ function Vu(t) {
|
|
|
6003
6021
|
S(() => {
|
|
6004
6022
|
z.t > 0.3 && Ca(!0);
|
|
6005
6023
|
}, [z.t]);
|
|
6006
|
-
const xa = !
|
|
6024
|
+
const xa = !Be && u && ie && (n != null && n.allowDownload) && !fe && ((qs = n == null ? void 0 : n.job) == null ? void 0 : qs.hasVideo) !== !1 ? /* @__PURE__ */ i(li, { src: xn(e.origin, ie, "video", e.cred), t: Vt(z, he), playing: z.playing && !Lt, seekN: z.seekN, onToggle: z.has ? xt : void 0 }, ie) : null, Qt = !Be && u && st && Ao(st) ? st : null, Tn = Qt ? Bi(Qt) : null, rs = ze(() => Tn ? Vo(Tn) : void 0, [Tn]), ir = Qt && ((Ks = Pn(Qt)) == null ? void 0 : Ks.id) === "facebook" ? Qt : null, Sa = ir ? /* @__PURE__ */ i(Po, { url: ir, t: Vt(z, he) + (((Xs = (Js = n == null ? void 0 : n.job) == null ? void 0 : Js.crop) == null ? void 0 : Xs.startS) ?? 0), playing: z.playing && !Lt, seekN: z.seekN, onToggle: z.has ? xt : void 0 }, ir) : rs ? /* @__PURE__ */ i(li, { setup: rs, seekOver: 1, t: Vt(z, he) + (((ti = (ei = n == null ? void 0 : n.job) == null ? void 0 : ei.crop) == null ? void 0 : ti.startS) ?? 0), playing: z.playing && !Lt, seekN: z.seekN, onToggle: z.has ? xt : void 0 }, Tn) : Qt ? /* @__PURE__ */ i(Yo, { url: Qt, t: Vt(z, he) + (((ri = (ni = n == null ? void 0 : n.job) == null ? void 0 : ni.crop) == null ? void 0 : ri.startS) ?? 0), playing: z.playing && !Lt, seekN: z.seekN, title: qe }) : null, Da = z.has ? /* @__PURE__ */ g("div", { className: "txyt vsp-follow", children: [
|
|
6007
6025
|
/* @__PURE__ */ i("div", { "aria-hidden": "true", className: "txyt__tap", onClick: xt, style: { cursor: "pointer" } }),
|
|
6008
6026
|
/* @__PURE__ */ i("div", { className: `txyt__paused${z.playing ? "" : " txyt__paused--on"}`, "aria-hidden": "true", children: /* @__PURE__ */ i("span", { className: "txyt__pausedplay", children: /* @__PURE__ */ i(Xt, { size: 44 }) }) })
|
|
6009
|
-
] }) : null, ss =
|
|
6010
|
-
/* @__PURE__ */ i($c, { ytId:
|
|
6027
|
+
] }) : null, ss = Be ? /* @__PURE__ */ g(be, { children: [
|
|
6028
|
+
/* @__PURE__ */ i($c, { ytId: Be, title: qe, t: ya, playing: z.playing && !Lt, waiting: re.on && !!z.timed && !!z.preparing, seekN: z.seekN, onTime: (v) => {
|
|
6011
6029
|
var me, Pe, We;
|
|
6012
6030
|
return (We = z.videoAt) == null ? void 0 : We.call(z, v - (((Pe = (me = n == null ? void 0 : n.job) == null ? void 0 : me.crop) == null ? void 0 : Pe.startS) ?? 0));
|
|
6013
6031
|
}, onToggle: z.has ? xt : void 0, onAd: Zn, lead: Je ? At.lead : void 0 }),
|
|
6014
6032
|
/* @__PURE__ */ g("div", { className: "vsp-poster", "aria-hidden": "true", style: { opacity: Oa ? 0 : 1 }, children: [
|
|
6015
|
-
/* @__PURE__ */ i("div", { className: "vsp-poster__img", style: { backgroundImage: `url(https://i.ytimg.com/vi/${
|
|
6033
|
+
/* @__PURE__ */ i("div", { className: "vsp-poster__img", style: { backgroundImage: `url(https://i.ytimg.com/vi/${Be}/hqdefault.jpg)` } }),
|
|
6016
6034
|
/* @__PURE__ */ i("span", { className: "txyt__pausedplay", children: /* @__PURE__ */ i(Xt, { size: 44 }) })
|
|
6017
6035
|
] })
|
|
6018
6036
|
] }) : u ? /* @__PURE__ */ g(be, { children: [
|
|
@@ -6020,7 +6038,7 @@ function Vu(t) {
|
|
|
6020
6038
|
Da,
|
|
6021
6039
|
Sa,
|
|
6022
6040
|
xa
|
|
6023
|
-
] }) : null, is = $t &&
|
|
6041
|
+
] }) : null, is = $t && Be && !te ? /* @__PURE__ */ i(kc, { ytId: Be, title: qe, radius: 14, large: !0, style: s ? void 0 : { margin: "8px 20px 2px" }, picture: ss, children: /* @__PURE__ */ i(gu, { pos: qr, transport: ts, chip: sr({ ...rr, width: 64, height: 28, minHeight: 28, padding: "0 8px" }, "sm"), voices: ns, onFull: () => {
|
|
6024
6042
|
cn(!0), K(!0);
|
|
6025
6043
|
}, copied: null }) }) : null, Xe = z.wordSync ? Kl(he, z.idx, z.t) ? he[z.idx] : void 0 : he[z.idx];
|
|
6026
6044
|
for (const v of he) for (const [me, Pe] of Object.entries(v.translations)) Pe && A.current.set(`${v.sentenceId ?? v.start}|${me}`, Pe);
|
|
@@ -6212,7 +6230,7 @@ function Vu(t) {
|
|
|
6212
6230
|
/* @__PURE__ */ i("div", { className: "sdiv" })
|
|
6213
6231
|
] }),
|
|
6214
6232
|
t.settingsExtra
|
|
6215
|
-
] }) }), Dt = te && $t && (!!
|
|
6233
|
+
] }) }), Dt = te && $t && (!!Be || u) && /* @__PURE__ */ i(
|
|
6216
6234
|
ha,
|
|
6217
6235
|
{
|
|
6218
6236
|
page: (t.layout ?? "embed") === "page",
|
|
@@ -6279,14 +6297,14 @@ function Vu(t) {
|
|
|
6279
6297
|
/* @__PURE__ */ i("span", { className: "ctrans__sp", "aria-hidden": "true" }),
|
|
6280
6298
|
/* @__PURE__ */ g("div", { className: "ctrans__mid", children: [
|
|
6281
6299
|
/* @__PURE__ */ i("button", { type: "button", className: "ctrans__step", "aria-label": "Previous segment", title: "Previous segment", style: { opacity: z.idx <= 0 ? 0.3 : 1 }, onClick: z.prev, children: /* @__PURE__ */ i(oe, { d: X.chevronLeft, size: 16, sw: 1.8 }) }),
|
|
6282
|
-
/* @__PURE__ */ i("button", { type: "button", className: "ctrans__play", "aria-label": re.relang ? "Preparing audio" : z.playing ? "Pause" : "Play", title: re.relang ? "Preparing audio…" : re.playTitle ?? (z.playing ? "Pause" : "Play"), disabled: !bt, onClick: z.toggle, children: re.relang ? /* @__PURE__ */ i("span", { className: "ctrans__spin" }) : /* @__PURE__ */ i("svg", { viewBox: "0 0 24 24", width: 16, height: 16, fill: "currentColor", "aria-hidden": "true", style: z.playing ? void 0 : { marginLeft: 2 }, children: z.playing ? Qc :
|
|
6300
|
+
/* @__PURE__ */ i("button", { type: "button", className: "ctrans__play", "aria-label": re.relang ? "Preparing audio" : z.playing ? "Pause" : "Play", title: re.relang ? "Preparing audio…" : re.playTitle ?? (z.playing ? "Pause" : "Play"), disabled: !bt, onClick: z.toggle, children: re.relang ? /* @__PURE__ */ i("span", { className: "ctrans__spin" }) : /* @__PURE__ */ i("svg", { viewBox: "0 0 24 24", width: 16, height: 16, fill: "currentColor", "aria-hidden": "true", style: z.playing ? void 0 : { marginLeft: 2 }, children: z.playing ? Qc : Vc }) }),
|
|
6283
6301
|
/* @__PURE__ */ i("button", { type: "button", className: "ctrans__step", "aria-label": "Next segment", title: "Next segment", style: { opacity: z.idx >= he.length - 1 ? 0.3 : 1 }, onClick: z.next, children: /* @__PURE__ */ i(oe, { d: X.chevronRight, size: 16, sw: 1.8 }) })
|
|
6284
6302
|
] }),
|
|
6285
6303
|
/* @__PURE__ */ i("span", { className: "ctrans__mute", children: Nn(36) })
|
|
6286
6304
|
] }),
|
|
6287
6305
|
/* @__PURE__ */ i("div", { className: "ctrans__scrub", children: wa(v) })
|
|
6288
|
-
] }) }), Qa = Ic("ga", { tabs: qt, cur: h, pref: (si = qt[0]) == null ? void 0 : si.key, onPick: f }), Ls = Math.max(0, Math.min(100, Math.round(U))),
|
|
6289
|
-
|
|
6306
|
+
] }) }), Qa = Ic("ga", { tabs: qt, cur: h, pref: (si = qt[0]) == null ? void 0 : si.key, onPick: f }), Ls = Math.max(0, Math.min(100, Math.round(U))), Va = Ye && /* @__PURE__ */ g("div", { className: "gfull gfull--hold", "data-theme": "dark", role: "status", "aria-live": "polite", children: [
|
|
6307
|
+
Be && /* @__PURE__ */ i("div", { className: "gfull__holdbg", style: { backgroundImage: `url(https://i.ytimg.com/vi/${Be}/hqdefault.jpg)` } }),
|
|
6290
6308
|
/* @__PURE__ */ i("div", { className: "gfull__hold", children: n ? /* @__PURE__ */ g(be, { children: [
|
|
6291
6309
|
qe && /* @__PURE__ */ i("div", { className: "gfull__holdt", children: qe }),
|
|
6292
6310
|
/* @__PURE__ */ i("div", { className: "gfull__holdpct", children: ae === "transcribing" ? `${Ls}%` : /* @__PURE__ */ i("span", { className: "gfull__spin gfull__holdspin" }) }),
|
|
@@ -6302,15 +6320,15 @@ function Vu(t) {
|
|
|
6302
6320
|
var v;
|
|
6303
6321
|
(v = On.current) == null || v.call(On, ks);
|
|
6304
6322
|
}, [ks]);
|
|
6305
|
-
const [
|
|
6323
|
+
const [Ba, gr] = k(!1), fr = !!Dt && !Ye && (Je ? !!z.ended : !z.playing && z.dur > 0 && z.t >= z.dur - 0.5);
|
|
6306
6324
|
S(() => {
|
|
6307
6325
|
fr || gr(!1);
|
|
6308
6326
|
}, [fr]);
|
|
6309
|
-
const Ha = t.endCard !== !1 && fr && !
|
|
6327
|
+
const Ha = t.endCard !== !1 && fr && !Ba && /* @__PURE__ */ i(zu, { options: { appUrl: t.appUrl, ...t.endCard || {} }, onStarted: t.onStarted, onClose: () => gr(!0), onReplay: () => {
|
|
6310
6328
|
gr(!0), et.current = !0, z.seekFrac ? z.seekFrac(0) : z.seekRow(0), z.playing || z.toggle();
|
|
6311
6329
|
} });
|
|
6312
6330
|
if (u) return /* @__PURE__ */ g(be, { children: [
|
|
6313
|
-
r ? /* @__PURE__ */ i("div", { className: "gfull", "data-theme": "dark", children: hr }) :
|
|
6331
|
+
r ? /* @__PURE__ */ i("div", { className: "gfull", "data-theme": "dark", children: hr }) : Va || Dt || /* @__PURE__ */ i("div", { className: "gfull", "data-theme": "dark" }),
|
|
6314
6332
|
Ha,
|
|
6315
6333
|
Mr
|
|
6316
6334
|
] });
|
|
@@ -6319,7 +6337,7 @@ function Vu(t) {
|
|
|
6319
6337
|
return /* @__PURE__ */ g(be, { children: [
|
|
6320
6338
|
/* @__PURE__ */ i("div", { className: "dhead dhead--listener dhead--cols", children: /* @__PURE__ */ g("div", { className: "gcolhead", children: [
|
|
6321
6339
|
/* @__PURE__ */ i("div", { className: "gcolhead__main", children: /* @__PURE__ */ g("div", { className: "gcolhead__col", children: [
|
|
6322
|
-
/* @__PURE__ */ i("div", { style: { flex: "none" }, children: /* @__PURE__ */ i(
|
|
6340
|
+
/* @__PURE__ */ i("div", { style: { flex: "none" }, children: /* @__PURE__ */ i(Bn, { dark: a, height: 20.38 }) }),
|
|
6323
6341
|
!r && /* @__PURE__ */ g("div", { className: "dhead__session", children: [
|
|
6324
6342
|
/* @__PURE__ */ i("span", { className: "t", children: n ? qe : "" }),
|
|
6325
6343
|
/* @__PURE__ */ i("span", { className: "s", children: n ? ws : "" })
|
|
@@ -6402,17 +6420,17 @@ export {
|
|
|
6402
6420
|
Tc as ExportPanel,
|
|
6403
6421
|
ha as FullVideo,
|
|
6404
6422
|
gu as MiniPlayer,
|
|
6405
|
-
|
|
6423
|
+
Bc as MuteButton,
|
|
6406
6424
|
Xc as NO_SEEK,
|
|
6407
6425
|
Qc as PAUSE_D,
|
|
6408
|
-
|
|
6426
|
+
Vc as PLAY_D,
|
|
6409
6427
|
tu as PUB_SIDE,
|
|
6410
6428
|
td as PanelSeek,
|
|
6411
6429
|
xl as PlayerApiProvider,
|
|
6412
6430
|
$n as REMOVE_BG_LABEL,
|
|
6413
6431
|
Zo as REMOVE_BG_NOTE,
|
|
6414
6432
|
nc as ReplayScrub,
|
|
6415
|
-
|
|
6433
|
+
Vi as SITES,
|
|
6416
6434
|
rd as SiteIcon,
|
|
6417
6435
|
uc as SpeakerCast,
|
|
6418
6436
|
Lc as SummaryPanel,
|
|
@@ -6427,7 +6445,7 @@ export {
|
|
|
6427
6445
|
Oo as hostOfUrl,
|
|
6428
6446
|
Ht as lineEnd,
|
|
6429
6447
|
la as lineWords,
|
|
6430
|
-
|
|
6448
|
+
Vt as pictureT,
|
|
6431
6449
|
En as placePosition,
|
|
6432
6450
|
_n as realFull,
|
|
6433
6451
|
Ju as setErrorReporter,
|