@burdenoff/fe-libs 2026.1115.11 → 2026.1115.12

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.
@@ -3,504 +3,509 @@ import { EscapeLayer as t } from "../../../components/EscapeLayer.js";
3
3
  import { useI18n as n } from "../../../providers/shell/I18nProvider.js";
4
4
  import { useAssistantTr as r } from "../../i18n.js";
5
5
  import { languageDisplayName as i } from "../../voice/speechVoices.js";
6
- import { resolveAssistantLanguage as a } from "../../voice/languages.js";
7
- import { useAssistantStore as o } from "../../store.js";
8
- import { useVoiceInput as s } from "../../voice/useVoiceInput.js";
9
- import { useAssistantAttachments as ee } from "../../useAssistantAttachments.js";
10
- import { getSendableAttachments as te } from "../../attachments.js";
11
- import { ATTACHMENT_COMMIT_CODES as ne } from "../../attachmentCommit.js";
12
- import { AssistantAttachmentButton as re } from "./AssistantAttachmentButton.js";
13
- import { AssistantAttachmentChips as ie } from "./AssistantAttachmentChips.js";
14
- import { AssistantFocusChip as ae } from "./AssistantFocusChip.js";
15
- import { useAskAboutStore as oe } from "../../askAbout/askAboutStore.js";
16
- import { AssistantVoiceButton as se, ListeningDot as ce } from "./AssistantVoiceButton.js";
17
- import { AssistantVoiceSessionButton as le } from "../voice/AssistantVoiceSessionButton.js";
18
- import { useCompactDictation as ue } from "./useCompactDictation.js";
19
- import { DictationControls as de, DictationLiveText as fe, MicBlockedNotice as pe } from "./AssistantDictation.js";
20
- import { AssistantMicMenu as me } from "./AssistantMicMenu.js";
21
- import { AssistantModeSelector as he } from "./AssistantModeSelector.js";
22
- import { AssistantModeMenu as ge } from "./AssistantModeMenu.js";
23
- import { AssistantViewSwitchRow as _e } from "../compact/AssistantViewSwitchRow.js";
24
- import { compactEnterSends as ve, isImeComposingEnter as ye } from "./imeEnter.js";
25
- import { PAGE_COLUMN as be, useAssistantPageLayout as xe } from "../assistantPageLayout.js";
26
- import { useCallback as c, useEffect as l, useId as u, useLayoutEffect as Se, useMemo as Ce, useRef as d, useState as f } from "react";
27
- import { ArrowUp as we, Loader2 as p, Square as Te } from "lucide-react";
28
- import { Fragment as Ee, jsx as m, jsxs as h } from "react/jsx-runtime";
6
+ import { resolveAssistantLanguage as ee } from "../../voice/languages.js";
7
+ import { useAssistantStore as a } from "../../store.js";
8
+ import { useVoiceInput as o } from "../../voice/useVoiceInput.js";
9
+ import { useAssistantAttachments as te } from "../../useAssistantAttachments.js";
10
+ import { getSendableAttachments as ne } from "../../attachments.js";
11
+ import { ATTACHMENT_COMMIT_CODES as re } from "../../attachmentCommit.js";
12
+ import { AssistantAttachmentButton as ie } from "./AssistantAttachmentButton.js";
13
+ import { AssistantAttachmentChips as ae } from "./AssistantAttachmentChips.js";
14
+ import { AssistantFocusChip as oe } from "./AssistantFocusChip.js";
15
+ import { useAskAboutStore as se } from "../../askAbout/askAboutStore.js";
16
+ import { AssistantVoiceButton as ce, ListeningDot as le } from "./AssistantVoiceButton.js";
17
+ import { AssistantVoiceSessionButton as ue } from "../voice/AssistantVoiceSessionButton.js";
18
+ import { pageBoxClass as de } from "./pageBoxClass.js";
19
+ import { useCompactDictation as fe } from "./useCompactDictation.js";
20
+ import { DictationControls as pe, DictationLiveText as me, MicBlockedNotice as he } from "./AssistantDictation.js";
21
+ import { AssistantMicMenu as ge } from "./AssistantMicMenu.js";
22
+ import { AssistantModeSelector as _e } from "./AssistantModeSelector.js";
23
+ import { AssistantModeMenu as ve } from "./AssistantModeMenu.js";
24
+ import { AssistantViewSwitchRow as ye } from "../compact/AssistantViewSwitchRow.js";
25
+ import { compactEnterSends as be, isImeComposingEnter as xe } from "./imeEnter.js";
26
+ import { PAGE_COLUMN as Se, useAssistantPageLayout as Ce } from "../assistantPageLayout.js";
27
+ import { useCallback as s, useEffect as c, useId as l, useLayoutEffect as we, useMemo as Te, useRef as u, useState as d } from "react";
28
+ import { ArrowUp as Ee, Loader2 as De, Square as Oe } from "lucide-react";
29
+ import { Fragment as ke, jsx as f, jsxs as p } from "react/jsx-runtime";
29
30
  // src/shared/assistant/ui/composer/AssistantComposer.tsx
30
- var De = 200;
31
- function Oe(e) {
31
+ var Ae = 200;
32
+ function je(e) {
32
33
  if (!e) return !1;
33
34
  let t = e.ownerDocument.activeElement;
34
35
  return !t || t === e.ownerDocument.body ? !1 : e.contains(t) ? !0 : e.closest("[data-assistant-panel]")?.contains(t) ?? !1;
35
36
  }
36
- var ke = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend: g, disabled: Ae = !1, readOnly: je = !1, placeholder: Me, mode: Ne, availableModes: _, attachmentCharsPerFile: Pe, onModeChange: Fe, auto: Ie, onStartVoiceSession: v, onDraftStart: Le, onDraftChange: Re, suspendDictation: ze = !1, onVoiceStateChange: Be, presentation: Ve = "classic", turnInFlight: y = !1, onStop: He, turnId: Ue, modeDisabledReason: We = null, inputRef: b, aboveCard: Ge, viewSwitch: Ke, modeReadOnly: qe = !1, voiceSessionActive: x = !1, concealed: Je = !1 }) => {
37
- let S = r(), C = xe(), { locale: w } = n(), T = Ae || je, E = Ve === "compact", D = d(null), Ye = c((e) => {
38
- D.current = e, typeof b == "function" ? b(e) : b && (b.current = e);
39
- }, [b]), [O, k] = f(""), [A, Xe] = f(!1), [j, Ze] = f(!1), Qe = d(!1), [M, N] = f(null), [$e, P] = f(null), [F, I] = f(null), [et, tt] = f(y);
40
- et === y ? F !== null && y && Ue != null && Ue !== F && I(null) : (tt(y), y ? (P(null), I(null)) : F !== null && (P(F), I(null)));
41
- let nt = d(!1), rt = d(null), it = d(!1), at = d(!1), ot = d(null), st = d(!1), L = d(0), { attachments: R, isBusy: ct, preparingCount: lt, sendBlocker: ut, rejection: dt, addFiles: z, remove: ft, retry: pt, clear: mt, clearRejection: ht, canAddMore: gt, commit: _t, cancelCommit: vt } = ee({ perFileChars: Pe }), B = O.trim() !== "" || R.length > 0, yt = d(!1), V = d(!1);
42
- l(() => {
43
- B && !yt.current ? (yt.current = !0, Le?.()) : B || (yt.current = !1);
44
- }, [B, Le]), l(() => {
45
- B || (V.current = !1), Re?.({
46
- text: O,
37
+ var Me = ({ children: e }) => e(l()), m = ({ writeAccessDenied: l = !1, onSend: m, disabled: Ne = !1, readOnly: Pe = !1, placeholder: Fe, mode: Ie, availableModes: h, attachmentCharsPerFile: Le, onModeChange: Re, auto: ze, onStartVoiceSession: g, onDraftStart: Be, onDraftChange: Ve, suspendDictation: He = !1, entrance: Ue = !1, onVoiceStateChange: We, presentation: Ge = "classic", turnInFlight: _ = !1, onStop: Ke, turnId: qe, modeDisabledReason: Je = null, inputRef: v, aboveCard: Ye, viewSwitch: Xe, modeReadOnly: Ze = !1, voiceSessionActive: y = !1, concealed: Qe = !1 }) => {
38
+ let b = r(), x = Ce(), { locale: S } = n(), C = Ne || Pe, w = Ge === "compact", T = u(null), $e = s((e) => {
39
+ T.current = e, typeof v == "function" ? v(e) : v && (v.current = e);
40
+ }, [v]), [E, D] = d(""), [O, et] = d(!1), [k, tt] = d(!1), nt = u(!1), [A, j] = d(null), [rt, M] = d(null), [N, P] = d(null), [it, at] = d(_);
41
+ it === _ ? N !== null && _ && qe != null && qe !== N && P(null) : (at(_), _ ? (M(null), P(null)) : N !== null && (M(N), P(null)));
42
+ let ot = u(!1), F = u(null), st = u(!1), ct = u(!1), lt = u(null), I = u(!1), L = u(0), { attachments: R, isBusy: ut, preparingCount: dt, sendBlocker: ft, rejection: pt, addFiles: z, remove: mt, retry: ht, clear: gt, clearRejection: _t, canAddMore: vt, commit: yt, cancelCommit: bt } = te({ perFileChars: Le }), B = E.trim() !== "" || R.length > 0, xt = u(!1), V = u(!1);
43
+ c(() => {
44
+ B && !xt.current ? (xt.current = !0, Be?.()) : B || (xt.current = !1);
45
+ }, [B, Be]), c(() => {
46
+ B || (V.current = !1), Ve?.({
47
+ text: E,
47
48
  hasAttachments: R.length > 0,
48
49
  dictated: V.current
49
50
  });
50
51
  }, [
51
- O,
52
+ E,
52
53
  R.length,
53
54
  B,
54
- Re
55
+ Ve
55
56
  ]);
56
- let H = c((e) => {
57
- V.current = !0, k((t) => t ? `${t.replace(/\s+$/, "")} ${e}` : e);
58
- }, []), bt = o((e) => e.assistantLanguage), xt = Ce(() => a(bt, w), [bt, w]), St = d(H), Ct = d(() => void 0), wt = o((e) => e.micDeviceId), U = s({
59
- onFinalize: (e) => St.current(e),
60
- onEnded: () => Ct.current(),
61
- language: xt.tag,
62
- deviceId: wt
63
- }), Tt = c(() => {
57
+ let H = s((e) => {
58
+ V.current = !0, D((t) => t ? `${t.replace(/\s+$/, "")} ${e}` : e);
59
+ }, []), St = a((e) => e.assistantLanguage), Ct = Te(() => ee(St, S), [St, S]), wt = u(H), Tt = u(() => void 0), Et = a((e) => e.micDeviceId), U = o({
60
+ onFinalize: (e) => wt.current(e),
61
+ onEnded: () => Tt.current(),
62
+ language: Ct.tag,
63
+ deviceId: Et
64
+ }), Dt = s(() => {
64
65
  V.current = !0;
65
- }, []), W = ue({
66
- enabled: E,
66
+ }, []), W = fe({
67
+ enabled: w,
67
68
  voice: U,
68
- text: O,
69
- setText: k,
70
- textareaRef: D,
71
- markDictated: Tt,
72
- deviceId: wt
73
- }), Et = W.addFinal;
74
- l(() => {
75
- St.current = E ? Et : H;
69
+ text: E,
70
+ setText: D,
71
+ textareaRef: T,
72
+ markDictated: Dt,
73
+ deviceId: Et
74
+ }), Ot = W.addFinal;
75
+ c(() => {
76
+ wt.current = w ? Ot : H;
76
77
  }, [
77
- E,
78
- Et,
78
+ w,
79
+ Ot,
79
80
  H
80
81
  ]);
81
- let Dt = W.recogniserEnded;
82
- l(() => {
83
- Ct.current = E ? Dt : () => void 0;
84
- }, [E, Dt]);
85
- let G = U.isActive, Ot = U.interim, kt = U.stop, At = W.keepAndStop;
86
- l(() => {
87
- ze && G && (E ? At() : (Ot.trim() !== "" && H(Ot.trim()), kt()));
82
+ let kt = W.recogniserEnded;
83
+ c(() => {
84
+ Tt.current = w ? kt : () => void 0;
85
+ }, [w, kt]);
86
+ let G = U.isActive, At = U.interim, jt = U.stop, Mt = W.keepAndStop;
87
+ c(() => {
88
+ He && G && (w ? Mt() : (At.trim() !== "" && H(At.trim()), jt()));
88
89
  }, [
89
- ze,
90
+ He,
90
91
  G,
91
- Ot,
92
- kt,
92
+ At,
93
+ jt,
93
94
  H,
94
- E,
95
- At
96
- ]), l(() => {
97
- Be?.({
98
- committing: j,
95
+ w,
96
+ Mt
97
+ ]), c(() => {
98
+ We?.({
99
+ committing: k,
99
100
  dictating: G
100
101
  });
101
102
  }, [
102
- Be,
103
- j,
103
+ We,
104
+ k,
104
105
  G
105
106
  ]);
106
- let jt = oe((e) => e.pending), Mt = jt ? S("askAbout.placeholder", "Ask about {{name}}…", { name: jt.label }) : Me ?? S("composer.placeholder", "Ask me anything…"), Nt = oe((e) => e.focusRequested), Pt = (e) => {
107
- k(e), requestAnimationFrame(() => {
108
- let t = D.current;
107
+ let Nt = se((e) => e.pending), Pt = Nt ? b("askAbout.placeholder", "Ask about {{name}}…", { name: Nt.label }) : Fe ?? b("composer.placeholder", "Ask me anything…"), Ft = se((e) => e.focusRequested), It = (e) => {
108
+ D(e), requestAnimationFrame(() => {
109
+ let t = T.current;
109
110
  t && (t.focus({ preventScroll: !0 }), t.setSelectionRange(e.length, e.length));
110
111
  });
111
112
  };
112
- l(() => {
113
- if (!Nt || T) return;
114
- let e = D.current;
115
- e && (e.focus({ preventScroll: !0 }), oe.getState().actions.composerFocused());
116
- }, [Nt, T]);
117
- let K = O.trim(), q = te(R), Ft = R.filter((e) => e.status === "error"), J = (K.length > 0 || q.length > 0) && !T && !j && ut === null, It = q.some((e) => !(e.fileId && e.downloadUrl) && !e.inlineOnly), Lt = d(T);
118
- Lt.current = T;
119
- let Y = d(!0);
120
- l(() => (Y.current = !0, () => {
113
+ c(() => {
114
+ if (!Ft || C) return;
115
+ let e = T.current;
116
+ e && (e.focus({ preventScroll: !0 }), se.getState().actions.composerFocused());
117
+ }, [Ft, C]);
118
+ let K = E.trim(), q = ne(R), Lt = R.filter((e) => e.status === "error"), J = (K.length > 0 || q.length > 0) && !C && !k && ft === null, Rt = q.some((e) => !(e.fileId && e.downloadUrl) && !e.inlineOnly), zt = u(C);
119
+ zt.current = C;
120
+ let Y = u(!0);
121
+ c(() => (Y.current = !0, () => {
121
122
  Y.current = !1;
122
- }), []), Se(() => {
123
- let e = D.current;
124
- e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, De)}px`);
125
- }, [O]);
126
- let X = c(async () => {
127
- if (!J || Qe.current) return;
123
+ }), []), we(() => {
124
+ let e = T.current;
125
+ e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, Ae)}px`);
126
+ }, [E]);
127
+ let X = s(async () => {
128
+ if (!J || nt.current) return;
128
129
  U.isActive && U.stop();
129
- let e = O.trim();
130
- N(null);
131
- let t = E && Oe(ot.current);
132
- if (!It) {
133
- st.current = t, g(e, q), k(""), mt();
130
+ let e = E.trim();
131
+ j(null);
132
+ let t = w && je(lt.current);
133
+ if (!Rt) {
134
+ I.current = t, m(e, q), D(""), gt();
134
135
  return;
135
136
  }
136
- let n = o.getState().activeConversationId;
137
- Qe.current = !0, Ze(!0);
137
+ let n = a.getState().activeConversationId;
138
+ nt.current = !0, tt(!0);
138
139
  try {
139
- let r = await _t();
140
+ let r = await yt();
140
141
  if (!Y.current) {
141
142
  r.ok && await r.rollback();
142
143
  return;
143
144
  }
144
145
  if (!r.ok) {
145
- r.cancelled || N({
146
+ r.cancelled || j({
146
147
  kind: "failed",
147
148
  failures: r.failures
148
149
  });
149
150
  return;
150
151
  }
151
- if (Lt.current) {
152
- await r.rollback(), Y.current && N({
152
+ if (zt.current) {
153
+ await r.rollback(), Y.current && j({
153
154
  kind: "busy",
154
155
  failures: []
155
156
  });
156
157
  return;
157
158
  }
158
- let i = o.getState();
159
+ let i = a.getState();
159
160
  if (i.activeConversationId !== n || n !== null && !i.conversations.some((e) => e.id === n)) {
160
- await r.rollback(), Y.current && N({
161
+ await r.rollback(), Y.current && j({
161
162
  kind: "moved",
162
163
  failures: []
163
164
  });
164
165
  return;
165
166
  }
166
- st.current = t, g(e, te(r.attachments)), r.handedOver(), k(""), mt();
167
+ I.current = t, m(e, ne(r.attachments)), r.handedOver(), D(""), gt();
167
168
  } finally {
168
- Qe.current = !1, Y.current && Ze(!1);
169
+ nt.current = !1, Y.current && tt(!1);
169
170
  }
170
171
  }, [
171
172
  J,
172
- It,
173
- _t,
174
- g,
175
- O,
173
+ Rt,
174
+ yt,
175
+ m,
176
+ E,
176
177
  q,
177
- mt,
178
+ gt,
178
179
  U,
179
- E
180
- ]), Rt = c(() => {
181
- vt(), D.current?.focus();
182
- }, [vt]), Z = c(() => {
183
- Lt.current ? nt.current = !0 : D.current?.focus();
184
- }, []), zt = c(() => {
185
- if (at.current) return;
186
- let e = He?.() ?? null;
187
- e !== null && (at.current = !0, I(e)), Z();
188
- }, [He, Z]);
189
- l(() => {
190
- !T && nt.current && (nt.current = !1, D.current?.focus());
191
- }, [T]);
192
- let Bt = c((e) => {
180
+ w
181
+ ]), Bt = s(() => {
182
+ bt(), T.current?.focus();
183
+ }, [bt]), Z = s(() => {
184
+ zt.current ? ot.current = !0 : T.current?.focus();
185
+ }, []), Vt = s(() => {
186
+ if (ct.current) return;
187
+ let e = Ke?.() ?? null;
188
+ e !== null && (ct.current = !0, P(e)), Z();
189
+ }, [Ke, Z]);
190
+ c(() => {
191
+ !C && ot.current && (ot.current = !1, T.current?.focus());
192
+ }, [C]);
193
+ let Ht = s((e) => {
193
194
  if (e !== null) {
194
- rt.current = e;
195
+ F.current = e;
195
196
  return;
196
197
  }
197
- let t = rt.current;
198
- rt.current = null, t !== null && t.ownerDocument.activeElement === t && (it.current = !0);
199
- }, []), Q = E && y && He !== void 0;
200
- Se(() => {
201
- !Q && it.current && (it.current = !1, Z());
202
- }, [Q, Z]), l(() => {
203
- F === null && (at.current = !1);
204
- }, [F]), Se(() => {
198
+ let t = F.current;
199
+ F.current = null, t !== null && t.ownerDocument.activeElement === t && (st.current = !0);
200
+ }, []), Q = w && _ && Ke !== void 0;
201
+ we(() => {
202
+ !Q && st.current && (st.current = !1, Z());
203
+ }, [Q, Z]), c(() => {
204
+ N === null && (ct.current = !1);
205
+ }, [N]), we(() => {
205
206
  if (!Q) return;
206
- let e = st.current;
207
- if (st.current = !1, !e) return;
208
- let t = rt.current;
207
+ let e = I.current;
208
+ if (I.current = !1, !e) return;
209
+ let t = F.current;
209
210
  if (t === null) return;
210
211
  let n = t.ownerDocument, r = n.activeElement;
211
- (r === null || r === n.body || r === D.current) && t.focus({ preventScroll: !0 });
212
+ (r === null || r === n.body || r === T.current) && t.focus({ preventScroll: !0 });
212
213
  }, [Q]);
213
- let Vt = c((e) => {
214
- k(e), P(null);
214
+ let Ut = s((e) => {
215
+ D(e), M(null);
215
216
  }, []);
216
- l(() => {
217
- N(null);
217
+ c(() => {
218
+ j(null);
218
219
  }, [R.length]);
219
- let Ht = (t) => {
220
- if (t.kind === "busy") return S("attachments.saveBusy", "The assistant started another reply, so nothing was sent. Your message and files are still here.");
221
- if (t.kind === "moved") return S("attachments.saveMoved", "You switched conversations while the files were being saved, so nothing was sent. Your message and files are still here.");
220
+ let Wt = (t) => {
221
+ if (t.kind === "busy") return b("attachments.saveBusy", "The assistant started another reply, so nothing was sent. Your message and files are still here.");
222
+ if (t.kind === "moved") return b("attachments.saveMoved", "You switched conversations while the files were being saved, so nothing was sent. Your message and files are still here.");
222
223
  let { failures: n } = t;
223
- if (n.some((e) => e.code === ne.editorAccessRequired)) return e(S, w);
224
- if (n.some((e) => e.code === ne.quotaExceeded || e.code === ne.quotaNotProvisioned)) return `${S("attachments.quotaFull", "File storage is full or not set up for this workspace, so the attachments couldn't be saved. Nothing was sent.")} ${S("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
224
+ if (n.some((e) => e.code === re.editorAccessRequired)) return e(b, S);
225
+ if (n.some((e) => e.code === re.quotaExceeded || e.code === re.quotaNotProvisioned)) return `${b("attachments.quotaFull", "File storage is full or not set up for this workspace, so the attachments couldn't be saved. Nothing was sent.")} ${b("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
225
226
  let r = n[0], i = R.find((e) => e.id === r?.id)?.filename ?? "";
226
- return `${n.length <= 1 ? S("attachments.saveFailedOne", "{{name}} couldn't be saved, so nothing was sent.", { name: i }) : S("attachments.saveFailedMany", "{{count}} attachments couldn't be saved, so nothing was sent.", { count: n.length })} ${S("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
227
- }, Ut = c((e) => {
227
+ return `${n.length <= 1 ? b("attachments.saveFailedOne", "{{name}} couldn't be saved, so nothing was sent.", { name: i }) : b("attachments.saveFailedMany", "{{count}} attachments couldn't be saved, so nothing was sent.", { count: n.length })} ${b("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
228
+ }, Gt = s((e) => {
228
229
  e.key === "Enter" && !e.shiftKey && (e.preventDefault(), X());
229
- }, [X]), Wt = c((e) => {
230
- e.key === "Escape" ? ye(e) && e.stopPropagation() : ve(e) && (e.preventDefault(), P(null), X());
231
- }, [X]), Gt = c((e) => {
230
+ }, [X]), Kt = s((e) => {
231
+ e.key === "Escape" ? xe(e) && e.stopPropagation() : be(e) && (e.preventDefault(), M(null), X());
232
+ }, [X]), qt = s((e) => {
232
233
  let t = Array.from(e.clipboardData?.files ?? []);
233
234
  t.length !== 0 && (e.preventDefault(), z(t));
234
- }, [z]), Kt = c((e) => {
235
- Array.from(e.dataTransfer?.types ?? []).includes("Files") && (L.current += 1, Xe(!0));
236
- }, []), qt = c(() => {
237
- L.current = Math.max(0, L.current - 1), L.current === 0 && Xe(!1);
238
- }, []), Jt = c((e) => {
235
+ }, [z]), Jt = s((e) => {
236
+ Array.from(e.dataTransfer?.types ?? []).includes("Files") && (L.current += 1, et(!0));
237
+ }, []), Yt = s(() => {
238
+ L.current = Math.max(0, L.current - 1), L.current === 0 && et(!1);
239
+ }, []), Xt = s((e) => {
239
240
  Array.from(e.dataTransfer?.types ?? []).includes("Files") && e.preventDefault();
240
- }, []), Yt = c((e) => {
241
- e.preventDefault(), L.current = 0, Xe(!1), z(e.dataTransfer?.files ?? null);
242
- }, [z]), Xt = (e) => {
241
+ }, []), Zt = s((e) => {
242
+ e.preventDefault(), L.current = 0, et(!1), z(e.dataTransfer?.files ?? null);
243
+ }, [z]), Qt = (e) => {
243
244
  switch (e) {
244
- case "too-many": return S("attachments.tooMany", "You can attach up to {{max}} files per message.", { max: 5 });
245
- case "too-large": return S("attachments.tooLarge", "That file is larger than 10 MB.");
246
- case "empty": return S("attachments.empty", "That file is empty.");
247
- case "unreadable": return S("attachments.unreadable", "That file could not be read.");
248
- case "unsupported-image": return S("attachments.unsupportedImage", "This device can't read that image format, so it can't be resized to send. Save it as JPEG and try again.");
249
- case "too-large-to-save": return S("attachments.tooLargeToSave", "That file is over 5 MB, so it can't be saved to Files, and no text could be read from it.");
245
+ case "too-many": return b("attachments.tooMany", "You can attach up to {{max}} files per message.", { max: 5 });
246
+ case "too-large": return b("attachments.tooLarge", "That file is larger than 10 MB.");
247
+ case "empty": return b("attachments.empty", "That file is empty.");
248
+ case "unreadable": return b("attachments.unreadable", "That file could not be read.");
249
+ case "unsupported-image": return b("attachments.unsupportedImage", "This device can't read that image format, so it can't be resized to send. Save it as JPEG and try again.");
250
+ case "too-large-to-save": return b("attachments.tooLargeToSave", "That file is over 5 MB, so it can't be saved to Files, and no text could be read from it.");
250
251
  }
251
252
  }, $ = (() => {
252
253
  switch (U.error) {
253
- case "not-allowed": return S("voice.denied", "Microphone access is blocked. Allow it in your browser settings to dictate.");
254
- case "audio-capture": return S("voice.noMic", "No microphone was found.");
255
- case "network": return S("voice.network", "Speech recognition is offline right now.");
256
- case "language-not-supported": return S("voice.languageNotSupported", "This browser cannot recognise spoken {{language}}. Try a different browser, or type instead.", { language: i(U.language, w) });
257
- case "unknown": return S("voice.failed", "Dictation stopped unexpectedly.");
254
+ case "not-allowed": return b("voice.denied", "Microphone access is blocked. Allow it in your browser settings to dictate.");
255
+ case "audio-capture": return b("voice.noMic", "No microphone was found.");
256
+ case "network": return b("voice.network", "Speech recognition is offline right now.");
257
+ case "language-not-supported": return b("voice.languageNotSupported", "This browser cannot recognise spoken {{language}}. Try a different browser, or type instead.", { language: i(U.language, S) });
258
+ case "unknown": return b("voice.failed", "Dictation stopped unexpectedly.");
258
259
  default: return null;
259
260
  }
260
- })(), Zt = (e, n, r = !1) => j ? /* @__PURE__ */ m(t, {
261
- onDismiss: Rt,
262
- children: /* @__PURE__ */ h("p", {
261
+ })(), $t = (e, n, r = !1) => k ? /* @__PURE__ */ f(t, {
262
+ onDismiss: Bt,
263
+ children: /* @__PURE__ */ p("p", {
263
264
  className: "flex items-center justify-center gap-2 text-text-muted",
264
265
  "data-testid": "assistant-commit-status",
265
266
  children: [
266
- /* @__PURE__ */ m(p, {
267
+ /* @__PURE__ */ f(De, {
267
268
  className: "size-3 motion-safe:animate-spin",
268
269
  "aria-hidden": "true"
269
270
  }),
270
- /* @__PURE__ */ m("span", { children: S("attachments.saving", "Saving your attachments…") }),
271
- /* @__PURE__ */ m("button", {
271
+ /* @__PURE__ */ f("span", { children: b("attachments.saving", "Saving your attachments…") }),
272
+ /* @__PURE__ */ f("button", {
272
273
  type: "button",
273
- onClick: Rt,
274
+ onClick: Bt,
274
275
  className: "rounded text-text-primary underline underline-offset-2 hover:text-action-primary-bg focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
275
276
  "data-testid": "assistant-commit-cancel",
276
- children: S("attachments.cancelSaving", "Cancel")
277
+ children: b("attachments.cancelSaving", "Cancel")
277
278
  })
278
279
  ]
279
280
  })
280
- }) : M ? /* @__PURE__ */ m("p", {
281
+ }) : A ? /* @__PURE__ */ f("p", {
281
282
  className: "text-status-error-text",
282
283
  role: "alert",
283
284
  "data-testid": "assistant-commit-failed",
284
- children: Ht(M)
285
- }) : !r && U.isStarting && !U.isListening ? /* @__PURE__ */ m("p", {
285
+ children: Wt(A)
286
+ }) : !r && U.isStarting && !U.isListening ? /* @__PURE__ */ f("p", {
286
287
  className: "text-text-muted",
287
288
  "data-testid": "assistant-voice-starting",
288
- children: S("voice.starting", "Starting the microphone…")
289
- }) : !r && U.isListening ? /* @__PURE__ */ h("p", {
289
+ children: b("voice.starting", "Starting the microphone…")
290
+ }) : !r && U.isListening ? /* @__PURE__ */ p("p", {
290
291
  className: "text-status-error-text",
291
292
  "data-testid": "assistant-voice-status",
292
- children: [/* @__PURE__ */ m(ce, {}), U.interim || S("voice.listening", "Listening… speak now, tap the square to stop")]
293
- }) : $ ? /* @__PURE__ */ m("p", {
293
+ children: [/* @__PURE__ */ f(le, {}), U.interim || b("voice.listening", "Listening… speak now, tap the square to stop")]
294
+ }) : $ ? /* @__PURE__ */ f("p", {
294
295
  className: "text-status-error-text",
295
296
  "data-testid": "assistant-voice-error",
296
297
  children: $
297
- }) : dt ? /* @__PURE__ */ m("button", {
298
+ }) : pt ? /* @__PURE__ */ f("button", {
298
299
  type: "button",
299
- onClick: ht,
300
+ onClick: _t,
300
301
  className: "text-status-error-text underline-offset-2 hover:underline",
301
302
  "data-testid": "assistant-attachment-rejection",
302
- children: Xt(dt)
303
- }) : ut === "failed" ? /* @__PURE__ */ m("p", {
303
+ children: Qt(pt)
304
+ }) : ft === "failed" ? /* @__PURE__ */ f("p", {
304
305
  className: "text-status-error-text",
305
306
  "data-testid": "assistant-attachment-blocked",
306
- children: Ft.length === 1 ? S("attachments.blockedOne", "{{name}} didn't upload. Retry or remove it before sending.", { name: Ft[0].filename }) : S("attachments.blockedMany", "{{count}} attachments didn't upload. Retry or remove them before sending.", { count: Ft.length })
307
- }) : n ? /* @__PURE__ */ m("p", {
307
+ children: Lt.length === 1 ? b("attachments.blockedOne", "{{name}} didn't upload. Retry or remove it before sending.", { name: Lt[0].filename }) : b("attachments.blockedMany", "{{count}} attachments didn't upload. Retry or remove them before sending.", { count: Lt.length })
308
+ }) : n ? /* @__PURE__ */ f("p", {
308
309
  className: "text-text-muted",
309
310
  "data-testid": "assistant-stopping-status",
310
- children: S("composer.stopping", "Stopping the reply…")
311
- }) : e ? /* @__PURE__ */ m("p", {
311
+ children: b("composer.stopping", "Stopping the reply…")
312
+ }) : e ? /* @__PURE__ */ f("p", {
312
313
  className: "text-text-muted",
313
314
  "data-testid": "assistant-stop-status",
314
- children: S("composer.stopped", "Reply stopped.")
315
- }) : /* @__PURE__ */ m("p", {
315
+ children: b("composer.stopped", "Reply stopped.")
316
+ }) : /* @__PURE__ */ f("p", {
316
317
  className: "text-text-muted",
317
- children: S("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach")
318
+ children: b("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach")
318
319
  });
319
- if (E) {
320
- let e = v !== void 0 && K.length === 0 && R.length === 0 && !U.isActive, n = S("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach"), r = U.isSupported && !x && W.phase !== "idle", i = U.error === "not-allowed" || U.error === "audio-capture", a = !!(j || M || $ || dt || ut === "failed" || $e !== null || F !== null), o = W.nothingHeard && !a, s = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-elevated)]";
321
- return /* @__PURE__ */ m(ke, { children: (ee) => /* @__PURE__ */ h("div", {
322
- ref: ot,
323
- className: `${C ? `flex-shrink-0 px-3 pt-1.5 ${be}` : "flex-shrink-0 px-3 pt-1.5"}${Je ? " hidden" : ""}`,
320
+ if (w) {
321
+ let e = g !== void 0 && K.length === 0 && R.length === 0 && !U.isActive, n = b("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach"), r = U.isSupported && !y && W.phase !== "idle", i = U.error === "not-allowed" || U.error === "audio-capture", ee = !!(k || A || $ || pt || ft === "failed" || rt !== null || N !== null), a = W.nothingHeard && !ee, o = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-elevated)]";
322
+ return /* @__PURE__ */ f(Me, { children: (te) => /* @__PURE__ */ p("div", {
323
+ ref: lt,
324
+ className: `${x ? `flex-shrink-0 px-3 pt-1.5 ${Se}` : "flex-shrink-0 px-3 pt-1.5"}${Qe ? " hidden" : ""}`,
324
325
  children: [
325
- Ge,
326
- Ke ? /* @__PURE__ */ m(_e, {
327
- voiceLive: x,
328
- children: Ke
326
+ Ye,
327
+ Xe ? /* @__PURE__ */ f(ye, {
328
+ voiceLive: y,
329
+ children: Xe
329
330
  }) : null,
330
- /* @__PURE__ */ h("div", {
331
- className: a || o || u ? "mb-1.5 px-1 text-center text-xs" : "",
331
+ /* @__PURE__ */ p("div", {
332
+ className: ee || a || l ? "mb-1.5 px-1 text-center text-xs" : "",
332
333
  "aria-live": "polite",
333
334
  "data-testid": "assistant-composer-status",
334
335
  children: [
335
- u ? /* @__PURE__ */ m("p", {
336
+ l ? /* @__PURE__ */ f("p", {
336
337
  className: "text-status-warning",
337
338
  "data-testid": "assistant-write-access-warning",
338
- children: S("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
339
+ children: b("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
339
340
  }) : null,
340
- i && $ && !j && !M ? /* @__PURE__ */ m(pe, {
341
+ i && $ && !k && !A ? /* @__PURE__ */ f(he, {
341
342
  message: $,
342
343
  onTryAgain: () => {
343
344
  U.clearError(), W.start();
344
345
  }
345
- }) : o ? /* @__PURE__ */ m("p", {
346
+ }) : a ? /* @__PURE__ */ f("p", {
346
347
  className: "text-text-secondary",
347
348
  "data-testid": "assistant-dictation-nothing-heard",
348
- children: S("dictation.nothingHeard", "Nothing was heard. Check the microphone and try again.")
349
- }) : a ? Zt($e !== null, F !== null, !0) : null,
350
- r && U.isListening ? /* @__PURE__ */ m("span", {
349
+ children: b("dictation.nothingHeard", "Nothing was heard. Check the microphone and try again.")
350
+ }) : ee ? $t(rt !== null, N !== null, !0) : null,
351
+ r && U.isListening ? /* @__PURE__ */ f("span", {
351
352
  className: "sr-only",
352
353
  "data-testid": "assistant-dictation-announced",
353
- children: S("voiceSession.listening", "Listening…")
354
+ children: b("voiceSession.listening", "Listening…")
354
355
  }) : null
355
356
  ]
356
357
  }),
357
- /* @__PURE__ */ m("p", {
358
- id: ee,
358
+ /* @__PURE__ */ f("p", {
359
+ id: te,
359
360
  hidden: !0,
360
361
  "data-testid": "assistant-composer-hint",
361
362
  children: n
362
363
  }),
363
- /* @__PURE__ */ h("div", {
364
- onDragEnter: Kt,
365
- onDragLeave: qt,
366
- onDragOver: Jt,
367
- onDrop: Yt,
368
- className: `flex flex-col rounded-3xl border transition-colors ${r && W.phase === "listening" ? "border-status-warning-bg ring-1 ring-status-warning-bg" : "focus-within:border-[var(--color-focus-ring)] focus-within:ring-1 focus-within:ring-[var(--color-focus-ring)]"} ${qe ? "bg-bg-surface" : "bg-bg-elevated"} ${r && W.phase !== "transcribing" ? "" : A ? "border-dashed border-[var(--color-focus-ring)]" : "border-[var(--color-text-muted)]"}`,
364
+ /* @__PURE__ */ p("div", {
365
+ onDragEnter: Jt,
366
+ onDragLeave: Yt,
367
+ onDragOver: Xt,
368
+ onDrop: Zt,
369
+ className: `flex flex-col rounded-3xl border transition-colors ${r && W.phase === "listening" ? "border-status-warning-bg ring-1 ring-status-warning-bg" : "focus-within:border-[var(--color-focus-ring)] focus-within:ring-1 focus-within:ring-[var(--color-focus-ring)]"} ${Ze ? "bg-bg-surface" : "bg-bg-elevated"} ${r && W.phase !== "transcribing" ? "" : O ? "border-dashed border-[var(--color-focus-ring)]" : "border-[var(--color-text-muted)]"} ${de(x, {
370
+ hearing: r && W.phase === "listening",
371
+ quiet: Pe || Ze || O,
372
+ entrance: Ue
373
+ })}`,
369
374
  "data-dictating": r ? W.phase : void 0,
370
375
  "data-testid": "assistant-composer",
371
376
  "data-presentation": "compact",
372
377
  children: [
373
- /* @__PURE__ */ m("div", {
378
+ /* @__PURE__ */ f("div", {
374
379
  className: "px-3 pt-3 empty:hidden",
375
- children: /* @__PURE__ */ h(Ee, { children: [/* @__PURE__ */ m(ae, {
376
- disabled: j,
380
+ children: /* @__PURE__ */ p(ke, { children: [/* @__PURE__ */ f(oe, {
381
+ disabled: k,
377
382
  showSuggestions: K.length === 0,
378
- onSuggest: Pt
379
- }), /* @__PURE__ */ m(ie, {
383
+ onSuggest: It
384
+ }), /* @__PURE__ */ f(ae, {
380
385
  attachments: R,
381
- onRemove: ft,
382
- onRetry: pt,
383
- disabled: T || j,
384
- preparingCount: lt
386
+ onRemove: mt,
387
+ onRetry: ht,
388
+ disabled: C || k,
389
+ preparingCount: dt
385
390
  })] })
386
391
  }),
387
- /* @__PURE__ */ m("textarea", {
388
- ref: Ye,
389
- value: O,
390
- onChange: (e) => Vt(e.target.value),
391
- onKeyDown: Wt,
392
- onPaste: Gt,
393
- disabled: T,
394
- readOnly: j,
395
- "aria-busy": j || void 0,
396
- placeholder: A ? S("composer.dropHere", "Drop files to attach") : Mt,
392
+ /* @__PURE__ */ f("textarea", {
393
+ ref: $e,
394
+ value: E,
395
+ onChange: (e) => Ut(e.target.value),
396
+ onKeyDown: Kt,
397
+ onPaste: qt,
398
+ disabled: C,
399
+ readOnly: k,
400
+ "aria-busy": k || void 0,
401
+ placeholder: O ? b("composer.dropHere", "Drop files to attach") : Pt,
397
402
  rows: 1,
398
403
  className: `scrollbar-slim scrollbar-box min-h-10 w-[calc(100%-0.375rem)] resize-none bg-transparent pb-1 pe-2.5 ps-4 pt-3 text-base leading-6 text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50${r ? " hidden" : ""}`,
399
- "aria-describedby": ee,
404
+ "aria-describedby": te,
400
405
  title: n,
401
- "aria-label": S("chatInput.ariaLabel", "Message input"),
406
+ "aria-label": b("chatInput.ariaLabel", "Message input"),
402
407
  "data-testid": "assistant-input"
403
408
  }),
404
- r ? /* @__PURE__ */ m(fe, {
409
+ r ? /* @__PURE__ */ f(me, {
405
410
  phase: W.phase,
406
411
  before: W.before,
407
412
  take: W.take,
408
413
  interim: W.interim,
409
414
  after: W.after
410
415
  }) : null,
411
- r ? W.phase === "transcribing" ? /* @__PURE__ */ m(de, {
416
+ r ? W.phase === "transcribing" ? /* @__PURE__ */ f(pe, {
412
417
  phase: W.phase,
413
418
  seconds: W.seconds,
414
419
  level: W.level,
415
420
  onCancel: W.cancel,
416
421
  onFinish: W.finish,
417
- focusRing: s
418
- }) : /* @__PURE__ */ m(t, {
422
+ focusRing: o
423
+ }) : /* @__PURE__ */ f(t, {
419
424
  onDismiss: W.cancel,
420
- children: /* @__PURE__ */ m("div", {
425
+ children: /* @__PURE__ */ f("div", {
421
426
  className: "contents",
422
- children: /* @__PURE__ */ m(de, {
427
+ children: /* @__PURE__ */ f(pe, {
423
428
  phase: W.phase,
424
429
  seconds: W.seconds,
425
430
  level: W.level,
426
431
  onCancel: W.cancel,
427
432
  onFinish: W.finish,
428
- focusRing: s
433
+ focusRing: o
429
434
  })
430
435
  })
431
- }) : /* @__PURE__ */ h("div", {
436
+ }) : /* @__PURE__ */ p("div", {
432
437
  className: "flex flex-nowrap items-center gap-1 px-1.5 pb-1.5 pt-1",
433
438
  "data-testid": "assistant-composer-controls",
434
439
  children: [
435
- /* @__PURE__ */ m(re, {
440
+ /* @__PURE__ */ f(ie, {
436
441
  onFiles: z,
437
- canAddMore: gt,
438
- disabled: T || j,
442
+ canAddMore: vt,
443
+ disabled: C || k,
439
444
  compact: !0,
440
445
  capMenuHeight: !0
441
446
  }),
442
- /* @__PURE__ */ m(ge, {
447
+ /* @__PURE__ */ f(ve, {
443
448
  chip: !0,
444
- readOnly: qe,
445
- mode: Ne,
446
- availableModes: _,
447
- onModeChange: Fe,
448
- auto: Ie,
449
- disabled: T || j,
450
- disabledReason: F === null ? y ? "replying" : We ?? "busy" : "busy"
449
+ readOnly: Ze,
450
+ mode: Ie,
451
+ availableModes: h,
452
+ onModeChange: Re,
453
+ auto: ze,
454
+ disabled: C || k,
455
+ disabledReason: N === null ? _ ? "replying" : Je ?? "busy" : "busy"
451
456
  }),
452
- C && i ? /* @__PURE__ */ m("span", {
457
+ x && i ? /* @__PURE__ */ f("span", {
453
458
  className: "ms-1 hidden min-w-0 truncate text-xs text-text-secondary sm:block",
454
459
  "data-testid": "assistant-mic-summary",
455
- children: S("dictation.noMicrophone", "No microphone available")
460
+ children: b("dictation.noMicrophone", "No microphone available")
456
461
  }) : null,
457
- /* @__PURE__ */ m("div", { className: "min-w-0 flex-1" }),
458
- U.isSupported && !x ? C ? /* @__PURE__ */ m(me, {
462
+ /* @__PURE__ */ f("div", { className: "min-w-0 flex-1" }),
463
+ U.isSupported && !y ? x ? /* @__PURE__ */ f(ge, {
459
464
  onDictate: W.start,
460
465
  blocked: i,
461
- disabled: T || j
462
- }) : /* @__PURE__ */ m(se, {
466
+ disabled: C || k
467
+ }) : /* @__PURE__ */ f(ce, {
463
468
  compact: !0,
464
469
  isListening: U.isListening,
465
470
  isStarting: U.isStarting,
466
471
  onToggle: W.start,
467
- disabled: T || j
472
+ disabled: C || k
468
473
  }) : null,
469
- Q ? /* @__PURE__ */ m("button", {
470
- ref: Bt,
474
+ Q ? /* @__PURE__ */ f("button", {
475
+ ref: Ht,
471
476
  type: "button",
472
- onClick: zt,
473
- className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover ${s} ${F === null ? "" : "cursor-default opacity-60"}`,
474
- "aria-label": F === null ? S("composer.stop", "Stop the reply") : S("composer.stopping", "Stopping the reply…"),
475
- title: F === null ? S("composer.stop", "Stop the reply") : S("composer.stopping", "Stopping the reply…"),
476
- "aria-disabled": F === null ? void 0 : "true",
477
- "aria-busy": F === null ? void 0 : "true",
477
+ onClick: Vt,
478
+ className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover ${o} ${N === null ? "" : "cursor-default opacity-60"}`,
479
+ "aria-label": N === null ? b("composer.stop", "Stop the reply") : b("composer.stopping", "Stopping the reply…"),
480
+ title: N === null ? b("composer.stop", "Stop the reply") : b("composer.stopping", "Stopping the reply…"),
481
+ "aria-disabled": N === null ? void 0 : "true",
482
+ "aria-busy": N === null ? void 0 : "true",
478
483
  "data-testid": "assistant-stop",
479
- children: F === null ? /* @__PURE__ */ m(Te, {
484
+ children: N === null ? /* @__PURE__ */ f(Oe, {
480
485
  className: "size-4 fill-current",
481
486
  "aria-hidden": "true"
482
- }) : /* @__PURE__ */ m(p, {
487
+ }) : /* @__PURE__ */ f(De, {
483
488
  className: "size-4 motion-safe:animate-spin",
484
489
  "aria-hidden": "true"
485
490
  })
486
- }) : e && !(C && i) ? /* @__PURE__ */ m(le, {
491
+ }) : e && !(x && i) ? /* @__PURE__ */ f(ue, {
487
492
  compact: !0,
488
- invisible: x,
489
- onStart: v,
490
- disabled: T || j
491
- }) : /* @__PURE__ */ m("button", {
493
+ invisible: y,
494
+ onStart: g,
495
+ disabled: C || k
496
+ }) : /* @__PURE__ */ f("button", {
492
497
  type: "button",
493
498
  onClick: () => {
494
- P(null), X();
499
+ M(null), X();
495
500
  },
496
501
  disabled: !J,
497
- className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full transition-colors ${s} ${J ? "bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover" : "bg-[var(--color-bg-disabled)] text-[var(--color-text-disabled)]"}`,
498
- "aria-label": S("chatInput.send", "Send message"),
502
+ className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full transition-colors ${o} ${J ? "bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover" : "bg-[var(--color-bg-disabled)] text-[var(--color-text-disabled)]"}`,
503
+ "aria-label": b("chatInput.send", "Send message"),
499
504
  "data-testid": "assistant-send",
500
- children: Ae || ct || j ? /* @__PURE__ */ m(p, {
505
+ children: Ne || ut || k ? /* @__PURE__ */ f(De, {
501
506
  className: "size-5 motion-safe:animate-spin",
502
507
  "aria-hidden": "true"
503
- }) : /* @__PURE__ */ m(we, {
508
+ }) : /* @__PURE__ */ f(Ee, {
504
509
  className: "size-5",
505
510
  "aria-hidden": "true"
506
511
  })
@@ -512,95 +517,95 @@ var ke = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
512
517
  ]
513
518
  }) });
514
519
  }
515
- return /* @__PURE__ */ h("div", {
520
+ return /* @__PURE__ */ p("div", {
516
521
  className: "flex-shrink-0 px-3 pb-3 pt-1.5",
517
522
  children: [
518
- /* @__PURE__ */ h("div", {
519
- onDragEnter: Kt,
520
- onDragLeave: qt,
521
- onDragOver: Jt,
522
- onDrop: Yt,
523
- className: `rounded-2xl border p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15 ${A ? "border-action-primary-bg border-dashed bg-action-primary-bg/5" : "border-border-default bg-bg-sunken"}`,
523
+ /* @__PURE__ */ p("div", {
524
+ onDragEnter: Jt,
525
+ onDragLeave: Yt,
526
+ onDragOver: Xt,
527
+ onDrop: Zt,
528
+ className: `rounded-2xl border p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15 ${O ? "border-action-primary-bg border-dashed bg-action-primary-bg/5" : "border-border-default bg-bg-sunken"}`,
524
529
  "data-testid": "assistant-composer",
525
530
  children: [
526
- /* @__PURE__ */ h(Ee, { children: [/* @__PURE__ */ m(ae, {
527
- disabled: j,
531
+ /* @__PURE__ */ p(ke, { children: [/* @__PURE__ */ f(oe, {
532
+ disabled: k,
528
533
  showSuggestions: K.length === 0,
529
- onSuggest: Pt
530
- }), /* @__PURE__ */ m(ie, {
534
+ onSuggest: It
535
+ }), /* @__PURE__ */ f(ae, {
531
536
  attachments: R,
532
- onRemove: ft,
533
- onRetry: pt,
534
- disabled: T || j,
535
- preparingCount: lt
537
+ onRemove: mt,
538
+ onRetry: ht,
539
+ disabled: C || k,
540
+ preparingCount: dt
536
541
  })] }),
537
- /* @__PURE__ */ h("div", {
542
+ /* @__PURE__ */ p("div", {
538
543
  className: "flex items-end gap-2",
539
544
  children: [
540
- /* @__PURE__ */ m(re, {
545
+ /* @__PURE__ */ f(ie, {
541
546
  onFiles: z,
542
- canAddMore: gt,
543
- disabled: T || j,
547
+ canAddMore: vt,
548
+ disabled: C || k,
544
549
  showLabel: !0
545
550
  }),
546
- /* @__PURE__ */ m("textarea", {
547
- ref: D,
548
- value: O,
549
- onChange: (e) => k(e.target.value),
550
- onKeyDown: Ut,
551
- onPaste: Gt,
552
- disabled: T,
553
- readOnly: j,
554
- "aria-busy": j || void 0,
555
- placeholder: A ? S("composer.dropHere", "Drop files to attach") : Mt,
551
+ /* @__PURE__ */ f("textarea", {
552
+ ref: T,
553
+ value: E,
554
+ onChange: (e) => D(e.target.value),
555
+ onKeyDown: Gt,
556
+ onPaste: qt,
557
+ disabled: C,
558
+ readOnly: k,
559
+ "aria-busy": k || void 0,
560
+ placeholder: O ? b("composer.dropHere", "Drop files to attach") : Pt,
556
561
  rows: 1,
557
562
  className: "min-h-[36px] flex-1 resize-none self-center bg-transparent px-1 py-2 text-[15px] leading-relaxed text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50",
558
- "aria-label": S("chatInput.ariaLabel", "Message input"),
563
+ "aria-label": b("chatInput.ariaLabel", "Message input"),
559
564
  "data-testid": "assistant-input"
560
565
  }),
561
- U.isSupported && /* @__PURE__ */ m(se, {
566
+ U.isSupported && /* @__PURE__ */ f(ce, {
562
567
  isListening: U.isListening,
563
568
  isStarting: U.isStarting,
564
569
  onToggle: U.toggle,
565
- disabled: T || j
570
+ disabled: C || k
566
571
  }),
567
- v && K.length === 0 && R.length === 0 && !U.isActive ? /* @__PURE__ */ m(le, {
568
- onStart: v,
569
- disabled: T || j
570
- }) : /* @__PURE__ */ m("button", {
572
+ g && K.length === 0 && R.length === 0 && !U.isActive ? /* @__PURE__ */ f(ue, {
573
+ onStart: g,
574
+ disabled: C || k
575
+ }) : /* @__PURE__ */ f("button", {
571
576
  type: "button",
572
577
  onClick: () => void X(),
573
578
  disabled: !J,
574
579
  className: `flex size-9 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${J ? "bg-action-primary-bg text-action-primary-text hover:scale-105 hover:bg-action-primary-bg-hover" : "bg-bg-elevated text-text-muted"}`,
575
- "aria-label": S("chatInput.send", "Send message"),
580
+ "aria-label": b("chatInput.send", "Send message"),
576
581
  "data-testid": "assistant-send",
577
- children: Ae || ct || j ? /* @__PURE__ */ m(p, { className: "size-4 motion-safe:animate-spin" }) : /* @__PURE__ */ m(we, { className: "size-4" })
582
+ children: Ne || ut || k ? /* @__PURE__ */ f(De, { className: "size-4 motion-safe:animate-spin" }) : /* @__PURE__ */ f(Ee, { className: "size-4" })
578
583
  })
579
584
  ]
580
585
  }),
581
- (_.length > 1 || _.some((e) => e.writeCapable)) && /* @__PURE__ */ m("div", {
586
+ (h.length > 1 || h.some((e) => e.writeCapable)) && /* @__PURE__ */ f("div", {
582
587
  className: "mt-2 px-0.5",
583
- children: /* @__PURE__ */ m(he, {
584
- mode: Ne,
585
- availableModes: _,
586
- onModeChange: Fe,
587
- disabled: T || j,
588
- auto: Ie
588
+ children: /* @__PURE__ */ f(_e, {
589
+ mode: Ie,
590
+ availableModes: h,
591
+ onModeChange: Re,
592
+ disabled: C || k,
593
+ auto: ze
589
594
  })
590
595
  })
591
596
  ]
592
597
  }),
593
- u ? /* @__PURE__ */ m("p", {
598
+ l ? /* @__PURE__ */ f("p", {
594
599
  className: "mt-1.5 px-1 text-center text-[11px] text-status-warning",
595
600
  "data-testid": "assistant-write-access-warning",
596
- children: S("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
601
+ children: b("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
597
602
  }) : null,
598
- /* @__PURE__ */ m("div", {
603
+ /* @__PURE__ */ f("div", {
599
604
  className: "mt-1.5 px-1 text-center text-[11px]",
600
605
  "aria-live": "polite",
601
- children: Zt(!1, !1)
606
+ children: $t(!1, !1)
602
607
  })
603
608
  ]
604
609
  });
605
610
  };
606
- export { g as AssistantComposer };
611
+ export { m as AssistantComposer };