@burdenoff/fe-libs 2026.1013.9 → 2026.1013.11
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/shared/assistant/i18nManifest.d.ts +1 -0
- package/dist/shared/assistant/i18nManifest.js +1 -0
- package/dist/shared/assistant/index.d.ts +1 -0
- package/dist/shared/assistant/speech/hostedTtsSpeechEngine.js +96 -72
- package/dist/shared/assistant/speech/pieceSink.d.ts +51 -0
- package/dist/shared/assistant/speech/pieceSink.js +90 -0
- package/dist/shared/assistant/speech/routingSpeechEngine.js +47 -37
- package/dist/shared/assistant/speech/types.d.ts +105 -1
- package/dist/shared/assistant/speech/types.js +4 -0
- package/dist/shared/assistant/ui/AssistantSpeechProvider.d.ts +11 -0
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +255 -250
- package/dist/shared/assistant/ui/useVoiceSession.d.ts +7 -1
- package/dist/shared/assistant/ui/useVoiceSession.js +253 -245
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +157 -145
- package/dist/shared-assistant.js +240 -238
- package/package.json +1 -1
|
@@ -18,256 +18,267 @@ import { useCallback as s, useEffect as c, useMemo as he, useRef as l, useState
|
|
|
18
18
|
import { Maximize2 as ge, Minimize2 as _e, ScrollText as ve, X as d } from "lucide-react";
|
|
19
19
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
20
20
|
//#region src/shared/assistant/ui/voice/AssistantVoiceSession.tsx
|
|
21
|
-
var m = ({ session: m, turns:
|
|
22
|
-
let
|
|
23
|
-
t("assistant.transcript", he(() => ({ run: () =>
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
let
|
|
27
|
-
m.phase !== "listening" && m.phase !== "thinking" ||
|
|
28
|
-
}, [
|
|
29
|
-
|
|
30
|
-
}, []),
|
|
21
|
+
var m = ({ session: m, turns: be = [], onSaveTranscript: xe, onContinueInChat: Se, notice: g = null, privacyNotice: _ = null, spoken: v, onInterrupt: Ce, onToggleMute: y, attachments: b = [], onAttachFiles: x, onRemoveAttachment: we, onRetryAttachment: Te, canAttachMore: Ee = !0, preparingAttachments: S = 0, attachmentsLocked: C = !1, attachmentNotice: w = null, spokenChunks: T = null, onEnd: E, capturing: De = !0, interrupting: Oe = !1, awaitingEndpoint: ke = !1, holding: D = !1, correcting: Ae = !1, onLetMeFinish: O, onImDone: k, proposalChip: A = null, proposalTray: j = null, renderAfterTurn: je }) => {
|
|
22
|
+
let M = n(), { muted: N, error: P } = m, F = l(null), I = l(null), [Me, L] = u("mini"), R = ce(Me, m.phase === "ended"), z = R === "full", B = R === "mini", V = R === "mini" ? "panel" : R === "panel" ? "full" : "mini", [H, U] = u(!1);
|
|
23
|
+
t("assistant.transcript", he(() => ({ run: () => H ? { status: "already" } : (U(!0), { status: "done" }) }), [H]));
|
|
24
|
+
let W = j !== null && !B, G = l(!1), K = l(y);
|
|
25
|
+
K.current = y;
|
|
26
|
+
let q = s(() => {
|
|
27
|
+
m.phase !== "listening" && m.phase !== "thinking" || N || G.current || o(m) || (G.current = !0, K.current());
|
|
28
|
+
}, [N, m]), J = s(() => {
|
|
29
|
+
G.current && (G.current = !1, K.current());
|
|
30
|
+
}, []), Ne = q;
|
|
31
31
|
c(() => {
|
|
32
32
|
let e = () => {
|
|
33
|
-
document.visibilityState === "hidden" ?
|
|
33
|
+
document.visibilityState === "hidden" ? q() : J();
|
|
34
34
|
};
|
|
35
35
|
return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
|
|
36
|
-
}, [
|
|
37
|
-
let e =
|
|
36
|
+
}, [q, J]), c(() => {
|
|
37
|
+
let e = J;
|
|
38
38
|
return window.addEventListener("focus", e), () => {
|
|
39
|
-
window.removeEventListener("focus", e),
|
|
39
|
+
window.removeEventListener("focus", e), G.current = !1;
|
|
40
40
|
};
|
|
41
41
|
}, []), c(() => {
|
|
42
|
-
document.activeElement?.closest("[data-hands-free-notice]") ||
|
|
43
|
-
}, []), e(
|
|
42
|
+
document.activeElement?.closest("[data-hands-free-notice]") || F.current?.focus();
|
|
43
|
+
}, []), e(I, { fallbackSelector: `[${ae}]` }), c(() => {
|
|
44
44
|
let e = (e) => {
|
|
45
45
|
if (e.key === "Escape") {
|
|
46
46
|
let t = pe({
|
|
47
47
|
defaultPrevented: e.defaultPrevented,
|
|
48
48
|
layerAbove: fe({
|
|
49
49
|
target: e.target,
|
|
50
|
-
session:
|
|
50
|
+
session: I.current,
|
|
51
51
|
doc: document
|
|
52
52
|
}),
|
|
53
|
-
transcriptOpen:
|
|
53
|
+
transcriptOpen: H
|
|
54
54
|
});
|
|
55
55
|
if (t === "ignore") return;
|
|
56
|
-
e.preventDefault(), t === "close-transcript" ?
|
|
56
|
+
e.preventDefault(), t === "close-transcript" ? U(!1) : _ ? _.decline() : W ? j?.onClose() : E();
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
if (e.key !== "Tab" || !
|
|
60
|
-
let t = (
|
|
59
|
+
if (e.key !== "Tab" || !z) return;
|
|
60
|
+
let t = (H ? I.current?.querySelector("[data-testid=\"assistant-voice-transcript\"]") : I.current)?.querySelectorAll("button:not([disabled])");
|
|
61
61
|
if (!t || t.length === 0) return;
|
|
62
62
|
let n = t[0], r = t[t.length - 1];
|
|
63
63
|
!n || !r || (e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus()));
|
|
64
64
|
};
|
|
65
65
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
66
66
|
}, [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
E,
|
|
68
|
+
z,
|
|
69
|
+
H,
|
|
70
|
+
W,
|
|
71
|
+
j,
|
|
72
|
+
_
|
|
73
73
|
]);
|
|
74
|
-
let
|
|
75
|
-
letMeFinish:
|
|
76
|
-
imDone:
|
|
77
|
-
} : null,
|
|
74
|
+
let Y = g !== null && P === null, X = o(m), Z = O && k && m.phase === "listening" && !N && P === null ? {
|
|
75
|
+
letMeFinish: O,
|
|
76
|
+
imDone: k
|
|
77
|
+
} : null, Pe = Z !== null;
|
|
78
78
|
c(() => {
|
|
79
|
-
if (
|
|
79
|
+
if (Pe) return;
|
|
80
80
|
let e = document.activeElement;
|
|
81
|
-
(!e || e === document.body) &&
|
|
82
|
-
}, [
|
|
83
|
-
let
|
|
81
|
+
(!e || e === document.body) && F.current?.focus();
|
|
82
|
+
}, [Pe]);
|
|
83
|
+
let Q = i({
|
|
84
84
|
snapshot: m,
|
|
85
|
-
capturing:
|
|
86
|
-
interrupting:
|
|
87
|
-
awaitingEndpoint:
|
|
88
|
-
}),
|
|
89
|
-
switch (
|
|
90
|
-
case "connecting": return
|
|
91
|
-
case "endpoint-grace": return
|
|
92
|
-
case "interrupting": return
|
|
93
|
-
case "thinking": return
|
|
94
|
-
case "speaking": return
|
|
85
|
+
capturing: De,
|
|
86
|
+
interrupting: Oe,
|
|
87
|
+
awaitingEndpoint: ke
|
|
88
|
+
}), Fe = (() => {
|
|
89
|
+
switch (Q) {
|
|
90
|
+
case "connecting": return M("voiceSession.connecting", "Starting the microphone…");
|
|
91
|
+
case "endpoint-grace": return M("voiceSession.endpointGrace", "Still listening — take your time");
|
|
92
|
+
case "interrupting": return M("voiceSession.interrupting", "Stopped — go ahead");
|
|
93
|
+
case "thinking": return M(a.key, a.fallback);
|
|
94
|
+
case "speaking": return M("voiceSession.speaking", "Speaking — tap to stop");
|
|
95
95
|
case "mic-error":
|
|
96
96
|
case "ended": return "";
|
|
97
|
-
case "listening": return
|
|
98
|
-
default: return
|
|
97
|
+
case "listening": return N ? M("voiceSession.muted", "Microphone off") : M("voiceSession.listening", "Listening…");
|
|
98
|
+
default: return Q;
|
|
99
99
|
}
|
|
100
|
-
})(),
|
|
101
|
-
tr:
|
|
102
|
-
stage:
|
|
103
|
-
muted:
|
|
104
|
-
label:
|
|
105
|
-
}),
|
|
100
|
+
})(), Ie = !N && (Q === "listening" || Q === "endpoint-grace"), Le = Ie && D ? M("voiceSession.holding", "Take your time — tap “I’m done” when you finish") : Ie && Ae ? M("voiceSession.correcting", "Stopped that answer — listening to your correction") : Fe, $ = ne({
|
|
101
|
+
tr: M,
|
|
102
|
+
stage: Q,
|
|
103
|
+
muted: N,
|
|
104
|
+
label: Le
|
|
105
|
+
}), Re = te(Le, $), ze = Q === "thinking";
|
|
106
106
|
return /* @__PURE__ */ p("div", {
|
|
107
|
-
ref:
|
|
108
|
-
className: `flex flex-col items-center justify-between bg-bg-sunken ${
|
|
107
|
+
ref: I,
|
|
108
|
+
className: `flex flex-col items-center justify-between bg-bg-sunken ${R === "full" ? "fixed inset-x-0 bottom-0 top-14 z-[60] px-6 py-8" : R === "panel" ? "absolute inset-0 z-20 px-4 py-6" : "absolute inset-x-0 bottom-0 z-20 min-h-[11.25rem] border-t border-border-subtle px-3 py-3 shadow-lg"}`,
|
|
109
109
|
role: "dialog",
|
|
110
|
-
"aria-modal":
|
|
111
|
-
"aria-label":
|
|
110
|
+
"aria-modal": z || void 0,
|
|
111
|
+
"aria-label": M("voiceSession.title", "Voice conversation"),
|
|
112
112
|
"data-testid": "assistant-voice-session",
|
|
113
113
|
[oe]: "",
|
|
114
114
|
children: [
|
|
115
115
|
/* @__PURE__ */ p("button", {
|
|
116
|
-
ref:
|
|
116
|
+
ref: F,
|
|
117
117
|
type: "button",
|
|
118
|
-
onClick:
|
|
119
|
-
className: `absolute ${
|
|
120
|
-
title:
|
|
118
|
+
onClick: E,
|
|
119
|
+
className: `absolute ${z ? "right-6 top-6 h-14 gap-2 px-5 text-base" : B ? "right-12 top-2 h-8 gap-1.5 px-2.5 text-xs" : "right-3 top-3 h-11 gap-2 px-4 text-sm"} flex items-center justify-center rounded-full border border-border-default bg-bg-elevated text-text-secondary hover:bg-bg-sunken transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong`,
|
|
120
|
+
title: M("voiceSession.end", "End the voice conversation"),
|
|
121
121
|
"data-testid": "assistant-voice-end",
|
|
122
122
|
children: [/* @__PURE__ */ f(d, {
|
|
123
|
-
className:
|
|
123
|
+
className: z ? "size-6" : B ? "size-4" : "size-5",
|
|
124
124
|
"aria-hidden": "true"
|
|
125
125
|
}), /* @__PURE__ */ f("span", {
|
|
126
|
-
className: `truncate whitespace-nowrap font-medium ${
|
|
127
|
-
children:
|
|
126
|
+
className: `truncate whitespace-nowrap font-medium ${B ? "max-w-[3.5rem] text-xs" : "max-w-[7rem]"}`,
|
|
127
|
+
children: M("voiceSession.endShort", "End")
|
|
128
128
|
})]
|
|
129
129
|
}),
|
|
130
130
|
/* @__PURE__ */ p("div", {
|
|
131
|
-
className: `flex flex-col items-center ${
|
|
132
|
-
children: [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
131
|
+
className: `flex flex-col items-center ${B ? `px-3 ${Y || w ? "pt-9 pb-2" : ""}` : `min-h-[1.5rem] ${Y || w ? z ? "pt-14" : "pt-10" : ""}`}`,
|
|
132
|
+
children: [
|
|
133
|
+
Y ? /* @__PURE__ */ f("p", {
|
|
134
|
+
className: "max-w-xs text-center text-xs text-status-warning",
|
|
135
|
+
"data-testid": "assistant-voice-notice",
|
|
136
|
+
children: h(g, M)
|
|
137
|
+
}) : null,
|
|
138
|
+
/* @__PURE__ */ f("span", {
|
|
139
|
+
className: "sr-only start-0 top-0",
|
|
140
|
+
role: "status",
|
|
141
|
+
"aria-live": "polite",
|
|
142
|
+
"aria-atomic": "true",
|
|
143
|
+
"data-testid": "assistant-voice-notice-announced",
|
|
144
|
+
children: Y && g === "reply-not-heard" ? h(g, M) : null
|
|
145
|
+
}),
|
|
146
|
+
w ? /* @__PURE__ */ f("p", {
|
|
147
|
+
className: "max-w-xs text-center text-xs text-status-warning",
|
|
148
|
+
role: "status",
|
|
149
|
+
"aria-live": "polite",
|
|
150
|
+
"data-testid": "assistant-voice-attachment-notice",
|
|
151
|
+
children: w
|
|
152
|
+
}) : null
|
|
153
|
+
]
|
|
143
154
|
}),
|
|
144
155
|
(() => {
|
|
145
156
|
let e = /* @__PURE__ */ f(se, {
|
|
146
157
|
session: m,
|
|
147
|
-
compact:
|
|
148
|
-
connecting:
|
|
149
|
-
onPress: r(
|
|
150
|
-
label: r(
|
|
151
|
-
}), t =
|
|
158
|
+
compact: B,
|
|
159
|
+
connecting: Q === "connecting",
|
|
160
|
+
onPress: r(Q) ? Ce : y,
|
|
161
|
+
label: r(Q) ? M("voiceSession.interrupt", "Stop the assistant and speak") : N ? M("voiceSession.unmute", "Turn the microphone on") : M("voiceSession.mute", "Turn the microphone off")
|
|
162
|
+
}), t = Z ? /* @__PURE__ */ f("button", {
|
|
152
163
|
type: "button",
|
|
153
|
-
onClick:
|
|
154
|
-
className: `flex items-center justify-center rounded-full border font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${
|
|
155
|
-
title:
|
|
164
|
+
onClick: D ? Z.imDone : Z.letMeFinish,
|
|
165
|
+
className: `flex items-center justify-center rounded-full border font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${B ? "h-7 px-3 text-xs" : z ? "h-11 px-6 text-base" : "h-9 px-4 text-sm"} ${D ? "border-transparent bg-action-primary-bg text-action-primary-text hover:opacity-90" : "border-border-default bg-bg-elevated text-text-secondary hover:bg-bg-sunken"}`,
|
|
166
|
+
title: D ? M("voiceSession.imDoneHint", "Send what you said now") : M("voiceSession.letMeFinishHint", "Pause sending until you tap “I’m done”"),
|
|
156
167
|
"data-testid": "assistant-voice-hold",
|
|
157
|
-
"data-holding":
|
|
158
|
-
children:
|
|
168
|
+
"data-holding": D ? "true" : "false",
|
|
169
|
+
children: D ? M("voiceSession.imDone", "I’m done") : M("voiceSession.letMeFinish", "Let me finish")
|
|
159
170
|
}) : null, n = t ? /* @__PURE__ */ p("div", {
|
|
160
171
|
className: "flex flex-col items-center gap-2",
|
|
161
172
|
children: [e, t]
|
|
162
|
-
}) : e, i = ee(
|
|
163
|
-
return
|
|
164
|
-
spokenChunks:
|
|
165
|
-
state:
|
|
173
|
+
}) : e, i = ee(Q) ? v : X || null, a = P === null ? null : ye(P, M);
|
|
174
|
+
return B ? /* @__PURE__ */ f(le, {
|
|
175
|
+
spokenChunks: T,
|
|
176
|
+
state: Q,
|
|
166
177
|
caption: i,
|
|
167
|
-
statusText:
|
|
168
|
-
statusSuffix:
|
|
169
|
-
rotateStatus:
|
|
178
|
+
statusText: Re,
|
|
179
|
+
statusSuffix: $,
|
|
180
|
+
rotateStatus: ze,
|
|
170
181
|
errorText: a,
|
|
171
182
|
control: n
|
|
172
183
|
}) : /* @__PURE__ */ f(ue, {
|
|
173
|
-
state:
|
|
174
|
-
userCaption:
|
|
175
|
-
spokenChunks:
|
|
176
|
-
assistantCaption:
|
|
177
|
-
expanded:
|
|
178
|
-
statusText:
|
|
179
|
-
statusSuffix:
|
|
180
|
-
rotateStatus:
|
|
184
|
+
state: Q,
|
|
185
|
+
userCaption: X || null,
|
|
186
|
+
spokenChunks: T,
|
|
187
|
+
assistantCaption: v,
|
|
188
|
+
expanded: z,
|
|
189
|
+
statusText: Re,
|
|
190
|
+
statusSuffix: $,
|
|
191
|
+
rotateStatus: ze,
|
|
181
192
|
errorText: a,
|
|
182
193
|
control: n
|
|
183
194
|
});
|
|
184
195
|
})(),
|
|
185
|
-
|
|
186
|
-
className:
|
|
196
|
+
A && !W ? /* @__PURE__ */ f("div", {
|
|
197
|
+
className: B ? "absolute left-20 right-36 top-2 flex justify-center" : `flex w-full justify-center ${z ? "max-w-[calc(100%-12rem)]" : "max-w-[calc(100%-8rem)]"}`,
|
|
187
198
|
children: /* @__PURE__ */ f("button", {
|
|
188
199
|
type: "button",
|
|
189
200
|
onClick: () => {
|
|
190
|
-
|
|
201
|
+
L("panel"), A.onOpen();
|
|
191
202
|
},
|
|
192
|
-
className: `max-w-full truncate rounded-full border border-border-default bg-bg-elevated font-medium text-text-primary transition-colors hover:bg-bg-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${
|
|
203
|
+
className: `max-w-full truncate rounded-full border border-border-default bg-bg-elevated font-medium text-text-primary transition-colors hover:bg-bg-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${B ? "h-8 px-3 text-xs" : "h-10 px-4 text-sm"}`,
|
|
193
204
|
"data-testid": "assistant-voice-proposal-chip",
|
|
194
|
-
children:
|
|
205
|
+
children: A.label
|
|
195
206
|
})
|
|
196
207
|
}) : null,
|
|
197
|
-
|
|
198
|
-
className: `absolute z-10 flex flex-col gap-2 overflow-y-auto rounded-lg border border-border-subtle bg-bg-elevated shadow-lg ${
|
|
208
|
+
j && W ? /* @__PURE__ */ p("div", {
|
|
209
|
+
className: `absolute z-10 flex flex-col gap-2 overflow-y-auto rounded-lg border border-border-subtle bg-bg-elevated shadow-lg ${z ? "inset-x-6 bottom-24 top-24 mx-auto max-w-xl p-4" : "inset-x-3 bottom-16 top-16 p-3"}`,
|
|
199
210
|
"data-testid": "assistant-voice-proposal-tray",
|
|
200
211
|
children: [/* @__PURE__ */ f("div", {
|
|
201
212
|
className: "flex justify-end",
|
|
202
213
|
children: /* @__PURE__ */ f("button", {
|
|
203
214
|
type: "button",
|
|
204
|
-
onClick:
|
|
215
|
+
onClick: j.onClose,
|
|
205
216
|
className: "flex size-8 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
|
|
206
|
-
"aria-label":
|
|
217
|
+
"aria-label": j.closeLabel,
|
|
207
218
|
"data-testid": "assistant-voice-proposal-tray-close",
|
|
208
219
|
children: /* @__PURE__ */ f(d, {
|
|
209
220
|
className: "size-4",
|
|
210
221
|
"aria-hidden": "true"
|
|
211
222
|
})
|
|
212
223
|
})
|
|
213
|
-
}),
|
|
224
|
+
}), j.content]
|
|
214
225
|
}) : null,
|
|
215
|
-
|
|
216
|
-
view:
|
|
217
|
-
onContinue:
|
|
218
|
-
onNotNow:
|
|
226
|
+
_ ? /* @__PURE__ */ f(me, {
|
|
227
|
+
view: R,
|
|
228
|
+
onContinue: _.accept,
|
|
229
|
+
onNotNow: _.decline
|
|
219
230
|
}) : null,
|
|
220
|
-
|
|
221
|
-
turns:
|
|
222
|
-
onClose: () =>
|
|
223
|
-
onSave:
|
|
224
|
-
onContinueInChat:
|
|
225
|
-
renderAfterTurn:
|
|
231
|
+
H ? /* @__PURE__ */ f(de, {
|
|
232
|
+
turns: be,
|
|
233
|
+
onClose: () => U(!1),
|
|
234
|
+
onSave: xe,
|
|
235
|
+
onContinueInChat: Se,
|
|
236
|
+
renderAfterTurn: je
|
|
226
237
|
}) : null,
|
|
227
|
-
|
|
228
|
-
className: `absolute ${
|
|
238
|
+
x ? /* @__PURE__ */ f("div", {
|
|
239
|
+
className: `absolute ${z ? "left-6 top-6" : B ? "left-11 top-2" : "left-3 top-3"}`,
|
|
229
240
|
children: /* @__PURE__ */ f(re, {
|
|
230
241
|
onFiles: (e) => {
|
|
231
|
-
|
|
242
|
+
x(e), L((e) => e === "mini" ? "panel" : e);
|
|
232
243
|
},
|
|
233
|
-
onPickerOpen:
|
|
244
|
+
onPickerOpen: Ne,
|
|
234
245
|
direction: "down",
|
|
235
|
-
canAddMore:
|
|
236
|
-
disabled:
|
|
246
|
+
canAddMore: Ee,
|
|
247
|
+
disabled: C
|
|
237
248
|
})
|
|
238
249
|
}) : null,
|
|
239
|
-
(
|
|
240
|
-
className: `absolute ${
|
|
250
|
+
(b.length > 0 || S > 0) && !B ? /* @__PURE__ */ f("div", {
|
|
251
|
+
className: `absolute ${z ? "bottom-24 left-24 right-24" : "bottom-16 left-16 right-16"}`,
|
|
241
252
|
"data-testid": "assistant-voice-attachments",
|
|
242
253
|
children: /* @__PURE__ */ f(ie, {
|
|
243
|
-
attachments:
|
|
244
|
-
onRemove:
|
|
245
|
-
onRetry:
|
|
246
|
-
preparingCount:
|
|
247
|
-
disabled:
|
|
254
|
+
attachments: b,
|
|
255
|
+
onRemove: we ?? (() => void 0),
|
|
256
|
+
onRetry: Te ?? (() => void 0),
|
|
257
|
+
preparingCount: S,
|
|
258
|
+
disabled: C
|
|
248
259
|
})
|
|
249
260
|
}) : null,
|
|
250
261
|
/* @__PURE__ */ f("button", {
|
|
251
262
|
type: "button",
|
|
252
|
-
onClick: () =>
|
|
253
|
-
className: `absolute ${
|
|
254
|
-
"aria-pressed":
|
|
255
|
-
"aria-label":
|
|
263
|
+
onClick: () => U((e) => !e),
|
|
264
|
+
className: `absolute ${z ? "bottom-6 right-6 size-14" : B ? "right-2 top-2 size-8" : "bottom-3 right-3 size-11"} flex items-center justify-center rounded-full bg-bg-elevated text-text-secondary transition-colors hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong`,
|
|
265
|
+
"aria-pressed": H,
|
|
266
|
+
"aria-label": M("voiceSession.transcriptTitle", "Voice transcript"),
|
|
256
267
|
"data-testid": "assistant-voice-transcript-toggle",
|
|
257
|
-
children: /* @__PURE__ */ f(ve, { className:
|
|
268
|
+
children: /* @__PURE__ */ f(ve, { className: z ? "size-6" : B ? "size-4" : "size-5" })
|
|
258
269
|
}),
|
|
259
270
|
/* @__PURE__ */ f("button", {
|
|
260
271
|
type: "button",
|
|
261
|
-
onClick: () =>
|
|
262
|
-
className: `absolute ${
|
|
263
|
-
"aria-label":
|
|
272
|
+
onClick: () => L(V),
|
|
273
|
+
className: `absolute ${z ? "bottom-6 left-6 size-14" : B ? "left-2 top-2 size-8" : "bottom-3 left-3 size-11"} flex items-center justify-center rounded-full bg-bg-elevated text-text-secondary transition-colors hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong`,
|
|
274
|
+
"aria-label": V === "panel" ? M("voiceSession.expandPanel", "Show the conversation in the panel") : V === "full" ? M("voiceSession.expand", "Expand the conversation to full screen") : M("voiceSession.collapse", "Shrink to the compact controller"),
|
|
264
275
|
"data-testid": "assistant-voice-expand",
|
|
265
|
-
children:
|
|
276
|
+
children: z ? /* @__PURE__ */ f(_e, { className: "size-5" }) : /* @__PURE__ */ f(ge, { className: B ? "size-4" : "size-5" })
|
|
266
277
|
})
|
|
267
278
|
]
|
|
268
279
|
});
|
|
269
280
|
};
|
|
270
|
-
function
|
|
281
|
+
function h(e, t) {
|
|
271
282
|
switch (e) {
|
|
272
283
|
case "network": return t("voiceSession.noticeNetwork", "Speech recognition lost its connection. Check your network — it will retry.");
|
|
273
284
|
case "not-capturing": return t("voiceSession.noticeNotCapturing", "The microphone did not start. Check that this site is allowed to use it, then try again.");
|
|
@@ -275,10 +286,11 @@ function ye(e, t) {
|
|
|
275
286
|
case "nothing-heard": return t("voiceSession.noticeNothingHeard", "Nothing heard yet. Check your microphone is not muted or in use by another app.");
|
|
276
287
|
case "hands-free-nothing-heard": return t("voiceSession.noticeHandsFreeNothingHeard", "Stopped, but I did not catch that. Say it again, or tap to replay.");
|
|
277
288
|
case "hands-free-fallback": return t("voiceSession.noticeHandsFreeFallback", "Hands-free interrupt turned itself off for this conversation. Tap to interrupt still works.");
|
|
289
|
+
case "reply-not-heard": return t("voiceSession.noticeReplyNotHeard", "That reply was not read aloud: earlier audio may still be playing. Read it in the transcript.");
|
|
278
290
|
default: return e;
|
|
279
291
|
}
|
|
280
292
|
}
|
|
281
|
-
function
|
|
293
|
+
function ye(e, t) {
|
|
282
294
|
switch (e) {
|
|
283
295
|
case "mic-denied": return t("voiceSession.micDenied", "Microphone access is blocked. Allow it in your browser settings to talk.");
|
|
284
296
|
case "no-speech-support": return t("voiceSession.noSpeechSupport", "This browser cannot listen. Try a different browser, or type instead.");
|