@factorialco/f0-react 16.7.2 → 16.8.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.
- package/dist/{ArchiveThumbnail-PuK9lQt7.js → ArchiveThumbnail-BKvu3lcu.js} +1 -1
- package/dist/{ArchiveViewer-EVdEZ47z.js → ArchiveViewer-PokpRAw4.js} +2 -2
- package/dist/{ChatPostComposerDialog-D_mW8jWn.js → ChatPostComposerDialog-D-5viWxQ.js} +2 -2
- package/dist/{CoachmarkProvider-B3rD36gl.js → CoachmarkProvider-C47BcI7u.js} +14202 -14202
- package/dist/{CodeThumbnail-C_5FsBOm.js → CodeThumbnail-CroXmUci.js} +1 -1
- package/dist/{CodeViewer-Jsi_2xXh.js → CodeViewer-DVTJp_wA.js} +3 -3
- package/dist/{DocumentToolbar-BzByx1Dn.js → DocumentToolbar-BANw77k3.js} +1 -1
- package/dist/{DocxViewer-CSYglhFv.js → DocxViewer-CevgUJLK.js} +1 -1
- package/dist/{F0AiProcessingOverlay-Bqx-e4_-.js → F0AiProcessingOverlay-DI6jMuCD.js} +330 -330
- package/dist/{F0Alert-HB_BxC2y.js → F0Alert-ieGe_wih.js} +3 -3
- package/dist/F0AudioPlayer-uMvUIjPA.js +2 -0
- package/dist/{F0CanvasPanel-Bln7jkQW.js → F0CanvasPanel-C4ph6y28.js} +4181 -4181
- package/dist/{F0DocumentViewer-DJ3LI-b-.js → F0DocumentViewer-CB-M5vkX.js} +2 -2
- package/dist/{F0DocumentViewer-Dld2UWye.js → F0DocumentViewer-NYnR9AyB.js} +1 -1
- package/dist/{F0Map-DROScvs0.js → F0Map-CGd46RFu.js} +9 -9
- package/dist/F0VideoPlayer-BA5EvMse.js +1 -0
- package/dist/{F0VideoPlayer-B9TW8FVY.js → F0VideoPlayer-C0z6zvj3.js} +15 -15
- package/dist/{HtmlViewer-DEUd_5sU.js → HtmlViewer-0nFbOUq8.js} +3 -3
- package/dist/{Map-B1ZzuTQM.js → Map-B08PBTa7.js} +3 -3
- package/dist/{PdfThumbnail-BgDYJsQ1.js → PdfThumbnail-D7J4iWRY.js} +1 -1
- package/dist/{PdfViewer-B8yj3t3V.js → PdfViewer-cW_JCDxU.js} +5 -5
- package/dist/{SheetViewer-C4ZdihC_.js → SheetViewer-DqoHh8uJ.js} +2 -2
- package/dist/{TextViewer-BszyoMOh.js → TextViewer-Bj4KGv39.js} +1 -1
- package/dist/ai.js +2 -2
- package/dist/component-status.js +51 -7
- package/dist/experimental.d.ts +120 -1
- package/dist/experimental.js +5738 -5299
- package/dist/f0.js +166 -166
- package/dist/{highlight-D8IVJ7ry.js → highlight-CciFQ6gi.js} +1 -1
- package/dist/{maplibre-lTb3LBXs.js → maplibre-DSB7gj3I.js} +1 -1
- package/dist/{pdfWorker-WlS_ycyi.js → pdfWorker-D4A-2BUo.js} +1 -1
- package/package.json +1 -1
- package/dist/F0AudioPlayer-Cyjz-Ray.js +0 -2
- package/dist/F0VideoPlayer-C6rx3JDg.js +0 -1
|
@@ -2,7 +2,7 @@ import { a as e, r as t } from "./i18n-provider-C-057er8.js";
|
|
|
2
2
|
import { n, t as r } from "./skeleton-C__vPA8D.js";
|
|
3
3
|
import { L as i, R as a } from "./tooltip-NXXT56H4.js";
|
|
4
4
|
import { D as o, K as s, M as c, R as l, V as u, Y as d, b as f, h as p, n as m, r as h, t as g } from "./F0Button-CfK_6Dfx.js";
|
|
5
|
-
import { $ as _, $
|
|
5
|
+
import { $ as _, $r as v, $s as y, $t as b, A as x, As as S, At as C, Bc as w, C as T, Cl as E, Co as D, Ct as ee, Dn as O, Dt as k, En as A, Et as te, F as j, Fi as M, G as N, Gc as P, Gi as ne, Ho as re, It as ie, J as F, Ja as ae, Js as I, Jt as oe, K as se, Ln as ce, M as le, Ms as ue, Mt as L, N as R, Nn as de, Ns as fe, Oo as pe, Os as me, Ot as he, P as ge, Pn as _e, Q as ve, S as ye, So as z, St as be, Tn as xe, U as B, Ui as Se, Ut as Ce, Vs as we, Wc as Te, Wi as Ee, Wt as De, X as Oe, Xt as ke, Y as Ae, Z as V, Zs as je, Zt as H, _ as Me, _t as Ne, aa as Pe, at as Fe, b as Ie, bn as Le, cn as Re, ct as ze, dc as Be, dn as Ve, dt as He, el as Ue, fi as We, fl as Ge, fn as Ke, fs as qe, ft as Je, g as Ye, gt as Xe, h as Ze, hn as Qe, hs as $e, ht as et, i as tt, ia as nt, in as rt, j as it, jn as at, jt as ot, k as st, kt as ct, la as lt, lt as ut, ml as dt, ms as ft, mt as pt, nn as mt, nt as ht, o as gt, oc as _t, on as vt, pi as yt, pl as bt, ps as xt, pt as St, q as Ct, qr as wt, qt as Tt, r as Et, rc as Dt, ri as Ot, rt as kt, sa as At, sn as jt, st as Mt, tc as Nt, ts as Pt, ut as Ft, vn as It, w as Lt, wl as Rt, wn as zt, wo as Bt, wt as Vt, x as Ht, xn as Ut, xt as Wt, yn as Gt } from "./F0CanvasPanel-C4ph6y28.js";
|
|
6
6
|
import { o as Kt, t as U } from "./F0Icon-BPx-9kOK.js";
|
|
7
7
|
import { t as qt } from "./i18n-provider-defaults-C660Phfh.js";
|
|
8
8
|
import { D as Jt, E as Yt, F as W, G as Xt, R as Zt, S as Qt, T as $t, W as en, g as tn, h as nn, j as rn, l as an, m as on, w as sn, y as cn } from "./useData-CaY41foq.js";
|
|
@@ -38,25 +38,25 @@ var Xn = [
|
|
|
38
38
|
"sm",
|
|
39
39
|
"md",
|
|
40
40
|
"lg"
|
|
41
|
-
], Qn = "relative flex flex-col rounded-lg border border-solid border-f1-border-secondary bg-f1-background/95 shadow transition-colors focus-within:border-f1-border", $n = [], er = () => null, tr = ({ onSend: e, inProgress: t = !1, onStop: n, sendKind: r = "send", hasAttachments: a = !1, sendBlocked: o = !1, maxLength: c, maxLengthError: l, error: u = null, labels: f, placeholders: p, placeholdersPaused: h, placeholderPreview: g, placeholderPreviewOneLine: _ = !1, role: v = "combobox", name: y, mentions: b, autocomplete: x, voice: S, onTextChange: C, onCleared: w, onEscape: T, onArrowUpWhenEmpty: E, onPasteFiles: D, pastePreferText: ee = !1, onStateChange: k, header:
|
|
42
|
-
let
|
|
43
|
-
let t =
|
|
44
|
-
|
|
45
|
-
}, []),
|
|
46
|
-
"permission-denied":
|
|
47
|
-
"device-error":
|
|
48
|
-
"transcription-failed":
|
|
49
|
-
},
|
|
41
|
+
], Qn = "relative flex flex-col rounded-lg border border-solid border-f1-border-secondary bg-f1-background/95 shadow transition-colors focus-within:border-f1-border", $n = [], er = () => null, tr = ({ onSend: e, inProgress: t = !1, onStop: n, sendKind: r = "send", hasAttachments: a = !1, sendBlocked: o = !1, maxLength: c, maxLengthError: l, error: u = null, labels: f, placeholders: p, placeholdersPaused: h, placeholderPreview: g, placeholderPreviewOneLine: _ = !1, role: v = "combobox", name: y, mentions: b, autocomplete: x, voice: S, onTextChange: C, onCleared: w, onEscape: T, onArrowUpWhenEmpty: E, onPasteFiles: D, pastePreferText: ee = !1, onStateChange: k, header: A, tray: te, leading: j, toolbarStart: M, toolbarCenter: N, collapsible: ne = !1, collapsed: re = !1, replacement: ie, asForm: F = !1, className: ae, surfaceRef: I, onSurfaceFocus: oe, onSurfaceBlur: se, handleRef: ce, reducedMotion: le = !1, "data-testid": ue }) => {
|
|
42
|
+
let L = pt(f, S), R = ie != null, { error: de, show: fe, clear: pe } = St(), me = J(() => {}), he = J(() => {}), ge = J(""), ve = G((e) => {
|
|
43
|
+
let t = ge.current, n = t && !/\s$/.test(t) ? " " : "";
|
|
44
|
+
me.current(`${t}${n}${e}`);
|
|
45
|
+
}, []), ye = {
|
|
46
|
+
"permission-denied": L.micPermissionDenied,
|
|
47
|
+
"device-error": L.micError,
|
|
48
|
+
"transcription-failed": L.transcriptionError
|
|
49
|
+
}, z = _e({
|
|
50
50
|
onTranscribe: S?.onTranscribe,
|
|
51
|
-
onPartial:
|
|
51
|
+
onPartial: ve,
|
|
52
52
|
onFinal: (e) => {
|
|
53
|
-
|
|
53
|
+
ve(e), he.current();
|
|
54
54
|
},
|
|
55
|
-
onError: (e) =>
|
|
55
|
+
onError: (e) => fe(ye[e]),
|
|
56
56
|
onAudio: S?.onAudio
|
|
57
|
-
}), [
|
|
57
|
+
}), [be, xe] = Y(!1), B = z.status === "recording", Se = z.status === "transcribing", Ce = !!S && (!!S.onTranscribe || !!S.onAudio) && z.isSupported, we = !S?.onAudio && (z.status !== "idle" || be), [Te, Ee] = Y(!1), De = Xe({
|
|
58
58
|
mentions: {
|
|
59
|
-
enabled: !!b && b.sources.length + +!!b.pinned > 0 && !
|
|
59
|
+
enabled: !!b && b.sources.length + +!!b.pinned > 0 && !Te && !R,
|
|
60
60
|
sources: b?.sources ?? $n,
|
|
61
61
|
pinned: b?.pinned,
|
|
62
62
|
scopeKey: b?.scopeKey,
|
|
@@ -64,55 +64,55 @@ var Xn = [
|
|
|
64
64
|
},
|
|
65
65
|
transformChange: x?.transformChange,
|
|
66
66
|
onTextChange: C,
|
|
67
|
-
historySuspended:
|
|
68
|
-
}), { value: Oe, setValue: ke, setCursorPosition: Ae, textareaRef: V, highlightRef: je, mentions: H, requestSelection: Me, clearText:
|
|
69
|
-
|
|
67
|
+
historySuspended: we
|
|
68
|
+
}), { value: Oe, setValue: ke, setCursorPosition: Ae, textareaRef: V, highlightRef: je, mentions: H, requestSelection: Me, clearText: Pe, breakHistory: Fe } = De;
|
|
69
|
+
me.current = (e) => {
|
|
70
70
|
ke(e), Ae(e.length);
|
|
71
71
|
};
|
|
72
72
|
let Ie = J(Oe);
|
|
73
73
|
Ie.current = Oe;
|
|
74
74
|
let Le = J(H.mentions);
|
|
75
75
|
Le.current = H.mentions;
|
|
76
|
-
let Re = (x?.useAutocomplete ?? er)(De),
|
|
76
|
+
let Re = (x?.useAutocomplete ?? er)(De), Be = Re?.isOpen ?? !1, Ve = H.dismissCurrentTrigger;
|
|
77
77
|
K(() => {
|
|
78
|
-
|
|
79
|
-
}, [
|
|
80
|
-
let { highlightSegments:
|
|
78
|
+
Ee(Be), Be && Ve();
|
|
79
|
+
}, [Be, Ve]);
|
|
80
|
+
let { highlightSegments: Ue, hasOverlay: We } = Ne(De, { suppressGhost: Be }), Ge = G((e) => {
|
|
81
81
|
let t = V.current;
|
|
82
82
|
if (!t) return;
|
|
83
83
|
t.focus(e);
|
|
84
84
|
let n = t.value.length;
|
|
85
85
|
t.setSelectionRange(n, n);
|
|
86
86
|
}, [V]);
|
|
87
|
-
|
|
87
|
+
he.current = () => V.current?.focus();
|
|
88
88
|
let Ke = H.close;
|
|
89
89
|
K(() => {
|
|
90
|
-
|
|
91
|
-
}, [
|
|
90
|
+
R && Ke();
|
|
91
|
+
}, [R, Ke]);
|
|
92
92
|
let qe = Oe.length === 0;
|
|
93
93
|
K(() => {
|
|
94
94
|
k?.({
|
|
95
95
|
isEmpty: qe,
|
|
96
|
-
recorder:
|
|
96
|
+
recorder: z.status
|
|
97
97
|
});
|
|
98
98
|
}, [
|
|
99
99
|
k,
|
|
100
100
|
qe,
|
|
101
|
-
|
|
101
|
+
z.status
|
|
102
102
|
]);
|
|
103
|
-
let [
|
|
103
|
+
let [Ye, Ze] = Y(!1), Qe = c !== void 0 && Oe.trim().length > c;
|
|
104
104
|
K(() => {
|
|
105
|
-
Qe ||
|
|
105
|
+
Qe || Ze(!1);
|
|
106
106
|
}, [Qe]);
|
|
107
|
-
let $e =
|
|
107
|
+
let $e = Ye && Qe ? l ?? null : null, tt = $e ?? u ?? de, [nt, rt] = Y(!1), it = J(!1), at = Oe.trim().length > 0 || a, ot = at && !we && !o && !nt && !R, st = t && !Se, ct = G(() => {
|
|
108
108
|
if (!ot || it.current) return;
|
|
109
109
|
if (Qe) {
|
|
110
|
-
|
|
110
|
+
Ze(!0);
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
H.close();
|
|
114
114
|
let t = Ie.current, n = (e) => {
|
|
115
|
-
!e && Ie.current === t && (
|
|
115
|
+
!e && Ie.current === t && (Pe(), Fe()), V.current?.focus({ preventScroll: !0 });
|
|
116
116
|
}, r;
|
|
117
117
|
try {
|
|
118
118
|
r = e({
|
|
@@ -133,32 +133,32 @@ var Xn = [
|
|
|
133
133
|
Qe,
|
|
134
134
|
H,
|
|
135
135
|
e,
|
|
136
|
-
|
|
136
|
+
Pe,
|
|
137
137
|
Fe,
|
|
138
138
|
V
|
|
139
139
|
]), lt = G(() => {
|
|
140
|
-
|
|
140
|
+
be || (S?.onPress?.(), pe(), xe(!0), (async () => {
|
|
141
141
|
try {
|
|
142
|
-
await
|
|
142
|
+
await z.start(), ge.current = Ie.current;
|
|
143
143
|
} catch {} finally {
|
|
144
|
-
|
|
144
|
+
xe(!1);
|
|
145
145
|
}
|
|
146
146
|
})());
|
|
147
147
|
}, [
|
|
148
|
-
|
|
148
|
+
be,
|
|
149
149
|
S,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
]),
|
|
153
|
-
|
|
154
|
-
}, [
|
|
150
|
+
pe,
|
|
151
|
+
z
|
|
152
|
+
]), dt = z.cancel, ft = G(() => {
|
|
153
|
+
dt(), S?.onCancelled?.();
|
|
154
|
+
}, [dt, S]), mt = J(!1), ht = S?.onStarted;
|
|
155
155
|
K(() => {
|
|
156
|
-
|
|
157
|
-
}, [
|
|
156
|
+
B && !mt.current && ht?.(), mt.current = B;
|
|
157
|
+
}, [B, ht]), Un(ce, () => ({
|
|
158
158
|
focus: (e) => {
|
|
159
|
-
|
|
159
|
+
R || Ge(e);
|
|
160
160
|
},
|
|
161
|
-
clear:
|
|
161
|
+
clear: Pe,
|
|
162
162
|
loadDraft: De.loadDraft,
|
|
163
163
|
getDraft: () => ({
|
|
164
164
|
text: Ie.current,
|
|
@@ -168,72 +168,72 @@ var Xn = [
|
|
|
168
168
|
let t = V.current, n = Ie.current, r = t?.selectionStart ?? n.length, i = t?.selectionEnd ?? n.length, a = r + e.length, o = n.slice(0, r) + e + n.slice(i);
|
|
169
169
|
ke(o), Ae(a), C?.(o), Me(a, o, !0);
|
|
170
170
|
},
|
|
171
|
-
cancelRecording:
|
|
171
|
+
cancelRecording: dt,
|
|
172
172
|
breakHistory: Fe,
|
|
173
173
|
addFiles: () => {}
|
|
174
174
|
}), [
|
|
175
|
-
|
|
175
|
+
R,
|
|
176
176
|
Ge,
|
|
177
|
-
|
|
177
|
+
Pe,
|
|
178
178
|
De.loadDraft,
|
|
179
179
|
V,
|
|
180
180
|
ke,
|
|
181
181
|
Ae,
|
|
182
182
|
C,
|
|
183
183
|
Me,
|
|
184
|
-
|
|
184
|
+
dt,
|
|
185
185
|
Fe
|
|
186
186
|
]);
|
|
187
187
|
let { escapeArmed: gt, handleClearKeyDown: _t, handleUndoRedoKeyDown: vt } = De, yt = (e) => {
|
|
188
188
|
if (e.key !== "Escape") return !1;
|
|
189
189
|
if (T?.(e)) return !0;
|
|
190
|
-
if (
|
|
190
|
+
if (B) return e.preventDefault(), ft(), !0;
|
|
191
191
|
let t = gt;
|
|
192
|
-
return _t(e) ? (t && (
|
|
192
|
+
return _t(e) ? (t && (Ze(!1), w?.()), !0) : !1;
|
|
193
193
|
}, bt = (e) => {
|
|
194
|
-
|
|
194
|
+
R || et(e) || vt(e) || Re?.handleKeyDown(e) || H.handleKeyDown(e) || yt(e) || (e.key === "ArrowUp" && !e.shiftKey && !e.altKey && !e.metaKey && !e.ctrlKey && Oe === "" && z.status === "idle" && !be && !S?.busy && E?.() ? e.preventDefault() : e.key === "Enter" && !e.shiftKey && (e.preventDefault(), t || ct()));
|
|
195
195
|
}, xt = (e) => {
|
|
196
|
-
e.preventDefault(), !
|
|
196
|
+
e.preventDefault(), !R && (t && !we ? (H.close(), n?.(), V.current?.focus()) : ct());
|
|
197
197
|
}, Ct = Mt({
|
|
198
|
-
enabled: !!D && !
|
|
198
|
+
enabled: !!D && !R,
|
|
199
199
|
onFiles: D ?? (() => {}),
|
|
200
200
|
preferText: ee
|
|
201
|
-
}), wt = Hn(), Tt = Hn(), Et = `chat-composer-mentions-${wt.replace(/:/g, "")}`, Dt = H.isOpen && !
|
|
201
|
+
}), wt = Hn(), Tt = Hn(), Et = `chat-composer-mentions-${wt.replace(/:/g, "")}`, Dt = H.isOpen && !Be && !R && (H.isLoading || H.rows.length > 0), Ot = H.rows[H.selectedIndex] ?? H.rows[0], kt = Dt && Ot ? Je(Et, Ot.item) : void 0, At = (e) => Ce ? /* @__PURE__ */ X(m, {
|
|
202
202
|
type: "button",
|
|
203
203
|
variant: "ghost",
|
|
204
204
|
size: e,
|
|
205
205
|
hideLabel: !0,
|
|
206
|
-
label: S?.busy ?
|
|
206
|
+
label: S?.busy ? L.sendingVoice : L.recordAudio,
|
|
207
207
|
icon: Nt,
|
|
208
208
|
onClick: lt,
|
|
209
209
|
disabled: S?.disabled,
|
|
210
|
-
loading:
|
|
211
|
-
}) : null, jt =
|
|
210
|
+
loading: be || Se || !!S?.busy
|
|
211
|
+
}) : null, jt = ut({
|
|
212
212
|
streaming: st,
|
|
213
213
|
hasDataToSend: at,
|
|
214
214
|
canSend: ot
|
|
215
|
-
}), Pt = (e) => /* @__PURE__ */ X(
|
|
215
|
+
}), Pt = (e) => /* @__PURE__ */ X(ze, {
|
|
216
216
|
action: jt,
|
|
217
217
|
sendKind: r,
|
|
218
218
|
size: e,
|
|
219
|
-
submit:
|
|
220
|
-
labels:
|
|
219
|
+
submit: F,
|
|
220
|
+
labels: L,
|
|
221
221
|
onSend: ct,
|
|
222
222
|
onStop: () => {
|
|
223
223
|
n?.(), V.current?.focus();
|
|
224
224
|
}
|
|
225
|
-
}), It = { duration:
|
|
225
|
+
}), It = { duration: le ? 0 : .15 }, Lt = typeof M == "function" ? M(z.status) : M, Rt = /* @__PURE__ */ X("div", {
|
|
226
226
|
className: "grid",
|
|
227
227
|
children: /* @__PURE__ */ X(d, {
|
|
228
228
|
initial: !1,
|
|
229
|
-
children:
|
|
229
|
+
children: B ? /* @__PURE__ */ Z(s.div, {
|
|
230
230
|
className: "flex items-center gap-3 pb-2 pl-3 pr-2 [grid-area:1/1]",
|
|
231
231
|
initial: { opacity: 0 },
|
|
232
232
|
animate: { opacity: 1 },
|
|
233
233
|
exit: { opacity: 0 },
|
|
234
234
|
transition: It,
|
|
235
235
|
children: [/* @__PURE__ */ X(O, {
|
|
236
|
-
stream:
|
|
236
|
+
stream: z.stream,
|
|
237
237
|
className: "min-w-0 flex-1"
|
|
238
238
|
}), /* @__PURE__ */ Z("div", {
|
|
239
239
|
className: "flex shrink-0 items-center gap-2",
|
|
@@ -242,17 +242,17 @@ var Xn = [
|
|
|
242
242
|
variant: "outline",
|
|
243
243
|
size: "md",
|
|
244
244
|
hideLabel: !0,
|
|
245
|
-
label:
|
|
246
|
-
icon:
|
|
245
|
+
label: L.cancelRecording,
|
|
246
|
+
icon: P,
|
|
247
247
|
onClick: ft
|
|
248
248
|
}), /* @__PURE__ */ X(m, {
|
|
249
249
|
type: "button",
|
|
250
250
|
variant: "default",
|
|
251
251
|
size: "md",
|
|
252
252
|
hideLabel: !0,
|
|
253
|
-
label:
|
|
253
|
+
label: L.confirmRecording,
|
|
254
254
|
icon: Tn,
|
|
255
|
-
onClick:
|
|
255
|
+
onClick: z.stop
|
|
256
256
|
})]
|
|
257
257
|
})]
|
|
258
258
|
}, "recording-row") : /* @__PURE__ */ Z(s.div, {
|
|
@@ -263,12 +263,12 @@ var Xn = [
|
|
|
263
263
|
transition: It,
|
|
264
264
|
children: [
|
|
265
265
|
Lt ? /* @__PURE__ */ X("div", {
|
|
266
|
-
className: i("flex items-center gap-1",
|
|
266
|
+
className: i("flex items-center gap-1", N ? "shrink-0" : "min-w-0"),
|
|
267
267
|
children: Lt
|
|
268
268
|
}) : null,
|
|
269
|
-
|
|
269
|
+
N ? /* @__PURE__ */ X("div", {
|
|
270
270
|
className: "min-w-0 flex-1",
|
|
271
|
-
children:
|
|
271
|
+
children: N
|
|
272
272
|
}) : null,
|
|
273
273
|
/* @__PURE__ */ Z("div", {
|
|
274
274
|
className: "ml-auto flex shrink-0 items-center gap-1",
|
|
@@ -278,7 +278,7 @@ var Xn = [
|
|
|
278
278
|
}, "actions-row")
|
|
279
279
|
})
|
|
280
280
|
}), zt = {
|
|
281
|
-
duration:
|
|
281
|
+
duration: le ? 0 : .32,
|
|
282
282
|
ease: [
|
|
283
283
|
.4,
|
|
284
284
|
0,
|
|
@@ -286,35 +286,35 @@ var Xn = [
|
|
|
286
286
|
1
|
|
287
287
|
]
|
|
288
288
|
}, Bt = /* @__PURE__ */ Z(Kn, { children: [
|
|
289
|
-
|
|
289
|
+
A,
|
|
290
290
|
/* @__PURE__ */ X(Ft, {
|
|
291
|
-
message:
|
|
291
|
+
message: tt,
|
|
292
292
|
id: Tt,
|
|
293
|
-
reducedMotion:
|
|
293
|
+
reducedMotion: le
|
|
294
294
|
}),
|
|
295
|
-
|
|
295
|
+
te,
|
|
296
296
|
/* @__PURE__ */ Z("div", {
|
|
297
|
-
className: i((
|
|
297
|
+
className: i((j || re) && "flex items-end", re && "pr-3"),
|
|
298
298
|
children: [
|
|
299
|
-
|
|
300
|
-
/* @__PURE__ */ X(
|
|
299
|
+
j,
|
|
300
|
+
/* @__PURE__ */ X(Wt, {
|
|
301
301
|
className: "min-w-0 flex-1",
|
|
302
302
|
textareaRef: V,
|
|
303
303
|
highlightRef: je,
|
|
304
304
|
value: Oe,
|
|
305
305
|
role: v,
|
|
306
306
|
name: y,
|
|
307
|
-
ariaLabel:
|
|
307
|
+
ariaLabel: L.placeholder,
|
|
308
308
|
placeholder: p ? {
|
|
309
309
|
mode: "overlay",
|
|
310
|
-
texts:
|
|
311
|
-
fallback:
|
|
310
|
+
texts: B ? [L.listening] : p,
|
|
311
|
+
fallback: B ? L.listening : L.placeholder,
|
|
312
312
|
paused: h,
|
|
313
|
-
preview:
|
|
313
|
+
preview: B ? void 0 : g,
|
|
314
314
|
previewOneLine: _
|
|
315
315
|
} : {
|
|
316
316
|
mode: "native",
|
|
317
|
-
text:
|
|
317
|
+
text: B ? L.listening : L.placeholder
|
|
318
318
|
},
|
|
319
319
|
onChange: De.handleChange,
|
|
320
320
|
onKeyDown: bt,
|
|
@@ -323,24 +323,24 @@ var Xn = [
|
|
|
323
323
|
onBlur: Re?.handleBlur,
|
|
324
324
|
onCursorUpdate: De.updateCursorPosition,
|
|
325
325
|
onScroll: De.syncHighlightScroll,
|
|
326
|
-
highlightSegments:
|
|
327
|
-
hasOverlay:
|
|
328
|
-
isAutocompleteOpen:
|
|
329
|
-
autocompleteListboxId:
|
|
330
|
-
activeAutocompleteOptionId: (
|
|
326
|
+
highlightSegments: Ue,
|
|
327
|
+
hasOverlay: We,
|
|
328
|
+
isAutocompleteOpen: Be || Dt,
|
|
329
|
+
autocompleteListboxId: Be ? Re?.listboxId : Dt ? Et : void 0,
|
|
330
|
+
activeAutocompleteOptionId: (Be ? Re?.activeDescendantId : void 0) ?? kt,
|
|
331
331
|
isInvalid: $e !== null,
|
|
332
332
|
errorMessageId: Tt
|
|
333
333
|
}),
|
|
334
|
-
|
|
334
|
+
re ? /* @__PURE__ */ Z("div", {
|
|
335
335
|
className: "flex shrink-0 items-center gap-2 pb-[10px] pl-2",
|
|
336
336
|
onMouseDown: (e) => e.preventDefault(),
|
|
337
337
|
children: [At("sm"), Pt("sm")]
|
|
338
338
|
}) : null
|
|
339
339
|
]
|
|
340
340
|
}),
|
|
341
|
-
|
|
341
|
+
ne ? /* @__PURE__ */ X(d, {
|
|
342
342
|
initial: !1,
|
|
343
|
-
children:
|
|
343
|
+
children: re ? null : /* @__PURE__ */ X(s.div, {
|
|
344
344
|
className: "overflow-hidden",
|
|
345
345
|
initial: {
|
|
346
346
|
opacity: 0,
|
|
@@ -360,10 +360,10 @@ var Xn = [
|
|
|
360
360
|
}) : Rt
|
|
361
361
|
] }), Vt = /* @__PURE__ */ Z(Kn, { children: [
|
|
362
362
|
Re?.popover,
|
|
363
|
-
/* @__PURE__ */ X(
|
|
363
|
+
/* @__PURE__ */ X(He, {
|
|
364
364
|
isOpen: Dt,
|
|
365
365
|
listboxId: Et,
|
|
366
|
-
label:
|
|
366
|
+
label: L.mentionSuggestions,
|
|
367
367
|
rows: H.rows,
|
|
368
368
|
groups: H.groups,
|
|
369
369
|
showGroupLabels: !!b?.showGroupLabels,
|
|
@@ -371,11 +371,11 @@ var Xn = [
|
|
|
371
371
|
selectedIndex: H.selectedIndex,
|
|
372
372
|
position: H.popoverPosition,
|
|
373
373
|
onSelect: H.selectRow,
|
|
374
|
-
pinnedDescription:
|
|
374
|
+
pinnedDescription: L.mentionPinnedDescription
|
|
375
375
|
}),
|
|
376
|
-
|
|
376
|
+
ie === void 0 ? Bt : /* @__PURE__ */ X(d, {
|
|
377
377
|
initial: !1,
|
|
378
|
-
children:
|
|
378
|
+
children: R ? /* @__PURE__ */ X(s.div, {
|
|
379
379
|
className: "overflow-hidden",
|
|
380
380
|
initial: {
|
|
381
381
|
height: 0,
|
|
@@ -389,7 +389,7 @@ var Xn = [
|
|
|
389
389
|
height: 0,
|
|
390
390
|
opacity: 0,
|
|
391
391
|
transition: {
|
|
392
|
-
duration:
|
|
392
|
+
duration: le ? 0 : .22,
|
|
393
393
|
ease: [
|
|
394
394
|
.4,
|
|
395
395
|
0,
|
|
@@ -399,7 +399,7 @@ var Xn = [
|
|
|
399
399
|
}
|
|
400
400
|
},
|
|
401
401
|
transition: {
|
|
402
|
-
duration:
|
|
402
|
+
duration: le ? 0 : .4,
|
|
403
403
|
ease: [
|
|
404
404
|
.4,
|
|
405
405
|
0,
|
|
@@ -407,7 +407,7 @@ var Xn = [
|
|
|
407
407
|
1
|
|
408
408
|
]
|
|
409
409
|
},
|
|
410
|
-
children:
|
|
410
|
+
children: ie
|
|
411
411
|
}, "replacement") : /* @__PURE__ */ X(s.div, {
|
|
412
412
|
className: "overflow-hidden",
|
|
413
413
|
initial: {
|
|
@@ -422,7 +422,7 @@ var Xn = [
|
|
|
422
422
|
height: 0,
|
|
423
423
|
opacity: 0,
|
|
424
424
|
transition: {
|
|
425
|
-
duration:
|
|
425
|
+
duration: le ? 0 : .15,
|
|
426
426
|
ease: [
|
|
427
427
|
.55,
|
|
428
428
|
0,
|
|
@@ -432,7 +432,7 @@ var Xn = [
|
|
|
432
432
|
}
|
|
433
433
|
},
|
|
434
434
|
transition: {
|
|
435
|
-
duration:
|
|
435
|
+
duration: le ? 0 : .4,
|
|
436
436
|
ease: [
|
|
437
437
|
.4,
|
|
438
438
|
0,
|
|
@@ -443,27 +443,27 @@ var Xn = [
|
|
|
443
443
|
children: Bt
|
|
444
444
|
}, "input")
|
|
445
445
|
})
|
|
446
|
-
] }), Ht = i(Qn,
|
|
447
|
-
return
|
|
448
|
-
ref:
|
|
449
|
-
"data-testid":
|
|
446
|
+
] }), Ht = i(Qn, ae);
|
|
447
|
+
return F ? /* @__PURE__ */ X("form", {
|
|
448
|
+
ref: I,
|
|
449
|
+
"data-testid": ue,
|
|
450
450
|
"data-f0-chat-composer": "",
|
|
451
451
|
"aria-busy": t,
|
|
452
452
|
className: Ht,
|
|
453
453
|
onClick: () => {
|
|
454
|
-
|
|
454
|
+
R || V.current?.focus();
|
|
455
455
|
},
|
|
456
|
-
onFocus:
|
|
457
|
-
onBlur:
|
|
456
|
+
onFocus: oe,
|
|
457
|
+
onBlur: se,
|
|
458
458
|
onSubmit: xt,
|
|
459
459
|
children: Vt
|
|
460
460
|
}) : /* @__PURE__ */ X("div", {
|
|
461
|
-
ref:
|
|
462
|
-
"data-testid":
|
|
461
|
+
ref: I,
|
|
462
|
+
"data-testid": ue,
|
|
463
463
|
"data-f0-chat-composer": "",
|
|
464
464
|
className: Ht,
|
|
465
|
-
onFocus:
|
|
466
|
-
onBlur:
|
|
465
|
+
onFocus: oe,
|
|
466
|
+
onBlur: se,
|
|
467
467
|
children: Vt
|
|
468
468
|
});
|
|
469
469
|
};
|
|
@@ -494,7 +494,7 @@ function nr(e, t, n = .2) {
|
|
|
494
494
|
//#endregion
|
|
495
495
|
//#region src/addons/ai/F0AiChatTextArea/components/AttachedFilesList.tsx
|
|
496
496
|
var rr = (e) => {
|
|
497
|
-
let { provided: t } =
|
|
497
|
+
let { provided: t } = oe();
|
|
498
498
|
return t ? /* @__PURE__ */ X(ir, { ...e }) : /* @__PURE__ */ X(Tt, { children: /* @__PURE__ */ X(ir, { ...e }) });
|
|
499
499
|
}, ir = ({ attachedFiles: e, isUploading: n, onRemove: r, removeLabel: i, reducedMotion: a }) => {
|
|
500
500
|
let o = t(), s = ar(e), c = q(() => e.flatMap((e) => {
|
|
@@ -506,7 +506,7 @@ var rr = (e) => {
|
|
|
506
506
|
});
|
|
507
507
|
return [{
|
|
508
508
|
att: e,
|
|
509
|
-
attachment:
|
|
509
|
+
attachment: Re({
|
|
510
510
|
name: n,
|
|
511
511
|
url: t,
|
|
512
512
|
mimeType: r
|
|
@@ -525,10 +525,10 @@ var rr = (e) => {
|
|
|
525
525
|
}];
|
|
526
526
|
}), [e, s]), l = q(() => c.map(({ att: e, attachment: t }, n) => ({
|
|
527
527
|
file: t,
|
|
528
|
-
item: e.status === "uploaded" ?
|
|
528
|
+
item: e.status === "uploaded" ? H(t, b(n, t.url)) : null
|
|
529
529
|
})), [c]), u = Ct(l, "composer"), d = c.map(({ att: e, attachment: t }) => ({
|
|
530
530
|
id: e.id,
|
|
531
|
-
content: /* @__PURE__ */ X(
|
|
531
|
+
content: /* @__PURE__ */ X(Ae, {
|
|
532
532
|
attachment: t,
|
|
533
533
|
status: e.status === "uploaded" ? "ready" : e.status === "error" ? "error" : "uploading",
|
|
534
534
|
errorMessage: e.errorMessage,
|
|
@@ -538,7 +538,7 @@ var rr = (e) => {
|
|
|
538
538
|
testIdPrefix: "ai-chat"
|
|
539
539
|
})
|
|
540
540
|
}));
|
|
541
|
-
return /* @__PURE__ */ X(
|
|
541
|
+
return /* @__PURE__ */ X(F, {
|
|
542
542
|
items: d,
|
|
543
543
|
label: o.t(e.length === 1 ? "chat.attachmentCount.one" : "chat.attachmentCount.other", { count: e.length }),
|
|
544
544
|
busy: n,
|
|
@@ -568,14 +568,14 @@ var rr = (e) => {
|
|
|
568
568
|
u(e), s?.(e);
|
|
569
569
|
}, f = [...n ? [{
|
|
570
570
|
label: c.ai.addFilesOrPhotos,
|
|
571
|
-
icon:
|
|
571
|
+
icon: we,
|
|
572
572
|
onClick: r,
|
|
573
573
|
disabled: i,
|
|
574
574
|
disabledTooltip: a
|
|
575
|
-
}, ...e.length > 0 ? [{ type: "separator" }] : []] : [], ...
|
|
575
|
+
}, ...e.length > 0 ? [{ type: "separator" }] : []] : [], ...se(e)];
|
|
576
576
|
return /* @__PURE__ */ X("div", {
|
|
577
577
|
onClick: (e) => e.stopPropagation(),
|
|
578
|
-
children: /* @__PURE__ */ X(
|
|
578
|
+
children: /* @__PURE__ */ X(pe, {
|
|
579
579
|
items: f,
|
|
580
580
|
align: "start",
|
|
581
581
|
disabled: o,
|
|
@@ -608,7 +608,7 @@ var rr = (e) => {
|
|
|
608
608
|
label: u.ai.attachFile,
|
|
609
609
|
hideLabel: !0,
|
|
610
610
|
type: "button",
|
|
611
|
-
icon:
|
|
611
|
+
icon: we,
|
|
612
612
|
variant: "ghost",
|
|
613
613
|
size: "md",
|
|
614
614
|
disabled: r || d,
|
|
@@ -639,7 +639,7 @@ var rr = (e) => {
|
|
|
639
639
|
};
|
|
640
640
|
}, lr = ({ creditWarning: e, children: n }) => {
|
|
641
641
|
let r = t(), i = cr(e);
|
|
642
|
-
return /* @__PURE__ */ X(
|
|
642
|
+
return /* @__PURE__ */ X(N, {
|
|
643
643
|
notice: i,
|
|
644
644
|
dismissLabel: r.ai.creditWarning.dismiss ?? "",
|
|
645
645
|
className: "[&_form]:border-f1-border",
|
|
@@ -836,7 +836,7 @@ var vr = (e, t) => e || t ? {
|
|
|
836
836
|
/* @__PURE__ */ X("div", {
|
|
837
837
|
className: "flex items-center py-0.5",
|
|
838
838
|
children: /* @__PURE__ */ X(U, {
|
|
839
|
-
icon:
|
|
839
|
+
icon: me,
|
|
840
840
|
size: "md",
|
|
841
841
|
color: "default"
|
|
842
842
|
})
|
|
@@ -851,7 +851,7 @@ var vr = (e, t) => e || t ? {
|
|
|
851
851
|
variant: "ghost",
|
|
852
852
|
label: r.ai.removeQuote,
|
|
853
853
|
onClick: n,
|
|
854
|
-
icon:
|
|
854
|
+
icon: P,
|
|
855
855
|
hideLabel: !0,
|
|
856
856
|
size: "sm"
|
|
857
857
|
})
|
|
@@ -860,7 +860,7 @@ var vr = (e, t) => e || t ? {
|
|
|
860
860
|
});
|
|
861
861
|
}, br = ({ cards: e }) => e.length === 0 ? null : /* @__PURE__ */ X("div", {
|
|
862
862
|
className: "grid w-full grid-cols-2 gap-3",
|
|
863
|
-
children: e.slice(0, 4).map((e) => /* @__PURE__ */ X(
|
|
863
|
+
children: e.slice(0, 4).map((e) => /* @__PURE__ */ X(B, {
|
|
864
864
|
avatar: {
|
|
865
865
|
type: "icon",
|
|
866
866
|
icon: e.icon
|
|
@@ -1003,68 +1003,68 @@ function Er(e) {
|
|
|
1003
1003
|
//#endregion
|
|
1004
1004
|
//#region src/addons/ai/F0AiChatTextArea/AiChatComposer.tsx
|
|
1005
1005
|
var Dr = "w-full max-w-content px-1";
|
|
1006
|
-
function Or({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholders: o, creditWarning: c, clarifyingUI: l, pendingContext: u = null, onPendingContextChange: f, pendingQuote: m = null, onPendingQuoteChange: h, fileAttachments: g, toolbarStart: _, composerActions: v, onComposerActionsOpenChange: y, onTranscribe: b, searchPersons: x, mentionSources: S, onProcessFilesRef:
|
|
1007
|
-
let F = t(), ae = !!p(), I = J(null), [oe, se] = Y(!1), [
|
|
1006
|
+
function Or({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholders: o, creditWarning: c, clarifyingUI: l, pendingContext: u = null, onPendingContextChange: f, pendingQuote: m = null, onPendingQuoteChange: h, fileAttachments: g, toolbarStart: _, composerActions: v, onComposerActionsOpenChange: y, onTranscribe: b, searchPersons: x, mentionSources: S, onProcessFilesRef: w, disclaimer: T, usageLimits: E, footer: D, isWelcomeScreen: O = !1, fullscreen: k = !1, welcomeScreenSuggestions: j, onSuggestionClick: M, welcomeScreenSuggestionsPlacement: N = "above", welcomeScreenSuggestionsCollapsedByDefault: P = !1, welcomeScreenCards: ne, padding: re = "default", name: ie }) {
|
|
1007
|
+
let F = t(), ae = !!p(), I = J(null), [oe, se] = Y(!1), [ce, le] = Y({
|
|
1008
1008
|
isEmpty: !0,
|
|
1009
1009
|
recorder: "idle"
|
|
1010
|
-
}),
|
|
1010
|
+
}), ue = J(null), R = J(null);
|
|
1011
1011
|
K(() => () => {
|
|
1012
|
-
|
|
1012
|
+
R.current && clearTimeout(R.current);
|
|
1013
1013
|
}, []);
|
|
1014
|
-
let
|
|
1014
|
+
let de = l != null, fe = J(u), pe = J(m);
|
|
1015
1015
|
Gn(() => {
|
|
1016
|
-
|
|
1016
|
+
fe.current = u, pe.current = m;
|
|
1017
1017
|
});
|
|
1018
|
-
let { tracking:
|
|
1018
|
+
let { tracking: me, setFocusChatInputFunction: he } = L(), { attachedFiles: ge, fileInputRef: _e, onUploadFiles: ve, acceptValue: ye, isAtMaxFiles: z, maxFiles: xe, processFiles: B, handleFileSelect: Se, handleRemoveFile: Ce, transientError: we, showTransientError: Te } = Er(g), Ee = Sr({
|
|
1019
1019
|
searchPersons: x,
|
|
1020
1020
|
mentionSources: S
|
|
1021
1021
|
});
|
|
1022
1022
|
K(() => {
|
|
1023
|
-
|
|
1023
|
+
P || typeof window < "u" && window.location.hash.length === 0 && I.current?.focus();
|
|
1024
1024
|
}, []), K(() => {
|
|
1025
|
-
if (
|
|
1026
|
-
else return
|
|
1025
|
+
if (de) he(null);
|
|
1026
|
+
else return he(() => {
|
|
1027
1027
|
I.current?.focus();
|
|
1028
|
-
}), () =>
|
|
1029
|
-
}, [
|
|
1030
|
-
if (
|
|
1031
|
-
|
|
1028
|
+
}), () => he(null);
|
|
1029
|
+
}, [de, he]), K(() => {
|
|
1030
|
+
if (w) return w((e) => {
|
|
1031
|
+
B(e);
|
|
1032
1032
|
}), () => {
|
|
1033
|
-
|
|
1033
|
+
w(null);
|
|
1034
1034
|
};
|
|
1035
|
-
}, [
|
|
1036
|
-
let De = G((e) => void
|
|
1035
|
+
}, [w, B]);
|
|
1036
|
+
let De = G((e) => void B(e), [B]), Oe = ge.filter((e) => e.status === "uploaded"), ke = ge.some((e) => e.status === "uploading"), Ae = ge.some((e) => e.status === "error"), V = !ce.isEmpty || Oe.length > 0, je = async ({ text: t, mentions: n }) => {
|
|
1037
1037
|
if (Ae) return Te(F.ai.fileUploadBlockedSubmit), !1;
|
|
1038
1038
|
if (a && await a() === !1) return !1;
|
|
1039
1039
|
let r = Oe, i = r.flatMap((e) => e.uploadedFile ? [e.uploadedFile] : []), o = u, s = m;
|
|
1040
1040
|
o && f?.(null), s && h?.(null);
|
|
1041
1041
|
try {
|
|
1042
1042
|
await e({
|
|
1043
|
-
text:
|
|
1043
|
+
text: te(t, n),
|
|
1044
1044
|
files: i,
|
|
1045
1045
|
context: o,
|
|
1046
1046
|
quote: s
|
|
1047
1047
|
});
|
|
1048
1048
|
} catch {
|
|
1049
|
-
return o && (
|
|
1049
|
+
return o && (fe.current == null || fe.current === o) && f?.(o), s && (pe.current == null || pe.current === s) && h?.(s), !1;
|
|
1050
1050
|
}
|
|
1051
1051
|
for (let e of r) Ce(e.id);
|
|
1052
1052
|
return !0;
|
|
1053
|
-
}, H =
|
|
1054
|
-
onItemClick:
|
|
1053
|
+
}, H = N === "inside", Me = C(), Ne = ot({
|
|
1054
|
+
onItemClick: M,
|
|
1055
1055
|
inBar: H
|
|
1056
|
-
}), Pe = O &&
|
|
1057
|
-
suggestions:
|
|
1056
|
+
}), Pe = O && j && j.length > 0 && M ? /* @__PURE__ */ X(be, {
|
|
1057
|
+
suggestions: j,
|
|
1058
1058
|
onItemClick: Ne.pick,
|
|
1059
1059
|
onItemHover: Ne.preview,
|
|
1060
1060
|
side: H ? "bottom" : "top",
|
|
1061
1061
|
reserveTwoRows: !H,
|
|
1062
1062
|
overflow: H ? "scroll" : "wrap"
|
|
1063
|
-
}) : null, Fe = !
|
|
1064
|
-
|
|
1063
|
+
}) : null, Fe = !P || oe || V || ce.recorder !== "idle", Ie = (e) => e instanceof Node ? ue.current?.contains(e) ? !0 : e instanceof Element && e.closest("[data-radix-popper-content-wrapper]") !== null : !1, Le = () => {
|
|
1064
|
+
R.current && clearTimeout(R.current), R.current = setTimeout(() => {
|
|
1065
1065
|
Ie(document.activeElement) || se(!1);
|
|
1066
1066
|
}, 0);
|
|
1067
|
-
}, Re = H, ze = Re &&
|
|
1067
|
+
}, Re = H, ze = Re && P, Be = ze && !Fe, Ve = Re && Pe ? /* @__PURE__ */ X("div", {
|
|
1068
1068
|
onClick: (e) => e.stopPropagation(),
|
|
1069
1069
|
children: Pe
|
|
1070
1070
|
}) : void 0, He = {
|
|
@@ -1075,7 +1075,7 @@ function Or({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1075
1075
|
.2,
|
|
1076
1076
|
1
|
|
1077
1077
|
]
|
|
1078
|
-
}, Ue = O && k && !!
|
|
1078
|
+
}, Ue = O && k && !!ne && ne.length > 0, We = k && O, Ge = We || !Me?.inBar, Ke = de || !!(T?.text || E), { motionProps: qe } = nr(O, 160, .5);
|
|
1079
1079
|
return /* @__PURE__ */ Z(s.div, {
|
|
1080
1080
|
"data-composer-layout": We ? "welcome" : "docked",
|
|
1081
1081
|
className: i("flex flex-col items-center", re === "default" && "px-4 pb-3 pt-2", We && "min-h-0 flex-1 justify-start"),
|
|
@@ -1085,7 +1085,7 @@ function Or({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1085
1085
|
className: i("flex flex-col gap-2", Dr),
|
|
1086
1086
|
children: [
|
|
1087
1087
|
D && !k ? D : null,
|
|
1088
|
-
Pe && !H ? /* @__PURE__ */ X("div", { children:
|
|
1088
|
+
Pe && !H ? /* @__PURE__ */ X("div", { children: P ? /* @__PURE__ */ X(d, {
|
|
1089
1089
|
initial: !1,
|
|
1090
1090
|
children: Fe ? /* @__PURE__ */ X(s.div, {
|
|
1091
1091
|
className: "overflow-hidden",
|
|
@@ -1109,13 +1109,13 @@ function Or({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1109
1109
|
creditWarning: c,
|
|
1110
1110
|
children: /* @__PURE__ */ X(tr, {
|
|
1111
1111
|
asForm: !0,
|
|
1112
|
-
surfaceRef:
|
|
1112
|
+
surfaceRef: ue,
|
|
1113
1113
|
handleRef: I,
|
|
1114
1114
|
className: "isolate z-20 items-stretch bg-f1-special-page-surface p-0 hover:cursor-text",
|
|
1115
|
-
replacement:
|
|
1115
|
+
replacement: de ? l : null,
|
|
1116
1116
|
onSurfaceFocus: () => se(!0),
|
|
1117
1117
|
onSurfaceBlur: Le,
|
|
1118
|
-
onStateChange:
|
|
1118
|
+
onStateChange: le,
|
|
1119
1119
|
onSend: je,
|
|
1120
1120
|
inProgress: r,
|
|
1121
1121
|
onStop: n,
|
|
@@ -1147,8 +1147,8 @@ function Or({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1147
1147
|
},
|
|
1148
1148
|
voice: b ? {
|
|
1149
1149
|
onTranscribe: b,
|
|
1150
|
-
onPress:
|
|
1151
|
-
onCancelled:
|
|
1150
|
+
onPress: me?.onDictationStart,
|
|
1151
|
+
onCancelled: me?.onDictationCancel
|
|
1152
1152
|
} : void 0,
|
|
1153
1153
|
onPasteFiles: g?.onUploadFiles ? De : void 0,
|
|
1154
1154
|
pastePreferText: !0,
|
|
@@ -1157,7 +1157,7 @@ function Or({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1157
1157
|
onRemove: () => h?.(null)
|
|
1158
1158
|
}) : null,
|
|
1159
1159
|
tray: /* @__PURE__ */ X(rr, {
|
|
1160
|
-
attachedFiles:
|
|
1160
|
+
attachedFiles: ge,
|
|
1161
1161
|
isUploading: ke,
|
|
1162
1162
|
onRemove: Ce,
|
|
1163
1163
|
removeLabel: F.ai.removeFile,
|
|
@@ -1165,19 +1165,19 @@ function Or({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1165
1165
|
}),
|
|
1166
1166
|
leading: Re ? /* @__PURE__ */ X("div", {
|
|
1167
1167
|
className: "flex shrink-0 self-center pl-3",
|
|
1168
|
-
children: /* @__PURE__ */ X(
|
|
1168
|
+
children: /* @__PURE__ */ X(A, {
|
|
1169
1169
|
size: "sm",
|
|
1170
1170
|
spin: r
|
|
1171
1171
|
})
|
|
1172
1172
|
}) : void 0,
|
|
1173
|
-
toolbarStart:
|
|
1174
|
-
onUploadFiles:
|
|
1173
|
+
toolbarStart: ve || _ || v?.length ? (e) => /* @__PURE__ */ Z(Kn, { children: [/* @__PURE__ */ X(sr, {
|
|
1174
|
+
onUploadFiles: ve,
|
|
1175
1175
|
composerActions: v,
|
|
1176
1176
|
onComposerActionsOpenChange: y,
|
|
1177
|
-
isAtMaxFiles:
|
|
1178
|
-
maxFiles:
|
|
1179
|
-
acceptValue:
|
|
1180
|
-
fileInputRef:
|
|
1177
|
+
isAtMaxFiles: z,
|
|
1178
|
+
maxFiles: xe,
|
|
1179
|
+
acceptValue: ye,
|
|
1180
|
+
fileInputRef: _e,
|
|
1181
1181
|
handleFileSelect: Se,
|
|
1182
1182
|
recordingStatus: e
|
|
1183
1183
|
}), _ ? /* @__PURE__ */ X("div", {
|
|
@@ -1198,7 +1198,7 @@ function Or({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1198
1198
|
children: /* @__PURE__ */ X("div", {
|
|
1199
1199
|
className: i("flex min-h-0 min-w-0 flex-col items-center", !Ke && "overflow-hidden"),
|
|
1200
1200
|
children: /* @__PURE__ */ X(ee, {
|
|
1201
|
-
hint:
|
|
1201
|
+
hint: de ? {
|
|
1202
1202
|
navigate: F.ai.clarifyingQuestion.navHint.navigate,
|
|
1203
1203
|
select: F.ai.clarifyingQuestion.navHint.select,
|
|
1204
1204
|
cancel: F.ai.clarifyingQuestion.navHint.cancel
|
|
@@ -1211,7 +1211,7 @@ function Or({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1211
1211
|
}),
|
|
1212
1212
|
Ue ? /* @__PURE__ */ X("div", {
|
|
1213
1213
|
className: i("mt-2 pt-2", Dr),
|
|
1214
|
-
children: /* @__PURE__ */ X(br, { cards:
|
|
1214
|
+
children: /* @__PURE__ */ X(br, { cards: ne })
|
|
1215
1215
|
}) : null,
|
|
1216
1216
|
D && O && k ? /* @__PURE__ */ X("div", {
|
|
1217
1217
|
className: "mx-auto mt-2 flex w-full max-w-content justify-center py-4",
|
|
@@ -1227,7 +1227,7 @@ function kr(e) {
|
|
|
1227
1227
|
...e,
|
|
1228
1228
|
name: "one-ai-input"
|
|
1229
1229
|
});
|
|
1230
|
-
return
|
|
1230
|
+
return ct() ? t : /* @__PURE__ */ X(he, { children: t });
|
|
1231
1231
|
}
|
|
1232
1232
|
//#endregion
|
|
1233
1233
|
//#region src/addons/ai/F0AiChat/components/markdownRenderers/components/typography.ts
|
|
@@ -1327,12 +1327,12 @@ function Gr({ children: e, ...t }) {
|
|
|
1327
1327
|
//#endregion
|
|
1328
1328
|
//#region src/addons/ai/F0AiChat/components/markdownRenderers/components/Image.tsx
|
|
1329
1329
|
function Kr({ src: e, alt: n, ...r }) {
|
|
1330
|
-
let o = t(), s = It(), c =
|
|
1330
|
+
let o = t(), s = It(), c = Gt(), l = Ut(e || void 0), [u, d] = Y(!1), [f, p] = Y(!1), m = n || (e ? mt(e) : "") || "image";
|
|
1331
1331
|
if (!e || u || l.status === "error") return n ? /* @__PURE__ */ X("span", {
|
|
1332
1332
|
className: "text-f1-foreground-secondary",
|
|
1333
1333
|
children: n
|
|
1334
1334
|
}) : null;
|
|
1335
|
-
let h = l.status === "ready" ? /* @__PURE__ */ X(
|
|
1335
|
+
let h = l.status === "ready" ? /* @__PURE__ */ X(Qe, {
|
|
1336
1336
|
...r,
|
|
1337
1337
|
src: l.url,
|
|
1338
1338
|
alt: n,
|
|
@@ -1360,7 +1360,7 @@ function Kr({ src: e, alt: n, ...r }) {
|
|
|
1360
1360
|
variant: "neutral",
|
|
1361
1361
|
label: o.chat.download,
|
|
1362
1362
|
hideLabel: !0,
|
|
1363
|
-
icon:
|
|
1363
|
+
icon: w,
|
|
1364
1364
|
onClick: () => c(e, m)
|
|
1365
1365
|
})
|
|
1366
1366
|
})]
|
|
@@ -1469,7 +1469,7 @@ function ei({ id: e, trigger: t, resolver: n, contentClassName: r = "w-64", ...a
|
|
|
1469
1469
|
side: "top",
|
|
1470
1470
|
align: "start",
|
|
1471
1471
|
className: i(r, "rounded-2xl border-none bg-f1-background p-0 text-f1-foreground shadow-md"),
|
|
1472
|
-
children: a.renderCard ? a.renderCard(h) : h.status === "loading" ? /* @__PURE__ */ X(
|
|
1472
|
+
children: a.renderCard ? a.renderCard(h) : h.status === "loading" ? /* @__PURE__ */ X(M.Skeleton, {}) : /* @__PURE__ */ X(M, { ...h.status === "ready" ? a.mapToCard(h.data) : a.fallbackCard })
|
|
1473
1473
|
})]
|
|
1474
1474
|
});
|
|
1475
1475
|
}
|
|
@@ -1524,7 +1524,7 @@ var ri = Rn(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
|
1524
1524
|
}));
|
|
1525
1525
|
ri.displayName = "CandidateTrigger";
|
|
1526
1526
|
function ii({ id: e, label: n }) {
|
|
1527
|
-
let { entityRefs: r } =
|
|
1527
|
+
let { entityRefs: r } = L(), i = r?.resolvers?.candidate, a = t(), o = r?.urls?.candidate?.(e), s = q(() => (e) => {
|
|
1528
1528
|
let t = [];
|
|
1529
1529
|
return e.source && t.push({
|
|
1530
1530
|
title: a.t("ai.entityRef.candidate.source"),
|
|
@@ -1588,10 +1588,10 @@ var ai = Rn(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
|
1588
1588
|
}));
|
|
1589
1589
|
ai.displayName = "ExpenseTrigger";
|
|
1590
1590
|
function oi({ id: e, label: n }) {
|
|
1591
|
-
let { entityRefs: r } =
|
|
1591
|
+
let { entityRefs: r } = L(), i = r?.resolvers?.expense, a = t(), o = r?.urls?.expense?.(e), s = q(() => (e) => ({
|
|
1592
1592
|
avatar: {
|
|
1593
1593
|
type: "icon",
|
|
1594
|
-
icon:
|
|
1594
|
+
icon: je
|
|
1595
1595
|
},
|
|
1596
1596
|
title: e.description || `Expense #${e.id}`,
|
|
1597
1597
|
description: [e.amount, e.status].filter(Boolean).join(" · "),
|
|
@@ -1629,7 +1629,7 @@ var si = Rn(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
|
1629
1629
|
}));
|
|
1630
1630
|
si.displayName = "JobPostingTrigger";
|
|
1631
1631
|
function ci({ id: e, label: n }) {
|
|
1632
|
-
let { entityRefs: r } =
|
|
1632
|
+
let { entityRefs: r } = L(), i = r?.resolvers?.jobPosting, a = t(), o = r?.urls?.jobPosting?.(e), s = q(() => (e) => ({
|
|
1633
1633
|
title: e.title,
|
|
1634
1634
|
description: [e.status, e.location].filter(Boolean).join(" · "),
|
|
1635
1635
|
...o && { secondaryActions: {
|
|
@@ -1688,7 +1688,7 @@ function ui({ name: e }) {
|
|
|
1688
1688
|
//#region src/addons/ai/F0AiChat/components/markdownRenderers/entityRef/entities/person/PersonEntityRef.tsx
|
|
1689
1689
|
var di = "\xA0";
|
|
1690
1690
|
function fi({ id: e, label: t }) {
|
|
1691
|
-
let { entityRefs: n } =
|
|
1691
|
+
let { entityRefs: n } = L(), r = n?.resolvers?.person, i = n?.urls?.person?.(e);
|
|
1692
1692
|
if (!r) return /* @__PURE__ */ X("span", { children: t });
|
|
1693
1693
|
let [a = "", ...o] = t.trim().split(/\s+/), s = o.join(" ");
|
|
1694
1694
|
return /* @__PURE__ */ X(ei, {
|
|
@@ -1700,7 +1700,7 @@ function fi({ id: e, label: t }) {
|
|
|
1700
1700
|
resolver: r,
|
|
1701
1701
|
contentClassName: "w-72",
|
|
1702
1702
|
renderCard: (e) => {
|
|
1703
|
-
if (e.status !== "ready") return /* @__PURE__ */ X(
|
|
1703
|
+
if (e.status !== "ready") return /* @__PURE__ */ X(x, {
|
|
1704
1704
|
name: t,
|
|
1705
1705
|
avatar: {
|
|
1706
1706
|
type: "person",
|
|
@@ -1711,7 +1711,7 @@ function fi({ id: e, label: t }) {
|
|
|
1711
1711
|
profileHref: i
|
|
1712
1712
|
});
|
|
1713
1713
|
let n = e.data;
|
|
1714
|
-
return /* @__PURE__ */ X(
|
|
1714
|
+
return /* @__PURE__ */ X(x, {
|
|
1715
1715
|
name: `${n.firstName} ${n.lastName}`,
|
|
1716
1716
|
avatar: {
|
|
1717
1717
|
type: "person",
|
|
@@ -1755,7 +1755,7 @@ var mi = Rn(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
|
1755
1755
|
}));
|
|
1756
1756
|
mi.displayName = "RequisitionTrigger";
|
|
1757
1757
|
function hi({ id: e, label: n }) {
|
|
1758
|
-
let { entityRefs: r } =
|
|
1758
|
+
let { entityRefs: r } = L(), i = r?.resolvers?.requisition, a = t(), o = r?.urls?.requisition?.(e), s = q(() => (e) => {
|
|
1759
1759
|
let t = e.lineManager ? `${e.lineManager.firstName} ${e.lineManager.lastName}` : void 0, n = [
|
|
1760
1760
|
e.status ? {
|
|
1761
1761
|
label: a.t("ai.entityRef.requisition.status"),
|
|
@@ -1823,7 +1823,7 @@ var gi = Rn(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
|
1823
1823
|
}));
|
|
1824
1824
|
gi.displayName = "VacancyTrigger";
|
|
1825
1825
|
function _i({ id: e, label: n }) {
|
|
1826
|
-
let { entityRefs: r } =
|
|
1826
|
+
let { entityRefs: r } = L(), i = r?.resolvers?.vacancy, a = t(), o = r?.urls?.vacancy?.(e), s = q(() => (e) => ({
|
|
1827
1827
|
title: e.name,
|
|
1828
1828
|
description: [e.status, e.vacancyType].filter(Boolean).join(" · "),
|
|
1829
1829
|
...o && { secondaryActions: {
|
|
@@ -1871,7 +1871,7 @@ function xi(e) {
|
|
|
1871
1871
|
return typeof e == "string" ? e : typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(xi).join("") : e && typeof e == "object" && "props" in e ? xi(e.props.children) : "";
|
|
1872
1872
|
}
|
|
1873
1873
|
function Si({ type: e, id: t, children: n }) {
|
|
1874
|
-
let { entityRefs: r } =
|
|
1874
|
+
let { entityRefs: r } = L();
|
|
1875
1875
|
if (!t || !e) return /* @__PURE__ */ X("span", { children: n });
|
|
1876
1876
|
let i = xi(n), a = yi(e);
|
|
1877
1877
|
if (a) return /* @__PURE__ */ X(a, {
|
|
@@ -1919,7 +1919,7 @@ var Ci = (e) => Array.from(e.querySelector("tr")?.children ?? []), wi = (e) => {
|
|
|
1919
1919
|
//#endregion
|
|
1920
1920
|
//#region src/addons/ai/F0AiChat/components/markdownRenderers/components/useOneLineWidth.ts
|
|
1921
1921
|
function Di(e, t) {
|
|
1922
|
-
let n = J(null), r =
|
|
1922
|
+
let n = J(null), r = nt(), [i, a] = Y();
|
|
1923
1923
|
return Gn(function() {
|
|
1924
1924
|
if (!t || !n.current) return;
|
|
1925
1925
|
let e = parseFloat(getComputedStyle(n.current, "::before").width);
|
|
@@ -1947,11 +1947,11 @@ var Oi = (e) => Fn.toArray(e).filter((e) => zn(e)), ki = (e) => Oi(e.props.child
|
|
|
1947
1947
|
return t;
|
|
1948
1948
|
};
|
|
1949
1949
|
async function ji({ header: e, rows: t }, n, r) {
|
|
1950
|
-
let i = (e.length > 0 ? [e, ...t] : t).map((e) => e.map((e) =>
|
|
1950
|
+
let i = (e.length > 0 ? [e, ...t] : t).map((e) => e.map((e) => R(xi(e)))), a = n === "xlsx" ? await j([{
|
|
1951
1951
|
name: "Data",
|
|
1952
1952
|
rows: i
|
|
1953
|
-
}]) : await
|
|
1954
|
-
|
|
1953
|
+
}]) : await it(i);
|
|
1954
|
+
le(a, `${r}.${n}`);
|
|
1955
1955
|
}
|
|
1956
1956
|
function Mi({ children: e, title: n, ...r }) {
|
|
1957
1957
|
let o = t(), s = J(null), c = Ti(s), l = c.left || c.right, u = p(), d = (t) => {
|
|
@@ -1975,27 +1975,27 @@ function Mi({ children: e, title: n, ...r }) {
|
|
|
1975
1975
|
})
|
|
1976
1976
|
}), /* @__PURE__ */ Z("div", {
|
|
1977
1977
|
className: "-ml-2 flex gap-1 pt-1",
|
|
1978
|
-
children: [/* @__PURE__ */ X(
|
|
1978
|
+
children: [/* @__PURE__ */ X(pe, {
|
|
1979
1979
|
items: [{
|
|
1980
1980
|
label: o.t("ai.dataDownload.download", { format: "Excel" }),
|
|
1981
|
-
icon:
|
|
1981
|
+
icon: w,
|
|
1982
1982
|
onClick: () => d("xlsx")
|
|
1983
1983
|
}, {
|
|
1984
1984
|
label: o.t("ai.dataDownload.download", { format: "CSV" }),
|
|
1985
|
-
icon:
|
|
1985
|
+
icon: w,
|
|
1986
1986
|
onClick: () => d("csv")
|
|
1987
1987
|
}],
|
|
1988
1988
|
children: /* @__PURE__ */ X(m, {
|
|
1989
1989
|
variant: "ghost",
|
|
1990
1990
|
size: "sm",
|
|
1991
|
-
icon:
|
|
1991
|
+
icon: w,
|
|
1992
1992
|
label: o.ai.dataDownload.title,
|
|
1993
1993
|
className: "text-f1-foreground-secondary hover:text-f1-foreground"
|
|
1994
1994
|
})
|
|
1995
1995
|
}), l && (c.after > 0 || c.left) ? /* @__PURE__ */ X(m, {
|
|
1996
1996
|
variant: "ghost",
|
|
1997
1997
|
size: "sm",
|
|
1998
|
-
icon: c.after > 0 ?
|
|
1998
|
+
icon: c.after > 0 ? Ge : vn,
|
|
1999
1999
|
iconPosition: c.after > 0 ? "right" : "left",
|
|
2000
2000
|
label: c.after > 0 ? o.t(c.after === 1 ? "ai.aiTable.moreColumns.one" : "ai.aiTable.moreColumns.other", { count: c.after }) : o.ai.aiTable.backToStart,
|
|
2001
2001
|
className: "text-f1-foreground-secondary hover:text-f1-foreground",
|
|
@@ -2483,7 +2483,7 @@ function Ra(e) {
|
|
|
2483
2483
|
return e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
2484
2484
|
}
|
|
2485
2485
|
function za(e) {
|
|
2486
|
-
let { days: t, hours: n, minutes: r, seconds: i } =
|
|
2486
|
+
let { days: t, hours: n, minutes: r, seconds: i } = v(e), a = [];
|
|
2487
2487
|
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(" ");
|
|
2488
2488
|
}
|
|
2489
2489
|
function Ba(e) {
|
|
@@ -2558,7 +2558,7 @@ function Ua(e, t) {
|
|
|
2558
2558
|
};
|
|
2559
2559
|
}
|
|
2560
2560
|
function Wa({ formName: e, formDescription: t, module: n, cardTitle: r, cardDescription: i, fieldDescriptions: a, formValues: o, valueFormatter: s }) {
|
|
2561
|
-
let { canvasContent: c, openCanvas: l, dismissCanvas: u } =
|
|
2561
|
+
let { canvasContent: c, openCanvas: l, dismissCanvas: u } = L(), d = Ma(e), f = s ?? d, p = J(() => {}), m = r ?? e, h = i ?? t ?? "", g = c?.type === "form" && c.formName === e, _ = () => l({
|
|
2562
2562
|
type: "form",
|
|
2563
2563
|
title: m,
|
|
2564
2564
|
description: h,
|
|
@@ -2619,7 +2619,7 @@ Wa.displayName = "FormCard";
|
|
|
2619
2619
|
//#endregion
|
|
2620
2620
|
//#region src/addons/ai/F0AiMessagesContainer/components/ActiveFormCard.tsx
|
|
2621
2621
|
function Ga() {
|
|
2622
|
-
let e =
|
|
2622
|
+
let e = ce(), t = e?.activeForm;
|
|
2623
2623
|
if (!t) return null;
|
|
2624
2624
|
let n = t.cardTitle, r = t.cardDescription, i = (e?.getFillVersion(t.formName) ?? 0) > 0;
|
|
2625
2625
|
return !n || !r || !i ? null : /* @__PURE__ */ X("div", {
|
|
@@ -2638,9 +2638,9 @@ function Ga() {
|
|
|
2638
2638
|
//#endregion
|
|
2639
2639
|
//#region src/addons/ai/F0AiFileAttachments/components/FileCanvasCards.tsx
|
|
2640
2640
|
var Ka = 625, qa = /* @__PURE__ */ new Set(), Ja = ({ documents: e, onOpenFile: t, onCanvasUnavailable: n }) => {
|
|
2641
|
-
let { canvasContent: r, tryOpenCanvas: i, dismissCanvas: a, panelOverlays: o } =
|
|
2641
|
+
let { canvasContent: r, tryOpenCanvas: i, dismissCanvas: a, panelOverlays: o } = L(), s = zt(), c = ia(), l = e.map((e) => e.file), u = (r, { fallback: a = !0 } = {}) => {
|
|
2642
2642
|
let o = e[r];
|
|
2643
|
-
o && t?.(o.file, "document", { documentKind: o.documentKind }) !== !1 && !i(
|
|
2643
|
+
o && t?.(o.file, "document", { documentKind: o.documentKind }) !== !1 && !i(tt({
|
|
2644
2644
|
files: l,
|
|
2645
2645
|
index: r,
|
|
2646
2646
|
config: s
|
|
@@ -2674,7 +2674,7 @@ var Ka = 625, qa = /* @__PURE__ */ new Set(), Ja = ({ documents: e, onOpenFile:
|
|
|
2674
2674
|
}
|
|
2675
2675
|
},
|
|
2676
2676
|
title: e.name,
|
|
2677
|
-
description: e.size ? vt(e.size) :
|
|
2677
|
+
description: e.size ? vt(e.size) : ke(e.name, na(e)),
|
|
2678
2678
|
isActive: n,
|
|
2679
2679
|
action: {
|
|
2680
2680
|
type: "open",
|
|
@@ -2686,7 +2686,7 @@ var Ka = 625, qa = /* @__PURE__ */ new Set(), Ja = ({ documents: e, onOpenFile:
|
|
|
2686
2686
|
})
|
|
2687
2687
|
});
|
|
2688
2688
|
}, Ya = "rounded-xl", Xa = "ai-chat", Za = (e) => {
|
|
2689
|
-
let { provided: t } =
|
|
2689
|
+
let { provided: t } = oe();
|
|
2690
2690
|
return t ? /* @__PURE__ */ X(eo, { ...e }) : /* @__PURE__ */ X(Tt, { children: /* @__PURE__ */ X(eo, { ...e }) });
|
|
2691
2691
|
}, Qa = {
|
|
2692
2692
|
image: 0,
|
|
@@ -2695,7 +2695,7 @@ var Ka = 625, qa = /* @__PURE__ */ new Set(), Ja = ({ documents: e, onOpenFile:
|
|
|
2695
2695
|
audio: 3,
|
|
2696
2696
|
file: 4
|
|
2697
2697
|
}, $a = (e) => e.bucket === "image" || e.bucket === "video" || e.bucket === "audio" || e.bucket === "document" ? e.bucket : "file", eo = ({ files: e, align: t = "start", onOpenFile: n, onFileDownloaded: r, size: i = "default", opensIn: a }) => {
|
|
2698
|
-
let { remotePreviews: o } =
|
|
2698
|
+
let { remotePreviews: o } = oe(), s = ie(), c = i === "default" && (a ?? (t === "start" && s ? "canvas" : "viewer")) === "canvas", [l, u] = Y(() => /* @__PURE__ */ new Set()), d = q(() => to(e, o, l), [
|
|
2699
2699
|
e,
|
|
2700
2700
|
o,
|
|
2701
2701
|
l
|
|
@@ -2712,12 +2712,12 @@ var Ka = 625, qa = /* @__PURE__ */ new Set(), Ja = ({ documents: e, onOpenFile:
|
|
|
2712
2712
|
onImageError: (e) => u((t) => new Set(t).add(e.url))
|
|
2713
2713
|
});
|
|
2714
2714
|
}, to = (e, t, n) => e.map((e, r) => {
|
|
2715
|
-
let i =
|
|
2715
|
+
let i = rt(e), a = !(t || xe(e.url)) || i.bucket === "file" || i.bucket === "image" && n.has(e.url);
|
|
2716
2716
|
return {
|
|
2717
2717
|
file: e,
|
|
2718
2718
|
cls: i,
|
|
2719
2719
|
generic: a,
|
|
2720
|
-
item: a ? null :
|
|
2720
|
+
item: a ? null : H(e, b(r, e.url))
|
|
2721
2721
|
};
|
|
2722
2722
|
}), no = ({ align: e, compact: t = !1, children: n }) => /* @__PURE__ */ X("div", {
|
|
2723
2723
|
className: i("flex w-full min-w-0 flex-col gap-1.5", e === "end" ? "items-end" : "items-start"),
|
|
@@ -2749,8 +2749,8 @@ var Ka = 625, qa = /* @__PURE__ */ new Set(), Ja = ({ documents: e, onOpenFile:
|
|
|
2749
2749
|
}) : null,
|
|
2750
2750
|
c.map((e, t) => {
|
|
2751
2751
|
let { file: n, cls: r } = e, i = `${n.name}-${t}`;
|
|
2752
|
-
return r.bucket === "video" ? /* @__PURE__ */ X(
|
|
2753
|
-
file:
|
|
2752
|
+
return r.bucket === "video" ? /* @__PURE__ */ X(Ie, {
|
|
2753
|
+
file: Ke(n),
|
|
2754
2754
|
cornerClass: "rounded-xl",
|
|
2755
2755
|
testIdPrefix: Xa,
|
|
2756
2756
|
onDownloaded: () => s?.(n)
|
|
@@ -2759,7 +2759,7 @@ var Ka = 625, qa = /* @__PURE__ */ new Set(), Ja = ({ documents: e, onOpenFile:
|
|
|
2759
2759
|
f || t ? null : d.map((e, t) => {
|
|
2760
2760
|
let { file: n, cls: i } = e;
|
|
2761
2761
|
return i.bucket === "document" ? /* @__PURE__ */ X(kt, {
|
|
2762
|
-
file:
|
|
2762
|
+
file: Ke(n),
|
|
2763
2763
|
kind: i.kind,
|
|
2764
2764
|
cornerClass: "rounded-xl",
|
|
2765
2765
|
testIdPrefix: Xa,
|
|
@@ -2771,8 +2771,8 @@ var Ka = 625, qa = /* @__PURE__ */ new Set(), Ja = ({ documents: e, onOpenFile:
|
|
|
2771
2771
|
onDownloaded: () => s?.(n)
|
|
2772
2772
|
}, `${n.name}-${t}`) : null;
|
|
2773
2773
|
}),
|
|
2774
|
-
c.map((e, t) => e.cls.bucket === "audio" ? /* @__PURE__ */ X(
|
|
2775
|
-
file:
|
|
2774
|
+
c.map((e, t) => e.cls.bucket === "audio" ? /* @__PURE__ */ X(ye, {
|
|
2775
|
+
file: Ke(e.file),
|
|
2776
2776
|
testIdPrefix: Xa,
|
|
2777
2777
|
onDownloaded: () => s?.(e.file)
|
|
2778
2778
|
}, `${e.file.name}-${t}`) : null),
|
|
@@ -2783,7 +2783,7 @@ var Ka = 625, qa = /* @__PURE__ */ new Set(), Ja = ({ documents: e, onOpenFile:
|
|
|
2783
2783
|
children: [g.length > 0 ? g.map((e, t) => {
|
|
2784
2784
|
let { file: n, cls: i } = e;
|
|
2785
2785
|
return i.bucket === "document" ? /* @__PURE__ */ X(kt, {
|
|
2786
|
-
file:
|
|
2786
|
+
file: Ke(n),
|
|
2787
2787
|
kind: i.kind,
|
|
2788
2788
|
cornerClass: "rounded-xl",
|
|
2789
2789
|
compact: !0,
|
|
@@ -2819,11 +2819,11 @@ var Ka = 625, qa = /* @__PURE__ */ new Set(), Ja = ({ documents: e, onOpenFile:
|
|
|
2819
2819
|
file: i,
|
|
2820
2820
|
onOpen: () => n(e)
|
|
2821
2821
|
}, c) : s.bucket === "audio" ? /* @__PURE__ */ X(T, {
|
|
2822
|
-
file:
|
|
2822
|
+
file: Ke(i),
|
|
2823
2823
|
testIdPrefix: Xa,
|
|
2824
2824
|
onOpen: () => n(e)
|
|
2825
2825
|
}, c) : s.bucket === "document" ? /* @__PURE__ */ X(kt, {
|
|
2826
|
-
file:
|
|
2826
|
+
file: Ke(i),
|
|
2827
2827
|
kind: s.kind,
|
|
2828
2828
|
cornerClass: "rounded-xl",
|
|
2829
2829
|
compact: !0,
|
|
@@ -2837,32 +2837,32 @@ var Ka = 625, qa = /* @__PURE__ */ new Set(), Ja = ({ documents: e, onOpenFile:
|
|
|
2837
2837
|
})
|
|
2838
2838
|
})
|
|
2839
2839
|
}), ao = ({ file: e, onFileDownloaded: n }) => {
|
|
2840
|
-
let r = t(), i =
|
|
2841
|
-
return /* @__PURE__ */ X(
|
|
2840
|
+
let r = t(), i = Gt(), a = na(e);
|
|
2841
|
+
return /* @__PURE__ */ X(Fe, {
|
|
2842
2842
|
file: {
|
|
2843
2843
|
...e,
|
|
2844
2844
|
mimeType: a
|
|
2845
2845
|
},
|
|
2846
|
-
icon: a === "application/zip" ?
|
|
2846
|
+
icon: a === "application/zip" ? dt : void 0,
|
|
2847
2847
|
testId: `${Xa}-file-tile`,
|
|
2848
2848
|
action: {
|
|
2849
2849
|
label: r.t("chat.downloadNamedFile", { name: e.name }),
|
|
2850
|
-
icon:
|
|
2850
|
+
icon: w,
|
|
2851
2851
|
onClick: () => {
|
|
2852
2852
|
i(e.url, e.name), n?.(e);
|
|
2853
2853
|
}
|
|
2854
2854
|
}
|
|
2855
2855
|
});
|
|
2856
2856
|
}, oo = "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", so = ({ file: e, onOpen: n, onError: r }) => {
|
|
2857
|
-
let o = t(), s =
|
|
2858
|
-
return
|
|
2857
|
+
let o = t(), s = Ut(e.thumbnailUrl ?? e.url);
|
|
2858
|
+
return Le(s.status, r), /* @__PURE__ */ X("button", {
|
|
2859
2859
|
type: "button",
|
|
2860
2860
|
onClick: n,
|
|
2861
2861
|
draggable: !1,
|
|
2862
2862
|
"aria-label": o.t("chat.openNamedDocument", { name: e.name }),
|
|
2863
2863
|
className: i(oo, a()),
|
|
2864
2864
|
"data-testid": "ai-chat-image-attachment",
|
|
2865
|
-
children: s.status === "ready" ? /* @__PURE__ */ X(
|
|
2865
|
+
children: s.status === "ready" ? /* @__PURE__ */ X(Qe, {
|
|
2866
2866
|
src: s.url,
|
|
2867
2867
|
alt: e.name,
|
|
2868
2868
|
draggable: !1,
|
|
@@ -2871,31 +2871,31 @@ var Ka = 625, qa = /* @__PURE__ */ new Set(), Ja = ({ documents: e, onOpenFile:
|
|
|
2871
2871
|
}) : null
|
|
2872
2872
|
});
|
|
2873
2873
|
}, co = ({ file: e, onOpen: n }) => {
|
|
2874
|
-
let r = t(), { urlCache: o } =
|
|
2874
|
+
let r = t(), { urlCache: o } = zt(), s = Ut(e.thumbnailUrl), c = !e.thumbnailUrl && o === null, [l, u] = Y(!1);
|
|
2875
2875
|
return /* @__PURE__ */ Z("button", {
|
|
2876
2876
|
type: "button",
|
|
2877
2877
|
onClick: n,
|
|
2878
2878
|
"aria-label": r.t("chat.videoPlayerLabel", { name: e.name }),
|
|
2879
2879
|
className: i(oo, a()),
|
|
2880
2880
|
"data-testid": "ai-chat-video-attachment",
|
|
2881
|
-
children: [!l && (s.status === "ready" || c) ? /* @__PURE__ */ X(
|
|
2881
|
+
children: [!l && (s.status === "ready" || c) ? /* @__PURE__ */ X(V, {
|
|
2882
2882
|
url: e.url,
|
|
2883
2883
|
posterUrl: s.status === "ready" ? s.url : void 0,
|
|
2884
2884
|
onError: () => u(!0)
|
|
2885
|
-
}) : null, /* @__PURE__ */ X(
|
|
2885
|
+
}) : null, /* @__PURE__ */ X(Oe, {})]
|
|
2886
2886
|
});
|
|
2887
2887
|
}, lo = ({ images: e, onOpen: n, onImageError: r }) => {
|
|
2888
|
-
let a = t(), o = e.length === 1 ? e[0] : void 0, s =
|
|
2888
|
+
let a = t(), o = e.length === 1 ? e[0] : void 0, s = Ut(o ? o.thumbnailUrl ?? o.url : void 0), c = Me(o && s.status === "ready" ? s.url : void 0, o) ?? void 0, l = o ? Ye(c?.width, c?.height) : null;
|
|
2889
2889
|
return /* @__PURE__ */ X("div", {
|
|
2890
2890
|
style: l ? { width: l.width } : void 0,
|
|
2891
|
-
className: i("grid grid-cols-2 overflow-hidden border border-solid border-f1-border-secondary", l ? "max-w-full" : ht,
|
|
2891
|
+
className: i("grid grid-cols-2 overflow-hidden border border-solid border-f1-border-secondary", l ? "max-w-full" : ht, ve, Ya),
|
|
2892
2892
|
"data-testid": "ai-chat-image-album",
|
|
2893
|
-
children:
|
|
2893
|
+
children: Ze(c ? [c] : e).map((t, o, s) => {
|
|
2894
2894
|
let c = e[t.index];
|
|
2895
2895
|
if (!c) return null;
|
|
2896
2896
|
let l = o === s.length - 1;
|
|
2897
|
-
return /* @__PURE__ */ X(
|
|
2898
|
-
image:
|
|
2897
|
+
return /* @__PURE__ */ X(Ht, {
|
|
2898
|
+
image: Ve(c),
|
|
2899
2899
|
aspectRatio: t.aspectRatio,
|
|
2900
2900
|
spanFull: t.span === 2,
|
|
2901
2901
|
inset: t.inset,
|
|
@@ -2990,7 +2990,7 @@ function _o({ anchor: e, onReply: n }) {
|
|
|
2990
2990
|
type: "button",
|
|
2991
2991
|
variant: "ghost",
|
|
2992
2992
|
label: c,
|
|
2993
|
-
icon:
|
|
2993
|
+
icon: S,
|
|
2994
2994
|
onClick: () => {
|
|
2995
2995
|
n(e.text);
|
|
2996
2996
|
}
|
|
@@ -3097,7 +3097,7 @@ var vo = In(void 0), yo = () => Vn(vo), bo = (e) => /* @__PURE__ */ X(yt, {
|
|
|
3097
3097
|
return /* @__PURE__ */ Z("div", {
|
|
3098
3098
|
className: i("-ml-2 -mt-1 flex items-center", !a && f === null && "opacity-0 transition-opacity duration-150 focus-within:opacity-100 group-hover/turn:opacity-100 motion-reduce:transition-none [@media(hover:none)]:opacity-100"),
|
|
3099
3099
|
children: [
|
|
3100
|
-
/* @__PURE__ */ X(
|
|
3100
|
+
/* @__PURE__ */ X(We, {
|
|
3101
3101
|
size: "md",
|
|
3102
3102
|
variant: "ghost",
|
|
3103
3103
|
valueToCopy: e,
|
|
@@ -3118,7 +3118,7 @@ var vo = In(void 0), yo = () => Vn(vo), bo = (e) => /* @__PURE__ */ X(yt, {
|
|
|
3118
3118
|
className: "flex min-w-0 flex-1 items-center justify-center gap-1",
|
|
3119
3119
|
children: /* @__PURE__ */ X(U, {
|
|
3120
3120
|
size: "md",
|
|
3121
|
-
icon: f === "like" ?
|
|
3121
|
+
icon: f === "like" ? qe : xt,
|
|
3122
3122
|
color: "default"
|
|
3123
3123
|
})
|
|
3124
3124
|
})
|
|
@@ -3136,7 +3136,7 @@ var vo = In(void 0), yo = () => Vn(vo), bo = (e) => /* @__PURE__ */ X(yt, {
|
|
|
3136
3136
|
className: "flex min-w-0 flex-1 items-center justify-center gap-1",
|
|
3137
3137
|
children: /* @__PURE__ */ X(U, {
|
|
3138
3138
|
size: "md",
|
|
3139
|
-
icon: f === "dislike" ? ft :
|
|
3139
|
+
icon: f === "dislike" ? ft : $e,
|
|
3140
3140
|
color: "default"
|
|
3141
3141
|
})
|
|
3142
3142
|
})
|
|
@@ -3153,7 +3153,7 @@ var vo = In(void 0), yo = () => Vn(vo), bo = (e) => /* @__PURE__ */ X(yt, {
|
|
|
3153
3153
|
className: "flex min-w-0 flex-1 items-center justify-center gap-1",
|
|
3154
3154
|
children: /* @__PURE__ */ X(U, {
|
|
3155
3155
|
size: "md",
|
|
3156
|
-
icon:
|
|
3156
|
+
icon: bt,
|
|
3157
3157
|
color: "default"
|
|
3158
3158
|
})
|
|
3159
3159
|
})
|
|
@@ -3214,13 +3214,13 @@ function wo() {
|
|
|
3214
3214
|
//#region src/addons/ai/F0AiMessagesContainer/components/rail.ts
|
|
3215
3215
|
var To = "-ml-1 flex w-5 shrink-0 flex-col items-center", Eo = "w-px shrink-0 bg-f1-border-secondary", Do = ({ icon: e, title: t, children: n, open: r, defaultOpen: a = !1, onOpenChange: o, lockOpen: c = !1 }) => {
|
|
3216
3216
|
let [l, u] = Y(a), d = p(), f = r !== void 0, m = f ? r : l;
|
|
3217
|
-
return /* @__PURE__ */ Z(
|
|
3217
|
+
return /* @__PURE__ */ Z(Se, {
|
|
3218
3218
|
className: "mb-1 w-full",
|
|
3219
3219
|
open: m,
|
|
3220
3220
|
onOpenChange: (e) => {
|
|
3221
3221
|
c || (f || u(e), o?.(e));
|
|
3222
3222
|
},
|
|
3223
|
-
children: [/* @__PURE__ */ Z(
|
|
3223
|
+
children: [/* @__PURE__ */ Z(ne, {
|
|
3224
3224
|
disabled: c,
|
|
3225
3225
|
className: i("group/rail flex w-full items-center gap-1.5 text-base text-f1-foreground-secondary", !c && "transition-colors duration-150 hover:text-f1-foreground"),
|
|
3226
3226
|
children: [/* @__PURE__ */ Z("span", {
|
|
@@ -3242,7 +3242,7 @@ var To = "-ml-1 flex w-5 shrink-0 flex-col items-center", Eo = "w-px shrink-0 bg
|
|
|
3242
3242
|
})
|
|
3243
3243
|
})] })
|
|
3244
3244
|
})]
|
|
3245
|
-
}), /* @__PURE__ */ X(
|
|
3245
|
+
}), /* @__PURE__ */ X(Ee, {
|
|
3246
3246
|
forceMount: !0,
|
|
3247
3247
|
className: "data-[state=open]:mt-1.5",
|
|
3248
3248
|
children: /* @__PURE__ */ X(s.div, {
|
|
@@ -3276,11 +3276,11 @@ function Oo({ step: e, last: t }) {
|
|
|
3276
3276
|
className: "flex gap-1.5",
|
|
3277
3277
|
children: [/* @__PURE__ */ Z("span", {
|
|
3278
3278
|
className: i(To, "pt-0.5"),
|
|
3279
|
-
children: [n ? /* @__PURE__ */ X(
|
|
3279
|
+
children: [n ? /* @__PURE__ */ X(de, {
|
|
3280
3280
|
variant: "thinking",
|
|
3281
3281
|
size: 16
|
|
3282
3282
|
}) : /* @__PURE__ */ X(U, {
|
|
3283
|
-
icon:
|
|
3283
|
+
icon: Ue,
|
|
3284
3284
|
size: "sm",
|
|
3285
3285
|
color: "secondary"
|
|
3286
3286
|
}), t ? null : /* @__PURE__ */ X("span", {
|
|
@@ -3360,7 +3360,7 @@ var Po = (e, t) => {
|
|
|
3360
3360
|
function Fo({ titles: e, title: n, inProgress: r, isWriting: a, answered: o = !1, startedAt: s = null }) {
|
|
3361
3361
|
let c = t(), l = !!r && !a && !o, [u, d] = Y(!1), f = !!r && !a, p = Po(e, f), m = p.length > 0, h = (l || u) && m, g = f && !h;
|
|
3362
3362
|
return /* @__PURE__ */ X(Do, {
|
|
3363
|
-
icon: g && m ? /* @__PURE__ */ X(
|
|
3363
|
+
icon: g && m ? /* @__PURE__ */ X(de, { variant: "thinking" }) : /* @__PURE__ */ X(U, { icon: Be }),
|
|
3364
3364
|
title: /* @__PURE__ */ X("span", {
|
|
3365
3365
|
className: i(g && "shine-text"),
|
|
3366
3366
|
children: /* @__PURE__ */ X(No, {
|
|
@@ -3388,7 +3388,7 @@ function Io({ turn: e }) {
|
|
|
3388
3388
|
return e.stopped ? /* @__PURE__ */ X("p", {
|
|
3389
3389
|
className: "text-base italic text-f1-foreground-secondary",
|
|
3390
3390
|
children: n.ai.responseStopped
|
|
3391
|
-
}) : e.endIndicator === "activity" ? /* @__PURE__ */ X(
|
|
3391
|
+
}) : e.endIndicator === "activity" ? /* @__PURE__ */ X(at, { status: "writing" }) : e.endIndicator === "asking" ? /* @__PURE__ */ X(at, {
|
|
3392
3392
|
title: n.ai.askingQuestions,
|
|
3393
3393
|
status: "asking"
|
|
3394
3394
|
}) : null;
|
|
@@ -3435,7 +3435,7 @@ function Bo({ children: e }) {
|
|
|
3435
3435
|
display: "flex",
|
|
3436
3436
|
height: "5",
|
|
3437
3437
|
alignItems: "center",
|
|
3438
|
-
children: /* @__PURE__ */ X(U, { icon:
|
|
3438
|
+
children: /* @__PURE__ */ X(U, { icon: me })
|
|
3439
3439
|
}), /* @__PURE__ */ Z("div", {
|
|
3440
3440
|
className: "min-w-0 whitespace-pre-wrap text-base leading-5 [overflow-wrap:anywhere] [&>div]:flex [&>div]:flex-col [&>div]:gap-1 [&_p]:m-0",
|
|
3441
3441
|
children: [/* @__PURE__ */ X("span", {
|
|
@@ -3497,7 +3497,7 @@ function Go({ message: e, onReplyQuote: n, onCopy: r, autoScrollIntoView: a = !0
|
|
|
3497
3497
|
let s = Uo(a), c = J(null), l = e?.content, u = e?.rawData, d = q(() => $i({
|
|
3498
3498
|
content: l,
|
|
3499
3499
|
rawData: u
|
|
3500
|
-
}), [l, u]), f = (ea(l, "user") ?? "").trim(), p = e?.presentation, m = p?.kind === "notice", h = p?.kind === "answers" && p.questions.length > 0 ? p.questions : null, g = h !== null || f.length > 0, _ = t(), v = h ? h.map(({ question: e, answers: t }) => `${e}\n${Lo(t, _.ai.clarifyingQuestion.skipped)}`).join("\n\n") :
|
|
3500
|
+
}), [l, u]), f = (ea(l, "user") ?? "").trim(), p = e?.presentation, m = p?.kind === "notice", h = p?.kind === "answers" && p.questions.length > 0 ? p.questions : null, g = h !== null || f.length > 0, _ = t(), v = h ? h.map(({ question: e, answers: t }) => `${e}\n${Lo(t, _.ai.clarifyingQuestion.skipped)}`).join("\n\n") : Vt(f), { anchor: y, clear: b } = mo({
|
|
3501
3501
|
containerRef: c,
|
|
3502
3502
|
enabled: g && !m
|
|
3503
3503
|
});
|
|
@@ -3535,7 +3535,7 @@ function Go({ message: e, onReplyQuote: n, onCopy: r, autoScrollIntoView: a = !0
|
|
|
3535
3535
|
children: h ? /* @__PURE__ */ X(zo, { questions: h }) : x(f)
|
|
3536
3536
|
}), /* @__PURE__ */ X("div", {
|
|
3537
3537
|
className: i("absolute bottom-0 right-full mr-1 flex", "opacity-0 transition-opacity duration-150 focus-within:opacity-100 group-hover/user-message:opacity-100 motion-reduce:transition-none [@media(hover:none)]:opacity-100"),
|
|
3538
|
-
children: /* @__PURE__ */ X(
|
|
3538
|
+
children: /* @__PURE__ */ X(We, {
|
|
3539
3539
|
size: "md",
|
|
3540
3540
|
variant: "ghost",
|
|
3541
3541
|
valueToCopy: v,
|
|
@@ -3625,7 +3625,7 @@ var qo = () => {
|
|
|
3625
3625
|
}));
|
|
3626
3626
|
};
|
|
3627
3627
|
function ts({ prompts: { suggestions: e, onItemClick: t }, round: n }) {
|
|
3628
|
-
let { preview: r, pick: i } =
|
|
3628
|
+
let { preview: r, pick: i } = ot({ onItemClick: t }), a = es(q(() => Xo(e, n), [e, n]));
|
|
3629
3629
|
return Jo(e, r), /* @__PURE__ */ X(W, {
|
|
3630
3630
|
display: "flex",
|
|
3631
3631
|
flexDirection: "column",
|
|
@@ -3701,20 +3701,20 @@ var is = {
|
|
|
3701
3701
|
onThumbsDown: () => {}
|
|
3702
3702
|
};
|
|
3703
3703
|
function as({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a, initialMessageCaption: o, initialMessageSubtitle: c, onWelcomeClick: l, welcomePrompts: u, renderToolCall: f, onReplyQuote: p, onAssistantMessageRendered: m, autoScrollUserIntoView: h = !0, renderMarkdown: g, feedback: _, freezeLayout: v = !1, noShadows: y = !1, fullscreen: b = !1, children: x, AssistantMessage: S, UserMessage: C, onRegenerate: w, onCopy: T }) {
|
|
3704
|
-
let { modal: E, handleSubmit: D, handleClose: ee } = Ui(_ ?? is), O = t(), k = S ?? xo,
|
|
3705
|
-
viewportRef:
|
|
3706
|
-
contentRef:
|
|
3707
|
-
lastTurnRef:
|
|
3704
|
+
let { modal: E, handleSubmit: D, handleClose: ee } = Ui(_ ?? is), O = t(), k = S ?? xo, A = C ?? Go, te = a ?? O.ai.defaultInitialMessage, j = !n && e.length === 0 && te !== "", M = J(null), N = J(null), P = J(null), ne = J(null), { showScrollBtn: re, scrolledFromTop: ie, turnMinHeight: F, scrollToBottom: ae } = Ea({
|
|
3705
|
+
viewportRef: M,
|
|
3706
|
+
contentRef: N,
|
|
3707
|
+
lastTurnRef: ne,
|
|
3708
3708
|
turnsCount: e.length,
|
|
3709
3709
|
isLoadingThread: n,
|
|
3710
3710
|
lastTurnInProgress: e[e.length - 1]?.isInProgress ?? !1,
|
|
3711
3711
|
freezeTurnMinHeight: v
|
|
3712
3712
|
});
|
|
3713
3713
|
ma({
|
|
3714
|
-
viewportRef:
|
|
3715
|
-
contentRef:
|
|
3714
|
+
viewportRef: M,
|
|
3715
|
+
contentRef: N
|
|
3716
3716
|
});
|
|
3717
|
-
let I = e[e.length - 1], oe = ha(!(!I || I.endIndicator !== "thinking" && !I.thinking?.inProgress), I?.thinking?.startedAt), se = I?.endIndicator === "asking",
|
|
3717
|
+
let I = e[e.length - 1], oe = ha(!(!I || I.endIndicator !== "thinking" && !I.thinking?.inProgress), I?.thinking?.startedAt), se = I?.endIndicator === "asking", ce = aa(e.flatMap((e) => e.assistantMessages.flatMap((e) => e.id ? [e.id] : [])), n), le = (t, n) => {
|
|
3718
3718
|
let r = n === e.length - 1, i = t.thinking && t.thinking.titles.length > 0 ? t.thinking : t.endIndicator === "thinking" ? {
|
|
3719
3719
|
titles: [],
|
|
3720
3720
|
inProgress: !0
|
|
@@ -3731,13 +3731,13 @@ function as({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3731
3731
|
index: r,
|
|
3732
3732
|
isCurrentMessage: !1,
|
|
3733
3733
|
AssistantMessage: k,
|
|
3734
|
-
UserMessage:
|
|
3734
|
+
UserMessage: A,
|
|
3735
3735
|
onRegenerate: w,
|
|
3736
3736
|
onCopy: T,
|
|
3737
3737
|
rawData: e.rawData || {},
|
|
3738
3738
|
...o
|
|
3739
3739
|
};
|
|
3740
|
-
return /* @__PURE__ */ X(
|
|
3740
|
+
return /* @__PURE__ */ X(A, { ...i }, `${n}-u-${r}`);
|
|
3741
3741
|
}, c = (e, i) => {
|
|
3742
3742
|
let a = r && i === t.assistantMessages.length - 1, s = t.userMessages.length + i, c = {
|
|
3743
3743
|
message: e,
|
|
@@ -3745,7 +3745,7 @@ function as({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3745
3745
|
index: s,
|
|
3746
3746
|
isCurrentMessage: a,
|
|
3747
3747
|
AssistantMessage: k,
|
|
3748
|
-
UserMessage:
|
|
3748
|
+
UserMessage: A,
|
|
3749
3749
|
onRegenerate: w,
|
|
3750
3750
|
onCopy: T,
|
|
3751
3751
|
rawData: e.rawData || {},
|
|
@@ -3754,12 +3754,12 @@ function as({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3754
3754
|
return /* @__PURE__ */ X(k, {
|
|
3755
3755
|
...c,
|
|
3756
3756
|
isGenerating: t.isInProgress && a,
|
|
3757
|
-
isLive: t.isInProgress ||
|
|
3757
|
+
isLive: t.isInProgress || ce(e.id),
|
|
3758
3758
|
isLoading: t.isInProgress && a && !os(e)
|
|
3759
3759
|
}, `${n}-a-${i}`);
|
|
3760
3760
|
};
|
|
3761
3761
|
return /* @__PURE__ */ Z("div", {
|
|
3762
|
-
ref: r ?
|
|
3762
|
+
ref: r ? ne : void 0,
|
|
3763
3763
|
className: "group/turn flex flex-col items-start justify-start gap-2 px-1",
|
|
3764
3764
|
[ua]: n,
|
|
3765
3765
|
style: { minHeight: r && F || void 0 },
|
|
@@ -3801,29 +3801,29 @@ function as({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3801
3801
|
children: se ? O.ai.askingQuestions : ""
|
|
3802
3802
|
}),
|
|
3803
3803
|
/* @__PURE__ */ X("div", {
|
|
3804
|
-
ref:
|
|
3805
|
-
className: i("flex-1 overflow-y-scroll [overflow-anchor:none]", "relative", !
|
|
3804
|
+
ref: M,
|
|
3805
|
+
className: i("flex-1 overflow-y-scroll [overflow-anchor:none]", "relative", !j && "[mask-image:linear-gradient(to_top,transparent_var(--f0-ai-composer-overlap,0px),rgb(0_0_0/0.16)_calc(var(--f0-ai-composer-overlap,0px)+0.75rem),rgb(0_0_0/0.5)_calc(var(--f0-ai-composer-overlap,0px)+1.5rem),rgb(0_0_0/0.84)_calc(var(--f0-ai-composer-overlap,0px)+2.25rem),#000_calc(var(--f0-ai-composer-overlap,0px)+3rem))]", "scrollbar-on-hover"),
|
|
3806
3806
|
children: /* @__PURE__ */ Z("div", {
|
|
3807
|
-
ref:
|
|
3808
|
-
className: i("flex min-h-full flex-col items-center px-4 pt-4",
|
|
3807
|
+
ref: N,
|
|
3808
|
+
className: i("flex min-h-full flex-col items-center px-4 pt-4", j ? b ? "pb-4" : "pb-[calc(1rem+var(--f0-ai-composer-rest,0px))]" : "pb-[calc(3rem+var(--f0-ai-composer-overlap,0px))]"),
|
|
3809
3809
|
children: [
|
|
3810
3810
|
/* @__PURE__ */ Z("div", {
|
|
3811
|
-
className: i(
|
|
3811
|
+
className: i(j ? "flex flex-1 px-1" : "flex flex-col gap-6", "w-full max-w-content"),
|
|
3812
3812
|
children: [
|
|
3813
3813
|
n ? /* @__PURE__ */ X(wo, {}) : null,
|
|
3814
|
-
|
|
3815
|
-
phrase:
|
|
3814
|
+
j ? /* @__PURE__ */ X(rs, {
|
|
3815
|
+
phrase: te,
|
|
3816
3816
|
caption: o,
|
|
3817
3817
|
subtitle: c,
|
|
3818
3818
|
prompts: u,
|
|
3819
3819
|
onClick: l
|
|
3820
3820
|
}) : null,
|
|
3821
|
-
n ? null : e.map((e, t) =>
|
|
3821
|
+
n ? null : e.map((e, t) => le(e, t)),
|
|
3822
3822
|
r
|
|
3823
3823
|
]
|
|
3824
3824
|
}),
|
|
3825
3825
|
/* @__PURE__ */ X("div", {
|
|
3826
|
-
ref:
|
|
3826
|
+
ref: P,
|
|
3827
3827
|
className: "h-px shrink-0",
|
|
3828
3828
|
"aria-hidden": !0
|
|
3829
3829
|
}),
|
|
@@ -3849,7 +3849,7 @@ function as({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3849
3849
|
scale: .8
|
|
3850
3850
|
},
|
|
3851
3851
|
transition: { duration: .2 },
|
|
3852
|
-
children: /* @__PURE__ */ X(
|
|
3852
|
+
children: /* @__PURE__ */ X(st, {
|
|
3853
3853
|
label: O.ai.scrollToBottom,
|
|
3854
3854
|
onClick: () => ae()
|
|
3855
3855
|
})
|
|
@@ -3867,7 +3867,7 @@ var os = (e) => !!ea(e.content) || $i(e).length > 0;
|
|
|
3867
3867
|
//#endregion
|
|
3868
3868
|
//#region src/addons/ai/F0AiMessagesContainer/F0AiMessagesContainer.tsx
|
|
3869
3869
|
function ss(e) {
|
|
3870
|
-
let t =
|
|
3870
|
+
let t = oe(), n = /* @__PURE__ */ X(Vi, { children: /* @__PURE__ */ X(as, { ...e }) });
|
|
3871
3871
|
return e.filePreviews || !t.provided ? /* @__PURE__ */ X(Tt, {
|
|
3872
3872
|
filePreviews: e.filePreviews,
|
|
3873
3873
|
children: n
|
|
@@ -3890,7 +3890,7 @@ function ds() {
|
|
|
3890
3890
|
//#endregion
|
|
3891
3891
|
//#region src/addons/ai/F0AiChat/providers/useCanvasEntities.ts
|
|
3892
3892
|
function fs() {
|
|
3893
|
-
let { canvasEntities: e } =
|
|
3893
|
+
let { canvasEntities: e } = L();
|
|
3894
3894
|
return e;
|
|
3895
3895
|
}
|
|
3896
3896
|
//#endregion
|
|
@@ -4138,7 +4138,7 @@ var ys = [
|
|
|
4138
4138
|
onClick: c,
|
|
4139
4139
|
label: l.actions.cancel,
|
|
4140
4140
|
hideLabel: !0,
|
|
4141
|
-
icon:
|
|
4141
|
+
icon: P
|
|
4142
4142
|
})
|
|
4143
4143
|
]
|
|
4144
4144
|
});
|
|
@@ -4146,23 +4146,23 @@ var ys = [
|
|
|
4146
4146
|
clarifyingQuestion: e,
|
|
4147
4147
|
isSubmitDisabled: t
|
|
4148
4148
|
}), As = ({ clarifyingQuestion: e, isSubmitDisabled: n }) => {
|
|
4149
|
-
let r = t(), i = p(), { currentStep: a, currentStepIndex: o, totalSteps: c, toggleOption: l, confirm: u, skip: f, 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 = J(null), ee = S ?? "single", O = c > 1, k = o === 0,
|
|
4149
|
+
let r = t(), i = p(), { currentStep: a, currentStepIndex: o, totalSteps: c, toggleOption: l, confirm: u, skip: f, 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 = J(null), ee = S ?? "single", O = c > 1, k = o === 0, A = o === c - 1, te = O ? r.t("ai.clarifyingQuestion.stepOf", {
|
|
4150
4150
|
current: String(o + 1),
|
|
4151
4151
|
total: String(c)
|
|
4152
|
-
}) : void 0,
|
|
4153
|
-
|
|
4152
|
+
}) : void 0, j = x.length > 0, M = (T ?? "").trim().length > 0, N = j || E && M || C === !0, P = n === !0 && A, ne = () => {
|
|
4153
|
+
P || u();
|
|
4154
4154
|
}, re = () => {
|
|
4155
|
-
|
|
4155
|
+
P || f();
|
|
4156
4156
|
}, ie = (e) => {
|
|
4157
4157
|
let t = ee === "single" && x.includes(e);
|
|
4158
|
-
l(e), ee === "single" && !
|
|
4159
|
-
}, F =
|
|
4158
|
+
l(e), ee === "single" && !A && !t && Promise.resolve().then(u);
|
|
4159
|
+
}, F = A ? r.ai.clarifyingQuestion.submit : r.ai.clarifyingQuestion.next, ae = C === !0 && !j && !(E && M), I = () => {
|
|
4160
4160
|
v(), requestAnimationFrame(() => {
|
|
4161
4161
|
D.current?.focus();
|
|
4162
4162
|
});
|
|
4163
4163
|
}, oe = (e) => {
|
|
4164
4164
|
e.key === "Escape" && (e.preventDefault(), m());
|
|
4165
|
-
}, se = i ? 0 : Ds,
|
|
4165
|
+
}, se = i ? 0 : Ds, ce = i ? 0 : Os;
|
|
4166
4166
|
return /* @__PURE__ */ Z("div", {
|
|
4167
4167
|
className: "flex flex-col",
|
|
4168
4168
|
onKeyDown: oe,
|
|
@@ -4184,16 +4184,16 @@ var ys = [
|
|
|
4184
4184
|
exit: {
|
|
4185
4185
|
opacity: 0,
|
|
4186
4186
|
transition: {
|
|
4187
|
-
duration:
|
|
4187
|
+
duration: ce,
|
|
4188
4188
|
ease: Es
|
|
4189
4189
|
}
|
|
4190
4190
|
},
|
|
4191
4191
|
children: [/* @__PURE__ */ X(Ts, {
|
|
4192
4192
|
question: y,
|
|
4193
|
-
stepLabel:
|
|
4193
|
+
stepLabel: te,
|
|
4194
4194
|
isFirstStep: k,
|
|
4195
|
-
isFinalStep:
|
|
4196
|
-
canProceed:
|
|
4195
|
+
isFinalStep: A,
|
|
4196
|
+
canProceed: N,
|
|
4197
4197
|
onBack: h,
|
|
4198
4198
|
onNext: u,
|
|
4199
4199
|
onCancel: m
|
|
@@ -4203,25 +4203,25 @@ var ys = [
|
|
|
4203
4203
|
options: b,
|
|
4204
4204
|
selectedOptionIds: x,
|
|
4205
4205
|
allowCustomAnswer: w,
|
|
4206
|
-
hasSelection:
|
|
4207
|
-
hasCustomText:
|
|
4206
|
+
hasSelection: j,
|
|
4207
|
+
hasCustomText: M,
|
|
4208
4208
|
customAnswerText: T,
|
|
4209
4209
|
isCustomAnswerActive: E,
|
|
4210
|
-
canProceed:
|
|
4210
|
+
canProceed: N,
|
|
4211
4211
|
customInputRef: D,
|
|
4212
4212
|
onToggleOption: ie,
|
|
4213
4213
|
onActivateCustom: I,
|
|
4214
4214
|
onChangeCustomText: g,
|
|
4215
4215
|
onToggleCustomActive: _,
|
|
4216
|
-
onConfirm:
|
|
4216
|
+
onConfirm: ne
|
|
4217
4217
|
})]
|
|
4218
4218
|
}, o)
|
|
4219
4219
|
})
|
|
4220
4220
|
}), /* @__PURE__ */ X(ms, {
|
|
4221
|
-
canProceed:
|
|
4222
|
-
submitDisabled:
|
|
4221
|
+
canProceed: N,
|
|
4222
|
+
submitDisabled: P,
|
|
4223
4223
|
label: F,
|
|
4224
|
-
onConfirm:
|
|
4224
|
+
onConfirm: ne,
|
|
4225
4225
|
onSkip: re,
|
|
4226
4226
|
showSkip: ae
|
|
4227
4227
|
})]
|
|
@@ -4549,13 +4549,13 @@ var Rs = class {
|
|
|
4549
4549
|
repeatType: "mirror"
|
|
4550
4550
|
};
|
|
4551
4551
|
function Gs(e) {
|
|
4552
|
-
let [t, n] = Y(e), r =
|
|
4552
|
+
let [t, n] = Y(e), r = Rt(e), i = J(null);
|
|
4553
4553
|
return Yn(r, "change", (e) => n(e)), {
|
|
4554
4554
|
value: t,
|
|
4555
4555
|
motionValue: r,
|
|
4556
4556
|
controls: i,
|
|
4557
4557
|
animate: G((e, t) => {
|
|
4558
|
-
i.current =
|
|
4558
|
+
i.current = E(r, e, t);
|
|
4559
4559
|
}, [r])
|
|
4560
4560
|
};
|
|
4561
4561
|
}
|
|
@@ -4843,19 +4843,19 @@ function Sc({ fs: e, vs: t = Xs, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4843
4843
|
-1,
|
|
4844
4844
|
0
|
|
4845
4845
|
]), e.STATIC_DRAW);
|
|
4846
|
-
},
|
|
4846
|
+
}, A = ({ alpha: e, beta: t, gamma: n }) => {
|
|
4847
4847
|
E.current.iDeviceOrientation.value = [
|
|
4848
4848
|
e ?? 0,
|
|
4849
4849
|
t ?? 0,
|
|
4850
4850
|
n ?? 0,
|
|
4851
4851
|
window.orientation ?? 0
|
|
4852
4852
|
];
|
|
4853
|
-
},
|
|
4853
|
+
}, te = (e) => {
|
|
4854
4854
|
let [t = 0, n = 0] = yc(e), r = t - (b.current?.left ?? 0) - window.pageXOffset, i = (b.current?.height ?? 0) - n - (b.current?.top ?? 0) - window.pageYOffset;
|
|
4855
4855
|
y.current = !0;
|
|
4856
4856
|
let a = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
|
|
4857
4857
|
a && (a[2] = r, a[3] = i), S.current[0] = r, S.current[1] = i;
|
|
4858
|
-
},
|
|
4858
|
+
}, j = (e) => {
|
|
4859
4859
|
b.current = p.current?.getBoundingClientRect();
|
|
4860
4860
|
let [t = 0, n = 0] = yc(e), r = t - (b.current?.left ?? 0), i = (b.current?.height ?? 0) - n - (b.current?.top ?? 0);
|
|
4861
4861
|
if (c !== 1) S.current[0] = r, S.current[1] = i;
|
|
@@ -4863,10 +4863,10 @@ function Sc({ fs: e, vs: t = Xs, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4863
4863
|
let e = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
|
|
4864
4864
|
e && (e[0] = r, e[1] = i);
|
|
4865
4865
|
}
|
|
4866
|
-
},
|
|
4866
|
+
}, M = () => {
|
|
4867
4867
|
let e = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
|
|
4868
4868
|
e && (e[2] = 0, e[3] = 0);
|
|
4869
|
-
},
|
|
4869
|
+
}, N = () => {
|
|
4870
4870
|
let e = m.current;
|
|
4871
4871
|
if (!e) return;
|
|
4872
4872
|
b.current = p.current?.getBoundingClientRect();
|
|
@@ -4875,7 +4875,7 @@ function Sc({ fs: e, vs: t = Xs, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4875
4875
|
let t = e.getUniformLocation(g.current, nc);
|
|
4876
4876
|
e.uniform2fv(t, [e.canvas.width, e.canvas.height]);
|
|
4877
4877
|
}
|
|
4878
|
-
},
|
|
4878
|
+
}, P = (e, t) => {
|
|
4879
4879
|
let n = m.current;
|
|
4880
4880
|
if (!n) return null;
|
|
4881
4881
|
let r = n.createShader(e);
|
|
@@ -4886,10 +4886,10 @@ function Sc({ fs: e, vs: t = Xs, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4886
4886
|
n.deleteShader(r), d?.(vc(`Shader compiler log: ${e}`));
|
|
4887
4887
|
}
|
|
4888
4888
|
return r;
|
|
4889
|
-
},
|
|
4889
|
+
}, ne = (e, t) => {
|
|
4890
4890
|
let n = m.current;
|
|
4891
4891
|
if (!n) return;
|
|
4892
|
-
let r =
|
|
4892
|
+
let r = P(n.FRAGMENT_SHADER, e), i = P(n.VERTEX_SHADER, t);
|
|
4893
4893
|
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?.(vc(`Unable to initialize the shader program: ${n.getProgramInfoLog(g.current)}`)));
|
|
4894
4894
|
}, re = () => {
|
|
4895
4895
|
if (r) for (let e of Object.keys(r)) {
|
|
@@ -5007,10 +5007,10 @@ function Sc({ fs: e, vs: t = Xs, textures: n = [], uniforms: r, clearColor: i =
|
|
|
5007
5007
|
v.current = requestAnimationFrame(I);
|
|
5008
5008
|
}, oe = () => {
|
|
5009
5009
|
let e = { passive: !0 };
|
|
5010
|
-
E.current.iMouse?.isNeeded && p.current && (p.current.addEventListener("mousemove",
|
|
5010
|
+
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", te, e), p.current.addEventListener("touchmove", j, e), p.current.addEventListener("touchend", M, e), p.current.addEventListener("touchstart", te, e)), E.current.iDeviceOrientation?.isNeeded && window.addEventListener("deviceorientation", A, e), p.current && (T.current = new ResizeObserver(N), T.current.observe(p.current), window.addEventListener("resize", N, e));
|
|
5011
5011
|
}, se = () => {
|
|
5012
5012
|
let e = { passive: !0 };
|
|
5013
|
-
E.current.iMouse?.isNeeded && p.current && (p.current.removeEventListener("mousemove",
|
|
5013
|
+
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", te, e), p.current.removeEventListener("touchmove", j, e), p.current.removeEventListener("touchend", M, e), p.current.removeEventListener("touchstart", te, e)), E.current.iDeviceOrientation?.isNeeded && window.removeEventListener("deviceorientation", A, e), T.current && (T.current.disconnect(), window.removeEventListener("resize", N, e));
|
|
5014
5014
|
};
|
|
5015
5015
|
return K(() => {
|
|
5016
5016
|
D.current = r;
|
|
@@ -5019,7 +5019,7 @@ function Sc({ fs: e, vs: t = Xs, textures: n = [], uniforms: r, clearColor: i =
|
|
|
5019
5019
|
function r() {
|
|
5020
5020
|
O();
|
|
5021
5021
|
let n = m.current;
|
|
5022
|
-
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, re(), ie(),
|
|
5022
|
+
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, re(), ie(), ne(F(e || Ys), t || Xs), k(), requestAnimationFrame(I), oe(), N());
|
|
5023
5023
|
}
|
|
5024
5024
|
return requestAnimationFrame(r), () => {
|
|
5025
5025
|
let e = m.current;
|
|
@@ -5166,7 +5166,7 @@ function Dc({ size: e = "lg", state: t, color: n, colorShift: r = .05, audioTrac
|
|
|
5166
5166
|
}
|
|
5167
5167
|
//#endregion
|
|
5168
5168
|
//#region src/blocks/ai/F0HILActionConfirmation/F0HILActionConfirmation.tsx
|
|
5169
|
-
var Oc = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm: i, cancelText: a, onCancel: o, stackAt: s = "sm" }) => /* @__PURE__ */ X(
|
|
5169
|
+
var Oc = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm: i, cancelText: a, onCancel: o, stackAt: s = "sm" }) => /* @__PURE__ */ X(B, {
|
|
5170
5170
|
title: e,
|
|
5171
5171
|
description: t,
|
|
5172
5172
|
avatar: n,
|
|
@@ -5339,10 +5339,10 @@ var Vc = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
5339
5339
|
className: "relative w-full flex-1",
|
|
5340
5340
|
role: "img",
|
|
5341
5341
|
"aria-label": `Sparkline chart showing ${i} trend`,
|
|
5342
|
-
children: [/* @__PURE__ */ X(
|
|
5342
|
+
children: [/* @__PURE__ */ X(ae, {
|
|
5343
5343
|
width: "100%",
|
|
5344
5344
|
height: "100%",
|
|
5345
|
-
children: /* @__PURE__ */ Z(
|
|
5345
|
+
children: /* @__PURE__ */ Z(Pe, {
|
|
5346
5346
|
data: e,
|
|
5347
5347
|
margin: {
|
|
5348
5348
|
top: 4,
|
|
@@ -5371,7 +5371,7 @@ var Vc = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
5371
5371
|
hide: !0,
|
|
5372
5372
|
domain: ["dataMin - 1", "dataMax + 1"]
|
|
5373
5373
|
}),
|
|
5374
|
-
/* @__PURE__ */ X(
|
|
5374
|
+
/* @__PURE__ */ X(lt, {
|
|
5375
5375
|
type: "linear",
|
|
5376
5376
|
dataKey: "value",
|
|
5377
5377
|
stroke: a.stroke,
|
|
@@ -5458,7 +5458,7 @@ var Vc = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
5458
5458
|
});
|
|
5459
5459
|
});
|
|
5460
5460
|
Wc.displayName = "F0AiInsightCard";
|
|
5461
|
-
var Gc = e(
|
|
5461
|
+
var Gc = e(re(Wc, () => /* @__PURE__ */ Z("div", {
|
|
5462
5462
|
className: "flex w-[217px] h-[200px] flex-col gap-2 rounded-2xl border border-solid border-f1-border-secondary bg-f1-background p-4",
|
|
5463
5463
|
"aria-busy": "true",
|
|
5464
5464
|
"aria-live": "polite",
|
|
@@ -5543,11 +5543,11 @@ Qc.displayName = "F0AiProposalCard";
|
|
|
5543
5543
|
//#region src/blocks/ai/F0AiMessageSources/components/CollapsibleMessage.tsx
|
|
5544
5544
|
var $c = ({ icon: e, title: t, children: n }) => {
|
|
5545
5545
|
let [r, i] = Y(!1), a = p();
|
|
5546
|
-
return /* @__PURE__ */ Z(
|
|
5546
|
+
return /* @__PURE__ */ Z(Se, {
|
|
5547
5547
|
className: "mb-1 w-full",
|
|
5548
5548
|
open: r,
|
|
5549
5549
|
onOpenChange: i,
|
|
5550
|
-
children: [/* @__PURE__ */ Z(
|
|
5550
|
+
children: [/* @__PURE__ */ Z(ne, {
|
|
5551
5551
|
className: "flex w-full items-center text-base text-f1-foreground-secondary transition-colors duration-150 hover:text-f1-foreground [&[data-state=open]>svg]:rotate-90",
|
|
5552
5552
|
children: [
|
|
5553
5553
|
/* @__PURE__ */ X("span", {
|
|
@@ -5566,7 +5566,7 @@ var $c = ({ icon: e, title: t, children: n }) => {
|
|
|
5566
5566
|
className: "h-4 w-4 transition-transform duration-200"
|
|
5567
5567
|
})
|
|
5568
5568
|
]
|
|
5569
|
-
}), /* @__PURE__ */ X(
|
|
5569
|
+
}), /* @__PURE__ */ X(Ee, {
|
|
5570
5570
|
forceMount: !0,
|
|
5571
5571
|
className: "data-[state=open]:mt-3",
|
|
5572
5572
|
children: /* @__PURE__ */ X(s.div, {
|
|
@@ -5634,11 +5634,11 @@ nl.displayName = "F0AiMessageSources";
|
|
|
5634
5634
|
//#endregion
|
|
5635
5635
|
//#region src/addons/ai/F0AiTableCard/F0AiTableCard.tsx
|
|
5636
5636
|
async function rl(e, t, n) {
|
|
5637
|
-
let r =
|
|
5637
|
+
let r = ge(e), i = t === "xlsx" ? await j([{
|
|
5638
5638
|
name: "Data",
|
|
5639
5639
|
rows: r
|
|
5640
|
-
}]) : await
|
|
5641
|
-
|
|
5640
|
+
}]) : await it(r);
|
|
5641
|
+
le(i, `${n}.${t}`);
|
|
5642
5642
|
}
|
|
5643
5643
|
function il({ dataset: e, title: n, filename: r }) {
|
|
5644
5644
|
let a = t(), o = J(null), s = n ?? a.ai.aiTable.title, c = G((e) => {
|
|
@@ -5667,16 +5667,16 @@ function il({ dataset: e, title: n, filename: r }) {
|
|
|
5667
5667
|
tag: "h2",
|
|
5668
5668
|
className: "text-base font-medium capitalize text-f1-foreground",
|
|
5669
5669
|
children: s
|
|
5670
|
-
}), /* @__PURE__ */ X(
|
|
5671
|
-
icon:
|
|
5670
|
+
}), /* @__PURE__ */ X(pe, {
|
|
5671
|
+
icon: w,
|
|
5672
5672
|
size: "md",
|
|
5673
5673
|
items: [{
|
|
5674
5674
|
label: a.ai.aiTable.downloadExcel,
|
|
5675
|
-
icon:
|
|
5675
|
+
icon: w,
|
|
5676
5676
|
onClick: () => c("xlsx")
|
|
5677
5677
|
}, {
|
|
5678
5678
|
label: a.ai.aiTable.downloadCsv,
|
|
5679
|
-
icon:
|
|
5679
|
+
icon: w,
|
|
5680
5680
|
onClick: () => c("csv")
|
|
5681
5681
|
}]
|
|
5682
5682
|
})]
|
|
@@ -5754,7 +5754,7 @@ function cl({ label: e, onClick: t }) {
|
|
|
5754
5754
|
variant: "ghost",
|
|
5755
5755
|
hideLabel: !0,
|
|
5756
5756
|
label: e,
|
|
5757
|
-
icon:
|
|
5757
|
+
icon: I,
|
|
5758
5758
|
onClick: t
|
|
5759
5759
|
})
|
|
5760
5760
|
}) : null
|
|
@@ -5780,7 +5780,7 @@ function dl(e) {
|
|
|
5780
5780
|
e.detail !== 0 && (e.preventDefault(), e.stopPropagation());
|
|
5781
5781
|
}
|
|
5782
5782
|
var fl = ({ currentThreadTitle: e, fullscreen: n = !1, onToggleVisualizationMode: r, onClose: a, onNewChat: o, history: c, historyOpen: l, onHistoryOpenChange: u }) => {
|
|
5783
|
-
let d = t(), f = p(), h = e?.trim() ?? "", { panelOverlays: g } =
|
|
5783
|
+
let d = t(), f = p(), h = e?.trim() ?? "", { panelOverlays: g } = L(), [_, v] = Y(null), b = ul();
|
|
5784
5784
|
return /* @__PURE__ */ Z(Mn, {
|
|
5785
5785
|
open: l,
|
|
5786
5786
|
onOpenChange: u,
|
|
@@ -5788,7 +5788,7 @@ var fl = ({ currentThreadTitle: e, fullscreen: n = !1, onToggleVisualizationMode
|
|
|
5788
5788
|
asChild: !0,
|
|
5789
5789
|
children: /* @__PURE__ */ Z("header", {
|
|
5790
5790
|
ref: v,
|
|
5791
|
-
onClickCapture:
|
|
5791
|
+
onClickCapture: b ? dl : void 0,
|
|
5792
5792
|
className: "relative flex w-full items-center justify-between gap-1 overflow-hidden py-3 pl-2.5 pr-3",
|
|
5793
5793
|
children: [
|
|
5794
5794
|
c ? /* @__PURE__ */ X(kn, {
|
|
@@ -5821,14 +5821,14 @@ var fl = ({ currentThreadTitle: e, fullscreen: n = !1, onToggleVisualizationMode
|
|
|
5821
5821
|
variant: "ghost",
|
|
5822
5822
|
hideLabel: !0,
|
|
5823
5823
|
label: n ? d.ai.collapseChat : d.ai.expandChat,
|
|
5824
|
-
icon: n ?
|
|
5824
|
+
icon: n ? y : _t,
|
|
5825
5825
|
onClick: r
|
|
5826
5826
|
}),
|
|
5827
5827
|
/* @__PURE__ */ X(m, {
|
|
5828
5828
|
variant: "ghost",
|
|
5829
5829
|
hideLabel: !0,
|
|
5830
5830
|
label: d.ai.closeChat,
|
|
5831
|
-
icon:
|
|
5831
|
+
icon: P,
|
|
5832
5832
|
onClick: a
|
|
5833
5833
|
})
|
|
5834
5834
|
]
|
|
@@ -5852,18 +5852,18 @@ var fl = ({ currentThreadTitle: e, fullscreen: n = !1, onToggleVisualizationMode
|
|
|
5852
5852
|
//#region src/addons/ai/F0AiChatHistory/utils.ts
|
|
5853
5853
|
function pl(e) {
|
|
5854
5854
|
let t = new Date(e), n = /* @__PURE__ */ new Date();
|
|
5855
|
-
return D(t) ? "today" :
|
|
5855
|
+
return D(t) ? "today" : z(t) ? "yesterday" : gn(t, n) ? "thisMonth" : "older";
|
|
5856
5856
|
}
|
|
5857
5857
|
function ml(e, t, n) {
|
|
5858
5858
|
let r = new Date(e), i = xn(r, "p", { locale: n });
|
|
5859
5859
|
if (D(r)) return `${t.today}, ${i}`;
|
|
5860
|
-
if (
|
|
5860
|
+
if (z(r)) return `${t.yesterday}, ${i}`;
|
|
5861
5861
|
let a = !bn(r, /* @__PURE__ */ new Date());
|
|
5862
5862
|
return `${xn(r, a ? "MMM d yyyy" : "MMM d", { locale: n })}, ${i}`;
|
|
5863
5863
|
}
|
|
5864
5864
|
function hl(e, t) {
|
|
5865
5865
|
let n = new Date(e);
|
|
5866
|
-
return
|
|
5866
|
+
return z(n) ? xn(n, "p", { locale: t }) : Bt(n, {
|
|
5867
5867
|
addSuffix: !0,
|
|
5868
5868
|
locale: t
|
|
5869
5869
|
});
|
|
@@ -5892,13 +5892,13 @@ function _l({ thread: e, isPinned: n, isActive: r = !1, isPending: a = !1, onSel
|
|
|
5892
5892
|
let g = t(), _ = yn(), v = q(() => [
|
|
5893
5893
|
{
|
|
5894
5894
|
label: n ? g.ai.unpinChat : g.ai.pinChat,
|
|
5895
|
-
icon: n ?
|
|
5895
|
+
icon: n ? ue : fe,
|
|
5896
5896
|
onClick: () => n ? l(e.id) : c(e.id)
|
|
5897
5897
|
},
|
|
5898
5898
|
...d?.(e) ?? [],
|
|
5899
5899
|
{
|
|
5900
5900
|
label: g.ai.deleteChat,
|
|
5901
|
-
icon:
|
|
5901
|
+
icon: Te,
|
|
5902
5902
|
critical: !0,
|
|
5903
5903
|
onClick: () => u(e.id)
|
|
5904
5904
|
}
|
|
@@ -5969,7 +5969,7 @@ function _l({ thread: e, isPinned: n, isActive: r = !1, isPending: a = !1, onSel
|
|
|
5969
5969
|
children: /* @__PURE__ */ X(pn, { size: "small" })
|
|
5970
5970
|
}) : /* @__PURE__ */ X("div", {
|
|
5971
5971
|
className: i("hidden shrink-0 items-center", "group-hover:flex group-focus-within:flex", "has-[[aria-expanded=true]]:flex", "[@media(hover:none)]:flex [@media(pointer:coarse)]:flex"),
|
|
5972
|
-
children: /* @__PURE__ */ X(
|
|
5972
|
+
children: /* @__PURE__ */ X(pe, {
|
|
5973
5973
|
items: v,
|
|
5974
5974
|
children: /* @__PURE__ */ X(m, {
|
|
5975
5975
|
icon: En,
|
|
@@ -6120,7 +6120,7 @@ function wl({ value: e, onChange: n }) {
|
|
|
6120
6120
|
size: "sm",
|
|
6121
6121
|
hideLabel: !0,
|
|
6122
6122
|
label: r.actions.clear,
|
|
6123
|
-
icon:
|
|
6123
|
+
icon: P,
|
|
6124
6124
|
onClick: () => n("")
|
|
6125
6125
|
}) : null
|
|
6126
6126
|
]
|
|
@@ -6179,7 +6179,7 @@ function El({ onClose: e, onSelectThread: n, onNewChat: r, actions: a, threads:
|
|
|
6179
6179
|
className: "flex flex-col gap-2",
|
|
6180
6180
|
children: [
|
|
6181
6181
|
r ? /* @__PURE__ */ X(Cl, {
|
|
6182
|
-
icon:
|
|
6182
|
+
icon: I,
|
|
6183
6183
|
label: h.ai.startNewChat,
|
|
6184
6184
|
onClick: () => {
|
|
6185
6185
|
r(), e();
|
|
@@ -6271,11 +6271,11 @@ function kl() {
|
|
|
6271
6271
|
//#region src/addons/ai/F0AiChatHistory/useChatHistory.ts
|
|
6272
6272
|
var Al = "f0-ai-pinned-threads";
|
|
6273
6273
|
function jl() {
|
|
6274
|
-
let e =
|
|
6274
|
+
let e = Ce(Al, []);
|
|
6275
6275
|
return new Set(Array.isArray(e) ? e : []);
|
|
6276
6276
|
}
|
|
6277
6277
|
function Ml(e) {
|
|
6278
|
-
|
|
6278
|
+
De(Al, [...e]);
|
|
6279
6279
|
}
|
|
6280
6280
|
function Nl({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, unpinThread: i }) {
|
|
6281
6281
|
let [a, o] = Y([]), [s, c] = Y(!1), [l, u] = Y(null), [d, f] = Y(jl), [p, m] = Y(() => /* @__PURE__ */ new Set()), h = G(async () => {
|
|
@@ -6345,7 +6345,7 @@ function Nl({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, u
|
|
|
6345
6345
|
}
|
|
6346
6346
|
//#endregion
|
|
6347
6347
|
//#region src/addons/ai/F0AiChatUsageLimits/types.ts
|
|
6348
|
-
var Pl = ["top", "bottom"], Fl = s.create(
|
|
6348
|
+
var Pl = ["top", "bottom"], Fl = s.create(A), Il = ({ label: e, reduceMotion: t }) => /* @__PURE__ */ Z("div", {
|
|
6349
6349
|
role: "status",
|
|
6350
6350
|
"aria-live": "polite",
|
|
6351
6351
|
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",
|