@burdenoff/fe-libs 2026.1030.4 → 2026.1030.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.
@@ -2,436 +2,436 @@ import { quotaExhaustedEventName as e } from "../quota.js";
2
2
  import { useAssistantTr as t } from "../i18n.js";
3
3
  import { assistantPanelOwnsEscape as n } from "./panelOverlays.js";
4
4
  import { AssistantPreviewBridgeHost as r } from "../preview/bridgeHost.js";
5
- import { ASSISTANT_COMPACT_DOCKED_DEFAULT_QUERY as i, ASSISTANT_DOCK_WIDTH_VAR as a, ASSISTANT_OVERLAY_DESKTOP_QUERY as o, ASSISTANT_OVERLAY_TOP_VAR as s, ASSISTANT_PANEL_INSET_VAR as c, ASSISTANT_SHEET_BOTTOM_VAR as l, ASSISTANT_WINDOW_BOTTOM_VAR as u, assistantCompactLauncherVisibility as d, assistantCompactOverlayClassName as f, assistantCompactOverlayKeys as p, assistantLauncherBottom as ee, assistantLauncherRight as m, assistantOverlayClassName as te, assistantOverlayEscapeAction as ne, assistantOverlayKeys as re, assistantQuotaKindOf as h, assistantWindowBottom as g, closestAround as ie, createAssistantNavigate as ae, isAssistantSurface as oe, isAssistantToggleShortcut as se, nextAssistantOpenState as _, publishedAssistantDockWidth as v, publishedAssistantPanelInset as ce, publishedCompactDockWidth as le, publishedCompactPanelInset as y, readAssistantLayoutChoice as ue, readAssistantLegacyDockChoice as de, readAssistantOverlayFlag as b, readAssistantWindowView as x, requestedAssistantOpenState as S, resolveCompactDocked as fe, writeAssistantLayoutChoice as C, writeAssistantOverlayFlag as w, writeAssistantWindowView as pe } from "./assistantOverlayState.js";
6
- import { useAssistantServerHistory as T } from "../history/useAssistantServerHistory.js";
7
- import { AssistantCloseGuardContext as E } from "./closeGuard.js";
8
- import { AIAssistantPanel as D } from "./AIAssistantPanel.js";
5
+ import { ASSISTANT_COMPACT_DOCKED_DEFAULT_QUERY as i, ASSISTANT_DOCK_WIDTH_VAR as a, ASSISTANT_OVERLAY_DESKTOP_QUERY as o, ASSISTANT_OVERLAY_TOP_VAR as s, ASSISTANT_PANEL_INSET_VAR as c, ASSISTANT_SHEET_BOTTOM_VAR as l, ASSISTANT_WINDOW_BOTTOM_VAR as u, assistantCompactLauncherBottom as d, assistantCompactLauncherVisibility as f, assistantCompactOverlayClassName as ee, assistantCompactOverlayKeys as p, assistantLauncherBottom as m, assistantLauncherRight as te, assistantOverlayClassName as ne, assistantOverlayEscapeAction as h, assistantOverlayKeys as re, assistantQuotaKindOf as g, assistantWindowBottom as ie, closestAround as ae, createAssistantNavigate as _, isAssistantSurface as v, isAssistantToggleShortcut as oe, nextAssistantOpenState as y, publishedAssistantDockWidth as b, publishedAssistantPanelInset as se, publishedCompactDockWidth as ce, publishedCompactPanelInset as x, readAssistantLayoutChoice as le, readAssistantLegacyDockChoice as ue, readAssistantOverlayFlag as S, readAssistantWindowView as C, requestedAssistantOpenState as w, resolveCompactDocked as de, writeAssistantLayoutChoice as T, writeAssistantOverlayFlag as E, writeAssistantWindowView as fe } from "./assistantOverlayState.js";
6
+ import { useAssistantServerHistory as D } from "../history/useAssistantServerHistory.js";
7
+ import { AssistantCloseGuardContext as pe } from "./closeGuard.js";
8
+ import { AIAssistantPanel as O } from "./AIAssistantPanel.js";
9
9
  import { useAssistantVisualViewport as me } from "./useAssistantVisualViewport.js";
10
- import { createContext as O, useCallback as k, useContext as A, useEffect as j, useMemo as M, useRef as N, useState as P, useSyncExternalStore as F } from "react";
11
- import { Sparkles as he } from "lucide-react";
12
- import { jsx as I, jsxs as L } from "react/jsx-runtime";
10
+ import { createContext as k, useCallback as A, useContext as j, useEffect as M, useMemo as N, useRef as P, useState as F, useSyncExternalStore as I } from "react";
11
+ import { Sparkles as L } from "lucide-react";
12
+ import { jsx as R, jsxs as z } from "react/jsx-runtime";
13
13
  //#region src/shared/assistant/ui/AssistantOverlay.tsx
14
- var R = O(null);
15
- function z() {
16
- return A(R);
14
+ var B = k(null);
15
+ function V() {
16
+ return j(B);
17
17
  }
18
- function B() {
19
- return A(R)?.dockWidthPx ?? 0;
18
+ function H() {
19
+ return j(B)?.dockWidthPx ?? 0;
20
20
  }
21
- function V() {
22
- return A(R)?.panelInsetPx ?? 0;
21
+ function U() {
22
+ return j(B)?.panelInsetPx ?? 0;
23
23
  }
24
- var H = () => typeof window > "u" ? void 0 : window.sessionStorage, U = () => typeof window > "u" ? void 0 : window.localStorage;
25
- function W(e) {
24
+ var W = () => typeof window > "u" ? void 0 : window.sessionStorage, G = () => typeof window > "u" ? void 0 : window.localStorage;
25
+ function K(e) {
26
26
  if (typeof window > "u" || typeof window.matchMedia != "function") return () => {};
27
27
  let t = window.matchMedia(o);
28
28
  return t.addEventListener("change", e), () => t.removeEventListener("change", e);
29
29
  }
30
- function G() {
30
+ function q() {
31
31
  return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(min-width: 640px)").matches;
32
32
  }
33
- function ge() {
34
- return F(W, G, () => !1);
33
+ function he() {
34
+ return I(K, q, () => !1);
35
35
  }
36
- function K(t, n) {
37
- let r = N(n);
38
- j(() => {
36
+ function J(t, n) {
37
+ let r = P(n);
38
+ M(() => {
39
39
  r.current = n;
40
- }, [n]), j(() => {
40
+ }, [n]), M(() => {
41
41
  if (!t || typeof window > "u") return;
42
- let n = e(t), i = (e) => r.current(h(e), e);
42
+ let n = e(t), i = (e) => r.current(g(e), e);
43
43
  return window.addEventListener(n, i), () => window.removeEventListener(n, i);
44
44
  }, [t]);
45
45
  }
46
- var _e = () => {};
47
- function q(e) {
46
+ var ge = () => {};
47
+ function Y(e) {
48
48
  if (typeof window > "u" || typeof window.matchMedia != "function") return () => {};
49
49
  let t = window.matchMedia(i);
50
50
  return t.addEventListener("change", e), () => t.removeEventListener("change", e);
51
51
  }
52
- function J() {
52
+ function X() {
53
53
  return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(i).matches;
54
54
  }
55
- var Y = () => () => {}, X = () => !1;
56
- function ve(e) {
57
- return F(e ? q : Y, e ? J : X, X);
55
+ var Z = () => () => {}, Q = () => !1;
56
+ function _e(e) {
57
+ return I(e ? Y : Z, e ? X : Q, Q);
58
58
  }
59
- function Z({ keyPrefix: e, quota: t, presentation: n = "classic", children: r }) {
60
- let i = M(() => re(e), [e]), o = M(() => p(e), [e]), s = n === "compact", l = N(s);
61
- j(() => {
59
+ function ve({ keyPrefix: e, quota: t, presentation: n = "classic", children: r }) {
60
+ let i = N(() => re(e), [e]), o = N(() => p(e), [e]), s = n === "compact", l = P(s);
61
+ M(() => {
62
62
  l.current = s;
63
63
  }, [s]);
64
- let [u, d] = P(() => b(H, i.openStorageKey)), [f, ee] = P(() => b(U, i.dockStorageKey)), [m, te] = P(() => {
64
+ let [u, d] = F(() => S(W, i.openStorageKey)), [f, ee] = F(() => S(G, i.dockStorageKey)), [m, te] = F(() => {
65
65
  if (!s) return "panel";
66
66
  try {
67
- let e = H()?.getItem(o.surfaceStorageKey);
68
- return oe(e) ? e : "panel";
67
+ let e = W()?.getItem(o.surfaceStorageKey);
68
+ return v(e) ? e : "panel";
69
69
  } catch {
70
70
  return "panel";
71
71
  }
72
- }), [ne, h] = P(() => s && b(H, o.minimizedStorageKey)), g = s && u && m === "window" && ne, [ie, ae] = P(!1), T = s && u && m === "panel" && ie, [E, D] = P(() => s ? x(U, o.windowViewStorageKey) : null), me = k((e) => {
73
- l.current && D(e);
74
- }, []), [O] = P(() => s ? {
75
- explicit: ue(U, o.layoutStorageKey),
76
- legacy: de(U, i.dockStorageKey)
72
+ }), [ne, h] = F(() => s && S(W, o.minimizedStorageKey)), g = s && u && m === "window" && ne, [ie, ae] = F(!1), _ = s && u && m === "panel" && ie, [D, pe] = F(() => s ? C(G, o.windowViewStorageKey) : null), O = A((e) => {
73
+ l.current && pe(e);
74
+ }, []), [me] = F(() => s ? {
75
+ explicit: le(G, o.layoutStorageKey),
76
+ legacy: ue(G, i.dockStorageKey)
77
77
  } : {
78
78
  explicit: null,
79
79
  legacy: null
80
- }), [A, F] = P(null), he = ve(s), L = s ? fe({
81
- explicit: A ?? O.explicit,
82
- legacy: O.legacy,
83
- wideViewport: he
84
- }) : f, z = N(L);
85
- j(() => {
80
+ }), [k, j] = F(null), I = _e(s), L = s ? de({
81
+ explicit: k ?? me.explicit,
82
+ legacy: me.legacy,
83
+ wideViewport: I
84
+ }) : f, z = P(L);
85
+ M(() => {
86
86
  z.current = L;
87
87
  }, [L]);
88
- let B = N(null), V = N(u);
89
- j(() => {
90
- V.current = u;
88
+ let V = P(null), H = P(u);
89
+ M(() => {
90
+ H.current = u;
91
91
  }, [u]);
92
- let W = N(!1), G = u && (!s || m === "panel" && !g);
93
- j(() => {
94
- W.current = G;
95
- }, [G]);
96
- let q = k(() => {
97
- let e = B.current?.() === !0;
92
+ let U = P(!1), K = u && (!s || m === "panel" && !g);
93
+ M(() => {
94
+ U.current = K;
95
+ }, [K]);
96
+ let q = A(() => {
97
+ let e = V.current?.() === !0;
98
98
  return e && l.current && h(!1), e;
99
- }, []), J = k((e) => (B.current = e, () => {
100
- B.current === e && (B.current = null);
101
- }), []), Y = k(() => {
99
+ }, []), Y = A((e) => (V.current = e, () => {
100
+ V.current === e && (V.current = null);
101
+ }), []), X = A(() => {
102
102
  d(!0), te("panel"), h(!1);
103
- }, []), X = k(() => {
103
+ }, []), Z = A(() => {
104
104
  d(!1), h(!1), ae(!1);
105
- }, []), Z = k(() => {
106
- l.current ? Y() : d(!0);
107
- }, [Y]), ye = k(() => {
108
- q() || (l.current ? X() : d(!1));
109
- }, [q, X]), be = k(() => {
105
+ }, []), Q = A(() => {
106
+ l.current ? X() : d(!0);
107
+ }, [X]), ve = A(() => {
108
+ q() || (l.current ? Z() : d(!1));
109
+ }, [q, Z]), ye = A(() => {
110
110
  if (l.current) {
111
- if (W.current) {
111
+ if (U.current) {
112
112
  if (q()) return;
113
- X();
114
- } else Y();
113
+ Z();
114
+ } else X();
115
115
  return;
116
116
  }
117
- V.current && q() || d((e) => !e);
117
+ H.current && q() || d((e) => !e);
118
118
  }, [
119
119
  q,
120
- X,
121
- Y
122
- ]), xe = k(() => {
120
+ Z,
121
+ X
122
+ ]), be = A(() => {
123
123
  if (l.current) {
124
124
  let e = z.current ? "floating" : "docked";
125
- z.current = e === "docked", F(e);
125
+ z.current = e === "docked", j(e);
126
126
  return;
127
127
  }
128
128
  ee((e) => !e);
129
- }, []), Se = Z, Ce = k(() => {
129
+ }, []), xe = Q, Se = A(() => {
130
130
  if (!l.current) {
131
131
  d(!0);
132
132
  return;
133
133
  }
134
- W.current || (d(!0), te("window"), h(!1));
135
- }, []), we = k(() => {
136
- !l.current || !V.current || W.current || h(!0);
134
+ U.current || (d(!0), te("window"), h(!1));
135
+ }, []), Ce = A(() => {
136
+ !l.current || !H.current || U.current || h(!0);
137
137
  }, []);
138
- j(() => {
139
- w(H, i.openStorageKey, u);
140
- }, [i.openStorageKey, u]), j(() => {
141
- s || w(U, i.dockStorageKey, f);
138
+ M(() => {
139
+ E(W, i.openStorageKey, u);
140
+ }, [i.openStorageKey, u]), M(() => {
141
+ s || E(G, i.dockStorageKey, f);
142
142
  }, [
143
143
  s,
144
144
  i.dockStorageKey,
145
145
  f
146
- ]), j(() => {
147
- !s || A === null || C(U, o.layoutStorageKey, A);
146
+ ]), M(() => {
147
+ !s || k === null || T(G, o.layoutStorageKey, k);
148
148
  }, [
149
149
  s,
150
150
  o.layoutStorageKey,
151
- A
152
- ]), j(() => {
153
- !s || E === null || pe(U, o.windowViewStorageKey, E);
151
+ k
152
+ ]), M(() => {
153
+ !s || D === null || fe(G, o.windowViewStorageKey, D);
154
154
  }, [
155
155
  s,
156
156
  o.windowViewStorageKey,
157
- E
158
- ]), j(() => {
157
+ D
158
+ ]), M(() => {
159
159
  if (s) try {
160
- H()?.setItem(o.surfaceStorageKey, m);
160
+ W()?.setItem(o.surfaceStorageKey, m);
161
161
  } catch {}
162
162
  }, [
163
163
  s,
164
164
  o.surfaceStorageKey,
165
165
  m
166
- ]), j(() => {
167
- s && w(H, o.minimizedStorageKey, g);
166
+ ]), M(() => {
167
+ s && E(W, o.minimizedStorageKey, g);
168
168
  }, [
169
169
  s,
170
170
  o.minimizedStorageKey,
171
171
  g
172
- ]), j(() => {
172
+ ]), M(() => {
173
173
  if (typeof window > "u") return;
174
174
  let e = (e) => {
175
- let t = S(e);
175
+ let t = w(e);
176
176
  if (l.current) {
177
- t === !0 ? Y() : t === !1 ? V.current && !q() && X() : W.current ? q() || X() : Y();
177
+ t === !0 ? X() : t === !1 ? H.current && !q() && Z() : U.current ? q() || Z() : X();
178
178
  return;
179
179
  }
180
- V.current && !_(!0, t) && B.current?.() === !0 || d((e) => _(e, t));
180
+ H.current && !y(!0, t) && V.current?.() === !0 || d((e) => y(e, t));
181
181
  };
182
182
  return window.addEventListener(i.toggleEvent, e), () => window.removeEventListener(i.toggleEvent, e);
183
183
  }, [
184
184
  i.toggleEvent,
185
- Y,
186
185
  X,
186
+ Z,
187
187
  q
188
- ]), j(() => {
188
+ ]), M(() => {
189
189
  if (typeof document > "u") return;
190
190
  let e = (e) => {
191
- if (se(e)) {
191
+ if (oe(e)) {
192
192
  if (e.preventDefault(), l.current) {
193
- W.current ? q() || X() : Y();
193
+ U.current ? q() || Z() : X();
194
194
  return;
195
195
  }
196
- V.current && B.current?.() === !0 || d((e) => !e);
196
+ H.current && V.current?.() === !0 || d((e) => !e);
197
197
  }
198
198
  };
199
199
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
200
200
  }, [
201
- Y,
202
201
  X,
202
+ Z,
203
203
  q
204
- ]), K(t?.product ?? null, t?.onExhausted ?? _e);
205
- let Q = ge(), $ = s ? le({
204
+ ]), J(t?.product ?? null, t?.onExhausted ?? ge);
205
+ let we = he(), Te = s ? ce({
206
206
  isOpen: u,
207
207
  docked: L,
208
- isDesktop: Q,
208
+ isDesktop: we,
209
209
  surface: m,
210
- expanded: T
211
- }) : v({
210
+ expanded: _
211
+ }) : b({
212
212
  isOpen: u,
213
213
  docked: f,
214
- isDesktop: Q
215
- }), Te = s ? y({
214
+ isDesktop: we
215
+ }), $ = s ? x({
216
216
  isOpen: u,
217
217
  docked: L,
218
- isDesktop: Q,
218
+ isDesktop: we,
219
219
  surface: m,
220
- expanded: T
221
- }) : ce({
220
+ expanded: _
221
+ }) : se({
222
222
  isOpen: u,
223
223
  docked: f,
224
- isDesktop: Q
224
+ isDesktop: we
225
225
  });
226
- j(() => {
226
+ M(() => {
227
227
  if (typeof document > "u") return;
228
228
  let e = document.documentElement.style;
229
- return e.setProperty(a, `${$}px`), () => {
229
+ return e.setProperty(a, `${Te}px`), () => {
230
230
  e.removeProperty(a);
231
231
  };
232
- }, [$]), j(() => {
232
+ }, [Te]), M(() => {
233
233
  if (typeof document > "u") return;
234
234
  let e = document.documentElement.style;
235
- return e.setProperty(c, `${Te}px`), () => {
235
+ return e.setProperty(c, `${$}px`), () => {
236
236
  e.removeProperty(c);
237
237
  };
238
- }, [Te]);
239
- let Ee = M(() => ({
238
+ }, [$]);
239
+ let Ee = N(() => ({
240
240
  isOpen: u,
241
- open: Z,
242
- close: ye,
243
- toggle: be,
241
+ open: Q,
242
+ close: ve,
243
+ toggle: ye,
244
244
  docked: L,
245
- toggleDock: xe,
246
- dockWidthPx: $,
247
- panelInsetPx: Te,
245
+ toggleDock: be,
246
+ dockWidthPx: Te,
247
+ panelInsetPx: $,
248
248
  keys: i,
249
- registerCloseGuard: J,
249
+ registerCloseGuard: Y,
250
250
  presentation: n,
251
251
  surface: m,
252
252
  minimized: g,
253
- fullOpen: G,
254
- openFull: Se,
255
- openWindow: Ce,
256
- minimize: we,
257
- expanded: T,
253
+ fullOpen: K,
254
+ openFull: xe,
255
+ openWindow: Se,
256
+ minimize: Ce,
257
+ expanded: _,
258
258
  setExpanded: ae,
259
- windowView: s ? E : null,
260
- setWindowView: me
259
+ windowView: s ? D : null,
260
+ setWindowView: O
261
261
  }), [
262
262
  u,
263
- Z,
263
+ Q,
264
+ ve,
264
265
  ye,
265
- be,
266
266
  L,
267
- xe,
268
- $,
267
+ be,
269
268
  Te,
269
+ $,
270
270
  i,
271
- J,
271
+ Y,
272
272
  n,
273
273
  m,
274
274
  g,
275
- G,
275
+ K,
276
+ xe,
276
277
  Se,
277
278
  Ce,
278
- we,
279
- T,
279
+ _,
280
280
  s,
281
- E,
282
- me
281
+ D,
282
+ O
283
283
  ]);
284
- return /* @__PURE__ */ I(R.Provider, {
284
+ return /* @__PURE__ */ R(B.Provider, {
285
285
  value: Ee,
286
286
  children: r
287
287
  });
288
288
  }
289
- var ye = (e, t) => /* @__PURE__ */ I(D, {
289
+ var ye = (e, t) => /* @__PURE__ */ R(O, {
290
290
  ...e,
291
291
  ...t
292
292
  });
293
293
  function be(e) {
294
- let t = z();
295
- return t ? /* @__PURE__ */ I(xe, {
294
+ let t = V();
295
+ return t ? /* @__PURE__ */ R(xe, {
296
296
  state: t,
297
297
  ...e
298
298
  }) : null;
299
299
  }
300
- function xe({ state: e, panelId: i = "ai-assistant", panelProps: a, renderPanel: o, navigate: c, isShellLessTarget: p, topOffsetPx: re = 56, launcherIcon: h, launcherBottomInset: oe = "1.5rem", showLauncher: se = !0, closeOnEscape: _ = !0 }) {
301
- let { isOpen: v, close: ce, toggle: le, docked: y, toggleDock: ue, dockWidthPx: de } = e, b = e.presentation === "compact", { surface: x, minimized: S, setExpanded: fe } = e, C = t();
302
- T(a?.serverHistory === !0);
303
- let [w, pe] = P(!1), D = N(null), O = N(null), A = ge(), [F, R] = P(0), [z, B] = P(0);
304
- j(() => {
305
- F !== 0 && D.current?.querySelector("[data-testid=\"assistant-input\"]")?.focus({ preventScroll: !0 });
306
- }, [F]), j(() => {
307
- z !== 0 && D.current?.querySelector("[data-testid=\"assistant-window-view-chat\"]")?.focus({ preventScroll: !0 });
308
- }, [z]), me(D, b && v && !S && !A);
309
- let V = N(a?.onExpandedChange);
310
- j(() => {
311
- V.current = a?.onExpandedChange;
300
+ function xe({ state: e, panelId: i = "ai-assistant", panelProps: a, renderPanel: o, navigate: c, isShellLessTarget: p, topOffsetPx: re = 56, launcherIcon: g, launcherBottomInset: v = "1.5rem", showLauncher: oe = !0, closeOnEscape: y = !0 }) {
301
+ let { isOpen: b, close: se, toggle: ce, docked: x, toggleDock: le, dockWidthPx: ue } = e, S = e.presentation === "compact", { surface: C, minimized: w, setExpanded: de } = e, T = t();
302
+ D(a?.serverHistory === !0);
303
+ let [E, fe] = F(!1), O = P(null), k = P(null), j = he(), [I, B] = F(0), [V, H] = F(0);
304
+ M(() => {
305
+ I !== 0 && O.current?.querySelector("[data-testid=\"assistant-input\"]")?.focus({ preventScroll: !0 });
306
+ }, [I]), M(() => {
307
+ V !== 0 && O.current?.querySelector("[data-testid=\"assistant-window-view-chat\"]")?.focus({ preventScroll: !0 });
308
+ }, [V]), me(O, S && b && !w && !j);
309
+ let U = P(a?.onExpandedChange);
310
+ M(() => {
311
+ U.current = a?.onExpandedChange;
312
312
  });
313
- let H = k((e) => {
314
- fe(e), V.current?.(e);
315
- }, [fe]), U = M(() => c ? ae({
313
+ let W = A((e) => {
314
+ de(e), U.current?.(e);
315
+ }, [de]), G = N(() => c ? _({
316
316
  navigate: c,
317
317
  isShellLessTarget: p,
318
- isDesktop: G,
319
- collapseSheet: () => pe(!1),
318
+ isDesktop: q,
319
+ collapseSheet: () => fe(!1),
320
320
  openInNewTab: (e) => window.open(e, "_blank", "noopener,noreferrer")
321
- }) : void 0, [c, p]), W = b && x === "window" ? e.minimize : ce;
322
- j(() => {
323
- if (!v || !_ || S) return;
321
+ }) : void 0, [c, p]), K = S && C === "window" ? e.minimize : se;
322
+ M(() => {
323
+ if (!b || !y || w) return;
324
324
  let e = (e) => {
325
- ne({
325
+ h({
326
326
  key: e.key,
327
- isOpen: v,
327
+ isOpen: b,
328
328
  alreadyHandled: e.defaultPrevented,
329
329
  dialogOpen: document.querySelector("[role=\"dialog\"],[role=\"alertdialog\"],dialog[open]") !== null,
330
- pressedInsideDialog: ie(e.target, "[role=\"dialog\"],[role=\"alertdialog\"],dialog[open]") !== null,
330
+ pressedInsideDialog: ae(e.target, "[role=\"dialog\"],[role=\"alertdialog\"],dialog[open]") !== null,
331
331
  panelOwnsEscape: n()
332
- }) === "close" && (e.preventDefault(), W());
332
+ }) === "close" && (e.preventDefault(), K());
333
333
  };
334
334
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
335
335
  }, [
336
- v,
337
- S,
338
- W,
339
- _
336
+ b,
337
+ w,
338
+ K,
339
+ y
340
340
  ]);
341
- let K = N(S);
342
- j(() => {
343
- if (b && S && !K.current) {
341
+ let J = P(w);
342
+ M(() => {
343
+ if (S && w && !J.current) {
344
344
  let e = document.activeElement;
345
- (!e || e === document.body || D.current?.contains(e)) && O.current?.focus({ preventScroll: !0 });
345
+ (!e || e === document.body || O.current?.contains(e)) && k.current?.focus({ preventScroll: !0 });
346
346
  }
347
- K.current = S;
348
- }, [b, S]);
349
- let _e = {
347
+ J.current = w;
348
+ }, [S, w]);
349
+ let ge = {
350
350
  panelId: i,
351
- visible: !S,
352
- onClose: ce,
353
- docked: y,
354
- onToggleDock: ue,
355
- onNavigate: U,
351
+ visible: !w,
352
+ onClose: se,
353
+ docked: x,
354
+ onToggleDock: le,
355
+ onNavigate: G,
356
356
  isShellLessTarget: p,
357
- ...b ? {
357
+ ...S ? {
358
358
  presentation: "compact",
359
- surface: x,
359
+ surface: C,
360
360
  onOpenFull: e.openFull,
361
361
  onMinimize: e.minimize,
362
- onExpandedChange: H,
362
+ onExpandedChange: W,
363
363
  windowView: e.windowView,
364
364
  onWindowViewChange: e.setWindowView
365
365
  } : {}
366
- }, q = b ? C("overlay.launcherQuick", "Open quick assistant") : C("overlay.launcher", "AI Assistant"), J = {
366
+ }, Y = S ? T("overlay.launcherQuick", "Open quick assistant") : T("overlay.launcher", "AI Assistant"), X = {
367
367
  [s]: `${re}px`,
368
368
  [l]: "var(--mobile-tabbar-height, 0px)"
369
- }, Y = {
370
- ...J,
371
- [u]: g(oe)
372
- }, X = b ? d({
373
- isOpen: v,
374
- surface: x,
375
- minimized: S
376
- }) : v ? "desktop-only" : "always", ve = (t) => {
377
- !b || e.fullOpen ? le() : v && !S ? e.minimize() : (e.openWindow(), A || t.detail === 0 ? R((e) => e + 1) : B((e) => e + 1));
369
+ }, Z = {
370
+ ...X,
371
+ [u]: ie(v)
372
+ }, Q = S ? f({
373
+ isOpen: b,
374
+ surface: C,
375
+ minimized: w
376
+ }) : b ? "desktop-only" : "always", _e = (t) => {
377
+ !S || e.fullOpen ? ce() : b && !w ? e.minimize() : (e.openWindow(), j || t.detail === 0 ? B((e) => e + 1) : H((e) => e + 1));
378
378
  };
379
- return /* @__PURE__ */ L(r, {
379
+ return /* @__PURE__ */ z(r, {
380
380
  preview: a?.preview,
381
- children: [v && /* @__PURE__ */ L("div", {
382
- ref: D,
383
- className: b ? f({
384
- surface: x,
385
- minimized: S,
386
- docked: y,
381
+ children: [b && /* @__PURE__ */ z("div", {
382
+ ref: O,
383
+ className: S ? ee({
384
+ surface: C,
385
+ minimized: w,
386
+ docked: x,
387
387
  expanded: e.expanded,
388
- sheetExpanded: w
389
- }) : te({
390
- expanded: w,
391
- docked: y
388
+ sheetExpanded: E
389
+ }) : ne({
390
+ expanded: E,
391
+ docked: x
392
392
  }),
393
- style: b ? Y : J,
393
+ style: S ? Z : X,
394
394
  "data-testid": "assistant-overlay",
395
- ...b ? {
395
+ ...S ? {
396
396
  id: i,
397
- "data-surface": x,
398
- ...S ? {
397
+ "data-surface": C,
398
+ ...w ? {
399
399
  hidden: !0,
400
400
  inert: !0,
401
401
  "data-minimized": ""
402
402
  } : {}
403
403
  } : {},
404
- children: [/* @__PURE__ */ I("button", {
404
+ children: [/* @__PURE__ */ R("button", {
405
405
  type: "button",
406
- onClick: () => pe((e) => !e),
406
+ onClick: () => fe((e) => !e),
407
407
  className: "flex w-full shrink-0 justify-center pt-2 pb-1 sm:hidden",
408
- "aria-label": w ? C("sheet.collapse", "Shrink the assistant") : C("sheet.expand", "Expand the assistant"),
409
- "aria-expanded": w,
408
+ "aria-label": E ? T("sheet.collapse", "Shrink the assistant") : T("sheet.expand", "Expand the assistant"),
409
+ "aria-expanded": E,
410
410
  "data-testid": "assistant-sheet-handle",
411
- children: /* @__PURE__ */ I("span", { className: "h-1.5 w-10 rounded-full bg-border-strong" })
412
- }), /* @__PURE__ */ I("div", {
411
+ children: /* @__PURE__ */ R("span", { className: "h-1.5 w-10 rounded-full bg-border-strong" })
412
+ }), /* @__PURE__ */ R("div", {
413
413
  className: "flex min-h-0 flex-1 flex-col",
414
- children: /* @__PURE__ */ I(E.Provider, {
414
+ children: /* @__PURE__ */ R(pe.Provider, {
415
415
  value: e.registerCloseGuard ?? null,
416
- children: o ? o(_e) : ye(a, _e)
416
+ children: o ? o(ge) : ye(a, ge)
417
417
  })
418
418
  })]
419
- }), se && /* @__PURE__ */ I("button", {
420
- ref: O,
419
+ }), oe && /* @__PURE__ */ R("button", {
420
+ ref: k,
421
421
  type: "button",
422
- onClick: ve,
423
- title: b ? q : C("overlay.launcherTitle", "AI Assistant ({{shortcut}})", { shortcut: "Ctrl+Shift+A" }),
424
- "aria-label": q,
425
- "aria-haspopup": b ? void 0 : "dialog",
426
- "aria-expanded": b ? v && !S : v,
427
- ...b && v ? { "aria-controls": i } : {},
422
+ onClick: _e,
423
+ title: S ? Y : T("overlay.launcherTitle", "AI Assistant ({{shortcut}})", { shortcut: "Ctrl+Shift+A" }),
424
+ "aria-label": Y,
425
+ "aria-haspopup": S ? void 0 : "dialog",
426
+ "aria-expanded": S ? b && !w : b,
427
+ ...S && b ? { "aria-controls": i } : {},
428
428
  "data-testid": "assistant-fab",
429
429
  style: {
430
- bottom: ee(oe),
431
- right: m(de)
430
+ bottom: S ? d(v) : m(v),
431
+ right: te(ue)
432
432
  },
433
- className: "fixed z-30 size-14 items-center justify-center rounded-full border border-border-strong bg-[var(--color-accent-soft)] text-action-primary-bg shadow-float transition-colors duration-200 hover:border-action-primary-bg focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] cursor-pointer " + (X === "hidden" ? "hidden" : X === "desktop-only" ? "hidden sm:inline-flex" : "inline-flex"),
434
- children: h ?? /* @__PURE__ */ I(he, {
433
+ className: "fixed z-30 size-14 items-center justify-center rounded-full border border-border-strong bg-[var(--color-accent-soft)] text-action-primary-bg shadow-float transition-colors duration-200 hover:border-action-primary-bg focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] cursor-pointer " + (Q === "hidden" ? "hidden" : Q === "desktop-only" ? "hidden sm:inline-flex" : "inline-flex") + (S ? " max-[480px]:[--assistant-consent-clearance:var(--bf-consent-banner-offset,0px)]" : ""),
434
+ children: g ?? /* @__PURE__ */ R(L, {
435
435
  className: "size-6",
436
436
  "aria-hidden": "true"
437
437
  })
@@ -439,4 +439,4 @@ function xe({ state: e, panelId: i = "ai-assistant", panelProps: a, renderPanel:
439
439
  });
440
440
  }
441
441
  //#endregion
442
- export { be as AssistantOverlay, Z as AssistantOverlayProvider, B as useAssistantDockWidth, z as useAssistantOverlayOrNull, V as useAssistantPanelInset, K as useAssistantQuotaExhausted };
442
+ export { be as AssistantOverlay, ve as AssistantOverlayProvider, H as useAssistantDockWidth, V as useAssistantOverlayOrNull, U as useAssistantPanelInset, J as useAssistantQuotaExhausted };