@factorialco/f0-react 14.16.1 → 14.18.0

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 (56) hide show
  1. package/dist/{ArchiveThumbnail-COsawOBr.js → ArchiveThumbnail-Dj23fTU2.js} +3 -3
  2. package/dist/{ArchiveViewer-ah7lBRU5.js → ArchiveViewer-C9Z1RX74.js} +5 -5
  3. package/dist/{ChatPostComposerDialog-DSIpJQ7c.js → ChatPostComposerDialog-BztXuihb.js} +3 -3
  4. package/dist/{CoachmarkProvider-B8jp2NdH.js → CoachmarkProvider-wHJ1fNtv.js} +21873 -21707
  5. package/dist/{CodeThumbnail-_y-kDD-q.js → CodeThumbnail-C8kuBnUv.js} +1 -1
  6. package/dist/{CodeViewer-r5tyxLSt.js → CodeViewer-othGwd2k.js} +8 -8
  7. package/dist/{DocumentToolbar-DvXvTDh4.js → DocumentToolbar-Dx1trDu_.js} +5 -5
  8. package/dist/{DocxViewer-CPMbiE5a.js → DocxViewer-C33rqSqK.js} +3 -3
  9. package/dist/{F0AiProcessingOverlay-aDAdrNce.js → F0AiProcessingOverlay-2MFEG-x3.js} +435 -435
  10. package/dist/{F0Alert-DBQeR0cM.js → F0Alert-EuqVV5XC.js} +12 -12
  11. package/dist/F0AudioPlayer-fmgmAwIs.js +2 -0
  12. package/dist/{F0Button-CVBX4mpV.js → F0Button-DEQjTtQQ.js} +3424 -3339
  13. package/dist/{F0CanvasPanel-DOsB2n3S.js → F0CanvasPanel-DOjVevQN.js} +18 -18
  14. package/dist/{F0DocumentViewer-ZJcQEhGA.js → F0DocumentViewer-CN32kEGx.js} +4 -4
  15. package/dist/{F0DocumentViewer-C1o_L8VI.js → F0DocumentViewer-DlnbQXJy.js} +1 -1
  16. package/dist/{F0Icon-1popYub0.js → F0Icon-yYYIXayJ.js} +1 -1
  17. package/dist/{F0Map-BReBnzyX.js → F0Map-DZ_8bKFy.js} +16 -16
  18. package/dist/{F0Select-1hIMxh-o.js → F0Select-BDp-zH6t.js} +8 -8
  19. package/dist/{F0Text-BJF7W4yd.js → F0Text-CdAHlkuW.js} +2 -2
  20. package/dist/{F0VideoPlayer-DQ2BzdKP.js → F0VideoPlayer-BwxyRTls.js} +22 -22
  21. package/dist/F0VideoPlayer-buv3Ng9D.js +1 -0
  22. package/dist/{HtmlThumbnail-DLtk8JYr.js → HtmlThumbnail-s_oajO_b.js} +1 -1
  23. package/dist/{HtmlViewer-9ilcTnKa.js → HtmlViewer-BzBp0hjD.js} +9 -9
  24. package/dist/{LayoutGroup-Ctdx3KAT.js → LayoutGroup-Ca-XZBlO.js} +1 -1
  25. package/dist/{Map-BdBVSbou.js → Map-BZU8gY2T.js} +10 -10
  26. package/dist/{PdfThumbnail-DhPj5b9N.js → PdfThumbnail-DlwsrdaB.js} +1 -1
  27. package/dist/{PdfViewer-BZwgAyV2.js → PdfViewer-C4fR5F7k.js} +10 -10
  28. package/dist/{SandboxedHtmlFrame-U-V8AeTu.js → SandboxedHtmlFrame-CF-4NPOg.js} +2 -2
  29. package/dist/{SheetViewer-FblPSdbq.js → SheetViewer-BxaAH-7B.js} +5 -5
  30. package/dist/{TextViewer-itfREx_P.js → TextViewer-BKMQ_8Xx.js} +4 -4
  31. package/dist/ai.d.ts +2 -2
  32. package/dist/ai.js +3 -3
  33. package/dist/component-status.js +3 -3
  34. package/dist/{dist-mXRQ3ead.js → dist-B0p9HtOX.js} +4 -4
  35. package/dist/{dist-Cdt-yhbF.js → dist-L1PI_yN8.js} +1 -1
  36. package/dist/{dist-CEaJ2V1g.js → dist-z-guLZkn.js} +1 -1
  37. package/dist/experimental.d.ts +215 -31
  38. package/dist/experimental.js +2773 -2414
  39. package/dist/{exports-CqUFRi14.d.ts → exports-CsooheN0.d.ts} +1 -1
  40. package/dist/f0.d.ts +11 -3
  41. package/dist/f0.js +159 -157
  42. package/dist/{highlight-hOG6cDzB.js → highlight-CSF4P5Fv.js} +1 -1
  43. package/dist/{i18n-provider-CJrQqAyn.js → i18n-provider-DBzM2kq0.js} +33 -29
  44. package/dist/{index-CWG70Tzs.d.ts → index-Bp-nOH1C.d.ts} +47 -4
  45. package/dist/{maplibre-BT9XMUNs.js → maplibre-DS72SypK.js} +1 -1
  46. package/dist/{pdfWorker-B8z9bBca.js → pdfWorker-pOyip4YO.js} +1 -1
  47. package/dist/{popover--syRPfsv.js → popover-Qp4DqBn0.js} +1 -1
  48. package/dist/{scrollarea-LZjvVdDY.js → scrollarea-_MxU-d6t.js} +3 -3
  49. package/dist/{skeleton-BKBf76U9.js → skeleton-AiUxUDj1.js} +1 -1
  50. package/dist/styles.css +1 -1
  51. package/dist/{toolbarStyles-DWH5y0G7.js → toolbarStyles-BQgoBBND.js} +1 -1
  52. package/dist/{types-fb-NjbfH.d.ts → types-vsDe9Lim.d.ts} +64 -14
  53. package/dist/{useData-y9LqXE8Q.js → useData-Cp4u3Mch.js} +6 -6
  54. package/package.json +1 -1
  55. package/dist/F0AudioPlayer-DtbtzMRe.js +0 -2
  56. package/dist/F0VideoPlayer-DJCGorxe.js +0 -1
@@ -1,16 +1,16 @@
1
- import { a as e, r as t } from "./i18n-provider-CJrQqAyn.js";
2
- import { n, t as r } from "./skeleton-BKBf76U9.js";
1
+ import { a as e, r as t } from "./i18n-provider-DBzM2kq0.js";
2
+ import { n, t as r } from "./skeleton-AiUxUDj1.js";
3
3
  import { L as i, R as a } from "./tooltip-BX4dSfeL.js";
4
- import { K as o, T as s, U as c, h as l, n as u, r as d, t as f, y as p } from "./F0Button-CVBX4mpV.js";
5
- import { $ as m, $t as h, A as g, Aa as _, Ao as v, As as y, B as b, Bt as x, C as S, Cc as C, Di as w, Ds as T, Ei as E, Ft as D, G as O, Gi as ee, Go as k, Gt as A, H as j, Ht as M, J as N, Jo as P, K as F, Kc as I, Ko as L, Kt as te, Lr as ne, Lt as re, M as ie, Ms as ae, Mt as R, O as oe, Oi as z, Ot as B, Po as se, Ps as ce, Pt as le, Q as ue, S as de, Sc as fe, St as pe, U as me, Ui as he, Vi as V, Vo as ge, Vr as _e, W as ve, Ws as ye, Wt as be, Xr as xe, Xt as Se, Y as Ce, Yt as we, Zr as Te, _t as Ee, a as De, an as H, ao as Oe, at as ke, b as U, bo as Ae, bs as je, cn as Me, ct as Ne, dn as Pe, ds as Fe, dt as Ie, en as Le, fn as Re, fs as ze, ft as Be, g as Ve, gn as He, gt as Ue, h as We, in as Ge, io as Ke, it as qe, j as Je, jr as Ye, jt as Xe, k as Ze, ki as Qe, kt as $e, ln as et, lo as tt, ls as nt, lt as rt, m as it, nl as at, nn as ot, ns as st, ot as ct, q as lt, qo as ut, r as dt, rn as ft, rs as pt, rt as W, ss as mt, st as ht, tl as gt, tt as _t, ut as vt, vc as yt, vn as bt, vt as xt, x as St, xn as Ct, y as wt, yi as Tt, yt as Et, zs as Dt } from "./F0CanvasPanel-DOsB2n3S.js";
6
- import { o as Ot, t as G } from "./F0Icon-1popYub0.js";
4
+ import { K as o, T as s, U as c, h as l, n as u, r as d, t as f, y as p } from "./F0Button-DEQjTtQQ.js";
5
+ import { $ as m, $t as h, A as g, Aa as _, B as v, Bs as y, Bt as b, C as x, Cc as S, Di as C, Ei as w, Fo as T, Fs as E, Ft as D, G as ee, Gi as te, Gs as O, Gt as k, H as A, Ho as j, Ht as M, J as N, Jo as P, K as F, Ko as I, Kt as ne, Lr as re, Lt as ie, M as ae, Mt as L, Ns as R, O as oe, Oi as z, Os as B, Ot as se, Pt as ce, Q as le, S as ue, St as de, U as fe, Ui as pe, Vi as me, Vr as V, W as he, Wt as ge, Xr as _e, Xt as ve, Y as ye, Yo as be, Yt as xe, Zr as Se, _t as Ce, a as we, an as Te, ao as Ee, at as De, b as H, bo as Oe, cn as U, cs as ke, ct as Ae, dn as je, dt as Me, en as Ne, fn as Pe, fs as Fe, ft as Ie, g as Le, gn as Re, gt as ze, h as Be, in as Ve, io as He, is as Ue, it as We, j as Ge, jo as Ke, jr as qe, js as Je, jt as Ye, k as Xe, ki as Ze, kt as Qe, ln as $e, lo as et, lt as tt, m as nt, nl as rt, nn as it, ot as at, ps as ot, q as st, qc as ct, qo as lt, r as ut, rl as dt, rn as ft, rs as pt, rt as W, st as mt, tt as ht, us as gt, ut as _t, vn as vt, vt as yt, wc as bt, x as xt, xn as St, xs as Ct, y as wt, yc as Tt, yi as Et, yt as Dt } from "./F0CanvasPanel-DOjVevQN.js";
6
+ import { o as Ot, t as G } from "./F0Icon-yYYIXayJ.js";
7
7
  import { t as kt } from "./i18n-provider-defaults-BCSptJcf.js";
8
- import { F as At, H as jt, M as Mt, O as Nt, S as Pt, V as Ft, g as It, h as Lt, l as Rt, m as zt, y as Bt } from "./useData-y9LqXE8Q.js";
9
- import { Cr as Vt, Dn as Ht, Dr as Ut, Ft as Wt, On as Gt, Ot as Kt, Tr as qt, bt as Jt, cn as Yt, dt as Xt, kr as Zt, nn as Qt, sn as $t, un as en, vt as tn, wr as nn, yt as rn } from "./F0Select-1hIMxh-o.js";
8
+ import { F as At, H as jt, M as Mt, O as Nt, S as Pt, V as Ft, g as It, h as Lt, l as Rt, m as zt, y as Bt } from "./useData-Cp4u3Mch.js";
9
+ import { Cr as Vt, Dn as Ht, Dr as Ut, Ft as Wt, On as Gt, Ot as Kt, Tr as qt, bt as Jt, cn as Yt, dt as Xt, kr as Zt, nn as Qt, sn as $t, un as en, vt as tn, wr as nn, yt as rn } from "./F0Select-BDp-zH6t.js";
10
10
  import { t as an } from "./Check-DAp9gCRh.js";
11
11
  import { t as on } from "./Ellipsis-CBouJQYY.js";
12
12
  import { t as sn } from "./ExternalLink-RdKU698E.js";
13
- import { a as cn, gt as ln, i as un, t as dn } from "./popover--syRPfsv.js";
13
+ import { a as cn, gt as ln, i as un, t as dn } from "./popover-Qp4DqBn0.js";
14
14
  import { a as fn } from "./dist-Cuwaibqg.js";
15
15
  import { createContext as pn, createElement as mn, forwardRef as hn, memo as gn, useCallback as K, useContext as _n, useEffect as q, useId as vn, useImperativeHandle as yn, useInsertionEffect as bn, useLayoutEffect as xn, useMemo as J, useRef as Y, useState as X } from "react";
16
16
  import { Fragment as Sn, jsx as Z, jsxs as Q } from "react/jsx-runtime";
@@ -37,33 +37,33 @@ var En = [
37
37
  "sm",
38
38
  "md",
39
39
  "lg"
40
- ], On = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;"), kn = /[\\`*_{}[\]()#+\-.!|~>]/g, An = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(kn, "\\$&"), jn = (e) => `<entity-ref type="${On(e.type)}" id="${On(e.id)}">${On(e.label)}</entity-ref>`, Mn = (e, t) => e.slice(t.start, Et(t)).normalize("NFC") === `@${t.label}`.normalize("NFC");
40
+ ], On = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;"), kn = /[\\`*_{}[\]()#+\-.!|~>]/g, An = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(kn, "\\$&"), jn = (e) => `<entity-ref type="${On(e.type)}" id="${On(e.id)}">${On(e.label)}</entity-ref>`, Mn = (e, t) => e.slice(t.start, Dt(t)).normalize("NFC") === `@${t.label}`.normalize("NFC");
41
41
  function Nn(e, t) {
42
42
  let n = e.length - e.trimStart().length, r = e.trimEnd().length, i = t.filter((t) => t.start >= n && Mn(e, t)).sort((e, t) => e.start - t.start), a = "", o = n;
43
- for (let t of i) t.start < o || Et(t) > r || (a += An(e.slice(o, t.start)) + jn(t), o = Et(t));
43
+ for (let t of i) t.start < o || Dt(t) > r || (a += An(e.slice(o, t.start)) + jn(t), o = Dt(t));
44
44
  return a + An(e.slice(o, r));
45
45
  }
46
46
  //#endregion
47
47
  //#region src/elements/F0Composer/parts/surface.ts
48
- var Pn = "relative flex flex-col rounded-lg border border-solid border-f1-border-secondary bg-f1-background/95 shadow-md transition-colors", Fn = [], In = () => null, Ln = ({ onSend: e, inProgress: t = !1, onStop: n, sendKind: r = "send", hasAttachments: a = !1, sendBlocked: s = !1, maxLength: l, maxLengthError: d, error: f = null, labels: p, placeholders: m, placeholdersPaused: h, role: g = "combobox", name: _, mentions: v, autocomplete: y, voice: b, onTextChange: x, onCleared: S, onEscape: w, onArrowUpWhenEmpty: T, onPasteFiles: E, pastePreferText: D = !1, onStateChange: O, header: ee, tray: k, leading: A, toolbarStart: j, toolbarCenter: M, collapsible: N = !1, collapsed: P = !1, replacement: F, accent: I = !1, asForm: L = !1, className: te, surfaceRef: ne, onSurfaceFocus: re, onSurfaceBlur: ie, handleRef: ae, reducedMotion: R = !1, "data-testid": oe }) => {
49
- let z = rt(p, b), B = F != null, { error: se, show: le, clear: ue } = Ne(), de = Y(() => {}), fe = Y(() => {}), pe = Y(""), me = K((e) => {
50
- let t = pe.current, n = t && !/\s$/.test(t) ? " " : "";
51
- de.current(`${t}${n}${e}`);
52
- }, []), he = {
48
+ var Pn = "relative flex flex-col rounded-lg border border-solid border-f1-border-secondary bg-f1-background/95 shadow-md transition-colors", Fn = [], In = () => null, Ln = ({ onSend: e, inProgress: t = !1, onStop: n, sendKind: r = "send", hasAttachments: a = !1, sendBlocked: s = !1, maxLength: l, maxLengthError: d, error: f = null, labels: p, placeholders: m, placeholdersPaused: h, role: g = "combobox", name: _, mentions: v, autocomplete: y, voice: b, onTextChange: x, onCleared: S, onEscape: C, onArrowUpWhenEmpty: w, onPasteFiles: T, pastePreferText: D = !1, onStateChange: ee, header: te, tray: O, leading: k, toolbarStart: A, toolbarCenter: j, collapsible: M = !1, collapsed: N = !1, replacement: P, accent: F = !1, asForm: I = !1, className: ne, surfaceRef: re, onSurfaceFocus: ie, onSurfaceBlur: ae, handleRef: L, reducedMotion: R = !1, "data-testid": oe }) => {
49
+ let z = tt(p, b), B = P != null, { error: se, show: ce, clear: le } = Ae(), ue = Y(() => {}), de = Y(() => {}), fe = Y(""), pe = K((e) => {
50
+ let t = fe.current, n = t && !/\s$/.test(t) ? " " : "";
51
+ ue.current(`${t}${n}${e}`);
52
+ }, []), me = {
53
53
  "permission-denied": z.micPermissionDenied,
54
54
  "device-error": z.micError,
55
55
  "transcription-failed": z.transcriptionError
56
- }, V = bt({
56
+ }, V = vt({
57
57
  onTranscribe: b?.onTranscribe,
58
- onPartial: me,
58
+ onPartial: pe,
59
59
  onFinal: (e) => {
60
- me(e), fe.current();
60
+ pe(e), de.current();
61
61
  },
62
- onError: (e) => le(he[e]),
62
+ onError: (e) => ce(me[e]),
63
63
  onAudio: b?.onAudio
64
- }), [ge, _e] = X(!1), ve = V.status === "recording", ye = V.status === "transcribing", be = !!b && (!!b.onTranscribe || !!b.onAudio) && V.isSupported, xe = !b?.onAudio && (V.status !== "idle" || ge), [Se, Ce] = X(!1), we = Ie({
64
+ }), [he, ge] = X(!1), _e = V.status === "recording", ve = V.status === "transcribing", ye = !!b && (!!b.onTranscribe || !!b.onAudio) && V.isSupported, be = !b?.onAudio && (V.status !== "idle" || he), [xe, Se] = X(!1), Ce = Me({
65
65
  mentions: {
66
- enabled: !!v && v.sources.length + +!!v.pinned > 0 && !Se && !B,
66
+ enabled: !!v && v.sources.length + +!!v.pinned > 0 && !xe && !B,
67
67
  sources: v?.sources ?? Fn,
68
68
  pinned: v?.pinned,
69
69
  scopeKey: v?.scopeKey,
@@ -71,55 +71,55 @@ var Pn = "relative flex flex-col rounded-lg border border-solid border-f1-border
71
71
  },
72
72
  transformChange: y?.transformChange,
73
73
  onTextChange: x,
74
- historySuspended: xe
75
- }), { value: Te, setValue: Ee, setCursorPosition: De, textareaRef: H, highlightRef: Oe, mentions: U, requestSelection: Ae, clearText: je, breakHistory: Me } = we;
76
- de.current = (e) => {
77
- Ee(e), De(e.length);
74
+ historySuspended: be
75
+ }), { value: we, setValue: Te, setCursorPosition: Ee, textareaRef: H, highlightRef: Oe, mentions: U, requestSelection: ke, clearText: je, breakHistory: Fe } = Ce;
76
+ ue.current = (e) => {
77
+ Te(e), Ee(e.length);
78
78
  };
79
- let Pe = Y(Te);
80
- Pe.current = Te;
81
- let Fe = Y(U.mentions);
82
- Fe.current = U.mentions;
83
- let ze = (y?.useAutocomplete ?? In)(we), Ve = ze?.isOpen ?? !1, He = U.dismissCurrentTrigger;
79
+ let Le = Y(we);
80
+ Le.current = we;
81
+ let Re = Y(U.mentions);
82
+ Re.current = U.mentions;
83
+ let Be = (y?.useAutocomplete ?? In)(Ce), Ve = Be?.isOpen ?? !1, He = U.dismissCurrentTrigger;
84
84
  q(() => {
85
- Ce(Ve), Ve && He();
85
+ Se(Ve), Ve && He();
86
86
  }, [Ve, He]);
87
- let { highlightSegments: We, hasOverlay: Ge } = Be(we, { suppressGhost: Ve }), Ke = K((e) => {
87
+ let { highlightSegments: Ue, hasOverlay: Ge } = Ie(Ce, { suppressGhost: Ve }), Ke = K((e) => {
88
88
  let t = H.current;
89
89
  if (!t) return;
90
90
  t.focus(e);
91
91
  let n = t.value.length;
92
92
  t.setSelectionRange(n, n);
93
93
  }, [H]);
94
- fe.current = () => H.current?.focus();
95
- let Je = U.close;
94
+ de.current = () => H.current?.focus();
95
+ let qe = U.close;
96
96
  q(() => {
97
- B && Je();
98
- }, [B, Je]);
99
- let Ye = Te.length === 0;
97
+ B && qe();
98
+ }, [B, qe]);
99
+ let Je = we.length === 0;
100
100
  q(() => {
101
- O?.({
102
- isEmpty: Ye,
101
+ ee?.({
102
+ isEmpty: Je,
103
103
  recorder: V.status
104
104
  });
105
105
  }, [
106
- O,
107
- Ye,
106
+ ee,
107
+ Je,
108
108
  V.status
109
109
  ]);
110
- let [Xe, Ze] = X(!1), Qe = l !== void 0 && Te.trim().length > l;
110
+ let [Ye, Xe] = X(!1), Ze = l !== void 0 && we.trim().length > l;
111
111
  q(() => {
112
- Qe || Ze(!1);
113
- }, [Qe]);
114
- let $e = Xe && Qe ? d ?? null : null, et = $e ?? f ?? se, [tt, nt] = X(!1), it = Y(!1), at = (Te.trim().length > 0 || a) && !xe && !s && !tt && !B, ot = t && !ye, lt = K(() => {
115
- if (!at || it.current) return;
116
- if (Qe) {
117
- Ze(!0);
112
+ Ze || Xe(!1);
113
+ }, [Ze]);
114
+ let Qe = Ye && Ze ? d ?? null : null, $e = Qe ?? f ?? se, [et, nt] = X(!1), rt = Y(!1), it = (we.trim().length > 0 || a) && !be && !s && !et && !B, ot = t && !ve, st = K(() => {
115
+ if (!it || rt.current) return;
116
+ if (Ze) {
117
+ Xe(!0);
118
118
  return;
119
119
  }
120
120
  U.close();
121
- let t = Pe.current, n = (e) => {
122
- !e && Pe.current === t && (je(), Me()), H.current?.focus({ preventScroll: !0 });
121
+ let t = Le.current, n = (e) => {
122
+ !e && Le.current === t && (je(), Fe()), H.current?.focus({ preventScroll: !0 });
123
123
  }, r;
124
124
  try {
125
125
  r = e({
@@ -130,92 +130,92 @@ var Pn = "relative flex flex-col rounded-lg border border-solid border-f1-border
130
130
  n(!0);
131
131
  return;
132
132
  }
133
- r instanceof Promise ? (it.current = !0, nt(!0), r.then((e) => {
134
- it.current = !1, nt(!1), n(e === !1);
133
+ r instanceof Promise ? (rt.current = !0, nt(!0), r.then((e) => {
134
+ rt.current = !1, nt(!1), n(e === !1);
135
135
  }, () => {
136
- it.current = !1, nt(!1), n(!0);
136
+ rt.current = !1, nt(!1), n(!0);
137
137
  })) : n(r === !1);
138
138
  }, [
139
- at,
140
- Qe,
139
+ it,
140
+ Ze,
141
141
  U,
142
142
  e,
143
143
  je,
144
- Me,
144
+ Fe,
145
145
  H
146
- ]), [ut, dt] = X(0), ft = Y(at);
147
- ft.current !== at && (ft.current = at, at && dt((e) => e + 1));
148
- let pt = K(() => {
149
- ge || (b?.onPress?.(), ue(), _e(!0), (async () => {
146
+ ]), [ct, lt] = X(0), ut = Y(it);
147
+ ut.current !== it && (ut.current = it, it && lt((e) => e + 1));
148
+ let dt = K(() => {
149
+ he || (b?.onPress?.(), le(), ge(!0), (async () => {
150
150
  try {
151
- await V.start(), pe.current = Pe.current;
151
+ await V.start(), fe.current = Le.current;
152
152
  } catch {} finally {
153
- _e(!1);
153
+ ge(!1);
154
154
  }
155
155
  })());
156
156
  }, [
157
- ge,
157
+ he,
158
158
  b,
159
- ue,
159
+ le,
160
160
  V
161
- ]), W = V.cancel, mt = K(() => {
162
- W(), b?.onCancelled?.();
163
- }, [W, b]), gt = Y(!1), _t = b?.onStarted;
161
+ ]), ft = V.cancel, W = K(() => {
162
+ ft(), b?.onCancelled?.();
163
+ }, [ft, b]), ht = Y(!1), gt = b?.onStarted;
164
164
  q(() => {
165
- ve && !gt.current && _t?.(), gt.current = ve;
166
- }, [ve, _t]), yn(ae, () => ({
165
+ _e && !ht.current && gt?.(), ht.current = _e;
166
+ }, [_e, gt]), yn(L, () => ({
167
167
  focus: (e) => {
168
168
  B || Ke(e);
169
169
  },
170
170
  clear: je,
171
- loadDraft: we.loadDraft,
171
+ loadDraft: Ce.loadDraft,
172
172
  getDraft: () => ({
173
- text: Pe.current,
174
- mentions: Fe.current
173
+ text: Le.current,
174
+ mentions: Re.current
175
175
  }),
176
176
  insertText: (e) => {
177
- let t = H.current, n = Pe.current, r = t?.selectionStart ?? n.length, i = t?.selectionEnd ?? n.length, a = r + e.length, o = n.slice(0, r) + e + n.slice(i);
178
- Ee(o), De(a), x?.(o), Ae(a, o, !0);
177
+ let t = H.current, n = Le.current, r = t?.selectionStart ?? n.length, i = t?.selectionEnd ?? n.length, a = r + e.length, o = n.slice(0, r) + e + n.slice(i);
178
+ Te(o), Ee(a), x?.(o), ke(a, o, !0);
179
179
  },
180
- cancelRecording: W,
181
- breakHistory: Me
180
+ cancelRecording: ft,
181
+ breakHistory: Fe
182
182
  }), [
183
183
  B,
184
184
  Ke,
185
185
  je,
186
- we.loadDraft,
186
+ Ce.loadDraft,
187
187
  H,
188
+ Te,
188
189
  Ee,
189
- De,
190
190
  x,
191
- Ae,
192
- W,
193
- Me
191
+ ke,
192
+ ft,
193
+ Fe
194
194
  ]);
195
- let { escapeArmed: yt, handleClearKeyDown: xt, handleUndoRedoKeyDown: St } = we, Ct = (e) => {
195
+ let { escapeArmed: yt, handleClearKeyDown: xt, handleUndoRedoKeyDown: St } = Ce, Ct = (e) => {
196
196
  if (e.key !== "Escape") return !1;
197
- if (w?.(e)) return !0;
198
- if (ve) return e.preventDefault(), mt(), !0;
197
+ if (C?.(e)) return !0;
198
+ if (_e) return e.preventDefault(), W(), !0;
199
199
  let t = yt;
200
- return xt(e) ? (t && (Ze(!1), S?.()), !0) : !1;
200
+ return xt(e) ? (t && (Xe(!1), S?.()), !0) : !1;
201
201
  }, wt = (e) => {
202
- B || vt(e) || St(e) || ze?.handleKeyDown(e) || U.handleKeyDown(e) || Ct(e) || (e.key === "ArrowUp" && !e.shiftKey && !e.altKey && !e.metaKey && !e.ctrlKey && Te === "" && V.status === "idle" && !ge && !b?.busy && T?.() ? e.preventDefault() : e.key === "Enter" && !e.shiftKey && (e.preventDefault(), t || lt()));
202
+ B || _t(e) || St(e) || Be?.handleKeyDown(e) || U.handleKeyDown(e) || Ct(e) || (e.key === "ArrowUp" && !e.shiftKey && !e.altKey && !e.metaKey && !e.ctrlKey && we === "" && V.status === "idle" && !he && !b?.busy && w?.() ? e.preventDefault() : e.key === "Enter" && !e.shiftKey && (e.preventDefault(), t || st()));
203
203
  }, Tt = (e) => {
204
- e.preventDefault(), !B && (t && !xe ? (U.close(), n?.(), H.current?.focus()) : lt());
205
- }, Et = qe({
206
- enabled: !!E && !B,
207
- onFiles: E ?? (() => {}),
204
+ e.preventDefault(), !B && (t && !be ? (U.close(), n?.(), H.current?.focus()) : st());
205
+ }, Et = We({
206
+ enabled: !!T && !B,
207
+ onFiles: T ?? (() => {}),
208
208
  preferText: D
209
- }), Dt = vn(), Ot = vn(), G = `chat-composer-mentions-${Dt.replace(/:/g, "")}`, kt = U.isOpen && !Ve && !B && (U.isLoading || U.rows.length > 0), At = U.rows[U.selectedIndex] ?? U.rows[0], jt = kt && At ? ht(G, At.item) : void 0, Mt = (e) => be ? /* @__PURE__ */ Z(u, {
209
+ }), Dt = vn(), Ot = vn(), G = `chat-composer-mentions-${Dt.replace(/:/g, "")}`, kt = U.isOpen && !Ve && !B && (U.isLoading || U.rows.length > 0), At = U.rows[U.selectedIndex] ?? U.rows[0], jt = kt && At ? mt(G, At.item) : void 0, Mt = (e) => ye ? /* @__PURE__ */ Z(u, {
210
210
  type: "button",
211
211
  variant: "outline",
212
212
  size: e,
213
213
  hideLabel: !0,
214
214
  label: b?.busy ? z.sendingVoice : z.recordAudio,
215
- icon: ce,
216
- onClick: pt,
215
+ icon: E,
216
+ onClick: dt,
217
217
  disabled: b?.disabled,
218
- loading: ge || ye || !!b?.busy
218
+ loading: he || ve || !!b?.busy
219
219
  }) : null, Nt = ot ? "stop" : r, Pt = (e) => /* @__PURE__ */ Z(o, {
220
220
  initial: !1,
221
221
  mode: "popLayout",
@@ -235,40 +235,40 @@ var Pn = "relative flex flex-col rounded-lg border border-solid border-f1-border
235
235
  },
236
236
  transition: {
237
237
  duration: .15,
238
- ease: Le
238
+ ease: Ne
239
239
  },
240
240
  children: ot ? /* @__PURE__ */ Z(u, {
241
- type: L ? "submit" : "button",
241
+ type: I ? "submit" : "button",
242
242
  variant: "neutral",
243
243
  size: e,
244
244
  hideLabel: !0,
245
245
  label: z.stop,
246
- icon: st,
247
- onClick: L ? void 0 : () => {
246
+ icon: pt,
247
+ onClick: I ? void 0 : () => {
248
248
  n?.(), H.current?.focus();
249
249
  }
250
250
  }) : /* @__PURE__ */ Z(u, {
251
- type: L ? "submit" : "button",
251
+ type: I ? "submit" : "button",
252
252
  variant: "default",
253
253
  size: e,
254
254
  hideLabel: !0,
255
255
  label: r === "save" ? z.save : z.send,
256
256
  icon: r === "save" ? an : Ut,
257
- onClick: L ? void 0 : lt,
258
- disabled: !at
257
+ onClick: I ? void 0 : st,
258
+ disabled: !it
259
259
  })
260
- }, `${Nt}-${ot ? 0 : ut}`)
261
- }), Ft = { duration: R ? 0 : .15 }, It = typeof j == "function" ? j(V.status) : j, Lt = /* @__PURE__ */ Z("div", {
260
+ }, `${Nt}-${ot ? 0 : ct}`)
261
+ }), Ft = { duration: R ? 0 : .15 }, It = typeof A == "function" ? A(V.status) : A, Lt = /* @__PURE__ */ Z("div", {
262
262
  className: "grid",
263
263
  children: /* @__PURE__ */ Z(o, {
264
264
  initial: !1,
265
- children: ve ? /* @__PURE__ */ Q(c.div, {
265
+ children: _e ? /* @__PURE__ */ Q(c.div, {
266
266
  className: "flex items-center gap-3 p-3 [grid-area:1/1]",
267
267
  initial: { opacity: 0 },
268
268
  animate: { opacity: 1 },
269
269
  exit: { opacity: 0 },
270
270
  transition: Ft,
271
- children: [/* @__PURE__ */ Z(Re, {
271
+ children: [/* @__PURE__ */ Z(Pe, {
272
272
  stream: V.stream,
273
273
  className: "min-w-0 flex-1"
274
274
  }), /* @__PURE__ */ Q("div", {
@@ -279,8 +279,8 @@ var Pn = "relative flex flex-col rounded-lg border border-solid border-f1-border
279
279
  size: "md",
280
280
  hideLabel: !0,
281
281
  label: z.cancelRecording,
282
- icon: C,
283
- onClick: mt
282
+ icon: bt,
283
+ onClick: W
284
284
  }), /* @__PURE__ */ Z(u, {
285
285
  type: "button",
286
286
  variant: "default",
@@ -299,12 +299,12 @@ var Pn = "relative flex flex-col rounded-lg border border-solid border-f1-border
299
299
  transition: Ft,
300
300
  children: [
301
301
  It ? /* @__PURE__ */ Z("div", {
302
- className: i("flex items-center gap-1", M ? "shrink-0" : "min-w-0"),
302
+ className: i("flex items-center gap-1", j ? "shrink-0" : "min-w-0"),
303
303
  children: It
304
304
  }) : null,
305
- M ? /* @__PURE__ */ Z("div", {
305
+ j ? /* @__PURE__ */ Z("div", {
306
306
  className: "min-w-0 flex-1",
307
- children: M
307
+ children: j
308
308
  }) : null,
309
309
  /* @__PURE__ */ Q("div", {
310
310
  className: "ml-auto flex shrink-0 items-center gap-1",
@@ -322,59 +322,59 @@ var Pn = "relative flex flex-col rounded-lg border border-solid border-f1-border
322
322
  1
323
323
  ]
324
324
  }, zt = /* @__PURE__ */ Q(Sn, { children: [
325
- ee,
326
- /* @__PURE__ */ Z(ke, {
327
- message: et,
325
+ te,
326
+ /* @__PURE__ */ Z(De, {
327
+ message: $e,
328
328
  id: Ot,
329
329
  reducedMotion: R
330
330
  }),
331
- k,
331
+ O,
332
332
  /* @__PURE__ */ Q("div", {
333
- className: i((A || P) && "flex items-end", P && "pr-3"),
333
+ className: i((k || N) && "flex items-end", N && "pr-3"),
334
334
  children: [
335
- A,
336
- /* @__PURE__ */ Z(Ue, {
335
+ k,
336
+ /* @__PURE__ */ Z(ze, {
337
337
  className: "min-w-0 flex-1",
338
338
  textareaRef: H,
339
339
  highlightRef: Oe,
340
- value: Te,
340
+ value: we,
341
341
  role: g,
342
342
  name: _,
343
343
  ariaLabel: z.placeholder,
344
344
  placeholder: m ? {
345
345
  mode: "overlay",
346
- texts: ve ? [z.listening] : m,
347
- fallback: ve ? z.listening : z.placeholder,
346
+ texts: _e ? [z.listening] : m,
347
+ fallback: _e ? z.listening : z.placeholder,
348
348
  paused: h
349
349
  } : {
350
350
  mode: "native",
351
- text: ve ? z.listening : z.placeholder
351
+ text: _e ? z.listening : z.placeholder
352
352
  },
353
- onChange: we.handleChange,
353
+ onChange: Ce.handleChange,
354
354
  onKeyDown: wt,
355
355
  onPaste: Et,
356
- onFocus: ze?.handleFocus,
357
- onBlur: ze?.handleBlur,
358
- onCursorUpdate: we.updateCursorPosition,
359
- onScroll: we.syncHighlightScroll,
360
- highlightSegments: We,
356
+ onFocus: Be?.handleFocus,
357
+ onBlur: Be?.handleBlur,
358
+ onCursorUpdate: Ce.updateCursorPosition,
359
+ onScroll: Ce.syncHighlightScroll,
360
+ highlightSegments: Ue,
361
361
  hasOverlay: Ge,
362
362
  isAutocompleteOpen: Ve || kt,
363
- autocompleteListboxId: Ve ? ze?.listboxId : kt ? G : void 0,
364
- activeAutocompleteOptionId: (Ve ? ze?.activeDescendantId : void 0) ?? jt,
365
- isInvalid: $e !== null,
363
+ autocompleteListboxId: Ve ? Be?.listboxId : kt ? G : void 0,
364
+ activeAutocompleteOptionId: (Ve ? Be?.activeDescendantId : void 0) ?? jt,
365
+ isInvalid: Qe !== null,
366
366
  errorMessageId: Ot
367
367
  }),
368
- P ? /* @__PURE__ */ Q("div", {
368
+ N ? /* @__PURE__ */ Q("div", {
369
369
  className: "flex shrink-0 items-center gap-2 pb-[10px] pl-2",
370
370
  onMouseDown: (e) => e.preventDefault(),
371
371
  children: [Mt("sm"), Pt("sm")]
372
372
  }) : null
373
373
  ]
374
374
  }),
375
- N ? /* @__PURE__ */ Z(o, {
375
+ M ? /* @__PURE__ */ Z(o, {
376
376
  initial: !1,
377
- children: P ? null : /* @__PURE__ */ Z(c.div, {
377
+ children: N ? null : /* @__PURE__ */ Z(c.div, {
378
378
  className: "overflow-hidden",
379
379
  initial: {
380
380
  opacity: 0,
@@ -393,8 +393,8 @@ var Pn = "relative flex flex-col rounded-lg border border-solid border-f1-border
393
393
  }, "action-row")
394
394
  }) : Lt
395
395
  ] }), Bt = /* @__PURE__ */ Q(Sn, { children: [
396
- ze?.popover,
397
- /* @__PURE__ */ Z(ct, {
396
+ Be?.popover,
397
+ /* @__PURE__ */ Z(at, {
398
398
  isOpen: kt,
399
399
  listboxId: G,
400
400
  label: z.mentionSuggestions,
@@ -407,7 +407,7 @@ var Pn = "relative flex flex-col rounded-lg border border-solid border-f1-border
407
407
  onSelect: U.selectRow,
408
408
  pinnedDescription: z.mentionPinnedDescription
409
409
  }),
410
- F === void 0 ? zt : /* @__PURE__ */ Z(o, {
410
+ P === void 0 ? zt : /* @__PURE__ */ Z(o, {
411
411
  initial: !1,
412
412
  children: B ? /* @__PURE__ */ Z(c.div, {
413
413
  className: "overflow-hidden",
@@ -441,7 +441,7 @@ var Pn = "relative flex flex-col rounded-lg border border-solid border-f1-border
441
441
  1
442
442
  ]
443
443
  },
444
- children: F
444
+ children: P
445
445
  }, "replacement") : /* @__PURE__ */ Z(c.div, {
446
446
  className: "overflow-hidden",
447
447
  initial: {
@@ -477,9 +477,9 @@ var Pn = "relative flex flex-col rounded-lg border border-solid border-f1-border
477
477
  children: zt
478
478
  }, "input")
479
479
  })
480
- ] }), Vt = i(Pn, I && "!border-f1-border-selected", te);
481
- return L ? /* @__PURE__ */ Z("form", {
482
- ref: ne,
480
+ ] }), Vt = i(Pn, F && "!border-f1-border-selected", ne);
481
+ return I ? /* @__PURE__ */ Z("form", {
482
+ ref: re,
483
483
  "data-testid": oe,
484
484
  "data-f0-chat-composer": "",
485
485
  "aria-busy": t,
@@ -487,17 +487,17 @@ var Pn = "relative flex flex-col rounded-lg border border-solid border-f1-border
487
487
  onClick: () => {
488
488
  B || H.current?.focus();
489
489
  },
490
- onFocus: re,
491
- onBlur: ie,
490
+ onFocus: ie,
491
+ onBlur: ae,
492
492
  onSubmit: Tt,
493
493
  children: Bt
494
494
  }) : /* @__PURE__ */ Z("div", {
495
- ref: ne,
495
+ ref: re,
496
496
  "data-testid": oe,
497
497
  "data-f0-chat-composer": "",
498
498
  className: Vt,
499
- onFocus: re,
500
- onBlur: ie,
499
+ onFocus: ie,
500
+ onBlur: ae,
501
501
  children: Bt
502
502
  });
503
503
  };
@@ -528,19 +528,19 @@ function Rn(e, t, n = .2) {
528
528
  //#endregion
529
529
  //#region src/addons/ai/F0AiChatTextArea/components/AttachedFilesList.tsx
530
530
  var zn = (e) => {
531
- let { provided: t } = R();
532
- return t ? /* @__PURE__ */ Z(Bn, { ...e }) : /* @__PURE__ */ Z(Xe, { children: /* @__PURE__ */ Z(Bn, { ...e }) });
531
+ let { provided: t } = L();
532
+ return t ? /* @__PURE__ */ Z(Bn, { ...e }) : /* @__PURE__ */ Z(Ye, { children: /* @__PURE__ */ Z(Bn, { ...e }) });
533
533
  }, Bn = ({ attachedFiles: e, isUploading: n, onRemove: r, removeLabel: i, reducedMotion: a }) => {
534
534
  let o = t(), s = Vn(e), c = J(() => e.flatMap((e) => {
535
535
  let t = s.get(e.id);
536
536
  if (!t) return [];
537
- let n = e.file.name, r = e.file.type || A({
537
+ let n = e.file.name, r = e.file.type || k({
538
538
  name: n,
539
539
  url: t
540
540
  });
541
541
  return [{
542
542
  att: e,
543
- attachment: te({
543
+ attachment: ne({
544
544
  name: n,
545
545
  url: t,
546
546
  mimeType: r
@@ -559,10 +559,10 @@ var zn = (e) => {
559
559
  }];
560
560
  }), [e, s]), l = J(() => c.map(({ att: e, attachment: t }, n) => ({
561
561
  file: t,
562
- item: e.status === "uploaded" ? D(t, re(n, t.url)) : null
563
- })), [c]), u = me(l, "composer"), d = c.map(({ att: e, attachment: t }) => ({
562
+ item: e.status === "uploaded" ? D(t, ie(n, t.url)) : null
563
+ })), [c]), u = fe(l, "composer"), d = c.map(({ att: e, attachment: t }) => ({
564
564
  id: e.id,
565
- content: /* @__PURE__ */ Z(O, {
565
+ content: /* @__PURE__ */ Z(ee, {
566
566
  attachment: t,
567
567
  status: e.status === "uploaded" ? "ready" : e.status === "error" ? "error" : "uploading",
568
568
  errorMessage: e.errorMessage,
@@ -572,7 +572,7 @@ var zn = (e) => {
572
572
  testIdPrefix: "ai-chat"
573
573
  })
574
574
  }));
575
- return /* @__PURE__ */ Z(ve, {
575
+ return /* @__PURE__ */ Z(he, {
576
576
  items: d,
577
577
  label: o.t(e.length === 1 ? "chat.attachmentCount.one" : "chat.attachmentCount.other", { count: e.length }),
578
578
  busy: n,
@@ -621,14 +621,14 @@ var zn = (e) => {
621
621
  d(e), s?.(e);
622
622
  }, p = [...n ? [{
623
623
  label: c.ai.addFilesOrPhotos,
624
- icon: je,
624
+ icon: Ct,
625
625
  onClick: r,
626
626
  disabled: i,
627
627
  disabledTooltip: a
628
628
  }, ...e.length > 0 ? [{ type: "separator" }] : []] : [], ...Hn(e)];
629
629
  return /* @__PURE__ */ Z("div", {
630
630
  onClick: (e) => e.stopPropagation(),
631
- children: /* @__PURE__ */ Z(tt, {
631
+ children: /* @__PURE__ */ Z(et, {
632
632
  items: p,
633
633
  align: "start",
634
634
  disabled: o,
@@ -661,7 +661,7 @@ var zn = (e) => {
661
661
  label: d.ai.attachFile,
662
662
  hideLabel: !0,
663
663
  type: "button",
664
- icon: je,
664
+ icon: Ct,
665
665
  variant: "outline",
666
666
  size: "md",
667
667
  disabled: r || f,
@@ -692,7 +692,7 @@ var zn = (e) => {
692
692
  };
693
693
  }, Kn = ({ creditWarning: e, children: n }) => {
694
694
  let r = t(), i = Gn(e);
695
- return /* @__PURE__ */ Z(j, {
695
+ return /* @__PURE__ */ Z(A, {
696
696
  notice: i,
697
697
  dismissLabel: r.ai.creditWarning.dismiss ?? "",
698
698
  className: "[&_form]:border-f1-border",
@@ -855,7 +855,7 @@ var zn = (e) => {
855
855
  /* @__PURE__ */ Z("div", {
856
856
  className: "flex items-center py-0.5",
857
857
  children: /* @__PURE__ */ Z(G, {
858
- icon: mt,
858
+ icon: ke,
859
859
  size: "md",
860
860
  color: "default"
861
861
  })
@@ -870,7 +870,7 @@ var zn = (e) => {
870
870
  variant: "ghost",
871
871
  label: r.ai.removeQuote,
872
872
  onClick: n,
873
- icon: C,
873
+ icon: bt,
874
874
  hideLabel: !0,
875
875
  size: "sm"
876
876
  })
@@ -879,7 +879,7 @@ var zn = (e) => {
879
879
  });
880
880
  }, nr = ({ cards: e }) => e.length === 0 ? null : /* @__PURE__ */ Z("div", {
881
881
  className: "grid w-full grid-cols-2 gap-3",
882
- children: e.slice(0, 4).map((e) => /* @__PURE__ */ Z(b, {
882
+ children: e.slice(0, 4).map((e) => /* @__PURE__ */ Z(v, {
883
883
  avatar: {
884
884
  type: "icon",
885
885
  icon: e.icon
@@ -1021,8 +1021,8 @@ function cr(e) {
1021
1021
  }
1022
1022
  //#endregion
1023
1023
  //#region src/addons/ai/F0AiChatTextArea/AiChatComposer.tsx
1024
- var lr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholders: s, creditWarning: u, clarifyingUI: d, pendingContext: f = null, onPendingContextChange: p, pendingQuote: m = null, onPendingQuoteChange: h, fileAttachments: g, toolbarStart: _, composerActions: v, onComposerActionsOpenChange: y, onTranscribe: b, searchPersons: x, mentionSources: S, onProcessFilesRef: C, disclaimer: w, usageLimits: T, footer: E, isWelcomeScreen: D = !1, fullscreen: O = !1, welcomeScreenSuggestions: ee, onSuggestionClick: k, welcomeScreenSuggestionsPlacement: A = "above", welcomeScreenSuggestionsCollapsedByDefault: j = !1, welcomeScreenCards: M, padding: N = "default", name: P, ref: F }) => {
1025
- let I = t(), L = !!l(), te = Y(null), [ne, re] = X(null), [ie, ae] = X(!1), [R, oe] = X({
1024
+ var lr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholders: s, creditWarning: u, clarifyingUI: d, pendingContext: f = null, onPendingContextChange: p, pendingQuote: m = null, onPendingQuoteChange: h, fileAttachments: g, toolbarStart: _, composerActions: v, onComposerActionsOpenChange: y, onTranscribe: b, searchPersons: x, mentionSources: S, onProcessFilesRef: C, disclaimer: w, usageLimits: T, footer: E, isWelcomeScreen: D = !1, fullscreen: ee = !1, welcomeScreenSuggestions: te, onSuggestionClick: O, welcomeScreenSuggestionsPlacement: k = "above", welcomeScreenSuggestionsCollapsedByDefault: A = !1, welcomeScreenCards: j, padding: M = "default", name: N, ref: P }) => {
1025
+ let F = t(), I = !!l(), ne = Y(null), [re, ie] = X(null), [ae, L] = X(!1), [R, oe] = X({
1026
1026
  isEmpty: !0,
1027
1027
  recorder: "idle"
1028
1028
  }), z = Y(null), B = Y(null);
@@ -1038,17 +1038,17 @@ var lr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholde
1038
1038
  item: e,
1039
1039
  group: t,
1040
1040
  prompt: e.prompt || e.title
1041
- }), k?.(e, t);
1042
- }, [ue, k]), { attachedFiles: pe, fileInputRef: me, onUploadFiles: he, acceptValue: V, isAtMaxFiles: ge, maxFiles: _e, processFiles: ve, handleFileSelect: ye, handleRemoveFile: be, transientError: xe, showTransientError: Se } = cr(g), Ce = ir({
1041
+ }), O?.(e, t);
1042
+ }, [ue, O]), { attachedFiles: pe, fileInputRef: me, onUploadFiles: V, acceptValue: he, isAtMaxFiles: ge, maxFiles: _e, processFiles: ve, handleFileSelect: ye, handleRemoveFile: be, transientError: xe, showTransientError: Se } = cr(g), we = ir({
1043
1043
  searchPersons: x,
1044
1044
  mentionSources: S
1045
1045
  });
1046
1046
  q(() => {
1047
- j || typeof window < "u" && window.location.hash.length === 0 && te.current?.focus();
1047
+ A || typeof window < "u" && window.location.hash.length === 0 && ne.current?.focus();
1048
1048
  }, []), q(() => {
1049
1049
  if (se) de(null);
1050
1050
  else return de(() => {
1051
- te.current?.focus();
1051
+ ne.current?.focus();
1052
1052
  }), () => de(null);
1053
1053
  }, [se, de]), q(() => {
1054
1054
  if (C) return C((e) => {
@@ -1057,10 +1057,10 @@ var lr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholde
1057
1057
  C(null);
1058
1058
  };
1059
1059
  }, [C, ve]);
1060
- let we = K((e) => void ve(e), [ve]), Te = pe.filter((e) => e.status === "uploaded"), De = pe.some((e) => e.status === "uploading"), H = pe.some((e) => e.status === "error"), Oe = !R.isEmpty || Te.length > 0, ke = async ({ text: t, mentions: n }) => {
1061
- if (H) return Se(I.ai.fileUploadBlockedSubmit), !1;
1060
+ let Te = K((e) => void ve(e), [ve]), Ee = pe.filter((e) => e.status === "uploaded"), De = pe.some((e) => e.status === "uploading"), H = pe.some((e) => e.status === "error"), Oe = !R.isEmpty || Ee.length > 0, U = async ({ text: t, mentions: n }) => {
1061
+ if (H) return Se(F.ai.fileUploadBlockedSubmit), !1;
1062
1062
  if (a && await a() === !1) return !1;
1063
- let r = Te, i = r.flatMap((e) => e.uploadedFile ? [e.uploadedFile] : []), o = f, s = m;
1063
+ let r = Ee, i = r.flatMap((e) => e.uploadedFile ? [e.uploadedFile] : []), o = f, s = m;
1064
1064
  o && p?.(null), s && h?.(null);
1065
1065
  try {
1066
1066
  await e({
@@ -1074,40 +1074,40 @@ var lr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholde
1074
1074
  }
1075
1075
  for (let e of r) be(e.id);
1076
1076
  return !0;
1077
- }, U = ne ? ne.prompt ?? ne.title : null, Ae = U ? [U] : s ?? [], je = A === "inside", Me = D && ee && ee.length > 0 && k ? /* @__PURE__ */ Z(Ee, {
1078
- suggestions: ee,
1077
+ }, ke = re ? re.prompt ?? re.title : null, Ae = ke ? [ke] : s ?? [], Me = k === "inside", Ne = D && te && te.length > 0 && O ? /* @__PURE__ */ Z(Ce, {
1078
+ suggestions: te,
1079
1079
  onItemClick: fe,
1080
- onItemHover: re,
1081
- side: je ? "bottom" : "top",
1082
- reserveTwoRows: !je,
1083
- overflow: je ? "scroll" : "wrap"
1084
- }) : null, Ne = !j || ie || Oe || R.recorder !== "idle", Fe = (e) => e instanceof Node ? z.current?.contains(e) ? !0 : e instanceof Element && e.closest("[data-radix-popper-content-wrapper]") !== null : !1, Ie = () => {
1080
+ onItemHover: ie,
1081
+ side: Me ? "bottom" : "top",
1082
+ reserveTwoRows: !Me,
1083
+ overflow: Me ? "scroll" : "wrap"
1084
+ }) : null, Pe = !A || ae || Oe || R.recorder !== "idle", Fe = (e) => e instanceof Node ? z.current?.contains(e) ? !0 : e instanceof Element && e.closest("[data-radix-popper-content-wrapper]") !== null : !1, Ie = () => {
1085
1085
  B.current && clearTimeout(B.current), B.current = setTimeout(() => {
1086
- Fe(document.activeElement) || ae(!1);
1086
+ Fe(document.activeElement) || L(!1);
1087
1087
  }, 0);
1088
- }, Le = je, Re = Le && j, ze = Re && !Ne, Be = Le && Me ? /* @__PURE__ */ Z("div", {
1088
+ }, Le = Me, Re = Le && A, ze = Re && !Pe, Be = Le && Ne ? /* @__PURE__ */ Z("div", {
1089
1089
  onClick: (e) => e.stopPropagation(),
1090
- children: Me
1090
+ children: Ne
1091
1091
  }) : void 0, Ve = {
1092
- duration: L ? 0 : .32,
1092
+ duration: I ? 0 : .32,
1093
1093
  ease: [
1094
1094
  .4,
1095
1095
  0,
1096
1096
  .2,
1097
1097
  1
1098
1098
  ]
1099
- }, He = D && O && !!M && M.length > 0, Ue = O && D, { motionProps: We } = Rn(D, 160, .5);
1099
+ }, He = D && ee && !!j && j.length > 0, Ue = ee && D, { motionProps: We } = Rn(D, 160, .5);
1100
1100
  return /* @__PURE__ */ Q(c.div, {
1101
- ref: F,
1101
+ ref: P,
1102
1102
  "data-composer-layout": Ue ? "welcome" : "docked",
1103
- className: i("flex flex-col items-center gap-2", N === "default" && "px-4 pb-3 pt-2", Ue && "min-h-0 flex-1 justify-start -mt-20"),
1104
- ...O ? We : {},
1103
+ className: i("flex flex-col items-center gap-2", M === "default" && "px-4 pb-3 pt-2", Ue && "min-h-0 flex-1 justify-start -mt-20"),
1104
+ ...ee ? We : {},
1105
1105
  children: [
1106
1106
  /* @__PURE__ */ Q("div", {
1107
1107
  className: "flex w-full max-w-content flex-col gap-2",
1108
- children: [Me && !je ? /* @__PURE__ */ Z("div", { children: j ? /* @__PURE__ */ Z(o, {
1108
+ children: [Ne && !Me ? /* @__PURE__ */ Z("div", { children: A ? /* @__PURE__ */ Z(o, {
1109
1109
  initial: !1,
1110
- children: Ne ? /* @__PURE__ */ Z(c.div, {
1110
+ children: Pe ? /* @__PURE__ */ Z(c.div, {
1111
1111
  className: "overflow-hidden",
1112
1112
  initial: {
1113
1113
  opacity: 0,
@@ -1122,53 +1122,53 @@ var lr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholde
1122
1122
  height: 0
1123
1123
  },
1124
1124
  transition: Ve,
1125
- children: Me
1125
+ children: Ne
1126
1126
  }, "welcome-suggestions") : null
1127
- }) : Me }) : null, /* @__PURE__ */ Z(Kn, {
1127
+ }) : Ne }) : null, /* @__PURE__ */ Z(Kn, {
1128
1128
  creditWarning: u,
1129
1129
  children: /* @__PURE__ */ Z(Ln, {
1130
1130
  asForm: !0,
1131
1131
  surfaceRef: z,
1132
- handleRef: te,
1132
+ handleRef: ne,
1133
1133
  className: "isolate z-20 items-stretch p-0 hover:cursor-text",
1134
1134
  accent: se,
1135
1135
  replacement: se ? d : null,
1136
- onSurfaceFocus: () => ae(!0),
1136
+ onSurfaceFocus: () => L(!0),
1137
1137
  onSurfaceBlur: Ie,
1138
1138
  onStateChange: oe,
1139
- onSend: ke,
1139
+ onSend: U,
1140
1140
  inProgress: r,
1141
1141
  onStop: n,
1142
- hasAttachments: Te.length > 0,
1142
+ hasAttachments: Ee.length > 0,
1143
1143
  sendBlocked: De,
1144
1144
  error: xe,
1145
1145
  role: "textbox",
1146
- name: P,
1146
+ name: N,
1147
1147
  placeholders: Ae,
1148
1148
  placeholdersPaused: r,
1149
1149
  labels: {
1150
- placeholder: I.ai.inputPlaceholder,
1151
- listening: I.ai.listening,
1152
- send: I.ai.sendMessage,
1153
- stop: I.ai.stopAnswerGeneration,
1154
- recordAudio: I.ai.recordAudio,
1155
- cancelRecording: I.ai.cancelRecording,
1156
- confirmRecording: I.ai.stopRecording,
1157
- micPermissionDenied: I.ai.micPermissionDenied,
1158
- micError: I.ai.micError,
1159
- transcriptionError: I.ai.transcriptionError,
1160
- mentionSuggestions: I.ai.mentions.suggestions
1150
+ placeholder: F.ai.inputPlaceholder,
1151
+ listening: F.ai.listening,
1152
+ send: F.ai.sendMessage,
1153
+ stop: F.ai.stopAnswerGeneration,
1154
+ recordAudio: F.ai.recordAudio,
1155
+ cancelRecording: F.ai.cancelRecording,
1156
+ confirmRecording: F.ai.stopRecording,
1157
+ micPermissionDenied: F.ai.micPermissionDenied,
1158
+ micError: F.ai.micError,
1159
+ transcriptionError: F.ai.transcriptionError,
1160
+ mentionSuggestions: F.ai.mentions.suggestions
1161
1161
  },
1162
1162
  mentions: {
1163
- sources: Ce,
1164
- showGroupLabels: Ce.length > 1
1163
+ sources: we,
1164
+ showGroupLabels: we.length > 1
1165
1165
  },
1166
1166
  voice: b ? {
1167
1167
  onTranscribe: b,
1168
1168
  onPress: ue?.onDictationStart,
1169
1169
  onCancelled: ue?.onDictationCancel
1170
1170
  } : void 0,
1171
- onPasteFiles: g?.onUploadFiles ? we : void 0,
1171
+ onPasteFiles: g?.onUploadFiles ? Te : void 0,
1172
1172
  pastePreferText: !0,
1173
1173
  header: m ? /* @__PURE__ */ Z(tr, {
1174
1174
  quote: m,
@@ -1178,23 +1178,23 @@ var lr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholde
1178
1178
  attachedFiles: pe,
1179
1179
  isUploading: De,
1180
1180
  onRemove: be,
1181
- removeLabel: I.ai.removeFile,
1182
- reducedMotion: L
1181
+ removeLabel: F.ai.removeFile,
1182
+ reducedMotion: I
1183
1183
  }),
1184
1184
  leading: Le ? /* @__PURE__ */ Z("div", {
1185
1185
  className: "flex shrink-0 self-center pl-3",
1186
- children: /* @__PURE__ */ Z(Pe, {
1186
+ children: /* @__PURE__ */ Z(je, {
1187
1187
  size: "sm",
1188
1188
  spin: r
1189
1189
  })
1190
1190
  }) : void 0,
1191
- toolbarStart: he || _ || v?.length ? (e) => /* @__PURE__ */ Q(Sn, { children: [/* @__PURE__ */ Z(Wn, {
1192
- onUploadFiles: he,
1191
+ toolbarStart: V || _ || v?.length ? (e) => /* @__PURE__ */ Q(Sn, { children: [/* @__PURE__ */ Z(Wn, {
1192
+ onUploadFiles: V,
1193
1193
  composerActions: v,
1194
1194
  onComposerActionsOpenChange: y,
1195
1195
  isAtMaxFiles: ge,
1196
1196
  maxFiles: _e,
1197
- acceptValue: V,
1197
+ acceptValue: he,
1198
1198
  fileInputRef: me,
1199
1199
  handleFileSelect: ye,
1200
1200
  recordingStatus: e
@@ -1206,26 +1206,26 @@ var lr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholde
1206
1206
  toolbarCenter: Be,
1207
1207
  collapsible: Re,
1208
1208
  collapsed: ze,
1209
- reducedMotion: L
1209
+ reducedMotion: I
1210
1210
  })
1211
1211
  })]
1212
1212
  }),
1213
1213
  He ? /* @__PURE__ */ Z("div", {
1214
1214
  className: "w-full max-w-content pt-2",
1215
- children: /* @__PURE__ */ Z(nr, { cards: M })
1215
+ children: /* @__PURE__ */ Z(nr, { cards: j })
1216
1216
  }) : null,
1217
- E && D && O ? /* @__PURE__ */ Z("div", {
1217
+ E && D && ee ? /* @__PURE__ */ Z("div", {
1218
1218
  className: "w-full py-4 mx-auto flex max-w-content justify-center",
1219
1219
  children: E
1220
1220
  }) : null,
1221
- /* @__PURE__ */ Z(xt, {
1221
+ /* @__PURE__ */ Z(yt, {
1222
1222
  hint: se ? {
1223
- navigate: I.ai.clarifyingQuestion.navHint.navigate,
1224
- select: I.ai.clarifyingQuestion.navHint.select,
1225
- cancel: I.ai.clarifyingQuestion.navHint.cancel
1223
+ navigate: F.ai.clarifyingQuestion.navHint.navigate,
1224
+ select: F.ai.clarifyingQuestion.navHint.select,
1225
+ cancel: F.ai.clarifyingQuestion.navHint.cancel
1226
1226
  } : null,
1227
1227
  disclaimer: Ue ? null : er(w, T),
1228
- reducedMotion: L
1228
+ reducedMotion: I
1229
1229
  })
1230
1230
  ]
1231
1231
  });
@@ -1265,7 +1265,7 @@ function mr({ ...e }) {
1265
1265
  //#endregion
1266
1266
  //#region src/addons/ai/F0AiChat/components/markdownRenderers/components/Image.tsx
1267
1267
  function hr({ src: e, alt: n, ...r }) {
1268
- let o = t(), s = ot(), c = ft(), l = H(e || void 0), [u, d] = X(!1), [p, m] = X(!1), g = n || (e ? x(e) : "") || "image";
1268
+ let o = t(), s = it(), c = ft(), l = Te(e || void 0), [u, d] = X(!1), [p, m] = X(!1), g = n || (e ? b(e) : "") || "image";
1269
1269
  if (!e || u || l.status === "error") return n ? /* @__PURE__ */ Z("span", {
1270
1270
  className: "text-f1-foreground-secondary",
1271
1271
  children: n
@@ -1298,7 +1298,7 @@ function hr({ src: e, alt: n, ...r }) {
1298
1298
  variant: "neutral",
1299
1299
  label: o.chat.download,
1300
1300
  hideLabel: !0,
1301
- icon: yt,
1301
+ icon: Tt,
1302
1302
  onClick: () => c(e, g)
1303
1303
  })
1304
1304
  })]
@@ -1307,7 +1307,7 @@ function hr({ src: e, alt: n, ...r }) {
1307
1307
  //#endregion
1308
1308
  //#region src/addons/ai/F0AiChat/components/markdownRenderers/components/Link.tsx
1309
1309
  function gr({ children: e, className: t, ...n }) {
1310
- return /* @__PURE__ */ Z(Qe, {
1310
+ return /* @__PURE__ */ Z(Ze, {
1311
1311
  ...n,
1312
1312
  className: i("[overflow-wrap:anywhere]", t),
1313
1313
  variant: "link",
@@ -1374,7 +1374,7 @@ function br({ id: e, trigger: t, resolver: n, contentClassName: r = "w-64", ...a
1374
1374
  side: "top",
1375
1375
  align: "start",
1376
1376
  className: i(r, "rounded-2xl border-none p-0 shadow-md"),
1377
- children: l ? /* @__PURE__ */ Z(Tt.Skeleton, {}) : a.renderCard ? a.renderCard(h) : /* @__PURE__ */ Z(Tt, { ...h ? a.mapToCard(h) : a.fallbackCard })
1377
+ children: l ? /* @__PURE__ */ Z(Et.Skeleton, {}) : a.renderCard ? a.renderCard(h) : /* @__PURE__ */ Z(Et, { ...h ? a.mapToCard(h) : a.fallbackCard })
1378
1378
  })]
1379
1379
  });
1380
1380
  }
@@ -1489,7 +1489,7 @@ function Er({ id: e, label: n }) {
1489
1489
  let { entityRefs: r } = W(), i = r?.resolvers?.expense, a = t(), o = r?.urls?.expense?.(e), s = J(() => (e) => ({
1490
1490
  avatar: {
1491
1491
  type: "icon",
1492
- icon: y
1492
+ icon: Je
1493
1493
  },
1494
1494
  title: e.description || `Expense #${e.id}`,
1495
1495
  description: [e.amount, e.status].filter(Boolean).join(" · "),
@@ -1741,10 +1741,10 @@ function zr({ type: e, id: t, children: n }) {
1741
1741
  //#endregion
1742
1742
  //#region src/addons/ai/F0AiChat/components/markdownRenderers/components/Table.tsx
1743
1743
  async function Br(e, t, n) {
1744
- let r = Je(e), i = t === "xlsx" ? await ie([{
1744
+ let r = Ge(e), i = t === "xlsx" ? await ae([{
1745
1745
  name: "Data",
1746
1746
  rows: r
1747
- }]) : await Ze(r);
1747
+ }]) : await Xe(r);
1748
1748
  g(i, `${n}.${t}`);
1749
1749
  }
1750
1750
  function Vr({ children: e, title: n, ...r }) {
@@ -1761,16 +1761,16 @@ function Vr({ children: e, title: n, ...r }) {
1761
1761
  tag: "h2",
1762
1762
  className: "text-base font-medium capitalize text-f1-foreground",
1763
1763
  children: n ?? a.ai.reportCard.tableLabel
1764
- }), /* @__PURE__ */ Z(tt, {
1765
- icon: yt,
1764
+ }), /* @__PURE__ */ Z(et, {
1765
+ icon: Tt,
1766
1766
  size: "md",
1767
1767
  items: [{
1768
1768
  label: a.t("ai.dataDownload.download", { format: "Excel" }),
1769
- icon: yt,
1769
+ icon: Tt,
1770
1770
  onClick: () => s("xlsx")
1771
1771
  }, {
1772
1772
  label: a.t("ai.dataDownload.download", { format: "CSV" }),
1773
- icon: yt,
1773
+ icon: Tt,
1774
1774
  onClick: () => s("csv")
1775
1775
  }]
1776
1776
  })]
@@ -1874,7 +1874,7 @@ var Xr = {
1874
1874
  return i ? `${r}.${i}` : r;
1875
1875
  }
1876
1876
  let n = t.split("?")[1], r = n ? new URLSearchParams(n.split("#")[0]).get("path") : null;
1877
- return x(r ?? t) || e || "file";
1877
+ return b(r ?? t) || e || "file";
1878
1878
  }, $r = (e, t) => e.startsWith("data:") ? e : `data:${t ?? "application/octet-stream"};base64,${e}`, ei = (e, t) => {
1879
1879
  let n = $(e.data), r = $(e.url) ?? (n ? $r(n, t) : void 0);
1880
1880
  if (!r) return null;
@@ -1925,11 +1925,11 @@ var Xr = {
1925
1925
  if (n.length !== 0) return t === "user" ? n[n.length - 1] : n.join("\n\n");
1926
1926
  }, ci = (e, { urlFor: t } = {}) => ({
1927
1927
  url: e.url ?? t?.(e.path) ?? e.path,
1928
- name: e.displayName || x(e.path),
1928
+ name: e.displayName || b(e.path),
1929
1929
  mimeType: e.mimeType,
1930
1930
  size: e.bytes,
1931
1931
  previewUrl: e.preview ? t?.(e.preview.path) ?? e.preview.url : void 0
1932
- }), li = (e) => A(e) ?? "", ui = pn(!1), di = () => _n(ui), fi = (e, t) => {
1932
+ }), li = (e) => k(e) ?? "", ui = pn(!1), di = () => _n(ui), fi = (e, t) => {
1933
1933
  let [n, r] = X(() => t ? null : new Set(e));
1934
1934
  return t && n !== null ? r(null) : !t && n === null && r(new Set(e)), (e) => e !== void 0 && n !== null && !n.has(e);
1935
1935
  }, pi = ({ avatar: e }) => e?.type === "module" ? /* @__PURE__ */ Z(Nt, {
@@ -2036,7 +2036,7 @@ function wi(e) {
2036
2036
  return e && e.charAt(0).toUpperCase() + e.slice(1);
2037
2037
  }
2038
2038
  function Ti(e) {
2039
- let { days: t, hours: n, minutes: r, seconds: i } = ne(e), a = [];
2039
+ let { days: t, hours: n, minutes: r, seconds: i } = re(e), a = [];
2040
2040
  return t > 0 && a.push(`${t}d`), n > 0 && a.push(`${n}h`), r > 0 && a.push(`${r}m`), (i > 0 || a.length === 0) && a.push(`${i}s`), a.join(" ");
2041
2041
  }
2042
2042
  function Ei(e) {
@@ -2138,7 +2138,7 @@ function Ai({ formName: e, formDescription: t, module: n, cardTitle: r, cardDesc
2138
2138
  if (!e) return !1;
2139
2139
  let t = Array.isArray(e.content) ? e.content[0] : e.content;
2140
2140
  return t?.type !== "item" || t.text !== "—";
2141
- }) : [], b = y.slice(0, bi), x = y.length > bi;
2141
+ }) : [], b = y.slice(0, bi), S = y.length > bi;
2142
2142
  return /* @__PURE__ */ Z(hi, {
2143
2143
  avatar: n ? {
2144
2144
  type: "module",
@@ -2155,13 +2155,13 @@ function Ai({ formName: e, formDescription: t, module: n, cardTitle: r, cardDesc
2155
2155
  },
2156
2156
  children: b.length > 0 && !_ ? /* @__PURE__ */ Z("div", {
2157
2157
  className: "-mx-3 flex w-full flex-col overflow-hidden pb-1",
2158
- children: /* @__PURE__ */ Z(S, {
2158
+ children: /* @__PURE__ */ Z(x, {
2159
2159
  details: b.map((e) => ({
2160
2160
  title: e.label,
2161
2161
  content: e.content,
2162
2162
  ...e.verticalLayout && { verticalLayout: !0 }
2163
2163
  })),
2164
- showSeeMore: x,
2164
+ showSeeMore: S,
2165
2165
  onClickSeeMore: v,
2166
2166
  tableView: !0
2167
2167
  })
@@ -2172,7 +2172,7 @@ Ai.displayName = "FormCard";
2172
2172
  //#endregion
2173
2173
  //#region src/addons/ai/F0AiMessagesContainer/components/ActiveFormCard.tsx
2174
2174
  function ji() {
2175
- let e = Ct(), t = e?.activeForm;
2175
+ let e = St(), t = e?.activeForm;
2176
2176
  if (!t) return null;
2177
2177
  let n = t.cardTitle, r = t.cardDescription, i = (e?.getFillVersion(t.formName) ?? 0) > 0;
2178
2178
  return !n || !r || !i ? null : /* @__PURE__ */ Z("div", {
@@ -2264,9 +2264,9 @@ function Bi({ viewportRef: e, contentRef: t }) {
2264
2264
  //#endregion
2265
2265
  //#region src/addons/ai/F0AiFileAttachments/components/FileCanvasCards.tsx
2266
2266
  var Vi = 625, Hi = /* @__PURE__ */ new Set(), Ui = ({ documents: e, onOpenFile: t, onCanvasUnavailable: n }) => {
2267
- let { canvasContent: r, tryOpenCanvas: i, closeCanvas: a, dismissCanvas: o, panelOverlays: s } = W(), c = Me(), l = di(), u = e.map((e) => e.file), d = (r, { fallback: a = !0 } = {}) => {
2267
+ let { canvasContent: r, tryOpenCanvas: i, closeCanvas: a, dismissCanvas: o, panelOverlays: s } = W(), c = U(), l = di(), u = e.map((e) => e.file), d = (r, { fallback: a = !0 } = {}) => {
2268
2268
  let o = e[r];
2269
- o && t?.(o.file, "document", { documentKind: o.documentKind }) !== !1 && !(i?.(dt({
2269
+ o && t?.(o.file, "document", { documentKind: o.documentKind }) !== !1 && !(i?.(ut({
2270
2270
  files: u,
2271
2271
  index: r,
2272
2272
  config: c
@@ -2286,7 +2286,7 @@ var Vi = 625, Hi = /* @__PURE__ */ new Set(), Ui = ({ documents: e, onOpenFile:
2286
2286
  className: "flex w-full max-w-sm flex-col gap-2",
2287
2287
  "data-testid": "ai-chat-file-canvas-cards",
2288
2288
  children: e.map(({ file: e }, t) => {
2289
- let n = De(r, e.url);
2289
+ let n = we(r, e.url);
2290
2290
  return /* @__PURE__ */ Z("div", {
2291
2291
  "data-active": n || void 0,
2292
2292
  "data-testid": "ai-chat-file-canvas-card",
@@ -2300,7 +2300,7 @@ var Vi = 625, Hi = /* @__PURE__ */ new Set(), Ui = ({ documents: e, onOpenFile:
2300
2300
  }
2301
2301
  },
2302
2302
  title: e.name,
2303
- description: e.size ? be(e.size) : le(e.name, li(e)),
2303
+ description: e.size ? ge(e.size) : ce(e.name, li(e)),
2304
2304
  isActive: n,
2305
2305
  action: {
2306
2306
  type: "open",
@@ -2312,8 +2312,8 @@ var Vi = 625, Hi = /* @__PURE__ */ new Set(), Ui = ({ documents: e, onOpenFile:
2312
2312
  })
2313
2313
  });
2314
2314
  }, Wi = "rounded-xl", Gi = "ai-chat", Ki = (e) => {
2315
- let { provided: t } = R();
2316
- return t ? /* @__PURE__ */ Z(Yi, { ...e }) : /* @__PURE__ */ Z(Xe, { children: /* @__PURE__ */ Z(Yi, { ...e }) });
2315
+ let { provided: t } = L();
2316
+ return t ? /* @__PURE__ */ Z(Yi, { ...e }) : /* @__PURE__ */ Z(Ye, { children: /* @__PURE__ */ Z(Yi, { ...e }) });
2317
2317
  }, qi = {
2318
2318
  image: 0,
2319
2319
  video: 1,
@@ -2321,11 +2321,11 @@ var Vi = 625, Hi = /* @__PURE__ */ new Set(), Ui = ({ documents: e, onOpenFile:
2321
2321
  audio: 3,
2322
2322
  file: 4
2323
2323
  }, Ji = (e) => e.bucket === "image" || e.bucket === "video" || e.bucket === "audio" || e.bucket === "document" ? e.bucket : "file", Yi = ({ files: e, align: t = "start", onOpenFile: n, onFileDownloaded: r, size: i = "default", opensIn: a }) => {
2324
- let { remotePreviews: o } = R(), s = pe(), c = i === "default" && (a ?? (t === "start" && s ? "canvas" : "viewer")) === "canvas", [l, u] = X(() => /* @__PURE__ */ new Set()), d = J(() => Xi(e, o, l), [
2324
+ let { remotePreviews: o } = L(), s = de(), c = i === "default" && (a ?? (t === "start" && s ? "canvas" : "viewer")) === "canvas", [l, u] = X(() => /* @__PURE__ */ new Set()), d = J(() => Xi(e, o, l), [
2325
2325
  e,
2326
2326
  o,
2327
2327
  l
2328
- ]), f = J(() => i === "compact" ? d : [...d].sort((e, t) => qi[e.cls.bucket] - qi[t.cls.bucket]), [d, i]), p = me(f, "transcript");
2328
+ ]), f = J(() => i === "compact" ? d : [...d].sort((e, t) => qi[e.cls.bucket] - qi[t.cls.bucket]), [d, i]), p = fe(f, "transcript");
2329
2329
  return e.length === 0 ? null : Z(i === "compact" ? $i : Qi, {
2330
2330
  entries: d,
2331
2331
  canvas: c,
@@ -2338,12 +2338,12 @@ var Vi = 625, Hi = /* @__PURE__ */ new Set(), Ui = ({ documents: e, onOpenFile:
2338
2338
  onImageError: (e) => u((t) => new Set(t).add(e.url))
2339
2339
  });
2340
2340
  }, Xi = (e, t, n) => e.map((e, r) => {
2341
- let i = M(e), a = !(t || et(e.url)) || i.bucket === "file" || i.bucket === "image" && n.has(e.url);
2341
+ let i = M(e), a = !(t || $e(e.url)) || i.bucket === "file" || i.bucket === "image" && n.has(e.url);
2342
2342
  return {
2343
2343
  file: e,
2344
2344
  cls: i,
2345
2345
  generic: a,
2346
- item: a ? null : D(e, re(r, e.url))
2346
+ item: a ? null : D(e, ie(r, e.url))
2347
2347
  };
2348
2348
  }), Zi = ({ align: e, compact: t = !1, children: n }) => /* @__PURE__ */ Z("div", {
2349
2349
  className: i("flex w-full min-w-0 flex-col gap-1.5", e === "end" ? "items-end" : "items-start"),
@@ -2376,7 +2376,7 @@ var Vi = 625, Hi = /* @__PURE__ */ new Set(), Ui = ({ documents: e, onOpenFile:
2376
2376
  c.map((e, t) => {
2377
2377
  let { file: n, cls: r } = e, i = `${n.name}-${t}`;
2378
2378
  return r.bucket === "video" ? /* @__PURE__ */ Z(wt, {
2379
- file: Se(n),
2379
+ file: ve(n),
2380
2380
  cornerClass: "rounded-xl",
2381
2381
  testIdPrefix: Gi,
2382
2382
  onDownloaded: () => s?.(n)
@@ -2385,7 +2385,7 @@ var Vi = 625, Hi = /* @__PURE__ */ new Set(), Ui = ({ documents: e, onOpenFile:
2385
2385
  f || t ? null : d.map((e, t) => {
2386
2386
  let { file: n, cls: i } = e;
2387
2387
  return i.bucket === "document" ? /* @__PURE__ */ Z(m, {
2388
- file: Se(n),
2388
+ file: ve(n),
2389
2389
  kind: i.kind,
2390
2390
  cornerClass: "rounded-xl",
2391
2391
  testIdPrefix: Gi,
@@ -2397,8 +2397,8 @@ var Vi = 625, Hi = /* @__PURE__ */ new Set(), Ui = ({ documents: e, onOpenFile:
2397
2397
  onDownloaded: () => s?.(n)
2398
2398
  }, `${n.name}-${t}`) : null;
2399
2399
  }),
2400
- c.map((e, t) => e.cls.bucket === "audio" ? /* @__PURE__ */ Z(St, {
2401
- file: Se(e.file),
2400
+ c.map((e, t) => e.cls.bucket === "audio" ? /* @__PURE__ */ Z(xt, {
2401
+ file: ve(e.file),
2402
2402
  testIdPrefix: Gi,
2403
2403
  onDownloaded: () => s?.(e.file)
2404
2404
  }, `${e.file.name}-${t}`) : null),
@@ -2409,7 +2409,7 @@ var Vi = 625, Hi = /* @__PURE__ */ new Set(), Ui = ({ documents: e, onOpenFile:
2409
2409
  children: [_.length > 0 ? _.map((e, t) => {
2410
2410
  let { file: n, cls: i } = e;
2411
2411
  return i.bucket === "document" ? /* @__PURE__ */ Z(m, {
2412
- file: Se(n),
2412
+ file: ve(n),
2413
2413
  kind: i.kind,
2414
2414
  cornerClass: "rounded-xl",
2415
2415
  compact: !0,
@@ -2444,12 +2444,12 @@ var Vi = 625, Hi = /* @__PURE__ */ new Set(), Ui = ({ documents: e, onOpenFile:
2444
2444
  }, c) : s.bucket === "video" ? /* @__PURE__ */ Z(ra, {
2445
2445
  file: i,
2446
2446
  onOpen: () => n(e)
2447
- }, c) : s.bucket === "audio" ? /* @__PURE__ */ Z(de, {
2448
- file: Se(i),
2447
+ }, c) : s.bucket === "audio" ? /* @__PURE__ */ Z(ue, {
2448
+ file: ve(i),
2449
2449
  testIdPrefix: Gi,
2450
2450
  onOpen: () => n(e)
2451
2451
  }, c) : s.bucket === "document" ? /* @__PURE__ */ Z(m, {
2452
- file: Se(i),
2452
+ file: ve(i),
2453
2453
  kind: s.kind,
2454
2454
  cornerClass: "rounded-xl",
2455
2455
  compact: !0,
@@ -2464,24 +2464,24 @@ var Vi = 625, Hi = /* @__PURE__ */ new Set(), Ui = ({ documents: e, onOpenFile:
2464
2464
  })
2465
2465
  }), ea = ({ file: e, onFileDownloaded: n }) => {
2466
2466
  let r = t(), i = ft(), a = li(e);
2467
- return /* @__PURE__ */ Z(_t, {
2467
+ return /* @__PURE__ */ Z(ht, {
2468
2468
  file: {
2469
2469
  ...e,
2470
2470
  mimeType: a
2471
2471
  },
2472
- icon: a === "application/zip" ? I : void 0,
2472
+ icon: a === "application/zip" ? ct : void 0,
2473
2473
  testId: `${Gi}-file-tile`,
2474
2474
  action: {
2475
2475
  label: r.t("chat.downloadNamedFile", { name: e.name }),
2476
- icon: yt,
2476
+ icon: Tt,
2477
2477
  onClick: () => {
2478
2478
  i(e.url, e.name), n?.(e);
2479
2479
  }
2480
2480
  }
2481
2481
  });
2482
2482
  }, ta = "relative box-border h-[132px] w-[168px] shrink-0 overflow-hidden rounded-xl border border-solid border-f1-border-secondary bg-f1-background-secondary p-0 transition-opacity hover:opacity-90", na = ({ file: e, onOpen: n, onError: r }) => {
2483
- let o = t(), s = H(e.thumbnailUrl ?? e.url);
2484
- return Ge(s.status, r), /* @__PURE__ */ Z("button", {
2483
+ let o = t(), s = Te(e.thumbnailUrl ?? e.url);
2484
+ return Ve(s.status, r), /* @__PURE__ */ Z("button", {
2485
2485
  type: "button",
2486
2486
  onClick: n,
2487
2487
  draggable: !1,
@@ -2497,31 +2497,31 @@ var Vi = 625, Hi = /* @__PURE__ */ new Set(), Ui = ({ documents: e, onOpenFile:
2497
2497
  }) : null
2498
2498
  });
2499
2499
  }, ra = ({ file: e, onOpen: n }) => {
2500
- let r = t(), { urlCache: o } = Me(), s = H(e.thumbnailUrl), c = !e.thumbnailUrl && o === null, [l, u] = X(!1);
2500
+ let r = t(), { urlCache: o } = U(), s = Te(e.thumbnailUrl), c = !e.thumbnailUrl && o === null, [l, u] = X(!1);
2501
2501
  return /* @__PURE__ */ Q("button", {
2502
2502
  type: "button",
2503
2503
  onClick: n,
2504
2504
  "aria-label": r.t("chat.videoPlayerLabel", { name: e.name }),
2505
2505
  className: i(ta, a()),
2506
2506
  "data-testid": "ai-chat-video-attachment",
2507
- children: [!l && (s.status === "ready" || c) ? /* @__PURE__ */ Z(lt, {
2507
+ children: [!l && (s.status === "ready" || c) ? /* @__PURE__ */ Z(st, {
2508
2508
  url: e.url,
2509
2509
  posterUrl: s.status === "ready" ? s.url : void 0,
2510
2510
  onError: () => u(!0)
2511
2511
  }) : null, /* @__PURE__ */ Z(F, {})]
2512
2512
  });
2513
2513
  }, ia = ({ images: e, onOpen: n, onImageError: r }) => {
2514
- let a = t(), o = e.length === 1 ? e[0] : void 0, s = H(o ? o.thumbnailUrl ?? o.url : void 0), c = Ve(o && s.status === "ready" ? s.url : void 0, o) ?? void 0, l = o ? We(c?.width, c?.height) : null;
2514
+ let a = t(), o = e.length === 1 ? e[0] : void 0, s = Te(o ? o.thumbnailUrl ?? o.url : void 0), c = Le(o && s.status === "ready" ? s.url : void 0, o) ?? void 0, l = o ? Be(c?.width, c?.height) : null;
2515
2515
  return /* @__PURE__ */ Z("div", {
2516
2516
  style: l ? { width: l.width } : void 0,
2517
- className: i("grid grid-cols-2 overflow-hidden border border-solid border-f1-border-secondary", l ? "max-w-full" : ue, N, Wi),
2517
+ className: i("grid grid-cols-2 overflow-hidden border border-solid border-f1-border-secondary", l ? "max-w-full" : le, N, Wi),
2518
2518
  "data-testid": "ai-chat-image-album",
2519
- children: it(c ? [c] : e).map((t, o, s) => {
2519
+ children: nt(c ? [c] : e).map((t, o, s) => {
2520
2520
  let c = e[t.index];
2521
2521
  if (!c) return null;
2522
2522
  let l = o === s.length - 1;
2523
- return /* @__PURE__ */ Z(U, {
2524
- image: we(c),
2523
+ return /* @__PURE__ */ Z(H, {
2524
+ image: xe(c),
2525
2525
  aspectRatio: t.aspectRatio,
2526
2526
  spanFull: t.span === 2,
2527
2527
  inset: t.inset,
@@ -2537,7 +2537,7 @@ var Vi = 625, Hi = /* @__PURE__ */ new Set(), Ui = ({ documents: e, onOpenFile:
2537
2537
  testIdPrefix: Gi,
2538
2538
  overlay: t.hiddenCount > 0 ? /* @__PURE__ */ Z("span", {
2539
2539
  "aria-hidden": !0,
2540
- className: i("absolute inset-0 flex items-center justify-center text-2xl font-semibold text-f1-foreground-inverse", Ce),
2540
+ className: i("absolute inset-0 flex items-center justify-center text-2xl font-semibold text-f1-foreground-inverse", ye),
2541
2541
  "data-testid": "ai-chat-image-album-more",
2542
2542
  children: `+${t.hiddenCount}`
2543
2543
  }) : void 0
@@ -2616,7 +2616,7 @@ function da({ anchor: e, onReply: n }) {
2616
2616
  type: "button",
2617
2617
  variant: "ghost",
2618
2618
  label: c,
2619
- icon: nt,
2619
+ icon: gt,
2620
2620
  onClick: () => {
2621
2621
  n(e.text);
2622
2622
  }
@@ -2625,7 +2625,7 @@ function da({ anchor: e, onReply: n }) {
2625
2625
  }
2626
2626
  //#endregion
2627
2627
  //#region src/addons/ai/F0AiMessagesContainer/components/AssistantMessage.tsx
2628
- var fa = pn(void 0), pa = () => _n(fa), ma = (e) => /* @__PURE__ */ Z(Te, {
2628
+ var fa = pn(void 0), pa = () => _n(fa), ma = (e) => /* @__PURE__ */ Z(Se, {
2629
2629
  content: e,
2630
2630
  format: "markdown"
2631
2631
  }), ha = ({ isGenerating: e, isLoading: t, isLive: n = !1, message: r, renderToolCall: i, onReplyQuote: a, onRendered: o, renderMarkdown: s }) => {
@@ -2690,7 +2690,7 @@ var fa = pn(void 0), pa = () => _n(fa), ma = (e) => /* @__PURE__ */ Z(Te, {
2690
2690
  return document.addEventListener("keydown", e), () => {
2691
2691
  document.removeEventListener("keydown", e);
2692
2692
  };
2693
- }, [d]), /* @__PURE__ */ Z(_e, {
2693
+ }, [d]), /* @__PURE__ */ Z(V, {
2694
2694
  position: "center",
2695
2695
  isOpen: !0,
2696
2696
  onClose: f,
@@ -2707,7 +2707,7 @@ var fa = pn(void 0), pa = () => _n(fa), ma = (e) => /* @__PURE__ */ Z(Te, {
2707
2707
  },
2708
2708
  children: /* @__PURE__ */ Z("div", {
2709
2709
  className: "flex flex-col gap-6",
2710
- children: /* @__PURE__ */ Z(Ye, {
2710
+ children: /* @__PURE__ */ Z(qe, {
2711
2711
  autoFocus: !0,
2712
2712
  label: l,
2713
2713
  placeholder: u,
@@ -2772,7 +2772,7 @@ var xa = ({ content: e, targetMessage: n, onCopy: r, actions: i = [] }) => {
2772
2772
  return /* @__PURE__ */ Q("div", {
2773
2773
  className: "flex",
2774
2774
  children: [
2775
- /* @__PURE__ */ Z(xe, {
2775
+ /* @__PURE__ */ Z(_e, {
2776
2776
  size: "md",
2777
2777
  variant: "ghost",
2778
2778
  valueToCopy: e,
@@ -2793,7 +2793,7 @@ var xa = ({ content: e, targetMessage: n, onCopy: r, actions: i = [] }) => {
2793
2793
  className: "flex min-w-0 flex-1 items-center justify-center gap-1",
2794
2794
  children: /* @__PURE__ */ Z(G, {
2795
2795
  size: "md",
2796
- icon: c === "like" ? k : L,
2796
+ icon: c === "like" ? I : lt,
2797
2797
  color: "default"
2798
2798
  })
2799
2799
  })
@@ -2811,7 +2811,7 @@ var xa = ({ content: e, targetMessage: n, onCopy: r, actions: i = [] }) => {
2811
2811
  className: "flex min-w-0 flex-1 items-center justify-center gap-1",
2812
2812
  children: /* @__PURE__ */ Z(G, {
2813
2813
  size: "md",
2814
- icon: c === "dislike" ? ut : P,
2814
+ icon: c === "dislike" ? P : be,
2815
2815
  color: "default"
2816
2816
  })
2817
2817
  })
@@ -2854,7 +2854,7 @@ var xa = ({ content: e, targetMessage: n, onCopy: r, actions: i = [] }) => {
2854
2854
  ])
2855
2855
  }), Ca = ({ icon: e, title: t, children: n, open: r, defaultOpen: a = !1, onOpenChange: o, lockOpen: s = !1 }) => {
2856
2856
  let [u, d] = X(a), f = l(), p = r !== void 0, m = p ? r : u;
2857
- return /* @__PURE__ */ Q(E, {
2857
+ return /* @__PURE__ */ Q(w, {
2858
2858
  className: "mb-1 w-full",
2859
2859
  open: m,
2860
2860
  onOpenChange: (e) => {
@@ -2877,7 +2877,7 @@ var xa = ({ content: e, targetMessage: n, onCopy: r, actions: i = [] }) => {
2877
2877
  }),
2878
2878
  s ? null : /* @__PURE__ */ Z(G, { icon: nn })
2879
2879
  ]
2880
- }), /* @__PURE__ */ Z(w, {
2880
+ }), /* @__PURE__ */ Z(C, {
2881
2881
  forceMount: !0,
2882
2882
  className: "data-[state=open]:mt-3",
2883
2883
  children: /* @__PURE__ */ Z(c.div, {
@@ -2933,7 +2933,7 @@ var xa = ({ content: e, targetMessage: n, onCopy: r, actions: i = [] }) => {
2933
2933
  }, [r, s]);
2934
2934
  let u = r ? o.ai.thoughtsGroupTitle : n ?? o.ai.thoughtsGroupTitle, d = e.length - 1, f = (e) => !r || i ? "completed" : e === d ? "executing" : "completed";
2935
2935
  return /* @__PURE__ */ Z(Ca, {
2936
- icon: ye,
2936
+ icon: O,
2937
2937
  title: u,
2938
2938
  open: s,
2939
2939
  onOpenChange: c,
@@ -2942,7 +2942,7 @@ var xa = ({ content: e, targetMessage: n, onCopy: r, actions: i = [] }) => {
2942
2942
  className: "flex flex-col gap-3 pb-4",
2943
2943
  children: e.map((t, n) => /* @__PURE__ */ Q("div", {
2944
2944
  className: "relative",
2945
- children: [/* @__PURE__ */ Z(He, {
2945
+ children: [/* @__PURE__ */ Z(Re, {
2946
2946
  title: t,
2947
2947
  status: f(n),
2948
2948
  suffix: f(n) === "executing" ? /* @__PURE__ */ Z(Ea, { startedAt: a }) : void 0,
@@ -2954,14 +2954,14 @@ var xa = ({ content: e, targetMessage: n, onCopy: r, actions: i = [] }) => {
2954
2954
  }, n))
2955
2955
  })
2956
2956
  });
2957
- }, Oa = (e) => /* @__PURE__ */ Z(Te, {
2957
+ }, Oa = (e) => /* @__PURE__ */ Z(Se, {
2958
2958
  content: e,
2959
2959
  format: "markdown"
2960
2960
  }), ka = ({ text: e, renderMarkdown: t }) => /* @__PURE__ */ Q("div", {
2961
2961
  className: "flex max-w-[90%] items-start gap-2 self-end pb-1 pr-2 text-f1-foreground-tertiary",
2962
2962
  children: [/* @__PURE__ */ Z("div", {
2963
2963
  className: "flex h-5 items-center",
2964
- children: /* @__PURE__ */ Z(G, { icon: mt })
2964
+ children: /* @__PURE__ */ Z(G, { icon: ke })
2965
2965
  }), /* @__PURE__ */ Z("div", {
2966
2966
  className: "min-w-0 whitespace-pre-wrap break-words text-base leading-5 [&>div]:flex [&>div]:flex-col [&>div]:gap-1 [&_p]:m-0",
2967
2967
  children: (t ?? Oa)(e)
@@ -3143,28 +3143,28 @@ var Ba = {
3143
3143
  onThumbsUp: () => {},
3144
3144
  onThumbsDown: () => {}
3145
3145
  }, Va = (e) => {
3146
- let t = R(), n = /* @__PURE__ */ Z(va, { children: /* @__PURE__ */ Z(Ha, { ...e }) });
3147
- return e.filePreviews || !t.provided ? /* @__PURE__ */ Z(Xe, {
3146
+ let t = L(), n = /* @__PURE__ */ Z(va, { children: /* @__PURE__ */ Z(Ha, { ...e }) });
3147
+ return e.filePreviews || !t.provided ? /* @__PURE__ */ Z(Ye, {
3148
3148
  filePreviews: e.filePreviews,
3149
3149
  children: n
3150
3150
  }) : n;
3151
3151
  }, Ha = ({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a, initialMessageCaption: s, initialMessageSubtitle: l, initialMessageCta: d, onWelcomeClick: f, renderToolCall: p, onReplyQuote: m, onAssistantMessageRendered: h, autoScrollUserIntoView: g = !0, renderMarkdown: _, feedback: v, freezeLayout: y = !1, noShadows: b = !1, fullscreen: x = !1, children: S, AssistantMessage: C, UserMessage: w, onRegenerate: T, onCopy: E }) => {
3152
- let { modal: D, handleSubmit: O, handleClose: ee } = ba(v ?? Ba), k = t(), A = C ?? ha, j = w ?? Aa, M = J(() => {
3153
- let e = a ?? k.ai.defaultInitialMessage;
3152
+ let { modal: D, handleSubmit: ee, handleClose: te } = ba(v ?? Ba), O = t(), k = C ?? ha, A = w ?? Aa, j = J(() => {
3153
+ let e = a ?? O.ai.defaultInitialMessage;
3154
3154
  return (Array.isArray(e) ? e : [e]).filter((e) => typeof e == "string" && e.length > 0);
3155
- }, [a, k.ai.defaultInitialMessage]), N = !n && e.length === 0 && M.length > 0, P = Y(null), F = Y(null), I = Y(null), L = Y(null), te = Y(null), { showScrollBtn: ne, turnMinHeight: re, scrollToBottom: ie } = za({
3156
- viewportRef: P,
3157
- contentRef: F,
3158
- endRef: I,
3159
- lastTurnRef: te,
3155
+ }, [a, O.ai.defaultInitialMessage]), M = !n && e.length === 0 && j.length > 0, N = Y(null), P = Y(null), F = Y(null), I = Y(null), ne = Y(null), { showScrollBtn: re, turnMinHeight: ie, scrollToBottom: ae } = za({
3156
+ viewportRef: N,
3157
+ contentRef: P,
3158
+ endRef: F,
3159
+ lastTurnRef: ne,
3160
3160
  turnsCount: e.length,
3161
3161
  freezeTurnMinHeight: y
3162
3162
  });
3163
3163
  Bi({
3164
- viewportRef: P,
3165
- contentRef: F
3164
+ viewportRef: N,
3165
+ contentRef: P
3166
3166
  });
3167
- let ae = e[e.length - 1], R = Ra(!(!ae || ae.endIndicator !== "thinking" && !ae.thinking?.inProgress), ae?.thinking?.startedAt), oe = ae?.endIndicator === "asking", z = fi(e.flatMap((e) => e.assistantMessages.flatMap((e) => e.id ? [e.id] : [])), n), B = (t, n) => {
3167
+ let L = e[e.length - 1], R = Ra(!(!L || L.endIndicator !== "thinking" && !L.thinking?.inProgress), L?.thinking?.startedAt), oe = L?.endIndicator === "asking", z = fi(e.flatMap((e) => e.assistantMessages.flatMap((e) => e.id ? [e.id] : [])), n), B = (t, n) => {
3168
3168
  let r = n === e.length - 1, a = {
3169
3169
  renderToolCall: p,
3170
3170
  onReplyQuote: m,
@@ -3177,28 +3177,28 @@ var Ba = {
3177
3177
  inProgress: t.isInProgress,
3178
3178
  index: r,
3179
3179
  isCurrentMessage: !1,
3180
- AssistantMessage: A,
3181
- UserMessage: j,
3180
+ AssistantMessage: k,
3181
+ UserMessage: A,
3182
3182
  onRegenerate: T,
3183
3183
  onCopy: E,
3184
3184
  rawData: e.rawData || {},
3185
3185
  ...a
3186
3186
  };
3187
- return /* @__PURE__ */ Z(j, { ...i }, `${n}-u-${r}`);
3187
+ return /* @__PURE__ */ Z(A, { ...i }, `${n}-u-${r}`);
3188
3188
  }, s = (e, i) => {
3189
3189
  let o = r && i === t.assistantMessages.length - 1, s = t.userMessages.length + i, c = {
3190
3190
  message: e,
3191
3191
  inProgress: t.isInProgress,
3192
3192
  index: s,
3193
3193
  isCurrentMessage: o,
3194
- AssistantMessage: A,
3195
- UserMessage: j,
3194
+ AssistantMessage: k,
3195
+ UserMessage: A,
3196
3196
  onRegenerate: T,
3197
3197
  onCopy: E,
3198
3198
  rawData: e.rawData || {},
3199
3199
  ...a
3200
3200
  };
3201
- return /* @__PURE__ */ Z(A, {
3201
+ return /* @__PURE__ */ Z(k, {
3202
3202
  ...c,
3203
3203
  isGenerating: t.isInProgress && o,
3204
3204
  isLive: t.isInProgress || z(e.id),
@@ -3206,15 +3206,15 @@ var Ba = {
3206
3206
  }, `${n}-a-${i}`);
3207
3207
  };
3208
3208
  return /* @__PURE__ */ Q("div", {
3209
- ref: r ? te : void 0,
3209
+ ref: r ? ne : void 0,
3210
3210
  className: i("flex flex-col items-start justify-start gap-2 px-1", r && "pb-5"),
3211
3211
  [Ii]: n,
3212
- style: { minHeight: r && re || void 0 },
3212
+ style: { minHeight: r && ie || void 0 },
3213
3213
  children: [
3214
3214
  t.userMessages.map((e, t) => o(e, t)),
3215
3215
  t.thinking && t.thinking.titles.length > 0 ? /* @__PURE__ */ Z(Da, {
3216
3216
  titles: t.thinking.titles,
3217
- title: k.ai.thoughtsGroupTitle,
3217
+ title: O.ai.thoughtsGroupTitle,
3218
3218
  inProgress: t.thinking.inProgress,
3219
3219
  isWriting: t.thinking.isWriting,
3220
3220
  startedAt: r ? R : null
@@ -3222,16 +3222,16 @@ var Ba = {
3222
3222
  t.assistantMessages.map((e, t) => s(e, t)),
3223
3223
  t.stopped ? /* @__PURE__ */ Z("p", {
3224
3224
  className: "text-base italic text-f1-foreground-secondary",
3225
- children: k.ai.responseStopped
3225
+ children: O.ai.responseStopped
3226
3226
  }) : null,
3227
- t.endIndicator === "thinking" ? /* @__PURE__ */ Z(He, {
3228
- title: k.ai.thinking,
3227
+ t.endIndicator === "thinking" ? /* @__PURE__ */ Z(Re, {
3228
+ title: O.ai.thinking,
3229
3229
  status: "executing",
3230
3230
  suffix: /* @__PURE__ */ Z(Ea, { startedAt: R })
3231
3231
  }) : null,
3232
- t.endIndicator === "activity" ? /* @__PURE__ */ Z(He, { status: "writing" }) : null,
3233
- t.endIndicator === "asking" ? /* @__PURE__ */ Z(He, {
3234
- title: k.ai.askingQuestions,
3232
+ t.endIndicator === "activity" ? /* @__PURE__ */ Z(Re, { status: "writing" }) : null,
3233
+ t.endIndicator === "asking" ? /* @__PURE__ */ Z(Re, {
3234
+ title: O.ai.askingQuestions,
3235
3235
  status: "asking"
3236
3236
  }) : null,
3237
3237
  t.feedback && t.endIndicator !== "asking" ? /* @__PURE__ */ Z(xa, {
@@ -3250,21 +3250,21 @@ var Ba = {
3250
3250
  /* @__PURE__ */ Z("div", {
3251
3251
  role: "status",
3252
3252
  className: "sr-only",
3253
- children: oe ? k.ai.askingQuestions : ""
3253
+ children: oe ? O.ai.askingQuestions : ""
3254
3254
  }),
3255
3255
  /* @__PURE__ */ Z("div", {
3256
- ref: P,
3256
+ ref: N,
3257
3257
  className: i("flex-1 overflow-y-scroll [overflow-anchor:none]", "[scrollbar-width:thin] [scrollbar-color:transparent_transparent]", "hover:[scrollbar-color:var(--scrollbar-thumb)_transparent]", "[&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent", "[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-transparent", "hover:[&::-webkit-scrollbar-thumb]:bg-f1-background-inverse/30"),
3258
3258
  children: /* @__PURE__ */ Q("div", {
3259
- ref: F,
3259
+ ref: P,
3260
3260
  className: "flex min-h-full flex-col items-center px-4 pb-[calc(1rem+var(--f0-ai-composer-overlap,0px))] pt-4",
3261
3261
  children: [
3262
3262
  /* @__PURE__ */ Q("div", {
3263
- className: i(N ? "flex flex-1" : "flex flex-col gap-6", "w-full max-w-content"),
3263
+ className: i(M ? "flex flex-1" : "flex flex-col gap-6", "w-full max-w-content"),
3264
3264
  children: [
3265
3265
  n ? /* @__PURE__ */ Z(Wa, {}) : null,
3266
- N ? /* @__PURE__ */ Z(La, {
3267
- messages: M,
3266
+ M ? /* @__PURE__ */ Z(La, {
3267
+ messages: j,
3268
3268
  caption: s,
3269
3269
  subtitle: l,
3270
3270
  cta: d,
@@ -3276,16 +3276,16 @@ var Ba = {
3276
3276
  ]
3277
3277
  }),
3278
3278
  /* @__PURE__ */ Z("div", {
3279
- ref: L,
3279
+ ref: I,
3280
3280
  className: "h-px shrink-0",
3281
3281
  "aria-hidden": !0
3282
3282
  }),
3283
3283
  /* @__PURE__ */ Z("footer", {
3284
3284
  className: "copilotKitMessagesFooter",
3285
- ref: I,
3285
+ ref: F,
3286
3286
  children: S
3287
3287
  }),
3288
- /* @__PURE__ */ Z(o, { children: ne ? /* @__PURE__ */ Z(c.div, {
3288
+ /* @__PURE__ */ Z(o, { children: re ? /* @__PURE__ */ Z(c.div, {
3289
3289
  className: "sticky bottom-[calc(0.5rem+var(--f0-ai-composer-overlap,0px))] z-10 flex justify-center",
3290
3290
  initial: {
3291
3291
  opacity: 0,
@@ -3301,8 +3301,8 @@ var Ba = {
3301
3301
  },
3302
3302
  transition: { duration: .2 },
3303
3303
  children: /* @__PURE__ */ Z(u, {
3304
- onClick: () => ie(),
3305
- label: k.ai.scrollToBottom,
3304
+ onClick: () => ae(),
3305
+ label: O.ai.scrollToBottom,
3306
3306
  variant: "neutral",
3307
3307
  icon: Zt,
3308
3308
  hideLabel: !0
@@ -3311,11 +3311,11 @@ var Ba = {
3311
3311
  ]
3312
3312
  })
3313
3313
  }),
3314
- !b && !N ? /* @__PURE__ */ Z(Sa, { position: "top" }, "shadow-top") : null
3314
+ !b && !M ? /* @__PURE__ */ Z(Sa, { position: "top" }, "shadow-top") : null
3315
3315
  ]
3316
3316
  }), D.isOpen ? /* @__PURE__ */ Z(ga, {
3317
- onSubmit: O,
3318
- onClose: ee,
3317
+ onSubmit: ee,
3318
+ onClose: te,
3319
3319
  reactionType: D.currentReaction,
3320
3320
  message: D.currentMessage
3321
3321
  }) : null] });
@@ -3577,7 +3577,7 @@ var no = [
3577
3577
  onClick: c,
3578
3578
  label: l.actions.cancel,
3579
3579
  hideLabel: !0,
3580
- icon: C
3580
+ icon: bt
3581
3581
  })
3582
3582
  ]
3583
3583
  });
@@ -3585,26 +3585,26 @@ var no = [
3585
3585
  clarifyingQuestion: e,
3586
3586
  isSubmitDisabled: t
3587
3587
  }), po = ({ clarifyingQuestion: e, isSubmitDisabled: n }) => {
3588
- let r = t(), i = l(), { currentStep: a, currentStepIndex: s, totalSteps: u, toggleOption: d, confirm: f, skip: p, cancel: m, back: h, setCustomAnswerText: g, setCustomAnswerActive: _, activateCustomAnswer: v } = e, { question: y, options: b, selectedOptionIds: x, selectionMode: S, optional: C, allowCustomAnswer: w, customAnswerText: T, isCustomAnswerActive: E } = a, D = Y(null), O = S ?? "single", ee = u > 1, k = s === 0, A = s === u - 1, j = ee ? r.t("ai.clarifyingQuestion.stepOf", {
3588
+ let r = t(), i = l(), { currentStep: a, currentStepIndex: s, totalSteps: u, toggleOption: d, confirm: f, skip: p, cancel: m, back: h, setCustomAnswerText: g, setCustomAnswerActive: _, activateCustomAnswer: v } = e, { question: y, options: b, selectedOptionIds: x, selectionMode: S, optional: C, allowCustomAnswer: w, customAnswerText: T, isCustomAnswerActive: E } = a, D = Y(null), ee = S ?? "single", te = u > 1, O = s === 0, k = s === u - 1, A = te ? r.t("ai.clarifyingQuestion.stepOf", {
3589
3589
  current: String(s + 1),
3590
3590
  total: String(u)
3591
- }) : void 0, M = x.length > 0, N = (T ?? "").trim().length > 0, P = M || E && N || C === !0, F = n === !0 && A, I = () => {
3592
- F || f();
3593
- }, L = () => {
3594
- F || p();
3595
- }, te = (e) => {
3596
- let t = O === "single" && x.includes(e);
3597
- d(e), O === "single" && !A && !t && Promise.resolve().then(f);
3598
- }, ne = A ? r.ai.clarifyingQuestion.submit : r.ai.clarifyingQuestion.next, re = C === !0 && !M && !(E && N), ie = () => {
3591
+ }) : void 0, j = x.length > 0, M = (T ?? "").trim().length > 0, N = j || E && M || C === !0, P = n === !0 && k, F = () => {
3592
+ P || f();
3593
+ }, I = () => {
3594
+ P || p();
3595
+ }, ne = (e) => {
3596
+ let t = ee === "single" && x.includes(e);
3597
+ d(e), ee === "single" && !k && !t && Promise.resolve().then(f);
3598
+ }, re = k ? r.ai.clarifyingQuestion.submit : r.ai.clarifyingQuestion.next, ie = C === !0 && !j && !(E && M), ae = () => {
3599
3599
  v(), requestAnimationFrame(() => {
3600
3600
  D.current?.focus();
3601
3601
  });
3602
- }, ae = (e) => {
3602
+ }, L = (e) => {
3603
3603
  e.key === "Escape" && (e.preventDefault(), m());
3604
3604
  }, R = i ? 0 : lo, oe = i ? 0 : uo;
3605
3605
  return /* @__PURE__ */ Q("div", {
3606
3606
  className: "flex flex-col",
3607
- onKeyDown: ae,
3607
+ onKeyDown: L,
3608
3608
  children: [/* @__PURE__ */ Z("div", {
3609
3609
  className: "flex flex-col gap-3 pt-3",
3610
3610
  children: /* @__PURE__ */ Z(o, {
@@ -3629,40 +3629,40 @@ var no = [
3629
3629
  },
3630
3630
  children: [/* @__PURE__ */ Z(so, {
3631
3631
  question: y,
3632
- stepLabel: j,
3633
- isFirstStep: k,
3634
- isFinalStep: A,
3635
- canProceed: P,
3632
+ stepLabel: A,
3633
+ isFirstStep: O,
3634
+ isFinalStep: k,
3635
+ canProceed: N,
3636
3636
  onBack: h,
3637
3637
  onNext: f,
3638
3638
  onCancel: m
3639
3639
  }), /* @__PURE__ */ Z(oo, {
3640
- mode: O,
3640
+ mode: ee,
3641
3641
  question: y,
3642
3642
  options: b,
3643
3643
  selectedOptionIds: x,
3644
3644
  allowCustomAnswer: w,
3645
- hasSelection: M,
3646
- hasCustomText: N,
3645
+ hasSelection: j,
3646
+ hasCustomText: M,
3647
3647
  customAnswerText: T,
3648
3648
  isCustomAnswerActive: E,
3649
- canProceed: P,
3649
+ canProceed: N,
3650
3650
  customInputRef: D,
3651
- onToggleOption: te,
3652
- onActivateCustom: ie,
3651
+ onToggleOption: ne,
3652
+ onActivateCustom: ae,
3653
3653
  onChangeCustomText: g,
3654
3654
  onToggleCustomActive: _,
3655
- onConfirm: I
3655
+ onConfirm: F
3656
3656
  })]
3657
3657
  }, s)
3658
3658
  })
3659
3659
  }), /* @__PURE__ */ Z(Za, {
3660
- canProceed: P,
3661
- submitDisabled: F,
3662
- label: ne,
3663
- onConfirm: I,
3664
- onSkip: L,
3665
- showSkip: re
3660
+ canProceed: N,
3661
+ submitDisabled: P,
3662
+ label: re,
3663
+ onConfirm: F,
3664
+ onSkip: I,
3665
+ showSkip: ie
3666
3666
  })]
3667
3667
  });
3668
3668
  };
@@ -3988,13 +3988,13 @@ var xo = class {
3988
3988
  repeatType: "mirror"
3989
3989
  };
3990
3990
  function ko(e) {
3991
- let [t, n] = X(e), r = at(e), i = Y(null);
3991
+ let [t, n] = X(e), r = dt(e), i = Y(null);
3992
3992
  return Tn(r, "change", (e) => n(e)), {
3993
3993
  value: t,
3994
3994
  motionValue: r,
3995
3995
  controls: i,
3996
3996
  animate: K((e, t) => {
3997
- i.current = gt(r, e, t);
3997
+ i.current = rt(r, e, t);
3998
3998
  }, [r])
3999
3999
  };
4000
4000
  }
@@ -4258,15 +4258,15 @@ function os({ fs: e, vs: t = Po, textures: n = [], uniforms: r, clearColor: i =
4258
4258
  0
4259
4259
  ]
4260
4260
  }
4261
- }), D = Y(r), O = (e, t) => {
4261
+ }), D = Y(r), ee = (e, t) => {
4262
4262
  let n = "width" in e ? e.width ?? 0 : 0, r = "height" in e ? e.height ?? 0 : 0, i = E.current.iChannelResolution;
4263
4263
  if (!i) return;
4264
4264
  Array.isArray(i.value) || (i.value = []);
4265
4265
  let a = i.value;
4266
4266
  a[t * 3] = n * l, a[t * 3 + 1] = r * l, a[t * 3 + 2] = 0;
4267
- }, ee = () => {
4267
+ }, te = () => {
4268
4268
  p.current && (m.current = p.current.getContext("webgl", s) || p.current.getContext("experimental-webgl", s), m.current?.getExtension("OES_standard_derivatives"), m.current?.getExtension("EXT_shader_texture_lod"));
4269
- }, k = () => {
4269
+ }, O = () => {
4270
4270
  let e = m.current;
4271
4271
  h.current = e?.createBuffer() ?? null, e?.bindBuffer(e.ARRAY_BUFFER, h.current), e?.bufferData(e.ARRAY_BUFFER, new Float32Array([
4272
4272
  1,
@@ -4282,19 +4282,19 @@ function os({ fs: e, vs: t = Po, textures: n = [], uniforms: r, clearColor: i =
4282
4282
  -1,
4283
4283
  0
4284
4284
  ]), e.STATIC_DRAW);
4285
- }, A = ({ alpha: e, beta: t, gamma: n }) => {
4285
+ }, k = ({ alpha: e, beta: t, gamma: n }) => {
4286
4286
  E.current.iDeviceOrientation.value = [
4287
4287
  e ?? 0,
4288
4288
  t ?? 0,
4289
4289
  n ?? 0,
4290
4290
  window.orientation ?? 0
4291
4291
  ];
4292
- }, j = (e) => {
4292
+ }, A = (e) => {
4293
4293
  let [t = 0, n = 0] = rs(e), r = t - (b.current?.left ?? 0) - window.pageXOffset, i = (b.current?.height ?? 0) - n - (b.current?.top ?? 0) - window.pageYOffset;
4294
4294
  y.current = !0;
4295
4295
  let a = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
4296
4296
  a && (a[2] = r, a[3] = i), S.current[0] = r, S.current[1] = i;
4297
- }, M = (e) => {
4297
+ }, j = (e) => {
4298
4298
  b.current = p.current?.getBoundingClientRect();
4299
4299
  let [t = 0, n = 0] = rs(e), r = t - (b.current?.left ?? 0), i = (b.current?.height ?? 0) - n - (b.current?.top ?? 0);
4300
4300
  if (c !== 1) S.current[0] = r, S.current[1] = i;
@@ -4302,10 +4302,10 @@ function os({ fs: e, vs: t = Po, textures: n = [], uniforms: r, clearColor: i =
4302
4302
  let e = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
4303
4303
  e && (e[0] = r, e[1] = i);
4304
4304
  }
4305
- }, N = () => {
4305
+ }, M = () => {
4306
4306
  let e = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
4307
4307
  e && (e[2] = 0, e[3] = 0);
4308
- }, P = () => {
4308
+ }, N = () => {
4309
4309
  let e = m.current;
4310
4310
  if (!e) return;
4311
4311
  b.current = p.current?.getBoundingClientRect();
@@ -4314,7 +4314,7 @@ function os({ fs: e, vs: t = Po, textures: n = [], uniforms: r, clearColor: i =
4314
4314
  let t = e.getUniformLocation(g.current, Bo);
4315
4315
  e.uniform2fv(t, [e.canvas.width, e.canvas.height]);
4316
4316
  }
4317
- }, F = (e, t) => {
4317
+ }, P = (e, t) => {
4318
4318
  let n = m.current;
4319
4319
  if (!n) return null;
4320
4320
  let r = n.createShader(e);
@@ -4325,12 +4325,12 @@ function os({ fs: e, vs: t = Po, textures: n = [], uniforms: r, clearColor: i =
4325
4325
  n.deleteShader(r), d?.(ns(`Shader compiler log: ${e}`));
4326
4326
  }
4327
4327
  return r;
4328
- }, I = (e, t) => {
4328
+ }, F = (e, t) => {
4329
4329
  let n = m.current;
4330
4330
  if (!n) return;
4331
- let r = F(n.FRAGMENT_SHADER, e), i = F(n.VERTEX_SHADER, t);
4331
+ let r = P(n.FRAGMENT_SHADER, e), i = P(n.VERTEX_SHADER, t);
4332
4332
  g.current = n.createProgram(), g.current && i && r && (n.attachShader(g.current, i), n.attachShader(g.current, r), n.linkProgram(g.current), n.getProgramParameter(g.current, n.LINK_STATUS) ? (n.useProgram(g.current), _.current = n.getAttribLocation(g.current, "aVertexPosition"), n.enableVertexAttribArray(_.current)) : d?.(ns(`Unable to initialize the shader program: ${n.getProgramInfoLog(g.current)}`)));
4333
- }, L = () => {
4333
+ }, I = () => {
4334
4334
  if (r) for (let e of Object.keys(r)) {
4335
4335
  let t = r[e];
4336
4336
  if (!t) continue;
@@ -4344,7 +4344,7 @@ function os({ fs: e, vs: t = Po, textures: n = [], uniforms: r, clearColor: i =
4344
4344
  ...o ? { arraySize: o } : {}
4345
4345
  };
4346
4346
  }
4347
- }, te = () => {
4347
+ }, ne = () => {
4348
4348
  let e = m.current;
4349
4349
  if (e) {
4350
4350
  if (n && n.length > 0) {
@@ -4357,7 +4357,7 @@ function os({ fs: e, vs: t = Po, textures: n = [], uniforms: r, clearColor: i =
4357
4357
  let t = n.map((t, n) => (E.current[`${Vo}${n}`] = {
4358
4358
  type: "sampler2D",
4359
4359
  isNeeded: !1
4360
- }, O(t, n), C.current[n] = new ts(e), C.current[n]?.load(t).then((e) => O(e, n))));
4360
+ }, ee(t, n), C.current[n] = new ts(e), C.current[n]?.load(t).then((e) => ee(e, n))));
4361
4361
  Promise.all(t).then(() => {
4362
4362
  u && u();
4363
4363
  }).catch((e) => {
@@ -4365,7 +4365,7 @@ function os({ fs: e, vs: t = Po, textures: n = [], uniforms: r, clearColor: i =
4365
4365
  });
4366
4366
  } else u && u();
4367
4367
  }
4368
- }, ne = (e) => {
4368
+ }, re = (e) => {
4369
4369
  let t = jo.includes(a ?? "highp"), n = `precision ${t ? a : jo[1]} float;\n`;
4370
4370
  t || f?.(ns(`wrong precision type ${a}, please make sure to pass one of a valid precision lowp, mediump, highp, by default you shader precision will be set to highp.`));
4371
4371
  let r = n.concat(`#define DPR ${l.toFixed(1)}\n`).concat(e.replace(/texture\(/g, "texture2D("));
@@ -4375,7 +4375,7 @@ function os({ fs: e, vs: t = Po, textures: n = [], uniforms: r, clearColor: i =
4375
4375
  r = as(r, `uniform ${e.type} ${t}${e.arraySize || ""}; \n`, r.lastIndexOf(n) + n.length), e.isNeeded = !0;
4376
4376
  }
4377
4377
  return e.includes("mainImage") && (r = r.concat(Mo)), r;
4378
- }, re = (e) => {
4378
+ }, ie = (e) => {
4379
4379
  let t = m.current;
4380
4380
  if (!t || !g.current) return;
4381
4381
  let n = w.current ? (e - w.current) / 1e3 : 0;
@@ -4434,31 +4434,31 @@ function os({ fs: e, vs: t = Po, textures: n = [], uniforms: r, clearColor: i =
4434
4434
  t.activeTexture(t.TEXTURE0 + e), t.bindTexture(t.TEXTURE_2D, i), t.uniform1i(s, e), r && n.updateTexture(i, a, o);
4435
4435
  }
4436
4436
  }
4437
- }, ie = (e) => {
4437
+ }, ae = (e) => {
4438
4438
  let t = m.current;
4439
4439
  if (!t) return;
4440
- t.viewport(0, 0, t.drawingBufferWidth, t.drawingBufferHeight), t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT), t.bindBuffer(t.ARRAY_BUFFER, h.current), t.vertexAttribPointer(_.current ?? 0, 3, t.FLOAT, !1, 0, 0), re(e), t.drawArrays(t.TRIANGLE_STRIP, 0, 4);
4440
+ t.viewport(0, 0, t.drawingBufferWidth, t.drawingBufferHeight), t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT), t.bindBuffer(t.ARRAY_BUFFER, h.current), t.vertexAttribPointer(_.current ?? 0, 3, t.FLOAT, !1, 0, 0), ie(e), t.drawArrays(t.TRIANGLE_STRIP, 0, 4);
4441
4441
  let n = E.current.iMouse?.value;
4442
4442
  if (E.current.iMouse?.isNeeded && c !== 1 && Array.isArray(n)) {
4443
4443
  let e = n[0] ?? 0, t = n[1] ?? 0;
4444
4444
  n[0] = is(e, S.current[0] ?? 0, c), n[1] = is(t, S.current[1] ?? 0, c);
4445
4445
  }
4446
- v.current = requestAnimationFrame(ie);
4447
- }, ae = () => {
4446
+ v.current = requestAnimationFrame(ae);
4447
+ }, L = () => {
4448
4448
  let e = { passive: !0 };
4449
- E.current.iMouse?.isNeeded && p.current && (p.current.addEventListener("mousemove", M, e), p.current.addEventListener("mouseout", N, e), p.current.addEventListener("mouseup", N, e), p.current.addEventListener("mousedown", j, e), p.current.addEventListener("touchmove", M, e), p.current.addEventListener("touchend", N, e), p.current.addEventListener("touchstart", j, e)), E.current.iDeviceOrientation?.isNeeded && window.addEventListener("deviceorientation", A, e), p.current && (T.current = new ResizeObserver(P), T.current.observe(p.current), window.addEventListener("resize", P, e));
4449
+ E.current.iMouse?.isNeeded && p.current && (p.current.addEventListener("mousemove", j, e), p.current.addEventListener("mouseout", M, e), p.current.addEventListener("mouseup", M, e), p.current.addEventListener("mousedown", A, e), p.current.addEventListener("touchmove", j, e), p.current.addEventListener("touchend", M, e), p.current.addEventListener("touchstart", A, e)), E.current.iDeviceOrientation?.isNeeded && window.addEventListener("deviceorientation", k, e), p.current && (T.current = new ResizeObserver(N), T.current.observe(p.current), window.addEventListener("resize", N, e));
4450
4450
  }, R = () => {
4451
4451
  let e = { passive: !0 };
4452
- E.current.iMouse?.isNeeded && p.current && (p.current.removeEventListener("mousemove", M, e), p.current.removeEventListener("mouseout", N, e), p.current.removeEventListener("mouseup", N, e), p.current.removeEventListener("mousedown", j, e), p.current.removeEventListener("touchmove", M, e), p.current.removeEventListener("touchend", N, e), p.current.removeEventListener("touchstart", j, e)), E.current.iDeviceOrientation?.isNeeded && window.removeEventListener("deviceorientation", A, e), T.current && (T.current.disconnect(), window.removeEventListener("resize", P, e));
4452
+ E.current.iMouse?.isNeeded && p.current && (p.current.removeEventListener("mousemove", j, e), p.current.removeEventListener("mouseout", M, e), p.current.removeEventListener("mouseup", M, e), p.current.removeEventListener("mousedown", A, e), p.current.removeEventListener("touchmove", j, e), p.current.removeEventListener("touchend", M, e), p.current.removeEventListener("touchstart", A, e)), E.current.iDeviceOrientation?.isNeeded && window.removeEventListener("deviceorientation", k, e), T.current && (T.current.disconnect(), window.removeEventListener("resize", N, e));
4453
4453
  };
4454
4454
  return q(() => {
4455
4455
  D.current = r;
4456
4456
  }, [r]), q(() => {
4457
4457
  let n = C.current;
4458
4458
  function r() {
4459
- ee();
4459
+ te();
4460
4460
  let n = m.current;
4461
- n && p.current && (n.clearColor(...i), n.clearDepth(1), n.enable(n.DEPTH_TEST), n.depthFunc(n.LEQUAL), n.viewport(0, 0, p.current.width, p.current.height), p.current.height = p.current.clientHeight, p.current.width = p.current.clientWidth, L(), te(), I(ne(e || No), t || Po), k(), requestAnimationFrame(ie), ae(), P());
4461
+ n && p.current && (n.clearColor(...i), n.clearDepth(1), n.enable(n.DEPTH_TEST), n.depthFunc(n.LEQUAL), n.viewport(0, 0, p.current.width, p.current.height), p.current.height = p.current.clientHeight, p.current.width = p.current.clientWidth, I(), ne(), F(re(e || No), t || Po), O(), requestAnimationFrame(ae), L(), N());
4462
4462
  }
4463
4463
  return requestAnimationFrame(r), () => {
4464
4464
  let e = m.current;
@@ -4605,7 +4605,7 @@ function ds({ size: e = "lg", state: t, color: n, colorShift: r = .05, audioTrac
4605
4605
  }
4606
4606
  //#endregion
4607
4607
  //#region src/blocks/ai/F0HILActionConfirmation/F0HILActionConfirmation.tsx
4608
- var fs = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm: i, cancelText: a, onCancel: o, stackAt: s = "sm" }) => /* @__PURE__ */ Z(b, {
4608
+ var fs = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm: i, cancelText: a, onCancel: o, stackAt: s = "sm" }) => /* @__PURE__ */ Z(v, {
4609
4609
  title: e,
4610
4610
  description: t,
4611
4611
  avatar: n,
@@ -4649,7 +4649,7 @@ var fs = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
4649
4649
  1
4650
4650
  ]
4651
4651
  },
4652
- children: /* @__PURE__ */ Z(v, {
4652
+ children: /* @__PURE__ */ Z(Ke, {
4653
4653
  size: "md",
4654
4654
  label: a.ai.ask,
4655
4655
  onClick: (e) => {
@@ -4780,7 +4780,7 @@ var Ts = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
4780
4780
  children: [/* @__PURE__ */ Z(_, {
4781
4781
  width: "100%",
4782
4782
  height: "100%",
4783
- children: /* @__PURE__ */ Q(V, {
4783
+ children: /* @__PURE__ */ Q(me, {
4784
4784
  data: e,
4785
4785
  margin: {
4786
4786
  top: 4,
@@ -4805,11 +4805,11 @@ var Ts = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
4805
4805
  stopOpacity: .02
4806
4806
  })]
4807
4807
  }) }),
4808
- /* @__PURE__ */ Z(he, {
4808
+ /* @__PURE__ */ Z(pe, {
4809
4809
  hide: !0,
4810
4810
  domain: ["dataMin - 1", "dataMax + 1"]
4811
4811
  }),
4812
- /* @__PURE__ */ Z(ee, {
4812
+ /* @__PURE__ */ Z(te, {
4813
4813
  type: "linear",
4814
4814
  dataKey: "value",
4815
4815
  stroke: a.stroke,
@@ -4896,7 +4896,7 @@ var Ts = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
4896
4896
  });
4897
4897
  });
4898
4898
  Os.displayName = "F0AiInsightCard";
4899
- var ks = e(Ae(Os, () => /* @__PURE__ */ Q("div", {
4899
+ var ks = e(Oe(Os, () => /* @__PURE__ */ Q("div", {
4900
4900
  className: "flex w-[217px] h-[200px] flex-col gap-2 rounded-2xl border border-solid border-f1-border-secondary bg-f1-background p-4",
4901
4901
  "aria-busy": "true",
4902
4902
  "aria-live": "polite",
@@ -4981,7 +4981,7 @@ Is.displayName = "F0AiProposalCard";
4981
4981
  //#region src/blocks/ai/F0AiMessageSources/components/CollapsibleMessage.tsx
4982
4982
  var Ls = ({ icon: e, title: t, children: n }) => {
4983
4983
  let [r, i] = X(!1), a = l();
4984
- return /* @__PURE__ */ Q(E, {
4984
+ return /* @__PURE__ */ Q(w, {
4985
4985
  className: "mb-1 w-full",
4986
4986
  open: r,
4987
4987
  onOpenChange: i,
@@ -5004,7 +5004,7 @@ var Ls = ({ icon: e, title: t, children: n }) => {
5004
5004
  className: "h-4 w-4 transition-transform duration-200"
5005
5005
  })
5006
5006
  ]
5007
- }), /* @__PURE__ */ Z(w, {
5007
+ }), /* @__PURE__ */ Z(C, {
5008
5008
  forceMount: !0,
5009
5009
  className: "data-[state=open]:mt-3",
5010
5010
  children: /* @__PURE__ */ Z(c.div, {
@@ -5028,7 +5028,7 @@ var Ls = ({ icon: e, title: t, children: n }) => {
5028
5028
  })
5029
5029
  })]
5030
5030
  });
5031
- }, Rs = (e) => se[e] ?? sn, zs = ({ iconName: e }) => e ? /* @__PURE__ */ Z("div", {
5031
+ }, Rs = (e) => T[e] ?? sn, zs = ({ iconName: e }) => e ? /* @__PURE__ */ Z("div", {
5032
5032
  className: "mr-1 flex items-center justify-center",
5033
5033
  children: /* @__PURE__ */ Z(G, {
5034
5034
  icon: Rs(e),
@@ -5072,10 +5072,10 @@ Bs.displayName = "F0AiMessageSources";
5072
5072
  //#endregion
5073
5073
  //#region src/addons/ai/F0AiTableCard/F0AiTableCard.tsx
5074
5074
  async function Vs(e, t, n) {
5075
- let r = Je(e), i = t === "xlsx" ? await ie([{
5075
+ let r = Ge(e), i = t === "xlsx" ? await ae([{
5076
5076
  name: "Data",
5077
5077
  rows: r
5078
- }]) : await Ze(r);
5078
+ }]) : await Xe(r);
5079
5079
  g(i, `${n}.${t}`);
5080
5080
  }
5081
5081
  function Hs({ dataset: e, title: n, filename: r }) {
@@ -5105,16 +5105,16 @@ function Hs({ dataset: e, title: n, filename: r }) {
5105
5105
  tag: "h2",
5106
5106
  className: "text-base font-medium capitalize text-f1-foreground",
5107
5107
  children: s
5108
- }), /* @__PURE__ */ Z(tt, {
5109
- icon: yt,
5108
+ }), /* @__PURE__ */ Z(et, {
5109
+ icon: Tt,
5110
5110
  size: "md",
5111
5111
  items: [{
5112
5112
  label: a.ai.aiTable.downloadExcel,
5113
- icon: yt,
5113
+ icon: Tt,
5114
5114
  onClick: () => c("xlsx")
5115
5115
  }, {
5116
5116
  label: a.ai.aiTable.downloadCsv,
5117
- icon: yt,
5117
+ icon: Tt,
5118
5118
  onClick: () => c("csv")
5119
5119
  }]
5120
5120
  })]
@@ -5161,7 +5161,7 @@ function Us({ credits: e, trigger: n }) {
5161
5161
  variant: "ghost",
5162
5162
  hideLabel: !0,
5163
5163
  label: r.t("ai.credits.title"),
5164
- icon: pt,
5164
+ icon: Ue,
5165
5165
  pressed: i
5166
5166
  })
5167
5167
  }), /* @__PURE__ */ Q(un, {
@@ -5259,7 +5259,7 @@ function Us({ credits: e, trigger: n }) {
5259
5259
  variant: "outlinePromote",
5260
5260
  href: e.upgradePlanUrl,
5261
5261
  label: r.t("ai.credits.upgradePlan"),
5262
- icon: ge
5262
+ icon: j
5263
5263
  })]
5264
5264
  }) : null]
5265
5265
  })]
@@ -5363,7 +5363,7 @@ function Ks({ employeeCredits: e, trigger: n }) {
5363
5363
  variant: "ghost",
5364
5364
  hideLabel: !0,
5365
5365
  label: r.t("ai.credits.title"),
5366
- icon: pt,
5366
+ icon: Ue,
5367
5367
  pressed: i
5368
5368
  })
5369
5369
  }), /* @__PURE__ */ Q(un, {
@@ -5407,20 +5407,20 @@ var qs = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
5407
5407
  }) : e ? /* @__PURE__ */ Z(Us, {
5408
5408
  credits: e,
5409
5409
  trigger: n
5410
- }) : null, Js = qs, Ys = ({ historyEnabled: e = !1, title: n, currentThreadTitle: r, fullscreen: a = !1, lockVisualizationMode: o = !1, onToggleVisualizationMode: f, onClose: p, onNewChat: m, onOpenHistory: h, hasMessages: g = !1, credits: _, employeeCredits: v, compact: y = !1, actions: b }) => {
5411
- let x = t(), S = l(), { panelOverlays: w } = W(), E = !o && !w && /* @__PURE__ */ Z(u, {
5410
+ }) : null, Js = qs, Ys = ({ historyEnabled: e = !1, title: n, currentThreadTitle: r, fullscreen: a = !1, lockVisualizationMode: o = !1, onToggleVisualizationMode: f, onClose: p, onNewChat: m, onOpenHistory: h, hasMessages: g = !1, credits: _, employeeCredits: v, compact: b = !1, actions: x }) => {
5411
+ let S = t(), C = l(), { panelOverlays: w } = W(), T = !o && !w && /* @__PURE__ */ Z(u, {
5412
5412
  variant: "ghost",
5413
5413
  hideLabel: !0,
5414
- label: a ? x.ai.collapseChat : x.ai.expandChat,
5415
- icon: a ? ae : Dt,
5414
+ label: a ? S.ai.collapseChat : S.ai.expandChat,
5415
+ icon: a ? R : y,
5416
5416
  onClick: f
5417
- }), D = /* @__PURE__ */ Z(u, {
5417
+ }), E = /* @__PURE__ */ Z(u, {
5418
5418
  variant: "ghost",
5419
5419
  hideLabel: !0,
5420
- label: x.ai.closeChat,
5421
- icon: C,
5420
+ label: S.ai.closeChat,
5421
+ icon: bt,
5422
5422
  onClick: p
5423
- }), O = b?.map((e) => /* @__PURE__ */ Z(u, {
5423
+ }), D = x?.map((e) => /* @__PURE__ */ Z(u, {
5424
5424
  variant: "ghost",
5425
5425
  hideLabel: !0,
5426
5426
  label: e.label,
@@ -5428,24 +5428,24 @@ var qs = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
5428
5428
  type: "button",
5429
5429
  onClick: e.onClick
5430
5430
  }, e.id));
5431
- return y ? /* @__PURE__ */ Q("header", {
5431
+ return b ? /* @__PURE__ */ Q("header", {
5432
5432
  className: i("flex items-center justify-between gap-3 pr-4 pl-5 py-3"),
5433
5433
  children: [/* @__PURE__ */ Z(d, {
5434
5434
  lines: 1,
5435
5435
  className: "min-w-0 flex-1 text-left font-semibold text-f1-foreground",
5436
- children: r ?? x.ai.newConversation
5436
+ children: r ?? S.ai.newConversation
5437
5437
  }), /* @__PURE__ */ Q(c.div, {
5438
5438
  className: "flex shrink-0 items-center",
5439
5439
  initial: { opacity: 0 },
5440
5440
  animate: { opacity: 1 },
5441
5441
  transition: {
5442
- duration: S ? 0 : .2,
5442
+ duration: C ? 0 : .2,
5443
5443
  ease: "easeOut"
5444
5444
  },
5445
5445
  children: [
5446
- O,
5447
- E,
5448
- D
5446
+ D,
5447
+ T,
5448
+ E
5449
5449
  ]
5450
5450
  })]
5451
5451
  }) : e ? /* @__PURE__ */ Q("header", {
@@ -5462,7 +5462,7 @@ var qs = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
5462
5462
  children: [/* @__PURE__ */ Z(d, {
5463
5463
  lines: 1,
5464
5464
  className: "min-w-0 text-left",
5465
- children: r ?? x.ai.newConversation
5465
+ children: r ?? S.ai.newConversation
5466
5466
  }), /* @__PURE__ */ Z(G, {
5467
5467
  icon: Ft,
5468
5468
  color: "default",
@@ -5475,7 +5475,7 @@ var qs = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
5475
5475
  initial: { opacity: 0 },
5476
5476
  animate: { opacity: 1 },
5477
5477
  transition: {
5478
- duration: S ? 0 : .2,
5478
+ duration: C ? 0 : .2,
5479
5479
  ease: "easeOut"
5480
5480
  },
5481
5481
  children: [
@@ -5483,9 +5483,9 @@ var qs = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
5483
5483
  credits: _,
5484
5484
  employeeCredits: v
5485
5485
  }),
5486
- O,
5487
- E,
5488
- D
5486
+ D,
5487
+ T,
5488
+ E
5489
5489
  ]
5490
5490
  })]
5491
5491
  }) : /* @__PURE__ */ Q("header", {
@@ -5501,24 +5501,24 @@ var qs = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
5501
5501
  initial: { opacity: 0 },
5502
5502
  animate: { opacity: 1 },
5503
5503
  transition: {
5504
- duration: S ? 0 : .2,
5504
+ duration: C ? 0 : .2,
5505
5505
  ease: "easeOut"
5506
5506
  },
5507
5507
  children: [
5508
5508
  g && !o ? /* @__PURE__ */ Z(u, {
5509
5509
  variant: "ghost",
5510
5510
  hideLabel: !0,
5511
- label: x.ai.startNewChat,
5512
- icon: T,
5511
+ label: S.ai.startNewChat,
5512
+ icon: B,
5513
5513
  onClick: m
5514
5514
  }) : null,
5515
5515
  /* @__PURE__ */ Z(qs, {
5516
5516
  credits: _,
5517
5517
  employeeCredits: v
5518
5518
  }),
5519
- O,
5520
- E,
5521
- D
5519
+ D,
5520
+ T,
5521
+ E
5522
5522
  ]
5523
5523
  })]
5524
5524
  });
@@ -5527,12 +5527,12 @@ var qs = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
5527
5527
  //#region src/addons/ai/F0AiChatHistory/utils.ts
5528
5528
  function Xs(e) {
5529
5529
  let t = new Date(e), n = /* @__PURE__ */ new Date();
5530
- return Oe(t) ? "today" : Ke(t) ? "yesterday" : Yt(t, n) ? "thisMonth" : "older";
5530
+ return Ee(t) ? "today" : He(t) ? "yesterday" : Yt(t, n) ? "thisMonth" : "older";
5531
5531
  }
5532
5532
  function Zs(e, t, n) {
5533
5533
  let r = new Date(e), i = en(r, "p", { locale: n });
5534
- if (Oe(r)) return `${t.today}, ${i}`;
5535
- if (Ke(r)) return `${t.yesterday}, ${i}`;
5534
+ if (Ee(r)) return `${t.today}, ${i}`;
5535
+ if (He(r)) return `${t.yesterday}, ${i}`;
5536
5536
  let a = !$t(r, /* @__PURE__ */ new Date());
5537
5537
  return `${en(r, a ? "MMM d yyyy" : "MMM d", { locale: n })}, ${i}`;
5538
5538
  }
@@ -5559,11 +5559,11 @@ function Qs(e) {
5559
5559
  function $s({ thread: e, isPinned: n, isActive: r = !1, isPending: o = !1, onSelect: s, onPin: c, onUnpin: l, onDelete: f, className: p }) {
5560
5560
  let m = t(), h = Qt(), g = J(() => [{
5561
5561
  label: n ? m.ai.unpinChat : m.ai.pinChat,
5562
- icon: n ? Fe : ze,
5562
+ icon: n ? Fe : ot,
5563
5563
  onClick: () => n ? l(e.id) : c(e.id)
5564
5564
  }, {
5565
5565
  label: m.ai.deleteChat,
5566
- icon: fe,
5566
+ icon: S,
5567
5567
  critical: !0,
5568
5568
  onClick: () => f(e.id)
5569
5569
  }], [
@@ -5621,7 +5621,7 @@ function $s({ thread: e, isPinned: n, isActive: r = !1, isPending: o = !1, onSel
5621
5621
  children: /* @__PURE__ */ Z(Kt, { size: "small" })
5622
5622
  }) : /* @__PURE__ */ Z("div", {
5623
5623
  className: i("hidden items-center", "group-hover:flex group-focus-within:flex", "has-[[aria-expanded=true]]:flex"),
5624
- children: /* @__PURE__ */ Z(tt, {
5624
+ children: /* @__PURE__ */ Z(et, {
5625
5625
  items: g,
5626
5626
  children: /* @__PURE__ */ Z(u, {
5627
5627
  icon: on,
@@ -5731,7 +5731,7 @@ var ac = ({ onClose: e, onSelectThread: n, onNewChat: r, threads: a, isLoading:
5731
5731
  r(), e();
5732
5732
  }, [r, e]), w = K((e) => {
5733
5733
  p(e);
5734
- }, [p]), E = y.length > 0 || x.length > 0;
5734
+ }, [p]), T = y.length > 0 || x.length > 0;
5735
5735
  return Cn(/* @__PURE__ */ Q(Sn, { children: [/* @__PURE__ */ Z("div", {
5736
5736
  className: "fixed inset-0 z-50 bg-f1-background-overlay animate-in fade-in-0",
5737
5737
  onClick: e,
@@ -5767,7 +5767,7 @@ var ac = ({ onClose: e, onSelectThread: n, onNewChat: r, threads: a, isLoading:
5767
5767
  children: /* @__PURE__ */ Q("div", {
5768
5768
  className: "flex w-full items-center gap-2",
5769
5769
  children: [/* @__PURE__ */ Z(G, {
5770
- icon: T,
5770
+ icon: B,
5771
5771
  color: "default",
5772
5772
  size: "md"
5773
5773
  }), /* @__PURE__ */ Z(d, {
@@ -5782,7 +5782,7 @@ var ac = ({ onClose: e, onSelectThread: n, onNewChat: r, threads: a, isLoading:
5782
5782
  className: "py-8 text-center text-base text-f1-foreground-tertiary",
5783
5783
  children: c
5784
5784
  }) : null,
5785
- !o && !c && !E ? /* @__PURE__ */ Z("p", {
5785
+ !o && !c && !T ? /* @__PURE__ */ Z("p", {
5786
5786
  className: "py-8 text-center text-base text-f1-foreground-tertiary",
5787
5787
  children: m.ai.noPreviousChats
5788
5788
  }) : null,
@@ -5810,11 +5810,11 @@ var ac = ({ onClose: e, onSelectThread: n, onNewChat: r, threads: a, isLoading:
5810
5810
  })] }), document.body);
5811
5811
  }, oc = "f0-ai-pinned-threads";
5812
5812
  function sc() {
5813
- let e = B(oc, []);
5813
+ let e = se(oc, []);
5814
5814
  return new Set(Array.isArray(e) ? e : []);
5815
5815
  }
5816
5816
  function cc(e) {
5817
- $e(oc, [...e]);
5817
+ Qe(oc, [...e]);
5818
5818
  }
5819
5819
  function lc({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, unpinThread: i }) {
5820
5820
  let [a, o] = X([]), [s, c] = X(!1), [l, u] = X(null), [d, f] = X(sc), [p, m] = X(() => /* @__PURE__ */ new Set()), h = K(async () => {
@@ -5884,7 +5884,7 @@ function lc({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, u
5884
5884
  }
5885
5885
  //#endregion
5886
5886
  //#region src/addons/ai/F0AiChatUsageLimits/types.ts
5887
- var uc = ["top", "bottom"], dc = c.create(Pe), fc = ({ label: e, reduceMotion: t }) => /* @__PURE__ */ Q("div", {
5887
+ var uc = ["top", "bottom"], dc = c.create(je), fc = ({ label: e, reduceMotion: t }) => /* @__PURE__ */ Q("div", {
5888
5888
  role: "status",
5889
5889
  "aria-live": "polite",
5890
5890
  className: "flex flex-row items-center gap-1 rounded-full border border-solid border-f1-border-secondary bg-f1-background px-2 py-1.5 pr-2.5 shadow-md",