@burdenoff/fe-libs 2026.1112.4 → 2026.1112.5

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.
Files changed (37) hide show
  1. package/dist/shared/assistant/api.d.ts +7 -0
  2. package/dist/shared/assistant/api.js +47 -45
  3. package/dist/shared/assistant/createSandboxAssistantTransport.js +2 -1
  4. package/dist/shared/assistant/gatewayClient.js +1 -0
  5. package/dist/shared/assistant/index.d.ts +4 -0
  6. package/dist/shared/assistant/keepAlive.d.ts +74 -0
  7. package/dist/shared/assistant/keepAlive.js +77 -0
  8. package/dist/shared/assistant/prewarm.d.ts +20 -0
  9. package/dist/shared/assistant/prewarm.js +25 -4
  10. package/dist/shared/assistant/runtime.d.ts +7 -2
  11. package/dist/shared/assistant/runtime.js +23 -22
  12. package/dist/shared/assistant/signInWarm.d.ts +60 -0
  13. package/dist/shared/assistant/signInWarm.js +111 -0
  14. package/dist/shared/assistant/snapshotPoller.d.ts +16 -0
  15. package/dist/shared/assistant/snapshotPoller.js +29 -22
  16. package/dist/shared/assistant/staleSession.d.ts +27 -0
  17. package/dist/shared/assistant/staleSession.js +15 -0
  18. package/dist/shared/assistant/turnProgress.d.ts +16 -0
  19. package/dist/shared/assistant/turnProgress.js +30 -4
  20. package/dist/shared/assistant/ui/AssistantChatArea.js +1286 -1271
  21. package/dist/shared/assistant/ui/AssistantOverlay.d.ts +7 -0
  22. package/dist/shared/assistant/ui/AssistantOverlay.js +256 -248
  23. package/dist/shared/assistant/usageReporting.d.ts +18 -0
  24. package/dist/shared/assistant/usageReporting.js +17 -5
  25. package/dist/shared/assistant/useAssistantHeartbeat.d.ts +24 -4
  26. package/dist/shared/assistant/useAssistantHeartbeat.js +43 -24
  27. package/dist/shared/assistant/useAssistantSignInWarm.d.ts +19 -0
  28. package/dist/shared/assistant/useAssistantSignInWarm.js +55 -0
  29. package/dist/shared/assistant/writeProposals.d.ts +9 -0
  30. package/dist/shared/components/assistantWidget/AssistantWidget.d.ts +7 -0
  31. package/dist/shared/components/assistantWidget/AssistantWidget.js +289 -285
  32. package/dist/shared/providers/shell/AuthTokenProvider.d.ts +6 -0
  33. package/dist/shared/providers/shell/AuthTokenProvider.js +4 -1
  34. package/dist/shared/providers/shell/index.d.ts +1 -1
  35. package/dist/shared-assistant.js +374 -370
  36. package/dist/shared-providers-shell.js +12 -12
  37. package/package.json +1 -1
@@ -3,45 +3,45 @@ import { isAssistantQuotaRefusal as t } from "../../assistant/quota.js";
3
3
  import { AssistantAiDisclaimer as n } from "../../assistant/ui/AssistantAiDisclaimer.js";
4
4
  import { useVoiceInput as r } from "./useVoiceInput.js";
5
5
  import { MessageContent as i } from "./MessageContent.js";
6
- import { ASSISTANT_WIDGET_LAUNCHER_BOTTOM_CLASS as ee, ASSISTANT_WIDGET_WINDOW_BOTTOM_CLASS as te, ASSISTANT_WIDGET_WINDOW_MAX_HEIGHT_CLASS as ne } from "./assistantWidgetPosition.js";
7
- import { useCallback as a, useEffect as o, useMemo as re, useRef as s, useState as c } from "react";
8
- import { Download as ie, FileArchive as ae, History as oe, Link2 as se, Loader2 as l, MessageCircle as ce, Mic as le, PanelLeftClose as ue, PanelLeftOpen as de, Paperclip as fe, Plus as pe, Send as me, Sparkles as he, Trash2 as ge, X as u } from "lucide-react";
9
- import { Fragment as _e, jsx as d, jsxs as f } from "react/jsx-runtime";
6
+ import { ASSISTANT_WIDGET_LAUNCHER_BOTTOM_CLASS as a, ASSISTANT_WIDGET_WINDOW_BOTTOM_CLASS as ee, ASSISTANT_WIDGET_WINDOW_MAX_HEIGHT_CLASS as te } from "./assistantWidgetPosition.js";
7
+ import { useCallback as o, useEffect as s, useMemo as ne, useRef as c, useState as l } from "react";
8
+ import { Download as re, FileArchive as ie, History as ae, Link2 as oe, Loader2 as u, MessageCircle as se, Mic as ce, PanelLeftClose as le, PanelLeftOpen as ue, Paperclip as de, Plus as fe, Send as pe, Sparkles as me, Trash2 as he, X as d } from "lucide-react";
9
+ import { Fragment as ge, jsx as f, jsxs as p } from "react/jsx-runtime";
10
10
  // src/shared/components/assistantWidget/AssistantWidget.tsx
11
- function ve(e) {
11
+ function _e(e) {
12
12
  return e instanceof Error && e.message && (t(e) || e.name === "AssistantSendRefusal") ? e.message : `Sorry, I couldn't complete that: ${e instanceof Error ? e.message : "Something went wrong. Please try again."}`;
13
13
  }
14
- var p = "bf:toggle-assistant-widget", m = "bf:assistant-widget:isOpen", h = "bf:assistant-widget:railOpen";
15
- function ye() {
14
+ var m = "bf:toggle-assistant-widget", h = "bf:assistant-widget:isOpen", g = "bf:assistant-widget:railOpen";
15
+ function ve() {
16
16
  if (typeof window > "u") return !0;
17
17
  try {
18
- return window.sessionStorage.getItem(h) !== "0";
18
+ return window.sessionStorage.getItem(g) !== "0";
19
19
  } catch {
20
20
  return !0;
21
21
  }
22
22
  }
23
- function be(e) {
23
+ function ye(e) {
24
24
  if (typeof window < "u") try {
25
- window.sessionStorage.setItem(h, e ? "1" : "0");
25
+ window.sessionStorage.setItem(g, e ? "1" : "0");
26
26
  } catch {}
27
27
  }
28
- function xe() {
28
+ function be() {
29
29
  if (typeof window > "u") return !1;
30
30
  try {
31
- return window.sessionStorage.getItem(m) === "1";
31
+ return window.sessionStorage.getItem(h) === "1";
32
32
  } catch {
33
33
  return !1;
34
34
  }
35
35
  }
36
- function g(e) {
36
+ function _(e) {
37
37
  if (typeof window < "u") try {
38
- window.sessionStorage.setItem(m, e ? "1" : "0");
38
+ window.sessionStorage.setItem(h, e ? "1" : "0");
39
39
  } catch {}
40
40
  }
41
- function Se() {
41
+ function xe() {
42
42
  return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
43
43
  }
44
- function Ce(e) {
44
+ function Se(e) {
45
45
  if (!Number.isFinite(e) || e <= 0) return "";
46
46
  let t = [
47
47
  "B",
@@ -52,168 +52,172 @@ function Ce(e) {
52
52
  for (; n >= 1024 && r < t.length - 1;) n /= 1024, r += 1;
53
53
  return `${n >= 10 || r === 0 ? Math.round(n) : n.toFixed(1)} ${t[r]}`;
54
54
  }
55
- var _ = ({ transport: t, modes: m, defaultModeId: h, title: _ = "AI Assistant", subtitle: we = "Ask me to do things on this screen — I can run them for you.", placeholder: Te = "Ask anything, or describe what to create…", launcherClassName: Ee, voiceLang: De = "en-US", layout: Oe = "floating", showSessionPanel: ke = !1, onNavigate: Ae, topOffsetPx: je = 0, enableAttachments: Me = !1, attachmentAccept: Ne = ".json,.csv,.xlsx,.xls,.pdf,application/json,text/csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf", enableConnectSource: Pe = !1, connectSourceHref: Fe = "/integrations/connections" }) => {
56
- let v = re(() => m && m.length > 0 ? m : [{
55
+ var v = ({ transport: t, modes: h, defaultModeId: g, title: v = "AI Assistant", subtitle: Ce = "Ask me to do things on this screen — I can run them for you.", placeholder: we = "Ask anything, or describe what to create…", launcherClassName: Te, voiceLang: Ee = "en-US", layout: De = "floating", showSessionPanel: Oe = !1, warmOnSignIn: ke = !0, onNavigate: Ae, topOffsetPx: je = 0, enableAttachments: y = !1, attachmentAccept: Me = ".json,.csv,.xlsx,.xls,.pdf,application/json,text/csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf", enableConnectSource: Ne = !1, connectSourceHref: Pe = "/integrations/connections" }) => {
56
+ let b = ne(() => h && h.length > 0 ? h : [{
57
57
  id: "__default__",
58
- label: _,
58
+ label: v,
59
59
  transport: t,
60
- title: _,
61
- subtitle: we,
62
- placeholder: Te
60
+ title: v,
61
+ subtitle: Ce,
62
+ placeholder: we
63
63
  }], [
64
- m,
64
+ h,
65
65
  t,
66
- _,
67
- we,
68
- Te
69
- ]), [y, Ie] = c(() => h ?? v[0]?.id ?? "__default__"), b = v.find((e) => e.id === y) ?? v[0], x = b.transport, Le = b.title ?? _, Re = b.subtitle ?? we, ze = b.placeholder ?? Te;
70
- o(() => {
71
- v.some((e) => e.id === y) || Ie(v[0]?.id ?? "__default__");
72
- }, [v, y]);
73
- let S = !!x;
74
- o(() => {
75
- S || console.error("[AssistantWidget] No transport available — supply `transport`, or a non-empty `modes` where each entry has a transport.");
76
- }, [S]);
77
- let [C, w] = c(() => xe()), [T, E] = c([]), [D, O] = c(""), [k, A] = c([]), [j, Be] = c(!1), [Ve, M] = c(!1), [He, N] = c([]), [P, F] = c(!1), [Ue, We] = c(!1), [Ge, Ke] = c(() => ye()), [qe, I] = c([]), [L, Je] = c(null), [Ye, R] = c(!1), z = s(null), B = s(null), V = s(null), H = s(null), U = s(!1), W = s(null), G = s(null), K = s(!1), Xe = s(null);
78
- o(() => {
79
- if (S) {
80
- if (C && !U.current) {
81
- H.current = document.activeElement instanceof HTMLElement && document.activeElement !== document.body ? document.activeElement : B.current;
82
- let e = z.current;
83
- (e && !e.disabled ? e : V.current)?.focus();
84
- } else !C && U.current && (H.current?.isConnected ? H.current : B.current)?.focus();
85
- U.current = C;
66
+ v,
67
+ Ce,
68
+ we
69
+ ]), [x, Fe] = l(() => g ?? b[0]?.id ?? "__default__"), S = b.find((e) => e.id === x) ?? b[0], C = S.transport, Ie = S.title ?? v, Le = S.subtitle ?? Ce, Re = S.placeholder ?? we;
70
+ s(() => {
71
+ b.some((e) => e.id === x) || Fe(b[0]?.id ?? "__default__");
72
+ }, [b, x]);
73
+ let w = !!C;
74
+ s(() => {
75
+ w || console.error("[AssistantWidget] No transport available — supply `transport`, or a non-empty `modes` where each entry has a transport.");
76
+ }, [w]);
77
+ let [T, E] = l(() => be()), [D, O] = l([]), [k, A] = l(""), [j, M] = l([]), [N, P] = l(!1), [ze, F] = l(!1), [I, L] = l([]), [R, z] = l(!1), [Be, Ve] = l(!1), [He, Ue] = l(() => ve()), [We, B] = l([]), [V, Ge] = l(null), [Ke, qe] = l(!1), H = c(null), Je = c(null), Ye = c(null), Xe = c(null), Ze = c(!1), U = c(null), W = c(null), G = c(!1), Qe = c(null);
78
+ s(() => {
79
+ if (w) {
80
+ if (T && !Ze.current) {
81
+ Xe.current = document.activeElement instanceof HTMLElement && document.activeElement !== document.body ? document.activeElement : Je.current;
82
+ let e = H.current;
83
+ (e && !e.disabled ? e : Ye.current)?.focus();
84
+ } else !T && Ze.current && (Xe.current?.isConnected ? Xe.current : Je.current)?.focus();
85
+ Ze.current = T;
86
86
  }
87
- }, [S, C]);
88
- let q = Oe === "sidebar", Ze = ke && !!x?.newSession, Qe = a(() => {
89
- Ke((e) => {
87
+ }, [w, T]);
88
+ let K = De === "sidebar", $e = Oe && !!C?.newSession, et = o(() => {
89
+ Ue((e) => {
90
90
  let t = !e;
91
- return be(t), t;
91
+ return ye(t), t;
92
92
  });
93
- }, []), J = r(De), $e = a(() => {
94
- g(!0), w(!0), x.prewarm?.("full");
95
- }, [x]), Y = a(() => {
96
- g(!1), w(!1), x.suspend?.();
97
- }, [x]), X = a(() => {
98
- w((e) => {
93
+ }, []);
94
+ s(() => {
95
+ ke && C?.prewarm?.("full");
96
+ }, [C, ke]);
97
+ let q = r(Ee), tt = o(() => {
98
+ _(!0), E(!0), C.prewarm?.("full");
99
+ }, [C]), J = o(() => {
100
+ _(!1), E(!1), C.suspend?.();
101
+ }, [C]), Y = o(() => {
102
+ E((e) => {
99
103
  let t = !e;
100
- return g(t), t ? x.prewarm?.("full") : x.suspend?.(), t;
104
+ return _(t), t ? C.prewarm?.("full") : C.suspend?.(), t;
101
105
  });
102
- }, [x]);
103
- o(() => {
106
+ }, [C]);
107
+ s(() => {
104
108
  let e = (e) => {
105
109
  let t = e.detail;
106
- t?.open === !0 ? $e() : t?.open === !1 ? Y() : X();
110
+ t?.open === !0 ? tt() : t?.open === !1 ? J() : Y();
107
111
  };
108
- return window.addEventListener(p, e), () => window.removeEventListener(p, e);
112
+ return window.addEventListener(m, e), () => window.removeEventListener(m, e);
109
113
  }, [
110
- $e,
111
- Y,
112
- X
113
- ]), o(() => {
114
- J.isListening && J.transcript && O(J.transcript);
115
- }, [J.transcript, J.isListening]);
116
- let Z = a(async () => {
117
- if (x.listArtifacts) try {
118
- I(await x.listArtifacts());
114
+ tt,
115
+ J,
116
+ Y
117
+ ]), s(() => {
118
+ q.isListening && q.transcript && A(q.transcript);
119
+ }, [q.transcript, q.isListening]);
120
+ let X = o(async () => {
121
+ if (C.listArtifacts) try {
122
+ B(await C.listArtifacts());
119
123
  } catch {
120
- I([]);
124
+ B([]);
121
125
  }
122
- }, [x]), et = s(y);
123
- o(() => {
124
- et.current !== y && (et.current = y, G.current?.abort(), G.current = null, Be(!1), E([]), O(""), N([]), F(!1), M(!1), I([]), K.current = !1);
125
- }, [y]), o(() => {
126
- if (!C || K.current) return;
127
- let e = x.loadHistory;
126
+ }, [C]), nt = c(x);
127
+ s(() => {
128
+ nt.current !== x && (nt.current = x, W.current?.abort(), W.current = null, P(!1), O([]), A(""), L([]), z(!1), F(!1), B([]), G.current = !1);
129
+ }, [x]), s(() => {
130
+ if (!T || G.current) return;
131
+ let e = C.loadHistory;
128
132
  if (!e) {
129
- K.current = !0;
133
+ G.current = !0;
130
134
  return;
131
135
  }
132
- K.current = !0;
136
+ G.current = !0;
133
137
  let t = !1;
134
- return M(!0), (async () => {
138
+ return F(!0), (async () => {
135
139
  try {
136
140
  let n = await e();
137
- !t && n.length > 0 && (E((e) => e.length === 0 ? n : e), Z());
141
+ !t && n.length > 0 && (O((e) => e.length === 0 ? n : e), X());
138
142
  } catch {} finally {
139
- t || M(!1);
143
+ t || F(!1);
140
144
  }
141
145
  })(), () => {
142
146
  t = !0;
143
147
  };
144
148
  }, [
149
+ T,
145
150
  C,
146
- x,
147
- Z
148
- ]), o(() => {
149
- C && W.current && (W.current.scrollTop = W.current.scrollHeight);
150
- }, [T, C]);
151
- let Q = a((e, t) => {
152
- E((n) => n.map((n) => n.id === e ? {
151
+ X
152
+ ]), s(() => {
153
+ T && U.current && (U.current.scrollTop = U.current.scrollHeight);
154
+ }, [D, T]);
155
+ let Z = o((e, t) => {
156
+ O((n) => n.map((n) => n.id === e ? {
153
157
  ...n,
154
158
  ...t
155
159
  } : n));
156
- }, []), $ = a(async () => {
157
- if (x.listSessions) {
158
- We(!0);
160
+ }, []), Q = o(async () => {
161
+ if (C.listSessions) {
162
+ Ve(!0);
159
163
  try {
160
- N(await x.listSessions());
164
+ L(await C.listSessions());
161
165
  } catch {
162
- N([]);
166
+ L([]);
163
167
  } finally {
164
- We(!1);
168
+ Ve(!1);
165
169
  }
166
170
  }
167
- }, [x]), tt = a(async (e) => {
168
- if (x.downloadArtifact && !L) {
169
- Je(e.path);
171
+ }, [C]), rt = o(async (e) => {
172
+ if (C.downloadArtifact && !V) {
173
+ Ge(e.path);
170
174
  try {
171
- await x.downloadArtifact(e);
175
+ await C.downloadArtifact(e);
172
176
  } catch {} finally {
173
- Je(null);
177
+ Ge(null);
174
178
  }
175
179
  }
176
- }, [x, L]), nt = a(async () => {
177
- x.newSession && !j && (E([]), O(""), F(!1), I([]), await x.newSession());
178
- }, [x, j]), rt = a(async (e, t) => {
179
- if (x.deleteSession && !j) {
180
- N((t) => t.filter((t) => t.id !== e)), t && (E([]), O(""));
180
+ }, [C, V]), it = o(async () => {
181
+ C.newSession && !N && (O([]), A(""), z(!1), B([]), await C.newSession());
182
+ }, [C, N]), at = o(async (e, t) => {
183
+ if (C.deleteSession && !N) {
184
+ L((t) => t.filter((t) => t.id !== e)), t && (O([]), A(""));
181
185
  try {
182
- await x.deleteSession(e);
186
+ await C.deleteSession(e);
183
187
  } finally {
184
- $();
188
+ Q();
185
189
  }
186
190
  }
187
191
  }, [
188
- x,
189
- j,
190
- $
191
- ]), it = a(() => {
192
- F((e) => (e || $(), !e));
193
- }, [$]), at = a(async (e) => {
194
- if (x.selectSession && !j) {
195
- M(!0);
192
+ C,
193
+ N,
194
+ Q
195
+ ]), ot = o(() => {
196
+ z((e) => (e || Q(), !e));
197
+ }, [Q]), st = o(async (e) => {
198
+ if (C.selectSession && !N) {
199
+ F(!0);
196
200
  try {
197
- E(await x.selectSession(e)), F(!1), $(), Z();
201
+ O(await C.selectSession(e)), z(!1), Q(), X();
198
202
  } catch {} finally {
199
- M(!1);
203
+ F(!1);
200
204
  }
201
205
  }
202
206
  }, [
203
- x,
204
- j,
205
- $,
206
- Z
207
- ]), ot = a(async () => {
208
- let e = D.trim(), t = k;
209
- if (!e && t.length === 0 || j) return;
210
- V.current?.contains(document.activeElement) && z.current?.focus(), J.isListening && J.stop(), J.reset(), O(""), A([]), z.current && (z.current.style.height = "auto");
207
+ C,
208
+ N,
209
+ Q,
210
+ X
211
+ ]), $ = o(async () => {
212
+ let e = k.trim(), t = j;
213
+ if (!e && t.length === 0 || N) return;
214
+ Ye.current?.contains(document.activeElement) && H.current?.focus(), q.isListening && q.stop(), q.reset(), A(""), M([]), H.current && (H.current.style.height = "auto");
211
215
  let n = t.length > 0 ? `📎 ${t.map((e) => e.name).join(", ")}` : "", r = {
212
- id: Se(),
216
+ id: xe(),
213
217
  role: "user",
214
218
  content: [e, n].filter(Boolean).join("\n")
215
- }, i = Se();
216
- E((e) => [
219
+ }, i = xe();
220
+ O((e) => [
217
221
  ...e,
218
222
  r,
219
223
  {
@@ -222,365 +226,365 @@ var _ = ({ transport: t, modes: m, defaultModeId: h, title: _ = "AI Assistant",
222
226
  content: "",
223
227
  pending: !0
224
228
  }
225
- ]), Be(!0);
226
- let ee = new AbortController();
227
- G.current = ee;
229
+ ]), P(!0);
230
+ let a = new AbortController();
231
+ W.current = a;
228
232
  try {
229
- let { text: n } = await x.sendPrompt({
233
+ let { text: n } = await C.sendPrompt({
230
234
  prompt: e,
231
235
  attachments: t.length > 0 ? t : void 0,
232
- signal: ee.signal,
233
- onProgress: (e) => Q(i, { content: e })
236
+ signal: a.signal,
237
+ onProgress: (e) => Z(i, { content: e })
234
238
  });
235
- Q(i, {
239
+ Z(i, {
236
240
  content: n,
237
241
  pending: !1
238
- }), Z();
242
+ }), X();
239
243
  } catch (e) {
240
- Q(i, {
241
- content: ve(e),
244
+ Z(i, {
245
+ content: _e(e),
242
246
  pending: !1,
243
247
  error: !0
244
248
  });
245
249
  } finally {
246
- Be(!1), G.current = null, P && $();
250
+ P(!1), W.current = null, R && Q();
247
251
  }
248
252
  }, [
249
- D,
250
253
  k,
251
254
  j,
255
+ N,
256
+ Z,
257
+ C,
258
+ q,
259
+ R,
252
260
  Q,
253
- x,
254
- J,
255
- P,
256
- $,
257
- Z
258
- ]), st = a((e) => {
259
- e.key === "Enter" && !e.shiftKey && (e.preventDefault(), ot());
260
- }, [ot]), ct = a(() => {
261
- let e = z.current;
261
+ X
262
+ ]), ct = o((e) => {
263
+ e.key === "Enter" && !e.shiftKey && (e.preventDefault(), $());
264
+ }, [$]), lt = o(() => {
265
+ let e = H.current;
262
266
  e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 120)}px`);
263
- }, []), lt = a(() => {
264
- J.isListening ? J.stop() : J.start();
265
- }, [J]), ut = re(() => /* @__PURE__ */ d("button", {
266
- ref: B,
267
+ }, []), ut = o(() => {
268
+ q.isListening ? q.stop() : q.start();
269
+ }, [q]), dt = ne(() => /* @__PURE__ */ f("button", {
270
+ ref: Je,
267
271
  type: "button",
268
- onClick: X,
269
- onMouseEnter: () => !C && x.prewarm?.("probe"),
270
- onFocus: () => !C && x.prewarm?.("probe"),
271
- "aria-label": C ? "Close AI assistant" : "Open AI assistant",
272
- "aria-expanded": C,
272
+ onClick: Y,
273
+ onMouseEnter: () => !T && C.prewarm?.("probe"),
274
+ onFocus: () => !T && C.prewarm?.("probe"),
275
+ "aria-label": T ? "Close AI assistant" : "Open AI assistant",
276
+ "aria-expanded": T,
273
277
  "data-testid": "assistant-widget-launcher",
274
- className: e("fixed end-6 z-[100] inline-flex size-14 items-center justify-center rounded-full", ee, "bg-action-primary-bg text-action-primary-text shadow-xl transition-transform duration-200", "hover:scale-105 hover:bg-action-primary-bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer", Ee),
275
- children: d(C ? u : he, { className: "size-6" })
278
+ className: e("fixed end-6 z-[100] inline-flex size-14 items-center justify-center rounded-full", a, "bg-action-primary-bg text-action-primary-text shadow-xl transition-transform duration-200", "hover:scale-105 hover:bg-action-primary-bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer", Te),
279
+ children: f(T ? d : me, { className: "size-6" })
276
280
  }), [
277
- C,
278
- X,
279
- Ee,
280
- x
281
+ T,
282
+ Y,
283
+ Te,
284
+ C
281
285
  ]);
282
- return S ? /* @__PURE__ */ f(_e, { children: [
283
- ut,
284
- C ? /* @__PURE__ */ f("div", {
285
- ref: V,
286
+ return w ? /* @__PURE__ */ p(ge, { children: [
287
+ dt,
288
+ T ? /* @__PURE__ */ p("div", {
289
+ ref: Ye,
286
290
  role: "dialog",
287
291
  tabIndex: -1,
288
- "aria-label": Le,
292
+ "aria-label": Ie,
289
293
  "data-testid": "assistant-widget-window",
290
- "data-layout": Oe,
294
+ "data-layout": De,
291
295
  onKeyDown: (e) => {
292
- e.key === "Escape" && !e.defaultPrevented && !Ye && (e.preventDefault(), e.stopPropagation(), Y());
296
+ e.key === "Escape" && !e.defaultPrevented && !Ke && (e.preventDefault(), e.stopPropagation(), J());
293
297
  },
294
- style: q ? {
298
+ style: K ? {
295
299
  top: je,
296
300
  height: `calc(100vh - ${String(je)}px)`
297
301
  } : void 0,
298
- className: e("fixed z-[100] flex overflow-hidden border-border-default bg-bg-surface shadow-2xl", q ? "bottom-0 end-0 w-full border-s sm:w-[480px] lg:w-[560px] animate-in slide-in-from-right duration-200" : e("flex-col rounded-xl border end-6 h-[560px] w-[calc(100vw-3rem)] sm:w-[400px] animate-in slide-in-from-bottom-2 fade-in duration-200", te, ne)),
299
- children: [q && Ze && Ge ? /* @__PURE__ */ f("aside", {
302
+ className: e("fixed z-[100] flex overflow-hidden border-border-default bg-bg-surface shadow-2xl", K ? "bottom-0 end-0 w-full border-s sm:w-[480px] lg:w-[560px] animate-in slide-in-from-right duration-200" : e("flex-col rounded-xl border end-6 h-[560px] w-[calc(100vw-3rem)] sm:w-[400px] animate-in slide-in-from-bottom-2 fade-in duration-200", ee, te)),
303
+ children: [K && $e && He ? /* @__PURE__ */ p("aside", {
300
304
  "data-testid": "assistant-session-panel",
301
305
  className: "flex w-[168px] shrink-0 flex-col gap-1 border-e border-border-subtle bg-bg-sunken p-2",
302
306
  children: [
303
- /* @__PURE__ */ f("button", {
307
+ /* @__PURE__ */ p("button", {
304
308
  type: "button",
305
- onClick: Qe,
309
+ onClick: et,
306
310
  "aria-label": "Hide chats",
307
311
  "aria-expanded": !0,
308
312
  title: "Hide chats",
309
313
  "data-testid": "assistant-rail-toggle",
310
314
  className: "mb-1 flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-secondary transition-colors hover:bg-bg-surface hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
311
- children: [/* @__PURE__ */ d(ue, { className: "size-4 shrink-0" }), "Hide chats"]
315
+ children: [/* @__PURE__ */ f(le, { className: "size-4 shrink-0" }), "Hide chats"]
312
316
  }),
313
- /* @__PURE__ */ f("button", {
317
+ /* @__PURE__ */ p("button", {
314
318
  type: "button",
315
- onClick: () => void nt(),
316
- disabled: j,
319
+ onClick: () => void it(),
320
+ disabled: N,
317
321
  "data-testid": "assistant-new-chat",
318
322
  className: "flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-primary transition-colors hover:bg-bg-surface disabled:opacity-50 cursor-pointer",
319
- children: [/* @__PURE__ */ d(pe, { className: "size-4 shrink-0" }), "New chat"]
323
+ children: [/* @__PURE__ */ f(fe, { className: "size-4 shrink-0" }), "New chat"]
320
324
  }),
321
- /* @__PURE__ */ f("button", {
325
+ /* @__PURE__ */ p("button", {
322
326
  type: "button",
323
- onClick: it,
324
- "aria-expanded": P,
327
+ onClick: ot,
328
+ "aria-expanded": R,
325
329
  "data-testid": "assistant-history-toggle",
326
330
  className: "flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-primary transition-colors hover:bg-bg-surface cursor-pointer",
327
- children: [/* @__PURE__ */ d(oe, { className: "size-4 shrink-0" }), "History"]
331
+ children: [/* @__PURE__ */ f(ae, { className: "size-4 shrink-0" }), "History"]
328
332
  }),
329
- P ? /* @__PURE__ */ d("div", {
333
+ R ? /* @__PURE__ */ f("div", {
330
334
  "data-testid": "assistant-history-list",
331
335
  className: "mt-1 flex-1 space-y-0.5 overflow-y-auto border-t border-border-subtle pt-2",
332
- children: Ue && He.length === 0 ? /* @__PURE__ */ f("p", {
336
+ children: Be && I.length === 0 ? /* @__PURE__ */ p("p", {
333
337
  className: "flex items-center gap-1.5 px-2 py-1 text-[11px] text-text-muted",
334
- children: [/* @__PURE__ */ d(l, { className: "size-3 animate-spin" }), "Loading…"]
335
- }) : He.length === 0 ? /* @__PURE__ */ d("p", {
338
+ children: [/* @__PURE__ */ f(u, { className: "size-3 animate-spin" }), "Loading…"]
339
+ }) : I.length === 0 ? /* @__PURE__ */ f("p", {
336
340
  className: "px-2 py-1 text-[11px] leading-relaxed text-text-muted",
337
341
  children: "No past chats yet."
338
- }) : He.map((t) => /* @__PURE__ */ f("div", {
342
+ }) : I.map((t) => /* @__PURE__ */ p("div", {
339
343
  "data-testid": "assistant-history-row",
340
344
  className: e("group flex items-center gap-1 rounded pe-1 transition-colors", t.active ? "bg-bg-surface" : "hover:bg-bg-surface"),
341
- children: [/* @__PURE__ */ d("button", {
345
+ children: [/* @__PURE__ */ f("button", {
342
346
  type: "button",
343
- onClick: () => void at(t.id),
347
+ onClick: () => void st(t.id),
344
348
  title: t.title,
345
349
  "data-testid": "assistant-history-item",
346
350
  className: e("min-w-0 flex-1 truncate rounded px-2 py-1.5 text-start text-[11px] leading-relaxed cursor-pointer", t.active ? "font-medium text-text-primary" : "text-text-secondary group-hover:text-text-primary"),
347
351
  children: t.title
348
- }), x.deleteSession ? /* @__PURE__ */ d("button", {
352
+ }), C.deleteSession ? /* @__PURE__ */ f("button", {
349
353
  type: "button",
350
- onClick: () => void rt(t.id, !!t.active),
351
- disabled: j,
354
+ onClick: () => void at(t.id, !!t.active),
355
+ disabled: N,
352
356
  "aria-label": `Delete chat: ${t.title}`,
353
357
  title: "Delete this chat",
354
358
  "data-testid": "assistant-delete-chat",
355
359
  className: "inline-flex size-6 shrink-0 items-center justify-center rounded text-text-muted opacity-0 transition-opacity hover:text-status-error-bg focus-visible:opacity-100 group-hover:opacity-100 disabled:opacity-30 cursor-pointer",
356
- children: /* @__PURE__ */ d(ge, { className: "size-3.5" })
360
+ children: /* @__PURE__ */ f(he, { className: "size-3.5" })
357
361
  }) : null]
358
362
  }, t.id))
359
363
  }) : null
360
364
  ]
361
- }) : null, /* @__PURE__ */ f("div", {
365
+ }) : null, /* @__PURE__ */ p("div", {
362
366
  className: "flex min-h-0 min-w-0 flex-1 flex-col",
363
367
  children: [
364
- /* @__PURE__ */ f("div", {
368
+ /* @__PURE__ */ p("div", {
365
369
  className: "flex shrink-0 items-center justify-between gap-2 border-b border-border-subtle bg-bg-surface px-4 py-3",
366
- children: [/* @__PURE__ */ f("div", {
370
+ children: [/* @__PURE__ */ p("div", {
367
371
  className: "flex min-w-0 items-center gap-2",
368
- children: [q && Ze && !Ge ? /* @__PURE__ */ f("button", {
372
+ children: [K && $e && !He ? /* @__PURE__ */ p("button", {
369
373
  type: "button",
370
- onClick: Qe,
374
+ onClick: et,
371
375
  "aria-label": "Show chats",
372
376
  "aria-expanded": !1,
373
377
  title: "Show chats",
374
378
  "data-testid": "assistant-rail-toggle",
375
379
  className: "inline-flex shrink-0 items-center gap-1.5 rounded-md border border-border-subtle px-2 py-1.5 text-xs font-medium text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
376
- children: [/* @__PURE__ */ d(de, { className: "size-4" }), "Chats"]
377
- }) : /* @__PURE__ */ d("span", {
380
+ children: [/* @__PURE__ */ f(ue, { className: "size-4" }), "Chats"]
381
+ }) : /* @__PURE__ */ f("span", {
378
382
  className: "inline-flex size-7 shrink-0 items-center justify-center rounded-full bg-action-primary-bg/10 text-action-primary-bg",
379
- children: /* @__PURE__ */ d(he, { className: "size-4" })
380
- }), /* @__PURE__ */ d("h2", {
383
+ children: /* @__PURE__ */ f(me, { className: "size-4" })
384
+ }), /* @__PURE__ */ f("h2", {
381
385
  className: "truncate text-sm font-semibold text-text-primary",
382
- children: Le
386
+ children: Ie
383
387
  })]
384
- }), /* @__PURE__ */ d("button", {
388
+ }), /* @__PURE__ */ f("button", {
385
389
  type: "button",
386
- onClick: Y,
390
+ onClick: J,
387
391
  "aria-label": "Close AI assistant",
388
392
  "data-testid": "assistant-widget-close",
389
393
  className: "inline-flex size-8 shrink-0 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
390
- children: /* @__PURE__ */ d(u, { className: "size-4" })
394
+ children: /* @__PURE__ */ f(d, { className: "size-4" })
391
395
  })]
392
396
  }),
393
- v.length > 1 ? /* @__PURE__ */ d("div", {
397
+ b.length > 1 ? /* @__PURE__ */ f("div", {
394
398
  role: "tablist",
395
399
  "aria-label": "Assistant mode",
396
400
  "data-testid": "assistant-mode-switcher",
397
401
  className: "flex shrink-0 items-center gap-1 border-b border-border-subtle bg-bg-surface px-3 py-2",
398
- children: v.map((t) => {
399
- let n = t.id === y;
400
- return /* @__PURE__ */ d("button", {
402
+ children: b.map((t) => {
403
+ let n = t.id === x;
404
+ return /* @__PURE__ */ f("button", {
401
405
  type: "button",
402
406
  role: "tab",
403
407
  "aria-selected": n,
404
408
  tabIndex: n ? 0 : -1,
405
- onClick: () => Ie(t.id),
406
- disabled: j,
407
- title: j ? "Finish the current turn before switching" : t.label,
409
+ onClick: () => Fe(t.id),
410
+ disabled: N,
411
+ title: N ? "Finish the current turn before switching" : t.label,
408
412
  "data-testid": `assistant-mode-${t.id}`,
409
413
  className: e("rounded-md px-2.5 py-1 text-xs font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer", n ? "bg-action-primary-bg text-action-primary-text" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
410
414
  children: t.label
411
415
  }, t.id);
412
416
  })
413
417
  }) : null,
414
- /* @__PURE__ */ d("div", {
415
- ref: W,
418
+ /* @__PURE__ */ f("div", {
419
+ ref: U,
416
420
  className: "min-h-0 flex-1 space-y-3 overflow-y-auto px-4 py-4",
417
421
  "data-testid": "assistant-widget-messages",
418
- children: T.length === 0 && Ve ? /* @__PURE__ */ f("div", {
422
+ children: D.length === 0 && ze ? /* @__PURE__ */ p("div", {
419
423
  "data-testid": "assistant-widget-restoring",
420
424
  className: "flex h-full flex-col items-center justify-center gap-3 text-center",
421
- children: [/* @__PURE__ */ d(l, { className: "size-5 animate-spin text-text-secondary" }), /* @__PURE__ */ d("p", {
425
+ children: [/* @__PURE__ */ f(u, { className: "size-5 animate-spin text-text-secondary" }), /* @__PURE__ */ f("p", {
422
426
  className: "text-xs leading-relaxed text-text-secondary",
423
427
  children: "Restoring your conversation…"
424
428
  })]
425
- }) : T.length === 0 ? /* @__PURE__ */ f("div", {
429
+ }) : D.length === 0 ? /* @__PURE__ */ p("div", {
426
430
  className: "flex h-full flex-col items-center justify-center gap-3 text-center",
427
- children: [/* @__PURE__ */ d("span", {
431
+ children: [/* @__PURE__ */ f("span", {
428
432
  className: "inline-flex size-12 items-center justify-center rounded-full bg-bg-sunken text-action-primary-bg",
429
- children: /* @__PURE__ */ d(ce, { className: "size-6" })
430
- }), /* @__PURE__ */ d("p", {
433
+ children: /* @__PURE__ */ f(se, { className: "size-6" })
434
+ }), /* @__PURE__ */ f("p", {
431
435
  className: "max-w-[16rem] text-xs leading-relaxed text-text-secondary",
432
- children: Re
436
+ children: Le
433
437
  })]
434
- }) : T.map((t) => /* @__PURE__ */ d("div", {
438
+ }) : D.map((t) => /* @__PURE__ */ f("div", {
435
439
  className: e("flex", t.role === "user" ? "justify-end" : "justify-start"),
436
- children: /* @__PURE__ */ f("div", {
440
+ children: /* @__PURE__ */ p("div", {
437
441
  "data-testid": `assistant-widget-message-${t.role}`,
438
- className: e("whitespace-pre-wrap break-words rounded-lg px-3 py-2 text-xs leading-relaxed", q ? "max-w-[92%]" : "max-w-[85%]", t.role === "user" ? "bg-action-primary-bg text-action-primary-text" : t.error ? "bg-status-error-bg/10 text-status-error-bg" : "bg-bg-sunken text-text-primary"),
439
- children: [t.content ? /* @__PURE__ */ d(i, {
442
+ className: e("whitespace-pre-wrap break-words rounded-lg px-3 py-2 text-xs leading-relaxed", K ? "max-w-[92%]" : "max-w-[85%]", t.role === "user" ? "bg-action-primary-bg text-action-primary-text" : t.error ? "bg-status-error-bg/10 text-status-error-bg" : "bg-bg-sunken text-text-primary"),
443
+ children: [t.content ? /* @__PURE__ */ f(i, {
440
444
  content: t.content,
441
445
  onNavigate: Ae,
442
446
  allowBlocks: t.role === "assistant" && !t.error,
443
447
  streaming: t.pending === !0
444
- }) : null, t.pending ? /* @__PURE__ */ f("span", {
448
+ }) : null, t.pending ? /* @__PURE__ */ p("span", {
445
449
  "data-testid": "assistant-widget-working",
446
450
  className: e("inline-flex items-center gap-1 text-text-secondary", t.content ? "mt-1" : ""),
447
- children: [/* @__PURE__ */ d(l, { className: "size-3 animate-spin" }), t.content ? null : /* @__PURE__ */ d("span", { children: "Working on it…" })]
451
+ children: [/* @__PURE__ */ f(u, { className: "size-3 animate-spin" }), t.content ? null : /* @__PURE__ */ f("span", { children: "Working on it…" })]
448
452
  }) : null]
449
453
  })
450
454
  }, t.id))
451
455
  }),
452
- x.downloadArtifact && qe.length > 0 ? /* @__PURE__ */ d("div", {
456
+ C.downloadArtifact && We.length > 0 ? /* @__PURE__ */ f("div", {
453
457
  "data-testid": "assistant-widget-artifacts",
454
458
  className: "flex shrink-0 flex-wrap gap-1.5 border-t border-border-subtle bg-bg-sunken px-3 py-2",
455
- children: qe.map((e) => {
456
- let t = L === e.path;
457
- return /* @__PURE__ */ f("button", {
459
+ children: We.map((e) => {
460
+ let t = V === e.path;
461
+ return /* @__PURE__ */ p("button", {
458
462
  type: "button",
459
- onClick: () => void tt(e),
460
- disabled: !!L,
461
- title: `Download ${e.name}${e.size ? ` (${Ce(e.size)})` : ""}`,
463
+ onClick: () => void rt(e),
464
+ disabled: !!V,
465
+ title: `Download ${e.name}${e.size ? ` (${Se(e.size)})` : ""}`,
462
466
  "data-testid": "assistant-widget-artifact",
463
467
  className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border-default bg-bg-surface px-2 py-1 text-[11px] font-medium text-text-primary transition-colors hover:bg-bg-sunken focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:opacity-50 cursor-pointer",
464
- children: [t ? /* @__PURE__ */ d(l, { className: "size-3.5 shrink-0 animate-spin" }) : e.type === "directory" ? /* @__PURE__ */ d(ae, { className: "size-3.5 shrink-0 text-action-primary-bg" }) : /* @__PURE__ */ d(ie, { className: "size-3.5 shrink-0 text-action-primary-bg" }), /* @__PURE__ */ d("span", {
468
+ children: [t ? /* @__PURE__ */ f(u, { className: "size-3.5 shrink-0 animate-spin" }) : e.type === "directory" ? /* @__PURE__ */ f(ie, { className: "size-3.5 shrink-0 text-action-primary-bg" }) : /* @__PURE__ */ f(re, { className: "size-3.5 shrink-0 text-action-primary-bg" }), /* @__PURE__ */ f("span", {
465
469
  className: "truncate",
466
470
  children: e.name
467
471
  })]
468
472
  }, e.path);
469
473
  })
470
474
  }) : null,
471
- Me && k.length > 0 ? /* @__PURE__ */ d("div", {
475
+ y && j.length > 0 ? /* @__PURE__ */ f("div", {
472
476
  className: "flex flex-wrap gap-1.5 border-t border-border-default bg-bg-surface px-3 pt-2",
473
- children: k.map((e, t) => /* @__PURE__ */ f("span", {
477
+ children: j.map((e, t) => /* @__PURE__ */ p("span", {
474
478
  "data-testid": "assistant-widget-attachment",
475
479
  className: "flex items-center gap-1 rounded-md bg-bg-sunken px-2 py-1 text-[11px] text-text-secondary",
476
480
  children: [
477
- /* @__PURE__ */ d(fe, { className: "size-3" }),
478
- /* @__PURE__ */ d("span", {
481
+ /* @__PURE__ */ f(de, { className: "size-3" }),
482
+ /* @__PURE__ */ f("span", {
479
483
  className: "max-w-[140px] truncate",
480
484
  children: e.name
481
485
  }),
482
- /* @__PURE__ */ d("button", {
486
+ /* @__PURE__ */ f("button", {
483
487
  type: "button",
484
- onClick: () => A((e) => e.filter((e, n) => n !== t)),
488
+ onClick: () => M((e) => e.filter((e, n) => n !== t)),
485
489
  "aria-label": `Remove ${e.name}`,
486
490
  className: "text-text-muted hover:text-text-primary cursor-pointer",
487
- children: /* @__PURE__ */ d(u, { className: "size-3" })
491
+ children: /* @__PURE__ */ f(d, { className: "size-3" })
488
492
  })
489
493
  ]
490
494
  }, `${e.name}-${t}`))
491
495
  }) : null,
492
- /* @__PURE__ */ f("div", {
493
- className: e("flex shrink-0 items-end gap-2 bg-bg-surface px-3 py-2.5", Me && k.length > 0 ? "" : "border-t border-border-default"),
496
+ /* @__PURE__ */ p("div", {
497
+ className: e("flex shrink-0 items-end gap-2 bg-bg-surface px-3 py-2.5", y && j.length > 0 ? "" : "border-t border-border-default"),
494
498
  children: [
495
- Me ? /* @__PURE__ */ f(_e, { children: [/* @__PURE__ */ d("input", {
496
- ref: Xe,
499
+ y ? /* @__PURE__ */ p(ge, { children: [/* @__PURE__ */ f("input", {
500
+ ref: Qe,
497
501
  type: "file",
498
- accept: Ne,
502
+ accept: Me,
499
503
  multiple: !0,
500
504
  className: "hidden",
501
505
  onChange: (e) => {
502
506
  let t = Array.from(e.target.files ?? []);
503
- t.length > 0 && A((e) => [...e, ...t]), e.target.value = "";
507
+ t.length > 0 && M((e) => [...e, ...t]), e.target.value = "";
504
508
  }
505
- }), /* @__PURE__ */ d("button", {
509
+ }), /* @__PURE__ */ f("button", {
506
510
  type: "button",
507
- onClick: () => Xe.current?.click(),
511
+ onClick: () => Qe.current?.click(),
508
512
  "aria-label": "Attach a data file",
509
513
  "data-testid": "assistant-widget-upload",
510
514
  className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary transition-colors hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
511
- children: /* @__PURE__ */ d(fe, { className: "size-4" })
515
+ children: /* @__PURE__ */ f(de, { className: "size-4" })
512
516
  })] }) : null,
513
- Pe ? /* @__PURE__ */ d("button", {
517
+ Ne ? /* @__PURE__ */ f("button", {
514
518
  type: "button",
515
- onClick: () => R(!0),
519
+ onClick: () => qe(!0),
516
520
  "aria-label": "Connect a data source",
517
521
  title: "Connect a source (REST API / connection)",
518
522
  "data-testid": "assistant-widget-connect-source",
519
523
  className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary transition-colors hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
520
- children: /* @__PURE__ */ d(se, { className: "size-4" })
524
+ children: /* @__PURE__ */ f(oe, { className: "size-4" })
521
525
  }) : null,
522
- J.isSupported ? /* @__PURE__ */ d("button", {
526
+ q.isSupported ? /* @__PURE__ */ f("button", {
523
527
  type: "button",
524
- onClick: lt,
525
- "aria-label": J.isListening ? "Stop voice input" : "Start voice input",
526
- "aria-pressed": J.isListening,
528
+ onClick: ut,
529
+ "aria-label": q.isListening ? "Stop voice input" : "Start voice input",
530
+ "aria-pressed": q.isListening,
527
531
  "data-testid": "assistant-widget-mic",
528
- className: e("flex size-9 shrink-0 items-center justify-center rounded-lg transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer", J.isListening ? "animate-pulse bg-status-error-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary hover:text-text-primary"),
529
- children: /* @__PURE__ */ d(le, { className: "size-4" })
532
+ className: e("flex size-9 shrink-0 items-center justify-center rounded-lg transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer", q.isListening ? "animate-pulse bg-status-error-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary hover:text-text-primary"),
533
+ children: /* @__PURE__ */ f(ce, { className: "size-4" })
530
534
  }) : null,
531
- /* @__PURE__ */ d("textarea", {
532
- ref: z,
533
- value: D,
534
- onChange: (e) => O(e.target.value),
535
- onKeyDown: st,
536
- onInput: ct,
535
+ /* @__PURE__ */ f("textarea", {
536
+ ref: H,
537
+ value: k,
538
+ onChange: (e) => A(e.target.value),
539
+ onKeyDown: ct,
540
+ onInput: lt,
537
541
  rows: 1,
538
- placeholder: ze,
542
+ placeholder: Re,
539
543
  "aria-label": "Message the assistant",
540
544
  "data-testid": "assistant-widget-input",
541
545
  className: "flex-1 resize-none rounded-lg border border-border-default bg-bg-sunken px-3 py-2 text-xs leading-relaxed text-text-primary placeholder:text-text-muted focus:border-action-primary-bg focus:outline-none"
542
546
  }),
543
- /* @__PURE__ */ d("button", {
547
+ /* @__PURE__ */ f("button", {
544
548
  type: "button",
545
- onClick: () => void ot(),
546
- disabled: j || D.trim().length === 0 && k.length === 0,
549
+ onClick: () => void $(),
550
+ disabled: N || k.trim().length === 0 && j.length === 0,
547
551
  "aria-label": "Send message",
548
552
  "data-testid": "assistant-widget-send",
549
553
  className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:opacity-50 cursor-pointer",
550
- children: j ? /* @__PURE__ */ d(l, { className: "size-4 animate-spin" }) : /* @__PURE__ */ d(me, { className: "size-4" })
554
+ children: N ? /* @__PURE__ */ f(u, { className: "size-4 animate-spin" }) : /* @__PURE__ */ f(pe, { className: "size-4" })
551
555
  })
552
556
  ]
553
557
  }),
554
- /* @__PURE__ */ d(n, { className: "shrink-0 bg-bg-surface px-3 pb-2 pt-1" })
558
+ /* @__PURE__ */ f(n, { className: "shrink-0 bg-bg-surface px-3 pb-2 pt-1" })
555
559
  ]
556
560
  })]
557
561
  }) : null,
558
- Ye ? /* @__PURE__ */ d("div", {
562
+ Ke ? /* @__PURE__ */ f("div", {
559
563
  role: "dialog",
560
564
  "aria-modal": "true",
561
565
  "aria-label": "Connect a source",
562
566
  "data-testid": "assistant-connect-source-modal",
563
567
  className: "fixed inset-0 z-[110] flex items-center justify-center bg-black/50 p-4 animate-in fade-in duration-150",
564
- onClick: () => R(!1),
565
- children: /* @__PURE__ */ f("div", {
568
+ onClick: () => qe(!1),
569
+ children: /* @__PURE__ */ p("div", {
566
570
  className: "flex h-[80vh] max-h-[720px] w-full max-w-4xl flex-col overflow-hidden rounded-xl border border-border-default bg-bg-surface shadow-2xl animate-in zoom-in-95 duration-150",
567
571
  onClick: (e) => e.stopPropagation(),
568
- children: [/* @__PURE__ */ f("div", {
572
+ children: [/* @__PURE__ */ p("div", {
569
573
  className: "flex shrink-0 items-center justify-between border-b border-border-subtle px-4 py-3",
570
- children: [/* @__PURE__ */ f("div", {
574
+ children: [/* @__PURE__ */ p("div", {
571
575
  className: "flex items-center gap-2 text-sm font-medium text-text-primary",
572
- children: [/* @__PURE__ */ d(se, { className: "size-4 shrink-0" }), "Connect a source"]
573
- }), /* @__PURE__ */ d("button", {
576
+ children: [/* @__PURE__ */ f(oe, { className: "size-4 shrink-0" }), "Connect a source"]
577
+ }), /* @__PURE__ */ f("button", {
574
578
  type: "button",
575
- onClick: () => R(!1),
579
+ onClick: () => qe(!1),
576
580
  "aria-label": "Close",
577
581
  title: "Close",
578
582
  "data-testid": "assistant-connect-source-close",
579
583
  className: "flex size-8 items-center justify-center rounded-lg text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
580
- children: /* @__PURE__ */ d(u, { className: "size-4" })
584
+ children: /* @__PURE__ */ f(d, { className: "size-4" })
581
585
  })]
582
- }), /* @__PURE__ */ d("iframe", {
583
- src: Fe,
586
+ }), /* @__PURE__ */ f("iframe", {
587
+ src: Pe,
584
588
  title: "Connected Systems",
585
589
  "data-testid": "assistant-connect-source-frame",
586
590
  className: "min-h-0 w-full flex-1 border-0 bg-bg-surface"
@@ -589,4 +593,4 @@ var _ = ({ transport: t, modes: m, defaultModeId: h, title: _ = "AI Assistant",
589
593
  }) : null
590
594
  ] }) : null;
591
595
  };
592
- export { p as ASSISTANT_WIDGET_TOGGLE_EVENT, _ as AssistantWidget, ve as assistantWidgetFailureText };
596
+ export { m as ASSISTANT_WIDGET_TOGGLE_EVENT, v as AssistantWidget, _e as assistantWidgetFailureText };