@factorialco/f0-react 14.27.0 → 14.28.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/{ChatPostComposerDialog-DyET3Jkp.js → ChatPostComposerDialog-CBopYp7G.js} +1 -1
- package/dist/{CoachmarkProvider-DTgJHXrh.js → CoachmarkProvider-D3kuCz0z.js} +10749 -10754
- package/dist/{F0AiProcessingOverlay-3dgwZFNY.js → F0AiProcessingOverlay-ChHdHClR.js} +339 -330
- package/dist/{F0Map-DHBbY85H.js → F0Map-DMwl26B1.js} +2 -2
- package/dist/{Map-R-8eJOiD.js → Map-CN0m8z-_.js} +2 -2
- package/dist/ai.d.ts +2 -2
- package/dist/ai.js +1 -1
- package/dist/component-status.js +16 -16
- package/dist/experimental.js +4 -4
- package/dist/{exports-BLOAk-CE.d.ts → exports-8kOdrt5o.d.ts} +15 -6
- package/dist/f0.d.ts +2 -2
- package/dist/f0.js +2 -2
- package/dist/{maplibre-BsKmLbcI.js → maplibre-CSERfVkQ.js} +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { a as e, r as t } from "./i18n-provider-Dh10DM8E.js";
|
|
|
2
2
|
import { n, t as r } from "./skeleton-DNdyWB9k.js";
|
|
3
3
|
import { L as i, R as a } from "./tooltip-DFMOxXQO.js";
|
|
4
4
|
import { K as o, T as s, U as c, h as l, n as u, r as d, t as f, y as p } from "./F0Button-CGbIBIjd.js";
|
|
5
|
-
import { $ as m, A as h, Ai as g, At as _, B as v, C as y, Ct as b, Di as x, Ft as S, G as C, Gt as w, H as T, Hi as E, Hr as D, Io as ee, Is as te, It as O, J as ne, Jc as k, Jo as A, K as j, Ki as M, Ks as
|
|
5
|
+
import { $ as m, A as h, Ai as g, At as _, B as v, C as y, Ct as b, Di as x, Ft as S, G as C, Gt as w, H as T, Hi as E, Hr as D, Io as ee, Is as te, It as O, J as ne, Jc as k, Jo as A, K as j, Ki as M, Ks as N, Kt as P, M as F, Mo as re, Mr as ie, Ms as ae, Mt as oe, Nt as I, O as L, Oi as se, Ps as R, Qr as z, Rr as ce, Rt as le, S as ue, Sn as de, Ss as fe, Tc as pe, U as me, Uo as he, Ut as ge, Vs as B, Vt as _e, W as ve, Wi as ye, X as be, Xo as xe, Xt as Se, Y as Ce, Yo as we, Zr as Te, Zt as V, _n as Ee, _t as De, a as Oe, an as ke, ao as Ae, as as H, at as je, b as Me, bc as U, bi as Ne, bt as Pe, ct as Fe, ds as Ie, dt as Le, en as Re, et as ze, fn as Be, ft as Ve, g as He, h as Ue, il as We, in as Ge, is as Ke, it as W, j as qe, ja as Je, k as Ye, ki as Xe, ks as Ze, kt as Qe, ln as $e, ls as et, lt as tt, m as nt, ms as rt, nt as it, on as at, oo as ot, ot as st, pn as ct, ps as lt, pt as ut, q as dt, qo as ft, qt as pt, r as mt, rl as ht, rn as gt, st as _t, tn as vt, un as yt, uo as bt, ut as xt, vt as St, wc as Ct, x as wt, xo as Tt, y as Et, yn as Dt, yt as Ot } from "./F0CanvasPanel-DGb3UCXE.js";
|
|
6
6
|
import { o as kt, t as G } from "./F0Icon-BlWwWAoj.js";
|
|
7
7
|
import { t as At } from "./i18n-provider-defaults-DGZELJZW.js";
|
|
8
8
|
import { F as jt, H as Mt, M as Nt, O as Pt, S as Ft, V as It, g as Lt, h as Rt, l as zt, m as Bt, y as Vt } from "./useData-CIObT3HY.js";
|
|
@@ -37,25 +37,25 @@ var Dn = [
|
|
|
37
37
|
"sm",
|
|
38
38
|
"md",
|
|
39
39
|
"lg"
|
|
40
|
-
], kn = "relative flex flex-col rounded-lg border border-solid border-f1-border-secondary bg-f1-background/95 shadow-md transition-colors", An = [], jn = () => null, Mn = ({ onSend: e, inProgress: t = !1, onStop: n, sendKind: r = "send", hasAttachments: a = !1, sendBlocked: s = !1, maxLength: l, maxLengthError: d, error: f = null, labels: p, placeholders: m, placeholdersPaused: h, role: g = "combobox", name: _, mentions: v, autocomplete: y, voice: b, onTextChange: x, onCleared: S, onEscape: C, onArrowUpWhenEmpty: w, onPasteFiles: T, pastePreferText: E = !1, onStateChange: D, header: ee, tray: O, leading: ne, toolbarStart: k, toolbarCenter: A, collapsible: j = !1, collapsed: M = !1, replacement:
|
|
41
|
-
let
|
|
42
|
-
let t =
|
|
43
|
-
|
|
44
|
-
}, []),
|
|
45
|
-
"permission-denied":
|
|
46
|
-
"device-error":
|
|
47
|
-
"transcription-failed":
|
|
48
|
-
},
|
|
40
|
+
], kn = "relative flex flex-col rounded-lg border border-solid border-f1-border-secondary bg-f1-background/95 shadow-md transition-colors", An = [], jn = () => null, Mn = ({ onSend: e, inProgress: t = !1, onStop: n, sendKind: r = "send", hasAttachments: a = !1, sendBlocked: s = !1, maxLength: l, maxLengthError: d, error: f = null, labels: p, placeholders: m, placeholdersPaused: h, role: g = "combobox", name: _, mentions: v, autocomplete: y, voice: b, onTextChange: x, onCleared: S, onEscape: C, onArrowUpWhenEmpty: w, onPasteFiles: T, pastePreferText: E = !1, onStateChange: D, header: ee, tray: O, leading: ne, toolbarStart: k, toolbarCenter: A, collapsible: j = !1, collapsed: M = !1, replacement: N, accent: P = !1, asForm: F = !1, className: re, surfaceRef: ie, onSurfaceFocus: ae, onSurfaceBlur: oe, handleRef: I, reducedMotion: L = !1, "data-testid": se }) => {
|
|
41
|
+
let R = xt(p, b), z = N != null, { error: ce, show: le, clear: ue } = tt(), de = Y(() => {}), fe = Y(() => {}), me = Y(""), he = K((e) => {
|
|
42
|
+
let t = me.current, n = t && !/\s$/.test(t) ? " " : "";
|
|
43
|
+
de.current(`${t}${n}${e}`);
|
|
44
|
+
}, []), ge = {
|
|
45
|
+
"permission-denied": R.micPermissionDenied,
|
|
46
|
+
"device-error": R.micError,
|
|
47
|
+
"transcription-failed": R.transcriptionError
|
|
48
|
+
}, B = Dt({
|
|
49
49
|
onTranscribe: b?.onTranscribe,
|
|
50
|
-
onPartial:
|
|
50
|
+
onPartial: he,
|
|
51
51
|
onFinal: (e) => {
|
|
52
|
-
|
|
52
|
+
he(e), fe.current();
|
|
53
53
|
},
|
|
54
|
-
onError: (e) =>
|
|
54
|
+
onError: (e) => le(ge[e]),
|
|
55
55
|
onAudio: b?.onAudio
|
|
56
|
-
}), [
|
|
56
|
+
}), [_e, ve] = X(!1), ye = B.status === "recording", be = B.status === "transcribing", xe = !!b && (!!b.onTranscribe || !!b.onAudio) && B.isSupported, Se = !b?.onAudio && (B.status !== "idle" || _e), [Ce, we] = X(!1), Te = Ve({
|
|
57
57
|
mentions: {
|
|
58
|
-
enabled: !!v && v.sources.length + +!!v.pinned > 0 && !Ce && !
|
|
58
|
+
enabled: !!v && v.sources.length + +!!v.pinned > 0 && !Ce && !z,
|
|
59
59
|
sources: v?.sources ?? An,
|
|
60
60
|
pinned: v?.pinned,
|
|
61
61
|
scopeKey: v?.scopeKey,
|
|
@@ -65,7 +65,7 @@ var Dn = [
|
|
|
65
65
|
onTextChange: x,
|
|
66
66
|
historySuspended: Se
|
|
67
67
|
}), { value: V, setValue: Ee, setCursorPosition: Oe, textareaRef: ke, highlightRef: Ae, mentions: H, requestSelection: Me, clearText: U, breakHistory: Ne } = Te;
|
|
68
|
-
|
|
68
|
+
de.current = (e) => {
|
|
69
69
|
Ee(e), Oe(e.length);
|
|
70
70
|
};
|
|
71
71
|
let Pe = Y(V);
|
|
@@ -83,27 +83,27 @@ var Dn = [
|
|
|
83
83
|
let n = t.value.length;
|
|
84
84
|
t.setSelectionRange(n, n);
|
|
85
85
|
}, [ke]);
|
|
86
|
-
|
|
86
|
+
fe.current = () => ke.current?.focus();
|
|
87
87
|
let Ge = H.close;
|
|
88
88
|
q(() => {
|
|
89
|
-
|
|
90
|
-
}, [
|
|
89
|
+
z && Ge();
|
|
90
|
+
}, [z, Ge]);
|
|
91
91
|
let W = V.length === 0;
|
|
92
92
|
q(() => {
|
|
93
93
|
D?.({
|
|
94
94
|
isEmpty: W,
|
|
95
|
-
recorder:
|
|
95
|
+
recorder: B.status
|
|
96
96
|
});
|
|
97
97
|
}, [
|
|
98
98
|
D,
|
|
99
99
|
W,
|
|
100
|
-
|
|
100
|
+
B.status
|
|
101
101
|
]);
|
|
102
102
|
let [qe, Je] = X(!1), Ye = l !== void 0 && V.trim().length > l;
|
|
103
103
|
q(() => {
|
|
104
104
|
Ye || Je(!1);
|
|
105
105
|
}, [Ye]);
|
|
106
|
-
let Xe = qe && Ye ? d ?? null : null, Ze = Xe ?? f ??
|
|
106
|
+
let Xe = qe && Ye ? d ?? null : null, Ze = Xe ?? f ?? ce, [Qe, $e] = X(!1), et = Y(!1), nt = (V.trim().length > 0 || a) && !Se && !s && !Qe && !z, rt = t && !be, it = K(() => {
|
|
107
107
|
if (!nt || et.current) return;
|
|
108
108
|
if (Ye) {
|
|
109
109
|
Je(!0);
|
|
@@ -138,26 +138,26 @@ var Dn = [
|
|
|
138
138
|
]), [at, ot] = X(0), lt = Y(nt);
|
|
139
139
|
lt.current !== nt && (lt.current = nt, nt && ot((e) => e + 1));
|
|
140
140
|
let dt = K(() => {
|
|
141
|
-
|
|
141
|
+
_e || (b?.onPress?.(), ue(), ve(!0), (async () => {
|
|
142
142
|
try {
|
|
143
|
-
await
|
|
143
|
+
await B.start(), me.current = Pe.current;
|
|
144
144
|
} catch {} finally {
|
|
145
|
-
|
|
145
|
+
ve(!1);
|
|
146
146
|
}
|
|
147
147
|
})());
|
|
148
148
|
}, [
|
|
149
|
-
|
|
149
|
+
_e,
|
|
150
150
|
b,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
]), ft =
|
|
151
|
+
ue,
|
|
152
|
+
B
|
|
153
|
+
]), ft = B.cancel, pt = K(() => {
|
|
154
154
|
ft(), b?.onCancelled?.();
|
|
155
155
|
}, [ft, b]), mt = Y(!1), ht = b?.onStarted;
|
|
156
156
|
q(() => {
|
|
157
|
-
|
|
158
|
-
}, [
|
|
157
|
+
ye && !mt.current && ht?.(), mt.current = ye;
|
|
158
|
+
}, [ye, ht]), bn(I, () => ({
|
|
159
159
|
focus: (e) => {
|
|
160
|
-
|
|
160
|
+
z || We(e);
|
|
161
161
|
},
|
|
162
162
|
clear: U,
|
|
163
163
|
loadDraft: Te.loadDraft,
|
|
@@ -173,7 +173,7 @@ var Dn = [
|
|
|
173
173
|
breakHistory: Ne,
|
|
174
174
|
addFiles: () => {}
|
|
175
175
|
}), [
|
|
176
|
-
|
|
176
|
+
z,
|
|
177
177
|
We,
|
|
178
178
|
U,
|
|
179
179
|
Te.loadDraft,
|
|
@@ -188,33 +188,33 @@ var Dn = [
|
|
|
188
188
|
let { escapeArmed: gt, handleClearKeyDown: yt, handleUndoRedoKeyDown: bt } = Te, St = (e) => {
|
|
189
189
|
if (e.key !== "Escape") return !1;
|
|
190
190
|
if (C?.(e)) return !0;
|
|
191
|
-
if (
|
|
191
|
+
if (ye) return e.preventDefault(), pt(), !0;
|
|
192
192
|
let t = gt;
|
|
193
193
|
return yt(e) ? (t && (Je(!1), S?.()), !0) : !1;
|
|
194
194
|
}, Ct = (e) => {
|
|
195
|
-
|
|
195
|
+
z || Le(e) || bt(e) || Re?.handleKeyDown(e) || H.handleKeyDown(e) || St(e) || (e.key === "ArrowUp" && !e.shiftKey && !e.altKey && !e.metaKey && !e.ctrlKey && V === "" && B.status === "idle" && !_e && !b?.busy && w?.() ? e.preventDefault() : e.key === "Enter" && !e.shiftKey && (e.preventDefault(), t || it()));
|
|
196
196
|
}, wt = (e) => {
|
|
197
|
-
e.preventDefault(), !
|
|
197
|
+
e.preventDefault(), !z && (t && !Se ? (H.close(), n?.(), ke.current?.focus()) : it());
|
|
198
198
|
}, Tt = je({
|
|
199
|
-
enabled: !!T && !
|
|
199
|
+
enabled: !!T && !z,
|
|
200
200
|
onFiles: T ?? (() => {}),
|
|
201
201
|
preferText: E
|
|
202
|
-
}), Et = yn(), Ot = yn(), kt = `chat-composer-mentions-${Et.replace(/:/g, "")}`, G = H.isOpen && !ze && !
|
|
202
|
+
}), Et = yn(), Ot = yn(), kt = `chat-composer-mentions-${Et.replace(/:/g, "")}`, G = H.isOpen && !ze && !z && (H.isLoading || H.rows.length > 0), At = H.rows[H.selectedIndex] ?? H.rows[0], jt = G && At ? Fe(kt, At.item) : void 0, Mt = (e) => xe ? /* @__PURE__ */ Z(u, {
|
|
203
203
|
type: "button",
|
|
204
204
|
variant: "outline",
|
|
205
205
|
size: e,
|
|
206
206
|
hideLabel: !0,
|
|
207
|
-
label: b?.busy ?
|
|
207
|
+
label: b?.busy ? R.sendingVoice : R.recordAudio,
|
|
208
208
|
icon: te,
|
|
209
209
|
onClick: dt,
|
|
210
210
|
disabled: b?.disabled,
|
|
211
|
-
loading:
|
|
211
|
+
loading: _e || be || !!b?.busy
|
|
212
212
|
}) : null, Nt = rt ? "stop" : r, Pt = (e) => /* @__PURE__ */ Z(o, {
|
|
213
213
|
initial: !1,
|
|
214
214
|
mode: "popLayout",
|
|
215
215
|
children: /* @__PURE__ */ Z(c.div, {
|
|
216
216
|
className: "flex",
|
|
217
|
-
initial: !
|
|
217
|
+
initial: !L && {
|
|
218
218
|
opacity: 0,
|
|
219
219
|
scale: .95
|
|
220
220
|
},
|
|
@@ -222,7 +222,7 @@ var Dn = [
|
|
|
222
222
|
opacity: 1,
|
|
223
223
|
scale: 1
|
|
224
224
|
},
|
|
225
|
-
exit:
|
|
225
|
+
exit: L ? void 0 : {
|
|
226
226
|
opacity: 0,
|
|
227
227
|
transition: { duration: .1 }
|
|
228
228
|
},
|
|
@@ -231,38 +231,38 @@ var Dn = [
|
|
|
231
231
|
ease: vt
|
|
232
232
|
},
|
|
233
233
|
children: rt ? /* @__PURE__ */ Z(u, {
|
|
234
|
-
type:
|
|
234
|
+
type: F ? "submit" : "button",
|
|
235
235
|
variant: "neutral",
|
|
236
236
|
size: e,
|
|
237
237
|
hideLabel: !0,
|
|
238
|
-
label:
|
|
238
|
+
label: R.stop,
|
|
239
239
|
icon: Ke,
|
|
240
|
-
onClick:
|
|
240
|
+
onClick: F ? void 0 : () => {
|
|
241
241
|
n?.(), ke.current?.focus();
|
|
242
242
|
}
|
|
243
243
|
}) : /* @__PURE__ */ Z(u, {
|
|
244
|
-
type:
|
|
244
|
+
type: F ? "submit" : "button",
|
|
245
245
|
variant: "default",
|
|
246
246
|
size: e,
|
|
247
247
|
hideLabel: !0,
|
|
248
|
-
label: r === "save" ?
|
|
248
|
+
label: r === "save" ? R.save : R.send,
|
|
249
249
|
icon: r === "save" ? on : qt,
|
|
250
|
-
onClick:
|
|
250
|
+
onClick: F ? void 0 : it,
|
|
251
251
|
disabled: !nt
|
|
252
252
|
})
|
|
253
253
|
}, `${Nt}-${rt ? 0 : at}`)
|
|
254
|
-
}), Ft = { duration:
|
|
254
|
+
}), Ft = { duration: L ? 0 : .15 }, It = typeof k == "function" ? k(B.status) : k, Lt = /* @__PURE__ */ Z("div", {
|
|
255
255
|
className: "grid",
|
|
256
256
|
children: /* @__PURE__ */ Z(o, {
|
|
257
257
|
initial: !1,
|
|
258
|
-
children:
|
|
258
|
+
children: ye ? /* @__PURE__ */ Q(c.div, {
|
|
259
259
|
className: "flex items-center gap-3 p-3 [grid-area:1/1]",
|
|
260
260
|
initial: { opacity: 0 },
|
|
261
261
|
animate: { opacity: 1 },
|
|
262
262
|
exit: { opacity: 0 },
|
|
263
263
|
transition: Ft,
|
|
264
264
|
children: [/* @__PURE__ */ Z(ct, {
|
|
265
|
-
stream:
|
|
265
|
+
stream: B.stream,
|
|
266
266
|
className: "min-w-0 flex-1"
|
|
267
267
|
}), /* @__PURE__ */ Q("div", {
|
|
268
268
|
className: "flex shrink-0 items-center gap-2",
|
|
@@ -271,17 +271,17 @@ var Dn = [
|
|
|
271
271
|
variant: "outline",
|
|
272
272
|
size: "md",
|
|
273
273
|
hideLabel: !0,
|
|
274
|
-
label:
|
|
275
|
-
icon:
|
|
274
|
+
label: R.cancelRecording,
|
|
275
|
+
icon: pe,
|
|
276
276
|
onClick: pt
|
|
277
277
|
}), /* @__PURE__ */ Z(u, {
|
|
278
278
|
type: "button",
|
|
279
279
|
variant: "default",
|
|
280
280
|
size: "md",
|
|
281
281
|
hideLabel: !0,
|
|
282
|
-
label:
|
|
282
|
+
label: R.confirmRecording,
|
|
283
283
|
icon: on,
|
|
284
|
-
onClick:
|
|
284
|
+
onClick: B.stop
|
|
285
285
|
})]
|
|
286
286
|
})]
|
|
287
287
|
}, "recording-row") : /* @__PURE__ */ Q(c.div, {
|
|
@@ -307,7 +307,7 @@ var Dn = [
|
|
|
307
307
|
}, "actions-row")
|
|
308
308
|
})
|
|
309
309
|
}), Rt = {
|
|
310
|
-
duration:
|
|
310
|
+
duration: L ? 0 : .32,
|
|
311
311
|
ease: [
|
|
312
312
|
.4,
|
|
313
313
|
0,
|
|
@@ -319,7 +319,7 @@ var Dn = [
|
|
|
319
319
|
/* @__PURE__ */ Z(st, {
|
|
320
320
|
message: Ze,
|
|
321
321
|
id: Ot,
|
|
322
|
-
reducedMotion:
|
|
322
|
+
reducedMotion: L
|
|
323
323
|
}),
|
|
324
324
|
O,
|
|
325
325
|
/* @__PURE__ */ Q("div", {
|
|
@@ -333,15 +333,15 @@ var Dn = [
|
|
|
333
333
|
value: V,
|
|
334
334
|
role: g,
|
|
335
335
|
name: _,
|
|
336
|
-
ariaLabel:
|
|
336
|
+
ariaLabel: R.placeholder,
|
|
337
337
|
placeholder: m ? {
|
|
338
338
|
mode: "overlay",
|
|
339
|
-
texts:
|
|
340
|
-
fallback:
|
|
339
|
+
texts: ye ? [R.listening] : m,
|
|
340
|
+
fallback: ye ? R.listening : R.placeholder,
|
|
341
341
|
paused: h
|
|
342
342
|
} : {
|
|
343
343
|
mode: "native",
|
|
344
|
-
text:
|
|
344
|
+
text: ye ? R.listening : R.placeholder
|
|
345
345
|
},
|
|
346
346
|
onChange: Te.handleChange,
|
|
347
347
|
onKeyDown: Ct,
|
|
@@ -390,7 +390,7 @@ var Dn = [
|
|
|
390
390
|
/* @__PURE__ */ Z(_t, {
|
|
391
391
|
isOpen: G,
|
|
392
392
|
listboxId: kt,
|
|
393
|
-
label:
|
|
393
|
+
label: R.mentionSuggestions,
|
|
394
394
|
rows: H.rows,
|
|
395
395
|
groups: H.groups,
|
|
396
396
|
showGroupLabels: !!v?.showGroupLabels,
|
|
@@ -398,11 +398,11 @@ var Dn = [
|
|
|
398
398
|
selectedIndex: H.selectedIndex,
|
|
399
399
|
position: H.popoverPosition,
|
|
400
400
|
onSelect: H.selectRow,
|
|
401
|
-
pinnedDescription:
|
|
401
|
+
pinnedDescription: R.mentionPinnedDescription
|
|
402
402
|
}),
|
|
403
|
-
|
|
403
|
+
N === void 0 ? zt : /* @__PURE__ */ Z(o, {
|
|
404
404
|
initial: !1,
|
|
405
|
-
children:
|
|
405
|
+
children: z ? /* @__PURE__ */ Z(c.div, {
|
|
406
406
|
className: "overflow-hidden",
|
|
407
407
|
initial: {
|
|
408
408
|
height: 0,
|
|
@@ -416,7 +416,7 @@ var Dn = [
|
|
|
416
416
|
height: 0,
|
|
417
417
|
opacity: 0,
|
|
418
418
|
transition: {
|
|
419
|
-
duration:
|
|
419
|
+
duration: L ? 0 : .22,
|
|
420
420
|
ease: [
|
|
421
421
|
.4,
|
|
422
422
|
0,
|
|
@@ -426,7 +426,7 @@ var Dn = [
|
|
|
426
426
|
}
|
|
427
427
|
},
|
|
428
428
|
transition: {
|
|
429
|
-
duration:
|
|
429
|
+
duration: L ? 0 : .4,
|
|
430
430
|
ease: [
|
|
431
431
|
.4,
|
|
432
432
|
0,
|
|
@@ -434,7 +434,7 @@ var Dn = [
|
|
|
434
434
|
1
|
|
435
435
|
]
|
|
436
436
|
},
|
|
437
|
-
children:
|
|
437
|
+
children: N
|
|
438
438
|
}, "replacement") : /* @__PURE__ */ Z(c.div, {
|
|
439
439
|
className: "overflow-hidden",
|
|
440
440
|
initial: {
|
|
@@ -449,7 +449,7 @@ var Dn = [
|
|
|
449
449
|
height: 0,
|
|
450
450
|
opacity: 0,
|
|
451
451
|
transition: {
|
|
452
|
-
duration:
|
|
452
|
+
duration: L ? 0 : .15,
|
|
453
453
|
ease: [
|
|
454
454
|
.55,
|
|
455
455
|
0,
|
|
@@ -459,7 +459,7 @@ var Dn = [
|
|
|
459
459
|
}
|
|
460
460
|
},
|
|
461
461
|
transition: {
|
|
462
|
-
duration:
|
|
462
|
+
duration: L ? 0 : .4,
|
|
463
463
|
ease: [
|
|
464
464
|
.4,
|
|
465
465
|
0,
|
|
@@ -470,27 +470,27 @@ var Dn = [
|
|
|
470
470
|
children: zt
|
|
471
471
|
}, "input")
|
|
472
472
|
})
|
|
473
|
-
] }), Vt = i(kn,
|
|
474
|
-
return
|
|
475
|
-
ref:
|
|
476
|
-
"data-testid":
|
|
473
|
+
] }), Vt = i(kn, P && "!border-f1-border-selected", re);
|
|
474
|
+
return F ? /* @__PURE__ */ Z("form", {
|
|
475
|
+
ref: ie,
|
|
476
|
+
"data-testid": se,
|
|
477
477
|
"data-f0-chat-composer": "",
|
|
478
478
|
"aria-busy": t,
|
|
479
479
|
className: Vt,
|
|
480
480
|
onClick: () => {
|
|
481
|
-
|
|
481
|
+
z || ke.current?.focus();
|
|
482
482
|
},
|
|
483
|
-
onFocus:
|
|
484
|
-
onBlur:
|
|
483
|
+
onFocus: ae,
|
|
484
|
+
onBlur: oe,
|
|
485
485
|
onSubmit: wt,
|
|
486
486
|
children: Bt
|
|
487
487
|
}) : /* @__PURE__ */ Z("div", {
|
|
488
|
-
ref:
|
|
489
|
-
"data-testid":
|
|
488
|
+
ref: ie,
|
|
489
|
+
"data-testid": se,
|
|
490
490
|
"data-f0-chat-composer": "",
|
|
491
491
|
className: Vt,
|
|
492
|
-
onFocus:
|
|
493
|
-
onBlur:
|
|
492
|
+
onFocus: ae,
|
|
493
|
+
onBlur: oe,
|
|
494
494
|
children: Bt
|
|
495
495
|
});
|
|
496
496
|
};
|
|
@@ -521,13 +521,13 @@ function Nn(e, t, n = .2) {
|
|
|
521
521
|
//#endregion
|
|
522
522
|
//#region src/addons/ai/F0AiChatTextArea/components/AttachedFilesList.tsx
|
|
523
523
|
var Pn = (e) => {
|
|
524
|
-
let { provided: t } =
|
|
525
|
-
return t ? /* @__PURE__ */ Z(Fn, { ...e }) : /* @__PURE__ */ Z(
|
|
524
|
+
let { provided: t } = I();
|
|
525
|
+
return t ? /* @__PURE__ */ Z(Fn, { ...e }) : /* @__PURE__ */ Z(oe, { children: /* @__PURE__ */ Z(Fn, { ...e }) });
|
|
526
526
|
}, Fn = ({ attachedFiles: e, isUploading: n, onRemove: r, removeLabel: i, reducedMotion: a }) => {
|
|
527
527
|
let o = t(), s = In(e), c = J(() => e.flatMap((e) => {
|
|
528
528
|
let t = s.get(e.id);
|
|
529
529
|
if (!t) return [];
|
|
530
|
-
let n = e.file.name, r = e.file.type ||
|
|
530
|
+
let n = e.file.name, r = e.file.type || P({
|
|
531
531
|
name: n,
|
|
532
532
|
url: t
|
|
533
533
|
});
|
|
@@ -552,8 +552,8 @@ var Pn = (e) => {
|
|
|
552
552
|
}];
|
|
553
553
|
}), [e, s]), l = J(() => c.map(({ att: e, attachment: t }, n) => ({
|
|
554
554
|
file: t,
|
|
555
|
-
item: e.status === "uploaded" ? O(t,
|
|
556
|
-
})), [c]), u =
|
|
555
|
+
item: e.status === "uploaded" ? O(t, le(n, t.url)) : null
|
|
556
|
+
})), [c]), u = ve(l, "composer"), d = c.map(({ att: e, attachment: t }) => ({
|
|
557
557
|
id: e.id,
|
|
558
558
|
content: /* @__PURE__ */ Z(j, {
|
|
559
559
|
attachment: t,
|
|
@@ -595,11 +595,11 @@ var Pn = (e) => {
|
|
|
595
595
|
d(e), s?.(e);
|
|
596
596
|
}, p = [...n ? [{
|
|
597
597
|
label: c.ai.addFilesOrPhotos,
|
|
598
|
-
icon:
|
|
598
|
+
icon: fe,
|
|
599
599
|
onClick: r,
|
|
600
600
|
disabled: i,
|
|
601
601
|
disabledTooltip: a
|
|
602
|
-
}, ...e.length > 0 ? [{ type: "separator" }] : []] : [], ...
|
|
602
|
+
}, ...e.length > 0 ? [{ type: "separator" }] : []] : [], ...me(e)];
|
|
603
603
|
return /* @__PURE__ */ Z("div", {
|
|
604
604
|
onClick: (e) => e.stopPropagation(),
|
|
605
605
|
children: /* @__PURE__ */ Z(bt, {
|
|
@@ -635,7 +635,7 @@ var Pn = (e) => {
|
|
|
635
635
|
label: d.ai.attachFile,
|
|
636
636
|
hideLabel: !0,
|
|
637
637
|
type: "button",
|
|
638
|
-
icon:
|
|
638
|
+
icon: fe,
|
|
639
639
|
variant: "outline",
|
|
640
640
|
size: "md",
|
|
641
641
|
disabled: r || f,
|
|
@@ -844,7 +844,7 @@ var Pn = (e) => {
|
|
|
844
844
|
variant: "ghost",
|
|
845
845
|
label: r.ai.removeQuote,
|
|
846
846
|
onClick: n,
|
|
847
|
-
icon:
|
|
847
|
+
icon: pe,
|
|
848
848
|
hideLabel: !0,
|
|
849
849
|
size: "sm"
|
|
850
850
|
})
|
|
@@ -995,44 +995,44 @@ function nr(e) {
|
|
|
995
995
|
}
|
|
996
996
|
//#endregion
|
|
997
997
|
//#region src/addons/ai/F0AiChatTextArea/AiChatComposer.tsx
|
|
998
|
-
var rr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholders: s, creditWarning: u, clarifyingUI: d, pendingContext: f = null, onPendingContextChange: p, pendingQuote: m = null, onPendingQuoteChange: h, fileAttachments: g, toolbarStart: _, composerActions: v, onComposerActionsOpenChange: y, onTranscribe: b, searchPersons: x, mentionSources: S, onProcessFilesRef: C, disclaimer: w, usageLimits: T, footer: E, isWelcomeScreen: D = !1, fullscreen: ee = !1, welcomeScreenSuggestions: te, onSuggestionClick: O, welcomeScreenSuggestionsPlacement: ne = "above", welcomeScreenSuggestionsCollapsedByDefault: k = !1, welcomeScreenCards: A, padding: j = "default", name: M, ref:
|
|
999
|
-
let
|
|
998
|
+
var rr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholders: s, creditWarning: u, clarifyingUI: d, pendingContext: f = null, onPendingContextChange: p, pendingQuote: m = null, onPendingQuoteChange: h, fileAttachments: g, toolbarStart: _, composerActions: v, onComposerActionsOpenChange: y, onTranscribe: b, searchPersons: x, mentionSources: S, onProcessFilesRef: C, disclaimer: w, usageLimits: T, footer: E, isWelcomeScreen: D = !1, fullscreen: ee = !1, welcomeScreenSuggestions: te, onSuggestionClick: O, welcomeScreenSuggestionsPlacement: ne = "above", welcomeScreenSuggestionsCollapsedByDefault: k = !1, welcomeScreenCards: A, padding: j = "default", name: M, ref: N }) => {
|
|
999
|
+
let P = t(), F = !!l(), re = Y(null), [ie, ae] = X(null), [oe, I] = X(!1), [L, se] = X({
|
|
1000
1000
|
isEmpty: !0,
|
|
1001
1001
|
recorder: "idle"
|
|
1002
|
-
}),
|
|
1002
|
+
}), R = Y(null), z = Y(null);
|
|
1003
1003
|
q(() => () => {
|
|
1004
|
-
|
|
1004
|
+
z.current && clearTimeout(z.current);
|
|
1005
1005
|
}, []);
|
|
1006
|
-
let
|
|
1006
|
+
let ce = d != null, le = Y(f), ue = Y(m);
|
|
1007
1007
|
Sn(() => {
|
|
1008
|
-
|
|
1008
|
+
le.current = f, ue.current = m;
|
|
1009
1009
|
});
|
|
1010
|
-
let { tracking:
|
|
1011
|
-
|
|
1010
|
+
let { tracking: de, setFocusChatInputFunction: fe } = W(), pe = K((e, t) => {
|
|
1011
|
+
de?.onWelcomeSuggestionClick?.({
|
|
1012
1012
|
item: e,
|
|
1013
1013
|
group: t,
|
|
1014
1014
|
prompt: e.prompt || e.title
|
|
1015
1015
|
}), O?.(e, t);
|
|
1016
|
-
}, [
|
|
1016
|
+
}, [de, O]), { attachedFiles: me, fileInputRef: he, onUploadFiles: ge, acceptValue: B, isAtMaxFiles: _e, maxFiles: ve, processFiles: ye, handleFileSelect: be, handleRemoveFile: xe, transientError: Se, showTransientError: Ce } = nr(g), we = Qn({
|
|
1017
1017
|
searchPersons: x,
|
|
1018
1018
|
mentionSources: S
|
|
1019
1019
|
});
|
|
1020
1020
|
q(() => {
|
|
1021
|
-
k || typeof window < "u" && window.location.hash.length === 0 &&
|
|
1021
|
+
k || typeof window < "u" && window.location.hash.length === 0 && re.current?.focus();
|
|
1022
1022
|
}, []), q(() => {
|
|
1023
|
-
if (
|
|
1024
|
-
else return
|
|
1025
|
-
|
|
1026
|
-
}), () =>
|
|
1027
|
-
}, [
|
|
1023
|
+
if (ce) fe(null);
|
|
1024
|
+
else return fe(() => {
|
|
1025
|
+
re.current?.focus();
|
|
1026
|
+
}), () => fe(null);
|
|
1027
|
+
}, [ce, fe]), q(() => {
|
|
1028
1028
|
if (C) return C((e) => {
|
|
1029
|
-
|
|
1029
|
+
ye(e);
|
|
1030
1030
|
}), () => {
|
|
1031
1031
|
C(null);
|
|
1032
1032
|
};
|
|
1033
|
-
}, [C,
|
|
1034
|
-
let Te = K((e) => void
|
|
1035
|
-
if (De) return Ce(
|
|
1033
|
+
}, [C, ye]);
|
|
1034
|
+
let Te = K((e) => void ye(e), [ye]), V = me.filter((e) => e.status === "uploaded"), Ee = me.some((e) => e.status === "uploading"), De = me.some((e) => e.status === "error"), Oe = !L.isEmpty || V.length > 0, ke = async ({ text: t, mentions: n }) => {
|
|
1035
|
+
if (De) return Ce(P.ai.fileUploadBlockedSubmit), !1;
|
|
1036
1036
|
if (a && await a() === !1) return !1;
|
|
1037
1037
|
let r = V, i = r.flatMap((e) => e.uploadedFile ? [e.uploadedFile] : []), o = f, s = m;
|
|
1038
1038
|
o && p?.(null), s && h?.(null);
|
|
@@ -1044,26 +1044,26 @@ var rr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholde
|
|
|
1044
1044
|
quote: s
|
|
1045
1045
|
});
|
|
1046
1046
|
} catch {
|
|
1047
|
-
return o && (
|
|
1047
|
+
return o && (le.current == null || le.current === o) && p?.(o), s && (ue.current == null || ue.current === s) && h?.(s), !1;
|
|
1048
1048
|
}
|
|
1049
1049
|
for (let e of r) xe(e.id);
|
|
1050
1050
|
return !0;
|
|
1051
|
-
}, Ae =
|
|
1051
|
+
}, Ae = ie ? ie.prompt ?? ie.title : null, H = Ae ? [Ae] : s ?? [], je = ne === "inside", Me = D && te && te.length > 0 && O ? /* @__PURE__ */ Z(St, {
|
|
1052
1052
|
suggestions: te,
|
|
1053
|
-
onItemClick:
|
|
1054
|
-
onItemHover:
|
|
1053
|
+
onItemClick: pe,
|
|
1054
|
+
onItemHover: ae,
|
|
1055
1055
|
side: je ? "bottom" : "top",
|
|
1056
1056
|
reserveTwoRows: !je,
|
|
1057
1057
|
overflow: je ? "scroll" : "wrap"
|
|
1058
|
-
}) : null, U = !k ||
|
|
1059
|
-
|
|
1060
|
-
Ne(document.activeElement) ||
|
|
1058
|
+
}) : null, U = !k || oe || Oe || L.recorder !== "idle", Ne = (e) => e instanceof Node ? R.current?.contains(e) ? !0 : e instanceof Element && e.closest("[data-radix-popper-content-wrapper]") !== null : !1, Fe = () => {
|
|
1059
|
+
z.current && clearTimeout(z.current), z.current = setTimeout(() => {
|
|
1060
|
+
Ne(document.activeElement) || I(!1);
|
|
1061
1061
|
}, 0);
|
|
1062
1062
|
}, Ie = je, Le = Ie && k, Re = Le && !U, ze = Ie && Me ? /* @__PURE__ */ Z("div", {
|
|
1063
1063
|
onClick: (e) => e.stopPropagation(),
|
|
1064
1064
|
children: Me
|
|
1065
1065
|
}) : void 0, Ve = {
|
|
1066
|
-
duration:
|
|
1066
|
+
duration: F ? 0 : .32,
|
|
1067
1067
|
ease: [
|
|
1068
1068
|
.4,
|
|
1069
1069
|
0,
|
|
@@ -1072,7 +1072,7 @@ var rr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholde
|
|
|
1072
1072
|
]
|
|
1073
1073
|
}, He = D && ee && !!A && A.length > 0, Ue = ee && D, { motionProps: We } = Nn(D, 160, .5);
|
|
1074
1074
|
return /* @__PURE__ */ Q(c.div, {
|
|
1075
|
-
ref:
|
|
1075
|
+
ref: N,
|
|
1076
1076
|
"data-composer-layout": Ue ? "welcome" : "docked",
|
|
1077
1077
|
className: i("flex flex-col items-center gap-2", j === "default" && "px-4 pb-3 pt-2", Ue && "min-h-0 flex-1 justify-start -mt-20"),
|
|
1078
1078
|
...ee ? We : {},
|
|
@@ -1102,14 +1102,14 @@ var rr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholde
|
|
|
1102
1102
|
creditWarning: u,
|
|
1103
1103
|
children: /* @__PURE__ */ Z(Mn, {
|
|
1104
1104
|
asForm: !0,
|
|
1105
|
-
surfaceRef:
|
|
1106
|
-
handleRef:
|
|
1105
|
+
surfaceRef: R,
|
|
1106
|
+
handleRef: re,
|
|
1107
1107
|
className: "isolate z-20 items-stretch p-0 hover:cursor-text",
|
|
1108
|
-
accent:
|
|
1109
|
-
replacement:
|
|
1110
|
-
onSurfaceFocus: () =>
|
|
1108
|
+
accent: ce,
|
|
1109
|
+
replacement: ce ? d : null,
|
|
1110
|
+
onSurfaceFocus: () => I(!0),
|
|
1111
1111
|
onSurfaceBlur: Fe,
|
|
1112
|
-
onStateChange:
|
|
1112
|
+
onStateChange: se,
|
|
1113
1113
|
onSend: ke,
|
|
1114
1114
|
inProgress: r,
|
|
1115
1115
|
onStop: n,
|
|
@@ -1121,17 +1121,17 @@ var rr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholde
|
|
|
1121
1121
|
placeholders: H,
|
|
1122
1122
|
placeholdersPaused: r,
|
|
1123
1123
|
labels: {
|
|
1124
|
-
placeholder:
|
|
1125
|
-
listening:
|
|
1126
|
-
send:
|
|
1127
|
-
stop:
|
|
1128
|
-
recordAudio:
|
|
1129
|
-
cancelRecording:
|
|
1130
|
-
confirmRecording:
|
|
1131
|
-
micPermissionDenied:
|
|
1132
|
-
micError:
|
|
1133
|
-
transcriptionError:
|
|
1134
|
-
mentionSuggestions:
|
|
1124
|
+
placeholder: P.ai.inputPlaceholder,
|
|
1125
|
+
listening: P.ai.listening,
|
|
1126
|
+
send: P.ai.sendMessage,
|
|
1127
|
+
stop: P.ai.stopAnswerGeneration,
|
|
1128
|
+
recordAudio: P.ai.recordAudio,
|
|
1129
|
+
cancelRecording: P.ai.cancelRecording,
|
|
1130
|
+
confirmRecording: P.ai.stopRecording,
|
|
1131
|
+
micPermissionDenied: P.ai.micPermissionDenied,
|
|
1132
|
+
micError: P.ai.micError,
|
|
1133
|
+
transcriptionError: P.ai.transcriptionError,
|
|
1134
|
+
mentionSuggestions: P.ai.mentions.suggestions
|
|
1135
1135
|
},
|
|
1136
1136
|
mentions: {
|
|
1137
1137
|
sources: we,
|
|
@@ -1139,8 +1139,8 @@ var rr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholde
|
|
|
1139
1139
|
},
|
|
1140
1140
|
voice: b ? {
|
|
1141
1141
|
onTranscribe: b,
|
|
1142
|
-
onPress:
|
|
1143
|
-
onCancelled:
|
|
1142
|
+
onPress: de?.onDictationStart,
|
|
1143
|
+
onCancelled: de?.onDictationCancel
|
|
1144
1144
|
} : void 0,
|
|
1145
1145
|
onPasteFiles: g?.onUploadFiles ? Te : void 0,
|
|
1146
1146
|
pastePreferText: !0,
|
|
@@ -1149,11 +1149,11 @@ var rr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholde
|
|
|
1149
1149
|
onRemove: () => h?.(null)
|
|
1150
1150
|
}) : null,
|
|
1151
1151
|
tray: /* @__PURE__ */ Z(Pn, {
|
|
1152
|
-
attachedFiles:
|
|
1152
|
+
attachedFiles: me,
|
|
1153
1153
|
isUploading: Ee,
|
|
1154
1154
|
onRemove: xe,
|
|
1155
|
-
removeLabel:
|
|
1156
|
-
reducedMotion:
|
|
1155
|
+
removeLabel: P.ai.removeFile,
|
|
1156
|
+
reducedMotion: F
|
|
1157
1157
|
}),
|
|
1158
1158
|
leading: Ie ? /* @__PURE__ */ Z("div", {
|
|
1159
1159
|
className: "flex shrink-0 self-center pl-3",
|
|
@@ -1162,14 +1162,14 @@ var rr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholde
|
|
|
1162
1162
|
spin: r
|
|
1163
1163
|
})
|
|
1164
1164
|
}) : void 0,
|
|
1165
|
-
toolbarStart:
|
|
1166
|
-
onUploadFiles:
|
|
1165
|
+
toolbarStart: ge || _ || v?.length ? (e) => /* @__PURE__ */ Q(Cn, { children: [/* @__PURE__ */ Z(Rn, {
|
|
1166
|
+
onUploadFiles: ge,
|
|
1167
1167
|
composerActions: v,
|
|
1168
1168
|
onComposerActionsOpenChange: y,
|
|
1169
|
-
isAtMaxFiles:
|
|
1170
|
-
maxFiles:
|
|
1171
|
-
acceptValue:
|
|
1172
|
-
fileInputRef:
|
|
1169
|
+
isAtMaxFiles: _e,
|
|
1170
|
+
maxFiles: ve,
|
|
1171
|
+
acceptValue: B,
|
|
1172
|
+
fileInputRef: he,
|
|
1173
1173
|
handleFileSelect: be,
|
|
1174
1174
|
recordingStatus: e
|
|
1175
1175
|
}), _ ? /* @__PURE__ */ Z("div", {
|
|
@@ -1180,7 +1180,7 @@ var rr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholde
|
|
|
1180
1180
|
toolbarCenter: ze,
|
|
1181
1181
|
collapsible: Le,
|
|
1182
1182
|
collapsed: Re,
|
|
1183
|
-
reducedMotion:
|
|
1183
|
+
reducedMotion: F
|
|
1184
1184
|
})
|
|
1185
1185
|
})]
|
|
1186
1186
|
}),
|
|
@@ -1193,13 +1193,13 @@ var rr = ({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholde
|
|
|
1193
1193
|
children: E
|
|
1194
1194
|
}) : null,
|
|
1195
1195
|
/* @__PURE__ */ Z(Ot, {
|
|
1196
|
-
hint:
|
|
1197
|
-
navigate:
|
|
1198
|
-
select:
|
|
1199
|
-
cancel:
|
|
1196
|
+
hint: ce ? {
|
|
1197
|
+
navigate: P.ai.clarifyingQuestion.navHint.navigate,
|
|
1198
|
+
select: P.ai.clarifyingQuestion.navHint.select,
|
|
1199
|
+
cancel: P.ai.clarifyingQuestion.navHint.cancel
|
|
1200
1200
|
} : null,
|
|
1201
1201
|
disclaimer: Ue ? null : Jn(w, T),
|
|
1202
|
-
reducedMotion:
|
|
1202
|
+
reducedMotion: F
|
|
1203
1203
|
})
|
|
1204
1204
|
]
|
|
1205
1205
|
});
|
|
@@ -1239,7 +1239,7 @@ function cr({ ...e }) {
|
|
|
1239
1239
|
//#endregion
|
|
1240
1240
|
//#region src/addons/ai/F0AiChat/components/markdownRenderers/components/Image.tsx
|
|
1241
1241
|
function lr({ src: e, alt: n, ...r }) {
|
|
1242
|
-
let o = t(), s = gt(), c = Ge(), l = at(e || void 0), [u, d] = X(!1), [p, m] = X(!1), h = n || (e ?
|
|
1242
|
+
let o = t(), s = gt(), c = Ge(), l = at(e || void 0), [u, d] = X(!1), [p, m] = X(!1), h = n || (e ? _e(e) : "") || "image";
|
|
1243
1243
|
if (!e || u || l.status === "error") return n ? /* @__PURE__ */ Z("span", {
|
|
1244
1244
|
className: "text-f1-foreground-secondary",
|
|
1245
1245
|
children: n
|
|
@@ -1463,7 +1463,7 @@ function br({ id: e, label: n }) {
|
|
|
1463
1463
|
let { entityRefs: r } = W(), i = r?.resolvers?.expense, a = t(), o = r?.urls?.expense?.(e), s = J(() => (e) => ({
|
|
1464
1464
|
avatar: {
|
|
1465
1465
|
type: "icon",
|
|
1466
|
-
icon:
|
|
1466
|
+
icon: ae
|
|
1467
1467
|
},
|
|
1468
1468
|
title: e.description || `Expense #${e.id}`,
|
|
1469
1469
|
description: [e.amount, e.status].filter(Boolean).join(" · "),
|
|
@@ -1536,7 +1536,7 @@ function Cr({ id: e, label: t }) {
|
|
|
1536
1536
|
trigger: /* @__PURE__ */ Z(hr, { label: t }),
|
|
1537
1537
|
resolver: r,
|
|
1538
1538
|
contentClassName: "w-72",
|
|
1539
|
-
renderCard: (e) => e ? /* @__PURE__ */ Z(
|
|
1539
|
+
renderCard: (e) => e ? /* @__PURE__ */ Z(L, {
|
|
1540
1540
|
name: `${e.firstName} ${e.lastName}`,
|
|
1541
1541
|
avatar: {
|
|
1542
1542
|
type: "person",
|
|
@@ -1548,7 +1548,7 @@ function Cr({ id: e, label: t }) {
|
|
|
1548
1548
|
profileHref: i,
|
|
1549
1549
|
onProfileClick: e.onProfileClick,
|
|
1550
1550
|
actions: e.actions
|
|
1551
|
-
}) : /* @__PURE__ */ Z(
|
|
1551
|
+
}) : /* @__PURE__ */ Z(L, {
|
|
1552
1552
|
name: t,
|
|
1553
1553
|
profileHref: i
|
|
1554
1554
|
})
|
|
@@ -1715,7 +1715,7 @@ function Nr({ type: e, id: t, children: n }) {
|
|
|
1715
1715
|
//#endregion
|
|
1716
1716
|
//#region src/addons/ai/F0AiChat/components/markdownRenderers/components/Table.tsx
|
|
1717
1717
|
async function Pr(e, t, n) {
|
|
1718
|
-
let r = qe(e), i = t === "xlsx" ? await
|
|
1718
|
+
let r = qe(e), i = t === "xlsx" ? await F([{
|
|
1719
1719
|
name: "Data",
|
|
1720
1720
|
rows: r
|
|
1721
1721
|
}]) : await Ye(r);
|
|
@@ -1848,7 +1848,7 @@ var Wr = {
|
|
|
1848
1848
|
return i ? `${r}.${i}` : r;
|
|
1849
1849
|
}
|
|
1850
1850
|
let n = t.split("?")[1], r = n ? new URLSearchParams(n.split("#")[0]).get("path") : null;
|
|
1851
|
-
return
|
|
1851
|
+
return _e(r ?? t) || e || "file";
|
|
1852
1852
|
}, qr = (e, t) => e.startsWith("data:") ? e : `data:${t ?? "application/octet-stream"};base64,${e}`, Jr = (e, t) => {
|
|
1853
1853
|
let n = $(e.data), r = $(e.url) ?? (n ? qr(n, t) : void 0);
|
|
1854
1854
|
if (!r) return null;
|
|
@@ -1899,11 +1899,11 @@ var Wr = {
|
|
|
1899
1899
|
if (n.length !== 0) return t === "user" ? n[n.length - 1] : n.join("\n\n");
|
|
1900
1900
|
}, ni = (e, { urlFor: t } = {}) => ({
|
|
1901
1901
|
url: e.url ?? t?.(e.path) ?? e.path,
|
|
1902
|
-
name: e.displayName ||
|
|
1902
|
+
name: e.displayName || _e(e.path),
|
|
1903
1903
|
mimeType: e.mimeType,
|
|
1904
1904
|
size: e.bytes,
|
|
1905
1905
|
previewUrl: e.preview ? t?.(e.preview.path) ?? e.preview.url : void 0
|
|
1906
|
-
}), ri = (e) =>
|
|
1906
|
+
}), ri = (e) => P(e) ?? "", ii = mn(!1), ai = () => vn(ii), oi = (e, t) => {
|
|
1907
1907
|
let [n, r] = X(() => t ? null : new Set(e));
|
|
1908
1908
|
return t && n !== null ? r(null) : !t && n === null && r(new Set(e)), (e) => e !== void 0 && n !== null && !n.has(e);
|
|
1909
1909
|
}, si = ({ avatar: e }) => e?.type === "module" ? /* @__PURE__ */ Z(Pt, {
|
|
@@ -2010,7 +2010,7 @@ function vi(e) {
|
|
|
2010
2010
|
return e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
2011
2011
|
}
|
|
2012
2012
|
function yi(e) {
|
|
2013
|
-
let { days: t, hours: n, minutes: r, seconds: i } =
|
|
2013
|
+
let { days: t, hours: n, minutes: r, seconds: i } = ce(e), a = [];
|
|
2014
2014
|
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(" ");
|
|
2015
2015
|
}
|
|
2016
2016
|
function bi(e) {
|
|
@@ -2146,7 +2146,7 @@ wi.displayName = "FormCard";
|
|
|
2146
2146
|
//#endregion
|
|
2147
2147
|
//#region src/addons/ai/F0AiMessagesContainer/components/ActiveFormCard.tsx
|
|
2148
2148
|
function Ti() {
|
|
2149
|
-
let e =
|
|
2149
|
+
let e = de(), t = e?.activeForm;
|
|
2150
2150
|
if (!t) return null;
|
|
2151
2151
|
let n = t.cardTitle, r = t.cardDescription, i = (e?.getFillVersion(t.formName) ?? 0) > 0;
|
|
2152
2152
|
return !n || !r || !i ? null : /* @__PURE__ */ Z("div", {
|
|
@@ -2286,8 +2286,8 @@ var Fi = 625, Ii = /* @__PURE__ */ new Set(), Li = ({ documents: e, onOpenFile:
|
|
|
2286
2286
|
})
|
|
2287
2287
|
});
|
|
2288
2288
|
}, Ri = "rounded-xl", zi = "ai-chat", Bi = (e) => {
|
|
2289
|
-
let { provided: t } =
|
|
2290
|
-
return t ? /* @__PURE__ */ Z(Ui, { ...e }) : /* @__PURE__ */ Z(
|
|
2289
|
+
let { provided: t } = I();
|
|
2290
|
+
return t ? /* @__PURE__ */ Z(Ui, { ...e }) : /* @__PURE__ */ Z(oe, { children: /* @__PURE__ */ Z(Ui, { ...e }) });
|
|
2291
2291
|
}, Vi = {
|
|
2292
2292
|
image: 0,
|
|
2293
2293
|
video: 1,
|
|
@@ -2295,11 +2295,11 @@ var Fi = 625, Ii = /* @__PURE__ */ new Set(), Li = ({ documents: e, onOpenFile:
|
|
|
2295
2295
|
audio: 3,
|
|
2296
2296
|
file: 4
|
|
2297
2297
|
}, Hi = (e) => e.bucket === "image" || e.bucket === "video" || e.bucket === "audio" || e.bucket === "document" ? e.bucket : "file", Ui = ({ files: e, align: t = "start", onOpenFile: n, onFileDownloaded: r, size: i = "default", opensIn: a }) => {
|
|
2298
|
-
let { remotePreviews: o } =
|
|
2298
|
+
let { remotePreviews: o } = I(), s = b(), c = i === "default" && (a ?? (t === "start" && s ? "canvas" : "viewer")) === "canvas", [l, u] = X(() => /* @__PURE__ */ new Set()), d = J(() => Wi(e, o, l), [
|
|
2299
2299
|
e,
|
|
2300
2300
|
o,
|
|
2301
2301
|
l
|
|
2302
|
-
]), f = J(() => i === "compact" ? d : [...d].sort((e, t) => Vi[e.cls.bucket] - Vi[t.cls.bucket]), [d, i]), p =
|
|
2302
|
+
]), f = J(() => i === "compact" ? d : [...d].sort((e, t) => Vi[e.cls.bucket] - Vi[t.cls.bucket]), [d, i]), p = ve(f, "transcript");
|
|
2303
2303
|
return e.length === 0 ? null : Z(i === "compact" ? qi : Ki, {
|
|
2304
2304
|
entries: d,
|
|
2305
2305
|
canvas: c,
|
|
@@ -2312,12 +2312,12 @@ var Fi = 625, Ii = /* @__PURE__ */ new Set(), Li = ({ documents: e, onOpenFile:
|
|
|
2312
2312
|
onImageError: (e) => u((t) => new Set(t).add(e.url))
|
|
2313
2313
|
});
|
|
2314
2314
|
}, Wi = (e, t, n) => e.map((e, r) => {
|
|
2315
|
-
let i =
|
|
2315
|
+
let i = ge(e), a = !(t || yt(e.url)) || i.bucket === "file" || i.bucket === "image" && n.has(e.url);
|
|
2316
2316
|
return {
|
|
2317
2317
|
file: e,
|
|
2318
2318
|
cls: i,
|
|
2319
2319
|
generic: a,
|
|
2320
|
-
item: a ? null : O(e,
|
|
2320
|
+
item: a ? null : O(e, le(r, e.url))
|
|
2321
2321
|
};
|
|
2322
2322
|
}), Gi = ({ align: e, compact: t = !1, children: n }) => /* @__PURE__ */ Z("div", {
|
|
2323
2323
|
className: i("flex w-full min-w-0 flex-col gap-1.5", e === "end" ? "items-end" : "items-start"),
|
|
@@ -2418,7 +2418,7 @@ var Fi = 625, Ii = /* @__PURE__ */ new Set(), Li = ({ documents: e, onOpenFile:
|
|
|
2418
2418
|
}, c) : s.bucket === "video" ? /* @__PURE__ */ Z(Zi, {
|
|
2419
2419
|
file: i,
|
|
2420
2420
|
onOpen: () => n(e)
|
|
2421
|
-
}, c) : s.bucket === "audio" ? /* @__PURE__ */ Z(
|
|
2421
|
+
}, c) : s.bucket === "audio" ? /* @__PURE__ */ Z(ue, {
|
|
2422
2422
|
file: V(i),
|
|
2423
2423
|
testIdPrefix: zi,
|
|
2424
2424
|
onOpen: () => n(e)
|
|
@@ -2599,7 +2599,7 @@ function aa({ anchor: e, onReply: n }) {
|
|
|
2599
2599
|
}
|
|
2600
2600
|
//#endregion
|
|
2601
2601
|
//#region src/addons/ai/F0AiMessagesContainer/components/AssistantMessage.tsx
|
|
2602
|
-
var oa = mn(void 0), sa = () => vn(oa), ca = (e) => /* @__PURE__ */ Z(
|
|
2602
|
+
var oa = mn(void 0), sa = () => vn(oa), ca = (e) => /* @__PURE__ */ Z(z, {
|
|
2603
2603
|
content: e,
|
|
2604
2604
|
format: "markdown"
|
|
2605
2605
|
}), la = ({ isGenerating: e, isLoading: t, isLive: n = !1, message: r, renderToolCall: i, onReplyQuote: a, onRendered: o, renderMarkdown: s }) => {
|
|
@@ -2681,7 +2681,7 @@ var oa = mn(void 0), sa = () => vn(oa), ca = (e) => /* @__PURE__ */ Z(R, {
|
|
|
2681
2681
|
},
|
|
2682
2682
|
children: /* @__PURE__ */ Z("div", {
|
|
2683
2683
|
className: "flex flex-col gap-6",
|
|
2684
|
-
children: /* @__PURE__ */ Z(
|
|
2684
|
+
children: /* @__PURE__ */ Z(ie, {
|
|
2685
2685
|
autoFocus: !0,
|
|
2686
2686
|
label: l,
|
|
2687
2687
|
placeholder: u,
|
|
@@ -2851,7 +2851,7 @@ var ha = ({ content: e, targetMessage: n, onCopy: r, actions: i = [] }) => {
|
|
|
2851
2851
|
}),
|
|
2852
2852
|
s ? null : /* @__PURE__ */ Z(G, { icon: Yt })
|
|
2853
2853
|
]
|
|
2854
|
-
}), /* @__PURE__ */ Z(
|
|
2854
|
+
}), /* @__PURE__ */ Z(se, {
|
|
2855
2855
|
forceMount: !0,
|
|
2856
2856
|
className: "data-[state=open]:mt-3",
|
|
2857
2857
|
children: /* @__PURE__ */ Z(c.div, {
|
|
@@ -2907,7 +2907,7 @@ var ha = ({ content: e, targetMessage: n, onCopy: r, actions: i = [] }) => {
|
|
|
2907
2907
|
}, [r, s]);
|
|
2908
2908
|
let u = r ? o.ai.thoughtsGroupTitle : n ?? o.ai.thoughtsGroupTitle, d = e.length - 1, f = (e) => !r || i ? "completed" : e === d ? "executing" : "completed";
|
|
2909
2909
|
return /* @__PURE__ */ Z(_a, {
|
|
2910
|
-
icon:
|
|
2910
|
+
icon: N,
|
|
2911
2911
|
title: u,
|
|
2912
2912
|
open: s,
|
|
2913
2913
|
onOpenChange: c,
|
|
@@ -2928,7 +2928,7 @@ var ha = ({ content: e, targetMessage: n, onCopy: r, actions: i = [] }) => {
|
|
|
2928
2928
|
}, n))
|
|
2929
2929
|
})
|
|
2930
2930
|
});
|
|
2931
|
-
}, Sa = (e) => /* @__PURE__ */ Z(
|
|
2931
|
+
}, Sa = (e) => /* @__PURE__ */ Z(z, {
|
|
2932
2932
|
content: e,
|
|
2933
2933
|
format: "markdown"
|
|
2934
2934
|
}), Ca = ({ text: e, renderMarkdown: t }) => /* @__PURE__ */ Q("div", {
|
|
@@ -3117,8 +3117,8 @@ var Pa = {
|
|
|
3117
3117
|
onThumbsUp: () => {},
|
|
3118
3118
|
onThumbsDown: () => {}
|
|
3119
3119
|
}, Fa = (e) => {
|
|
3120
|
-
let t =
|
|
3121
|
-
return e.filePreviews || !t.provided ? /* @__PURE__ */ Z(
|
|
3120
|
+
let t = I(), n = /* @__PURE__ */ Z(fa, { children: /* @__PURE__ */ Z(Ia, { ...e }) });
|
|
3121
|
+
return e.filePreviews || !t.provided ? /* @__PURE__ */ Z(oe, {
|
|
3122
3122
|
filePreviews: e.filePreviews,
|
|
3123
3123
|
children: n
|
|
3124
3124
|
}) : n;
|
|
@@ -3126,19 +3126,19 @@ var Pa = {
|
|
|
3126
3126
|
let { modal: D, handleSubmit: ee, handleClose: te } = ma(v ?? Pa), O = t(), ne = C ?? la, k = w ?? wa, A = J(() => {
|
|
3127
3127
|
let e = a ?? O.ai.defaultInitialMessage;
|
|
3128
3128
|
return (Array.isArray(e) ? e : [e]).filter((e) => typeof e == "string" && e.length > 0);
|
|
3129
|
-
}, [a, O.ai.defaultInitialMessage]), j = !n && e.length === 0 && A.length > 0, M = Y(null),
|
|
3129
|
+
}, [a, O.ai.defaultInitialMessage]), j = !n && e.length === 0 && A.length > 0, M = Y(null), N = Y(null), P = Y(null), F = Y(null), re = Y(null), { showScrollBtn: ie, turnMinHeight: ae, scrollToBottom: oe } = Na({
|
|
3130
3130
|
viewportRef: M,
|
|
3131
|
-
contentRef:
|
|
3132
|
-
endRef:
|
|
3133
|
-
lastTurnRef:
|
|
3131
|
+
contentRef: N,
|
|
3132
|
+
endRef: P,
|
|
3133
|
+
lastTurnRef: re,
|
|
3134
3134
|
turnsCount: e.length,
|
|
3135
3135
|
freezeTurnMinHeight: y
|
|
3136
3136
|
});
|
|
3137
3137
|
Pi({
|
|
3138
3138
|
viewportRef: M,
|
|
3139
|
-
contentRef:
|
|
3139
|
+
contentRef: N
|
|
3140
3140
|
});
|
|
3141
|
-
let
|
|
3141
|
+
let I = e[e.length - 1], L = Ma(!(!I || I.endIndicator !== "thinking" && !I.thinking?.inProgress), I?.thinking?.startedAt), se = I?.endIndicator === "asking", R = oi(e.flatMap((e) => e.assistantMessages.flatMap((e) => e.id ? [e.id] : [])), n), z = (t, n) => {
|
|
3142
3142
|
let r = n === e.length - 1, a = {
|
|
3143
3143
|
renderToolCall: p,
|
|
3144
3144
|
onReplyQuote: m,
|
|
@@ -3175,15 +3175,15 @@ var Pa = {
|
|
|
3175
3175
|
return /* @__PURE__ */ Z(ne, {
|
|
3176
3176
|
...c,
|
|
3177
3177
|
isGenerating: t.isInProgress && o,
|
|
3178
|
-
isLive: t.isInProgress ||
|
|
3178
|
+
isLive: t.isInProgress || R(e.id),
|
|
3179
3179
|
isLoading: t.isInProgress && o && !La(e)
|
|
3180
3180
|
}, `${n}-a-${i}`);
|
|
3181
3181
|
};
|
|
3182
3182
|
return /* @__PURE__ */ Q("div", {
|
|
3183
|
-
ref: r ?
|
|
3183
|
+
ref: r ? re : void 0,
|
|
3184
3184
|
className: i("flex flex-col items-start justify-start gap-2 px-1", r && "pb-5"),
|
|
3185
3185
|
[Ai]: n,
|
|
3186
|
-
style: { minHeight: r &&
|
|
3186
|
+
style: { minHeight: r && ae || void 0 },
|
|
3187
3187
|
children: [
|
|
3188
3188
|
t.userMessages.map((e, t) => o(e, t)),
|
|
3189
3189
|
t.thinking && t.thinking.titles.length > 0 ? /* @__PURE__ */ Z(xa, {
|
|
@@ -3191,7 +3191,7 @@ var Pa = {
|
|
|
3191
3191
|
title: O.ai.thoughtsGroupTitle,
|
|
3192
3192
|
inProgress: t.thinking.inProgress,
|
|
3193
3193
|
isWriting: t.thinking.isWriting,
|
|
3194
|
-
startedAt: r ?
|
|
3194
|
+
startedAt: r ? L : null
|
|
3195
3195
|
}) : null,
|
|
3196
3196
|
t.assistantMessages.map((e, t) => s(e, t)),
|
|
3197
3197
|
t.stopped ? /* @__PURE__ */ Z("p", {
|
|
@@ -3201,7 +3201,7 @@ var Pa = {
|
|
|
3201
3201
|
t.endIndicator === "thinking" ? /* @__PURE__ */ Z(Ee, {
|
|
3202
3202
|
title: O.ai.thinking,
|
|
3203
3203
|
status: "executing",
|
|
3204
|
-
suffix: /* @__PURE__ */ Z(ba, { startedAt:
|
|
3204
|
+
suffix: /* @__PURE__ */ Z(ba, { startedAt: L })
|
|
3205
3205
|
}) : null,
|
|
3206
3206
|
t.endIndicator === "activity" ? /* @__PURE__ */ Z(Ee, { status: "writing" }) : null,
|
|
3207
3207
|
t.endIndicator === "asking" ? /* @__PURE__ */ Z(Ee, {
|
|
@@ -3224,13 +3224,13 @@ var Pa = {
|
|
|
3224
3224
|
/* @__PURE__ */ Z("div", {
|
|
3225
3225
|
role: "status",
|
|
3226
3226
|
className: "sr-only",
|
|
3227
|
-
children:
|
|
3227
|
+
children: se ? O.ai.askingQuestions : ""
|
|
3228
3228
|
}),
|
|
3229
3229
|
/* @__PURE__ */ Z("div", {
|
|
3230
3230
|
ref: M,
|
|
3231
3231
|
className: i("flex-1 overflow-y-scroll [overflow-anchor:none]", "[scrollbar-width:thin] [scrollbar-color:transparent_transparent]", "hover:[scrollbar-color:var(--scrollbar-thumb)_transparent]", "[&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent", "[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-transparent", "hover:[&::-webkit-scrollbar-thumb]:bg-f1-background-inverse/30"),
|
|
3232
3232
|
children: /* @__PURE__ */ Q("div", {
|
|
3233
|
-
ref:
|
|
3233
|
+
ref: N,
|
|
3234
3234
|
className: "flex min-h-full flex-col items-center px-4 pb-[calc(1rem+var(--f0-ai-composer-overlap,0px))] pt-4",
|
|
3235
3235
|
children: [
|
|
3236
3236
|
/* @__PURE__ */ Q("div", {
|
|
@@ -3245,21 +3245,21 @@ var Pa = {
|
|
|
3245
3245
|
onClick: f,
|
|
3246
3246
|
fullscreen: x
|
|
3247
3247
|
}) : null,
|
|
3248
|
-
n ? null : e.map((e, t) =>
|
|
3248
|
+
n ? null : e.map((e, t) => z(e, t)),
|
|
3249
3249
|
r
|
|
3250
3250
|
]
|
|
3251
3251
|
}),
|
|
3252
3252
|
/* @__PURE__ */ Z("div", {
|
|
3253
|
-
ref:
|
|
3253
|
+
ref: F,
|
|
3254
3254
|
className: "h-px shrink-0",
|
|
3255
3255
|
"aria-hidden": !0
|
|
3256
3256
|
}),
|
|
3257
3257
|
/* @__PURE__ */ Z("footer", {
|
|
3258
3258
|
className: "copilotKitMessagesFooter",
|
|
3259
|
-
ref:
|
|
3259
|
+
ref: P,
|
|
3260
3260
|
children: S
|
|
3261
3261
|
}),
|
|
3262
|
-
/* @__PURE__ */ Z(o, { children:
|
|
3262
|
+
/* @__PURE__ */ Z(o, { children: ie ? /* @__PURE__ */ Z(c.div, {
|
|
3263
3263
|
className: "sticky bottom-[calc(0.5rem+var(--f0-ai-composer-overlap,0px))] z-10 flex justify-center",
|
|
3264
3264
|
initial: {
|
|
3265
3265
|
opacity: 0,
|
|
@@ -3275,7 +3275,7 @@ var Pa = {
|
|
|
3275
3275
|
},
|
|
3276
3276
|
transition: { duration: .2 },
|
|
3277
3277
|
children: /* @__PURE__ */ Z(u, {
|
|
3278
|
-
onClick: () =>
|
|
3278
|
+
onClick: () => oe(),
|
|
3279
3279
|
label: O.ai.scrollToBottom,
|
|
3280
3280
|
variant: "neutral",
|
|
3281
3281
|
icon: Ht,
|
|
@@ -3551,7 +3551,7 @@ var Xa = [
|
|
|
3551
3551
|
onClick: c,
|
|
3552
3552
|
label: l.actions.cancel,
|
|
3553
3553
|
hideLabel: !0,
|
|
3554
|
-
icon:
|
|
3554
|
+
icon: pe
|
|
3555
3555
|
})
|
|
3556
3556
|
]
|
|
3557
3557
|
});
|
|
@@ -3562,23 +3562,23 @@ var Xa = [
|
|
|
3562
3562
|
let r = t(), i = l(), { currentStep: a, currentStepIndex: s, totalSteps: u, toggleOption: d, confirm: f, skip: p, cancel: m, back: h, setCustomAnswerText: g, setCustomAnswerActive: _, activateCustomAnswer: v } = e, { question: y, options: b, selectedOptionIds: x, selectionMode: S, optional: C, allowCustomAnswer: w, customAnswerText: T, isCustomAnswerActive: E } = a, D = Y(null), ee = S ?? "single", te = u > 1, O = s === 0, ne = s === u - 1, k = te ? r.t("ai.clarifyingQuestion.stepOf", {
|
|
3563
3563
|
current: String(s + 1),
|
|
3564
3564
|
total: String(u)
|
|
3565
|
-
}) : void 0, A = x.length > 0, j = (T ?? "").trim().length > 0, M = A || E && j || C === !0,
|
|
3566
|
-
|
|
3567
|
-
},
|
|
3568
|
-
|
|
3569
|
-
},
|
|
3565
|
+
}) : void 0, A = x.length > 0, j = (T ?? "").trim().length > 0, M = A || E && j || C === !0, N = n === !0 && ne, P = () => {
|
|
3566
|
+
N || f();
|
|
3567
|
+
}, F = () => {
|
|
3568
|
+
N || p();
|
|
3569
|
+
}, re = (e) => {
|
|
3570
3570
|
let t = ee === "single" && x.includes(e);
|
|
3571
3571
|
d(e), ee === "single" && !ne && !t && Promise.resolve().then(f);
|
|
3572
|
-
},
|
|
3572
|
+
}, ie = ne ? r.ai.clarifyingQuestion.submit : r.ai.clarifyingQuestion.next, ae = C === !0 && !A && !(E && j), oe = () => {
|
|
3573
3573
|
v(), requestAnimationFrame(() => {
|
|
3574
3574
|
D.current?.focus();
|
|
3575
3575
|
});
|
|
3576
|
-
},
|
|
3576
|
+
}, I = (e) => {
|
|
3577
3577
|
e.key === "Escape" && (e.preventDefault(), m());
|
|
3578
|
-
},
|
|
3578
|
+
}, L = i ? 0 : ro, se = i ? 0 : io;
|
|
3579
3579
|
return /* @__PURE__ */ Q("div", {
|
|
3580
3580
|
className: "flex flex-col",
|
|
3581
|
-
onKeyDown:
|
|
3581
|
+
onKeyDown: I,
|
|
3582
3582
|
children: [/* @__PURE__ */ Z("div", {
|
|
3583
3583
|
className: "flex flex-col gap-3 pt-3",
|
|
3584
3584
|
children: /* @__PURE__ */ Z(o, {
|
|
@@ -3590,14 +3590,14 @@ var Xa = [
|
|
|
3590
3590
|
animate: {
|
|
3591
3591
|
opacity: 1,
|
|
3592
3592
|
transition: {
|
|
3593
|
-
duration:
|
|
3593
|
+
duration: L,
|
|
3594
3594
|
ease: no
|
|
3595
3595
|
}
|
|
3596
3596
|
},
|
|
3597
3597
|
exit: {
|
|
3598
3598
|
opacity: 0,
|
|
3599
3599
|
transition: {
|
|
3600
|
-
duration:
|
|
3600
|
+
duration: se,
|
|
3601
3601
|
ease: no
|
|
3602
3602
|
}
|
|
3603
3603
|
},
|
|
@@ -3622,21 +3622,21 @@ var Xa = [
|
|
|
3622
3622
|
isCustomAnswerActive: E,
|
|
3623
3623
|
canProceed: M,
|
|
3624
3624
|
customInputRef: D,
|
|
3625
|
-
onToggleOption:
|
|
3626
|
-
onActivateCustom:
|
|
3625
|
+
onToggleOption: re,
|
|
3626
|
+
onActivateCustom: oe,
|
|
3627
3627
|
onChangeCustomText: g,
|
|
3628
3628
|
onToggleCustomActive: _,
|
|
3629
|
-
onConfirm:
|
|
3629
|
+
onConfirm: P
|
|
3630
3630
|
})]
|
|
3631
3631
|
}, s)
|
|
3632
3632
|
})
|
|
3633
3633
|
}), /* @__PURE__ */ Z(Ga, {
|
|
3634
3634
|
canProceed: M,
|
|
3635
|
-
submitDisabled:
|
|
3636
|
-
label:
|
|
3637
|
-
onConfirm:
|
|
3638
|
-
onSkip:
|
|
3639
|
-
showSkip:
|
|
3635
|
+
submitDisabled: N,
|
|
3636
|
+
label: ie,
|
|
3637
|
+
onConfirm: P,
|
|
3638
|
+
onSkip: F,
|
|
3639
|
+
showSkip: ae
|
|
3640
3640
|
})]
|
|
3641
3641
|
});
|
|
3642
3642
|
};
|
|
@@ -4288,7 +4288,7 @@ function es({ fs: e, vs: t = Oo, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4288
4288
|
let t = e.getUniformLocation(g.current, Po);
|
|
4289
4289
|
e.uniform2fv(t, [e.canvas.width, e.canvas.height]);
|
|
4290
4290
|
}
|
|
4291
|
-
},
|
|
4291
|
+
}, N = (e, t) => {
|
|
4292
4292
|
let n = m.current;
|
|
4293
4293
|
if (!n) return null;
|
|
4294
4294
|
let r = n.createShader(e);
|
|
@@ -4299,12 +4299,12 @@ function es({ fs: e, vs: t = Oo, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4299
4299
|
n.deleteShader(r), d?.(Xo(`Shader compiler log: ${e}`));
|
|
4300
4300
|
}
|
|
4301
4301
|
return r;
|
|
4302
|
-
},
|
|
4302
|
+
}, P = (e, t) => {
|
|
4303
4303
|
let n = m.current;
|
|
4304
4304
|
if (!n) return;
|
|
4305
|
-
let r =
|
|
4305
|
+
let r = N(n.FRAGMENT_SHADER, e), i = N(n.VERTEX_SHADER, t);
|
|
4306
4306
|
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?.(Xo(`Unable to initialize the shader program: ${n.getProgramInfoLog(g.current)}`)));
|
|
4307
|
-
},
|
|
4307
|
+
}, F = () => {
|
|
4308
4308
|
if (r) for (let e of Object.keys(r)) {
|
|
4309
4309
|
let t = r[e];
|
|
4310
4310
|
if (!t) continue;
|
|
@@ -4318,7 +4318,7 @@ function es({ fs: e, vs: t = Oo, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4318
4318
|
...o ? { arraySize: o } : {}
|
|
4319
4319
|
};
|
|
4320
4320
|
}
|
|
4321
|
-
},
|
|
4321
|
+
}, re = () => {
|
|
4322
4322
|
let e = m.current;
|
|
4323
4323
|
if (e) {
|
|
4324
4324
|
if (n && n.length > 0) {
|
|
@@ -4339,7 +4339,7 @@ function es({ fs: e, vs: t = Oo, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4339
4339
|
});
|
|
4340
4340
|
} else u && u();
|
|
4341
4341
|
}
|
|
4342
|
-
},
|
|
4342
|
+
}, ie = (e) => {
|
|
4343
4343
|
let t = To.includes(a ?? "highp"), n = `precision ${t ? a : To[1]} float;\n`;
|
|
4344
4344
|
t || f?.(Xo(`wrong precision type ${a}, please make sure to pass one of a valid precision lowp, mediump, highp, by default you shader precision will be set to highp.`));
|
|
4345
4345
|
let r = n.concat(`#define DPR ${l.toFixed(1)}\n`).concat(e.replace(/texture\(/g, "texture2D("));
|
|
@@ -4349,7 +4349,7 @@ function es({ fs: e, vs: t = Oo, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4349
4349
|
r = $o(r, `uniform ${e.type} ${t}${e.arraySize || ""}; \n`, r.lastIndexOf(n) + n.length), e.isNeeded = !0;
|
|
4350
4350
|
}
|
|
4351
4351
|
return e.includes("mainImage") && (r = r.concat(Eo)), r;
|
|
4352
|
-
},
|
|
4352
|
+
}, ae = (e) => {
|
|
4353
4353
|
let t = m.current;
|
|
4354
4354
|
if (!t || !g.current) return;
|
|
4355
4355
|
let n = w.current ? (e - w.current) / 1e3 : 0;
|
|
@@ -4408,20 +4408,20 @@ function es({ fs: e, vs: t = Oo, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4408
4408
|
t.activeTexture(t.TEXTURE0 + e), t.bindTexture(t.TEXTURE_2D, i), t.uniform1i(s, e), r && n.updateTexture(i, a, o);
|
|
4409
4409
|
}
|
|
4410
4410
|
}
|
|
4411
|
-
},
|
|
4411
|
+
}, oe = (e) => {
|
|
4412
4412
|
let t = m.current;
|
|
4413
4413
|
if (!t) return;
|
|
4414
|
-
t.viewport(0, 0, t.drawingBufferWidth, t.drawingBufferHeight), t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT), t.bindBuffer(t.ARRAY_BUFFER, h.current), t.vertexAttribPointer(_.current ?? 0, 3, t.FLOAT, !1, 0, 0),
|
|
4414
|
+
t.viewport(0, 0, t.drawingBufferWidth, t.drawingBufferHeight), t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT), t.bindBuffer(t.ARRAY_BUFFER, h.current), t.vertexAttribPointer(_.current ?? 0, 3, t.FLOAT, !1, 0, 0), ae(e), t.drawArrays(t.TRIANGLE_STRIP, 0, 4);
|
|
4415
4415
|
let n = E.current.iMouse?.value;
|
|
4416
4416
|
if (E.current.iMouse?.isNeeded && c !== 1 && Array.isArray(n)) {
|
|
4417
4417
|
let e = n[0] ?? 0, t = n[1] ?? 0;
|
|
4418
4418
|
n[0] = Qo(e, S.current[0] ?? 0, c), n[1] = Qo(t, S.current[1] ?? 0, c);
|
|
4419
4419
|
}
|
|
4420
|
-
v.current = requestAnimationFrame(
|
|
4421
|
-
},
|
|
4420
|
+
v.current = requestAnimationFrame(oe);
|
|
4421
|
+
}, I = () => {
|
|
4422
4422
|
let e = { passive: !0 };
|
|
4423
4423
|
E.current.iMouse?.isNeeded && p.current && (p.current.addEventListener("mousemove", A, e), p.current.addEventListener("mouseout", j, e), p.current.addEventListener("mouseup", j, e), p.current.addEventListener("mousedown", k, e), p.current.addEventListener("touchmove", A, e), p.current.addEventListener("touchend", j, e), p.current.addEventListener("touchstart", k, e)), E.current.iDeviceOrientation?.isNeeded && window.addEventListener("deviceorientation", ne, e), p.current && (T.current = new ResizeObserver(M), T.current.observe(p.current), window.addEventListener("resize", M, e));
|
|
4424
|
-
},
|
|
4424
|
+
}, L = () => {
|
|
4425
4425
|
let e = { passive: !0 };
|
|
4426
4426
|
E.current.iMouse?.isNeeded && p.current && (p.current.removeEventListener("mousemove", A, e), p.current.removeEventListener("mouseout", j, e), p.current.removeEventListener("mouseup", j, e), p.current.removeEventListener("mousedown", k, e), p.current.removeEventListener("touchmove", A, e), p.current.removeEventListener("touchend", j, e), p.current.removeEventListener("touchstart", k, e)), E.current.iDeviceOrientation?.isNeeded && window.removeEventListener("deviceorientation", ne, e), T.current && (T.current.disconnect(), window.removeEventListener("resize", M, e));
|
|
4427
4427
|
};
|
|
@@ -4432,7 +4432,7 @@ function es({ fs: e, vs: t = Oo, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4432
4432
|
function r() {
|
|
4433
4433
|
te();
|
|
4434
4434
|
let n = m.current;
|
|
4435
|
-
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,
|
|
4435
|
+
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, F(), re(), P(ie(e || Do), t || Oo), O(), requestAnimationFrame(oe), I(), M());
|
|
4436
4436
|
}
|
|
4437
4437
|
return requestAnimationFrame(r), () => {
|
|
4438
4438
|
let e = m.current;
|
|
@@ -4440,7 +4440,7 @@ function es({ fs: e, vs: t = Oo, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4440
4440
|
if (e.getExtension("WEBGL_lose_context")?.loseContext(), e.useProgram(null), e.deleteProgram(g.current ?? null), n.length > 0) for (let t of n) e.deleteTexture(t._webglTexture);
|
|
4441
4441
|
g.current = null;
|
|
4442
4442
|
}
|
|
4443
|
-
|
|
4443
|
+
L(), cancelAnimationFrame(v.current ?? 0);
|
|
4444
4444
|
};
|
|
4445
4445
|
}, []), /* @__PURE__ */ Z("canvas", {
|
|
4446
4446
|
ref: p,
|
|
@@ -4623,7 +4623,7 @@ var os = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4623
4623
|
1
|
|
4624
4624
|
]
|
|
4625
4625
|
},
|
|
4626
|
-
children: /* @__PURE__ */ Z(
|
|
4626
|
+
children: /* @__PURE__ */ Z(re, {
|
|
4627
4627
|
size: "md",
|
|
4628
4628
|
label: a.ai.ask,
|
|
4629
4629
|
onClick: (e) => {
|
|
@@ -4779,7 +4779,7 @@ var ys = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4779
4779
|
stopOpacity: .02
|
|
4780
4780
|
})]
|
|
4781
4781
|
}) }),
|
|
4782
|
-
/* @__PURE__ */ Z(
|
|
4782
|
+
/* @__PURE__ */ Z(ye, {
|
|
4783
4783
|
hide: !0,
|
|
4784
4784
|
domain: ["dataMin - 1", "dataMax + 1"]
|
|
4785
4785
|
}),
|
|
@@ -4978,7 +4978,7 @@ var js = ({ icon: e, title: t, children: n }) => {
|
|
|
4978
4978
|
className: "h-4 w-4 transition-transform duration-200"
|
|
4979
4979
|
})
|
|
4980
4980
|
]
|
|
4981
|
-
}), /* @__PURE__ */ Z(
|
|
4981
|
+
}), /* @__PURE__ */ Z(se, {
|
|
4982
4982
|
forceMount: !0,
|
|
4983
4983
|
className: "data-[state=open]:mt-3",
|
|
4984
4984
|
children: /* @__PURE__ */ Z(c.div, {
|
|
@@ -5046,7 +5046,7 @@ Ps.displayName = "F0AiMessageSources";
|
|
|
5046
5046
|
//#endregion
|
|
5047
5047
|
//#region src/addons/ai/F0AiTableCard/F0AiTableCard.tsx
|
|
5048
5048
|
async function Fs(e, t, n) {
|
|
5049
|
-
let r = qe(e), i = t === "xlsx" ? await
|
|
5049
|
+
let r = qe(e), i = t === "xlsx" ? await F([{
|
|
5050
5050
|
name: "Data",
|
|
5051
5051
|
rows: r
|
|
5052
5052
|
}]) : await Ye(r);
|
|
@@ -5233,7 +5233,7 @@ function Ls({ credits: e, trigger: n }) {
|
|
|
5233
5233
|
variant: "outlinePromote",
|
|
5234
5234
|
href: e.upgradePlanUrl,
|
|
5235
5235
|
label: r.t("ai.credits.upgradePlan"),
|
|
5236
|
-
icon:
|
|
5236
|
+
icon: he
|
|
5237
5237
|
})]
|
|
5238
5238
|
}) : null]
|
|
5239
5239
|
})]
|
|
@@ -5386,13 +5386,13 @@ var Vs = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
5386
5386
|
variant: "ghost",
|
|
5387
5387
|
hideLabel: !0,
|
|
5388
5388
|
label: a ? x.ai.collapseChat : x.ai.expandChat,
|
|
5389
|
-
icon: a ?
|
|
5389
|
+
icon: a ? R : B,
|
|
5390
5390
|
onClick: f
|
|
5391
5391
|
}), T = /* @__PURE__ */ Z(u, {
|
|
5392
5392
|
variant: "ghost",
|
|
5393
5393
|
hideLabel: !0,
|
|
5394
5394
|
label: x.ai.closeChat,
|
|
5395
|
-
icon:
|
|
5395
|
+
icon: pe,
|
|
5396
5396
|
onClick: p
|
|
5397
5397
|
}), E = b?.map((e) => /* @__PURE__ */ Z(u, {
|
|
5398
5398
|
variant: "ghost",
|
|
@@ -5530,78 +5530,84 @@ function Ks(e) {
|
|
|
5530
5530
|
}
|
|
5531
5531
|
//#endregion
|
|
5532
5532
|
//#region src/addons/ai/F0AiChatHistory/components/ThreadItem.tsx
|
|
5533
|
-
function qs({ thread: e, isPinned: n, isActive: r = !1, isPending:
|
|
5534
|
-
let
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5533
|
+
function qs({ thread: e, isPinned: n, isActive: r = !1, isPending: a = !1, onSelect: o, onPin: c, onUnpin: l, onDelete: f, threadActions: p, className: m }) {
|
|
5534
|
+
let h = t(), g = $t(), _ = J(() => [
|
|
5535
|
+
{
|
|
5536
|
+
label: n ? h.ai.unpinChat : h.ai.pinChat,
|
|
5537
|
+
icon: n ? lt : rt,
|
|
5538
|
+
onClick: () => n ? l(e.id) : c(e.id)
|
|
5539
|
+
},
|
|
5540
|
+
...p?.(e) ?? [],
|
|
5541
|
+
{
|
|
5542
|
+
label: h.ai.deleteChat,
|
|
5543
|
+
icon: Ct,
|
|
5544
|
+
critical: !0,
|
|
5545
|
+
onClick: () => f(e.id)
|
|
5546
|
+
}
|
|
5547
|
+
], [
|
|
5544
5548
|
n,
|
|
5545
|
-
e
|
|
5549
|
+
e,
|
|
5546
5550
|
c,
|
|
5547
5551
|
l,
|
|
5548
|
-
f
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5552
|
+
f,
|
|
5553
|
+
p,
|
|
5554
|
+
h.ai.pinChat,
|
|
5555
|
+
h.ai.unpinChat,
|
|
5556
|
+
h.ai.deleteChat
|
|
5557
|
+
]), v = J(() => Gs(e.updatedAt, {
|
|
5558
|
+
today: h.ai.today,
|
|
5559
|
+
yesterday: h.ai.yesterday
|
|
5560
|
+
}, g), [
|
|
5553
5561
|
e.updatedAt,
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5562
|
+
h.ai.today,
|
|
5563
|
+
h.ai.yesterday,
|
|
5564
|
+
g
|
|
5557
5565
|
]);
|
|
5558
5566
|
return /* @__PURE__ */ Q("div", {
|
|
5559
|
-
className: i("group flex
|
|
5560
|
-
role: "button",
|
|
5561
|
-
tabIndex: 0,
|
|
5562
|
-
"aria-current": r ? "true" : void 0,
|
|
5563
|
-
onKeyDown: (t) => {
|
|
5564
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), s(e.id, e.title));
|
|
5565
|
-
},
|
|
5567
|
+
className: i("group flex items-center gap-1 rounded py-1.5 pl-3 pr-1.5 hover:bg-f1-background-hover", m, r && "bg-f1-background-secondary"),
|
|
5566
5568
|
children: [
|
|
5567
|
-
/* @__PURE__ */
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5569
|
+
/* @__PURE__ */ Z(s, {
|
|
5570
|
+
type: "button",
|
|
5571
|
+
variant: "unstyled",
|
|
5572
|
+
"aria-label": e.title,
|
|
5573
|
+
"aria-current": r ? "true" : void 0,
|
|
5574
|
+
className: "flex min-w-0 flex-1 cursor-pointer self-stretch",
|
|
5575
|
+
onClick: () => o(e.id, e.title),
|
|
5576
|
+
prepend: e.icon && /* @__PURE__ */ Z(G, {
|
|
5577
|
+
icon: e.icon,
|
|
5578
|
+
size: "sm",
|
|
5579
|
+
className: "mr-1 shrink-0 text-f1-icon",
|
|
5580
|
+
"aria-hidden": !0
|
|
5581
|
+
}),
|
|
5582
|
+
children: /* @__PURE__ */ Q("span", {
|
|
5583
|
+
className: "flex w-full min-w-0 items-center gap-1",
|
|
5584
|
+
children: [/* @__PURE__ */ Z(d, {
|
|
5578
5585
|
lines: 1,
|
|
5579
5586
|
className: "py-0.5 text-left font-medium",
|
|
5580
5587
|
children: e.title
|
|
5581
|
-
}),
|
|
5582
|
-
/* @__PURE__ */ Z("span", {
|
|
5588
|
+
}), /* @__PURE__ */ Z("span", {
|
|
5583
5589
|
className: "hidden shrink-0 text-sm font-medium text-f1-foreground-tertiary group-focus-within:inline group-hover:inline",
|
|
5584
|
-
children:
|
|
5585
|
-
})
|
|
5586
|
-
|
|
5590
|
+
children: v
|
|
5591
|
+
})]
|
|
5592
|
+
})
|
|
5587
5593
|
}),
|
|
5588
5594
|
e.trailingLabel ? /* @__PURE__ */ Z("span", {
|
|
5589
5595
|
className: "hidden shrink-0 pr-1 text-sm font-medium text-f1-foreground-tertiary group-focus-within:inline group-hover:inline",
|
|
5590
5596
|
children: e.trailingLabel
|
|
5591
5597
|
}) : null,
|
|
5592
|
-
|
|
5598
|
+
a ? /* @__PURE__ */ Z("div", {
|
|
5593
5599
|
className: "flex h-7 w-7 shrink-0 items-center justify-center",
|
|
5594
|
-
"aria-label":
|
|
5600
|
+
"aria-label": h.ai.threadOptions,
|
|
5595
5601
|
children: /* @__PURE__ */ Z(Jt, { size: "small" })
|
|
5596
5602
|
}) : /* @__PURE__ */ Z("div", {
|
|
5597
5603
|
className: i("hidden items-center", "group-hover:flex group-focus-within:flex", "has-[[aria-expanded=true]]:flex"),
|
|
5598
5604
|
children: /* @__PURE__ */ Z(bt, {
|
|
5599
|
-
items:
|
|
5605
|
+
items: _,
|
|
5600
5606
|
children: /* @__PURE__ */ Z(u, {
|
|
5601
5607
|
icon: sn,
|
|
5602
5608
|
variant: "ghost",
|
|
5603
5609
|
size: "sm",
|
|
5604
|
-
label:
|
|
5610
|
+
label: h.ai.threadOptions,
|
|
5605
5611
|
hideLabel: !0
|
|
5606
5612
|
})
|
|
5607
5613
|
})
|
|
@@ -5611,27 +5617,27 @@ function qs({ thread: e, isPinned: n, isActive: r = !1, isPending: o = !1, onSel
|
|
|
5611
5617
|
}
|
|
5612
5618
|
//#endregion
|
|
5613
5619
|
//#region src/addons/ai/F0AiChatHistory/components/CollapsibleGroup.tsx
|
|
5614
|
-
function Js({ label: e, threads: t, pinnedIds: n, onSelect: r, onPin: o, onUnpin: s, onDelete: c }) {
|
|
5615
|
-
let [
|
|
5616
|
-
|
|
5617
|
-
}, []),
|
|
5618
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
5619
|
-
}, [
|
|
5620
|
+
function Js({ label: e, threads: t, pinnedIds: n, onSelect: r, onPin: o, onUnpin: s, onDelete: c, threadActions: l }) {
|
|
5621
|
+
let [u, d] = X(!0), f = K(() => {
|
|
5622
|
+
d((e) => !e);
|
|
5623
|
+
}, []), p = K((e) => {
|
|
5624
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), f());
|
|
5625
|
+
}, [f]);
|
|
5620
5626
|
return /* @__PURE__ */ Q("div", { children: [/* @__PURE__ */ Q("div", {
|
|
5621
5627
|
role: "button",
|
|
5622
5628
|
tabIndex: 0,
|
|
5623
|
-
onClick:
|
|
5624
|
-
onKeyDown:
|
|
5629
|
+
onClick: f,
|
|
5630
|
+
onKeyDown: p,
|
|
5625
5631
|
className: i("flex cursor-pointer items-center p-3 gap-1 hover:bg-f1-background-hover", a("rounded")),
|
|
5626
5632
|
children: [/* @__PURE__ */ Z("span", {
|
|
5627
5633
|
className: "text-sm font-medium capitalize tracking-wide text-f1-foreground-secondary",
|
|
5628
5634
|
children: e
|
|
5629
5635
|
}), /* @__PURE__ */ Z(G, {
|
|
5630
|
-
icon:
|
|
5636
|
+
icon: u ? It : rn,
|
|
5631
5637
|
color: "secondary",
|
|
5632
5638
|
size: "xs"
|
|
5633
5639
|
})]
|
|
5634
|
-
}),
|
|
5640
|
+
}), u ? /* @__PURE__ */ Z("div", {
|
|
5635
5641
|
className: "flex flex-col",
|
|
5636
5642
|
children: t.map((e) => /* @__PURE__ */ Z(qs, {
|
|
5637
5643
|
thread: e,
|
|
@@ -5639,7 +5645,8 @@ function Js({ label: e, threads: t, pinnedIds: n, onSelect: r, onPin: o, onUnpin
|
|
|
5639
5645
|
onSelect: r,
|
|
5640
5646
|
onPin: o,
|
|
5641
5647
|
onUnpin: s,
|
|
5642
|
-
onDelete: c
|
|
5648
|
+
onDelete: c,
|
|
5649
|
+
threadActions: l
|
|
5643
5650
|
}, e.id))
|
|
5644
5651
|
}) : null] });
|
|
5645
5652
|
}
|
|
@@ -5677,35 +5684,35 @@ function Qs() {
|
|
|
5677
5684
|
}
|
|
5678
5685
|
//#endregion
|
|
5679
5686
|
//#region src/addons/ai/F0AiChatHistory/F0AiChatHistory.tsx
|
|
5680
|
-
var $s = ({ onClose: e, onSelectThread: n, onNewChat: r, threads: a, isLoading: o, error: c, pinnedIds: l, onPinThread: u, onUnpinThread: f, onDeleteThread: p }) => {
|
|
5681
|
-
let
|
|
5682
|
-
q(()
|
|
5687
|
+
var $s = ({ onClose: e, onSelectThread: n, onNewChat: r, threads: a, isLoading: o, error: c, pinnedIds: l, onPinThread: u, onUnpinThread: f, onDeleteThread: p, threadActions: m }) => {
|
|
5688
|
+
let h = t(), [g, _] = X("");
|
|
5689
|
+
q(function() {
|
|
5683
5690
|
let t = (t) => {
|
|
5684
|
-
t.key === "Escape" && e();
|
|
5691
|
+
t.key === "Escape" && !t.defaultPrevented && e();
|
|
5685
5692
|
};
|
|
5686
5693
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
5687
5694
|
}, [e]);
|
|
5688
|
-
let
|
|
5689
|
-
today:
|
|
5690
|
-
yesterday:
|
|
5691
|
-
thisMonth:
|
|
5692
|
-
older:
|
|
5695
|
+
let v = J(() => ({
|
|
5696
|
+
today: h.ai.today,
|
|
5697
|
+
yesterday: h.ai.yesterday,
|
|
5698
|
+
thisMonth: h.ai.thisMonth,
|
|
5699
|
+
older: h.ai.older
|
|
5693
5700
|
}), [
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
]),
|
|
5699
|
-
if (!
|
|
5700
|
-
let e =
|
|
5701
|
+
h.ai.today,
|
|
5702
|
+
h.ai.yesterday,
|
|
5703
|
+
h.ai.thisMonth,
|
|
5704
|
+
h.ai.older
|
|
5705
|
+
]), y = J(() => {
|
|
5706
|
+
if (!g.trim()) return a;
|
|
5707
|
+
let e = g.toLowerCase();
|
|
5701
5708
|
return a.filter((t) => t.title.toLowerCase().includes(e));
|
|
5702
|
-
}, [a,
|
|
5709
|
+
}, [a, g]), b = J(() => y.filter((e) => l.has(e.id)), [y, l]), x = J(() => y.filter((e) => !l.has(e.id)), [y, l]), S = J(() => Ks(x), [x]), C = K((t, r) => {
|
|
5703
5710
|
n(t, r), e();
|
|
5704
|
-
}, [n, e]),
|
|
5711
|
+
}, [n, e]), w = K(() => {
|
|
5705
5712
|
r(), e();
|
|
5706
|
-
}, [r, e]),
|
|
5713
|
+
}, [r, e]), T = K((e) => {
|
|
5707
5714
|
p(e);
|
|
5708
|
-
}, [p]),
|
|
5715
|
+
}, [p]), E = b.length > 0 || S.length > 0;
|
|
5709
5716
|
return wn(/* @__PURE__ */ Q(Cn, { children: [/* @__PURE__ */ Z("div", {
|
|
5710
5717
|
className: "fixed inset-0 z-50 bg-f1-background-overlay animate-in fade-in-0",
|
|
5711
5718
|
onClick: e,
|
|
@@ -5713,7 +5720,7 @@ var $s = ({ onClose: e, onSelectThread: n, onNewChat: r, threads: a, isLoading:
|
|
|
5713
5720
|
}), /* @__PURE__ */ Z("div", {
|
|
5714
5721
|
role: "dialog",
|
|
5715
5722
|
"aria-modal": "true",
|
|
5716
|
-
"aria-label":
|
|
5723
|
+
"aria-label": h.ai.chatHistory,
|
|
5717
5724
|
className: i("fixed inset-0 z-50 flex items-center justify-center", "pointer-events-none", "animate-in fade-in-0 zoom-in-95"),
|
|
5718
5725
|
children: /* @__PURE__ */ Q("div", {
|
|
5719
5726
|
className: i("pointer-events-auto relative flex w-full max-w-[600px] flex-col", "rounded-xl bg-f1-background shadow-lg", "max-h-[min(600px,80vh)]"),
|
|
@@ -5725,9 +5732,9 @@ var $s = ({ onClose: e, onSelectThread: n, onNewChat: r, threads: a, isLoading:
|
|
|
5725
5732
|
size: "md"
|
|
5726
5733
|
}), /* @__PURE__ */ Z("input", {
|
|
5727
5734
|
type: "text",
|
|
5728
|
-
value:
|
|
5729
|
-
onChange: (e) =>
|
|
5730
|
-
placeholder:
|
|
5735
|
+
value: g,
|
|
5736
|
+
onChange: (e) => _(e.target.value),
|
|
5737
|
+
placeholder: h.ai.searchChats,
|
|
5731
5738
|
className: i("w-full", "py-2.5 pr-3", "text-base text-f1-foreground-secondary placeholder:text-f1-foreground-tertiary focus:outline-none", "outline-none")
|
|
5732
5739
|
})]
|
|
5733
5740
|
}), /* @__PURE__ */ Q("div", {
|
|
@@ -5737,7 +5744,7 @@ var $s = ({ onClose: e, onSelectThread: n, onNewChat: r, threads: a, isLoading:
|
|
|
5737
5744
|
variant: "ghost",
|
|
5738
5745
|
size: "md",
|
|
5739
5746
|
className: "py-1 [&>div>span>span]:w-full",
|
|
5740
|
-
onClick:
|
|
5747
|
+
onClick: w,
|
|
5741
5748
|
children: /* @__PURE__ */ Q("div", {
|
|
5742
5749
|
className: "flex w-full items-center gap-2",
|
|
5743
5750
|
children: [/* @__PURE__ */ Z(G, {
|
|
@@ -5747,7 +5754,7 @@ var $s = ({ onClose: e, onSelectThread: n, onNewChat: r, threads: a, isLoading:
|
|
|
5747
5754
|
}), /* @__PURE__ */ Z(d, {
|
|
5748
5755
|
lines: 1,
|
|
5749
5756
|
className: "text-left",
|
|
5750
|
-
children:
|
|
5757
|
+
children: h.ai.startNewChat
|
|
5751
5758
|
})]
|
|
5752
5759
|
})
|
|
5753
5760
|
}),
|
|
@@ -5756,27 +5763,29 @@ var $s = ({ onClose: e, onSelectThread: n, onNewChat: r, threads: a, isLoading:
|
|
|
5756
5763
|
className: "py-8 text-center text-base text-f1-foreground-tertiary",
|
|
5757
5764
|
children: c
|
|
5758
5765
|
}) : null,
|
|
5759
|
-
!o && !c && !
|
|
5766
|
+
!o && !c && !E ? /* @__PURE__ */ Z("p", {
|
|
5760
5767
|
className: "py-8 text-center text-base text-f1-foreground-tertiary",
|
|
5761
|
-
children:
|
|
5768
|
+
children: h.ai.noPreviousChats
|
|
5762
5769
|
}) : null,
|
|
5763
|
-
!o && !c &&
|
|
5764
|
-
label:
|
|
5765
|
-
threads:
|
|
5770
|
+
!o && !c && b.length > 0 ? /* @__PURE__ */ Z(Js, {
|
|
5771
|
+
label: h.ai.pinnedChats,
|
|
5772
|
+
threads: b,
|
|
5766
5773
|
pinnedIds: l,
|
|
5767
|
-
onSelect:
|
|
5774
|
+
onSelect: C,
|
|
5768
5775
|
onPin: u,
|
|
5769
5776
|
onUnpin: f,
|
|
5770
|
-
onDelete:
|
|
5777
|
+
onDelete: T,
|
|
5778
|
+
threadActions: m
|
|
5771
5779
|
}) : null,
|
|
5772
|
-
!o && !c ?
|
|
5773
|
-
label:
|
|
5780
|
+
!o && !c ? S.map((e) => /* @__PURE__ */ Z(Js, {
|
|
5781
|
+
label: v[e.key],
|
|
5774
5782
|
threads: e.threads,
|
|
5775
5783
|
pinnedIds: l,
|
|
5776
|
-
onSelect:
|
|
5784
|
+
onSelect: C,
|
|
5777
5785
|
onPin: u,
|
|
5778
5786
|
onUnpin: f,
|
|
5779
|
-
onDelete:
|
|
5787
|
+
onDelete: T,
|
|
5788
|
+
threadActions: m
|
|
5780
5789
|
}, e.key)) : null
|
|
5781
5790
|
]
|
|
5782
5791
|
})]
|