@vocalstack/player 0.1.0-alpha.38 → 0.1.0-alpha.39

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/index.js CHANGED
@@ -58,7 +58,7 @@ function oe({ d: t, ...e }) {
58
58
  function Ja({ size: t = 15 }) {
59
59
  return /* @__PURE__ */ i("svg", { viewBox: "0 0 24 24", width: t, height: t, fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ i("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2.5" }) });
60
60
  }
61
- function Dr({ size: t = 13 }) {
61
+ function Pn({ size: t = 13 }) {
62
62
  return /* @__PURE__ */ i("svg", { viewBox: "0 0 24 24", width: t, height: t, fill: "currentColor", style: { marginLeft: 2 }, "aria-hidden": "true", children: /* @__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" }) });
63
63
  }
64
64
  function lt({ size: t = 15, color: e = "currentColor", track: n = "rgba(127,127,127,.35)", sw: r }) {
@@ -86,7 +86,7 @@ function Xa({ 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 Pn({ dark: t, height: e = 20, link: n = !0 }) {
89
+ function $n({ dark: t, height: e = 20, link: n = !0 }) {
90
90
  const r = /* @__PURE__ */ i("img", { src: t ? Fa : Za, alt: "VocalStack", decoding: "sync", style: { height: e, width: "auto", display: "block" } });
91
91
  return n ? /* @__PURE__ */ i("a", { href: Ii, style: { display: "block" }, children: r }) : r;
92
92
  }
@@ -99,7 +99,7 @@ function ei({ children: t, panel: e, inset: n, className: r = "", style: s }) {
99
99
  function Tt({ checked: t, onChange: e, label: n, disabled: r }) {
100
100
  return /* @__PURE__ */ i("button", { type: "button", role: "switch", "aria-checked": t, "aria-label": n, className: "vs-toggle", disabled: r, onClick: () => e(!t), children: /* @__PURE__ */ i("span", { className: "vs-toggle__knob" }) });
101
101
  }
102
- function Tr({ value: t, onChange: e, options: n, size: r, bordered: s = !0, fill: a }) {
102
+ function wr({ value: t, onChange: e, options: n, size: r, bordered: s = !0, fill: a }) {
103
103
  const o = k(null), [l, c] = L(null), u = Math.max(0, n.findIndex((d) => d.value === t));
104
104
  return Kt(() => {
105
105
  const d = o.current;
@@ -177,7 +177,7 @@ function no(t, e) {
177
177
  };
178
178
  }, [t, e]);
179
179
  }
180
- function wr({ children: t, ms: e = 220 }) {
180
+ function vr({ children: t, ms: e = 220 }) {
181
181
  const [n] = L(() => {
182
182
  var r;
183
183
  return typeof window < "u" && !!((r = window.matchMedia) != null && r.call(window, "(hover: hover) and (pointer: fine)").matches);
@@ -229,7 +229,7 @@ function Jt({ open: t, onClose: e, title: n, titleNode: r, note: s, doneLabel: a
229
229
  ] }) }) : null;
230
230
  }
231
231
  ki(0);
232
- function vr({ children: t, style: e, className: n }) {
232
+ function Lr({ children: t, style: e, className: n }) {
233
233
  return /* @__PURE__ */ i("div", { className: n ? `eyebrow ${n}` : "eyebrow", style: e, children: t });
234
234
  }
235
235
  let Cn = null;
@@ -239,7 +239,7 @@ function $u(t) {
239
239
  function Oi(t) {
240
240
  Cn == null || Cn(t);
241
241
  }
242
- function $n() {
242
+ function Qn() {
243
243
  try {
244
244
  return document.createElement("audio").canPlayType("audio/x-caf; codecs=opus") === "probably" ? "caf" : "ogg";
245
245
  } catch {
@@ -274,11 +274,11 @@ async function ao(t) {
274
274
  }
275
275
  }
276
276
  function oo(t, e, n = {}) {
277
- const r = new URLSearchParams({ kind: "delivery", format: $n() });
277
+ const r = new URLSearchParams({ kind: "delivery", format: Qn() });
278
278
  return n.media ? r.set("media", n.media) : n.accessToken && r.set("access_token", n.accessToken), n.listenerToken && r.set("listenerToken", n.listenerToken), n.shareCode && r.set("shareCode", n.shareCode), `${t}/v1/recordings/${e}/audio?${r}`;
279
279
  }
280
280
  function ti(t, e, n = {}, r = "background") {
281
- const s = new URLSearchParams({ kind: r, format: $n() });
281
+ const s = new URLSearchParams({ kind: r, format: Qn() });
282
282
  return n.media ? s.set("media", n.media) : n.accessToken && s.set("access_token", n.accessToken), n.listenerToken && s.set("listenerToken", n.listenerToken), n.shareCode && s.set("shareCode", n.shareCode), `${t}/v1/recordings/${e}/audio?${s}`;
283
283
  }
284
284
  function On(t, e, n, r = {}) {
@@ -891,7 +891,7 @@ const nt = class nt {
891
891
  }
892
892
  };
893
893
  ge(nt, "WAIT_MS", 15e3), ge(nt, "START_WAIT_MS", 4e3), ge(nt, "COMING_MS", 12e4), ge(nt, "SKEW_LINES", 3), ge(nt, "RETRIES", 4), ge(nt, "RETRY_MS", 1200), ge(nt, "STARTING_MS", 3e5);
894
- let Lr = nt;
894
+ let kr = nt;
895
895
  function Di(t, e) {
896
896
  return e == null ? t.find((n) => !n.voiceKey) ?? null : t.find((n) => n.voiceKey === e) ?? t.find((n) => !n.voiceKey && n.voice === e) ?? null;
897
897
  }
@@ -908,7 +908,7 @@ function fo(t, e, n, r = {}, s) {
908
908
  return {
909
909
  sentenceId: u,
910
910
  lang: t.lang,
911
- src: `${n}/v1/recordings/${e}/voice/${u}?lang=${encodeURIComponent(t.lang)}${c}&format=${$n()}${y > 0 ? `&part=${y}` : ""}${d ? `&v=${encodeURIComponent(d)}` : ""}${l}`,
911
+ src: `${n}/v1/recordings/${e}/voice/${u}?lang=${encodeURIComponent(t.lang)}${c}&format=${Qn()}${y > 0 ? `&part=${y}` : ""}${d ? `&v=${encodeURIComponent(d)}` : ""}${l}`,
912
912
  durationS: M === 1 ? ((j = t.clipDur) == null ? void 0 : j[String(u)]) ?? 0 : 0,
913
913
  voice: t.voice ?? null,
914
914
  cloned: !1,
@@ -936,8 +936,8 @@ function po(t, e, n) {
936
936
  if (a += r[l], o < a) return l;
937
937
  return t.length - 1;
938
938
  }
939
- const kr = "vs.recentLangs", jr = /* @__PURE__ */ new Set();
940
- function zr(t, e) {
939
+ const jr = "vs.recentLangs", zr = /* @__PURE__ */ new Set();
940
+ function Ir(t, e) {
941
941
  try {
942
942
  const n = localStorage.getItem(t);
943
943
  return n === null ? e : JSON.parse(n);
@@ -950,25 +950,25 @@ function Ei(t, e) {
950
950
  e == null ? localStorage.removeItem(t) : localStorage.setItem(t, JSON.stringify(e));
951
951
  } catch {
952
952
  }
953
- for (const n of jr) n();
953
+ for (const n of zr) n();
954
954
  }
955
955
  function Er(t, e) {
956
- const [n, r] = L(() => zr(t, e));
956
+ const [n, r] = L(() => Ir(t, e));
957
957
  return D(() => {
958
- const s = () => r(zr(t, e));
959
- return jr.add(s), window.addEventListener("storage", s), () => {
960
- jr.delete(s), window.removeEventListener("storage", s);
958
+ const s = () => r(Ir(t, e));
959
+ return zr.add(s), window.addEventListener("storage", s), () => {
960
+ zr.delete(s), window.removeEventListener("storage", s);
961
961
  };
962
962
  }, [t]), [n, (s) => {
963
963
  r(s), Ei(t, s);
964
964
  }];
965
965
  }
966
966
  function ni(t) {
967
- const e = zr(kr, []);
968
- Ei(kr, Array.isArray(e) ? e.filter((n) => n !== t) : []);
967
+ const e = Ir(jr, []);
968
+ Ei(jr, Array.isArray(e) ? e.filter((n) => n !== t) : []);
969
969
  }
970
970
  function _i() {
971
- const [t, e] = Er(kr, []), n = Array.isArray(t) ? t : [];
971
+ const [t, e] = Er(jr, []), n = Array.isArray(t) ? t : [];
972
972
  return [n, (r) => {
973
973
  r && e([r, ...n.filter((s) => s !== r)].slice(0, 3));
974
974
  }];
@@ -1100,25 +1100,28 @@ function ri({ src: t, setup: e, t: n, playing: r, seekN: s, onToggle: a, seekOve
1100
1100
  return () => {
1101
1101
  clearInterval(m), f.playbackRate = 1;
1102
1102
  };
1103
- }, [c, r, o]), d ? null : /* @__PURE__ */ i(
1104
- "video",
1105
- {
1106
- ref: l,
1107
- className: "vsp-file",
1108
- style: { opacity: c ? 1 : 0 },
1109
- src: t,
1110
- muted: !0,
1111
- playsInline: !0,
1112
- preload: "auto",
1113
- disablePictureInPicture: !0,
1114
- onLoadedData: () => u(!0),
1115
- onError: () => {
1116
- t && M(!0);
1117
- },
1118
- onClick: a,
1119
- "aria-hidden": "true"
1120
- }
1121
- );
1103
+ }, [c, r, o]), d ? null : /* @__PURE__ */ g("div", { className: "txyt vsp-follow", children: [
1104
+ /* @__PURE__ */ i(
1105
+ "video",
1106
+ {
1107
+ ref: l,
1108
+ className: "vsp-file",
1109
+ style: { opacity: c ? 1 : 0 },
1110
+ src: t,
1111
+ muted: !0,
1112
+ playsInline: !0,
1113
+ preload: "auto",
1114
+ disablePictureInPicture: !0,
1115
+ onLoadedData: () => u(!0),
1116
+ onError: () => {
1117
+ t && M(!0);
1118
+ },
1119
+ "aria-hidden": "true"
1120
+ }
1121
+ ),
1122
+ c && /* @__PURE__ */ i("div", { "aria-hidden": "true", className: "txyt__tap", onClick: a, style: { cursor: a ? "pointer" : "default" } }),
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(Pn, { size: 44 }) }) })
1124
+ ] });
1122
1125
  }
1123
1126
  const Ui = [
1124
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" },
@@ -1151,7 +1154,7 @@ function Lo(t) {
1151
1154
  const e = vo(t);
1152
1155
  return e ? Ui.find((n) => n.hosts.test(e)) ?? null : null;
1153
1156
  }
1154
- function Qn(t) {
1157
+ function Bn(t) {
1155
1158
  try {
1156
1159
  return new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(t) ? t : `https://${t}`);
1157
1160
  } catch {
@@ -1161,11 +1164,11 @@ function Qn(t) {
1161
1164
  const xn = (t) => Math.max(0, Math.floor(t));
1162
1165
  function Ri(t) {
1163
1166
  var n;
1164
- const e = /\/(?:share|embed)\/(?:[^/?#]*-)?([0-9a-f]{32})(?:[/?#]|$)/i.exec(((n = Qn(t)) == null ? void 0 : n.pathname) ?? "");
1167
+ const e = /\/(?:share|embed)\/(?:[^/?#]*-)?([0-9a-f]{32})(?:[/?#]|$)/i.exec(((n = Bn(t)) == null ? void 0 : n.pathname) ?? "");
1165
1168
  return e ? e[1].toLowerCase() : null;
1166
1169
  }
1167
1170
  function ko(t) {
1168
- const e = Qn(t);
1171
+ const e = Bn(t);
1169
1172
  if (!e) return null;
1170
1173
  const n = e.pathname.split("/").filter(Boolean), r = n.map((a, o) => /^\d+$/.test(a) ? o : -1).filter((a) => a >= 0).pop();
1171
1174
  if (r == null) return null;
@@ -1173,14 +1176,14 @@ function ko(t) {
1173
1176
  return { id: n[r], h: e.searchParams.get("h") ?? (s && /^[0-9a-f]{6,}$/i.test(s) ? s : null) };
1174
1177
  }
1175
1178
  function jo(t) {
1176
- const e = Qn(t);
1179
+ const e = Bn(t);
1177
1180
  if (!e) return null;
1178
1181
  if (/(^|\.)dai\.ly$/i.test(e.hostname)) return e.pathname.split("/").filter(Boolean)[0] ?? null;
1179
1182
  const n = /\/video\/([a-z0-9]+)/i.exec(e.pathname);
1180
1183
  return n ? n[1] : null;
1181
1184
  }
1182
1185
  function zo(t) {
1183
- const e = Qn(t);
1186
+ const e = Bn(t);
1184
1187
  if (!e) return null;
1185
1188
  const n = e.pathname.split("/").filter(Boolean);
1186
1189
  if (/^clips\.twitch\.tv$/i.test(e.hostname)) return n[0] ? { clip: n[0] } : null;
@@ -1395,7 +1398,7 @@ async function Zo(t) {
1395
1398
  const n = await e.json().catch(() => null);
1396
1399
  return { ready: !1, retryS: Bo(e.status, n), ...Ho(n) };
1397
1400
  }
1398
- function hr(t) {
1401
+ function Mr(t) {
1399
1402
  t && (t.pause(), t.removeAttribute("src"), t.load());
1400
1403
  }
1401
1404
  function $i(t, e) {
@@ -1430,7 +1433,7 @@ function $i(t, e) {
1430
1433
  });
1431
1434
  };
1432
1435
  return m(), () => {
1433
- h = !0, f && clearTimeout(f), hr(c.current), c.current = null, hr(u.current[0]), hr(u.current[1]), u.current = [null, null], d.current = [NaN, NaN];
1436
+ h = !0, f && clearTimeout(f), Mr(c.current), c.current = null, Mr(u.current[0]), Mr(u.current[1]), u.current = [null, null], d.current = [NaN, NaN];
1434
1437
  };
1435
1438
  }, [t]), D(() => {
1436
1439
  const h = () => {
@@ -1639,7 +1642,7 @@ function il(t, e) {
1639
1642
  function dn(t, e) {
1640
1643
  return (e ?? []).map((n, r) => ({ text: String(n.text ?? ""), prob: n.prob ?? null, start: n.start ?? 0, end: n.end ?? 0, alts: n.alts, ...n.script === !0 ? { script: !0 } : {}, ...n.script === !0 && typeof n.recognized == "string" ? { recognized: n.recognized } : {}, seq: t, idx: r }));
1641
1644
  }
1642
- function Mr(t, e) {
1645
+ function gr(t, e) {
1643
1646
  const n = e ?? qt();
1644
1647
  delete n.numbers, n.state = t.state, t.speakerLabels && (n.labels = t.speakerLabels), n.lastSeq = Math.max(n.lastSeq, t.lastSeq), n.spans = t.spans.map((r) => ({ wallStart: r.wallStart, wallEnd: r.wallEnd ?? null, mediaStart: r.mediaStart, mediaEnd: r.mediaEnd ?? null }));
1645
1648
  for (const r of t.segments) {
@@ -1994,7 +1997,7 @@ const yl = /* @__PURE__ */ new Set([
1994
1997
  engine_lost: "The transcription engine stopped. Please try again.",
1995
1998
  capacity_exceeded: "Every transcription engine is busy right now. Please try again in a moment.",
1996
1999
  timeout: "That took too long. Please try again."
1997
- }, Ir = Vi.internal, gr = "Can't reach VocalStack. Check your connection.", ci = {
2000
+ }, Or = Vi.internal, fr = "Can't reach VocalStack. Check your connection.", ci = {
1998
2001
  NotAllowedError: "The browser blocked this. Allow it for this site, then try again.",
1999
2002
  NotSupportedError: "The audio couldn't be loaded. Try again in a moment.",
2000
2003
  AbortError: "It was cancelled."
@@ -2003,10 +2006,10 @@ function Ot(t) {
2003
2006
  const e = t, n = typeof (e == null ? void 0 : e.code) == "string" ? e.code : void 0, r = typeof (e == null ? void 0 : e.status) == "number" ? e.status : void 0, s = e == null ? void 0 : e.details;
2004
2007
  if (n || r && r >= 400) {
2005
2008
  const o = typeof (e == null ? void 0 : e.requestId) == "string" && e.requestId ? { requestId: e.requestId } : {};
2006
- return n && yl.has(n) && typeof (e == null ? void 0 : e.message) == "string" ? { message: e.message, code: n, status: r, details: s, ...o } : n === "unavailable" && r === void 0 ? { message: gr, code: n, details: s, ...o } : r === 0 ? { message: typeof (e == null ? void 0 : e.message) == "string" ? e.message : gr, code: n, status: r, details: s, ...o } : { message: n && Vi[n] || Ir, code: n, status: r, details: s, ...o };
2009
+ return n && yl.has(n) && typeof (e == null ? void 0 : e.message) == "string" ? { message: e.message, code: n, status: r, details: s, ...o } : n === "unavailable" && r === void 0 ? { message: fr, code: n, details: s, ...o } : r === 0 ? { message: typeof (e == null ? void 0 : e.message) == "string" ? e.message : fr, code: n, status: r, details: s, ...o } : { message: n && Vi[n] || Or, code: n, status: r, details: s, ...o };
2007
2010
  }
2008
2011
  const a = (e == null ? void 0 : e.name) ?? "";
2009
- return a === "TypeError" && /fetch|network|load failed/i.test(String((e == null ? void 0 : e.message) ?? "")) ? (typeof navigator < "u" && navigator.onLine !== !1 && Oi(t instanceof Error ? t : new Error(String(t))), { message: gr }) : ci[a] ? { message: ci[a] } : t instanceof Error && a === "Error" && !(t instanceof ji) ? { message: t.message } : { message: Ir };
2012
+ return a === "TypeError" && /fetch|network|load failed/i.test(String((e == null ? void 0 : e.message) ?? "")) ? (typeof navigator < "u" && navigator.onLine !== !1 && Oi(t instanceof Error ? t : new Error(String(t))), { message: fr }) : ci[a] ? { message: ci[a] } : t instanceof Error && a === "Error" && !(t instanceof ji) ? { message: t.message } : { message: Or };
2010
2013
  }
2011
2014
  const Hi = "https://api.vocalstack.com", Pr = ki(null);
2012
2015
  function Qt() {
@@ -2128,12 +2131,12 @@ async function ui(t, e, n = {}) {
2128
2131
  const a = r.toString();
2129
2132
  return fetch(`${t.origin}${e}${a ? `${e.includes("?") ? "&" : "?"}${a}` : ""}`, { method: n.method ?? "GET", headers: s, body: n.body === void 0 ? void 0 : JSON.stringify(n.body) });
2130
2133
  }
2131
- const fr = /* @__PURE__ */ new Map();
2134
+ const pr = /* @__PURE__ */ new Map();
2132
2135
  function Fi() {
2133
- const t = Qt(), [e, n] = L(fr.get(t.origin) ?? null);
2136
+ const t = Qt(), [e, n] = L(pr.get(t.origin) ?? null);
2134
2137
  return D(() => {
2135
- fr.has(t.origin) || t.client.languages.list().then((r) => {
2136
- fr.set(t.origin, r), n(r);
2138
+ pr.has(t.origin) || t.client.languages.list().then((r) => {
2139
+ pr.set(t.origin, r), n(r);
2137
2140
  }).catch(() => {
2138
2141
  });
2139
2142
  }, [t]), e;
@@ -2176,11 +2179,11 @@ function xl(t, e) {
2176
2179
  Z.close();
2177
2180
  return;
2178
2181
  }
2179
- T = 0, l.current = Z, c.current !== pe && Z.setLanguage(c.current), d(!0), h(null), o.current = Mr(Z.snapshot, o.current), y(), te();
2182
+ T = 0, l.current = Z, c.current !== pe && Z.setLanguage(c.current), d(!0), h(null), o.current = gr(Z.snapshot, o.current), y(), te();
2180
2183
  for await (const le of Z) {
2181
2184
  if (!A) break;
2182
2185
  if (le.type === "snapshot")
2183
- o.current = Mr(le.snapshot, le.reason === "gap" ? o.current : qt()), y(), te();
2186
+ o.current = gr(le.snapshot, le.reason === "gap" ? o.current : qt()), y(), te();
2184
2187
  else if (le.type === "frame") {
2185
2188
  ol(o.current, le.frame);
2186
2189
  const Te = le.frame;
@@ -2230,7 +2233,7 @@ function xl(t, e) {
2230
2233
  const T = r.current.client, _ = ++S.current;
2231
2234
  p(!0), C(null);
2232
2235
  const b = (K) => T.recordings.transcript(t, { lang: A ?? void 0, ...r.current.readAs, asListener: !r.current.owner }).then((v) => {
2233
- _ === S.current && (o.current = Mr(v, o.current), Y(A), y(), v.translationPending && K > 0 && window.setTimeout(() => {
2236
+ _ === S.current && (o.current = gr(v, o.current), Y(A), y(), v.translationPending && K > 0 && window.setTimeout(() => {
2234
2237
  _ === S.current && b(K - 1).catch(() => {
2235
2238
  });
2236
2239
  }, bl));
@@ -2265,9 +2268,9 @@ function Gi(t) {
2265
2268
  async function qi(t) {
2266
2269
  var s, a, o, l, c;
2267
2270
  const e = await t.json().catch(() => null), n = ((s = e == null ? void 0 : e.error) == null ? void 0 : s.code) ?? (e == null ? void 0 : e.code), r = ((a = e == null ? void 0 : e.error) == null ? void 0 : a.message) ?? (e == null ? void 0 : e.message);
2268
- return new ji(typeof n == "string" ? n : "internal", typeof r == "string" ? r : Ir, { status: t.status, details: ((l = (o = e == null ? void 0 : e.error) == null ? void 0 : o.data) == null ? void 0 : l.details) ?? ((c = e == null ? void 0 : e.data) == null ? void 0 : c.details) });
2271
+ return new ji(typeof n == "string" ? n : "internal", typeof r == "string" ? r : Or, { status: t.status, details: ((l = (o = e == null ? void 0 : e.error) == null ? void 0 : o.data) == null ? void 0 : l.details) ?? ((c = e == null ? void 0 : e.data) == null ? void 0 : c.details) });
2269
2272
  }
2270
- function pr(t) {
2273
+ function mr(t) {
2271
2274
  switch (t) {
2272
2275
  case "transcribing":
2273
2276
  return "transcribing";
@@ -2299,7 +2302,7 @@ function Al(t, e) {
2299
2302
  }
2300
2303
  return n;
2301
2304
  }
2302
- const Or = [
2305
+ const br = [
2303
2306
  { key: "pdf", name: "PDF", ext: "PDF", note: "Formatted transcript in paragraphs, with timestamps and speaker labels.", icon: "M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z" },
2304
2307
  { key: "xlsx", name: "Excel", ext: "XLSX", note: "One row per segment: start, end, speaker, text, confidence.", icon: "M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m0 0h-7.5m-9 0h7.5m0 0c.621 0 1.125.504 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5" },
2305
2308
  { 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" },
@@ -2357,7 +2360,7 @@ function $l(t, e, n) {
2357
2360
  return o += r * s[c] / a, { text: l, start: u, end: o };
2358
2361
  });
2359
2362
  }
2360
- function mr(t) {
2363
+ function Nr(t) {
2361
2364
  const e = getComputedStyle(t), n = t.clientHeight * 0.45;
2362
2365
  return {
2363
2366
  top: Math.min(parseFloat(e.paddingTop) || 0, n),
@@ -2785,7 +2788,7 @@ const nc = /* @__PURE__ */ g("span", { style: { display: "inline-flex", alignIte
2785
2788
  /* @__PURE__ */ i(oe, { d: X.langAuto, size: 19, sw: 1.7, style: { color: "var(--ink-62)", display: "block" } }),
2786
2789
  /* @__PURE__ */ i(oe, { d: X.globe, size: 18, sw: 1.6, style: { color: "var(--ink-62)", display: "block" } })
2787
2790
  ] });
2788
- function br(t, e) {
2791
+ function Cr(t, e) {
2789
2792
  const n = e ? t == null ? void 0 : t.languages.find((r) => r.code === e) : null;
2790
2793
  return { flag: e ? (n == null ? void 0 : n.flag) ?? "🌐" : nc, code: e ? e.toUpperCase() : "", label: (n == null ? void 0 : n.native) ?? "As spoken", name: (n == null ? void 0 : n.name) ?? "Original" };
2791
2794
  }
@@ -2925,7 +2928,7 @@ function cc({ audio: t, video: e, formats: n, onExport: r }) {
2925
2928
  u.current && l(null);
2926
2929
  }));
2927
2930
  }, f = (m, y, j, N) => /* @__PURE__ */ g(xe, { children: [
2928
- /* @__PURE__ */ i(vr, { style: { letterSpacing: ".12em", color: "var(--ink-35)" }, children: N }),
2931
+ /* @__PURE__ */ i(Lr, { style: { letterSpacing: ".12em", color: "var(--ink-35)" }, children: N }),
2929
2932
  /* @__PURE__ */ g("button", { type: "button", className: "dlrow", disabled: o != null, "aria-busy": o === m || void 0, onClick: () => h(m, y), style: o && o !== m ? { opacity: 0.45 } : void 0, children: [
2930
2933
  o === m ? /* @__PURE__ */ i(lt, { size: 17, color: "var(--brand)", track: "var(--fill-12)" }) : /* @__PURE__ */ i(oe, { d: j, size: 17, sw: 1.5, style: { flex: "none", color: "var(--ink-70)" } }),
2931
2934
  /* @__PURE__ */ g("span", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column", gap: 1, textAlign: "left" }, children: [
@@ -2939,8 +2942,8 @@ function cc({ audio: t, video: e, formats: n, onExport: r }) {
2939
2942
  t && f("audio", t, lc, "DOWNLOAD AUDIO"),
2940
2943
  e && f("video", e, X.video, "DOWNLOAD VIDEO"),
2941
2944
  n !== !1 && /* @__PURE__ */ g(xe, { children: [
2942
- /* @__PURE__ */ i(vr, { style: { letterSpacing: ".12em", color: "var(--ink-35)" }, children: "EXPORT AS" }),
2943
- /* @__PURE__ */ i("div", { className: "fmtgrid", children: Or.map((m) => /* @__PURE__ */ g("button", { type: "button", className: "fmtgrid__cell", title: o === m.key ? `Building the ${m.name}…` : m.note, disabled: o != null, "aria-busy": o === m.key || void 0, onClick: () => M(m.key), style: o && o !== m.key ? { opacity: 0.45 } : void 0, children: [
2945
+ /* @__PURE__ */ i(Lr, { style: { letterSpacing: ".12em", color: "var(--ink-35)" }, children: "EXPORT AS" }),
2946
+ /* @__PURE__ */ i("div", { className: "fmtgrid", children: br.map((m) => /* @__PURE__ */ g("button", { type: "button", className: "fmtgrid__cell", title: o === m.key ? `Building the ${m.name}…` : m.note, disabled: o != null, "aria-busy": o === m.key || void 0, onClick: () => M(m.key), style: o && o !== m.key ? { opacity: 0.45 } : void 0, children: [
2944
2947
  o === m.key ? /* @__PURE__ */ i(lt, { size: 16, color: "var(--brand)", track: "var(--fill-12)" }) : /* @__PURE__ */ i(oe, { d: s === m.key ? X.check : m.icon, size: 16, sw: 1.6, style: { color: s === m.key ? "var(--brand)" : "var(--ink-62)" } }),
2945
2948
  /* @__PURE__ */ i("span", { children: m.name })
2946
2949
  ] }, m.key)) })
@@ -2998,7 +3001,7 @@ ${a}`).catch(() => {
2998
3001
  ] });
2999
3002
  return /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
3000
3003
  /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, minHeight: 24 }, children: [
3001
- /* @__PURE__ */ i(vr, { style: { letterSpacing: ".12em", color: "var(--ink-35)" }, children: "SUMMARY" }),
3004
+ /* @__PURE__ */ i(Lr, { style: { letterSpacing: ".12em", color: "var(--ink-35)" }, children: "SUMMARY" }),
3002
3005
  t.state === "ready" && /* @__PURE__ */ g("button", { type: "button", className: "sumcopy", title: "Copy title and summary", style: { color: e ? "var(--brand)" : "var(--ink-70)" }, onClick: o, children: [
3003
3006
  /* @__PURE__ */ i(oe, { d: e ? X.check : fc, size: 13, sw: 1.6 }),
3004
3007
  e ? "Copied" : "Copy"
@@ -3274,7 +3277,7 @@ function kc(t) {
3274
3277
  const I = f.current;
3275
3278
  if (m(), r(p.id), a(null), l(null), u(null), !t) return;
3276
3279
  let C = p.previewUrl ? `${e.origin}${p.previewUrl}` : `${e.origin}/v1/voices/preview?voice=${encodeURIComponent(p.id)}&lang=${encodeURIComponent(t)}`;
3277
- $n() === "caf" && (C += `${C.includes("?") ? "&" : "?"}format=caf`);
3280
+ Qn() === "caf" && (C += `${C.includes("?") ? "&" : "?"}format=caf`);
3278
3281
  const S = Date.now();
3279
3282
  e.shareCode && C.includes("recording=") && (C += `&shareCode=${encodeURIComponent(e.shareCode)}`);
3280
3283
  const B = async () => {
@@ -3321,13 +3324,13 @@ function kc(t) {
3321
3324
  }, [t, m, e]);
3322
3325
  return { armId: n, sampleId: s, dlId: o, error: c, clearError: () => u(null), arm: N, stop: y, reset: j };
3323
3326
  }
3324
- const Cr = 0.05, ta = (t, e) => {
3327
+ const xr = 0.05, ta = (t, e) => {
3325
3328
  let n = 0;
3326
3329
  for (let r = 0; r < t.length; r++) t[r].start <= e + 1e-6 && (n = r);
3327
3330
  return n;
3328
3331
  };
3329
3332
  function jc(t, e, n, r) {
3330
- const s = Math.max(0, e), a = r > 0 && s >= r - Cr, o = t.length && t[0].start <= s + 1e-6 ? ta(t, s) : -1;
3333
+ const s = Math.max(0, e), a = r > 0 && s >= r - xr, o = t.length && t[0].start <= s + 1e-6 ? ta(t, s) : -1;
3331
3334
  return o < 0 ? { t: s, playing: n && !a, sentenceId: null, offset: 0, ended: a } : { t: s, playing: n && !a, sentenceId: t[o].sentenceId ?? null, offset: Math.max(0, s - t[o].start), ended: a };
3332
3335
  }
3333
3336
  function Sn(t, e, n) {
@@ -3338,10 +3341,10 @@ function Sn(t, e, n) {
3338
3341
  let a = t.t;
3339
3342
  if (s >= 0) {
3340
3343
  const c = e[s].start, u = Math.max(0, Math.min(((l = e[s + 1]) == null ? void 0 : l.start) ?? r, r) - c);
3341
- a = c + Math.min(t.offset, Math.max(0, u - Cr));
3344
+ a = c + Math.min(t.offset, Math.max(0, u - xr));
3342
3345
  }
3343
3346
  a = Math.max(0, Math.min(r, a));
3344
- const o = r > 0 && a >= r - Cr && s < 0;
3347
+ const o = r > 0 && a >= r - xr && s < 0;
3345
3348
  return { t: a, playing: t.playing && !o, index: s >= 0 ? s : ta(e, a) };
3346
3349
  }
3347
3350
  function zc(t) {
@@ -3560,7 +3563,7 @@ function Cc({ ytId: t, title: e, t: n, playing: r, seekN: s, onToggle: a, onAd:
3560
3563
  }, [Z]), /* @__PURE__ */ g("div", { className: `txyt${p ? " txyt--ad" : ""}`, children: [
3561
3564
  /* @__PURE__ */ i("iframe", { ref: f, onLoad: je, referrerPolicy: "strict-origin-when-cross-origin", src: `https://www.youtube-nocookie.com/embed/${t}?enablejsapi=1&mute=1&controls=0&rel=0&modestbranding=1&playsinline=1&iv_load_policy=3`, title: e, allow: "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" }),
3562
3565
  !p && /* @__PURE__ */ i("div", { "aria-hidden": "true", className: "txyt__tap", onClick: a, style: { cursor: a ? "pointer" : "default" } }),
3563
- /* @__PURE__ */ i("div", { className: `txyt__paused${ie && !p && !H ? " txyt__paused--on" : ""}`, "aria-hidden": "true", children: /* @__PURE__ */ i("span", { className: "txyt__pausedplay", children: /* @__PURE__ */ i(Dr, { size: 44 }) }) }),
3566
+ /* @__PURE__ */ i("div", { className: `txyt__paused${ie && !p && !H ? " txyt__paused--on" : ""}`, "aria-hidden": "true", children: /* @__PURE__ */ i("span", { className: "txyt__pausedplay", children: /* @__PURE__ */ i(Pn, { size: 44 }) }) }),
3564
3567
  p && /* @__PURE__ */ i("div", { className: "txyt__ad", "aria-live": "polite", children: "Ad on YouTube · the transcript carries on after it" }),
3565
3568
  H && /* @__PURE__ */ g("div", { className: "txyt__gone", children: [
3566
3569
  /* @__PURE__ */ i("span", { children: "YouTube no longer has this part of the broadcast" }),
@@ -3992,7 +3995,7 @@ function $c(t, e, n, r, s, a, o = !1, l) {
3992
3995
  var q;
3993
3996
  if (ve.current !== r) {
3994
3997
  const se = ve.current != null ? we.current : null;
3995
- ve.current = r, (q = u.current) == null || q.stop(), u.current = new Lr(), Se(u.current), u.current.setSequence(pe.current), M(!1), f(0), C(null), ee(null), F(null), H(se && (se.playing || se.t > 0) ? se : null);
3998
+ ve.current = r, (q = u.current) == null || q.stop(), u.current = new kr(), Se(u.current), u.current.setSequence(pe.current), M(!1), f(0), C(null), ee(null), F(null), H(se && (se.playing || se.t > 0) ? se : null);
3996
3999
  }
3997
4000
  const U = u.current;
3998
4001
  U.setMuted(p.current);
@@ -4195,7 +4198,7 @@ function Hc({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, lan
4195
4198
  D(() => {
4196
4199
  V.current !== H && (V.current = H, x((P) => P + 1));
4197
4200
  }, [H]);
4198
- const ce = rc(De, Ee || s || J, sc(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 = br(o, ve), ke = Gi(), Ie = ze(() => Yi(o, "translation"), [o]), [Fe, Ae] = L(null), [he] = L(() => /* @__PURE__ */ new Set()), [_e, Be] = L({}), $ = ze(() => Jl(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 : ((Wt = $[0]) == null ? void 0 : Wt.key) ?? null, ae = ze(() => {
4201
+ const ce = rc(De, Ee || s || J, sc(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 = Cr(o, ve), ke = Gi(), Ie = ze(() => Yi(o, "translation"), [o]), [Fe, Ae] = L(null), [he] = L(() => /* @__PURE__ */ new Set()), [_e, Be] = L({}), $ = ze(() => Jl(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 : ((Wt = $[0]) == null ? void 0 : Wt.key) ?? null, ae = ze(() => {
4199
4202
  const P = fi($, W, H);
4200
4203
  for (const [Ce, Ve] of Object.entries(_e[De ?? ""] ?? {})) P.set(Number(Ce), Ve);
4201
4204
  return P;
@@ -4265,7 +4268,7 @@ function Hc({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, lan
4265
4268
  return;
4266
4269
  }
4267
4270
  ie(P);
4268
- }, dt = we ? { ...br(o, null), flag: /* @__PURE__ */ i(oe, { d: X.langAuto, size: 21, sw: 1.7, style: { color: "currentColor", display: "block" } }) } : G, Et = c ? M ? /* @__PURE__ */ i("span", { className: "barchip", style: ot ? { background: "var(--brand-tint)", boxShadow: "0 0 0 1.5px var(--brand)" } : void 0, children: /* @__PURE__ */ i(_n, { flag: dt.flag, code: dt.code, bordered: !1, onClick: re, flagOnly: !0, label: dt.label }) }) : /* @__PURE__ */ i(_n, { flag: dt.flag, code: dt.code, bordered: !1, onClick: Qe, flagOnly: !0, label: dt.label }) : null, Bt = X.voiceClone, bt = Ee && (!!Ne.track || at), Bn = st ? "var(--conf-low)" : bt || M && wt ? "var(--brand)" : "var(--ink-55)", _t = zc({ on: Ee, want: je, relang: rt, playing: $e.playing, preparing: !!$e.preparing, starting: $e.starting }), [qe] = na(_t === "line", 400), ht = _t === "asked" || _t === "line" && qe, vt = at || ht, Lt = _t === "asked" ? pi : $e.preparing ? `Speaking this line in ${(Le == null ? void 0 : Le.name) ?? "this voice"}…` : at ? `Preparing this recording in ${(Le == null ? void 0 : Le.name) ?? "this voice"} — it will play as soon as it is ready` : st ? `This voice could not be prepared: ${st}` : se ? ye ? "Choose a voice" : Le ? Le.name : ke.vcNoVoice + G.label : `${ke.vcNoVoice}${G.label}`, kt = /* @__PURE__ */ i(To, { open: ne, onClose: Xt, keepOpen: (!!M || y) && !le, value: we ? null : ve, onSelect: At, languages: Ie, title: (M == null ? void 0 : M.title) ?? "SPOKEN LANGUAGE", note: (M == null ? void 0 : M.note) ?? Bc, searchPlaceholder: ke.search, none: "Original", pinned: (we ? l : ve) ? [we ? l : ve] : [], recent: te, requireVoice: le, sticky: y, busy: j }), Vt = ze(() => W.filter((P) => P.cloned && !P.auto), [W]), Yt = (P) => P.voiceId ? Vt.find((Ce) => Ce.id === `clone:${P.voiceId}`) ?? null : null, Mt = ze(() => $.filter((P) => P.key >= 0), [$]), tn = ze(() => {
4271
+ }, dt = we ? { ...Cr(o, null), flag: /* @__PURE__ */ i(oe, { d: X.langAuto, size: 21, sw: 1.7, style: { color: "currentColor", display: "block" } }) } : G, Et = c ? M ? /* @__PURE__ */ i("span", { className: "barchip", style: ot ? { background: "var(--brand-tint)", boxShadow: "0 0 0 1.5px var(--brand)" } : void 0, children: /* @__PURE__ */ i(_n, { flag: dt.flag, code: dt.code, bordered: !1, onClick: re, flagOnly: !0, label: dt.label }) }) : /* @__PURE__ */ i(_n, { flag: dt.flag, code: dt.code, bordered: !1, onClick: Qe, flagOnly: !0, label: dt.label }) : null, Bt = X.voiceClone, bt = Ee && (!!Ne.track || at), Vn = st ? "var(--conf-low)" : bt || M && wt ? "var(--brand)" : "var(--ink-55)", _t = zc({ on: Ee, want: je, relang: rt, playing: $e.playing, preparing: !!$e.preparing, starting: $e.starting }), [qe] = na(_t === "line", 400), ht = _t === "asked" || _t === "line" && qe, vt = at || ht, Lt = _t === "asked" ? pi : $e.preparing ? `Speaking this line in ${(Le == null ? void 0 : Le.name) ?? "this voice"}…` : at ? `Preparing this recording in ${(Le == null ? void 0 : Le.name) ?? "this voice"} — it will play as soon as it is ready` : st ? `This voice could not be prepared: ${st}` : se ? ye ? "Choose a voice" : Le ? Le.name : ke.vcNoVoice + G.label : `${ke.vcNoVoice}${G.label}`, kt = /* @__PURE__ */ i(To, { open: ne, onClose: Xt, keepOpen: (!!M || y) && !le, value: we ? null : ve, onSelect: At, languages: Ie, title: (M == null ? void 0 : M.title) ?? "SPOKEN LANGUAGE", note: (M == null ? void 0 : M.note) ?? Bc, searchPlaceholder: ke.search, none: "Original", pinned: (we ? l : ve) ? [we ? l : ve] : [], recent: te, requireVoice: le, sticky: y, busy: j }), Vt = ze(() => W.filter((P) => P.cloned && !P.auto), [W]), Yt = (P) => P.voiceId ? Vt.find((Ce) => Ce.id === `clone:${P.voiceId}`) ?? null : null, Mt = ze(() => $.filter((P) => P.key >= 0), [$]), tn = ze(() => {
4269
4272
  const P = W.filter((Ve) => !Ve.cloned);
4270
4273
  if (!Me) return [...P, ...s && Mt.length === 1 ? Vt.filter((Ve) => Ve.id === `clone:${Mt[0].voiceId}`) : []];
4271
4274
  const Ce = [];
@@ -4279,7 +4282,7 @@ function Hc({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, lan
4279
4282
  var Ce;
4280
4283
  return P ? ((Ce = W.find((Ve) => Ve.id === P)) == null ? void 0 : Ce.gender) ?? null : null;
4281
4284
  }, Ze = it ? it.sex ?? Ct(ae.get(it.key)) : null, Ht = ze(() => it ? tn.filter((P) => P.cloned ? P.live ? P.speaker === it.key : P.id === `clone:${it.voiceId}` : !0) : tn, [tn, it, Ze, Mt]), nn = (P) => W.find((Ce) => Ce.cloned && Ce.auto && Ce.speaker === P) ?? null, pt = { people: Mt, gvList: W, autoOf: nn, savedFor: Yt }, Ke = (A == null ? void 0 : A(pt)) ?? 0, rn = F ? Mt.map((P) => F(P, pt)).filter((P) => !!P) : [], Ut = /* @__PURE__ */ g("button", { type: "button", className: "txvoice", "aria-label": "Voice", "aria-pressed": M ? wt : void 0, "aria-busy": vt || void 0, title: vt || st ? Lt : void 0, style: { cursor: "pointer", background: bt || vt || M && wt ? "var(--brand-tint)" : "var(--fill-06)", boxShadow: M && wt ? "inset 0 0 0 1.5px var(--brand)" : void 0 }, onClick: M ? en : Xe, children: [
4282
- /* @__PURE__ */ i(oe, { d: Bt, size: 17, sw: 1.6, style: { color: Bn } }),
4285
+ /* @__PURE__ */ i(oe, { d: Bt, size: 17, sw: 1.6, style: { color: Vn } }),
4283
4286
  vt && /* @__PURE__ */ i("span", { "aria-hidden": "true", style: { position: "absolute", inset: 0, boxSizing: "border-box", borderRadius: "50%", border: "2px solid var(--fill-12)", borderTopColor: "var(--brand)", animation: "vs-spin .7s linear infinite", pointerEvents: "none" } }),
4284
4287
  rn.length > 0 ? /* @__PURE__ */ i("span", { className: "txvoice__warn", title: rn.join(" · "), children: "!" }) : !!Ke && /* @__PURE__ */ i("span", { className: "txvoice__n", title: `${Ke} speaker${Ke === 1 ? "" : "s"} can get a cloned voice`, children: Ke })
4285
4288
  ] }), Mn = /* @__PURE__ */ i(Jt, { open: J, onClose: ut, title: ke.vcSheet, titleNode: T, doneLabel: ke.done, children: /* @__PURE__ */ i(
@@ -4330,10 +4333,10 @@ function Hc({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, lan
4330
4333
  },
4331
4334
  onUse: O
4332
4335
  }
4333
- ) }), Vn = M ? null : /* @__PURE__ */ g(xe, { children: [
4336
+ ) }), Hn = M ? null : /* @__PURE__ */ g(xe, { children: [
4334
4337
  kt,
4335
4338
  Mn
4336
- ] }), xt = M && (ne || J) ? /* @__PURE__ */ i("div", { className: "vs-side", children: ne ? kt : Mn }) : null, Hn = Ge ? st ? `This voice could not be prepared: ${st}` : ht && (je || $e.playing) ? pi : null : null, Wn = ft;
4339
+ ] }), xt = M && (ne || J) ? /* @__PURE__ */ i("div", { className: "vs-side", children: ne ? kt : Mn }) : null, Wn = Ge ? st ? `This voice could not be prepared: ${st}` : ht && (je || $e.playing) ? pi : null : null, Fn = ft;
4337
4340
  return {
4338
4341
  barChip: { flag: dt.flag, code: dt.code, label: dt.label, onClick: M || y ? re : Qe, active: !!((M || y) && ot), can: c },
4339
4342
  sheetsOpen: ne || J,
@@ -4342,14 +4345,14 @@ function Hc({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, lan
4342
4345
  chip: Et,
4343
4346
  voiceBtn: Ut,
4344
4347
  voiceWaiting: vt,
4345
- sheets: Vn,
4348
+ sheets: Hn,
4346
4349
  sidePanel: xt,
4347
4350
  voicesMine: wt,
4348
4351
  toggleVoices: en,
4349
4352
  cloningOn: H,
4350
- playTitle: Hn,
4353
+ playTitle: Wn,
4351
4354
  noVoice: ft,
4352
- noVoiceNote: Wn,
4355
+ noVoiceNote: Fn,
4353
4356
  relang: rt,
4354
4357
  sampling: Q.sampleId != null,
4355
4358
  error: Q.error,
@@ -4417,18 +4420,18 @@ function Wc({ model: t, rows: e, player: n, fixed: r, applied: s, onFixOpen: a,
4417
4420
  const ve = (H) => {
4418
4421
  const E = j.current, x = je(H);
4419
4422
  if (!E || !x) return;
4420
- const V = x.getBoundingClientRect().top - E.getBoundingClientRect().top + E.scrollTop, ce = E.scrollHeight - E.clientHeight, W = mr(E), ye = Math.max(80, E.clientHeight - W.top - W.bottom), G = x.offsetHeight > ye ? 8 : (ye - x.offsetHeight) / 2;
4423
+ const V = x.getBoundingClientRect().top - E.getBoundingClientRect().top + E.scrollTop, ce = E.scrollHeight - E.clientHeight, W = Nr(E), ye = Math.max(80, E.clientHeight - W.top - W.bottom), G = x.offsetHeight > ye ? 8 : (ye - x.offsetHeight) / 2;
4421
4424
  E.scrollTop = Math.max(0, Math.min(ce, V - W.top - G));
4422
4425
  }, we = (H) => {
4423
4426
  const E = j.current, x = je(H);
4424
4427
  if (!E || !E.clientHeight || !E.offsetParent || !x) return 0;
4425
- const V = x.getBoundingClientRect(), ce = E.getBoundingClientRect(), W = mr(E), ye = ce.top + W.top, G = ce.bottom - W.bottom;
4428
+ const V = x.getBoundingClientRect(), ce = E.getBoundingClientRect(), W = Nr(E), ye = ce.top + W.top, G = ce.bottom - W.bottom;
4426
4429
  return V.height > G - ye ? V.top < ye - 4 ? -1 : V.top > G - 60 ? 1 : 0 : V.bottom < ye + 10 ? -1 : V.bottom > G - 4 ? 1 : 0;
4427
4430
  }, Ee = (H) => {
4428
4431
  pe.current = performance.now() + 420;
4429
4432
  const E = j.current, x = je(H);
4430
4433
  if (!E || !E.clientHeight || !x) return;
4431
- const V = x.getBoundingClientRect(), ce = E.getBoundingClientRect(), W = E.scrollHeight - E.clientHeight, ye = E.scrollTop, G = mr(E), ke = Math.max(80, E.clientHeight - G.top - G.bottom), Ie = V.height > ke ? 8 : (ke - V.height) / 2, Fe = Math.max(0, Math.min(W, ye + (V.top - ce.top) - G.top - Ie));
4434
+ const V = x.getBoundingClientRect(), ce = E.getBoundingClientRect(), W = E.scrollHeight - E.clientHeight, ye = E.scrollTop, G = Nr(E), ke = Math.max(80, E.clientHeight - G.top - G.bottom), Ie = V.height > ke ? 8 : (ke - V.height) / 2, Fe = Math.max(0, Math.min(W, ye + (V.top - ce.top) - G.top - Ie));
4432
4435
  if (le.current && cancelAnimationFrame(le.current), Math.abs(Fe - ye) < 2) {
4433
4436
  E.scrollTop = Fe, le.current = null;
4434
4437
  return;
@@ -4576,7 +4579,7 @@ function sa(t) {
4576
4579
  return e;
4577
4580
  }
4578
4581
  const Ni = (t) => Math.floor(sa(t) / 8) - hn.perBlock[t] * hn.blocks[t];
4579
- function xr(t, e) {
4582
+ function Sr(t, e) {
4580
4583
  let n = 0;
4581
4584
  for (let r = 7; r >= 0; r--)
4582
4585
  n = n << 1 ^ (n >>> 7) * 285, n ^= (e >>> r & 1) * t;
@@ -4587,8 +4590,8 @@ function Gc(t) {
4587
4590
  e[t - 1] = 1;
4588
4591
  let n = 1;
4589
4592
  for (let r = 0; r < t; r++) {
4590
- for (let s = 0; s < t; s++) e[s] = xr(e[s], n) ^ (s + 1 < t ? e[s + 1] : 0);
4591
- n = xr(n, 2);
4593
+ for (let s = 0; s < t; s++) e[s] = Sr(e[s], n) ^ (s + 1 < t ? e[s + 1] : 0);
4594
+ n = Sr(n, 2);
4592
4595
  }
4593
4596
  return e;
4594
4597
  }
@@ -4597,7 +4600,7 @@ function qc(t, e) {
4597
4600
  for (const r of t) {
4598
4601
  const s = r ^ n.shift();
4599
4602
  n.push(0), e.forEach((a, o) => {
4600
- n[o] ^= xr(a, s);
4603
+ n[o] ^= Sr(a, s);
4601
4604
  });
4602
4605
  }
4603
4606
  return n;
@@ -4741,7 +4744,7 @@ function Xc(t) {
4741
4744
  return `data:image/svg+xml,${encodeURIComponent(a)}`;
4742
4745
  }
4743
4746
  const ia = "M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15", eu = "M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25";
4744
- function Nr() {
4747
+ function yr() {
4745
4748
  const t = document;
4746
4749
  return t.fullscreenElement ?? t.webkitFullscreenElement ?? null;
4747
4750
  }
@@ -4880,15 +4883,15 @@ function En({ t, mini: e }) {
4880
4883
  disabled: !t.playable,
4881
4884
  style: { background: t.playable ? t.playing ? "rgba(238,240,248,.92)" : "var(--brand)" : "rgba(5,6,21,.42)", color: t.playable ? t.playing ? "#131326" : "var(--brand-ink)" : "rgba(234,236,250,.5)", cursor: t.playable ? "pointer" : "default" },
4882
4885
  onClick: t.onPlay,
4883
- children: t.busy ? /* @__PURE__ */ i("span", { className: "gfull__spin", "aria-hidden": "true" }) : t.playing ? /* @__PURE__ */ i(Xa, { size: e ? 14 : 18 }) : /* @__PURE__ */ i(Dr, { size: e ? 15 : 19 })
4886
+ children: t.busy ? /* @__PURE__ */ i("span", { className: "gfull__spin", "aria-hidden": "true" }) : t.playing ? /* @__PURE__ */ i(Xa, { size: e ? 14 : 18 }) : /* @__PURE__ */ i(Pn, { size: e ? 15 : 19 })
4884
4887
  }
4885
4888
  ),
4886
4889
  /* @__PURE__ */ i("button", { type: "button", className: "gfull__step", "aria-label": "Next line", title: "Next line", style: { opacity: t.nextOn ? 1 : 0.3 }, onClick: t.onNext, children: /* @__PURE__ */ i(oe, { d: X.chevronRight, size: e ? 13 : 16, sw: e ? 1.8 : 1.9 }) })
4887
4890
  ] });
4888
4891
  }
4889
- function Sr({ live: t, mini: e, desk: n, pct: r, mark: s }) {
4892
+ function Dr({ live: t, mini: e, desk: n, pct: r, mark: s }) {
4890
4893
  return /* @__PURE__ */ g("div", { className: `gfull__brand${s ? " gfull__brand--mark" : ""}`, children: [
4891
- /* @__PURE__ */ i("a", { href: Ii, target: "_blank", rel: "noopener", style: { display: "block", lineHeight: 0 }, "aria-label": "VocalStack", title: "VocalStack", children: s ? /* @__PURE__ */ i(Ar, { dark: !0, size: 22 }) : /* @__PURE__ */ i(Pn, { dark: !0, link: !1, height: e ? 11 : n ? 18 : 15 }) }),
4894
+ /* @__PURE__ */ i("a", { href: Ii, target: "_blank", rel: "noopener", style: { display: "block", lineHeight: 0 }, "aria-label": "VocalStack", title: "VocalStack", children: s ? /* @__PURE__ */ i(Ar, { dark: !0, size: 22 }) : /* @__PURE__ */ i($n, { dark: !0, link: !1, height: e ? 11 : n ? 18 : 15 }) }),
4892
4895
  t && /* @__PURE__ */ g("span", { className: "gfull__live", children: [
4893
4896
  /* @__PURE__ */ i("i", {}),
4894
4897
  "LIVE"
@@ -4905,7 +4908,7 @@ function aa({ v: t, size: e }) {
4905
4908
  function ru({ pos: t, transport: e, chip: n, voices: r, onShare: s, onFull: a, copied: o }) {
4906
4909
  return /* @__PURE__ */ g("div", { className: "gmini", "data-theme": "dark", children: [
4907
4910
  /* @__PURE__ */ i("div", { className: "gmini__shade", "aria-hidden": "true" }),
4908
- /* @__PURE__ */ i("div", { className: "gmini__top", children: /* @__PURE__ */ i(Sr, { live: t.live, mini: !0 }) }),
4911
+ /* @__PURE__ */ i("div", { className: "gmini__top", children: /* @__PURE__ */ i(Dr, { live: t.live, mini: !0 }) }),
4909
4912
  /* @__PURE__ */ g("div", { className: "gmini__foot", children: [
4910
4913
  /* @__PURE__ */ i("div", { className: "gmini__row", children: /* @__PURE__ */ i(An, { pos: t, interactive: !0 }) }),
4911
4914
  /* @__PURE__ */ g("div", { className: "gmini__row gmini__row--ctl", children: [
@@ -4924,9 +4927,9 @@ function ru({ pos: t, transport: e, chip: n, voices: r, onShare: s, onFull: a, c
4924
4927
  }
4925
4928
  const su = { color: "rgba(255,255,255,.4)" };
4926
4929
  function oa({ 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: m, picker: y, sheet: j, voices: N, voicesBtn: p, sheetOpen: I, onShare: C, onSettings: S, paused: B, copied: Y, onTouch: ee, onClose: z }) {
4927
- const [F, A] = L(() => !!Nr());
4930
+ const [F, A] = L(() => !!yr());
4928
4931
  D(() => {
4929
- const $ = () => A(!!Nr());
4932
+ const $ = () => A(!!yr());
4930
4933
  return document.addEventListener("fullscreenchange", $), document.addEventListener("webkitfullscreenchange", $), () => {
4931
4934
  document.removeEventListener("fullscreenchange", $), document.removeEventListener("webkitfullscreenchange", $);
4932
4935
  };
@@ -4972,7 +4975,7 @@ function oa({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title:
4972
4975
  pe.current = I, D(() => {
4973
4976
  const $ = (ae) => ae instanceof HTMLElement && (ae.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(ae.tagName)), Me = (ae) => {
4974
4977
  var fe;
4975
- ae.key === "Escape" && !pe.current && T.current && (ae.stopPropagation(), T.current()), ae.key === " " && !pe.current && !$(ae.target) && (ae.preventDefault(), ae.stopPropagation(), ae.repeat || (fe = _.current) == null || fe.call(_)), (ae.key === "f" || ae.key === "F") && !ae.metaKey && !ae.ctrlKey && !ae.altKey && !pe.current && !$(ae.target) && Ti() && (ae.preventDefault(), ae.repeat || Dn(!Nr()));
4978
+ ae.key === "Escape" && !pe.current && T.current && (ae.stopPropagation(), T.current()), ae.key === " " && !pe.current && !$(ae.target) && (ae.preventDefault(), ae.stopPropagation(), ae.repeat || (fe = _.current) == null || fe.call(_)), (ae.key === "f" || ae.key === "F") && !ae.metaKey && !ae.ctrlKey && !ae.altKey && !pe.current && !$(ae.target) && Ti() && (ae.preventDefault(), ae.repeat || Dn(!yr()));
4976
4979
  }, ue = (ae) => {
4977
4980
  ae.key === " " && !pe.current && !$(ae.target) && ae.preventDefault();
4978
4981
  };
@@ -5115,7 +5118,7 @@ function oa({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title:
5115
5118
  ] })
5116
5119
  ] }) }),
5117
5120
  /* @__PURE__ */ i("div", { className: `gfull__prog${we ? "" : " gfull__prog--two"}`, children: we ? /* @__PURE__ */ g(xe, { children: [
5118
- /* @__PURE__ */ i(Sr, { live: o.live, desk: !0, pct: u }),
5121
+ /* @__PURE__ */ i(Dr, { live: o.live, desk: !0, pct: u }),
5119
5122
  /* @__PURE__ */ i(En, { t: m }),
5120
5123
  /* @__PURE__ */ i(An, { pos: o, interactive: !0 }),
5121
5124
  /* @__PURE__ */ i("div", { className: "gfull__chip", children: f }),
@@ -5127,7 +5130,7 @@ function oa({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title:
5127
5130
  _e
5128
5131
  ] }) : /* @__PURE__ */ g(xe, { children: [
5129
5132
  /* @__PURE__ */ g("div", { className: "gfull__row", children: [
5130
- /* @__PURE__ */ i(Sr, { live: o.live, pct: u, mark: !0 }),
5133
+ /* @__PURE__ */ i(Dr, { live: o.live, pct: u, mark: !0 }),
5131
5134
  /* @__PURE__ */ i(An, { pos: o, interactive: !0 })
5132
5135
  ] }),
5133
5136
  /* @__PURE__ */ g("div", { className: "gfull__row", children: [
@@ -5149,7 +5152,7 @@ function iu({ dark: t, back: e, home: n, live: r, title: s, badge: a, subline: o
5149
5152
  return /* @__PURE__ */ g("div", { className: "ghead", children: [
5150
5153
  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 }) }),
5151
5154
  r && /* @__PURE__ */ i("span", { className: "mark", children: /* @__PURE__ */ i(Ar, { dark: t, size: 30 }) }),
5152
- /* @__PURE__ */ i("div", { style: { flex: 1, minWidth: 0, display: "flex" }, children: n ? /* @__PURE__ */ i("div", { className: "ghead__logo", children: /* @__PURE__ */ i(Pn, { dark: t, height: 22 }) }) : /* @__PURE__ */ g("div", { className: "ghead__title", onClick: e, title: e ? "Back" : void 0, style: { cursor: e ? "pointer" : "default" }, children: [
5155
+ /* @__PURE__ */ i("div", { style: { flex: 1, minWidth: 0, display: "flex" }, children: n ? /* @__PURE__ */ i("div", { className: "ghead__logo", children: /* @__PURE__ */ i($n, { dark: t, height: 22 }) }) : /* @__PURE__ */ g("div", { className: "ghead__title", onClick: e, title: e ? "Back" : void 0, style: { cursor: e ? "pointer" : "default" }, children: [
5153
5156
  /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
5154
5157
  /* @__PURE__ */ i("span", { className: "ghead__name", children: s }),
5155
5158
  a
@@ -5260,7 +5263,7 @@ function fu({ options: t, onStarted: e, onReplay: n, onClose: r }) {
5260
5263
  y.stopPropagation(), y.target === y.currentTarget && r();
5261
5264
  }, children: /* @__PURE__ */ g("div", { className: "vsp-end__card", children: [
5262
5265
  /* @__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 }) }),
5263
- /* @__PURE__ */ i("div", { className: "vsp-end__brand", children: /* @__PURE__ */ i(Pn, { dark: !0, link: !1, height: 16 }) }),
5266
+ /* @__PURE__ */ i("div", { className: "vsp-end__brand", children: /* @__PURE__ */ i($n, { dark: !0, link: !1, height: 16 }) }),
5264
5267
  /* @__PURE__ */ i("div", { className: "vsp-end__title", children: t.title ?? "Transcribe and translate any video" }),
5265
5268
  /* @__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." }),
5266
5269
  /* @__PURE__ */ g("form", { className: "vsp-end__row", onSubmit: (y) => {
@@ -5292,7 +5295,7 @@ function ua(t) {
5292
5295
  }
5293
5296
  const pu = { lang: null, subtitles: !0, speakerLabels: !1, wordHighlight: !0, translateAudio: !0, voices: "cloned", removeBackground: !1, muted: !1 };
5294
5297
  function mu(t, e) {
5295
- const n = Fi(), [r, s] = _i(), [a, o] = L(null), [l, c] = L("main"), u = br(n, t.lang), d = ze(() => Yi(n, "translation"), [n]), M = (Y) => {
5298
+ const n = Fi(), [r, s] = _i(), [a, o] = L(null), [l, c] = L("main"), u = Cr(n, t.lang), d = ze(() => Yi(n, "translation"), [n]), M = (Y) => {
5296
5299
  e({ lang: Y }), s(Y);
5297
5300
  }, h = _r({ open: a === "lang" || a === "settings" && l === "lang", onClose: () => a === "lang" ? o(null) : c("main"), value: t.lang, onSelect: M, languages: d, none: "As spoken", pinned: t.lang ? [t.lang] : [], recent: r, keepOpen: !0 }), f = () => {
5298
5301
  o(null), c("main");
@@ -5319,7 +5322,7 @@ function mu(t, e) {
5319
5322
  I("Highlight words", "Follow each word as it is spoken", /* @__PURE__ */ i(Tt, { checked: t.wordHighlight, onChange: (Y) => e({ wordHighlight: Y }), label: "Highlight words" }))
5320
5323
  ] }) : l === "audio" ? /* @__PURE__ */ g("div", { style: p, children: [
5321
5324
  I("Translate audio", t.lang ? "Hear the translation read aloud instead of the original speech" : "Pick a language to hear the translation read aloud", /* @__PURE__ */ i(Tt, { checked: t.translateAudio && !!t.lang, onChange: (Y) => e({ translateAudio: Y }), label: "Translate audio", disabled: !t.lang })),
5322
- I("Voices", t.voices === "cloned" ? "Each speaker in their own cloned voice, where they agreed to it" : "Synthetic voices matched to each speaker", /* @__PURE__ */ i(Tr, { value: t.voices, onChange: (Y) => e({ voices: Y }), size: "sm", options: [{ value: "synthetic", label: "Synthetic" }, { value: "cloned", label: "Cloned" }] })),
5325
+ I("Voices", t.voices === "cloned" ? "Each speaker in their own cloned voice, where they agreed to it" : "Synthetic voices matched to each speaker", /* @__PURE__ */ i(wr, { value: t.voices, onChange: (Y) => e({ voices: Y }), size: "sm", options: [{ value: "synthetic", label: "Synthetic" }, { value: "cloned", label: "Cloned" }] })),
5323
5326
  I(Yn, "Takes out everything that isn't speech: music, ambience and noise.", /* @__PURE__ */ i(Tt, { checked: t.removeBackground, onChange: (Y) => e({ removeBackground: Y }), label: Yn }))
5324
5327
  ] }) : /* @__PURE__ */ g("div", { style: p, children: [
5325
5328
  /* @__PURE__ */ g("div", { className: "srow srow--tap", role: "button", onClick: () => c("lang"), children: [
@@ -5347,8 +5350,8 @@ function mu(t, e) {
5347
5350
  j
5348
5351
  ] })
5349
5352
  ] }), B = /* @__PURE__ */ g(xe, { children: [
5350
- /* @__PURE__ */ i(Jt, { open: a === "lang", onClose: f, title: "LANGUAGE", kind: "picker", header: h.search, sticky: !0, children: /* @__PURE__ */ i(wr, { children: h.list }) }),
5351
- /* @__PURE__ */ i(Jt, { 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(wr, { children: S }) })
5353
+ /* @__PURE__ */ i(Jt, { open: a === "lang", onClose: f, title: "LANGUAGE", kind: "picker", header: h.search, sticky: !0, children: /* @__PURE__ */ i(vr, { children: h.list }) }),
5354
+ /* @__PURE__ */ i(Jt, { 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(vr, { children: S }) })
5352
5355
  ] });
5353
5356
  return {
5354
5357
  chip: y,
@@ -5444,7 +5447,7 @@ const da = {
5444
5447
  checking: "Checking the link…",
5445
5448
  starting: "Starting the transcription…"
5446
5449
  }, vi = /^(https?:\/\/)?([\w-]+\.)+[a-z]{2,}(\/\S*)?$/i;
5447
- function yr(t) {
5450
+ function Tr(t) {
5448
5451
  try {
5449
5452
  return new URL(t).hostname.replace(/^www\./, "");
5450
5453
  } catch {
@@ -5513,9 +5516,9 @@ function ha({ connect: t, onClick: e, label: n }) {
5513
5516
  }
5514
5517
  function Iu({ idle: t, src: e, ask: n, connect: r, page: s, poster: a = null, onClear: o }) {
5515
5518
  const l = () => r.start(e, n);
5516
- return /* @__PURE__ */ g(Rn, { idle: t, poster: a, src: e, title: yr(e), page: s, onAct: l, children: [
5519
+ return /* @__PURE__ */ g(Rn, { idle: t, poster: a, src: e, title: Tr(e), page: s, onAct: l, children: [
5517
5520
  /* @__PURE__ */ i(ha, { connect: r, onClick: l, label: r.connected ? "Play with VocalStack" : "Connect to VocalStack" }),
5518
- !r.busy && /* @__PURE__ */ i("div", { className: "vsp-idle__note", children: r.connected ? `Plays ${yr(e)} with subtitles and spoken translations.` : `Connect to play ${yr(e)} with subtitles and spoken translations.` }),
5521
+ !r.busy && /* @__PURE__ */ i("div", { className: "vsp-idle__note", children: r.connected ? `Plays ${Tr(e)} with subtitles and spoken translations.` : `Connect to play ${Tr(e)} with subtitles and spoken translations.` }),
5519
5522
  o && !r.busy && /* @__PURE__ */ i("button", { type: "button", className: "vsp-idle__other", onClick: o, children: "Choose another video" })
5520
5523
  ] });
5521
5524
  }
@@ -5700,11 +5703,11 @@ function Du(t) {
5700
5703
  onFrame: (w) => {
5701
5704
  w.type === "job.progress" && S({ state: w.state, processedS: w.processedS ?? 0, totalS: w.totalS ?? null, segmentsDone: w.segmentsDone ?? 0, segmentsTotal: w.segmentsTotal ?? null, pct: w.pct ?? 0, error: w.error ?? null });
5702
5705
  }
5703
- }), he = ze(() => ll(ce).filter((w) => !w.suppressed), [ce]), _e = Sl((n == null ? void 0 : n.job) ?? null), Be = ["done", "failed", "stopped"].includes(pr((_e == null ? void 0 : _e.state) ?? ((vs = n == null ? void 0 : n.job) == null ? void 0 : vs.state))), $ = Be ? _e : C ?? _e, Me = !!C && !["done", "failed", "stopped"].includes(pr(C.state)), ue = k(0);
5706
+ }), he = ze(() => ll(ce).filter((w) => !w.suppressed), [ce]), _e = Sl((n == null ? void 0 : n.job) ?? null), Be = ["done", "failed", "stopped"].includes(mr((_e == null ? void 0 : _e.state) ?? ((vs = n == null ? void 0 : n.job) == null ? void 0 : vs.state))), $ = Be ? _e : C ?? _e, Me = !!C && !["done", "failed", "stopped"].includes(mr(C.state)), ue = k(0);
5704
5707
  D(() => {
5705
5708
  !Be || !Me || Date.now() - ue.current < 1e4 || (ue.current = Date.now(), t.reread());
5706
5709
  }, [Be, Me, C == null ? void 0 : C.state, C == null ? void 0 : C.processedS, o]);
5707
- const ae = pr(($ == null ? void 0 : $.state) ?? ((Ls = n == null ? void 0 : n.job) == null ? void 0 : Ls.state) ?? (e.listen ? (v == null ? void 0 : v.state) === "finalized" ? "done" : v != null && v.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 = Al(n == null ? void 0 : n.job, $) ?? (v == null ? void 0 : v.mediaDurationS) ?? null, q = ((ks = ce.segments.values().next().value) == null ? void 0 : ks.language) ?? (v == null ? void 0 : v.spokenLanguage) ?? null, se = n != null && n.sharedBy ? `Shared by ${n.sharedBy}` : "", de = ((Is = (zs = (js = n == null ? void 0 : n.job) == null ? void 0 : js.source) == null ? void 0 : zs.name) == null ? void 0 : Is.trim()) || null, Oe = n ? ((Os = n.name) == null ? void 0 : Os.trim()) || de : null, Ne = !!((bs = n == null ? void 0 : n.job) != null && bs.hasAudio), Le = (Cs = n == null ? void 0 : n.job) == null ? void 0 : Cs.source, be = !Ne && !!Le && (Le.kind !== "url" || Le.bytes != null) && (ae === "transcribing" || ae === "queued" || ae === "done"), He = ie && (n != null && n.allowDownload) && Ne ? oo(e.origin, ie, e.cred) : null, $e = !!Le && (Le.kind !== "url" || Le.bytes != null), at = Au(He && $e ? He : null), st = He && (!$e || at === "yes") ? He : He && at === "unknown" ? null : ie && (n != null && n.allowDownload) && (be || Ne && $e) ? On(e.origin, ie, "source", e.cred) : null, ft = he[he.length - 1], Ge = ft ? ((xs = ft.words[ft.words.length - 1]) == null ? void 0 : xs.end) ?? ft.start : 0, rt = u && fe ? Math.max(Ge, ($ == null ? void 0 : $.processedS) ?? 0) : null, ct = Pc(st, (Ne || be) && !!(n != null && n.allowDownload), he, R, be ? ((Ds = (Ss = n == null ? void 0 : n.job) == null ? void 0 : Ss.crop) == null ? void 0 : Ds.startS) ?? 0 : 0, rt), Qe = ((Es = (As = n == null ? void 0 : n.job) == null ? void 0 : As.source) == null ? void 0 : Es.kind) === "url" ? Ki(n.job.source.url) : null, Xt = Do(Qe), At = Rc(he, R, ((Ys = (_s = n == null ? void 0 : n.job) == null ? void 0 : _s.crop) == null ? void 0 : Ys.startS) ?? 0, rt), Xe = !!Qe, ut = Xe ? At.player : ct, ot = Fi(), wt = k(null), re = Hc({ forcedVoice: t.voice ?? null, recordingId: ie, model: ce, rows: he, lenS: R, ended: !!ie && !fe, cred: e.cred, langs: ot, srcLang: q, canTranslate: !!(n != null && n.allowTranslate), pickedLang: ne, setPickedLang: Z, side: s && !te ? Vc : void 0, hearOriginal: V, timed: !!Qe, stockVoices: u && !Re, stickyPicker: u, pickerBusy: wt.current }), en = k(null);
5710
+ const ae = mr(($ == null ? void 0 : $.state) ?? ((Ls = n == null ? void 0 : n.job) == null ? void 0 : Ls.state) ?? (e.listen ? (v == null ? void 0 : v.state) === "finalized" ? "done" : v != null && v.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 = Al(n == null ? void 0 : n.job, $) ?? (v == null ? void 0 : v.mediaDurationS) ?? null, q = ((ks = ce.segments.values().next().value) == null ? void 0 : ks.language) ?? (v == null ? void 0 : v.spokenLanguage) ?? null, se = n != null && n.sharedBy ? `Shared by ${n.sharedBy}` : "", de = ((Is = (zs = (js = n == null ? void 0 : n.job) == null ? void 0 : js.source) == null ? void 0 : zs.name) == null ? void 0 : Is.trim()) || null, Oe = n ? ((Os = n.name) == null ? void 0 : Os.trim()) || de : null, Ne = !!((bs = n == null ? void 0 : n.job) != null && bs.hasAudio), Le = (Cs = n == null ? void 0 : n.job) == null ? void 0 : Cs.source, be = !Ne && !!Le && (Le.kind !== "url" || Le.bytes != null) && (ae === "transcribing" || ae === "queued" || ae === "done"), He = ie && (n != null && n.allowDownload) && Ne ? oo(e.origin, ie, e.cred) : null, $e = !!Le && (Le.kind !== "url" || Le.bytes != null), at = Au(He && $e ? He : null), st = He && (!$e || at === "yes") ? He : He && at === "unknown" ? null : ie && (n != null && n.allowDownload) && (be || Ne && $e) ? On(e.origin, ie, "source", e.cred) : null, ft = he[he.length - 1], Ge = ft ? ((xs = ft.words[ft.words.length - 1]) == null ? void 0 : xs.end) ?? ft.start : 0, rt = u && fe ? Math.max(Ge, ($ == null ? void 0 : $.processedS) ?? 0) : null, ct = Pc(st, (Ne || be) && !!(n != null && n.allowDownload), he, R, be ? ((Ds = (Ss = n == null ? void 0 : n.job) == null ? void 0 : Ss.crop) == null ? void 0 : Ds.startS) ?? 0 : 0, rt), Qe = ((Es = (As = n == null ? void 0 : n.job) == null ? void 0 : As.source) == null ? void 0 : Es.kind) === "url" ? Ki(n.job.source.url) : null, Xt = Do(Qe), At = Rc(he, R, ((Ys = (_s = n == null ? void 0 : n.job) == null ? void 0 : _s.crop) == null ? void 0 : Ys.startS) ?? 0, rt), Xe = !!Qe, ut = Xe ? At.player : ct, ot = Fi(), wt = k(null), re = Hc({ forcedVoice: t.voice ?? null, recordingId: ie, model: ce, rows: he, lenS: R, ended: !!ie && !fe, cred: e.cred, langs: ot, srcLang: q, canTranslate: !!(n != null && n.allowTranslate), pickedLang: ne, setPickedLang: Z, side: s && !te ? Vc : void 0, hearOriginal: V, timed: !!Qe, stockVoices: u && !Re, stickyPicker: u, pickerBusy: wt.current }), en = k(null);
5708
5711
  D(() => {
5709
5712
  !ie || en.current === J || (en.current = J, G(J));
5710
5713
  }, [J, ie]);
@@ -5727,7 +5730,7 @@ function Du(t) {
5727
5730
  D(() => {
5728
5731
  fe && !O.playing && bt.current && (bt.current.scrollTop = bt.current.scrollHeight);
5729
5732
  }, [fe, he.length]);
5730
- const Bn = Zc(bt, he, m, j, y), _t = /* @__PURE__ */ i(Fc, { open: m, q: j, onQ: N, onClose: () => y(!1), hits: Bn, desk: s, inline: s }), qe = Eo({ name: n == null ? void 0 : n.name, sourceName: (Rs = (Us = n == null ? void 0 : n.job) == null ? void 0 : Us.source) == null ? void 0 : Rs.name, ytTitle: Xt, url: (($s = (Ps = n == null ? void 0 : n.job) == null ? void 0 : Ps.source) == null ? void 0 : $s.kind) === "url" ? n.job.source.url : t.src ?? null, id: o }), ht = !!(n != null && n.allowDownload), vt = !!(n != null && n.allowExport), Lt = re.readLang, kt = Lt ? ((Qs = ot == null ? void 0 : ot.languages.find((w) => w.code === Lt)) == null ? void 0 : Qs.name) ?? Lt.toUpperCase() : null, Vt = async () => {
5733
+ const Vn = Zc(bt, he, m, j, y), _t = /* @__PURE__ */ i(Fc, { open: m, q: j, onQ: N, onClose: () => y(!1), hits: Vn, desk: s, inline: s }), qe = Eo({ name: n == null ? void 0 : n.name, sourceName: (Rs = (Us = n == null ? void 0 : n.job) == null ? void 0 : Us.source) == null ? void 0 : Rs.name, ytTitle: Xt, url: (($s = (Ps = n == null ? void 0 : n.job) == null ? void 0 : Ps.source) == null ? void 0 : $s.kind) === "url" ? n.job.source.url : t.src ?? null, id: o }), ht = !!(n != null && n.allowDownload), vt = !!(n != null && n.allowExport), Lt = re.readLang, kt = Lt ? ((Qs = ot == null ? void 0 : ot.languages.find((w) => w.code === Lt)) == null ? void 0 : Qs.name) ?? Lt.toUpperCase() : null, Vt = async () => {
5731
5734
  if (ie)
5732
5735
  try {
5733
5736
  if (Lt && re.canSpeak) {
@@ -5744,7 +5747,7 @@ function Du(t) {
5744
5747
  }
5745
5748
  }, Yt = (w) => {
5746
5749
  if (!ie) return;
5747
- const me = Or.find((We) => We.key === w).name, Pe = kt ? ` in ${kt}` : "";
5750
+ const me = br.find((We) => We.key === w).name, Pe = kt ? ` in ${kt}` : "";
5748
5751
  return _l(e, ie, w, { lang: Lt }).then(() => I(fe ? `${me} exported${Pe} for the first ${he.length} segments — the rest is still transcribing.` : `${me} exported${Pe}.`)).catch((We) => {
5749
5752
  throw M(Ot(We)), We;
5750
5753
  });
@@ -5767,7 +5770,7 @@ function Du(t) {
5767
5770
  });
5768
5771
  const pt = k(!1), Ke = k(!1);
5769
5772
  u && (Ci.video = !0);
5770
- const [rn, Ut] = L(!1), [Mn, Vn] = L(!1);
5773
+ const [rn, Ut] = L(!1), [Mn, Hn] = L(!1);
5771
5774
  D(() => {
5772
5775
  if (!u || pt.current || !Ct || !te || Ye || t.autoplay === !1) return;
5773
5776
  pt.current = !0;
@@ -5784,11 +5787,11 @@ function Du(t) {
5784
5787
  We === !1 ? Ut(!0) : We == null && !Ke.current && me();
5785
5788
  });
5786
5789
  }, [u, Ct, te, Ye]);
5787
- const xt = k(!1), Hn = () => {
5790
+ const xt = k(!1), Wn = () => {
5788
5791
  rn && (Ut(!1), xt.current = !0, setTimeout(() => {
5789
5792
  xt.current = !1;
5790
5793
  }, 500), Ze.current.muted && Ze.current.toggleMute());
5791
- }, Wn = () => {
5794
+ }, Fn = () => {
5792
5795
  if (xt.current) {
5793
5796
  xt.current = !1;
5794
5797
  return;
@@ -5815,7 +5818,7 @@ function Du(t) {
5815
5818
  D(() => {
5816
5819
  jt || (ut.playing && ut.pause(), re.player.playing && re.player.pause());
5817
5820
  }, [jt, ut.playing, re.player.playing]);
5818
- const Ue = re.barChip, Ft = Gi(Ue.label), Hr = /* @__PURE__ */ i(Tr, { value: B, onChange: ga, bordered: !1, options: ou(Ft, !!Qe) }), Zt = [...sn ? [{ key: "summary", label: "Summary" }] : [], ...on ? [{ key: "export", label: "Export" }] : []], Wr = (w) => /* @__PURE__ */ g(xe, { children: [
5821
+ const Ue = re.barChip, Ft = Gi(Ue.label), Hr = /* @__PURE__ */ i(wr, { value: B, onChange: ga, bordered: !1, options: ou(Ft, !!Qe) }), Zt = [...sn ? [{ key: "summary", label: "Summary" }] : [], ...on ? [{ key: "export", label: "Export" }] : []], Wr = (w) => /* @__PURE__ */ g(xe, { children: [
5819
5822
  w === "summary" && sn && /* @__PURE__ */ i(hc, { s: mt }),
5820
5823
  w === "export" && /* @__PURE__ */ i(cc, { audio: ht ? { name: qe, meta: Lt && re.canSpeak || Ne ? `MP3${R ? ` · ${It(R)}` : ""}` : "ORIGINAL AUDIO", onClick: Vt } : null, formats: vt, onExport: Yt })
5821
5824
  ] }), fa = (w) => /* @__PURE__ */ i(Hl, { index: O.idx, total: Math.max(1, he.length), frac: O.dur > 0 ? Math.min(1, O.t / O.dur) : 0, glideMs: O.wordSync ? 0 : 220, atLabel: It(O.t), durLabel: It(O.dur), stepLabel: w ? `${O.idx + 1} / ${he.length}` : "", onSeek: re.relang ? Qc : O.seekRow, onSeekFrac: re.relang ? void 0 : O.seekFrac, onScrubStart: O.hold, onScrubEnd: O.release }), Fr = {
@@ -5831,12 +5834,12 @@ function Du(t) {
5831
5834
  var me;
5832
5835
  re.relang || (me = O.seekFrac) == null || me.call(O, w);
5833
5836
  }
5834
- }, [pa, ma] = na(re.on && !!O.preparing && O.playing, 1500), Fn = re.on && ((Hs = O.error) == null ? void 0 : Hs.code) === "voice_not_started", Zn = re.canSpeak && !re.error && !Fn, fn = J ? ((Ws = ot == null ? void 0 : ot.languages.find((w) => w.code === J)) == null ? void 0 : Ws.name) ?? Ue.label : "", tt = te ? Ic({ lang: J, langName: fn, translating: Ie && !!J, translateFailed: Fe, voiceFailed: Fn, relang: re.relang, starting: re.on ? O.starting : null, slowLine: pa, lineSince: ma }) : null, Gn = !!Qe && !!tt && (tt.kind === "translating" || tt.kind === "voice" && re.relang), Zr = !Gn || !tt ? null : tt.kind === "translating" ? `Translating into ${fn || "the new language"}…` : `Preparing the ${fn || "translated"} voice…`, St = !Gn && ((tt == null ? void 0 : tt.kind) === "voice" || (tt == null ? void 0 : tt.kind) === "starting"), Gr = _r({ ...re.langList, keepOpen: !0, open: T === "lang", onClose: () => b("main") }), qr = Po(Q, re.on), Na = u && qr.bed && ht && ie && (!fe || st) ? ti(e.origin, ie, e.cred) : null, Kr = Go(Na, { t: Gt(O, he), playing: O.playing && !St && !(O.timed && O.preparing), muted: O.muted }), ya = u && qr.speech && ht && ie && (!fe || st) ? ti(e.origin, ie, e.cred, "speech") : null, qn = $i(ya, { t: Gt(O, he), playing: !re.on && O.playing, muted: O.muted }), Kn = !re.on && qn.on;
5837
+ }, [pa, ma] = na(re.on && !!O.preparing && O.playing, 1500), Zn = re.on && ((Hs = O.error) == null ? void 0 : Hs.code) === "voice_not_started", Gn = re.canSpeak && !re.error && !Zn, fn = J ? ((Ws = ot == null ? void 0 : ot.languages.find((w) => w.code === J)) == null ? void 0 : Ws.name) ?? Ue.label : "", tt = te ? Ic({ lang: J, langName: fn, translating: Ie && !!J, translateFailed: Fe, voiceFailed: Zn, relang: re.relang, starting: re.on ? O.starting : null, slowLine: pa, lineSince: ma }) : null, qn = !!Qe && !!tt && (tt.kind === "translating" || tt.kind === "voice" && re.relang), Zr = !qn || !tt ? null : tt.kind === "translating" ? `Translating into ${fn || "the new language"}…` : `Preparing the ${fn || "translated"} voice…`, St = !qn && ((tt == null ? void 0 : tt.kind) === "voice" || (tt == null ? void 0 : tt.kind) === "starting"), Gr = _r({ ...re.langList, keepOpen: !0, open: T === "lang", onClose: () => b("main") }), qr = Po(Q, re.on), Na = u && qr.bed && ht && ie && (!fe || st) ? ti(e.origin, ie, e.cred) : null, Kr = Go(Na, { t: Gt(O, he), playing: O.playing && !St && !(O.timed && O.preparing), muted: O.muted }), ya = u && qr.speech && ht && ie && (!fe || st) ? ti(e.origin, ie, e.cred, "speech") : null, Kn = $i(ya, { t: Gt(O, he), playing: !re.on && O.playing, muted: O.muted }), Jn = !re.on && Kn.on;
5835
5838
  D(() => {
5836
5839
  var w;
5837
- At.setVideoSound(!(Xe && (re.on || Kn))), (w = ct.silence) == null || w.call(ct, !Xe && Kn);
5838
- }, [Xe, re.on, Kn, st]);
5839
- const Jn = ht ? re.on ? Kr : qn.state : "unavailable", Xn = we && Zn && !!J, Ta = Xn ? [`Translated${re.hasClone ? Re ? ", cloned voices" : ", synthetic voices" : ""}`, !Q && ht && Kr !== "unavailable" ? "with background sound" : null].filter(Boolean).join(" ") : Q && Jn !== "unavailable" ? "Original speech, background removed" : "Original sound", wa = () => {
5840
+ At.setVideoSound(!(Xe && (re.on || Jn))), (w = ct.silence) == null || w.call(ct, !Xe && Jn);
5841
+ }, [Xe, re.on, Jn, st]);
5842
+ const Xn = ht ? re.on ? Kr : Kn.state : "unavailable", er = we && Gn && !!J, Ta = er ? [`Translated${re.hasClone ? Re ? ", cloned voices" : ", synthetic voices" : ""}`, !Q && ht && Kr !== "unavailable" ? "with background sound" : null].filter(Boolean).join(" ") : Q && Xn !== "unavailable" ? "Original speech, background removed" : "Original sound", wa = () => {
5840
5843
  if ((tt == null ? void 0 : tt.kind) === "translateFailed") {
5841
5844
  G(J);
5842
5845
  return;
@@ -5851,7 +5854,7 @@ function Du(t) {
5851
5854
  sl(Ct && jt ? { playing: O.playing, toggle: () => {
5852
5855
  Ke.current = !0, O.toggle();
5853
5856
  }, next: O.next, prev: O.prev } : null, Oe);
5854
- const er = { background: "transparent", color: "#eef0f8", width: 74, justifyContent: "center", boxSizing: "border-box" }, tr = (w, me) => !Ue.can || !x.language ? null : u ? /* @__PURE__ */ g("button", { type: "button", className: "gfull__btn", title: Bt ? `${Ue.label ?? Ue.code}: still being prepared` : Ue.label ?? Ue.code, "aria-label": `Language: ${Ue.label ?? Ue.code}`, "aria-busy": Bt || void 0, onClick: () => {
5857
+ const tr = { background: "transparent", color: "#eef0f8", width: 74, justifyContent: "center", boxSizing: "border-box" }, nr = (w, me) => !Ue.can || !x.language ? null : u ? /* @__PURE__ */ g("button", { type: "button", className: "gfull__btn", title: Bt ? `${Ue.label ?? Ue.code}: still being prepared` : Ue.label ?? Ue.code, "aria-label": `Language: ${Ue.label ?? Ue.code}`, "aria-busy": Bt || void 0, onClick: () => {
5855
5858
  z(!1), Ue.onClick();
5856
5859
  }, style: { position: "relative" }, children: [
5857
5860
  /* @__PURE__ */ i("span", { style: { fontSize: me === "sm" ? 17 : 21, lineHeight: 1 }, children: Ue.flag }),
@@ -5865,35 +5868,35 @@ function Du(t) {
5865
5868
  /* @__PURE__ */ i(Cc, { ytId: Qe, title: qe, t: Ma, playing: O.playing && !St, waiting: re.on && !!O.timed && !!O.preparing, seekN: O.seekN, onTime: (w) => {
5866
5869
  var me, Pe, We;
5867
5870
  return (We = O.videoAt) == null ? void 0 : We.call(O, w - (((Pe = (me = n == null ? void 0 : n.job) == null ? void 0 : me.crop) == null ? void 0 : Pe.startS) ?? 0));
5868
- }, onToggle: O.has ? Wt : void 0, onAd: Vn, lead: Xe ? At.lead : void 0 }),
5871
+ }, onToggle: O.has ? Wt : void 0, onAd: Hn, lead: Xe ? At.lead : void 0 }),
5869
5872
  /* @__PURE__ */ g("div", { className: "vsp-poster", "aria-hidden": "true", style: { opacity: La ? 0 : 1 }, children: [
5870
5873
  /* @__PURE__ */ i("div", { className: "vsp-poster__img", style: { backgroundImage: `url(https://i.ytimg.com/vi/${Qe}/hqdefault.jpg)` } }),
5871
- /* @__PURE__ */ i("span", { className: "txyt__pausedplay", children: /* @__PURE__ */ i(Dr, { size: 44 }) })
5874
+ /* @__PURE__ */ i("span", { className: "txyt__pausedplay", children: /* @__PURE__ */ i(Pn, { size: 44 }) })
5872
5875
  ] })
5873
5876
  ] }) : u ? /* @__PURE__ */ g(xe, { children: [
5874
5877
  /* @__PURE__ */ i("div", { className: "vsp-idle__pic vsp-idle__pic--brand" }),
5875
5878
  za,
5876
5879
  ja
5877
- ] }) : null, ns = Rt && Qe && !te ? /* @__PURE__ */ i(Mc, { ytId: Qe, title: qe, radius: 14, large: !0, style: s ? void 0 : { margin: "8px 20px 2px" }, picture: ts, children: /* @__PURE__ */ i(ru, { pos: Fr, transport: Jr, chip: tr({ ...er, width: 64, height: 28, minHeight: 28, padding: "0 8px" }, "sm"), voices: Xr, onFull: () => {
5880
+ ] }) : null, ns = Rt && Qe && !te ? /* @__PURE__ */ i(Mc, { ytId: Qe, title: qe, radius: 14, large: !0, style: s ? void 0 : { margin: "8px 20px 2px" }, picture: ts, children: /* @__PURE__ */ i(ru, { pos: Fr, transport: Jr, chip: nr({ ...tr, width: 64, height: 28, minHeight: 28, padding: "0 8px" }, "sm"), voices: Xr, onFull: () => {
5878
5881
  un(!0), K(!0);
5879
5882
  }, copied: null }) }) : null, et = O.wordSync ? Pl(he, O.idx, O.t) ? he[O.idx] : void 0 : he[O.idx];
5880
5883
  for (const w of he) for (const [me, Pe] of Object.entries(w.translations)) Pe && A.current.set(`${w.sentenceId ?? w.start}|${me}`, Pe);
5881
- const rs = (w, me) => w.translations[me] || A.current.get(`${w.sentenceId ?? w.start}|${me}`) || null, nr = (w, me) => !w || !me || w.language === me || !!rs(w, me), zt = nr(et, J) ? J : nr(et, F.current) ? F.current : J;
5882
- et && nr(et, zt) && (F.current = zt);
5884
+ const rs = (w, me) => w.translations[me] || A.current.get(`${w.sentenceId ?? w.start}|${me}`) || null, rr = (w, me) => !w || !me || w.language === me || !!rs(w, me), zt = rr(et, J) ? J : rr(et, F.current) ? F.current : J;
5885
+ et && rr(et, zt) && (F.current = zt);
5883
5886
  const ss = et && zt && et.language !== zt ? rs(et, zt) : null, Ia = et && ss && zt && !et.translations[zt] ? Object.assign([...he], { [O.idx]: { ...et, translations: { ...et.translations, [zt]: ss } } }) : he, Nn = et ? ra(Ia, O.idx, zt) : [], yn = Te ? Te === "on" : !u || re.on || !Ce || Ce === q, is = yn ? mi(O, O.idx, Nn) : null, as = Nn.map((w, me) => ({ t: w.text, sp: me < Nn.length - 1 ? " " : "", dim: is != null && me > is })), Tn = pe ? pe === "on" : u ? !1 : Nl(ce, he, v == null ? void 0 : v.settings), os = { lang: J, subtitles: Se, speakerLabels: Tn, wordHighlight: yn, translateAudio: we, voices: Re ? "cloned" : "synthetic", removeBackground: Q }, Oa = JSON.stringify(os), wn = k(t.onSettingsChange);
5884
5887
  wn.current = t.onSettingsChange, D(() => {
5885
5888
  var w;
5886
5889
  (w = wn.current) == null || w.call(wn, os);
5887
5890
  }, [Oa]);
5888
- const vn = et && et.speaker >= 0 && Tn ? Rr(ce, et.speaker) : null, [ba, ls] = L(!1), [rr, cs] = L(null), [Ca, us] = L(null), sr = k(void 0);
5889
- D(() => () => window.clearTimeout(sr.current), []);
5890
- const ir = k(void 0);
5891
+ const vn = et && et.speaker >= 0 && Tn ? Rr(ce, et.speaker) : null, [ba, ls] = L(!1), [sr, cs] = L(null), [Ca, us] = L(null), ir = k(void 0);
5891
5892
  D(() => () => window.clearTimeout(ir.current), []);
5893
+ const ar = k(void 0);
5894
+ D(() => () => window.clearTimeout(ar.current), []);
5892
5895
  const ds = (w) => {
5893
5896
  if (t.shareUrl) return t.shareUrl(w);
5894
5897
  const me = new URL(window.location.href);
5895
5898
  return w != null && w > 0 ? me.searchParams.set("t", String(w)) : me.searchParams.delete("t"), me.href;
5896
- }, Ln = k(l.startAt), ar = (w) => {
5899
+ }, Ln = k(l.startAt), or = (w) => {
5897
5900
  if (O.seekFrac && O.dur > 0) {
5898
5901
  O.seekFrac(Math.min(1, w / O.dur));
5899
5902
  return;
@@ -5904,13 +5907,13 @@ function Du(t) {
5904
5907
  }, hs = k(!1);
5905
5908
  D(() => {
5906
5909
  const w = Ln.current;
5907
- w == null || hs.current || !O.has || he.length === 0 || (hs.current = !0, ar(w));
5910
+ w == null || hs.current || !O.has || he.length === 0 || (hs.current = !0, or(w));
5908
5911
  }, [O.has, he.length]), D(() => {
5909
5912
  const w = Ln.current;
5910
- w == null || !O.playing || (Ln.current = null, Math.abs(O.t - w) > 2 && ar(w));
5913
+ w == null || !O.playing || (Ln.current = null, Math.abs(O.t - w) > 2 && or(w));
5911
5914
  }, [O.playing]);
5912
5915
  const xa = (w) => {
5913
- Ke.current = !0, Ln.current = null, ar(Math.max(0, w));
5916
+ Ke.current = !0, Ln.current = null, or(Math.max(0, w));
5914
5917
  };
5915
5918
  t.handle.current = {
5916
5919
  seek: (w) => xa(w),
@@ -5945,12 +5948,12 @@ function Du(t) {
5945
5948
  return () => window.clearInterval(Pe);
5946
5949
  }, []);
5947
5950
  const Sa = () => t.onShare ? t.onShare() : Qr(ds(null), qe, () => {
5948
- window.clearTimeout(ir.current), ls(!0), ir.current = window.setTimeout(() => ls(!1), 2200);
5951
+ window.clearTimeout(ar.current), ls(!0), ar.current = window.setTimeout(() => ls(!1), 2200);
5949
5952
  }), fs = (w, me, Pe) => {
5950
- const We = Or.find((In) => In.key === w), Nt = rr === w, gt = Ca === w;
5951
- return /* @__PURE__ */ g("div", { className: "srow srow--tap", role: "button", "aria-busy": Nt || void 0, style: rr && !Nt ? { opacity: 0.45, pointerEvents: "none" } : void 0, onClick: () => {
5952
- rr || (cs(w), Promise.resolve().then(() => Yt(w)).then(() => {
5953
- us(w), window.clearTimeout(sr.current), sr.current = window.setTimeout(() => us(null), 1600);
5953
+ const We = br.find((In) => In.key === w), Nt = sr === w, gt = Ca === w;
5954
+ return /* @__PURE__ */ g("div", { className: "srow srow--tap", role: "button", "aria-busy": Nt || void 0, style: sr && !Nt ? { opacity: 0.45, pointerEvents: "none" } : void 0, onClick: () => {
5955
+ sr || (cs(w), Promise.resolve().then(() => Yt(w)).then(() => {
5956
+ us(w), window.clearTimeout(ir.current), ir.current = window.setTimeout(() => us(null), 1600);
5954
5957
  }).catch(() => {
5955
5958
  }).finally(() => cs(null)));
5956
5959
  }, children: [
@@ -5967,7 +5970,7 @@ function Du(t) {
5967
5970
  /* @__PURE__ */ i(oe, { d: X.chevronLeft, size: 18, sw: 1.8 }),
5968
5971
  "Back"
5969
5972
  ] })
5970
- ] }), kn = /* @__PURE__ */ i(oe, { d: X.chevronRight, size: 17, sw: 1.6, style: { flex: "none", color: "var(--ink-45)" } }), Aa = { main: "SETTINGS", lang: "LANGUAGE", subs: "SUBTITLES", audio: "AUDIO", export: "EXPORT" }[T], jn = { display: "flex", flexDirection: "column", gap: 2, paddingBottom: 14 }, or = u ? /* @__PURE__ */ i(Jt, { open: ee, onClose: () => z(!1), title: Aa, titleNode: T === "main" ? void 0 : Da, doneLabel: Ft.done, kind: T === "main" ? "settings" : "settings vs-sheet--page", sticky: !0, children: /* @__PURE__ */ i(wr, { children: T === "lang" ? /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: "column" }, children: [
5973
+ ] }), kn = /* @__PURE__ */ i(oe, { d: X.chevronRight, size: 17, sw: 1.6, style: { flex: "none", color: "var(--ink-45)" } }), Aa = { main: "SETTINGS", lang: "LANGUAGE", subs: "SUBTITLES", audio: "AUDIO", export: "EXPORT" }[T], jn = { display: "flex", flexDirection: "column", gap: 2, paddingBottom: 14 }, lr = u ? /* @__PURE__ */ i(Jt, { open: ee, onClose: () => z(!1), title: Aa, titleNode: T === "main" ? void 0 : Da, doneLabel: Ft.done, kind: T === "main" ? "settings" : "settings vs-sheet--page", sticky: !0, children: /* @__PURE__ */ i(vr, { children: T === "lang" ? /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: "column" }, children: [
5971
5974
  /* @__PURE__ */ i("div", { style: { position: "sticky", top: 0, zIndex: 1, padding: "4px 14px 10px", background: "var(--vs-surface-raised)" }, children: Gr.search }),
5972
5975
  Gr.list
5973
5976
  ] }) : T === "subs" ? /* @__PURE__ */ g("div", { style: jn, children: [
@@ -5996,23 +5999,23 @@ function Du(t) {
5996
5999
  /* @__PURE__ */ g("div", { className: "srow", children: [
5997
6000
  /* @__PURE__ */ g("div", { style: { flex: 1, minWidth: 0 }, children: [
5998
6001
  /* @__PURE__ */ i("div", { className: "srow__t", children: "Translate audio" }),
5999
- /* @__PURE__ */ i("div", { className: "srow__s", children: J ? Zn ? "Hear the translation read aloud instead of the original speech" : re.canSpeak ? "Not available right now" : "Not available in this language" : "Pick a language to hear the translation read aloud" })
6002
+ /* @__PURE__ */ i("div", { className: "srow__s", children: J ? Gn ? "Hear the translation read aloud instead of the original speech" : re.canSpeak ? "Not available right now" : "Not available in this language" : "Pick a language to hear the translation read aloud" })
6000
6003
  ] }),
6001
- /* @__PURE__ */ i(Tt, { checked: Xn, onChange: Ee, label: "Translate audio", disabled: !Zn || !J })
6004
+ /* @__PURE__ */ i(Tt, { checked: er, onChange: Ee, label: "Translate audio", disabled: !Gn || !J })
6002
6005
  ] }),
6003
- Xn && re.hasClone && /* @__PURE__ */ g("div", { className: "srow", children: [
6006
+ er && re.hasClone && /* @__PURE__ */ g("div", { className: "srow", children: [
6004
6007
  /* @__PURE__ */ g("div", { style: { flex: 1, minWidth: 0 }, children: [
6005
6008
  /* @__PURE__ */ i("div", { className: "srow__t", children: "Voices" }),
6006
6009
  /* @__PURE__ */ i("div", { className: "srow__s", children: Re ? "Each speaker in their own cloned voice" : "Synthetic voices matched to each speaker" })
6007
6010
  ] }),
6008
- /* @__PURE__ */ i(Tr, { value: Re ? "clone" : "stock", onChange: (w) => De(w === "clone"), size: "sm", options: [{ value: "stock", label: "Synthetic" }, { value: "clone", label: "Cloned" }] })
6011
+ /* @__PURE__ */ i(wr, { value: Re ? "clone" : "stock", onChange: (w) => De(w === "clone"), size: "sm", options: [{ value: "stock", label: "Synthetic" }, { value: "clone", label: "Cloned" }] })
6009
6012
  ] }),
6010
6013
  /* @__PURE__ */ g("div", { className: "srow", children: [
6011
6014
  /* @__PURE__ */ g("div", { style: { flex: 1, minWidth: 0 }, children: [
6012
6015
  /* @__PURE__ */ i("div", { className: "srow__t", children: Yn }),
6013
- /* @__PURE__ */ i("div", { className: "srow__s", children: Ro(Q, Jn, "video", re.on ? 0 : qn.untilS) })
6016
+ /* @__PURE__ */ i("div", { className: "srow__s", children: Ro(Q, Xn, "video", re.on ? 0 : Kn.untilS) })
6014
6017
  ] }),
6015
- /* @__PURE__ */ i(Tt, { checked: Q && ht, onChange: H, label: Yn, disabled: !ht || Jn === "unavailable" && !Q })
6018
+ /* @__PURE__ */ i(Tt, { checked: Q && ht, onChange: H, label: Yn, disabled: !ht || Xn === "unavailable" && !Q })
6016
6019
  ] })
6017
6020
  ] }) : T === "export" ? /* @__PURE__ */ g("div", { style: jn, children: [
6018
6021
  fs("srt", "Subtitles", "SRT / VTT caption cues, ready for a video editor or a player"),
@@ -6074,17 +6077,17 @@ function Du(t) {
6074
6077
  title: qe,
6075
6078
  desk: s,
6076
6079
  pos: Fr,
6077
- mute: { muted: O.muted, onToggle: Wn },
6080
+ mute: { muted: O.muted, onToggle: Fn },
6078
6081
  cc: x.subtitles ? { on: Se, onToggle: () => ve((w) => !w) } : void 0,
6079
6082
  noFull: !x.fullscreen,
6080
6083
  ad: Mn,
6081
- wait: tt && !Gn ? /* @__PURE__ */ i(bc, { state: tt, line: St ? as.map((w) => w.t + w.sp).join("") : null, onRetry: wa, onOriginal: va }) : O.edgeWait ? `Transcribing ${Math.round(U)}% — it plays on as more is written` : null,
6084
+ wait: tt && !qn ? /* @__PURE__ */ i(bc, { state: tt, line: St ? as.map((w) => w.t + w.sp).join("") : null, onRetry: wa, onOriginal: va }) : O.edgeWait ? `Transcribing ${Math.round(U)}% — it plays on as more is written` : null,
6082
6085
  pct: fe ? Math.round(U) : null,
6083
6086
  sub: Se && et ? { who: vn ? Ur(ce, et.speaker) : null, color: vn ? vn.fg ?? `var(--lane-${vn.lane})` : "#fff", words: as, cursor: mi(O, O.idx, Nn) } : null,
6084
- chip: tr(s ? er : { ...er, width: 64, padding: "0 6px" }, s ? void 0 : "sm"),
6087
+ chip: nr(s ? tr : { ...tr, width: 64, padding: "0 6px" }, s ? void 0 : "sm"),
6085
6088
  transport: Jr,
6086
6089
  picker: re.sheets,
6087
- sheet: u ? or : null,
6090
+ sheet: u ? lr : null,
6088
6091
  voices: null,
6089
6092
  voicesBtn: u ? null : Xr,
6090
6093
  sheetOpen: re.sheetsOpen || ee,
@@ -6108,7 +6111,7 @@ function Du(t) {
6108
6111
  `${fn || "Translated"} voice is still being prepared · playing with subtitles`
6109
6112
  ] }) : null,
6110
6113
  onTouch: () => {
6111
- un(!0), Hn();
6114
+ un(!0), Wn();
6112
6115
  },
6113
6116
  onClose: u ? void 0 : () => {
6114
6117
  un(!1), K(!1);
@@ -6126,7 +6129,7 @@ function Du(t) {
6126
6129
  /* @__PURE__ */ i("span", { className: "s", children: it })
6127
6130
  ] }),
6128
6131
  !s && /* @__PURE__ */ i("div", { className: "pubprog__bar", style: { marginTop: 8 }, children: /* @__PURE__ */ i("div", { style: { width: `${U}%` } }) })
6129
- ] }), lr = r && /* @__PURE__ */ i("div", { className: "hint", style: { padding: "30px 20px", textAlign: "center", fontSize: 13 }, children: "This link is no longer shared. Ask the person who sent it for a new one." }), ms = /* @__PURE__ */ i(Wc, { model: ce, rows: he, player: jt ? O : { ...O, playRow: O.seekRow }, tail: Mt, tailFg: tn, running: fe, desk: s, feedRef: bt, listener: !0, showLabels: Tn, find: j, findOpen: !s && m, lang: Ce, warm: an, onVisible: Ve, wordHl: yn }), cr = /* @__PURE__ */ i(Vl, { error: d ?? W ?? (Fn && te ? null : O.error) ?? re.error, onClose: () => {
6132
+ ] }), cr = r && /* @__PURE__ */ i("div", { className: "hint", style: { padding: "30px 20px", textAlign: "center", fontSize: 13 }, children: "This link is no longer shared. Ask the person who sent it for a new one." }), ms = /* @__PURE__ */ i(Wc, { model: ce, rows: he, player: jt ? O : { ...O, playRow: O.seekRow }, tail: Mt, tailFg: tn, running: fe, desk: s, feedRef: bt, listener: !0, showLabels: Tn, find: j, findOpen: !s && m, lang: Ce, warm: an, onVisible: Ve, wordHl: yn }), ur = /* @__PURE__ */ i(Vl, { error: d ?? W ?? (Zn && te ? null : O.error) ?? re.error, onClose: () => {
6130
6133
  M(null), ye(), O.clearError(), re.clearError();
6131
6134
  } }), Ns = [R ? It(R) : null, q ? q.toUpperCase() : null, se || "Read-only copy"].filter(Boolean).join(" · "), ys = (w) => /* @__PURE__ */ i("div", { className: "ctrans", children: re.noVoice ? re.noVoiceNote : /* @__PURE__ */ g(xe, { children: [
6132
6135
  /* @__PURE__ */ g("div", { className: "ctrans__row", children: [
@@ -6156,24 +6159,24 @@ function Du(t) {
6156
6159
  var w;
6157
6160
  (w = zn.current) == null || w.call(zn, ws);
6158
6161
  }, [ws]);
6159
- const [Ya, ur] = L(!1), dr = !!Dt && !Ye && (Xe ? !!O.ended : !O.playing && O.dur > 0 && O.t >= O.dur - 0.5);
6162
+ const [Ya, dr] = L(!1), hr = !!Dt && !Ye && (Xe ? !!O.ended : !O.playing && O.dur > 0 && O.t >= O.dur - 0.5);
6160
6163
  D(() => {
6161
- dr || ur(!1);
6162
- }, [dr]);
6163
- const Ua = t.endCard !== !1 && dr && !Ya && /* @__PURE__ */ i(fu, { options: { appUrl: t.appUrl, ...t.endCard || {} }, onStarted: t.onStarted, onClose: () => ur(!0), onReplay: () => {
6164
- ur(!0), Ke.current = !0, O.seekFrac ? O.seekFrac(0) : O.seekRow(0), O.playing || O.toggle();
6164
+ hr || dr(!1);
6165
+ }, [hr]);
6166
+ const Ua = t.endCard !== !1 && hr && !Ya && /* @__PURE__ */ i(fu, { options: { appUrl: t.appUrl, ...t.endCard || {} }, onStarted: t.onStarted, onClose: () => dr(!0), onReplay: () => {
6167
+ dr(!0), Ke.current = !0, O.seekFrac ? O.seekFrac(0) : O.seekRow(0), O.playing || O.toggle();
6165
6168
  } });
6166
6169
  if (u) return /* @__PURE__ */ g(xe, { children: [
6167
- r ? /* @__PURE__ */ i("div", { className: "gfull", "data-theme": "dark", children: lr }) : _a || Dt || /* @__PURE__ */ i("div", { className: "gfull", "data-theme": "dark" }),
6170
+ r ? /* @__PURE__ */ i("div", { className: "gfull", "data-theme": "dark", children: cr }) : _a || Dt || /* @__PURE__ */ i("div", { className: "gfull", "data-theme": "dark" }),
6168
6171
  Ua,
6169
- cr
6172
+ ur
6170
6173
  ] });
6171
6174
  if (s) {
6172
6175
  const w = jt && !Rt && !r && /* @__PURE__ */ i("div", { className: "pubdeskctl", children: ys(!0) }), me = !r && (Zt.length > 0 || Rt || !!re.sidePanel || !!w);
6173
6176
  return /* @__PURE__ */ g(xe, { children: [
6174
6177
  /* @__PURE__ */ i("div", { className: "dhead dhead--listener dhead--cols", children: /* @__PURE__ */ g("div", { className: "gcolhead", children: [
6175
6178
  /* @__PURE__ */ i("div", { className: "gcolhead__main", children: /* @__PURE__ */ g("div", { className: "gcolhead__col", children: [
6176
- /* @__PURE__ */ i("div", { style: { flex: "none" }, children: /* @__PURE__ */ i(Pn, { dark: a, height: 20.38 }) }),
6179
+ /* @__PURE__ */ i("div", { style: { flex: "none" }, children: /* @__PURE__ */ i($n, { dark: a, height: 20.38 }) }),
6177
6180
  !r && /* @__PURE__ */ g("div", { className: "dhead__session", children: [
6178
6181
  /* @__PURE__ */ i("span", { className: "t", children: n ? qe : "" }),
6179
6182
  /* @__PURE__ */ i("span", { className: "s", children: n ? Ns : "" })
@@ -6183,7 +6186,7 @@ function Du(t) {
6183
6186
  ] }) }),
6184
6187
  /* @__PURE__ */ g("div", { className: "listenerlive listenerlive--cols listenerlive--pub", children: [
6185
6188
  /* @__PURE__ */ g("div", { className: "listenerlive__main", children: [
6186
- lr,
6189
+ cr,
6187
6190
  !r && _t,
6188
6191
  ps,
6189
6192
  p && /* @__PURE__ */ i("div", { className: "pubflash", children: p }),
@@ -6201,9 +6204,9 @@ function Du(t) {
6201
6204
  ] })
6202
6205
  ] }),
6203
6206
  !Dt && re.sheets,
6204
- !(u && Dt) && or,
6207
+ !(u && Dt) && lr,
6205
6208
  Dt,
6206
- cr
6209
+ ur
6207
6210
  ] });
6208
6211
  }
6209
6212
  const Ra = Zt.length > 0 && !m && /* @__PURE__ */ i("div", { className: "txwidget", children: /* @__PURE__ */ g(ei, { panel: !0, children: [
@@ -6212,7 +6215,7 @@ function Du(t) {
6212
6215
  ] }) });
6213
6216
  return /* @__PURE__ */ g(xe, { children: [
6214
6217
  /* @__PURE__ */ i(iu, { dark: a, title: n ? qe : "", subline: n ? Ns : "", onOptions: () => z(!0), optionsActive: ee }),
6215
- lr,
6218
+ cr,
6216
6219
  ps,
6217
6220
  !r && Ra,
6218
6221
  !r && ns,
@@ -6224,14 +6227,14 @@ function Du(t) {
6224
6227
  !r && /* @__PURE__ */ g("div", { className: "gbottom", "data-transport": "1", children: [
6225
6228
  jt && !Rt && /* @__PURE__ */ i("div", { className: "pubctl", children: ys(!1) }),
6226
6229
  /* @__PURE__ */ g("div", { className: "gbottom__bar", children: [
6227
- Ue.can && /* @__PURE__ */ i("div", { style: { flex: "none" }, children: tr({ width: 87 }, void 0) }),
6230
+ Ue.can && /* @__PURE__ */ i("div", { style: { flex: "none" }, children: nr({ width: 87 }, void 0) }),
6228
6231
  /* @__PURE__ */ i("div", { style: { flex: 1, minWidth: 0 }, children: Hr })
6229
6232
  ] })
6230
6233
  ] }),
6231
6234
  !Dt && re.sheets,
6232
- !(u && Dt) && or,
6235
+ !(u && Dt) && lr,
6233
6236
  Dt,
6234
- cr
6237
+ ur
6235
6238
  ] });
6236
6239
  }
6237
6240
  function Au(t) {