@burtson-labs/bandit-engine 2.0.80 → 2.0.82
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/{chat-52DKSYA5.mjs → chat-WYUPU7KD.mjs} +2 -2
- package/dist/{chunk-VDVXUEP2.mjs → chunk-NB3N4BKW.mjs} +771 -636
- package/dist/chunk-NB3N4BKW.mjs.map +1 -0
- package/dist/{chunk-L2AKXXK3.mjs → chunk-ZMXWFP65.mjs} +2 -2
- package/dist/index.js +3569 -3428
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/management/management.js +1141 -1000
- package/dist/management/management.js.map +1 -1
- package/dist/management/management.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-VDVXUEP2.mjs.map +0 -1
- /package/dist/{chat-52DKSYA5.mjs.map → chat-WYUPU7KD.mjs.map} +0 -0
- /package/dist/{chunk-L2AKXXK3.mjs.map → chunk-ZMXWFP65.mjs.map} +0 -0
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
} from "./chunk-KCI46M23.mjs";
|
|
85
85
|
|
|
86
86
|
// src/chat/chat.tsx
|
|
87
|
-
import { useCallback as useCallback6, useEffect as useEffect15, useLayoutEffect, useMemo as
|
|
87
|
+
import { useCallback as useCallback6, useEffect as useEffect15, useLayoutEffect, useMemo as useMemo4, useRef as useRef13, useState as useState16 } from "react";
|
|
88
88
|
|
|
89
89
|
// src/chat/custom-logo.tsx
|
|
90
90
|
import React, { useEffect } from "react";
|
|
@@ -171,7 +171,7 @@ var Logo = ({ visible, atTop = false }) => {
|
|
|
171
171
|
var custom_logo_default = Logo;
|
|
172
172
|
|
|
173
173
|
// src/chat/chat.tsx
|
|
174
|
-
import { Box as
|
|
174
|
+
import { Box as Box16, ThemeProvider, CssBaseline, CircularProgress as CircularProgress4, Typography as Typography11 } from "@mui/material";
|
|
175
175
|
import { createTheme } from "@mui/material/styles";
|
|
176
176
|
import { Navigate } from "react-router-dom";
|
|
177
177
|
|
|
@@ -248,8 +248,122 @@ var BanditChatLogo = ({ atTop = false, visible = false }) => {
|
|
|
248
248
|
var bandit_chat_logo_default = BanditChatLogo;
|
|
249
249
|
|
|
250
250
|
// src/chat/chat-messages.tsx
|
|
251
|
-
import { Box as
|
|
251
|
+
import { Box as Box3 } from "@mui/material";
|
|
252
|
+
|
|
253
|
+
// src/chat/source-chips.tsx
|
|
254
|
+
import { useMemo, useState as useState2 } from "react";
|
|
255
|
+
import { Box as Box2, Tooltip } from "@mui/material";
|
|
252
256
|
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
257
|
+
var parseWebSources = (content) => {
|
|
258
|
+
if (!content) return [];
|
|
259
|
+
const idx = content.lastIndexOf("**Sources**");
|
|
260
|
+
if (idx === -1) return [];
|
|
261
|
+
const section = content.slice(idx);
|
|
262
|
+
const out = [];
|
|
263
|
+
const re = /^\s*[-*]\s*\[([^\]]+)\]\(([^)\s]+)\)/gm;
|
|
264
|
+
let m;
|
|
265
|
+
while ((m = re.exec(section)) !== null) {
|
|
266
|
+
const url = m[2].trim();
|
|
267
|
+
if (/^https?:\/\//i.test(url)) {
|
|
268
|
+
out.push({ title: m[1].trim(), url });
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
const seen = /* @__PURE__ */ new Set();
|
|
272
|
+
return out.filter((s) => seen.has(s.url) ? false : (seen.add(s.url), true));
|
|
273
|
+
};
|
|
274
|
+
var domainOf = (url) => {
|
|
275
|
+
try {
|
|
276
|
+
return new URL(url).hostname.replace(/^www\./, "");
|
|
277
|
+
} catch {
|
|
278
|
+
return url;
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
var SourceChip = ({ source }) => {
|
|
282
|
+
const [failed, setFailed] = useState2(false);
|
|
283
|
+
const domain = domainOf(source.url);
|
|
284
|
+
const label = source.title?.trim() || domain;
|
|
285
|
+
return /* @__PURE__ */ jsx4(Tooltip, { title: `${label} \xB7 ${domain}`, arrow: true, children: /* @__PURE__ */ jsxs(
|
|
286
|
+
Box2,
|
|
287
|
+
{
|
|
288
|
+
component: "a",
|
|
289
|
+
href: source.url,
|
|
290
|
+
target: "_blank",
|
|
291
|
+
rel: "noopener noreferrer",
|
|
292
|
+
sx: {
|
|
293
|
+
display: "inline-flex",
|
|
294
|
+
alignItems: "center",
|
|
295
|
+
gap: 0.75,
|
|
296
|
+
maxWidth: 240,
|
|
297
|
+
px: 1,
|
|
298
|
+
py: 0.4,
|
|
299
|
+
borderRadius: 999,
|
|
300
|
+
border: "1px solid",
|
|
301
|
+
borderColor: "divider",
|
|
302
|
+
bgcolor: "action.hover",
|
|
303
|
+
textDecoration: "none",
|
|
304
|
+
color: "text.primary",
|
|
305
|
+
fontSize: 12.5,
|
|
306
|
+
lineHeight: 1.4,
|
|
307
|
+
transition: "border-color 0.15s ease, background-color 0.15s ease",
|
|
308
|
+
"&:hover": { borderColor: "primary.main", bgcolor: "action.selected" }
|
|
309
|
+
},
|
|
310
|
+
children: [
|
|
311
|
+
failed ? /* @__PURE__ */ jsx4(
|
|
312
|
+
Box2,
|
|
313
|
+
{
|
|
314
|
+
sx: {
|
|
315
|
+
width: 16,
|
|
316
|
+
height: 16,
|
|
317
|
+
borderRadius: "4px",
|
|
318
|
+
bgcolor: "primary.main",
|
|
319
|
+
color: "primary.contrastText",
|
|
320
|
+
display: "grid",
|
|
321
|
+
placeItems: "center",
|
|
322
|
+
fontSize: 9,
|
|
323
|
+
fontWeight: 700,
|
|
324
|
+
flexShrink: 0
|
|
325
|
+
},
|
|
326
|
+
children: domain.charAt(0).toUpperCase()
|
|
327
|
+
}
|
|
328
|
+
) : /* @__PURE__ */ jsx4(
|
|
329
|
+
Box2,
|
|
330
|
+
{
|
|
331
|
+
component: "img",
|
|
332
|
+
src: `https://icons.duckduckgo.com/ip3/${domain}.ico`,
|
|
333
|
+
alt: "",
|
|
334
|
+
loading: "lazy",
|
|
335
|
+
onError: () => setFailed(true),
|
|
336
|
+
sx: { width: 16, height: 16, borderRadius: "4px", flexShrink: 0 }
|
|
337
|
+
}
|
|
338
|
+
),
|
|
339
|
+
/* @__PURE__ */ jsx4(
|
|
340
|
+
Box2,
|
|
341
|
+
{
|
|
342
|
+
component: "span",
|
|
343
|
+
sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
|
|
344
|
+
children: label
|
|
345
|
+
}
|
|
346
|
+
)
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
) });
|
|
350
|
+
};
|
|
351
|
+
var SourceChips = ({ content }) => {
|
|
352
|
+
const sources = useMemo(() => parseWebSources(content), [content]);
|
|
353
|
+
if (sources.length === 0) return null;
|
|
354
|
+
return /* @__PURE__ */ jsx4(
|
|
355
|
+
Box2,
|
|
356
|
+
{
|
|
357
|
+
sx: { display: "flex", flexWrap: "wrap", gap: 0.75, mt: 1.5 },
|
|
358
|
+
"aria-label": "Sources",
|
|
359
|
+
children: sources.map((s, i) => /* @__PURE__ */ jsx4(SourceChip, { source: s }, `${s.url}-${i}`))
|
|
360
|
+
}
|
|
361
|
+
);
|
|
362
|
+
};
|
|
363
|
+
var source_chips_default = SourceChips;
|
|
364
|
+
|
|
365
|
+
// src/chat/chat-messages.tsx
|
|
366
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
253
367
|
var ChatMessages = ({
|
|
254
368
|
pendingMessage,
|
|
255
369
|
streamBuffer,
|
|
@@ -269,7 +383,7 @@ var ChatMessages = ({
|
|
|
269
383
|
const lastIndex = history.length - 1;
|
|
270
384
|
const hasActivePlaceholder = lastIndex >= 0 && history[lastIndex]?.answer === "...";
|
|
271
385
|
if (!responseStarted && !pendingMessage && history.length === 0) return null;
|
|
272
|
-
return /* @__PURE__ */
|
|
386
|
+
return /* @__PURE__ */ jsxs2(Box3, { sx: { px: isMobile ? 0 : 0, pt: "100px", display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
273
387
|
history.map((entry, index) => {
|
|
274
388
|
const isLast = index === lastIndex;
|
|
275
389
|
const isPlaceholder = entry.answer === "...";
|
|
@@ -278,8 +392,8 @@ var ChatMessages = ({
|
|
|
278
392
|
const content = isLast ? isStreaming ? streamBuffer || "" : isPlaceholder ? "" : entry.answer : entry.answer;
|
|
279
393
|
const rawSources = entry.sourceFiles;
|
|
280
394
|
const sourceSummaries = rawSources ? rawSources.filter((doc) => doc && typeof doc.name === "string" && doc.name.trim()).map((doc) => ({ id: doc.id || doc.name, name: doc.name.trim() })) : void 0;
|
|
281
|
-
const responseNode = /* @__PURE__ */
|
|
282
|
-
|
|
395
|
+
const responseNode = /* @__PURE__ */ jsxs2(
|
|
396
|
+
Box3,
|
|
283
397
|
{
|
|
284
398
|
sx: {
|
|
285
399
|
minHeight: isLast ? isMobile ? "80px" : "60px" : void 0,
|
|
@@ -288,8 +402,8 @@ var ChatMessages = ({
|
|
|
288
402
|
transition: "min-height 0.25s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
289
403
|
},
|
|
290
404
|
children: [
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
|
|
405
|
+
/* @__PURE__ */ jsx5(
|
|
406
|
+
Box3,
|
|
293
407
|
{
|
|
294
408
|
sx: {
|
|
295
409
|
position: showLoader ? "static" : "absolute",
|
|
@@ -302,14 +416,14 @@ var ChatMessages = ({
|
|
|
302
416
|
pointerEvents: showLoader ? "auto" : "none",
|
|
303
417
|
zIndex: showLoader ? 1 : 0
|
|
304
418
|
},
|
|
305
|
-
children: /* @__PURE__ */
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
/* @__PURE__ */
|
|
419
|
+
children: /* @__PURE__ */ jsxs2(Box3, { sx: { display: "flex", alignItems: "center", gap: 1, minHeight: "40px", pl: 2 }, children: [
|
|
420
|
+
/* @__PURE__ */ jsxs2("div", { className: "typing-only", children: [
|
|
421
|
+
/* @__PURE__ */ jsx5("span", { className: "dot" }),
|
|
422
|
+
/* @__PURE__ */ jsx5("span", { className: "dot" }),
|
|
423
|
+
/* @__PURE__ */ jsx5("span", { className: "dot" })
|
|
310
424
|
] }),
|
|
311
|
-
showThinking && /* @__PURE__ */
|
|
312
|
-
|
|
425
|
+
showThinking && /* @__PURE__ */ jsx5(
|
|
426
|
+
Box3,
|
|
313
427
|
{
|
|
314
428
|
component: "span",
|
|
315
429
|
sx: {
|
|
@@ -325,8 +439,8 @@ var ChatMessages = ({
|
|
|
325
439
|
] })
|
|
326
440
|
}
|
|
327
441
|
),
|
|
328
|
-
/* @__PURE__ */
|
|
329
|
-
|
|
442
|
+
/* @__PURE__ */ jsxs2(
|
|
443
|
+
Box3,
|
|
330
444
|
{
|
|
331
445
|
sx: {
|
|
332
446
|
position: showLoader ? "absolute" : "static",
|
|
@@ -339,20 +453,23 @@ var ChatMessages = ({
|
|
|
339
453
|
pointerEvents: showLoader ? "none" : "auto",
|
|
340
454
|
zIndex: 1
|
|
341
455
|
},
|
|
342
|
-
children:
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
456
|
+
children: [
|
|
457
|
+
/* @__PURE__ */ jsx5(
|
|
458
|
+
StreamingMarkdown_default,
|
|
459
|
+
{
|
|
460
|
+
content,
|
|
461
|
+
isStreaming: isStreaming && isLast,
|
|
462
|
+
sources: sourceSummaries
|
|
463
|
+
}
|
|
464
|
+
),
|
|
465
|
+
/* @__PURE__ */ jsx5(source_chips_default, { content })
|
|
466
|
+
]
|
|
350
467
|
}
|
|
351
468
|
)
|
|
352
469
|
]
|
|
353
470
|
}
|
|
354
471
|
);
|
|
355
|
-
return /* @__PURE__ */
|
|
472
|
+
return /* @__PURE__ */ jsx5(Box3, { children: /* @__PURE__ */ jsx5(
|
|
356
473
|
ai_response_text_field_default,
|
|
357
474
|
{
|
|
358
475
|
question: entry.question,
|
|
@@ -367,17 +484,17 @@ var ChatMessages = ({
|
|
|
367
484
|
}
|
|
368
485
|
) }, index);
|
|
369
486
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ jsx5("div", { style: { height: "1px" }, ref: scrollTargetRef })
|
|
371
488
|
] });
|
|
372
489
|
};
|
|
373
490
|
var chat_messages_default = ChatMessages;
|
|
374
491
|
|
|
375
492
|
// src/chat/chat-input.tsx
|
|
376
|
-
import { useEffect as useEffect3, useRef as useRef2, useState as
|
|
377
|
-
import { Box as
|
|
493
|
+
import { useEffect as useEffect3, useRef as useRef2, useState as useState4 } from "react";
|
|
494
|
+
import { Box as Box4, TextField, IconButton as IconButton3, Tooltip as Tooltip2, Avatar as Avatar2, Typography, CircularProgress as CircularProgress2, Collapse } from "@mui/material";
|
|
378
495
|
|
|
379
496
|
// src/services/stt/transcriber.tsx
|
|
380
|
-
import { useState as
|
|
497
|
+
import { useState as useState3, useRef } from "react";
|
|
381
498
|
|
|
382
499
|
// src/services/stt/sound-recorder.service.ts
|
|
383
500
|
import { first, from, fromEvent, map, shareReplay, switchMap } from "rxjs";
|
|
@@ -523,7 +640,7 @@ var STTClient = class {
|
|
|
523
640
|
// src/services/stt/transcriber.tsx
|
|
524
641
|
import { CircularProgress, IconButton as IconButton2, useTheme as useTheme3 } from "@mui/material";
|
|
525
642
|
import { from as from2, Subscription, switchMap as switchMap2 } from "rxjs";
|
|
526
|
-
import { Fragment as Fragment2, jsx as
|
|
643
|
+
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
527
644
|
var initialButtonStyles = (badgeBackground, fileText, hoverBadgeBackground) => ({
|
|
528
645
|
bgcolor: badgeBackground,
|
|
529
646
|
color: fileText,
|
|
@@ -537,10 +654,10 @@ var Transcriber = ({ onTranscriptionCompleted }) => {
|
|
|
537
654
|
const badgeBackground = theme.palette.chat.badge;
|
|
538
655
|
const fileText = theme.palette.chat.fileText;
|
|
539
656
|
const hoverBadgeBackground = theme.palette.chat.badgeHover;
|
|
540
|
-
const [status, setStatus] =
|
|
657
|
+
const [status, setStatus] = useState3("IDLE");
|
|
541
658
|
const recorderRef = useRef(new SoundRecorderService());
|
|
542
|
-
const [iconButtonStyles] =
|
|
543
|
-
const [recordingSub, setRecordingSub] =
|
|
659
|
+
const [iconButtonStyles] = useState3(() => initialButtonStyles(badgeBackground, fileText, hoverBadgeBackground));
|
|
660
|
+
const [recordingSub, setRecordingSub] = useState3(() => new Subscription());
|
|
544
661
|
const start = () => {
|
|
545
662
|
recordingSub.unsubscribe();
|
|
546
663
|
const recording = recorderRef.current.start();
|
|
@@ -571,7 +688,7 @@ var Transcriber = ({ onTranscriptionCompleted }) => {
|
|
|
571
688
|
setStatus("LOADING");
|
|
572
689
|
stop();
|
|
573
690
|
};
|
|
574
|
-
return /* @__PURE__ */
|
|
691
|
+
return /* @__PURE__ */ jsx6(
|
|
575
692
|
"div",
|
|
576
693
|
{
|
|
577
694
|
style: {
|
|
@@ -581,16 +698,16 @@ var Transcriber = ({ onTranscriptionCompleted }) => {
|
|
|
581
698
|
backgroundColor: status === "RECORDING" ? "rgba(0,0,0,.3)" : "rgba(0,0,0,0)",
|
|
582
699
|
borderRadius: "50px"
|
|
583
700
|
},
|
|
584
|
-
children: status === "IDLE" ? /* @__PURE__ */
|
|
585
|
-
/* @__PURE__ */
|
|
701
|
+
children: status === "IDLE" ? /* @__PURE__ */ jsx6(IconButton2, { sx: { ...iconButtonStyles }, onClick: handleRecordClick, children: /* @__PURE__ */ jsx6(MicIcon, { sx: { color: "#aaa", cursor: "pointer" } }) }) : status === "RECORDING" ? /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
702
|
+
/* @__PURE__ */ jsx6(
|
|
586
703
|
IconButton2,
|
|
587
704
|
{
|
|
588
705
|
onClick: handleCancelClick,
|
|
589
706
|
sx: { ...iconButtonStyles, marginRight: 1 },
|
|
590
|
-
children: /* @__PURE__ */
|
|
707
|
+
children: /* @__PURE__ */ jsx6(CloseIcon, {})
|
|
591
708
|
}
|
|
592
709
|
),
|
|
593
|
-
/* @__PURE__ */
|
|
710
|
+
/* @__PURE__ */ jsx6(
|
|
594
711
|
IconButton2,
|
|
595
712
|
{
|
|
596
713
|
sx: {
|
|
@@ -598,10 +715,10 @@ var Transcriber = ({ onTranscriptionCompleted }) => {
|
|
|
598
715
|
filter: "invert(110%)"
|
|
599
716
|
},
|
|
600
717
|
onClick: handleSubmitClick,
|
|
601
|
-
children: /* @__PURE__ */
|
|
718
|
+
children: /* @__PURE__ */ jsx6(CheckIcon, {})
|
|
602
719
|
}
|
|
603
720
|
)
|
|
604
|
-
] }) : status === "LOADING" ? /* @__PURE__ */
|
|
721
|
+
] }) : status === "LOADING" ? /* @__PURE__ */ jsx6(IconButton2, { sx: { ...iconButtonStyles }, children: /* @__PURE__ */ jsx6(CircularProgress, { size: 20 }) }) : null
|
|
605
722
|
}
|
|
606
723
|
);
|
|
607
724
|
};
|
|
@@ -647,7 +764,7 @@ var useVoiceModeStore = create((set) => ({
|
|
|
647
764
|
|
|
648
765
|
// src/chat/chat-input.tsx
|
|
649
766
|
import { shallow } from "zustand/shallow";
|
|
650
|
-
import { Fragment as Fragment3, jsx as
|
|
767
|
+
import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
651
768
|
var ChatInput = (props) => {
|
|
652
769
|
const {
|
|
653
770
|
inputValue,
|
|
@@ -690,13 +807,13 @@ var ChatInput = (props) => {
|
|
|
690
807
|
}),
|
|
691
808
|
shallow
|
|
692
809
|
);
|
|
693
|
-
const [memoryOpen, setMemoryOpen] =
|
|
694
|
-
const [fileInputs, setFileInputs] =
|
|
810
|
+
const [memoryOpen, setMemoryOpen] = useState4(false);
|
|
811
|
+
const [fileInputs, setFileInputs] = useState4([]);
|
|
695
812
|
const fileInputRef = useRef2(null);
|
|
696
|
-
const [brandingText, setBrandingText] =
|
|
697
|
-
const [feedbackModalOpen, setFeedbackModalOpen] =
|
|
698
|
-
const [isKeyboardOpen, setKeyboardOpen] =
|
|
699
|
-
const [moreActionsOpen, setMoreActionsOpen] =
|
|
813
|
+
const [brandingText, setBrandingText] = useState4("");
|
|
814
|
+
const [feedbackModalOpen, setFeedbackModalOpen] = useState4(false);
|
|
815
|
+
const [isKeyboardOpen, setKeyboardOpen] = useState4(false);
|
|
816
|
+
const [moreActionsOpen, setMoreActionsOpen] = useState4(false);
|
|
700
817
|
const compactMobile = isMobile;
|
|
701
818
|
const primaryIconSize = isMobile ? 32 : 40;
|
|
702
819
|
const sendIconSize = isMobile ? 36 : 44;
|
|
@@ -944,7 +1061,7 @@ ${sanitize(
|
|
|
944
1061
|
}, [isMobile, hasSecondaryActions]);
|
|
945
1062
|
const renderAttachmentButton = (key) => {
|
|
946
1063
|
if (!hasAttachmentAction) return null;
|
|
947
|
-
return /* @__PURE__ */
|
|
1064
|
+
return /* @__PURE__ */ jsx7(Tooltip2, { title: "Attach files or images", children: /* @__PURE__ */ jsx7(
|
|
948
1065
|
IconButton3,
|
|
949
1066
|
{
|
|
950
1067
|
onClick: () => fileInputRef.current?.click(),
|
|
@@ -962,7 +1079,7 @@ ${sanitize(
|
|
|
962
1079
|
};
|
|
963
1080
|
const renderMemoryButton = (key) => {
|
|
964
1081
|
if (!hasMemoryAction) return null;
|
|
965
|
-
return /* @__PURE__ */
|
|
1082
|
+
return /* @__PURE__ */ jsx7(Tooltip2, { title: "Memory", children: /* @__PURE__ */ jsx7(
|
|
966
1083
|
IconButton3,
|
|
967
1084
|
{
|
|
968
1085
|
onClick: () => setMemoryOpen(true),
|
|
@@ -974,13 +1091,13 @@ ${sanitize(
|
|
|
974
1091
|
borderRadius: "50%",
|
|
975
1092
|
"&:hover": { bgcolor: hoverBadgeBackground }
|
|
976
1093
|
},
|
|
977
|
-
children: /* @__PURE__ */
|
|
1094
|
+
children: /* @__PURE__ */ jsx7(PsychologyIcon, { fontSize: "small" })
|
|
978
1095
|
}
|
|
979
1096
|
) }, key ?? "memory");
|
|
980
1097
|
};
|
|
981
1098
|
const renderFeedbackButton = (key) => {
|
|
982
1099
|
if (!hasFeedbackAction) return null;
|
|
983
|
-
return /* @__PURE__ */
|
|
1100
|
+
return /* @__PURE__ */ jsx7(Tooltip2, { title: "Send Feedback", children: /* @__PURE__ */ jsx7(
|
|
984
1101
|
IconButton3,
|
|
985
1102
|
{
|
|
986
1103
|
onClick: () => setFeedbackModalOpen(true),
|
|
@@ -992,17 +1109,17 @@ ${sanitize(
|
|
|
992
1109
|
borderRadius: "50%",
|
|
993
1110
|
"&:hover": { bgcolor: hoverBadgeBackground }
|
|
994
1111
|
},
|
|
995
|
-
children: /* @__PURE__ */
|
|
1112
|
+
children: /* @__PURE__ */ jsx7(FeedbackIcon, { fontSize: "small" })
|
|
996
1113
|
}
|
|
997
1114
|
) }, key ?? "feedback");
|
|
998
1115
|
};
|
|
999
1116
|
const renderSttButton = (key) => {
|
|
1000
1117
|
if (!hasSttAction) return null;
|
|
1001
|
-
return /* @__PURE__ */
|
|
1118
|
+
return /* @__PURE__ */ jsx7(Box4, { sx: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx7(transcriber_default, { onTranscriptionCompleted: handleTranscriptionCompleted }) }, key ?? "stt");
|
|
1002
1119
|
};
|
|
1003
|
-
return /* @__PURE__ */
|
|
1004
|
-
/* @__PURE__ */
|
|
1005
|
-
|
|
1120
|
+
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
1121
|
+
/* @__PURE__ */ jsxs4(
|
|
1122
|
+
Box4,
|
|
1006
1123
|
{
|
|
1007
1124
|
sx: {
|
|
1008
1125
|
width: "100%",
|
|
@@ -1021,8 +1138,8 @@ ${sanitize(
|
|
|
1021
1138
|
},
|
|
1022
1139
|
ref: inputContainerRef,
|
|
1023
1140
|
children: [
|
|
1024
|
-
/* @__PURE__ */
|
|
1025
|
-
|
|
1141
|
+
/* @__PURE__ */ jsxs4(
|
|
1142
|
+
Box4,
|
|
1026
1143
|
{
|
|
1027
1144
|
sx: {
|
|
1028
1145
|
width: "100%",
|
|
@@ -1037,8 +1154,8 @@ ${sanitize(
|
|
|
1037
1154
|
gap: isMobile ? compactMobile ? 0.75 : 1 : 1
|
|
1038
1155
|
},
|
|
1039
1156
|
children: [
|
|
1040
|
-
/* @__PURE__ */
|
|
1041
|
-
|
|
1157
|
+
/* @__PURE__ */ jsxs4(
|
|
1158
|
+
Box4,
|
|
1042
1159
|
{
|
|
1043
1160
|
sx: {
|
|
1044
1161
|
display: "flex",
|
|
@@ -1048,8 +1165,8 @@ ${sanitize(
|
|
|
1048
1165
|
flexDirection: "row"
|
|
1049
1166
|
},
|
|
1050
1167
|
children: [
|
|
1051
|
-
fileInputs.map((file, idx) => /* @__PURE__ */
|
|
1052
|
-
|
|
1168
|
+
fileInputs.map((file, idx) => /* @__PURE__ */ jsxs4(
|
|
1169
|
+
Box4,
|
|
1053
1170
|
{
|
|
1054
1171
|
sx: {
|
|
1055
1172
|
position: "relative",
|
|
@@ -1062,7 +1179,7 @@ ${sanitize(
|
|
|
1062
1179
|
gap: isMobile ? compactMobile ? 0.6 : 0.9 : 1
|
|
1063
1180
|
},
|
|
1064
1181
|
children: [
|
|
1065
|
-
/* @__PURE__ */
|
|
1182
|
+
/* @__PURE__ */ jsx7(
|
|
1066
1183
|
Avatar2,
|
|
1067
1184
|
{
|
|
1068
1185
|
sx: {
|
|
@@ -1076,22 +1193,22 @@ ${sanitize(
|
|
|
1076
1193
|
children: getFileIcon(file.name)
|
|
1077
1194
|
}
|
|
1078
1195
|
),
|
|
1079
|
-
/* @__PURE__ */
|
|
1080
|
-
/* @__PURE__ */
|
|
1196
|
+
/* @__PURE__ */ jsx7(Typography, { variant: "caption", sx: { color: fileText }, children: file.name }),
|
|
1197
|
+
/* @__PURE__ */ jsx7(
|
|
1081
1198
|
IconButton3,
|
|
1082
1199
|
{
|
|
1083
1200
|
size: "small",
|
|
1084
1201
|
onClick: () => setFileInputs((prev) => prev.filter((_, i) => i !== idx)),
|
|
1085
1202
|
sx: { ml: 0.5, color: theme.palette.mode === "dark" ? "#aaa" : "#444" },
|
|
1086
|
-
children: /* @__PURE__ */
|
|
1203
|
+
children: /* @__PURE__ */ jsx7(CloseIcon, { sx: { fontSize: 14 } })
|
|
1087
1204
|
}
|
|
1088
1205
|
)
|
|
1089
1206
|
]
|
|
1090
1207
|
},
|
|
1091
1208
|
idx
|
|
1092
1209
|
)),
|
|
1093
|
-
pastedImages.map((img, idx) => /* @__PURE__ */
|
|
1094
|
-
/* @__PURE__ */
|
|
1210
|
+
pastedImages.map((img, idx) => /* @__PURE__ */ jsxs4(Box4, { sx: { position: "relative" }, children: [
|
|
1211
|
+
/* @__PURE__ */ jsx7(
|
|
1095
1212
|
Avatar2,
|
|
1096
1213
|
{
|
|
1097
1214
|
src: img,
|
|
@@ -1103,7 +1220,7 @@ ${sanitize(
|
|
|
1103
1220
|
}
|
|
1104
1221
|
}
|
|
1105
1222
|
),
|
|
1106
|
-
/* @__PURE__ */
|
|
1223
|
+
/* @__PURE__ */ jsx7(
|
|
1107
1224
|
IconButton3,
|
|
1108
1225
|
{
|
|
1109
1226
|
size: "small",
|
|
@@ -1120,7 +1237,7 @@ ${sanitize(
|
|
|
1120
1237
|
bgcolor: "rgba(255, 5, 5, 0.85)"
|
|
1121
1238
|
}
|
|
1122
1239
|
},
|
|
1123
|
-
children: /* @__PURE__ */
|
|
1240
|
+
children: /* @__PURE__ */ jsx7(
|
|
1124
1241
|
CloseIcon,
|
|
1125
1242
|
{
|
|
1126
1243
|
sx: {
|
|
@@ -1132,7 +1249,7 @@ ${sanitize(
|
|
|
1132
1249
|
}
|
|
1133
1250
|
)
|
|
1134
1251
|
] }, `img-${idx}`)),
|
|
1135
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ jsx7(
|
|
1136
1253
|
"input",
|
|
1137
1254
|
{
|
|
1138
1255
|
type: "file",
|
|
@@ -1169,15 +1286,15 @@ ${sanitize(
|
|
|
1169
1286
|
]
|
|
1170
1287
|
}
|
|
1171
1288
|
),
|
|
1172
|
-
/* @__PURE__ */
|
|
1173
|
-
|
|
1289
|
+
/* @__PURE__ */ jsx7(
|
|
1290
|
+
Box4,
|
|
1174
1291
|
{
|
|
1175
1292
|
sx: {
|
|
1176
1293
|
display: "flex",
|
|
1177
1294
|
maxHeight: "200px",
|
|
1178
1295
|
overflowY: "auto"
|
|
1179
1296
|
},
|
|
1180
|
-
children: /* @__PURE__ */
|
|
1297
|
+
children: /* @__PURE__ */ jsx7(
|
|
1181
1298
|
TextField,
|
|
1182
1299
|
{
|
|
1183
1300
|
fullWidth: true,
|
|
@@ -1209,8 +1326,8 @@ ${sanitize(
|
|
|
1209
1326
|
)
|
|
1210
1327
|
}
|
|
1211
1328
|
),
|
|
1212
|
-
/* @__PURE__ */
|
|
1213
|
-
|
|
1329
|
+
/* @__PURE__ */ jsxs4(
|
|
1330
|
+
Box4,
|
|
1214
1331
|
{
|
|
1215
1332
|
sx: {
|
|
1216
1333
|
display: "flex",
|
|
@@ -1220,8 +1337,8 @@ ${sanitize(
|
|
|
1220
1337
|
mt: isMobile ? 0.5 : 1
|
|
1221
1338
|
},
|
|
1222
1339
|
children: [
|
|
1223
|
-
/* @__PURE__ */
|
|
1224
|
-
|
|
1340
|
+
/* @__PURE__ */ jsxs4(
|
|
1341
|
+
Box4,
|
|
1225
1342
|
{
|
|
1226
1343
|
sx: {
|
|
1227
1344
|
display: "flex",
|
|
@@ -1230,12 +1347,12 @@ ${sanitize(
|
|
|
1230
1347
|
minHeight: primaryIconSize
|
|
1231
1348
|
},
|
|
1232
1349
|
children: [
|
|
1233
|
-
isVoiceModeEligible && /* @__PURE__ */
|
|
1234
|
-
/* @__PURE__ */
|
|
1235
|
-
|
|
1350
|
+
isVoiceModeEligible && /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
1351
|
+
/* @__PURE__ */ jsx7(
|
|
1352
|
+
Tooltip2,
|
|
1236
1353
|
{
|
|
1237
1354
|
title: !isVoiceModeEnabled ? "Enable voice mode" : voiceStatus === "error" ? voiceError || "Voice mode error" : voiceStatus === "processing" ? "Transcribing your speech" : voiceStatus === "recording" ? "Recording - click to stop" : voiceStatus === "initializing" ? "Preparing microphone" : "Listening - click to turn off",
|
|
1238
|
-
children: /* @__PURE__ */
|
|
1355
|
+
children: /* @__PURE__ */ jsx7(
|
|
1239
1356
|
IconButton3,
|
|
1240
1357
|
{
|
|
1241
1358
|
onClick: toggleVoiceMode,
|
|
@@ -1252,12 +1369,12 @@ ${sanitize(
|
|
|
1252
1369
|
bgcolor: isVoiceModeEnabled ? alpha(theme.palette.error.main, theme.palette.mode === "dark" ? 0.55 : 0.38) : hoverBadgeBackground
|
|
1253
1370
|
}
|
|
1254
1371
|
},
|
|
1255
|
-
children: !isVoiceModeEnabled ? /* @__PURE__ */
|
|
1372
|
+
children: !isVoiceModeEnabled ? /* @__PURE__ */ jsx7(GraphicEqIcon, { fontSize: "small", sx: { color: theme.palette.mode === "dark" ? fileText : theme.palette.text.secondary } }) : voiceStatus === "processing" || voiceStatus === "initializing" ? /* @__PURE__ */ jsx7(CircularProgress2, { size: 18, sx: { color: fileText } }) : voiceStatus === "error" ? /* @__PURE__ */ jsx7(HearingDisabledIcon, { fontSize: "small", sx: { color: theme.palette.error.light } }) : voiceStatus === "recording" ? /* @__PURE__ */ jsx7(GraphicEqIcon, { fontSize: "small", sx: { color: theme.palette.error.light } }) : /* @__PURE__ */ jsx7(GraphicEqIcon, { fontSize: "small", sx: { color: theme.palette.common.white } })
|
|
1256
1373
|
}
|
|
1257
1374
|
)
|
|
1258
1375
|
}
|
|
1259
1376
|
),
|
|
1260
|
-
!isMobile && isVoiceModeEnabled && /* @__PURE__ */
|
|
1377
|
+
!isMobile && isVoiceModeEnabled && /* @__PURE__ */ jsx7(
|
|
1261
1378
|
Typography,
|
|
1262
1379
|
{
|
|
1263
1380
|
variant: "caption",
|
|
@@ -1275,7 +1392,7 @@ ${sanitize(
|
|
|
1275
1392
|
!isMobile && renderAttachmentButton("attach-inline"),
|
|
1276
1393
|
!isMobile && renderMemoryButton("memory-inline"),
|
|
1277
1394
|
!isMobile && renderSttButton("stt-inline"),
|
|
1278
|
-
isMobile && hasSecondaryActions && /* @__PURE__ */
|
|
1395
|
+
isMobile && hasSecondaryActions && /* @__PURE__ */ jsx7(
|
|
1279
1396
|
IconButton3,
|
|
1280
1397
|
{
|
|
1281
1398
|
onClick: () => setMoreActionsOpen((prev) => !prev),
|
|
@@ -1288,7 +1405,7 @@ ${sanitize(
|
|
|
1288
1405
|
transition: "background-color 0.2s ease",
|
|
1289
1406
|
"&:hover": { bgcolor: hoverBadgeBackground }
|
|
1290
1407
|
},
|
|
1291
|
-
children: /* @__PURE__ */
|
|
1408
|
+
children: /* @__PURE__ */ jsx7(
|
|
1292
1409
|
ExpandMoreIcon,
|
|
1293
1410
|
{
|
|
1294
1411
|
fontSize: "small",
|
|
@@ -1303,7 +1420,7 @@ ${sanitize(
|
|
|
1303
1420
|
]
|
|
1304
1421
|
}
|
|
1305
1422
|
),
|
|
1306
|
-
/* @__PURE__ */
|
|
1423
|
+
/* @__PURE__ */ jsx7(Box4, { sx: { display: "flex", alignItems: "center", gap: isMobile ? 0.6 : 1 }, children: /* @__PURE__ */ jsx7(Tooltip2, { title: isStreaming ? "Stop response" : "Send message", children: /* @__PURE__ */ jsx7("span", { children: /* @__PURE__ */ jsx7(
|
|
1307
1424
|
IconButton3,
|
|
1308
1425
|
{
|
|
1309
1426
|
onClick: isStreaming ? onStop || (() => {
|
|
@@ -1320,14 +1437,14 @@ ${sanitize(
|
|
|
1320
1437
|
"&:hover": { bgcolor: sendButtonHover },
|
|
1321
1438
|
"&.Mui-disabled": { opacity: 0.5 }
|
|
1322
1439
|
},
|
|
1323
|
-
children: isStreaming ? /* @__PURE__ */
|
|
1440
|
+
children: isStreaming ? /* @__PURE__ */ jsx7(CloseIcon, { fontSize: "small" }) : /* @__PURE__ */ jsx7(ArrowUpwardIcon, { fontSize: "small" })
|
|
1324
1441
|
}
|
|
1325
1442
|
) }) }) })
|
|
1326
1443
|
]
|
|
1327
1444
|
}
|
|
1328
1445
|
),
|
|
1329
|
-
isMobile && hasSecondaryActions && /* @__PURE__ */
|
|
1330
|
-
|
|
1446
|
+
isMobile && hasSecondaryActions && /* @__PURE__ */ jsx7(Collapse, { in: moreActionsOpen, unmountOnExit: true, children: /* @__PURE__ */ jsxs4(
|
|
1447
|
+
Box4,
|
|
1331
1448
|
{
|
|
1332
1449
|
sx: {
|
|
1333
1450
|
display: "flex",
|
|
@@ -1348,7 +1465,7 @@ ${sanitize(
|
|
|
1348
1465
|
]
|
|
1349
1466
|
}
|
|
1350
1467
|
),
|
|
1351
|
-
/* @__PURE__ */
|
|
1468
|
+
/* @__PURE__ */ jsxs4(
|
|
1352
1469
|
Typography,
|
|
1353
1470
|
{
|
|
1354
1471
|
variant: "caption",
|
|
@@ -1374,8 +1491,8 @@ ${sanitize(
|
|
|
1374
1491
|
]
|
|
1375
1492
|
}
|
|
1376
1493
|
),
|
|
1377
|
-
isMemoryEnabled && /* @__PURE__ */
|
|
1378
|
-
isFeedbackEnabled && /* @__PURE__ */
|
|
1494
|
+
isMemoryEnabled && /* @__PURE__ */ jsx7(memory_modal_default, { open: memoryOpen, onClose: () => setMemoryOpen(false) }),
|
|
1495
|
+
isFeedbackEnabled && /* @__PURE__ */ jsx7(
|
|
1379
1496
|
FeedbackModal,
|
|
1380
1497
|
{
|
|
1381
1498
|
open: feedbackModalOpen,
|
|
@@ -1388,8 +1505,8 @@ ${sanitize(
|
|
|
1388
1505
|
var chat_input_default = ChatInput;
|
|
1389
1506
|
|
|
1390
1507
|
// src/chat/ask-user-card.tsx
|
|
1391
|
-
import { useEffect as useEffect4, useState as
|
|
1392
|
-
import { Box as
|
|
1508
|
+
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
1509
|
+
import { Box as Box5, Paper, Typography as Typography2, Button, TextField as TextField2, Chip, Stack } from "@mui/material";
|
|
1393
1510
|
import { useTheme as useTheme5, alpha as alpha2 } from "@mui/material/styles";
|
|
1394
1511
|
|
|
1395
1512
|
// src/store/askUserStore.ts
|
|
@@ -1455,12 +1572,12 @@ var parseAskUserQuestions = (rawJson) => {
|
|
|
1455
1572
|
};
|
|
1456
1573
|
|
|
1457
1574
|
// src/chat/ask-user-card.tsx
|
|
1458
|
-
import { jsx as
|
|
1575
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1459
1576
|
var AskUserCard = () => {
|
|
1460
1577
|
const theme = useTheme5();
|
|
1461
1578
|
const { pending, submit, cancel } = useAskUserStore();
|
|
1462
|
-
const [selected, setSelected] =
|
|
1463
|
-
const [freeform, setFreeform] =
|
|
1579
|
+
const [selected, setSelected] = useState5({});
|
|
1580
|
+
const [freeform, setFreeform] = useState5({});
|
|
1464
1581
|
useEffect4(() => {
|
|
1465
1582
|
if (!pending) return;
|
|
1466
1583
|
const preselected = {};
|
|
@@ -1481,7 +1598,7 @@ var AskUserCard = () => {
|
|
|
1481
1598
|
});
|
|
1482
1599
|
submit(final);
|
|
1483
1600
|
};
|
|
1484
|
-
return /* @__PURE__ */
|
|
1601
|
+
return /* @__PURE__ */ jsx8(Box5, { sx: { width: "100%", display: "flex", justifyContent: "center", px: { xs: 1, sm: 2 }, mb: 1.5 }, children: /* @__PURE__ */ jsxs5(
|
|
1485
1602
|
Paper,
|
|
1486
1603
|
{
|
|
1487
1604
|
elevation: 0,
|
|
@@ -1494,13 +1611,13 @@ var AskUserCard = () => {
|
|
|
1494
1611
|
bgcolor: alpha2(theme.palette.primary.main, 0.06)
|
|
1495
1612
|
},
|
|
1496
1613
|
children: [
|
|
1497
|
-
/* @__PURE__ */
|
|
1498
|
-
pending.questions.map((q) => /* @__PURE__ */
|
|
1499
|
-
q.header && /* @__PURE__ */
|
|
1500
|
-
/* @__PURE__ */
|
|
1501
|
-
q.options && q.options.length > 0 && /* @__PURE__ */
|
|
1614
|
+
/* @__PURE__ */ jsx8(Typography2, { variant: "caption", sx: { color: theme.palette.primary.main, fontWeight: 700, letterSpacing: 0.4 }, children: "BANDIT NEEDS A QUICK DECISION" }),
|
|
1615
|
+
pending.questions.map((q) => /* @__PURE__ */ jsxs5(Box5, { sx: { mt: 1.5 }, children: [
|
|
1616
|
+
q.header && /* @__PURE__ */ jsx8(Chip, { label: q.header, size: "small", sx: { mb: 0.75, fontWeight: 600 }, color: "primary", variant: "outlined" }),
|
|
1617
|
+
/* @__PURE__ */ jsx8(Typography2, { sx: { fontWeight: 600, color: theme.palette.text.primary, mb: 1 }, children: q.question }),
|
|
1618
|
+
q.options && q.options.length > 0 && /* @__PURE__ */ jsx8(Stack, { spacing: 1, children: q.options.map((opt) => {
|
|
1502
1619
|
const isSel = selected[q.id] === opt.label && !freeform[q.id]?.trim();
|
|
1503
|
-
return /* @__PURE__ */
|
|
1620
|
+
return /* @__PURE__ */ jsx8(
|
|
1504
1621
|
Button,
|
|
1505
1622
|
{
|
|
1506
1623
|
onClick: () => {
|
|
@@ -1517,9 +1634,9 @@ var AskUserCard = () => {
|
|
|
1517
1634
|
px: 1.5,
|
|
1518
1635
|
borderColor: alpha2(theme.palette.primary.main, 0.4)
|
|
1519
1636
|
},
|
|
1520
|
-
children: /* @__PURE__ */
|
|
1521
|
-
/* @__PURE__ */
|
|
1522
|
-
opt.description && /* @__PURE__ */
|
|
1637
|
+
children: /* @__PURE__ */ jsxs5(Box5, { children: [
|
|
1638
|
+
/* @__PURE__ */ jsx8(Typography2, { sx: { fontWeight: 600, lineHeight: 1.3 }, children: opt.label }),
|
|
1639
|
+
opt.description && /* @__PURE__ */ jsx8(
|
|
1523
1640
|
Typography2,
|
|
1524
1641
|
{
|
|
1525
1642
|
variant: "caption",
|
|
@@ -1532,7 +1649,7 @@ var AskUserCard = () => {
|
|
|
1532
1649
|
opt.label
|
|
1533
1650
|
);
|
|
1534
1651
|
}) }),
|
|
1535
|
-
q.allowFreeform !== false && /* @__PURE__ */
|
|
1652
|
+
q.allowFreeform !== false && /* @__PURE__ */ jsx8(
|
|
1536
1653
|
TextField2,
|
|
1537
1654
|
{
|
|
1538
1655
|
fullWidth: true,
|
|
@@ -1544,9 +1661,9 @@ var AskUserCard = () => {
|
|
|
1544
1661
|
}
|
|
1545
1662
|
)
|
|
1546
1663
|
] }, q.id)),
|
|
1547
|
-
/* @__PURE__ */
|
|
1548
|
-
/* @__PURE__ */
|
|
1549
|
-
/* @__PURE__ */
|
|
1664
|
+
/* @__PURE__ */ jsxs5(Box5, { sx: { display: "flex", justifyContent: "flex-end", gap: 1, mt: 2 }, children: [
|
|
1665
|
+
/* @__PURE__ */ jsx8(Button, { onClick: cancel, color: "inherit", sx: { textTransform: "none", color: theme.palette.text.secondary }, children: "Skip" }),
|
|
1666
|
+
/* @__PURE__ */ jsx8(Button, { onClick: handleSubmit, disabled: !allAnswered, variant: "contained", sx: { textTransform: "none" }, children: "Submit" })
|
|
1550
1667
|
] })
|
|
1551
1668
|
]
|
|
1552
1669
|
}
|
|
@@ -2438,9 +2555,9 @@ The user explicitly asked you to remember this. Respond with a short third-perso
|
|
|
2438
2555
|
};
|
|
2439
2556
|
|
|
2440
2557
|
// src/chat/hooks/useMoodEngine.tsx
|
|
2441
|
-
import { useState as
|
|
2558
|
+
import { useState as useState6 } from "react";
|
|
2442
2559
|
var useMoodEngine = () => {
|
|
2443
|
-
const [mood, setMood] =
|
|
2560
|
+
const [mood, setMood] = useState6("neutral");
|
|
2444
2561
|
const analyzeMood = async (message) => {
|
|
2445
2562
|
try {
|
|
2446
2563
|
const detected = await detectMessageMood(message);
|
|
@@ -4130,9 +4247,9 @@ var useAutoScroll = (options = {}) => {
|
|
|
4130
4247
|
};
|
|
4131
4248
|
|
|
4132
4249
|
// src/hooks/useNetworkStatus.ts
|
|
4133
|
-
import { useState as
|
|
4250
|
+
import { useState as useState7, useEffect as useEffect6, useCallback as useCallback3 } from "react";
|
|
4134
4251
|
var useNetworkStatus = () => {
|
|
4135
|
-
const [networkStatus, setNetworkStatus] =
|
|
4252
|
+
const [networkStatus, setNetworkStatus] = useState7({
|
|
4136
4253
|
isOnline: navigator.onLine,
|
|
4137
4254
|
isSlowConnection: false,
|
|
4138
4255
|
connectionQuality: "fast",
|
|
@@ -4211,13 +4328,13 @@ var useNetworkStatus = () => {
|
|
|
4211
4328
|
|
|
4212
4329
|
// src/chat/chat-app-bar.tsx
|
|
4213
4330
|
import { Avatar as Avatar8 } from "@mui/material";
|
|
4214
|
-
import { useEffect as useEffect12, useRef as useRef10, useState as
|
|
4331
|
+
import { useEffect as useEffect12, useRef as useRef10, useState as useState14 } from "react";
|
|
4215
4332
|
import {
|
|
4216
|
-
Box as
|
|
4333
|
+
Box as Box12,
|
|
4217
4334
|
IconButton as IconButton9,
|
|
4218
4335
|
Menu as Menu5,
|
|
4219
4336
|
MenuItem as MenuItem5,
|
|
4220
|
-
Tooltip as
|
|
4337
|
+
Tooltip as Tooltip5,
|
|
4221
4338
|
useMediaQuery as useMediaQuery5,
|
|
4222
4339
|
useTheme as useTheme12,
|
|
4223
4340
|
Dialog as Dialog5,
|
|
@@ -4230,13 +4347,13 @@ import {
|
|
|
4230
4347
|
import { useNavigate } from "react-router-dom";
|
|
4231
4348
|
|
|
4232
4349
|
// src/chat/conversation-drawer.tsx
|
|
4233
|
-
import { useState as
|
|
4350
|
+
import { useState as useState12, useMemo as useMemo2, useEffect as useEffect10, useRef as useRef8, useCallback as useCallback4 } from "react";
|
|
4234
4351
|
import {
|
|
4235
4352
|
Drawer,
|
|
4236
|
-
Box as
|
|
4353
|
+
Box as Box10,
|
|
4237
4354
|
Typography as Typography7,
|
|
4238
4355
|
IconButton as IconButton7,
|
|
4239
|
-
Tooltip as
|
|
4356
|
+
Tooltip as Tooltip4,
|
|
4240
4357
|
TextField as TextField6,
|
|
4241
4358
|
InputAdornment,
|
|
4242
4359
|
useMediaQuery as useMediaQuery4,
|
|
@@ -4254,11 +4371,11 @@ import {
|
|
|
4254
4371
|
Avatar as Avatar6,
|
|
4255
4372
|
alpha as alpha6
|
|
4256
4373
|
} from "@mui/material";
|
|
4257
|
-
import { X as CloseIcon4, X as ClearIcon, Search as SearchIcon, Folder as FolderIcon4, MoreVertical as MoreVertIcon3, Trash2 as DeleteSweepIcon, Inbox as InboxIcon3, Plus as AddIcon4, Settings as SettingsIcon2 } from "lucide-react";
|
|
4374
|
+
import { X as CloseIcon4, X as ClearIcon, Search as SearchIcon, Folder as FolderIcon4, MoreVertical as MoreVertIcon3, Trash2 as DeleteSweepIcon, Inbox as InboxIcon3, Plus as AddIcon4, Settings as SettingsIcon2, Brain as MemoryIcon } from "lucide-react";
|
|
4258
4375
|
import { useTheme as useTheme10 } from "@mui/material/styles";
|
|
4259
4376
|
|
|
4260
4377
|
// src/chat/project-management-modal.tsx
|
|
4261
|
-
import { useState as
|
|
4378
|
+
import { useState as useState8, useEffect as useEffect7, useRef as useRef5 } from "react";
|
|
4262
4379
|
import {
|
|
4263
4380
|
Modal,
|
|
4264
4381
|
Button as Button2,
|
|
@@ -4266,7 +4383,7 @@ import {
|
|
|
4266
4383
|
List,
|
|
4267
4384
|
ListItem,
|
|
4268
4385
|
IconButton as IconButton4,
|
|
4269
|
-
Box as
|
|
4386
|
+
Box as Box6,
|
|
4270
4387
|
Typography as Typography3,
|
|
4271
4388
|
Avatar as Avatar3,
|
|
4272
4389
|
Chip as Chip2,
|
|
@@ -4279,7 +4396,7 @@ import {
|
|
|
4279
4396
|
} from "@mui/material";
|
|
4280
4397
|
import { Plus as AddIcon2, Pencil as EditIcon, Trash2 as DeleteIcon, MoreVertical as MoreVertIcon, Folder as FolderIcon, X as CloseIcon2, ArrowLeft as ArrowBackIcon } from "lucide-react";
|
|
4281
4398
|
import { useTheme as useTheme6, alpha as alpha3 } from "@mui/material/styles";
|
|
4282
|
-
import { Fragment as Fragment4, jsx as
|
|
4399
|
+
import { Fragment as Fragment4, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
4283
4400
|
var DEFAULT_COLORS = [
|
|
4284
4401
|
"#2196F3",
|
|
4285
4402
|
"#4CAF50",
|
|
@@ -4308,17 +4425,17 @@ var ProjectManagementModal = ({
|
|
|
4308
4425
|
hydrate
|
|
4309
4426
|
} = useProjectStore();
|
|
4310
4427
|
const { getConversationsByProject } = useConversationStore();
|
|
4311
|
-
const [showCreateForm, setShowCreateForm] =
|
|
4312
|
-
const [editingProject, setEditingProject] =
|
|
4313
|
-
const [formData, setFormData] =
|
|
4428
|
+
const [showCreateForm, setShowCreateForm] = useState8(false);
|
|
4429
|
+
const [editingProject, setEditingProject] = useState8(null);
|
|
4430
|
+
const [formData, setFormData] = useState8({
|
|
4314
4431
|
name: "",
|
|
4315
4432
|
description: "",
|
|
4316
4433
|
color: DEFAULT_COLORS[0]
|
|
4317
4434
|
});
|
|
4318
|
-
const [menuAnchor, setMenuAnchor] =
|
|
4319
|
-
const [selectedProject, setSelectedProject] =
|
|
4320
|
-
const [loading, setLoading] =
|
|
4321
|
-
const [error, setError] =
|
|
4435
|
+
const [menuAnchor, setMenuAnchor] = useState8(null);
|
|
4436
|
+
const [selectedProject, setSelectedProject] = useState8(null);
|
|
4437
|
+
const [loading, setLoading] = useState8(false);
|
|
4438
|
+
const [error, setError] = useState8(null);
|
|
4322
4439
|
const modalContainerRef = useRef5(null);
|
|
4323
4440
|
useEffect7(() => {
|
|
4324
4441
|
if (open && !_hasHydrated) {
|
|
@@ -4427,8 +4544,8 @@ var ProjectManagementModal = ({
|
|
|
4427
4544
|
const hoverSurface = alpha3(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.22 : 0.08);
|
|
4428
4545
|
const headerTitle = showCreateForm ? editingProject ? "Edit Project" : "Create Project" : "Manage Projects";
|
|
4429
4546
|
const headerSubtitle = showCreateForm ? "Name, describe, and color-code your project." : "Organize conversations into cohesive projects.";
|
|
4430
|
-
const content = /* @__PURE__ */
|
|
4431
|
-
|
|
4547
|
+
const content = /* @__PURE__ */ jsxs6(
|
|
4548
|
+
Box6,
|
|
4432
4549
|
{
|
|
4433
4550
|
ref: modalContainerRef,
|
|
4434
4551
|
sx: {
|
|
@@ -4446,8 +4563,8 @@ var ProjectManagementModal = ({
|
|
|
4446
4563
|
position: "relative"
|
|
4447
4564
|
},
|
|
4448
4565
|
children: [
|
|
4449
|
-
isMobile && /* @__PURE__ */
|
|
4450
|
-
|
|
4566
|
+
isMobile && /* @__PURE__ */ jsx9(
|
|
4567
|
+
Box6,
|
|
4451
4568
|
{
|
|
4452
4569
|
sx: {
|
|
4453
4570
|
width: 56,
|
|
@@ -4460,8 +4577,8 @@ var ProjectManagementModal = ({
|
|
|
4460
4577
|
}
|
|
4461
4578
|
}
|
|
4462
4579
|
),
|
|
4463
|
-
/* @__PURE__ */
|
|
4464
|
-
|
|
4580
|
+
/* @__PURE__ */ jsxs6(
|
|
4581
|
+
Box6,
|
|
4465
4582
|
{
|
|
4466
4583
|
sx: {
|
|
4467
4584
|
px: isMobile ? 1.5 : 2.75,
|
|
@@ -4473,8 +4590,8 @@ var ProjectManagementModal = ({
|
|
|
4473
4590
|
gap: 1
|
|
4474
4591
|
},
|
|
4475
4592
|
children: [
|
|
4476
|
-
/* @__PURE__ */
|
|
4477
|
-
|
|
4593
|
+
/* @__PURE__ */ jsxs6(
|
|
4594
|
+
Box6,
|
|
4478
4595
|
{
|
|
4479
4596
|
sx: {
|
|
4480
4597
|
display: "flex",
|
|
@@ -4483,8 +4600,8 @@ var ProjectManagementModal = ({
|
|
|
4483
4600
|
gap: 1
|
|
4484
4601
|
},
|
|
4485
4602
|
children: [
|
|
4486
|
-
/* @__PURE__ */
|
|
4487
|
-
|
|
4603
|
+
/* @__PURE__ */ jsxs6(
|
|
4604
|
+
Box6,
|
|
4488
4605
|
{
|
|
4489
4606
|
sx: {
|
|
4490
4607
|
display: "flex",
|
|
@@ -4494,8 +4611,8 @@ var ProjectManagementModal = ({
|
|
|
4494
4611
|
flex: 1
|
|
4495
4612
|
},
|
|
4496
4613
|
children: [
|
|
4497
|
-
showCreateForm && /* @__PURE__ */
|
|
4498
|
-
/* @__PURE__ */
|
|
4614
|
+
showCreateForm && /* @__PURE__ */ jsx9(IconButton4, { onClick: resetForm, size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsx9(ArrowBackIcon, { size: 16 }) }),
|
|
4615
|
+
/* @__PURE__ */ jsx9(
|
|
4499
4616
|
Typography3,
|
|
4500
4617
|
{
|
|
4501
4618
|
variant: "h6",
|
|
@@ -4512,16 +4629,16 @@ var ProjectManagementModal = ({
|
|
|
4512
4629
|
]
|
|
4513
4630
|
}
|
|
4514
4631
|
),
|
|
4515
|
-
/* @__PURE__ */
|
|
4632
|
+
/* @__PURE__ */ jsx9(IconButton4, { onClick: handleClose, size: "small", children: /* @__PURE__ */ jsx9(CloseIcon2, {}) })
|
|
4516
4633
|
]
|
|
4517
4634
|
}
|
|
4518
4635
|
),
|
|
4519
|
-
/* @__PURE__ */
|
|
4636
|
+
/* @__PURE__ */ jsx9(Typography3, { variant: "body2", color: "text.secondary", children: headerSubtitle })
|
|
4520
4637
|
]
|
|
4521
4638
|
}
|
|
4522
4639
|
),
|
|
4523
|
-
/* @__PURE__ */
|
|
4524
|
-
|
|
4640
|
+
/* @__PURE__ */ jsxs6(
|
|
4641
|
+
Box6,
|
|
4525
4642
|
{
|
|
4526
4643
|
sx: {
|
|
4527
4644
|
flex: 1,
|
|
@@ -4533,9 +4650,9 @@ var ProjectManagementModal = ({
|
|
|
4533
4650
|
gap: 2.5
|
|
4534
4651
|
},
|
|
4535
4652
|
children: [
|
|
4536
|
-
error && /* @__PURE__ */
|
|
4537
|
-
showCreateForm ? /* @__PURE__ */
|
|
4538
|
-
/* @__PURE__ */
|
|
4653
|
+
error && /* @__PURE__ */ jsx9(Alert, { severity: "error", onClose: () => setError(null), children: error }),
|
|
4654
|
+
showCreateForm ? /* @__PURE__ */ jsxs6(Box6, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
4655
|
+
/* @__PURE__ */ jsx9(
|
|
4539
4656
|
TextField3,
|
|
4540
4657
|
{
|
|
4541
4658
|
label: "Project name",
|
|
@@ -4547,7 +4664,7 @@ var ProjectManagementModal = ({
|
|
|
4547
4664
|
autoFocus: true
|
|
4548
4665
|
}
|
|
4549
4666
|
),
|
|
4550
|
-
/* @__PURE__ */
|
|
4667
|
+
/* @__PURE__ */ jsx9(
|
|
4551
4668
|
TextField3,
|
|
4552
4669
|
{
|
|
4553
4670
|
label: "Description (optional)",
|
|
@@ -4559,10 +4676,10 @@ var ProjectManagementModal = ({
|
|
|
4559
4676
|
disabled: loading
|
|
4560
4677
|
}
|
|
4561
4678
|
),
|
|
4562
|
-
/* @__PURE__ */
|
|
4563
|
-
/* @__PURE__ */
|
|
4564
|
-
/* @__PURE__ */
|
|
4565
|
-
|
|
4679
|
+
/* @__PURE__ */ jsxs6(Box6, { children: [
|
|
4680
|
+
/* @__PURE__ */ jsx9(Typography3, { variant: "subtitle2", sx: { mb: 1 }, children: "Color" }),
|
|
4681
|
+
/* @__PURE__ */ jsx9(Box6, { sx: { display: "flex", flexWrap: "wrap", gap: 1 }, children: DEFAULT_COLORS.map((color) => /* @__PURE__ */ jsx9(
|
|
4682
|
+
Box6,
|
|
4566
4683
|
{
|
|
4567
4684
|
sx: {
|
|
4568
4685
|
width: 32,
|
|
@@ -4582,11 +4699,11 @@ var ProjectManagementModal = ({
|
|
|
4582
4699
|
color
|
|
4583
4700
|
)) })
|
|
4584
4701
|
] })
|
|
4585
|
-
] }) : /* @__PURE__ */
|
|
4586
|
-
/* @__PURE__ */
|
|
4702
|
+
] }) : /* @__PURE__ */ jsxs6(Box6, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
4703
|
+
/* @__PURE__ */ jsx9(
|
|
4587
4704
|
Button2,
|
|
4588
4705
|
{
|
|
4589
|
-
startIcon: /* @__PURE__ */
|
|
4706
|
+
startIcon: /* @__PURE__ */ jsx9(AddIcon2, {}),
|
|
4590
4707
|
onClick: () => setShowCreateForm(true),
|
|
4591
4708
|
variant: "contained",
|
|
4592
4709
|
sx: {
|
|
@@ -4598,8 +4715,8 @@ var ProjectManagementModal = ({
|
|
|
4598
4715
|
children: "Create project"
|
|
4599
4716
|
}
|
|
4600
4717
|
),
|
|
4601
|
-
projects.length === 0 ? /* @__PURE__ */
|
|
4602
|
-
|
|
4718
|
+
projects.length === 0 ? /* @__PURE__ */ jsxs6(
|
|
4719
|
+
Box6,
|
|
4603
4720
|
{
|
|
4604
4721
|
sx: {
|
|
4605
4722
|
textAlign: "center",
|
|
@@ -4611,15 +4728,15 @@ var ProjectManagementModal = ({
|
|
|
4611
4728
|
backgroundColor: subtleSurface
|
|
4612
4729
|
},
|
|
4613
4730
|
children: [
|
|
4614
|
-
/* @__PURE__ */
|
|
4615
|
-
/* @__PURE__ */
|
|
4616
|
-
/* @__PURE__ */
|
|
4731
|
+
/* @__PURE__ */ jsx9(FolderIcon, { size: 48, style: { marginBottom: 8, opacity: 0.5 } }),
|
|
4732
|
+
/* @__PURE__ */ jsx9(Typography3, { variant: "body1", sx: { fontWeight: 600 }, children: "No projects yet" }),
|
|
4733
|
+
/* @__PURE__ */ jsx9(Typography3, { variant: "body2", children: "Create your first project to organize conversations." })
|
|
4617
4734
|
]
|
|
4618
4735
|
}
|
|
4619
|
-
) : /* @__PURE__ */
|
|
4736
|
+
) : /* @__PURE__ */ jsx9(List, { sx: { display: "flex", flexDirection: "column", gap: 1.25, py: 0 }, children: projects.map((project) => {
|
|
4620
4737
|
const conversationCount = getConversationsByProject(project.id).length;
|
|
4621
|
-
return /* @__PURE__ */
|
|
4622
|
-
|
|
4738
|
+
return /* @__PURE__ */ jsx9(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxs6(
|
|
4739
|
+
Box6,
|
|
4623
4740
|
{
|
|
4624
4741
|
sx: {
|
|
4625
4742
|
display: "flex",
|
|
@@ -4637,7 +4754,7 @@ var ProjectManagementModal = ({
|
|
|
4637
4754
|
}
|
|
4638
4755
|
},
|
|
4639
4756
|
children: [
|
|
4640
|
-
/* @__PURE__ */
|
|
4757
|
+
/* @__PURE__ */ jsx9(
|
|
4641
4758
|
Avatar3,
|
|
4642
4759
|
{
|
|
4643
4760
|
sx: {
|
|
@@ -4646,12 +4763,12 @@ var ProjectManagementModal = ({
|
|
|
4646
4763
|
height: 36,
|
|
4647
4764
|
fontSize: "1rem"
|
|
4648
4765
|
},
|
|
4649
|
-
children: /* @__PURE__ */
|
|
4766
|
+
children: /* @__PURE__ */ jsx9(FolderIcon, { size: 16 })
|
|
4650
4767
|
}
|
|
4651
4768
|
),
|
|
4652
|
-
/* @__PURE__ */
|
|
4653
|
-
/* @__PURE__ */
|
|
4654
|
-
/* @__PURE__ */
|
|
4769
|
+
/* @__PURE__ */ jsxs6(Box6, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
4770
|
+
/* @__PURE__ */ jsxs6(Box6, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
|
|
4771
|
+
/* @__PURE__ */ jsx9(
|
|
4655
4772
|
Typography3,
|
|
4656
4773
|
{
|
|
4657
4774
|
variant: "subtitle1",
|
|
@@ -4659,7 +4776,7 @@ var ProjectManagementModal = ({
|
|
|
4659
4776
|
children: project.name
|
|
4660
4777
|
}
|
|
4661
4778
|
),
|
|
4662
|
-
/* @__PURE__ */
|
|
4779
|
+
/* @__PURE__ */ jsx9(
|
|
4663
4780
|
Chip2,
|
|
4664
4781
|
{
|
|
4665
4782
|
label: `${conversationCount}`,
|
|
@@ -4674,7 +4791,7 @@ var ProjectManagementModal = ({
|
|
|
4674
4791
|
}
|
|
4675
4792
|
)
|
|
4676
4793
|
] }),
|
|
4677
|
-
project.description && /* @__PURE__ */
|
|
4794
|
+
project.description && /* @__PURE__ */ jsx9(
|
|
4678
4795
|
Typography3,
|
|
4679
4796
|
{
|
|
4680
4797
|
variant: "body2",
|
|
@@ -4684,7 +4801,7 @@ var ProjectManagementModal = ({
|
|
|
4684
4801
|
}
|
|
4685
4802
|
)
|
|
4686
4803
|
] }),
|
|
4687
|
-
/* @__PURE__ */
|
|
4804
|
+
/* @__PURE__ */ jsx9(
|
|
4688
4805
|
IconButton4,
|
|
4689
4806
|
{
|
|
4690
4807
|
onClick: (e) => {
|
|
@@ -4697,7 +4814,7 @@ var ProjectManagementModal = ({
|
|
|
4697
4814
|
mt: 0.25,
|
|
4698
4815
|
zIndex: 1
|
|
4699
4816
|
},
|
|
4700
|
-
children: /* @__PURE__ */
|
|
4817
|
+
children: /* @__PURE__ */ jsx9(MoreVertIcon, { size: 16 })
|
|
4701
4818
|
}
|
|
4702
4819
|
)
|
|
4703
4820
|
]
|
|
@@ -4708,8 +4825,8 @@ var ProjectManagementModal = ({
|
|
|
4708
4825
|
]
|
|
4709
4826
|
}
|
|
4710
4827
|
),
|
|
4711
|
-
/* @__PURE__ */
|
|
4712
|
-
|
|
4828
|
+
/* @__PURE__ */ jsx9(
|
|
4829
|
+
Box6,
|
|
4713
4830
|
{
|
|
4714
4831
|
sx: {
|
|
4715
4832
|
px: isMobile ? 1.5 : 2.75,
|
|
@@ -4719,8 +4836,8 @@ var ProjectManagementModal = ({
|
|
|
4719
4836
|
justifyContent: "flex-end",
|
|
4720
4837
|
gap: 1
|
|
4721
4838
|
},
|
|
4722
|
-
children: showCreateForm ? /* @__PURE__ */
|
|
4723
|
-
/* @__PURE__ */
|
|
4839
|
+
children: showCreateForm ? /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
4840
|
+
/* @__PURE__ */ jsx9(
|
|
4724
4841
|
Button2,
|
|
4725
4842
|
{
|
|
4726
4843
|
onClick: resetForm,
|
|
@@ -4729,21 +4846,21 @@ var ProjectManagementModal = ({
|
|
|
4729
4846
|
children: "Cancel"
|
|
4730
4847
|
}
|
|
4731
4848
|
),
|
|
4732
|
-
/* @__PURE__ */
|
|
4849
|
+
/* @__PURE__ */ jsx9(
|
|
4733
4850
|
Button2,
|
|
4734
4851
|
{
|
|
4735
4852
|
onClick: editingProject ? handleEditProject : handleCreateProject,
|
|
4736
4853
|
variant: "contained",
|
|
4737
4854
|
disabled: loading,
|
|
4738
|
-
startIcon: loading ? /* @__PURE__ */
|
|
4855
|
+
startIcon: loading ? /* @__PURE__ */ jsx9(CircularProgress3, { size: 16 }) : void 0,
|
|
4739
4856
|
sx: { textTransform: "none", borderRadius: 2 },
|
|
4740
4857
|
children: editingProject ? "Update project" : "Create project"
|
|
4741
4858
|
}
|
|
4742
4859
|
)
|
|
4743
|
-
] }) : /* @__PURE__ */
|
|
4860
|
+
] }) : /* @__PURE__ */ jsx9(Button2, { onClick: handleClose, sx: { textTransform: "none", borderRadius: 2 }, children: "Close" })
|
|
4744
4861
|
}
|
|
4745
4862
|
),
|
|
4746
|
-
/* @__PURE__ */
|
|
4863
|
+
/* @__PURE__ */ jsxs6(
|
|
4747
4864
|
Menu,
|
|
4748
4865
|
{
|
|
4749
4866
|
anchorEl: menuAnchor,
|
|
@@ -4765,20 +4882,20 @@ var ProjectManagementModal = ({
|
|
|
4765
4882
|
}
|
|
4766
4883
|
},
|
|
4767
4884
|
children: [
|
|
4768
|
-
/* @__PURE__ */
|
|
4885
|
+
/* @__PURE__ */ jsx9(
|
|
4769
4886
|
MenuItem,
|
|
4770
4887
|
{
|
|
4771
4888
|
onClick: () => {
|
|
4772
4889
|
if (!selectedProject) return;
|
|
4773
4890
|
startEdit(selectedProject);
|
|
4774
4891
|
},
|
|
4775
|
-
children: /* @__PURE__ */
|
|
4776
|
-
/* @__PURE__ */
|
|
4777
|
-
/* @__PURE__ */
|
|
4892
|
+
children: /* @__PURE__ */ jsxs6(Box6, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
4893
|
+
/* @__PURE__ */ jsx9(EditIcon, { size: 16 }),
|
|
4894
|
+
/* @__PURE__ */ jsx9(Typography3, { variant: "body2", color: "inherit", children: "Edit" })
|
|
4778
4895
|
] })
|
|
4779
4896
|
}
|
|
4780
4897
|
),
|
|
4781
|
-
/* @__PURE__ */
|
|
4898
|
+
/* @__PURE__ */ jsx9(
|
|
4782
4899
|
MenuItem,
|
|
4783
4900
|
{
|
|
4784
4901
|
onClick: () => {
|
|
@@ -4786,9 +4903,9 @@ var ProjectManagementModal = ({
|
|
|
4786
4903
|
handleDeleteProject(selectedProject);
|
|
4787
4904
|
},
|
|
4788
4905
|
sx: { color: theme.palette.error.main },
|
|
4789
|
-
children: /* @__PURE__ */
|
|
4790
|
-
/* @__PURE__ */
|
|
4791
|
-
/* @__PURE__ */
|
|
4906
|
+
children: /* @__PURE__ */ jsxs6(Box6, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
4907
|
+
/* @__PURE__ */ jsx9(DeleteIcon, { size: 16 }),
|
|
4908
|
+
/* @__PURE__ */ jsx9(Typography3, { variant: "body2", color: "inherit", children: "Delete" })
|
|
4792
4909
|
] })
|
|
4793
4910
|
}
|
|
4794
4911
|
)
|
|
@@ -4798,7 +4915,7 @@ var ProjectManagementModal = ({
|
|
|
4798
4915
|
]
|
|
4799
4916
|
}
|
|
4800
4917
|
);
|
|
4801
|
-
return /* @__PURE__ */
|
|
4918
|
+
return /* @__PURE__ */ jsx9(Fragment4, { children: isMobile ? /* @__PURE__ */ jsx9(
|
|
4802
4919
|
SwipeableDrawer,
|
|
4803
4920
|
{
|
|
4804
4921
|
anchor: "bottom",
|
|
@@ -4818,7 +4935,7 @@ var ProjectManagementModal = ({
|
|
|
4818
4935
|
},
|
|
4819
4936
|
children: content
|
|
4820
4937
|
}
|
|
4821
|
-
) : /* @__PURE__ */
|
|
4938
|
+
) : /* @__PURE__ */ jsx9(
|
|
4822
4939
|
Modal,
|
|
4823
4940
|
{
|
|
4824
4941
|
open,
|
|
@@ -4837,7 +4954,7 @@ var ProjectManagementModal = ({
|
|
|
4837
4954
|
var project_management_modal_default = ProjectManagementModal;
|
|
4838
4955
|
|
|
4839
4956
|
// src/chat/move-conversation-modal.tsx
|
|
4840
|
-
import { useState as
|
|
4957
|
+
import { useState as useState9, useEffect as useEffect8 } from "react";
|
|
4841
4958
|
import {
|
|
4842
4959
|
Dialog,
|
|
4843
4960
|
DialogTitle,
|
|
@@ -4852,12 +4969,12 @@ import {
|
|
|
4852
4969
|
Typography as Typography4,
|
|
4853
4970
|
Avatar as Avatar4,
|
|
4854
4971
|
Radio,
|
|
4855
|
-
Box as
|
|
4972
|
+
Box as Box7,
|
|
4856
4973
|
Divider
|
|
4857
4974
|
} from "@mui/material";
|
|
4858
4975
|
import { Folder as FolderIcon2, Inbox as InboxIcon } from "lucide-react";
|
|
4859
4976
|
import { useTheme as useTheme7 } from "@mui/material/styles";
|
|
4860
|
-
import { jsx as
|
|
4977
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
4861
4978
|
var MoveConversationModal = ({
|
|
4862
4979
|
open,
|
|
4863
4980
|
onClose,
|
|
@@ -4867,7 +4984,7 @@ var MoveConversationModal = ({
|
|
|
4867
4984
|
const theme = useTheme7();
|
|
4868
4985
|
const { projects, _hasHydrated, hydrate } = useProjectStore();
|
|
4869
4986
|
const { moveConversationToProject } = useConversationStore();
|
|
4870
|
-
const [selectedProjectId, setSelectedProjectId] =
|
|
4987
|
+
const [selectedProjectId, setSelectedProjectId] = useState9(
|
|
4871
4988
|
currentProjectId
|
|
4872
4989
|
);
|
|
4873
4990
|
useEffect8(() => {
|
|
@@ -4894,7 +5011,7 @@ var MoveConversationModal = ({
|
|
|
4894
5011
|
};
|
|
4895
5012
|
const conversationCount = conversations.length;
|
|
4896
5013
|
const isMultiple = conversationCount > 1;
|
|
4897
|
-
return /* @__PURE__ */
|
|
5014
|
+
return /* @__PURE__ */ jsxs7(
|
|
4898
5015
|
Dialog,
|
|
4899
5016
|
{
|
|
4900
5017
|
open,
|
|
@@ -4908,20 +5025,20 @@ var MoveConversationModal = ({
|
|
|
4908
5025
|
}
|
|
4909
5026
|
},
|
|
4910
5027
|
children: [
|
|
4911
|
-
/* @__PURE__ */
|
|
5028
|
+
/* @__PURE__ */ jsxs7(DialogTitle, { children: [
|
|
4912
5029
|
"Move ",
|
|
4913
5030
|
isMultiple ? `${conversationCount} Conversations` : "Conversation"
|
|
4914
5031
|
] }),
|
|
4915
|
-
/* @__PURE__ */
|
|
4916
|
-
/* @__PURE__ */
|
|
4917
|
-
/* @__PURE__ */
|
|
4918
|
-
/* @__PURE__ */
|
|
5032
|
+
/* @__PURE__ */ jsxs7(DialogContent, { sx: { px: 3 }, children: [
|
|
5033
|
+
/* @__PURE__ */ jsx10(Typography4, { variant: "body2", color: "text.secondary", sx: { mb: 2 }, children: isMultiple ? `Select a project to move ${conversationCount} conversations to:` : `Select a project to move "${conversations[0]?.name}" to:` }),
|
|
5034
|
+
/* @__PURE__ */ jsxs7(List2, { children: [
|
|
5035
|
+
/* @__PURE__ */ jsx10(ListItem2, { disablePadding: true, children: /* @__PURE__ */ jsxs7(
|
|
4919
5036
|
ListItemButton,
|
|
4920
5037
|
{
|
|
4921
5038
|
onClick: () => setSelectedProjectId(null),
|
|
4922
5039
|
selected: selectedProjectId === null,
|
|
4923
5040
|
children: [
|
|
4924
|
-
/* @__PURE__ */
|
|
5041
|
+
/* @__PURE__ */ jsx10(ListItemIcon, { children: /* @__PURE__ */ jsx10(
|
|
4925
5042
|
Radio,
|
|
4926
5043
|
{
|
|
4927
5044
|
checked: selectedProjectId === null,
|
|
@@ -4929,7 +5046,7 @@ var MoveConversationModal = ({
|
|
|
4929
5046
|
size: "small"
|
|
4930
5047
|
}
|
|
4931
5048
|
) }),
|
|
4932
|
-
/* @__PURE__ */
|
|
5049
|
+
/* @__PURE__ */ jsx10(ListItemIcon, { children: /* @__PURE__ */ jsx10(
|
|
4933
5050
|
Avatar4,
|
|
4934
5051
|
{
|
|
4935
5052
|
sx: {
|
|
@@ -4937,10 +5054,10 @@ var MoveConversationModal = ({
|
|
|
4937
5054
|
width: 32,
|
|
4938
5055
|
height: 32
|
|
4939
5056
|
},
|
|
4940
|
-
children: /* @__PURE__ */
|
|
5057
|
+
children: /* @__PURE__ */ jsx10(InboxIcon, {})
|
|
4941
5058
|
}
|
|
4942
5059
|
) }),
|
|
4943
|
-
/* @__PURE__ */
|
|
5060
|
+
/* @__PURE__ */ jsx10(
|
|
4944
5061
|
ListItemText,
|
|
4945
5062
|
{
|
|
4946
5063
|
primary: "No Project",
|
|
@@ -4950,14 +5067,14 @@ var MoveConversationModal = ({
|
|
|
4950
5067
|
]
|
|
4951
5068
|
}
|
|
4952
5069
|
) }),
|
|
4953
|
-
/* @__PURE__ */
|
|
4954
|
-
projects.map((project) => /* @__PURE__ */
|
|
5070
|
+
/* @__PURE__ */ jsx10(Divider, { sx: { my: 1 } }),
|
|
5071
|
+
projects.map((project) => /* @__PURE__ */ jsx10(ListItem2, { disablePadding: true, children: /* @__PURE__ */ jsxs7(
|
|
4955
5072
|
ListItemButton,
|
|
4956
5073
|
{
|
|
4957
5074
|
onClick: () => setSelectedProjectId(project.id),
|
|
4958
5075
|
selected: selectedProjectId === project.id,
|
|
4959
5076
|
children: [
|
|
4960
|
-
/* @__PURE__ */
|
|
5077
|
+
/* @__PURE__ */ jsx10(ListItemIcon, { children: /* @__PURE__ */ jsx10(
|
|
4961
5078
|
Radio,
|
|
4962
5079
|
{
|
|
4963
5080
|
checked: selectedProjectId === project.id,
|
|
@@ -4965,7 +5082,7 @@ var MoveConversationModal = ({
|
|
|
4965
5082
|
size: "small"
|
|
4966
5083
|
}
|
|
4967
5084
|
) }),
|
|
4968
|
-
/* @__PURE__ */
|
|
5085
|
+
/* @__PURE__ */ jsx10(ListItemIcon, { children: /* @__PURE__ */ jsx10(
|
|
4969
5086
|
Avatar4,
|
|
4970
5087
|
{
|
|
4971
5088
|
sx: {
|
|
@@ -4973,10 +5090,10 @@ var MoveConversationModal = ({
|
|
|
4973
5090
|
width: 32,
|
|
4974
5091
|
height: 32
|
|
4975
5092
|
},
|
|
4976
|
-
children: /* @__PURE__ */
|
|
5093
|
+
children: /* @__PURE__ */ jsx10(FolderIcon2, {})
|
|
4977
5094
|
}
|
|
4978
5095
|
) }),
|
|
4979
|
-
/* @__PURE__ */
|
|
5096
|
+
/* @__PURE__ */ jsx10(
|
|
4980
5097
|
ListItemText,
|
|
4981
5098
|
{
|
|
4982
5099
|
primary: project.name,
|
|
@@ -4986,16 +5103,16 @@ var MoveConversationModal = ({
|
|
|
4986
5103
|
]
|
|
4987
5104
|
}
|
|
4988
5105
|
) }, project.id)),
|
|
4989
|
-
projects.length === 0 && /* @__PURE__ */
|
|
5106
|
+
projects.length === 0 && /* @__PURE__ */ jsx10(Box7, { sx: {
|
|
4990
5107
|
textAlign: "center",
|
|
4991
5108
|
py: 2,
|
|
4992
5109
|
color: theme.palette.text.secondary
|
|
4993
|
-
}, children: /* @__PURE__ */
|
|
5110
|
+
}, children: /* @__PURE__ */ jsx10(Typography4, { variant: "body2", children: "No projects available. Create a project first to organize conversations." }) })
|
|
4994
5111
|
] })
|
|
4995
5112
|
] }),
|
|
4996
|
-
/* @__PURE__ */
|
|
4997
|
-
/* @__PURE__ */
|
|
4998
|
-
/* @__PURE__ */
|
|
5113
|
+
/* @__PURE__ */ jsxs7(DialogActions, { sx: { px: 3, pb: 2 }, children: [
|
|
5114
|
+
/* @__PURE__ */ jsx10(Button3, { onClick: onClose, children: "Cancel" }),
|
|
5115
|
+
/* @__PURE__ */ jsxs7(
|
|
4999
5116
|
Button3,
|
|
5000
5117
|
{
|
|
5001
5118
|
onClick: handleMove,
|
|
@@ -5015,9 +5132,9 @@ var MoveConversationModal = ({
|
|
|
5015
5132
|
var move_conversation_modal_default = MoveConversationModal;
|
|
5016
5133
|
|
|
5017
5134
|
// src/chat/simple-conversation-item.tsx
|
|
5018
|
-
import { useState as
|
|
5135
|
+
import { useState as useState10, useRef as useRef6, useEffect as useEffect9 } from "react";
|
|
5019
5136
|
import {
|
|
5020
|
-
Box as
|
|
5137
|
+
Box as Box8,
|
|
5021
5138
|
Typography as Typography5,
|
|
5022
5139
|
IconButton as IconButton5,
|
|
5023
5140
|
Menu as Menu2,
|
|
@@ -5034,7 +5151,7 @@ import {
|
|
|
5034
5151
|
} from "@mui/material";
|
|
5035
5152
|
import { MoreVertical as MoreVertIcon2, Pencil as EditIcon2, Trash2 as DeleteIcon2, GripVertical as DragIcon, MailOpen as MoveIcon } from "lucide-react";
|
|
5036
5153
|
import { useTheme as useTheme8, alpha as alpha4 } from "@mui/material/styles";
|
|
5037
|
-
import { Fragment as Fragment5, jsx as
|
|
5154
|
+
import { Fragment as Fragment5, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
5038
5155
|
var SimpleConversationItem = ({
|
|
5039
5156
|
conversation,
|
|
5040
5157
|
isSelected,
|
|
@@ -5052,12 +5169,12 @@ var SimpleConversationItem = ({
|
|
|
5052
5169
|
}) => {
|
|
5053
5170
|
const theme = useTheme8();
|
|
5054
5171
|
const isMobile = useMediaQuery3(theme.breakpoints.down("sm"));
|
|
5055
|
-
const [anchorEl, setAnchorEl] =
|
|
5056
|
-
const [isEditing, setIsEditing] =
|
|
5057
|
-
const [editName, setEditName] =
|
|
5058
|
-
const [isDragging, setIsDragging] =
|
|
5059
|
-
const [isTouchDragging, setIsTouchDragging] =
|
|
5060
|
-
const [showRenameDialog, setShowRenameDialog] =
|
|
5172
|
+
const [anchorEl, setAnchorEl] = useState10(null);
|
|
5173
|
+
const [isEditing, setIsEditing] = useState10(false);
|
|
5174
|
+
const [editName, setEditName] = useState10(conversation.name);
|
|
5175
|
+
const [isDragging, setIsDragging] = useState10(false);
|
|
5176
|
+
const [isTouchDragging, setIsTouchDragging] = useState10(false);
|
|
5177
|
+
const [showRenameDialog, setShowRenameDialog] = useState10(false);
|
|
5061
5178
|
const longPressTimeoutRef = useRef6(null);
|
|
5062
5179
|
const touchStartPointRef = useRef6(null);
|
|
5063
5180
|
const activeTouchIdRef = useRef6(null);
|
|
@@ -5069,8 +5186,8 @@ var SimpleConversationItem = ({
|
|
|
5069
5186
|
const regex = new RegExp(`(${query.trim()})`, "gi");
|
|
5070
5187
|
const parts = text.split(regex);
|
|
5071
5188
|
return parts.map(
|
|
5072
|
-
(part, index) => regex.test(part) ? /* @__PURE__ */
|
|
5073
|
-
|
|
5189
|
+
(part, index) => regex.test(part) ? /* @__PURE__ */ jsx11(
|
|
5190
|
+
Box8,
|
|
5074
5191
|
{
|
|
5075
5192
|
component: "span",
|
|
5076
5193
|
sx: {
|
|
@@ -5205,9 +5322,9 @@ var SimpleConversationItem = ({
|
|
|
5205
5322
|
setIsTouchDragging(false);
|
|
5206
5323
|
}
|
|
5207
5324
|
}, [isTouchDragActive, isTouchDragging]);
|
|
5208
|
-
return /* @__PURE__ */
|
|
5209
|
-
/* @__PURE__ */
|
|
5210
|
-
|
|
5325
|
+
return /* @__PURE__ */ jsxs8(Fragment5, { children: [
|
|
5326
|
+
/* @__PURE__ */ jsxs8(
|
|
5327
|
+
Box8,
|
|
5211
5328
|
{
|
|
5212
5329
|
"data-project-id": conversation.projectId ?? "__ungrouped",
|
|
5213
5330
|
draggable: !isMobile && !isEditing,
|
|
@@ -5259,7 +5376,7 @@ var SimpleConversationItem = ({
|
|
|
5259
5376
|
}
|
|
5260
5377
|
},
|
|
5261
5378
|
children: [
|
|
5262
|
-
!isMobile && !isEditing && /* @__PURE__ */
|
|
5379
|
+
!isMobile && !isEditing && /* @__PURE__ */ jsx11(
|
|
5263
5380
|
DragIcon,
|
|
5264
5381
|
{
|
|
5265
5382
|
size: 16,
|
|
@@ -5267,8 +5384,8 @@ var SimpleConversationItem = ({
|
|
|
5267
5384
|
style: { marginRight: 4, cursor: "grab" }
|
|
5268
5385
|
}
|
|
5269
5386
|
),
|
|
5270
|
-
/* @__PURE__ */
|
|
5271
|
-
isEditing ? /* @__PURE__ */
|
|
5387
|
+
/* @__PURE__ */ jsxs8(Box8, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
5388
|
+
isEditing ? /* @__PURE__ */ jsx11(
|
|
5272
5389
|
TextField4,
|
|
5273
5390
|
{
|
|
5274
5391
|
value: editName,
|
|
@@ -5291,7 +5408,7 @@ var SimpleConversationItem = ({
|
|
|
5291
5408
|
}
|
|
5292
5409
|
}
|
|
5293
5410
|
}
|
|
5294
|
-
) : /* @__PURE__ */
|
|
5411
|
+
) : /* @__PURE__ */ jsx11(
|
|
5295
5412
|
Typography5,
|
|
5296
5413
|
{
|
|
5297
5414
|
variant: "body2",
|
|
@@ -5306,7 +5423,7 @@ var SimpleConversationItem = ({
|
|
|
5306
5423
|
children: highlightText(conversation.name, searchQuery)
|
|
5307
5424
|
}
|
|
5308
5425
|
),
|
|
5309
|
-
!isEditing && snippet && /* @__PURE__ */
|
|
5426
|
+
!isEditing && snippet && /* @__PURE__ */ jsx11(
|
|
5310
5427
|
Typography5,
|
|
5311
5428
|
{
|
|
5312
5429
|
variant: "caption",
|
|
@@ -5325,7 +5442,7 @@ var SimpleConversationItem = ({
|
|
|
5325
5442
|
}
|
|
5326
5443
|
)
|
|
5327
5444
|
] }),
|
|
5328
|
-
!isEditing && /* @__PURE__ */
|
|
5445
|
+
!isEditing && /* @__PURE__ */ jsx11(
|
|
5329
5446
|
IconButton5,
|
|
5330
5447
|
{
|
|
5331
5448
|
onClick: handleMenuOpen,
|
|
@@ -5354,10 +5471,10 @@ var SimpleConversationItem = ({
|
|
|
5354
5471
|
}
|
|
5355
5472
|
}
|
|
5356
5473
|
},
|
|
5357
|
-
children: /* @__PURE__ */
|
|
5474
|
+
children: /* @__PURE__ */ jsx11(MoreVertIcon2, { size: 16 })
|
|
5358
5475
|
}
|
|
5359
5476
|
),
|
|
5360
|
-
/* @__PURE__ */
|
|
5477
|
+
/* @__PURE__ */ jsxs8(
|
|
5361
5478
|
Menu2,
|
|
5362
5479
|
{
|
|
5363
5480
|
anchorEl,
|
|
@@ -5384,17 +5501,17 @@ var SimpleConversationItem = ({
|
|
|
5384
5501
|
}
|
|
5385
5502
|
},
|
|
5386
5503
|
children: [
|
|
5387
|
-
onRename && /* @__PURE__ */
|
|
5388
|
-
/* @__PURE__ */
|
|
5389
|
-
/* @__PURE__ */
|
|
5504
|
+
onRename && /* @__PURE__ */ jsxs8(MenuItem2, { onClick: handleEdit, children: [
|
|
5505
|
+
/* @__PURE__ */ jsx11(ListItemIcon2, { children: /* @__PURE__ */ jsx11(EditIcon2, { size: 16 }) }),
|
|
5506
|
+
/* @__PURE__ */ jsx11(ListItemText2, { children: "Rename" })
|
|
5390
5507
|
] }),
|
|
5391
|
-
onMove && /* @__PURE__ */
|
|
5392
|
-
/* @__PURE__ */
|
|
5393
|
-
/* @__PURE__ */
|
|
5508
|
+
onMove && /* @__PURE__ */ jsxs8(MenuItem2, { onClick: handleMove, children: [
|
|
5509
|
+
/* @__PURE__ */ jsx11(ListItemIcon2, { children: /* @__PURE__ */ jsx11(MoveIcon, { size: 16 }) }),
|
|
5510
|
+
/* @__PURE__ */ jsx11(ListItemText2, { children: "Move to Project" })
|
|
5394
5511
|
] }),
|
|
5395
|
-
/* @__PURE__ */
|
|
5396
|
-
/* @__PURE__ */
|
|
5397
|
-
/* @__PURE__ */
|
|
5512
|
+
/* @__PURE__ */ jsxs8(MenuItem2, { onClick: handleDelete, children: [
|
|
5513
|
+
/* @__PURE__ */ jsx11(ListItemIcon2, { children: /* @__PURE__ */ jsx11(DeleteIcon2, { size: 16 }) }),
|
|
5514
|
+
/* @__PURE__ */ jsx11(ListItemText2, { children: "Delete" })
|
|
5398
5515
|
] })
|
|
5399
5516
|
]
|
|
5400
5517
|
}
|
|
@@ -5402,7 +5519,7 @@ var SimpleConversationItem = ({
|
|
|
5402
5519
|
]
|
|
5403
5520
|
}
|
|
5404
5521
|
),
|
|
5405
|
-
isMobile && /* @__PURE__ */
|
|
5522
|
+
isMobile && /* @__PURE__ */ jsxs8(
|
|
5406
5523
|
Dialog2,
|
|
5407
5524
|
{
|
|
5408
5525
|
open: showRenameDialog,
|
|
@@ -5418,8 +5535,8 @@ var SimpleConversationItem = ({
|
|
|
5418
5535
|
}
|
|
5419
5536
|
},
|
|
5420
5537
|
children: [
|
|
5421
|
-
/* @__PURE__ */
|
|
5422
|
-
/* @__PURE__ */
|
|
5538
|
+
/* @__PURE__ */ jsx11(DialogTitle2, { sx: { pb: 1 }, children: "Rename Conversation" }),
|
|
5539
|
+
/* @__PURE__ */ jsx11(DialogContent2, { children: /* @__PURE__ */ jsx11(
|
|
5423
5540
|
TextField4,
|
|
5424
5541
|
{
|
|
5425
5542
|
value: editName,
|
|
@@ -5432,8 +5549,8 @@ var SimpleConversationItem = ({
|
|
|
5432
5549
|
}
|
|
5433
5550
|
}
|
|
5434
5551
|
) }),
|
|
5435
|
-
/* @__PURE__ */
|
|
5436
|
-
/* @__PURE__ */
|
|
5552
|
+
/* @__PURE__ */ jsxs8(DialogActions2, { sx: { px: 3, pb: 2 }, children: [
|
|
5553
|
+
/* @__PURE__ */ jsx11(
|
|
5437
5554
|
Button4,
|
|
5438
5555
|
{
|
|
5439
5556
|
onClick: () => {
|
|
@@ -5443,7 +5560,7 @@ var SimpleConversationItem = ({
|
|
|
5443
5560
|
children: "Cancel"
|
|
5444
5561
|
}
|
|
5445
5562
|
),
|
|
5446
|
-
/* @__PURE__ */
|
|
5563
|
+
/* @__PURE__ */ jsx11(
|
|
5447
5564
|
Button4,
|
|
5448
5565
|
{
|
|
5449
5566
|
onClick: () => {
|
|
@@ -5464,20 +5581,20 @@ var SimpleConversationItem = ({
|
|
|
5464
5581
|
var simple_conversation_item_default = SimpleConversationItem;
|
|
5465
5582
|
|
|
5466
5583
|
// src/chat/project-header.tsx
|
|
5467
|
-
import { useRef as useRef7, useState as
|
|
5584
|
+
import { useRef as useRef7, useState as useState11 } from "react";
|
|
5468
5585
|
import {
|
|
5469
|
-
Box as
|
|
5586
|
+
Box as Box9,
|
|
5470
5587
|
Typography as Typography6,
|
|
5471
5588
|
IconButton as IconButton6,
|
|
5472
5589
|
Avatar as Avatar5,
|
|
5473
5590
|
Chip as Chip3,
|
|
5474
|
-
Tooltip as
|
|
5591
|
+
Tooltip as Tooltip3,
|
|
5475
5592
|
TextField as TextField5,
|
|
5476
5593
|
alpha as alpha5
|
|
5477
5594
|
} from "@mui/material";
|
|
5478
5595
|
import { ChevronDown as ExpandMoreIcon2, ChevronUp as ExpandLessIcon, Plus as AddIcon3, Folder as FolderIcon3, FolderOpen as FolderOpenIcon, Inbox as InboxIcon2, X as CloseIcon3, Check as CheckIcon2 } from "lucide-react";
|
|
5479
5596
|
import { useTheme as useTheme9 } from "@mui/material/styles";
|
|
5480
|
-
import { jsx as
|
|
5597
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
5481
5598
|
var ProjectHeader = ({
|
|
5482
5599
|
projectId,
|
|
5483
5600
|
projectName,
|
|
@@ -5494,9 +5611,9 @@ var ProjectHeader = ({
|
|
|
5494
5611
|
const theme = useTheme9();
|
|
5495
5612
|
const { createNewConversation } = useConversationStore();
|
|
5496
5613
|
const { renameProject } = useProjectStore();
|
|
5497
|
-
const [isHovered, setIsHovered] =
|
|
5498
|
-
const [isDragOver, setIsDragOver] =
|
|
5499
|
-
const [renameDraft, setRenameDraft] =
|
|
5614
|
+
const [isHovered, setIsHovered] = useState11(false);
|
|
5615
|
+
const [isDragOver, setIsDragOver] = useState11(false);
|
|
5616
|
+
const [renameDraft, setRenameDraft] = useState11(projectName);
|
|
5500
5617
|
const renameActionRef = useRef7("none");
|
|
5501
5618
|
const isUngrouped = projectId === null;
|
|
5502
5619
|
const Icon = isCollapsed ? FolderIcon3 : FolderOpenIcon;
|
|
@@ -5543,8 +5660,8 @@ var ProjectHeader = ({
|
|
|
5543
5660
|
setRenameDraft(projectName);
|
|
5544
5661
|
onRenameComplete?.();
|
|
5545
5662
|
};
|
|
5546
|
-
return /* @__PURE__ */
|
|
5547
|
-
|
|
5663
|
+
return /* @__PURE__ */ jsxs9(
|
|
5664
|
+
Box9,
|
|
5548
5665
|
{
|
|
5549
5666
|
"data-project-id": projectId ?? "__ungrouped",
|
|
5550
5667
|
onMouseEnter: () => setIsHovered(true),
|
|
@@ -5570,7 +5687,7 @@ var ProjectHeader = ({
|
|
|
5570
5687
|
} : {}
|
|
5571
5688
|
},
|
|
5572
5689
|
children: [
|
|
5573
|
-
/* @__PURE__ */
|
|
5690
|
+
/* @__PURE__ */ jsx12(
|
|
5574
5691
|
Avatar5,
|
|
5575
5692
|
{
|
|
5576
5693
|
sx: {
|
|
@@ -5579,17 +5696,17 @@ var ProjectHeader = ({
|
|
|
5579
5696
|
height: 28,
|
|
5580
5697
|
mr: 1.5
|
|
5581
5698
|
},
|
|
5582
|
-
children: isUngrouped ? /* @__PURE__ */
|
|
5699
|
+
children: isUngrouped ? /* @__PURE__ */ jsx12(
|
|
5583
5700
|
InboxIcon2,
|
|
5584
5701
|
{
|
|
5585
5702
|
size: 16,
|
|
5586
5703
|
color: theme.palette.text.disabled,
|
|
5587
5704
|
style: { opacity: 0.7 }
|
|
5588
5705
|
}
|
|
5589
|
-
) : /* @__PURE__ */
|
|
5706
|
+
) : /* @__PURE__ */ jsx12(Icon, { size: 16 })
|
|
5590
5707
|
}
|
|
5591
5708
|
),
|
|
5592
|
-
isRenaming && !isUngrouped ? /* @__PURE__ */
|
|
5709
|
+
isRenaming && !isUngrouped ? /* @__PURE__ */ jsx12(
|
|
5593
5710
|
TextField5,
|
|
5594
5711
|
{
|
|
5595
5712
|
value: renameDraft,
|
|
@@ -5636,7 +5753,7 @@ var ProjectHeader = ({
|
|
|
5636
5753
|
}
|
|
5637
5754
|
}
|
|
5638
5755
|
}
|
|
5639
|
-
) : /* @__PURE__ */
|
|
5756
|
+
) : /* @__PURE__ */ jsxs9(
|
|
5640
5757
|
Typography6,
|
|
5641
5758
|
{
|
|
5642
5759
|
variant: "subtitle2",
|
|
@@ -5649,7 +5766,7 @@ var ProjectHeader = ({
|
|
|
5649
5766
|
},
|
|
5650
5767
|
children: [
|
|
5651
5768
|
projectName,
|
|
5652
|
-
isDragOver && /* @__PURE__ */
|
|
5769
|
+
isDragOver && /* @__PURE__ */ jsx12(
|
|
5653
5770
|
Typography6,
|
|
5654
5771
|
{
|
|
5655
5772
|
component: "span",
|
|
@@ -5665,7 +5782,7 @@ var ProjectHeader = ({
|
|
|
5665
5782
|
]
|
|
5666
5783
|
}
|
|
5667
5784
|
),
|
|
5668
|
-
/* @__PURE__ */
|
|
5785
|
+
/* @__PURE__ */ jsx12(
|
|
5669
5786
|
Chip3,
|
|
5670
5787
|
{
|
|
5671
5788
|
label: conversationCount,
|
|
@@ -5685,8 +5802,8 @@ var ProjectHeader = ({
|
|
|
5685
5802
|
}
|
|
5686
5803
|
}
|
|
5687
5804
|
),
|
|
5688
|
-
isRenaming && !isUngrouped && /* @__PURE__ */
|
|
5689
|
-
/* @__PURE__ */
|
|
5805
|
+
isRenaming && !isUngrouped && /* @__PURE__ */ jsxs9(Box9, { sx: { display: "flex", alignItems: "center", gap: 0.5, ml: 1 }, children: [
|
|
5806
|
+
/* @__PURE__ */ jsx12(Tooltip3, { title: "Cancel and remove", children: /* @__PURE__ */ jsx12(
|
|
5690
5807
|
IconButton6,
|
|
5691
5808
|
{
|
|
5692
5809
|
size: "small",
|
|
@@ -5696,10 +5813,10 @@ var ProjectHeader = ({
|
|
|
5696
5813
|
onRenameCancelDelete ? onRenameCancelDelete() : cancelRename();
|
|
5697
5814
|
},
|
|
5698
5815
|
sx: { color: alpha5(theme.palette.error.main, 0.9) },
|
|
5699
|
-
children: /* @__PURE__ */
|
|
5816
|
+
children: /* @__PURE__ */ jsx12(CloseIcon3, { size: 16 })
|
|
5700
5817
|
}
|
|
5701
5818
|
) }),
|
|
5702
|
-
/* @__PURE__ */
|
|
5819
|
+
/* @__PURE__ */ jsx12(Tooltip3, { title: "Save", children: /* @__PURE__ */ jsx12(
|
|
5703
5820
|
IconButton6,
|
|
5704
5821
|
{
|
|
5705
5822
|
size: "small",
|
|
@@ -5709,11 +5826,11 @@ var ProjectHeader = ({
|
|
|
5709
5826
|
commitRename();
|
|
5710
5827
|
},
|
|
5711
5828
|
sx: { color: theme.palette.success.main },
|
|
5712
|
-
children: /* @__PURE__ */
|
|
5829
|
+
children: /* @__PURE__ */ jsx12(CheckIcon2, { size: 16 })
|
|
5713
5830
|
}
|
|
5714
5831
|
) })
|
|
5715
5832
|
] }),
|
|
5716
|
-
isHovered && !isDragOver && !isUngrouped && !isRenaming && /* @__PURE__ */
|
|
5833
|
+
isHovered && !isDragOver && !isUngrouped && !isRenaming && /* @__PURE__ */ jsx12(Tooltip3, { title: `Add conversation to ${projectName.toLowerCase()}`, arrow: true, children: /* @__PURE__ */ jsx12(
|
|
5717
5834
|
IconButton6,
|
|
5718
5835
|
{
|
|
5719
5836
|
onClick: handleAddConversation,
|
|
@@ -5730,10 +5847,10 @@ var ProjectHeader = ({
|
|
|
5730
5847
|
},
|
|
5731
5848
|
transition: "all 0.2s ease"
|
|
5732
5849
|
},
|
|
5733
|
-
children: /* @__PURE__ */
|
|
5850
|
+
children: /* @__PURE__ */ jsx12(AddIcon3, { size: 16 })
|
|
5734
5851
|
}
|
|
5735
5852
|
) }),
|
|
5736
|
-
!isUngrouped && !isRenaming && /* @__PURE__ */
|
|
5853
|
+
!isUngrouped && !isRenaming && /* @__PURE__ */ jsx12(
|
|
5737
5854
|
IconButton6,
|
|
5738
5855
|
{
|
|
5739
5856
|
size: "small",
|
|
@@ -5741,7 +5858,7 @@ var ProjectHeader = ({
|
|
|
5741
5858
|
color: theme.palette.text.secondary,
|
|
5742
5859
|
transition: "transform 0.2s ease"
|
|
5743
5860
|
},
|
|
5744
|
-
children: isCollapsed ? /* @__PURE__ */
|
|
5861
|
+
children: isCollapsed ? /* @__PURE__ */ jsx12(ExpandMoreIcon2, { size: 16 }) : /* @__PURE__ */ jsx12(ExpandLessIcon, { size: 16 })
|
|
5745
5862
|
}
|
|
5746
5863
|
)
|
|
5747
5864
|
]
|
|
@@ -5763,7 +5880,7 @@ var TOOLTIP_COPY = {
|
|
|
5763
5880
|
var tooltip = (key) => TOOLTIP_COPY[key];
|
|
5764
5881
|
|
|
5765
5882
|
// src/chat/conversation-drawer.tsx
|
|
5766
|
-
import { Fragment as Fragment6, jsx as
|
|
5883
|
+
import { Fragment as Fragment6, jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
5767
5884
|
var BANDIT_AVATAR = "https://cdn.burtson.ai/images/bandit-head.png";
|
|
5768
5885
|
var coerceOptionalString = (value) => {
|
|
5769
5886
|
if (typeof value !== "string") return void 0;
|
|
@@ -5814,21 +5931,22 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5814
5931
|
createProject,
|
|
5815
5932
|
deleteProject
|
|
5816
5933
|
} = useProjectStore();
|
|
5817
|
-
const [projectManagementOpen, setProjectManagementOpen] =
|
|
5818
|
-
const [
|
|
5934
|
+
const [projectManagementOpen, setProjectManagementOpen] = useState12(false);
|
|
5935
|
+
const [memoryModalOpen, setMemoryModalOpen] = useState12(false);
|
|
5936
|
+
const [collapsedProjects, setCollapsedProjects] = useState12(/* @__PURE__ */ new Set());
|
|
5819
5937
|
const didInitCollapseRef = useRef8(false);
|
|
5820
|
-
const [searchQuery, setSearchQuery] =
|
|
5821
|
-
const [menuAnchorEl, setMenuAnchorEl] =
|
|
5822
|
-
const [clearConfirmOpen, setClearConfirmOpen] =
|
|
5823
|
-
const [moveModalOpen, setMoveModalOpen] =
|
|
5824
|
-
const [conversationToMove, setConversationToMove] =
|
|
5825
|
-
const [renameProjectId, setRenameProjectId] =
|
|
5938
|
+
const [searchQuery, setSearchQuery] = useState12("");
|
|
5939
|
+
const [menuAnchorEl, setMenuAnchorEl] = useState12(null);
|
|
5940
|
+
const [clearConfirmOpen, setClearConfirmOpen] = useState12(false);
|
|
5941
|
+
const [moveModalOpen, setMoveModalOpen] = useState12(false);
|
|
5942
|
+
const [conversationToMove, setConversationToMove] = useState12(null);
|
|
5943
|
+
const [renameProjectId, setRenameProjectId] = useState12(null);
|
|
5826
5944
|
const getCustomClaim = useCallback4((key) => {
|
|
5827
5945
|
if (!user) return void 0;
|
|
5828
5946
|
const record = user;
|
|
5829
5947
|
return coerceOptionalString(record[key]);
|
|
5830
5948
|
}, [user]);
|
|
5831
|
-
const userDisplayName =
|
|
5949
|
+
const userDisplayName = useMemo2(() => {
|
|
5832
5950
|
if (!user) return void 0;
|
|
5833
5951
|
const candidateFields = [
|
|
5834
5952
|
coerceOptionalString(user.name),
|
|
@@ -5843,7 +5961,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5843
5961
|
if (trimmedEmail) return trimmedEmail;
|
|
5844
5962
|
return user.sub;
|
|
5845
5963
|
}, [user, getCustomClaim]);
|
|
5846
|
-
const userSecondaryText =
|
|
5964
|
+
const userSecondaryText = useMemo2(() => {
|
|
5847
5965
|
if (!user) return void 0;
|
|
5848
5966
|
const trimmedEmail = coerceOptionalString(user.email);
|
|
5849
5967
|
if (trimmedEmail && trimmedEmail !== userDisplayName) {
|
|
@@ -5855,7 +5973,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5855
5973
|
}
|
|
5856
5974
|
return void 0;
|
|
5857
5975
|
}, [user, userDisplayName]);
|
|
5858
|
-
const [avatarImage, setAvatarImage] =
|
|
5976
|
+
const [avatarImage, setAvatarImage] = useState12(BANDIT_AVATAR);
|
|
5859
5977
|
useEffect10(() => {
|
|
5860
5978
|
let active2 = true;
|
|
5861
5979
|
let objectUrl = null;
|
|
@@ -5897,7 +6015,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5897
6015
|
};
|
|
5898
6016
|
}, [getCustomClaim]);
|
|
5899
6017
|
const avatarLabel = userDisplayName || user?.email || "Bandit";
|
|
5900
|
-
const avatarInitials =
|
|
6018
|
+
const avatarInitials = useMemo2(() => deriveInitials(avatarLabel), [avatarLabel]);
|
|
5901
6019
|
useEffect10(() => {
|
|
5902
6020
|
if (!projectsHydrated) {
|
|
5903
6021
|
hydrateProjects();
|
|
@@ -5916,7 +6034,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5916
6034
|
const end = Math.min(text.length, idx + query.length + 60);
|
|
5917
6035
|
return text.slice(start, end).replace(/\s+/g, " ").trim();
|
|
5918
6036
|
};
|
|
5919
|
-
const projectGroups =
|
|
6037
|
+
const projectGroups = useMemo2(() => {
|
|
5920
6038
|
const groups = projects.map((project) => ({
|
|
5921
6039
|
id: project.id,
|
|
5922
6040
|
name: project.name,
|
|
@@ -5939,7 +6057,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5939
6057
|
}
|
|
5940
6058
|
return groups.filter((group) => group.conversations.length > 0 || group.id !== null);
|
|
5941
6059
|
}, [projects, conversations, collapsedProjects]);
|
|
5942
|
-
const filteredProjectGroups =
|
|
6060
|
+
const filteredProjectGroups = useMemo2(() => {
|
|
5943
6061
|
if (!searchQuery.trim()) return projectGroups;
|
|
5944
6062
|
const query = searchQuery.toLowerCase();
|
|
5945
6063
|
return projectGroups.map((group) => {
|
|
@@ -6010,8 +6128,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6010
6128
|
setMoveModalOpen(false);
|
|
6011
6129
|
setConversationToMove(null);
|
|
6012
6130
|
};
|
|
6013
|
-
return /* @__PURE__ */
|
|
6014
|
-
/* @__PURE__ */
|
|
6131
|
+
return /* @__PURE__ */ jsxs10(Fragment6, { children: [
|
|
6132
|
+
/* @__PURE__ */ jsxs10(
|
|
6015
6133
|
Drawer,
|
|
6016
6134
|
{
|
|
6017
6135
|
anchor: "left",
|
|
@@ -6053,8 +6171,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6053
6171
|
}
|
|
6054
6172
|
},
|
|
6055
6173
|
children: [
|
|
6056
|
-
/* @__PURE__ */
|
|
6057
|
-
|
|
6174
|
+
/* @__PURE__ */ jsxs10(
|
|
6175
|
+
Box10,
|
|
6058
6176
|
{
|
|
6059
6177
|
sx: {
|
|
6060
6178
|
p: 2,
|
|
@@ -6065,7 +6183,23 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6065
6183
|
gap: 1
|
|
6066
6184
|
},
|
|
6067
6185
|
children: [
|
|
6068
|
-
/* @__PURE__ */
|
|
6186
|
+
/* @__PURE__ */ jsx13(Tooltip4, { title: "Memories", arrow: true, children: /* @__PURE__ */ jsx13(
|
|
6187
|
+
IconButton7,
|
|
6188
|
+
{
|
|
6189
|
+
onClick: () => setMemoryModalOpen(true),
|
|
6190
|
+
size: "small",
|
|
6191
|
+
"aria-label": "Memories",
|
|
6192
|
+
sx: {
|
|
6193
|
+
color: theme.palette.text.secondary,
|
|
6194
|
+
"&:hover": {
|
|
6195
|
+
color: theme.palette.primary.main,
|
|
6196
|
+
bgcolor: alpha6(theme.palette.primary.main, 0.1)
|
|
6197
|
+
}
|
|
6198
|
+
},
|
|
6199
|
+
children: /* @__PURE__ */ jsx13(MemoryIcon, {})
|
|
6200
|
+
}
|
|
6201
|
+
) }),
|
|
6202
|
+
/* @__PURE__ */ jsx13(Tooltip4, { title: tooltip("manageProjects"), arrow: true, children: /* @__PURE__ */ jsx13(
|
|
6069
6203
|
IconButton7,
|
|
6070
6204
|
{
|
|
6071
6205
|
onClick: () => setProjectManagementOpen(true),
|
|
@@ -6078,10 +6212,10 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6078
6212
|
bgcolor: alpha6(theme.palette.primary.main, 0.1)
|
|
6079
6213
|
}
|
|
6080
6214
|
},
|
|
6081
|
-
children: /* @__PURE__ */
|
|
6215
|
+
children: /* @__PURE__ */ jsx13(FolderIcon4, {})
|
|
6082
6216
|
}
|
|
6083
6217
|
) }),
|
|
6084
|
-
/* @__PURE__ */
|
|
6218
|
+
/* @__PURE__ */ jsx13(Tooltip4, { title: tooltip("conversationOptions"), arrow: true, children: /* @__PURE__ */ jsx13(
|
|
6085
6219
|
IconButton7,
|
|
6086
6220
|
{
|
|
6087
6221
|
onClick: handleMenuOpen,
|
|
@@ -6094,10 +6228,10 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6094
6228
|
bgcolor: alpha6(theme.palette.text.primary, 0.1)
|
|
6095
6229
|
}
|
|
6096
6230
|
},
|
|
6097
|
-
children: /* @__PURE__ */
|
|
6231
|
+
children: /* @__PURE__ */ jsx13(MoreVertIcon3, {})
|
|
6098
6232
|
}
|
|
6099
6233
|
) }),
|
|
6100
|
-
isMobile && /* @__PURE__ */
|
|
6234
|
+
isMobile && /* @__PURE__ */ jsx13(Tooltip4, { title: tooltip("closeConversationsPanel"), children: /* @__PURE__ */ jsx13(
|
|
6101
6235
|
IconButton7,
|
|
6102
6236
|
{
|
|
6103
6237
|
onClick: (e) => {
|
|
@@ -6114,13 +6248,13 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6114
6248
|
bgcolor: alpha6(theme.palette.error.main, 0.1)
|
|
6115
6249
|
}
|
|
6116
6250
|
},
|
|
6117
|
-
children: /* @__PURE__ */
|
|
6251
|
+
children: /* @__PURE__ */ jsx13(CloseIcon4, {})
|
|
6118
6252
|
}
|
|
6119
6253
|
) })
|
|
6120
6254
|
]
|
|
6121
6255
|
}
|
|
6122
6256
|
),
|
|
6123
|
-
/* @__PURE__ */
|
|
6257
|
+
/* @__PURE__ */ jsx13(Box10, { sx: { p: 2, pb: 1 }, children: /* @__PURE__ */ jsx13(
|
|
6124
6258
|
TextField6,
|
|
6125
6259
|
{
|
|
6126
6260
|
fullWidth: true,
|
|
@@ -6130,8 +6264,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6130
6264
|
onChange: (e) => setSearchQuery(e.target.value),
|
|
6131
6265
|
variant: "outlined",
|
|
6132
6266
|
InputProps: {
|
|
6133
|
-
startAdornment: /* @__PURE__ */
|
|
6134
|
-
endAdornment: searchQuery && /* @__PURE__ */
|
|
6267
|
+
startAdornment: /* @__PURE__ */ jsx13(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx13(SearchIcon, { size: 16, color: theme.palette.text.secondary }) }),
|
|
6268
|
+
endAdornment: searchQuery && /* @__PURE__ */ jsx13(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx13(Tooltip4, { title: tooltip("clearSearch"), children: /* @__PURE__ */ jsx13(
|
|
6135
6269
|
IconButton7,
|
|
6136
6270
|
{
|
|
6137
6271
|
onClick: handleSearchClear,
|
|
@@ -6139,7 +6273,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6139
6273
|
edge: "end",
|
|
6140
6274
|
"aria-label": tooltip("clearSearch"),
|
|
6141
6275
|
sx: { color: theme.palette.text.secondary },
|
|
6142
|
-
children: /* @__PURE__ */
|
|
6276
|
+
children: /* @__PURE__ */ jsx13(ClearIcon, { size: 16 })
|
|
6143
6277
|
}
|
|
6144
6278
|
) }) })
|
|
6145
6279
|
},
|
|
@@ -6156,9 +6290,9 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6156
6290
|
}
|
|
6157
6291
|
}
|
|
6158
6292
|
) }),
|
|
6159
|
-
/* @__PURE__ */
|
|
6160
|
-
/* @__PURE__ */
|
|
6161
|
-
|
|
6293
|
+
/* @__PURE__ */ jsxs10(Box10, { sx: { flex: 1, overflow: "auto", display: "flex", flexDirection: "column" }, children: [
|
|
6294
|
+
/* @__PURE__ */ jsxs10(
|
|
6295
|
+
Box10,
|
|
6162
6296
|
{
|
|
6163
6297
|
onClick: async () => {
|
|
6164
6298
|
const names = new Set(projects.map((p) => p.name));
|
|
@@ -6192,8 +6326,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6192
6326
|
"&:hover": { bgcolor: alpha6(theme.palette.text.primary, 0.04) }
|
|
6193
6327
|
},
|
|
6194
6328
|
children: [
|
|
6195
|
-
/* @__PURE__ */
|
|
6196
|
-
|
|
6329
|
+
/* @__PURE__ */ jsx13(
|
|
6330
|
+
Box10,
|
|
6197
6331
|
{
|
|
6198
6332
|
sx: {
|
|
6199
6333
|
width: 28,
|
|
@@ -6205,10 +6339,10 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6205
6339
|
justifyContent: "center",
|
|
6206
6340
|
flexShrink: 0
|
|
6207
6341
|
},
|
|
6208
|
-
children: /* @__PURE__ */
|
|
6342
|
+
children: /* @__PURE__ */ jsx13(FolderIcon4, { size: 16, color: theme.palette.success.main })
|
|
6209
6343
|
}
|
|
6210
6344
|
),
|
|
6211
|
-
/* @__PURE__ */
|
|
6345
|
+
/* @__PURE__ */ jsx13(
|
|
6212
6346
|
Typography7,
|
|
6213
6347
|
{
|
|
6214
6348
|
variant: "subtitle2",
|
|
@@ -6216,22 +6350,22 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6216
6350
|
children: "New Project"
|
|
6217
6351
|
}
|
|
6218
6352
|
),
|
|
6219
|
-
/* @__PURE__ */
|
|
6353
|
+
/* @__PURE__ */ jsx13(Tooltip4, { title: tooltip("addProject"), arrow: true, children: /* @__PURE__ */ jsx13(
|
|
6220
6354
|
IconButton7,
|
|
6221
6355
|
{
|
|
6222
6356
|
size: "small",
|
|
6223
6357
|
"aria-label": tooltip("addProject"),
|
|
6224
6358
|
sx: { color: theme.palette.success.main },
|
|
6225
|
-
children: /* @__PURE__ */
|
|
6359
|
+
children: /* @__PURE__ */ jsx13(AddIcon4, { size: 16 })
|
|
6226
6360
|
}
|
|
6227
6361
|
) })
|
|
6228
6362
|
]
|
|
6229
6363
|
}
|
|
6230
6364
|
),
|
|
6231
|
-
/* @__PURE__ */
|
|
6232
|
-
filteredProjectGroups.map((group, index) => /* @__PURE__ */
|
|
6233
|
-
group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */
|
|
6234
|
-
|
|
6365
|
+
/* @__PURE__ */ jsx13(Divider2, { sx: { opacity: 0.3 } }),
|
|
6366
|
+
filteredProjectGroups.map((group, index) => /* @__PURE__ */ jsxs10(Box10, { children: [
|
|
6367
|
+
group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */ jsxs10(
|
|
6368
|
+
Box10,
|
|
6235
6369
|
{
|
|
6236
6370
|
sx: {
|
|
6237
6371
|
py: 2,
|
|
@@ -6241,9 +6375,9 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6241
6375
|
gap: 2
|
|
6242
6376
|
},
|
|
6243
6377
|
children: [
|
|
6244
|
-
/* @__PURE__ */
|
|
6245
|
-
/* @__PURE__ */
|
|
6246
|
-
/* @__PURE__ */
|
|
6378
|
+
/* @__PURE__ */ jsx13(Divider2, { sx: { flex: 1, opacity: 0.6 } }),
|
|
6379
|
+
/* @__PURE__ */ jsxs10(Box10, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
6380
|
+
/* @__PURE__ */ jsx13(
|
|
6247
6381
|
InboxIcon3,
|
|
6248
6382
|
{
|
|
6249
6383
|
size: 14,
|
|
@@ -6251,7 +6385,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6251
6385
|
style: { opacity: 0.7 }
|
|
6252
6386
|
}
|
|
6253
6387
|
),
|
|
6254
|
-
/* @__PURE__ */
|
|
6388
|
+
/* @__PURE__ */ jsx13(
|
|
6255
6389
|
Typography7,
|
|
6256
6390
|
{
|
|
6257
6391
|
variant: "caption",
|
|
@@ -6266,12 +6400,12 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6266
6400
|
}
|
|
6267
6401
|
)
|
|
6268
6402
|
] }),
|
|
6269
|
-
/* @__PURE__ */
|
|
6403
|
+
/* @__PURE__ */ jsx13(Divider2, { sx: { flex: 1, opacity: 0.6 } })
|
|
6270
6404
|
]
|
|
6271
6405
|
}
|
|
6272
6406
|
),
|
|
6273
|
-
group.id !== null ? /* @__PURE__ */
|
|
6274
|
-
/* @__PURE__ */
|
|
6407
|
+
group.id !== null ? /* @__PURE__ */ jsxs10(Fragment6, { children: [
|
|
6408
|
+
/* @__PURE__ */ jsx13(
|
|
6275
6409
|
project_header_default,
|
|
6276
6410
|
{
|
|
6277
6411
|
projectId: group.id,
|
|
@@ -6300,8 +6434,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6300
6434
|
}
|
|
6301
6435
|
}
|
|
6302
6436
|
),
|
|
6303
|
-
/* @__PURE__ */
|
|
6304
|
-
group.conversations.map((conversation) => /* @__PURE__ */
|
|
6437
|
+
/* @__PURE__ */ jsx13(Collapse2, { in: !group.collapsed, children: /* @__PURE__ */ jsxs10(Box10, { sx: { pb: 1 }, children: [
|
|
6438
|
+
group.conversations.map((conversation) => /* @__PURE__ */ jsx13(
|
|
6305
6439
|
simple_conversation_item_default,
|
|
6306
6440
|
{
|
|
6307
6441
|
conversation,
|
|
@@ -6321,8 +6455,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6321
6455
|
},
|
|
6322
6456
|
conversation.id
|
|
6323
6457
|
)),
|
|
6324
|
-
group.conversations.length === 0 && !group.collapsed && group.id !== null && /* @__PURE__ */
|
|
6325
|
-
|
|
6458
|
+
group.conversations.length === 0 && !group.collapsed && group.id !== null && /* @__PURE__ */ jsxs10(
|
|
6459
|
+
Box10,
|
|
6326
6460
|
{
|
|
6327
6461
|
sx: {
|
|
6328
6462
|
p: 3,
|
|
@@ -6330,17 +6464,17 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6330
6464
|
color: theme.palette.text.secondary
|
|
6331
6465
|
},
|
|
6332
6466
|
children: [
|
|
6333
|
-
/* @__PURE__ */
|
|
6334
|
-
/* @__PURE__ */
|
|
6467
|
+
/* @__PURE__ */ jsx13(Typography7, { variant: "body2", children: "No conversations in this project yet" }),
|
|
6468
|
+
/* @__PURE__ */ jsx13(Typography7, { variant: "caption", sx: { mt: 1, display: "block" }, children: "Drag conversations here or use the + button above" })
|
|
6335
6469
|
]
|
|
6336
6470
|
}
|
|
6337
6471
|
)
|
|
6338
6472
|
] }) }),
|
|
6339
|
-
/* @__PURE__ */
|
|
6473
|
+
/* @__PURE__ */ jsx13(Divider2, { sx: { opacity: 0.3 } })
|
|
6340
6474
|
] }) : (
|
|
6341
6475
|
// Special handling for ungrouped - no header, just conversations in scrollable area
|
|
6342
|
-
/* @__PURE__ */
|
|
6343
|
-
|
|
6476
|
+
/* @__PURE__ */ jsx13(
|
|
6477
|
+
Box10,
|
|
6344
6478
|
{
|
|
6345
6479
|
sx: {
|
|
6346
6480
|
minHeight: 0,
|
|
@@ -6353,7 +6487,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6353
6487
|
mx: 1,
|
|
6354
6488
|
mb: 1
|
|
6355
6489
|
},
|
|
6356
|
-
children: group.conversations.map((conversation) => /* @__PURE__ */
|
|
6490
|
+
children: group.conversations.map((conversation) => /* @__PURE__ */ jsx13(
|
|
6357
6491
|
simple_conversation_item_default,
|
|
6358
6492
|
{
|
|
6359
6493
|
conversation,
|
|
@@ -6377,8 +6511,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6377
6511
|
)
|
|
6378
6512
|
)
|
|
6379
6513
|
] }, group.id || "ungrouped")),
|
|
6380
|
-
filteredProjectGroups.length === 0 && /* @__PURE__ */
|
|
6381
|
-
|
|
6514
|
+
filteredProjectGroups.length === 0 && /* @__PURE__ */ jsxs10(
|
|
6515
|
+
Box10,
|
|
6382
6516
|
{
|
|
6383
6517
|
sx: {
|
|
6384
6518
|
flex: 1,
|
|
@@ -6391,14 +6525,14 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6391
6525
|
color: theme.palette.text.secondary
|
|
6392
6526
|
},
|
|
6393
6527
|
children: [
|
|
6394
|
-
/* @__PURE__ */
|
|
6395
|
-
/* @__PURE__ */
|
|
6528
|
+
/* @__PURE__ */ jsx13(Typography7, { variant: "h6", sx: { mb: 1 }, children: searchQuery ? "No conversations found" : "No conversations yet" }),
|
|
6529
|
+
/* @__PURE__ */ jsx13(Typography7, { variant: "body2", sx: { mb: 3, maxWidth: 280 }, children: searchQuery ? `No conversations match "${searchQuery}"` : "Start your first conversation to begin organizing your chats into projects" })
|
|
6396
6530
|
]
|
|
6397
6531
|
}
|
|
6398
6532
|
)
|
|
6399
6533
|
] }),
|
|
6400
|
-
/* @__PURE__ */
|
|
6401
|
-
|
|
6534
|
+
/* @__PURE__ */ jsxs10(
|
|
6535
|
+
Box10,
|
|
6402
6536
|
{
|
|
6403
6537
|
onClick: user ? () => {
|
|
6404
6538
|
window.location.href = "/profile";
|
|
@@ -6419,7 +6553,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6419
6553
|
"&:hover": user ? { bgcolor: alpha6(theme.palette.primary.main, 0.08) } : void 0
|
|
6420
6554
|
},
|
|
6421
6555
|
children: [
|
|
6422
|
-
/* @__PURE__ */
|
|
6556
|
+
/* @__PURE__ */ jsx13(
|
|
6423
6557
|
Avatar6,
|
|
6424
6558
|
{
|
|
6425
6559
|
src: avatarImage,
|
|
@@ -6434,8 +6568,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6434
6568
|
children: avatarInitials
|
|
6435
6569
|
}
|
|
6436
6570
|
),
|
|
6437
|
-
/* @__PURE__ */
|
|
6438
|
-
|
|
6571
|
+
/* @__PURE__ */ jsxs10(
|
|
6572
|
+
Box10,
|
|
6439
6573
|
{
|
|
6440
6574
|
sx: {
|
|
6441
6575
|
minWidth: 0,
|
|
@@ -6447,7 +6581,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6447
6581
|
gap: 0.25
|
|
6448
6582
|
},
|
|
6449
6583
|
children: [
|
|
6450
|
-
/* @__PURE__ */
|
|
6584
|
+
/* @__PURE__ */ jsx13(
|
|
6451
6585
|
Typography7,
|
|
6452
6586
|
{
|
|
6453
6587
|
variant: "subtitle2",
|
|
@@ -6456,7 +6590,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6456
6590
|
children: user ? userDisplayName : "Not signed in"
|
|
6457
6591
|
}
|
|
6458
6592
|
),
|
|
6459
|
-
/* @__PURE__ */
|
|
6593
|
+
/* @__PURE__ */ jsx13(
|
|
6460
6594
|
Typography7,
|
|
6461
6595
|
{
|
|
6462
6596
|
variant: "caption",
|
|
@@ -6468,7 +6602,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6468
6602
|
]
|
|
6469
6603
|
}
|
|
6470
6604
|
),
|
|
6471
|
-
user && /* @__PURE__ */
|
|
6605
|
+
user && /* @__PURE__ */ jsx13(
|
|
6472
6606
|
SettingsIcon2,
|
|
6473
6607
|
{
|
|
6474
6608
|
size: 18,
|
|
@@ -6482,14 +6616,15 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6482
6616
|
]
|
|
6483
6617
|
}
|
|
6484
6618
|
),
|
|
6485
|
-
/* @__PURE__ */
|
|
6619
|
+
/* @__PURE__ */ jsx13(
|
|
6486
6620
|
project_management_modal_default,
|
|
6487
6621
|
{
|
|
6488
6622
|
open: projectManagementOpen,
|
|
6489
6623
|
onClose: () => setProjectManagementOpen(false)
|
|
6490
6624
|
}
|
|
6491
6625
|
),
|
|
6492
|
-
|
|
6626
|
+
/* @__PURE__ */ jsx13(memory_modal_default, { open: memoryModalOpen, onClose: () => setMemoryModalOpen(false) }),
|
|
6627
|
+
conversationToMove && /* @__PURE__ */ jsx13(
|
|
6493
6628
|
move_conversation_modal_default,
|
|
6494
6629
|
{
|
|
6495
6630
|
open: moveModalOpen,
|
|
@@ -6498,7 +6633,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6498
6633
|
currentProjectId: conversationToMove.projectId
|
|
6499
6634
|
}
|
|
6500
6635
|
),
|
|
6501
|
-
/* @__PURE__ */
|
|
6636
|
+
/* @__PURE__ */ jsx13(
|
|
6502
6637
|
Menu3,
|
|
6503
6638
|
{
|
|
6504
6639
|
anchorEl: menuAnchorEl,
|
|
@@ -6512,7 +6647,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6512
6647
|
vertical: "bottom",
|
|
6513
6648
|
horizontal: "right"
|
|
6514
6649
|
},
|
|
6515
|
-
children: /* @__PURE__ */
|
|
6650
|
+
children: /* @__PURE__ */ jsxs10(
|
|
6516
6651
|
MenuItem3,
|
|
6517
6652
|
{
|
|
6518
6653
|
onClick: () => {
|
|
@@ -6521,14 +6656,14 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6521
6656
|
},
|
|
6522
6657
|
sx: { color: theme.palette.error.main },
|
|
6523
6658
|
children: [
|
|
6524
|
-
/* @__PURE__ */
|
|
6525
|
-
/* @__PURE__ */
|
|
6659
|
+
/* @__PURE__ */ jsx13(ListItemIcon3, { children: /* @__PURE__ */ jsx13(DeleteSweepIcon, { size: 16, color: theme.palette.error.main }) }),
|
|
6660
|
+
/* @__PURE__ */ jsx13(ListItemText3, { children: "Clear All Conversations" })
|
|
6526
6661
|
]
|
|
6527
6662
|
}
|
|
6528
6663
|
)
|
|
6529
6664
|
}
|
|
6530
6665
|
),
|
|
6531
|
-
/* @__PURE__ */
|
|
6666
|
+
/* @__PURE__ */ jsxs10(
|
|
6532
6667
|
Dialog3,
|
|
6533
6668
|
{
|
|
6534
6669
|
open: clearConfirmOpen,
|
|
@@ -6536,11 +6671,11 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6536
6671
|
maxWidth: "sm",
|
|
6537
6672
|
fullWidth: true,
|
|
6538
6673
|
children: [
|
|
6539
|
-
/* @__PURE__ */
|
|
6540
|
-
/* @__PURE__ */
|
|
6541
|
-
/* @__PURE__ */
|
|
6542
|
-
/* @__PURE__ */
|
|
6543
|
-
/* @__PURE__ */
|
|
6674
|
+
/* @__PURE__ */ jsx13(DialogTitle3, { children: "Clear All Conversations?" }),
|
|
6675
|
+
/* @__PURE__ */ jsx13(DialogContent3, { children: /* @__PURE__ */ jsx13(Typography7, { children: "This will permanently delete all conversations and cannot be undone. Are you sure you want to continue?" }) }),
|
|
6676
|
+
/* @__PURE__ */ jsxs10(DialogActions3, { children: [
|
|
6677
|
+
/* @__PURE__ */ jsx13(Button5, { onClick: () => setClearConfirmOpen(false), children: "Cancel" }),
|
|
6678
|
+
/* @__PURE__ */ jsx13(
|
|
6544
6679
|
Button5,
|
|
6545
6680
|
{
|
|
6546
6681
|
onClick: handleClearAllConfirm,
|
|
@@ -6558,9 +6693,9 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6558
6693
|
var conversation_drawer_default = ConversationDrawer;
|
|
6559
6694
|
|
|
6560
6695
|
// src/chat/enhanced-mobile-conversations-modal.tsx
|
|
6561
|
-
import { useState as
|
|
6696
|
+
import { useState as useState13, useMemo as useMemo3, useEffect as useEffect11, useRef as useRef9, useCallback as useCallback5 } from "react";
|
|
6562
6697
|
import {
|
|
6563
|
-
Box as
|
|
6698
|
+
Box as Box11,
|
|
6564
6699
|
IconButton as IconButton8,
|
|
6565
6700
|
Modal as Modal2,
|
|
6566
6701
|
Typography as Typography8,
|
|
@@ -6585,7 +6720,7 @@ import {
|
|
|
6585
6720
|
} from "@mui/material";
|
|
6586
6721
|
import { X as CloseIcon5, X as ClearIcon2, Search as SearchIcon2, Folder as FolderIcon5, MoreVertical as MoreVertIcon4, Trash2 as DeleteSweepIcon2, Inbox as InboxIcon4, Plus as AddIcon5 } from "lucide-react";
|
|
6587
6722
|
import { useTheme as useTheme11, alpha as alpha7 } from "@mui/material/styles";
|
|
6588
|
-
import { Fragment as Fragment7, jsx as
|
|
6723
|
+
import { Fragment as Fragment7, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
6589
6724
|
var BANDIT_AVATAR2 = "https://cdn.burtson.ai/images/bandit-head.png";
|
|
6590
6725
|
var coerceOptionalString2 = (value) => {
|
|
6591
6726
|
if (typeof value !== "string") return void 0;
|
|
@@ -6636,24 +6771,24 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6636
6771
|
createProject,
|
|
6637
6772
|
deleteProject
|
|
6638
6773
|
} = useProjectStore();
|
|
6639
|
-
const [projectManagementOpen, setProjectManagementOpen] =
|
|
6640
|
-
const [collapsedProjects, setCollapsedProjects] =
|
|
6774
|
+
const [projectManagementOpen, setProjectManagementOpen] = useState13(false);
|
|
6775
|
+
const [collapsedProjects, setCollapsedProjects] = useState13(/* @__PURE__ */ new Set());
|
|
6641
6776
|
const didInitCollapseRef = useRef9(false);
|
|
6642
|
-
const [searchQuery, setSearchQuery] =
|
|
6643
|
-
const [menuAnchorEl, setMenuAnchorEl] =
|
|
6644
|
-
const [clearConfirmOpen, setClearConfirmOpen] =
|
|
6645
|
-
const [moveModalOpen, setMoveModalOpen] =
|
|
6646
|
-
const [conversationToMove, setConversationToMove] =
|
|
6647
|
-
const [renameProjectId, setRenameProjectId] =
|
|
6648
|
-
const [deletedConversationIds, setDeletedConversationIds] =
|
|
6649
|
-
const [touchDragState, setTouchDragState] =
|
|
6650
|
-
const [avatarImage, setAvatarImage] =
|
|
6777
|
+
const [searchQuery, setSearchQuery] = useState13("");
|
|
6778
|
+
const [menuAnchorEl, setMenuAnchorEl] = useState13(null);
|
|
6779
|
+
const [clearConfirmOpen, setClearConfirmOpen] = useState13(false);
|
|
6780
|
+
const [moveModalOpen, setMoveModalOpen] = useState13(false);
|
|
6781
|
+
const [conversationToMove, setConversationToMove] = useState13(null);
|
|
6782
|
+
const [renameProjectId, setRenameProjectId] = useState13(null);
|
|
6783
|
+
const [deletedConversationIds, setDeletedConversationIds] = useState13(/* @__PURE__ */ new Set());
|
|
6784
|
+
const [touchDragState, setTouchDragState] = useState13({ conversationId: null, originProjectId: null, hoverProjectId: null });
|
|
6785
|
+
const [avatarImage, setAvatarImage] = useState13(BANDIT_AVATAR2);
|
|
6651
6786
|
const getCustomClaim = useCallback5((key) => {
|
|
6652
6787
|
if (!user) return void 0;
|
|
6653
6788
|
const record = user;
|
|
6654
6789
|
return coerceOptionalString2(record[key]);
|
|
6655
6790
|
}, [user]);
|
|
6656
|
-
const userDisplayName =
|
|
6791
|
+
const userDisplayName = useMemo3(() => {
|
|
6657
6792
|
if (!user) return void 0;
|
|
6658
6793
|
const candidateFields = [
|
|
6659
6794
|
coerceOptionalString2(user.name),
|
|
@@ -6668,7 +6803,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6668
6803
|
if (trimmedEmail) return trimmedEmail;
|
|
6669
6804
|
return user.sub;
|
|
6670
6805
|
}, [user, getCustomClaim]);
|
|
6671
|
-
const userSecondaryText =
|
|
6806
|
+
const userSecondaryText = useMemo3(() => {
|
|
6672
6807
|
if (!user) return void 0;
|
|
6673
6808
|
const trimmedEmail = coerceOptionalString2(user.email);
|
|
6674
6809
|
if (trimmedEmail && trimmedEmail !== userDisplayName) {
|
|
@@ -6697,7 +6832,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6697
6832
|
}
|
|
6698
6833
|
}, [open]);
|
|
6699
6834
|
const avatarLabel = userDisplayName || user?.email || "Bandit";
|
|
6700
|
-
const avatarInitials =
|
|
6835
|
+
const avatarInitials = useMemo3(() => deriveInitials2(avatarLabel), [avatarLabel]);
|
|
6701
6836
|
const buildSnippet = (text, query, idx) => {
|
|
6702
6837
|
const start = Math.max(0, idx - 40);
|
|
6703
6838
|
const end = Math.min(text.length, idx + query.length + 60);
|
|
@@ -6716,7 +6851,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6716
6851
|
}
|
|
6717
6852
|
}
|
|
6718
6853
|
}, [projectsHydrated, projects]);
|
|
6719
|
-
const projectGroups =
|
|
6854
|
+
const projectGroups = useMemo3(() => {
|
|
6720
6855
|
const visibleConversations = conversations.filter(
|
|
6721
6856
|
(conversation) => !deletedConversationIds.has(conversation.id)
|
|
6722
6857
|
);
|
|
@@ -6742,11 +6877,11 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6742
6877
|
}
|
|
6743
6878
|
return groups.filter((group) => group.conversations.length > 0 || group.id !== null);
|
|
6744
6879
|
}, [projects, conversations, collapsedProjects, deletedConversationIds]);
|
|
6745
|
-
const visibleConversationCount =
|
|
6880
|
+
const visibleConversationCount = useMemo3(
|
|
6746
6881
|
() => projectGroups.reduce((total, group) => total + group.conversations.length, 0),
|
|
6747
6882
|
[projectGroups]
|
|
6748
6883
|
);
|
|
6749
|
-
const filteredProjectGroups =
|
|
6884
|
+
const filteredProjectGroups = useMemo3(() => {
|
|
6750
6885
|
if (!searchQuery.trim()) return projectGroups;
|
|
6751
6886
|
const query = searchQuery.toLowerCase();
|
|
6752
6887
|
return projectGroups.map((group) => {
|
|
@@ -6822,11 +6957,11 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6822
6957
|
return { conversationId: null, originProjectId: null, hoverProjectId: null };
|
|
6823
6958
|
});
|
|
6824
6959
|
}, [getProjectIdFromPoint, moveConversationToProject]);
|
|
6825
|
-
const activeDragConversation =
|
|
6960
|
+
const activeDragConversation = useMemo3(() => {
|
|
6826
6961
|
if (!touchDragState.conversationId) return null;
|
|
6827
6962
|
return conversations.find((conv) => conv.id === touchDragState.conversationId) || null;
|
|
6828
6963
|
}, [touchDragState.conversationId, conversations]);
|
|
6829
|
-
const activeHoverLabel =
|
|
6964
|
+
const activeHoverLabel = useMemo3(() => {
|
|
6830
6965
|
if (!touchDragState.hoverProjectId) return "";
|
|
6831
6966
|
if (touchDragState.hoverProjectId === "__ungrouped") return "Ungrouped";
|
|
6832
6967
|
const project = projects.find((p) => p.id === touchDragState.hoverProjectId);
|
|
@@ -6890,8 +7025,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6890
7025
|
return changed ? next : prev;
|
|
6891
7026
|
});
|
|
6892
7027
|
}, [conversations]);
|
|
6893
|
-
return /* @__PURE__ */
|
|
6894
|
-
/* @__PURE__ */
|
|
7028
|
+
return /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
7029
|
+
/* @__PURE__ */ jsx14(
|
|
6895
7030
|
Modal2,
|
|
6896
7031
|
{
|
|
6897
7032
|
open,
|
|
@@ -6900,8 +7035,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6900
7035
|
display: "flex",
|
|
6901
7036
|
alignItems: "flex-end"
|
|
6902
7037
|
},
|
|
6903
|
-
children: /* @__PURE__ */
|
|
6904
|
-
|
|
7038
|
+
children: /* @__PURE__ */ jsx14(Slide, { direction: "up", in: open, children: /* @__PURE__ */ jsxs11(
|
|
7039
|
+
Box11,
|
|
6905
7040
|
{
|
|
6906
7041
|
sx: {
|
|
6907
7042
|
width: "100%",
|
|
@@ -6914,7 +7049,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6914
7049
|
overflow: "hidden"
|
|
6915
7050
|
},
|
|
6916
7051
|
children: [
|
|
6917
|
-
/* @__PURE__ */
|
|
7052
|
+
/* @__PURE__ */ jsx14(
|
|
6918
7053
|
AppBar,
|
|
6919
7054
|
{
|
|
6920
7055
|
position: "static",
|
|
@@ -6924,9 +7059,9 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6924
7059
|
color: theme.palette.text.primary,
|
|
6925
7060
|
borderBottom: `1px solid ${theme.palette.divider}`
|
|
6926
7061
|
},
|
|
6927
|
-
children: /* @__PURE__ */
|
|
6928
|
-
/* @__PURE__ */
|
|
6929
|
-
visibleConversationCount > 0 && /* @__PURE__ */
|
|
7062
|
+
children: /* @__PURE__ */ jsxs11(Toolbar, { children: [
|
|
7063
|
+
/* @__PURE__ */ jsx14(Typography8, { variant: "h6", sx: { flex: 1, fontWeight: 600 }, children: "Conversations" }),
|
|
7064
|
+
visibleConversationCount > 0 && /* @__PURE__ */ jsx14(
|
|
6930
7065
|
Chip4,
|
|
6931
7066
|
{
|
|
6932
7067
|
label: visibleConversationCount,
|
|
@@ -6939,34 +7074,34 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6939
7074
|
}
|
|
6940
7075
|
}
|
|
6941
7076
|
),
|
|
6942
|
-
/* @__PURE__ */
|
|
7077
|
+
/* @__PURE__ */ jsx14(
|
|
6943
7078
|
IconButton8,
|
|
6944
7079
|
{
|
|
6945
7080
|
onClick: () => setProjectManagementOpen(true),
|
|
6946
7081
|
sx: { color: theme.palette.text.secondary },
|
|
6947
|
-
children: /* @__PURE__ */
|
|
7082
|
+
children: /* @__PURE__ */ jsx14(FolderIcon5, {})
|
|
6948
7083
|
}
|
|
6949
7084
|
),
|
|
6950
|
-
/* @__PURE__ */
|
|
7085
|
+
/* @__PURE__ */ jsx14(
|
|
6951
7086
|
IconButton8,
|
|
6952
7087
|
{
|
|
6953
7088
|
onClick: handleMenuOpen,
|
|
6954
7089
|
sx: { color: theme.palette.text.secondary },
|
|
6955
|
-
children: /* @__PURE__ */
|
|
7090
|
+
children: /* @__PURE__ */ jsx14(MoreVertIcon4, {})
|
|
6956
7091
|
}
|
|
6957
7092
|
),
|
|
6958
|
-
/* @__PURE__ */
|
|
7093
|
+
/* @__PURE__ */ jsx14(
|
|
6959
7094
|
IconButton8,
|
|
6960
7095
|
{
|
|
6961
7096
|
onClick: onClose,
|
|
6962
7097
|
sx: { color: theme.palette.text.secondary },
|
|
6963
|
-
children: /* @__PURE__ */
|
|
7098
|
+
children: /* @__PURE__ */ jsx14(CloseIcon5, {})
|
|
6964
7099
|
}
|
|
6965
7100
|
)
|
|
6966
7101
|
] })
|
|
6967
7102
|
}
|
|
6968
7103
|
),
|
|
6969
|
-
/* @__PURE__ */
|
|
7104
|
+
/* @__PURE__ */ jsx14(Box11, { sx: { p: 2, pb: 1 }, children: /* @__PURE__ */ jsx14(
|
|
6970
7105
|
TextField7,
|
|
6971
7106
|
{
|
|
6972
7107
|
fullWidth: true,
|
|
@@ -6976,22 +7111,22 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6976
7111
|
onChange: (e) => setSearchQuery(e.target.value),
|
|
6977
7112
|
variant: "outlined",
|
|
6978
7113
|
InputProps: {
|
|
6979
|
-
startAdornment: /* @__PURE__ */
|
|
6980
|
-
endAdornment: searchQuery && /* @__PURE__ */
|
|
7114
|
+
startAdornment: /* @__PURE__ */ jsx14(InputAdornment2, { position: "start", children: /* @__PURE__ */ jsx14(SearchIcon2, { size: 16, color: theme.palette.text.secondary }) }),
|
|
7115
|
+
endAdornment: searchQuery && /* @__PURE__ */ jsx14(InputAdornment2, { position: "end", children: /* @__PURE__ */ jsx14(
|
|
6981
7116
|
IconButton8,
|
|
6982
7117
|
{
|
|
6983
7118
|
onClick: handleSearchClear,
|
|
6984
7119
|
size: "small",
|
|
6985
7120
|
edge: "end",
|
|
6986
7121
|
sx: { color: theme.palette.text.secondary },
|
|
6987
|
-
children: /* @__PURE__ */
|
|
7122
|
+
children: /* @__PURE__ */ jsx14(ClearIcon2, { size: 16 })
|
|
6988
7123
|
}
|
|
6989
7124
|
) })
|
|
6990
7125
|
}
|
|
6991
7126
|
}
|
|
6992
7127
|
) }),
|
|
6993
|
-
/* @__PURE__ */
|
|
6994
|
-
|
|
7128
|
+
/* @__PURE__ */ jsxs11(
|
|
7129
|
+
Box11,
|
|
6995
7130
|
{
|
|
6996
7131
|
sx: {
|
|
6997
7132
|
flex: 1,
|
|
@@ -7002,8 +7137,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7002
7137
|
pb: 2
|
|
7003
7138
|
},
|
|
7004
7139
|
children: [
|
|
7005
|
-
touchDragActive && activeDragConversation && /* @__PURE__ */
|
|
7006
|
-
|
|
7140
|
+
touchDragActive && activeDragConversation && /* @__PURE__ */ jsxs11(
|
|
7141
|
+
Box11,
|
|
7007
7142
|
{
|
|
7008
7143
|
sx: {
|
|
7009
7144
|
position: "absolute",
|
|
@@ -7028,7 +7163,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7028
7163
|
overflow: "hidden"
|
|
7029
7164
|
},
|
|
7030
7165
|
children: [
|
|
7031
|
-
/* @__PURE__ */
|
|
7166
|
+
/* @__PURE__ */ jsxs11(
|
|
7032
7167
|
Typography8,
|
|
7033
7168
|
{
|
|
7034
7169
|
variant: "caption",
|
|
@@ -7041,8 +7176,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7041
7176
|
},
|
|
7042
7177
|
children: [
|
|
7043
7178
|
"Move",
|
|
7044
|
-
/* @__PURE__ */
|
|
7045
|
-
|
|
7179
|
+
/* @__PURE__ */ jsxs11(
|
|
7180
|
+
Box11,
|
|
7046
7181
|
{
|
|
7047
7182
|
component: "span",
|
|
7048
7183
|
sx: {
|
|
@@ -7062,7 +7197,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7062
7197
|
]
|
|
7063
7198
|
}
|
|
7064
7199
|
),
|
|
7065
|
-
/* @__PURE__ */
|
|
7200
|
+
/* @__PURE__ */ jsx14(
|
|
7066
7201
|
Typography8,
|
|
7067
7202
|
{
|
|
7068
7203
|
variant: "caption",
|
|
@@ -7071,11 +7206,11 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7071
7206
|
fontWeight: 500,
|
|
7072
7207
|
whiteSpace: "nowrap"
|
|
7073
7208
|
},
|
|
7074
|
-
children: activeHoverLabel ? /* @__PURE__ */
|
|
7209
|
+
children: activeHoverLabel ? /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
7075
7210
|
"to",
|
|
7076
7211
|
" ",
|
|
7077
|
-
/* @__PURE__ */
|
|
7078
|
-
|
|
7212
|
+
/* @__PURE__ */ jsx14(
|
|
7213
|
+
Box11,
|
|
7079
7214
|
{
|
|
7080
7215
|
component: "span",
|
|
7081
7216
|
sx: {
|
|
@@ -7091,8 +7226,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7091
7226
|
]
|
|
7092
7227
|
}
|
|
7093
7228
|
),
|
|
7094
|
-
/* @__PURE__ */
|
|
7095
|
-
|
|
7229
|
+
/* @__PURE__ */ jsxs11(
|
|
7230
|
+
Box11,
|
|
7096
7231
|
{
|
|
7097
7232
|
onClick: async () => {
|
|
7098
7233
|
const names = new Set(projects.map((p) => p.name));
|
|
@@ -7126,8 +7261,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7126
7261
|
"&:hover": { bgcolor: alpha7(theme.palette.text.primary, 0.04) }
|
|
7127
7262
|
},
|
|
7128
7263
|
children: [
|
|
7129
|
-
/* @__PURE__ */
|
|
7130
|
-
|
|
7264
|
+
/* @__PURE__ */ jsx14(
|
|
7265
|
+
Box11,
|
|
7131
7266
|
{
|
|
7132
7267
|
sx: {
|
|
7133
7268
|
width: 28,
|
|
@@ -7139,10 +7274,10 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7139
7274
|
justifyContent: "center",
|
|
7140
7275
|
flexShrink: 0
|
|
7141
7276
|
},
|
|
7142
|
-
children: /* @__PURE__ */
|
|
7277
|
+
children: /* @__PURE__ */ jsx14(FolderIcon5, { size: 16, color: theme.palette.success.main })
|
|
7143
7278
|
}
|
|
7144
7279
|
),
|
|
7145
|
-
/* @__PURE__ */
|
|
7280
|
+
/* @__PURE__ */ jsx14(
|
|
7146
7281
|
Typography8,
|
|
7147
7282
|
{
|
|
7148
7283
|
variant: "subtitle2",
|
|
@@ -7150,14 +7285,14 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7150
7285
|
children: "New Project"
|
|
7151
7286
|
}
|
|
7152
7287
|
),
|
|
7153
|
-
/* @__PURE__ */
|
|
7288
|
+
/* @__PURE__ */ jsx14(IconButton8, { size: "small", sx: { color: theme.palette.success.main }, children: /* @__PURE__ */ jsx14(AddIcon5, { size: 16 }) })
|
|
7154
7289
|
]
|
|
7155
7290
|
}
|
|
7156
7291
|
),
|
|
7157
|
-
/* @__PURE__ */
|
|
7158
|
-
filteredProjectGroups.map((group, index) => /* @__PURE__ */
|
|
7159
|
-
group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */
|
|
7160
|
-
|
|
7292
|
+
/* @__PURE__ */ jsx14(Divider3, { sx: { opacity: 0.3 } }),
|
|
7293
|
+
filteredProjectGroups.map((group, index) => /* @__PURE__ */ jsxs11(Box11, { children: [
|
|
7294
|
+
group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */ jsxs11(
|
|
7295
|
+
Box11,
|
|
7161
7296
|
{
|
|
7162
7297
|
sx: {
|
|
7163
7298
|
py: 2,
|
|
@@ -7167,9 +7302,9 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7167
7302
|
gap: 2
|
|
7168
7303
|
},
|
|
7169
7304
|
children: [
|
|
7170
|
-
/* @__PURE__ */
|
|
7171
|
-
/* @__PURE__ */
|
|
7172
|
-
/* @__PURE__ */
|
|
7305
|
+
/* @__PURE__ */ jsx14(Divider3, { sx: { flex: 1, opacity: 0.6 } }),
|
|
7306
|
+
/* @__PURE__ */ jsxs11(Box11, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
7307
|
+
/* @__PURE__ */ jsx14(
|
|
7173
7308
|
InboxIcon4,
|
|
7174
7309
|
{
|
|
7175
7310
|
size: 14,
|
|
@@ -7177,7 +7312,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7177
7312
|
style: { opacity: 0.7 }
|
|
7178
7313
|
}
|
|
7179
7314
|
),
|
|
7180
|
-
/* @__PURE__ */
|
|
7315
|
+
/* @__PURE__ */ jsx14(
|
|
7181
7316
|
Typography8,
|
|
7182
7317
|
{
|
|
7183
7318
|
variant: "caption",
|
|
@@ -7192,12 +7327,12 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7192
7327
|
}
|
|
7193
7328
|
)
|
|
7194
7329
|
] }),
|
|
7195
|
-
/* @__PURE__ */
|
|
7330
|
+
/* @__PURE__ */ jsx14(Divider3, { sx: { flex: 1, opacity: 0.6 } })
|
|
7196
7331
|
]
|
|
7197
7332
|
}
|
|
7198
7333
|
),
|
|
7199
|
-
group.id !== null ? /* @__PURE__ */
|
|
7200
|
-
/* @__PURE__ */
|
|
7334
|
+
group.id !== null ? /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
7335
|
+
/* @__PURE__ */ jsx14(
|
|
7201
7336
|
project_header_default,
|
|
7202
7337
|
{
|
|
7203
7338
|
projectId: group.id,
|
|
@@ -7227,8 +7362,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7227
7362
|
isTouchTarget: touchDragActive && touchDragState.hoverProjectId === group.id
|
|
7228
7363
|
}
|
|
7229
7364
|
),
|
|
7230
|
-
/* @__PURE__ */
|
|
7231
|
-
|
|
7365
|
+
/* @__PURE__ */ jsx14(Collapse3, { in: !group.collapsed, children: /* @__PURE__ */ jsx14(
|
|
7366
|
+
Box11,
|
|
7232
7367
|
{
|
|
7233
7368
|
"data-project-id": group.id ?? "__ungrouped",
|
|
7234
7369
|
sx: {
|
|
@@ -7238,7 +7373,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7238
7373
|
transition: "border 0.2s ease, background-color 0.2s ease",
|
|
7239
7374
|
backgroundColor: touchDragActive && touchDragState.hoverProjectId === group.id ? alpha7(theme.palette.primary.main, 0.08) : "transparent"
|
|
7240
7375
|
},
|
|
7241
|
-
children: group.conversations.map((conversation) => /* @__PURE__ */
|
|
7376
|
+
children: group.conversations.map((conversation) => /* @__PURE__ */ jsx14(
|
|
7242
7377
|
simple_conversation_item_default,
|
|
7243
7378
|
{
|
|
7244
7379
|
conversation,
|
|
@@ -7272,8 +7407,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7272
7407
|
) })
|
|
7273
7408
|
] }) : (
|
|
7274
7409
|
// Special handling for ungrouped - no header, just conversations in scrollable area
|
|
7275
|
-
/* @__PURE__ */
|
|
7276
|
-
|
|
7410
|
+
/* @__PURE__ */ jsx14(
|
|
7411
|
+
Box11,
|
|
7277
7412
|
{
|
|
7278
7413
|
sx: {
|
|
7279
7414
|
minHeight: 0,
|
|
@@ -7289,7 +7424,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7289
7424
|
backgroundColor: touchDragActive && touchDragState.hoverProjectId === "__ungrouped" ? alpha7(theme.palette.primary.main, 0.08) : alpha7(theme.palette.background.default, 0.3)
|
|
7290
7425
|
},
|
|
7291
7426
|
"data-project-id": "__ungrouped",
|
|
7292
|
-
children: group.conversations.map((conversation) => /* @__PURE__ */
|
|
7427
|
+
children: group.conversations.map((conversation) => /* @__PURE__ */ jsx14(
|
|
7293
7428
|
simple_conversation_item_default,
|
|
7294
7429
|
{
|
|
7295
7430
|
conversation,
|
|
@@ -7323,8 +7458,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7323
7458
|
)
|
|
7324
7459
|
)
|
|
7325
7460
|
] }, group.id || "ungrouped")),
|
|
7326
|
-
filteredProjectGroups.length === 0 && /* @__PURE__ */
|
|
7327
|
-
|
|
7461
|
+
filteredProjectGroups.length === 0 && /* @__PURE__ */ jsxs11(
|
|
7462
|
+
Box11,
|
|
7328
7463
|
{
|
|
7329
7464
|
sx: {
|
|
7330
7465
|
flex: 1,
|
|
@@ -7337,16 +7472,16 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7337
7472
|
color: theme.palette.text.secondary
|
|
7338
7473
|
},
|
|
7339
7474
|
children: [
|
|
7340
|
-
/* @__PURE__ */
|
|
7341
|
-
/* @__PURE__ */
|
|
7475
|
+
/* @__PURE__ */ jsx14(Typography8, { variant: "h6", sx: { mb: 1 }, children: searchQuery ? "No conversations found" : "No conversations yet" }),
|
|
7476
|
+
/* @__PURE__ */ jsx14(Typography8, { variant: "body2", sx: { mb: 3, maxWidth: 280 }, children: searchQuery ? `No conversations match "${searchQuery}"` : "Start your first conversation to begin organizing your chats into projects" })
|
|
7342
7477
|
]
|
|
7343
7478
|
}
|
|
7344
7479
|
)
|
|
7345
7480
|
]
|
|
7346
7481
|
}
|
|
7347
7482
|
),
|
|
7348
|
-
/* @__PURE__ */
|
|
7349
|
-
|
|
7483
|
+
/* @__PURE__ */ jsxs11(
|
|
7484
|
+
Box11,
|
|
7350
7485
|
{
|
|
7351
7486
|
sx: {
|
|
7352
7487
|
mt: "auto",
|
|
@@ -7361,7 +7496,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7361
7496
|
flexWrap: "wrap"
|
|
7362
7497
|
},
|
|
7363
7498
|
children: [
|
|
7364
|
-
/* @__PURE__ */
|
|
7499
|
+
/* @__PURE__ */ jsx14(
|
|
7365
7500
|
Avatar7,
|
|
7366
7501
|
{
|
|
7367
7502
|
src: avatarImage,
|
|
@@ -7376,8 +7511,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7376
7511
|
children: avatarInitials
|
|
7377
7512
|
}
|
|
7378
7513
|
),
|
|
7379
|
-
/* @__PURE__ */
|
|
7380
|
-
/* @__PURE__ */
|
|
7514
|
+
/* @__PURE__ */ jsxs11(Box11, { sx: { display: "flex", flexDirection: "column", alignItems: "center", gap: 0.5, minWidth: 0 }, children: [
|
|
7515
|
+
/* @__PURE__ */ jsx14(
|
|
7381
7516
|
Typography8,
|
|
7382
7517
|
{
|
|
7383
7518
|
variant: "subtitle2",
|
|
@@ -7386,7 +7521,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7386
7521
|
children: user ? userDisplayName : "Not signed in"
|
|
7387
7522
|
}
|
|
7388
7523
|
),
|
|
7389
|
-
!user && /* @__PURE__ */
|
|
7524
|
+
!user && /* @__PURE__ */ jsx14(
|
|
7390
7525
|
Typography8,
|
|
7391
7526
|
{
|
|
7392
7527
|
variant: "caption",
|
|
@@ -7404,14 +7539,14 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7404
7539
|
) })
|
|
7405
7540
|
}
|
|
7406
7541
|
),
|
|
7407
|
-
/* @__PURE__ */
|
|
7542
|
+
/* @__PURE__ */ jsx14(
|
|
7408
7543
|
project_management_modal_default,
|
|
7409
7544
|
{
|
|
7410
7545
|
open: projectManagementOpen,
|
|
7411
7546
|
onClose: () => setProjectManagementOpen(false)
|
|
7412
7547
|
}
|
|
7413
7548
|
),
|
|
7414
|
-
conversationToMove && /* @__PURE__ */
|
|
7549
|
+
conversationToMove && /* @__PURE__ */ jsx14(
|
|
7415
7550
|
move_conversation_modal_default,
|
|
7416
7551
|
{
|
|
7417
7552
|
open: moveModalOpen,
|
|
@@ -7420,7 +7555,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7420
7555
|
currentProjectId: conversationToMove.projectId
|
|
7421
7556
|
}
|
|
7422
7557
|
),
|
|
7423
|
-
/* @__PURE__ */
|
|
7558
|
+
/* @__PURE__ */ jsx14(
|
|
7424
7559
|
Menu4,
|
|
7425
7560
|
{
|
|
7426
7561
|
anchorEl: menuAnchorEl,
|
|
@@ -7434,7 +7569,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7434
7569
|
vertical: "bottom",
|
|
7435
7570
|
horizontal: "right"
|
|
7436
7571
|
},
|
|
7437
|
-
children: /* @__PURE__ */
|
|
7572
|
+
children: /* @__PURE__ */ jsxs11(
|
|
7438
7573
|
MenuItem4,
|
|
7439
7574
|
{
|
|
7440
7575
|
onClick: () => {
|
|
@@ -7444,14 +7579,14 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7444
7579
|
disabled: visibleConversationCount === 0,
|
|
7445
7580
|
sx: { color: theme.palette.error.main },
|
|
7446
7581
|
children: [
|
|
7447
|
-
/* @__PURE__ */
|
|
7448
|
-
/* @__PURE__ */
|
|
7582
|
+
/* @__PURE__ */ jsx14(ListItemIcon4, { children: /* @__PURE__ */ jsx14(DeleteSweepIcon2, { size: 16, color: theme.palette.error.main }) }),
|
|
7583
|
+
/* @__PURE__ */ jsx14(ListItemText4, { children: "Clear All Conversations" })
|
|
7449
7584
|
]
|
|
7450
7585
|
}
|
|
7451
7586
|
)
|
|
7452
7587
|
}
|
|
7453
7588
|
),
|
|
7454
|
-
/* @__PURE__ */
|
|
7589
|
+
/* @__PURE__ */ jsxs11(
|
|
7455
7590
|
Dialog4,
|
|
7456
7591
|
{
|
|
7457
7592
|
open: clearConfirmOpen,
|
|
@@ -7459,11 +7594,11 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7459
7594
|
maxWidth: "sm",
|
|
7460
7595
|
fullWidth: true,
|
|
7461
7596
|
children: [
|
|
7462
|
-
/* @__PURE__ */
|
|
7463
|
-
/* @__PURE__ */
|
|
7464
|
-
/* @__PURE__ */
|
|
7465
|
-
/* @__PURE__ */
|
|
7466
|
-
/* @__PURE__ */
|
|
7597
|
+
/* @__PURE__ */ jsx14(DialogTitle4, { children: "Clear All Conversations?" }),
|
|
7598
|
+
/* @__PURE__ */ jsx14(DialogContent4, { children: /* @__PURE__ */ jsx14(Typography8, { children: visibleConversationCount === 0 ? "No conversations available to clear." : `This will permanently delete ${visibleConversationCount} conversation${visibleConversationCount === 1 ? "" : "s"} and cannot be undone.` }) }),
|
|
7599
|
+
/* @__PURE__ */ jsxs11(DialogActions4, { children: [
|
|
7600
|
+
/* @__PURE__ */ jsx14(Button6, { onClick: () => setClearConfirmOpen(false), children: "Cancel" }),
|
|
7601
|
+
/* @__PURE__ */ jsx14(
|
|
7467
7602
|
Button6,
|
|
7468
7603
|
{
|
|
7469
7604
|
onClick: handleClearAllConfirm,
|
|
@@ -7482,7 +7617,7 @@ var enhanced_mobile_conversations_modal_default = EnhancedMobileConversationsMod
|
|
|
7482
7617
|
|
|
7483
7618
|
// src/chat/chat-app-bar.tsx
|
|
7484
7619
|
import { shallow as shallow2 } from "zustand/shallow";
|
|
7485
|
-
import { Fragment as Fragment8, jsx as
|
|
7620
|
+
import { Fragment as Fragment8, jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
7486
7621
|
var CDN_BASE = "https://cdn.burtson.ai/";
|
|
7487
7622
|
var banditHead = `${CDN_BASE}/images/bandit-head.png`;
|
|
7488
7623
|
var modelAvatars = {
|
|
@@ -7529,12 +7664,12 @@ var ChatAppBar = ({
|
|
|
7529
7664
|
menuBackground,
|
|
7530
7665
|
menuText
|
|
7531
7666
|
} = theme.palette.chat.appBar;
|
|
7532
|
-
const [modelAnchorEl, setModelAnchorEl] =
|
|
7533
|
-
const [engineAnchorEl, setEngineAnchorEl] =
|
|
7534
|
-
const [voiceAnchorEl, setVoiceAnchorEl] =
|
|
7535
|
-
const [modalOpen, setModalOpen] =
|
|
7536
|
-
const [confirmModelChangeOpen, setConfirmModelChangeOpen] =
|
|
7537
|
-
const [pendingModel, setPendingModel] =
|
|
7667
|
+
const [modelAnchorEl, setModelAnchorEl] = useState14(null);
|
|
7668
|
+
const [engineAnchorEl, setEngineAnchorEl] = useState14(null);
|
|
7669
|
+
const [voiceAnchorEl, setVoiceAnchorEl] = useState14(null);
|
|
7670
|
+
const [modalOpen, setModalOpen] = useState14(false);
|
|
7671
|
+
const [confirmModelChangeOpen, setConfirmModelChangeOpen] = useState14(false);
|
|
7672
|
+
const [pendingModel, setPendingModel] = useState14(null);
|
|
7538
7673
|
const { conversations, currentId, createNewConversation, _hasHydrated } = useConversationStore();
|
|
7539
7674
|
const { preferences } = usePreferencesStore();
|
|
7540
7675
|
const { settings: packageSettings } = usePackageSettingsStore();
|
|
@@ -7578,16 +7713,16 @@ var ChatAppBar = ({
|
|
|
7578
7713
|
};
|
|
7579
7714
|
const syncIndicatorIcon = (() => {
|
|
7580
7715
|
if (isPlaygroundMode2 || !syncEnabled) {
|
|
7581
|
-
return /* @__PURE__ */
|
|
7716
|
+
return /* @__PURE__ */ jsx15(CloudOffIcon, { fontSize: "small", color: "disabled" });
|
|
7582
7717
|
}
|
|
7583
7718
|
switch (syncStatus) {
|
|
7584
7719
|
case "syncing":
|
|
7585
|
-
return /* @__PURE__ */
|
|
7720
|
+
return /* @__PURE__ */ jsx15(SyncIcon, { fontSize: "small", sx: syncSpinSx, color: "primary" });
|
|
7586
7721
|
case "error":
|
|
7587
|
-
return /* @__PURE__ */
|
|
7722
|
+
return /* @__PURE__ */ jsx15(ErrorOutlineIcon, { fontSize: "small", color: "error" });
|
|
7588
7723
|
case "idle":
|
|
7589
7724
|
default:
|
|
7590
|
-
return /* @__PURE__ */
|
|
7725
|
+
return /* @__PURE__ */ jsx15(CloudDoneIcon, { fontSize: "small", color: "success" });
|
|
7591
7726
|
}
|
|
7592
7727
|
})();
|
|
7593
7728
|
const syncTooltip = (() => {
|
|
@@ -7693,9 +7828,9 @@ var ChatAppBar = ({
|
|
|
7693
7828
|
}
|
|
7694
7829
|
safeNavigate("/");
|
|
7695
7830
|
}
|
|
7696
|
-
return /* @__PURE__ */
|
|
7697
|
-
/* @__PURE__ */
|
|
7698
|
-
|
|
7831
|
+
return /* @__PURE__ */ jsxs12(Fragment8, { children: [
|
|
7832
|
+
/* @__PURE__ */ jsxs12(
|
|
7833
|
+
Box12,
|
|
7699
7834
|
{
|
|
7700
7835
|
sx: {
|
|
7701
7836
|
position: "fixed",
|
|
@@ -7715,8 +7850,8 @@ var ChatAppBar = ({
|
|
|
7715
7850
|
}
|
|
7716
7851
|
},
|
|
7717
7852
|
children: [
|
|
7718
|
-
/* @__PURE__ */
|
|
7719
|
-
|
|
7853
|
+
/* @__PURE__ */ jsxs12(
|
|
7854
|
+
Box12,
|
|
7720
7855
|
{
|
|
7721
7856
|
sx: {
|
|
7722
7857
|
display: "flex",
|
|
@@ -7736,16 +7871,16 @@ var ChatAppBar = ({
|
|
|
7736
7871
|
}
|
|
7737
7872
|
},
|
|
7738
7873
|
children: [
|
|
7739
|
-
/* @__PURE__ */
|
|
7874
|
+
/* @__PURE__ */ jsx15(Tooltip5, { title: homeTooltip, arrow: true, children: /* @__PURE__ */ jsx15(
|
|
7740
7875
|
IconButton9,
|
|
7741
7876
|
{
|
|
7742
7877
|
onClick: goToHome,
|
|
7743
7878
|
sx: pillButtonStyles,
|
|
7744
7879
|
"aria-label": "Go to home page",
|
|
7745
|
-
children: /* @__PURE__ */
|
|
7880
|
+
children: /* @__PURE__ */ jsx15(HomeIcon, {})
|
|
7746
7881
|
}
|
|
7747
7882
|
) }),
|
|
7748
|
-
showLimitedAdminPanel() && /* @__PURE__ */
|
|
7883
|
+
showLimitedAdminPanel() && /* @__PURE__ */ jsx15(Tooltip5, { title: "Management & Settings", arrow: true, children: /* @__PURE__ */ jsx15(
|
|
7749
7884
|
IconButton9,
|
|
7750
7885
|
{
|
|
7751
7886
|
onClick: () => safeNavigate(managementPath),
|
|
@@ -7757,10 +7892,10 @@ var ChatAppBar = ({
|
|
|
7757
7892
|
}
|
|
7758
7893
|
},
|
|
7759
7894
|
"aria-label": "Open management settings",
|
|
7760
|
-
children: /* @__PURE__ */
|
|
7895
|
+
children: /* @__PURE__ */ jsx15(SettingsIcon, {})
|
|
7761
7896
|
}
|
|
7762
7897
|
) }),
|
|
7763
|
-
/* @__PURE__ */
|
|
7898
|
+
/* @__PURE__ */ jsx15(Tooltip5, { title: syncTooltip, arrow: true, children: /* @__PURE__ */ jsxs12(
|
|
7764
7899
|
IconButton9,
|
|
7765
7900
|
{
|
|
7766
7901
|
onClick: handleSyncBadgeClick,
|
|
@@ -7776,8 +7911,8 @@ var ChatAppBar = ({
|
|
|
7776
7911
|
"aria-label": "Conversation sync status",
|
|
7777
7912
|
children: [
|
|
7778
7913
|
syncIndicatorIcon,
|
|
7779
|
-
pendingCount > 0 && !syncButtonDisabled && syncStatus !== "syncing" && /* @__PURE__ */
|
|
7780
|
-
|
|
7914
|
+
pendingCount > 0 && !syncButtonDisabled && syncStatus !== "syncing" && /* @__PURE__ */ jsx15(
|
|
7915
|
+
Box12,
|
|
7781
7916
|
{
|
|
7782
7917
|
sx: {
|
|
7783
7918
|
position: "absolute",
|
|
@@ -7802,7 +7937,7 @@ var ChatAppBar = ({
|
|
|
7802
7937
|
]
|
|
7803
7938
|
}
|
|
7804
7939
|
) }),
|
|
7805
|
-
!isMobile && /* @__PURE__ */
|
|
7940
|
+
!isMobile && /* @__PURE__ */ jsx15(Tooltip5, { title: `${drawerOpen ? "Close" : "Open"} Conversations`, arrow: true, children: /* @__PURE__ */ jsxs12(
|
|
7806
7941
|
IconButton9,
|
|
7807
7942
|
{
|
|
7808
7943
|
onClick: () => setDrawerOpen(!drawerOpen),
|
|
@@ -7816,9 +7951,9 @@ var ChatAppBar = ({
|
|
|
7816
7951
|
"aria-label": `${drawerOpen ? "Close" : "Open"} conversations drawer`,
|
|
7817
7952
|
"aria-pressed": drawerOpen,
|
|
7818
7953
|
children: [
|
|
7819
|
-
drawerOpen ? /* @__PURE__ */
|
|
7820
|
-
conversations.length > 0 && /* @__PURE__ */
|
|
7821
|
-
|
|
7954
|
+
drawerOpen ? /* @__PURE__ */ jsx15(NotesIcon, {}) : /* @__PURE__ */ jsx15(NotesIconOutlined, {}),
|
|
7955
|
+
conversations.length > 0 && /* @__PURE__ */ jsx15(
|
|
7956
|
+
Box12,
|
|
7822
7957
|
{
|
|
7823
7958
|
sx: {
|
|
7824
7959
|
position: "absolute",
|
|
@@ -7843,7 +7978,7 @@ var ChatAppBar = ({
|
|
|
7843
7978
|
]
|
|
7844
7979
|
}
|
|
7845
7980
|
) }),
|
|
7846
|
-
!isMobile && canShowNewConversationButton && /* @__PURE__ */
|
|
7981
|
+
!isMobile && canShowNewConversationButton && /* @__PURE__ */ jsx15(Tooltip5, { title: "Start New Conversation", arrow: true, children: /* @__PURE__ */ jsx15(
|
|
7847
7982
|
IconButton9,
|
|
7848
7983
|
{
|
|
7849
7984
|
onClick: () => createNewConversation(),
|
|
@@ -7857,14 +7992,14 @@ var ChatAppBar = ({
|
|
|
7857
7992
|
}
|
|
7858
7993
|
},
|
|
7859
7994
|
"aria-label": "Create new conversation",
|
|
7860
|
-
children: /* @__PURE__ */
|
|
7995
|
+
children: /* @__PURE__ */ jsx15(AddIcon, {})
|
|
7861
7996
|
}
|
|
7862
7997
|
) })
|
|
7863
7998
|
]
|
|
7864
7999
|
}
|
|
7865
8000
|
),
|
|
7866
|
-
/* @__PURE__ */
|
|
7867
|
-
|
|
8001
|
+
/* @__PURE__ */ jsxs12(
|
|
8002
|
+
Box12,
|
|
7868
8003
|
{
|
|
7869
8004
|
sx: {
|
|
7870
8005
|
display: "flex",
|
|
@@ -7884,7 +8019,7 @@ var ChatAppBar = ({
|
|
|
7884
8019
|
}
|
|
7885
8020
|
},
|
|
7886
8021
|
children: [
|
|
7887
|
-
isMobile && /* @__PURE__ */
|
|
8022
|
+
isMobile && /* @__PURE__ */ jsx15(Tooltip5, { title: `Conversations (${conversations.length})`, arrow: true, children: /* @__PURE__ */ jsxs12(
|
|
7888
8023
|
IconButton9,
|
|
7889
8024
|
{
|
|
7890
8025
|
onClick: () => setModalOpen(true),
|
|
@@ -7894,9 +8029,9 @@ var ChatAppBar = ({
|
|
|
7894
8029
|
},
|
|
7895
8030
|
"aria-label": `Open conversations modal with ${conversations.length} conversations`,
|
|
7896
8031
|
children: [
|
|
7897
|
-
/* @__PURE__ */
|
|
7898
|
-
conversations.length > 0 && /* @__PURE__ */
|
|
7899
|
-
|
|
8032
|
+
/* @__PURE__ */ jsx15(NotesIcon, { fontSize: "small" }),
|
|
8033
|
+
conversations.length > 0 && /* @__PURE__ */ jsx15(
|
|
8034
|
+
Box12,
|
|
7900
8035
|
{
|
|
7901
8036
|
sx: {
|
|
7902
8037
|
position: "absolute",
|
|
@@ -7921,7 +8056,7 @@ var ChatAppBar = ({
|
|
|
7921
8056
|
]
|
|
7922
8057
|
}
|
|
7923
8058
|
) }),
|
|
7924
|
-
isMobile && canShowNewConversationButton && /* @__PURE__ */
|
|
8059
|
+
isMobile && canShowNewConversationButton && /* @__PURE__ */ jsx15(Tooltip5, { title: "Start New Conversation", arrow: true, children: /* @__PURE__ */ jsx15(
|
|
7925
8060
|
IconButton9,
|
|
7926
8061
|
{
|
|
7927
8062
|
onClick: () => {
|
|
@@ -7938,10 +8073,10 @@ var ChatAppBar = ({
|
|
|
7938
8073
|
}
|
|
7939
8074
|
},
|
|
7940
8075
|
"aria-label": "Create new conversation",
|
|
7941
|
-
children: /* @__PURE__ */
|
|
8076
|
+
children: /* @__PURE__ */ jsx15(AddIcon, { fontSize: "small" })
|
|
7942
8077
|
}
|
|
7943
8078
|
) }),
|
|
7944
|
-
/* @__PURE__ */
|
|
8079
|
+
/* @__PURE__ */ jsx15(Tooltip5, { title: `Current AI: ${selectedModel.replace("Bandit-", "")}`, arrow: true, children: /* @__PURE__ */ jsx15(
|
|
7945
8080
|
IconButton9,
|
|
7946
8081
|
{
|
|
7947
8082
|
onClick: (e) => setModelAnchorEl(e.currentTarget),
|
|
@@ -7956,7 +8091,7 @@ var ChatAppBar = ({
|
|
|
7956
8091
|
}
|
|
7957
8092
|
},
|
|
7958
8093
|
"aria-label": `Change AI personality. Currently using ${selectedModel}`,
|
|
7959
|
-
children: /* @__PURE__ */
|
|
8094
|
+
children: /* @__PURE__ */ jsx15(
|
|
7960
8095
|
Avatar8,
|
|
7961
8096
|
{
|
|
7962
8097
|
src: currentAvatar,
|
|
@@ -7973,16 +8108,16 @@ var ChatAppBar = ({
|
|
|
7973
8108
|
)
|
|
7974
8109
|
}
|
|
7975
8110
|
) }),
|
|
7976
|
-
/* @__PURE__ */
|
|
8111
|
+
/* @__PURE__ */ jsx15(Tooltip5, { title: `Engine \xB7 ${engineDisplay}`, arrow: true, children: /* @__PURE__ */ jsx15(
|
|
7977
8112
|
IconButton9,
|
|
7978
8113
|
{
|
|
7979
8114
|
onClick: (e) => setEngineAnchorEl(e.currentTarget),
|
|
7980
8115
|
sx: pillButtonStyles,
|
|
7981
8116
|
"aria-label": `Change base model (engine). Currently ${engineDisplay}`,
|
|
7982
|
-
children: /* @__PURE__ */
|
|
8117
|
+
children: /* @__PURE__ */ jsx15(AutoAwesomeIcon, { fontSize: "small" })
|
|
7983
8118
|
}
|
|
7984
8119
|
) }),
|
|
7985
|
-
/* @__PURE__ */
|
|
8120
|
+
/* @__PURE__ */ jsxs12(
|
|
7986
8121
|
Menu5,
|
|
7987
8122
|
{
|
|
7988
8123
|
anchorEl: engineAnchorEl,
|
|
@@ -7991,8 +8126,8 @@ var ChatAppBar = ({
|
|
|
7991
8126
|
transformOrigin: { horizontal: "right", vertical: "top" },
|
|
7992
8127
|
anchorOrigin: { horizontal: "right", vertical: "bottom" },
|
|
7993
8128
|
children: [
|
|
7994
|
-
/* @__PURE__ */
|
|
7995
|
-
engines.length === 0 && /* @__PURE__ */
|
|
8129
|
+
/* @__PURE__ */ jsx15(Typography9, { variant: "overline", sx: { px: 2, color: theme.palette.text.secondary }, children: "Engine \xB7 base model" }),
|
|
8130
|
+
engines.length === 0 && /* @__PURE__ */ jsx15(MenuItem5, { disabled: true, children: /* @__PURE__ */ jsx15(Typography9, { variant: "body2", children: "No engines available" }) }),
|
|
7996
8131
|
engines.map((engine) => {
|
|
7997
8132
|
const badges = [
|
|
7998
8133
|
engine.vision && "vision",
|
|
@@ -8000,7 +8135,7 @@ var ChatAppBar = ({
|
|
|
8000
8135
|
engine.thinking && "thinking",
|
|
8001
8136
|
engine.cloud && "cloud"
|
|
8002
8137
|
].filter(Boolean);
|
|
8003
|
-
return /* @__PURE__ */
|
|
8138
|
+
return /* @__PURE__ */ jsxs12(
|
|
8004
8139
|
MenuItem5,
|
|
8005
8140
|
{
|
|
8006
8141
|
selected: engine.id === resolvedEngineId,
|
|
@@ -8020,13 +8155,13 @@ var ChatAppBar = ({
|
|
|
8020
8155
|
whiteSpace: "normal"
|
|
8021
8156
|
},
|
|
8022
8157
|
children: [
|
|
8023
|
-
/* @__PURE__ */
|
|
8024
|
-
/* @__PURE__ */
|
|
8025
|
-
engine.id === resolvedEngineId && /* @__PURE__ */
|
|
8158
|
+
/* @__PURE__ */ jsxs12(Box12, { sx: { display: "flex", alignItems: "center", gap: 1, width: "100%" }, children: [
|
|
8159
|
+
/* @__PURE__ */ jsx15(Typography9, { variant: "body2", sx: { fontWeight: 600, flex: 1 }, children: cleanEngineName(engine.displayName) }),
|
|
8160
|
+
engine.id === resolvedEngineId && /* @__PURE__ */ jsx15(Box12, { sx: { width: 8, height: 8, borderRadius: "50%", bgcolor: theme.palette.primary.main } })
|
|
8026
8161
|
] }),
|
|
8027
|
-
/* @__PURE__ */
|
|
8028
|
-
badges.length > 0 && /* @__PURE__ */
|
|
8029
|
-
|
|
8162
|
+
/* @__PURE__ */ jsx15(Typography9, { variant: "caption", sx: { color: theme.palette.text.secondary }, children: engine.available ? engine.description : engine.unavailableReason || "Unavailable" }),
|
|
8163
|
+
badges.length > 0 && /* @__PURE__ */ jsx15(Box12, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap", mt: 0.25 }, children: badges.map((b) => /* @__PURE__ */ jsx15(
|
|
8164
|
+
Box12,
|
|
8030
8165
|
{
|
|
8031
8166
|
sx: {
|
|
8032
8167
|
fontSize: "0.65rem",
|
|
@@ -8048,7 +8183,7 @@ var ChatAppBar = ({
|
|
|
8048
8183
|
]
|
|
8049
8184
|
}
|
|
8050
8185
|
),
|
|
8051
|
-
/* @__PURE__ */
|
|
8186
|
+
/* @__PURE__ */ jsx15(
|
|
8052
8187
|
Menu5,
|
|
8053
8188
|
{
|
|
8054
8189
|
anchorEl: modelAnchorEl,
|
|
@@ -8084,7 +8219,7 @@ var ChatAppBar = ({
|
|
|
8084
8219
|
}
|
|
8085
8220
|
}
|
|
8086
8221
|
},
|
|
8087
|
-
children: availableModels.map((model) => /* @__PURE__ */
|
|
8222
|
+
children: availableModels.map((model) => /* @__PURE__ */ jsxs12(
|
|
8088
8223
|
MenuItem5,
|
|
8089
8224
|
{
|
|
8090
8225
|
selected: model.name === selectedModel,
|
|
@@ -8131,7 +8266,7 @@ var ChatAppBar = ({
|
|
|
8131
8266
|
px: 2
|
|
8132
8267
|
},
|
|
8133
8268
|
children: [
|
|
8134
|
-
/* @__PURE__ */
|
|
8269
|
+
/* @__PURE__ */ jsx15(
|
|
8135
8270
|
Avatar8,
|
|
8136
8271
|
{
|
|
8137
8272
|
src: model.avatarBase64 || modelAvatars[model.name] || banditHead,
|
|
@@ -8144,12 +8279,12 @@ var ChatAppBar = ({
|
|
|
8144
8279
|
}
|
|
8145
8280
|
}
|
|
8146
8281
|
),
|
|
8147
|
-
/* @__PURE__ */
|
|
8148
|
-
/* @__PURE__ */
|
|
8149
|
-
/* @__PURE__ */
|
|
8282
|
+
/* @__PURE__ */ jsxs12(Box12, { sx: { flex: 1 }, children: [
|
|
8283
|
+
/* @__PURE__ */ jsx15(Typography9, { variant: "body2", sx: { fontWeight: 500 }, children: model.name.replace("Bandit-", "") }),
|
|
8284
|
+
/* @__PURE__ */ jsx15(Typography9, { variant: "caption", sx: { color: theme.palette.text.secondary, display: "block" }, children: model.name === selectedModel ? "Currently active" : "Switch to this AI" })
|
|
8150
8285
|
] }),
|
|
8151
|
-
model.name === selectedModel && /* @__PURE__ */
|
|
8152
|
-
|
|
8286
|
+
model.name === selectedModel && /* @__PURE__ */ jsx15(
|
|
8287
|
+
Box12,
|
|
8153
8288
|
{
|
|
8154
8289
|
sx: {
|
|
8155
8290
|
width: 8,
|
|
@@ -8165,8 +8300,8 @@ var ChatAppBar = ({
|
|
|
8165
8300
|
))
|
|
8166
8301
|
}
|
|
8167
8302
|
),
|
|
8168
|
-
isTTSAvailable && /* @__PURE__ */
|
|
8169
|
-
/* @__PURE__ */
|
|
8303
|
+
isTTSAvailable && /* @__PURE__ */ jsxs12(Fragment8, { children: [
|
|
8304
|
+
/* @__PURE__ */ jsx15(Tooltip5, { title: `Voice: ${selectedVoice ? toTitleCase(selectedVoice.split("-")[1]) : "Default"}`, arrow: true, children: /* @__PURE__ */ jsx15(
|
|
8170
8305
|
IconButton9,
|
|
8171
8306
|
{
|
|
8172
8307
|
onClick: (e) => setVoiceAnchorEl(e.currentTarget),
|
|
@@ -8180,10 +8315,10 @@ var ChatAppBar = ({
|
|
|
8180
8315
|
}
|
|
8181
8316
|
},
|
|
8182
8317
|
"aria-label": `Change voice. Currently using ${selectedVoice ? toTitleCase(selectedVoice.split("-")[1]) : "default"}`,
|
|
8183
|
-
children: /* @__PURE__ */
|
|
8318
|
+
children: /* @__PURE__ */ jsx15(RecordVoiceOverIcon, { fontSize: "small" })
|
|
8184
8319
|
}
|
|
8185
8320
|
) }),
|
|
8186
|
-
/* @__PURE__ */
|
|
8321
|
+
/* @__PURE__ */ jsx15(
|
|
8187
8322
|
Menu5,
|
|
8188
8323
|
{
|
|
8189
8324
|
anchorEl: voiceAnchorEl,
|
|
@@ -8220,7 +8355,7 @@ var ChatAppBar = ({
|
|
|
8220
8355
|
}
|
|
8221
8356
|
}
|
|
8222
8357
|
},
|
|
8223
|
-
children: availableVoices.length > 0 ? availableVoices.map((voice) => /* @__PURE__ */
|
|
8358
|
+
children: availableVoices.length > 0 ? availableVoices.map((voice) => /* @__PURE__ */ jsx15(
|
|
8224
8359
|
MenuItem5,
|
|
8225
8360
|
{
|
|
8226
8361
|
selected: voice === selectedVoice,
|
|
@@ -8228,14 +8363,14 @@ var ChatAppBar = ({
|
|
|
8228
8363
|
handleVoiceChange(voice);
|
|
8229
8364
|
setVoiceAnchorEl(null);
|
|
8230
8365
|
},
|
|
8231
|
-
children: /* @__PURE__ */
|
|
8232
|
-
/* @__PURE__ */
|
|
8233
|
-
/* @__PURE__ */
|
|
8234
|
-
/* @__PURE__ */
|
|
8235
|
-
/* @__PURE__ */
|
|
8366
|
+
children: /* @__PURE__ */ jsxs12(Box12, { sx: { display: "flex", alignItems: "center", gap: 1, width: "100%" }, children: [
|
|
8367
|
+
/* @__PURE__ */ jsx15(RecordVoiceOverIcon, { fontSize: "small", sx: { color: theme.palette.text.secondary } }),
|
|
8368
|
+
/* @__PURE__ */ jsxs12(Box12, { sx: { flex: 1 }, children: [
|
|
8369
|
+
/* @__PURE__ */ jsx15(Typography9, { variant: "body2", children: toTitleCase(voice.split("-")[1]) }),
|
|
8370
|
+
/* @__PURE__ */ jsx15(Typography9, { variant: "caption", sx: { color: theme.palette.text.secondary }, children: voice === selectedVoice ? "Currently active" : "Switch to this voice" })
|
|
8236
8371
|
] }),
|
|
8237
|
-
voice === selectedVoice && /* @__PURE__ */
|
|
8238
|
-
|
|
8372
|
+
voice === selectedVoice && /* @__PURE__ */ jsx15(
|
|
8373
|
+
Box12,
|
|
8239
8374
|
{
|
|
8240
8375
|
sx: {
|
|
8241
8376
|
width: 8,
|
|
@@ -8248,7 +8383,7 @@ var ChatAppBar = ({
|
|
|
8248
8383
|
] })
|
|
8249
8384
|
},
|
|
8250
8385
|
voice
|
|
8251
|
-
)) : /* @__PURE__ */
|
|
8386
|
+
)) : /* @__PURE__ */ jsx15(MenuItem5, { disabled: true, children: /* @__PURE__ */ jsx15(Typography9, { variant: "body2", color: "text.secondary", children: "No voices available" }) })
|
|
8252
8387
|
}
|
|
8253
8388
|
)
|
|
8254
8389
|
] })
|
|
@@ -8258,17 +8393,17 @@ var ChatAppBar = ({
|
|
|
8258
8393
|
]
|
|
8259
8394
|
}
|
|
8260
8395
|
),
|
|
8261
|
-
/* @__PURE__ */
|
|
8262
|
-
/* @__PURE__ */
|
|
8263
|
-
/* @__PURE__ */
|
|
8396
|
+
/* @__PURE__ */ jsx15(conversation_drawer_default, { open: drawerOpen, onClose: () => setDrawerOpen(false) }),
|
|
8397
|
+
/* @__PURE__ */ jsx15(enhanced_mobile_conversations_modal_default, { open: modalOpen, onClose: () => setModalOpen(false) }),
|
|
8398
|
+
/* @__PURE__ */ jsxs12(
|
|
8264
8399
|
Dialog5,
|
|
8265
8400
|
{
|
|
8266
8401
|
open: confirmModelChangeOpen,
|
|
8267
8402
|
onClose: () => setConfirmModelChangeOpen(false),
|
|
8268
8403
|
children: [
|
|
8269
|
-
/* @__PURE__ */
|
|
8270
|
-
/* @__PURE__ */
|
|
8271
|
-
/* @__PURE__ */
|
|
8404
|
+
/* @__PURE__ */ jsx15(DialogTitle5, { children: "Change personality and start new conversation?" }),
|
|
8405
|
+
/* @__PURE__ */ jsx15(DialogContent5, { children: /* @__PURE__ */ jsxs12(Box12, { display: "flex", alignItems: "center", gap: 2, mt: 1, justifyContent: "center", children: [
|
|
8406
|
+
/* @__PURE__ */ jsx15(
|
|
8272
8407
|
Avatar8,
|
|
8273
8408
|
{
|
|
8274
8409
|
src: pendingModelAvatar,
|
|
@@ -8276,15 +8411,15 @@ var ChatAppBar = ({
|
|
|
8276
8411
|
sx: { width: 40, height: 40, filter: "brightness(1.7)" }
|
|
8277
8412
|
}
|
|
8278
8413
|
),
|
|
8279
|
-
/* @__PURE__ */
|
|
8414
|
+
/* @__PURE__ */ jsxs12(Typography9, { variant: "body2", children: [
|
|
8280
8415
|
"Your current conversation will be saved, and a new one will begin with ",
|
|
8281
|
-
/* @__PURE__ */
|
|
8416
|
+
/* @__PURE__ */ jsx15("strong", { children: pendingModel }),
|
|
8282
8417
|
"."
|
|
8283
8418
|
] })
|
|
8284
8419
|
] }) }),
|
|
8285
|
-
/* @__PURE__ */
|
|
8286
|
-
/* @__PURE__ */
|
|
8287
|
-
/* @__PURE__ */
|
|
8420
|
+
/* @__PURE__ */ jsxs12(DialogActions5, { children: [
|
|
8421
|
+
/* @__PURE__ */ jsx15(Button7, { onClick: () => setConfirmModelChangeOpen(false), children: "Cancel" }),
|
|
8422
|
+
/* @__PURE__ */ jsx15(
|
|
8288
8423
|
Button7,
|
|
8289
8424
|
{
|
|
8290
8425
|
onClick: () => {
|
|
@@ -8387,19 +8522,19 @@ Respond with just the title and nothing else.
|
|
|
8387
8522
|
};
|
|
8388
8523
|
|
|
8389
8524
|
// src/chat/query-suggestion-picker.tsx
|
|
8390
|
-
import { useEffect as useEffect13, useRef as useRef11, useState as
|
|
8391
|
-
import { Box as
|
|
8525
|
+
import { useEffect as useEffect13, useRef as useRef11, useState as useState15 } from "react";
|
|
8526
|
+
import { Box as Box13, useMediaQuery as useMediaQuery6 } from "@mui/material";
|
|
8392
8527
|
import { useTheme as useTheme13, alpha as alpha8 } from "@mui/material/styles";
|
|
8393
8528
|
import ReactMarkdown from "react-markdown";
|
|
8394
8529
|
import remarkGfm from "remark-gfm";
|
|
8395
8530
|
import rehypeRaw from "rehype-raw";
|
|
8396
|
-
import { Fragment as Fragment9, jsx as
|
|
8531
|
+
import { Fragment as Fragment9, jsx as jsx16 } from "react/jsx-runtime";
|
|
8397
8532
|
var markdownComponents = {
|
|
8398
|
-
p: ({ node, ...props }) => /* @__PURE__ */
|
|
8399
|
-
mark: ({ node, children, ...props }) => /* @__PURE__ */
|
|
8533
|
+
p: ({ node, ...props }) => /* @__PURE__ */ jsx16("span", { ...props }),
|
|
8534
|
+
mark: ({ node, children, ...props }) => /* @__PURE__ */ jsx16("mark", { ...props, children }),
|
|
8400
8535
|
code: ({ node, children, ...props }) => {
|
|
8401
8536
|
const { inline, ...rest } = props;
|
|
8402
|
-
return inline ? /* @__PURE__ */
|
|
8537
|
+
return inline ? /* @__PURE__ */ jsx16("code", { ...rest, children }) : /* @__PURE__ */ jsx16("code", { ...rest, children });
|
|
8403
8538
|
}
|
|
8404
8539
|
};
|
|
8405
8540
|
var QuerySuggestionPicker = ({
|
|
@@ -8407,9 +8542,9 @@ var QuerySuggestionPicker = ({
|
|
|
8407
8542
|
inputHeight
|
|
8408
8543
|
}) => {
|
|
8409
8544
|
const hasGenerated = useRef11(false);
|
|
8410
|
-
const [hasSentPrompt, setHasSentPrompt] =
|
|
8411
|
-
const [examplePrompts, setExamplePrompts] =
|
|
8412
|
-
const [visiblePrompts, setVisiblePrompts] =
|
|
8545
|
+
const [hasSentPrompt, setHasSentPrompt] = useState15(false);
|
|
8546
|
+
const [examplePrompts, setExamplePrompts] = useState15([]);
|
|
8547
|
+
const [visiblePrompts, setVisiblePrompts] = useState15([]);
|
|
8413
8548
|
const scrollRef = useRef11(null);
|
|
8414
8549
|
const theme = useTheme13();
|
|
8415
8550
|
const isMobile = useMediaQuery6((theme2) => theme2.breakpoints.down("sm"));
|
|
@@ -8472,8 +8607,8 @@ var QuerySuggestionPicker = ({
|
|
|
8472
8607
|
return () => clearInterval(interval);
|
|
8473
8608
|
}, [hasSentPrompt, examplePrompts.length]);
|
|
8474
8609
|
const displayPrompts = isMobile ? visiblePrompts.slice(0, Math.min(visiblePrompts.length, 6)) : visiblePrompts;
|
|
8475
|
-
return displayPrompts.length > 0 && /* @__PURE__ */
|
|
8476
|
-
|
|
8610
|
+
return displayPrompts.length > 0 && /* @__PURE__ */ jsx16(Fragment9, { children: /* @__PURE__ */ jsx16(
|
|
8611
|
+
Box13,
|
|
8477
8612
|
{
|
|
8478
8613
|
ref: scrollRef,
|
|
8479
8614
|
sx: {
|
|
@@ -8489,8 +8624,8 @@ var QuerySuggestionPicker = ({
|
|
|
8489
8624
|
pb: isMobile ? 0.4 : 0,
|
|
8490
8625
|
"&::-webkit-scrollbar": { display: "none" }
|
|
8491
8626
|
},
|
|
8492
|
-
children: displayPrompts.map((prompt, i) => /* @__PURE__ */
|
|
8493
|
-
|
|
8627
|
+
children: displayPrompts.map((prompt, i) => /* @__PURE__ */ jsx16(
|
|
8628
|
+
Box13,
|
|
8494
8629
|
{
|
|
8495
8630
|
sx: {
|
|
8496
8631
|
px: isMobile ? 1.4 : 2,
|
|
@@ -8524,8 +8659,8 @@ var QuerySuggestionPicker = ({
|
|
|
8524
8659
|
onSend(prompt, []);
|
|
8525
8660
|
setHasSentPrompt(true);
|
|
8526
8661
|
},
|
|
8527
|
-
children: /* @__PURE__ */
|
|
8528
|
-
|
|
8662
|
+
children: /* @__PURE__ */ jsx16(
|
|
8663
|
+
Box13,
|
|
8529
8664
|
{
|
|
8530
8665
|
sx: {
|
|
8531
8666
|
flex: 1,
|
|
@@ -8549,7 +8684,7 @@ var QuerySuggestionPicker = ({
|
|
|
8549
8684
|
padding: "0.1em 0.25em"
|
|
8550
8685
|
}
|
|
8551
8686
|
},
|
|
8552
|
-
children: /* @__PURE__ */
|
|
8687
|
+
children: /* @__PURE__ */ jsx16(
|
|
8553
8688
|
ReactMarkdown,
|
|
8554
8689
|
{
|
|
8555
8690
|
remarkPlugins: [remarkGfm],
|
|
@@ -8568,9 +8703,9 @@ var QuerySuggestionPicker = ({
|
|
|
8568
8703
|
};
|
|
8569
8704
|
|
|
8570
8705
|
// ../../src/pages/under-review.tsx
|
|
8571
|
-
import { Box as
|
|
8706
|
+
import { Box as Box14, Typography as Typography10, useTheme as useTheme14 } from "@mui/material";
|
|
8572
8707
|
import { useNavigate as useNavigate2 } from "react-router-dom";
|
|
8573
|
-
import { jsx as
|
|
8708
|
+
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
8574
8709
|
var UnderReview = () => {
|
|
8575
8710
|
const theme = useTheme14();
|
|
8576
8711
|
const navigate = useNavigate2();
|
|
@@ -8578,8 +8713,8 @@ var UnderReview = () => {
|
|
|
8578
8713
|
localStorage.removeItem("authToken");
|
|
8579
8714
|
navigate("/login");
|
|
8580
8715
|
};
|
|
8581
|
-
return /* @__PURE__ */
|
|
8582
|
-
|
|
8716
|
+
return /* @__PURE__ */ jsxs13(
|
|
8717
|
+
Box14,
|
|
8583
8718
|
{
|
|
8584
8719
|
sx: {
|
|
8585
8720
|
minHeight: "100vh",
|
|
@@ -8594,8 +8729,8 @@ var UnderReview = () => {
|
|
|
8594
8729
|
position: "relative"
|
|
8595
8730
|
},
|
|
8596
8731
|
children: [
|
|
8597
|
-
/* @__PURE__ */
|
|
8598
|
-
|
|
8732
|
+
/* @__PURE__ */ jsx17(
|
|
8733
|
+
Box14,
|
|
8599
8734
|
{
|
|
8600
8735
|
onClick: handleSneakyLogout,
|
|
8601
8736
|
sx: {
|
|
@@ -8620,13 +8755,13 @@ var UnderReview = () => {
|
|
|
8620
8755
|
title: "Reset session"
|
|
8621
8756
|
}
|
|
8622
8757
|
),
|
|
8623
|
-
/* @__PURE__ */
|
|
8624
|
-
/* @__PURE__ */
|
|
8758
|
+
/* @__PURE__ */ jsx17(Typography10, { variant: "h4", sx: { mb: 2, fontWeight: 700, color: theme.palette.error.main }, children: "Under Review" }),
|
|
8759
|
+
/* @__PURE__ */ jsxs13(Typography10, { variant: "body1", sx: { mb: 2, color: theme.palette.text.secondary }, children: [
|
|
8625
8760
|
"Your request to use our services is currently being reviewed.",
|
|
8626
|
-
/* @__PURE__ */
|
|
8761
|
+
/* @__PURE__ */ jsx17("br", {}),
|
|
8627
8762
|
"For more info, please contact ",
|
|
8628
8763
|
" ",
|
|
8629
|
-
/* @__PURE__ */
|
|
8764
|
+
/* @__PURE__ */ jsx17("a", { href: "mailto:team@banditai.ai", style: { color: theme.palette.primary.main, fontWeight: 600 }, children: "team@banditai.ai" })
|
|
8630
8765
|
] })
|
|
8631
8766
|
]
|
|
8632
8767
|
}
|
|
@@ -8635,8 +8770,8 @@ var UnderReview = () => {
|
|
|
8635
8770
|
var under_review_default = UnderReview;
|
|
8636
8771
|
|
|
8637
8772
|
// src/components/ConnectionStatus.tsx
|
|
8638
|
-
import { Box as
|
|
8639
|
-
import { jsx as
|
|
8773
|
+
import { Box as Box15, Chip as Chip5, useTheme as useTheme15 } from "@mui/material";
|
|
8774
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
8640
8775
|
var ConnectionStatus = ({
|
|
8641
8776
|
showWhenGood = false,
|
|
8642
8777
|
position = "top"
|
|
@@ -8650,28 +8785,28 @@ var ConnectionStatus = ({
|
|
|
8650
8785
|
switch (connectionQuality) {
|
|
8651
8786
|
case "offline":
|
|
8652
8787
|
return {
|
|
8653
|
-
icon: /* @__PURE__ */
|
|
8788
|
+
icon: /* @__PURE__ */ jsx18(WifiOffIcon, { sx: { fontSize: 16 } }),
|
|
8654
8789
|
label: "Offline",
|
|
8655
8790
|
color: "error",
|
|
8656
8791
|
severity: "high"
|
|
8657
8792
|
};
|
|
8658
8793
|
case "slow":
|
|
8659
8794
|
return {
|
|
8660
|
-
icon: /* @__PURE__ */
|
|
8795
|
+
icon: /* @__PURE__ */ jsx18(SignalWifi2BarIcon, { sx: { fontSize: 16 } }),
|
|
8661
8796
|
label: "Slow connection",
|
|
8662
8797
|
color: "warning",
|
|
8663
8798
|
severity: "medium"
|
|
8664
8799
|
};
|
|
8665
8800
|
case "fast":
|
|
8666
8801
|
return {
|
|
8667
|
-
icon: /* @__PURE__ */
|
|
8802
|
+
icon: /* @__PURE__ */ jsx18(WifiIcon, { sx: { fontSize: 16 } }),
|
|
8668
8803
|
label: "Connected",
|
|
8669
8804
|
color: "success",
|
|
8670
8805
|
severity: "low"
|
|
8671
8806
|
};
|
|
8672
8807
|
default:
|
|
8673
8808
|
return {
|
|
8674
|
-
icon: /* @__PURE__ */
|
|
8809
|
+
icon: /* @__PURE__ */ jsx18(WifiIcon, { sx: { fontSize: 16 } }),
|
|
8675
8810
|
label: "Unknown",
|
|
8676
8811
|
color: "default",
|
|
8677
8812
|
severity: "low"
|
|
@@ -8679,8 +8814,8 @@ var ConnectionStatus = ({
|
|
|
8679
8814
|
}
|
|
8680
8815
|
};
|
|
8681
8816
|
const config = getStatusConfig();
|
|
8682
|
-
return /* @__PURE__ */
|
|
8683
|
-
|
|
8817
|
+
return /* @__PURE__ */ jsx18(
|
|
8818
|
+
Box15,
|
|
8684
8819
|
{
|
|
8685
8820
|
sx: {
|
|
8686
8821
|
position: "fixed",
|
|
@@ -8695,7 +8830,7 @@ var ConnectionStatus = ({
|
|
|
8695
8830
|
"100%": { opacity: 1 }
|
|
8696
8831
|
}
|
|
8697
8832
|
},
|
|
8698
|
-
children: /* @__PURE__ */
|
|
8833
|
+
children: /* @__PURE__ */ jsx18(
|
|
8699
8834
|
Chip5,
|
|
8700
8835
|
{
|
|
8701
8836
|
icon: config.icon,
|
|
@@ -9008,7 +9143,7 @@ var useVoiceMode = (config) => {
|
|
|
9008
9143
|
};
|
|
9009
9144
|
|
|
9010
9145
|
// src/chat/chat.tsx
|
|
9011
|
-
import { jsx as
|
|
9146
|
+
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
9012
9147
|
var ChatContent = () => {
|
|
9013
9148
|
const packageSettings = usePackageSettingsStore((state) => state.settings);
|
|
9014
9149
|
const featureFlag = useFeatureFlag();
|
|
@@ -9016,12 +9151,12 @@ var ChatContent = () => {
|
|
|
9016
9151
|
const ossMode = isOSSMode() || !packageSettings?.featureFlags?.subscriptionType;
|
|
9017
9152
|
const playgroundBypassAccess = packageSettings?.playgroundBypassAuth || typeof window !== "undefined" && window.location.pathname.includes("/playground");
|
|
9018
9153
|
const notificationService = useNotificationService();
|
|
9019
|
-
const [selectedTheme, setSelectedTheme] =
|
|
9020
|
-
const [themeLoading, setThemeLoading] =
|
|
9154
|
+
const [selectedTheme, setSelectedTheme] = useState16(null);
|
|
9155
|
+
const [themeLoading, setThemeLoading] = useState16(true);
|
|
9021
9156
|
const token = authenticationService.getToken();
|
|
9022
9157
|
const claims = token ? authenticationService.parseJwtClaims(token) : null;
|
|
9023
9158
|
const baseTheme = themeMap_default[selectedTheme ?? "bandit-dark"] || banditDarkTheme;
|
|
9024
|
-
const banditTheme =
|
|
9159
|
+
const banditTheme = useMemo4(() => {
|
|
9025
9160
|
return createTheme(baseTheme, {
|
|
9026
9161
|
components: {
|
|
9027
9162
|
MuiInputBase: {
|
|
@@ -9105,14 +9240,14 @@ var ChatContent = () => {
|
|
|
9105
9240
|
}, [packageSettings?.gatewayApiUrl, availableVoices.length, initialized, loadVoicesFromAPI, token]);
|
|
9106
9241
|
const provider = useAIProviderStore((state) => state.provider);
|
|
9107
9242
|
const inputRef = useRef13(null);
|
|
9108
|
-
const [pastedImages, setPastedImages] =
|
|
9243
|
+
const [pastedImages, setPastedImages] = useState16([]);
|
|
9109
9244
|
const inputContainerRef = useRef13(null);
|
|
9110
|
-
const [inputHeight, setInputHeight] =
|
|
9111
|
-
const [isSubmitting, setIsSubmitting] =
|
|
9112
|
-
const [pendingMessage, setPendingMessage] =
|
|
9245
|
+
const [inputHeight, setInputHeight] = useState16(80);
|
|
9246
|
+
const [isSubmitting, setIsSubmitting] = useState16(false);
|
|
9247
|
+
const [pendingMessage, setPendingMessage] = useState16(null);
|
|
9113
9248
|
const { conversations, currentId, _hasHydrated, hydrate } = useConversationStore();
|
|
9114
|
-
const [isMobile, setIsMobile] =
|
|
9115
|
-
const [drawerOpen, setDrawerOpen] =
|
|
9249
|
+
const [isMobile, setIsMobile] = useState16(false);
|
|
9250
|
+
const [drawerOpen, setDrawerOpen] = useState16(false);
|
|
9116
9251
|
const { generateName } = useConversationNameGenerator();
|
|
9117
9252
|
const { preferences } = usePreferencesStore();
|
|
9118
9253
|
const { containerRef: chatContainerRef, targetRef: scrollTargetRef, scrollToBottom, getScrollState } = useAutoScroll({
|
|
@@ -9124,14 +9259,14 @@ var ChatContent = () => {
|
|
|
9124
9259
|
const chatContainerEl = chatContainerRef.current;
|
|
9125
9260
|
const scrollTargetEl = scrollTargetRef.current;
|
|
9126
9261
|
const { isSlowConnection, connectionQuality, trackRequestStart, trackRequestEnd } = useNetworkStatus();
|
|
9127
|
-
const [showScrollToBottom, setShowScrollToBottom] =
|
|
9128
|
-
const [streamBuffer, setStreamBuffer] =
|
|
9129
|
-
const [responseStarted, setResponseStarted] =
|
|
9130
|
-
const [isStreaming, setIsStreaming] =
|
|
9131
|
-
const [isThinking, setIsThinking] =
|
|
9262
|
+
const [showScrollToBottom, setShowScrollToBottom] = useState16(false);
|
|
9263
|
+
const [streamBuffer, setStreamBuffer] = useState16("");
|
|
9264
|
+
const [responseStarted, setResponseStarted] = useState16(false);
|
|
9265
|
+
const [isStreaming, setIsStreaming] = useState16(false);
|
|
9266
|
+
const [isThinking, setIsThinking] = useState16(false);
|
|
9132
9267
|
const initialLogoState = history.length === 0;
|
|
9133
|
-
const [logoVisible, setLogoVisible] =
|
|
9134
|
-
const [logoShouldRender, setLogoShouldRender] =
|
|
9268
|
+
const [logoVisible, setLogoVisible] = useState16(initialLogoState);
|
|
9269
|
+
const [logoShouldRender, setLogoShouldRender] = useState16(initialLogoState);
|
|
9135
9270
|
const streamingGraceUntilRef = useRef13(0);
|
|
9136
9271
|
const GRACE_MS = 450;
|
|
9137
9272
|
const GRACE_OFFSET_DESKTOP = 28;
|
|
@@ -9140,8 +9275,8 @@ var ChatContent = () => {
|
|
|
9140
9275
|
const lastSpokenResponseRef = useRef13(null);
|
|
9141
9276
|
const previousConversationIdRef = useRef13(null);
|
|
9142
9277
|
const logoFadeTimeoutRef = useRef13(null);
|
|
9143
|
-
const [branding, setBranding] =
|
|
9144
|
-
const [brandingLoading, setBrandingLoading] =
|
|
9278
|
+
const [branding, setBranding] = useState16(null);
|
|
9279
|
+
const [brandingLoading, setBrandingLoading] = useState16(true);
|
|
9145
9280
|
const isBrandingLoadInProgressRef = useRef13(false);
|
|
9146
9281
|
const logoOnly = history.length === 0 && !brandingLoading;
|
|
9147
9282
|
useEffect15(() => {
|
|
@@ -9909,10 +10044,10 @@ var ChatContent = () => {
|
|
|
9909
10044
|
}
|
|
9910
10045
|
};
|
|
9911
10046
|
if (!hydrated || brandingLoading || themeLoading) {
|
|
9912
|
-
return /* @__PURE__ */
|
|
9913
|
-
/* @__PURE__ */
|
|
9914
|
-
/* @__PURE__ */
|
|
9915
|
-
|
|
10047
|
+
return /* @__PURE__ */ jsxs14(ThemeProvider, { theme: banditTheme, children: [
|
|
10048
|
+
/* @__PURE__ */ jsx19(CssBaseline, {}),
|
|
10049
|
+
/* @__PURE__ */ jsxs14(
|
|
10050
|
+
Box16,
|
|
9916
10051
|
{
|
|
9917
10052
|
sx: (theme) => ({
|
|
9918
10053
|
minHeight: "100dvh",
|
|
@@ -9925,8 +10060,8 @@ var ChatContent = () => {
|
|
|
9925
10060
|
color: theme.palette.text.primary
|
|
9926
10061
|
}),
|
|
9927
10062
|
children: [
|
|
9928
|
-
/* @__PURE__ */
|
|
9929
|
-
/* @__PURE__ */
|
|
10063
|
+
/* @__PURE__ */ jsx19(CircularProgress4, { size: 32, thickness: 4 }),
|
|
10064
|
+
/* @__PURE__ */ jsx19(Typography11, { variant: "body2", color: "text.secondary", children: "Preparing your workspace..." })
|
|
9930
10065
|
]
|
|
9931
10066
|
}
|
|
9932
10067
|
)
|
|
@@ -9934,15 +10069,15 @@ var ChatContent = () => {
|
|
|
9934
10069
|
}
|
|
9935
10070
|
const userHasAccess = playgroundBypassAccess || ossMode || claims?.roles?.includes("super-user") || claims?.roles?.includes("admin");
|
|
9936
10071
|
if (!userHasAccess) {
|
|
9937
|
-
return /* @__PURE__ */
|
|
9938
|
-
/* @__PURE__ */
|
|
9939
|
-
/* @__PURE__ */
|
|
10072
|
+
return /* @__PURE__ */ jsxs14(ThemeProvider, { theme: banditTheme, children: [
|
|
10073
|
+
/* @__PURE__ */ jsx19(CssBaseline, {}),
|
|
10074
|
+
/* @__PURE__ */ jsx19(under_review_default, {})
|
|
9940
10075
|
] });
|
|
9941
10076
|
}
|
|
9942
|
-
return /* @__PURE__ */
|
|
9943
|
-
/* @__PURE__ */
|
|
9944
|
-
/* @__PURE__ */
|
|
9945
|
-
|
|
10077
|
+
return /* @__PURE__ */ jsxs14(ThemeProvider, { theme: banditTheme, children: [
|
|
10078
|
+
/* @__PURE__ */ jsx19(CssBaseline, {}),
|
|
10079
|
+
/* @__PURE__ */ jsxs14(
|
|
10080
|
+
Box16,
|
|
9946
10081
|
{
|
|
9947
10082
|
sx: (theme) => ({
|
|
9948
10083
|
display: "flex",
|
|
@@ -9960,7 +10095,7 @@ var ChatContent = () => {
|
|
|
9960
10095
|
transition: "left 0.3s ease-in-out, width 0.3s ease-in-out"
|
|
9961
10096
|
}),
|
|
9962
10097
|
children: [
|
|
9963
|
-
/* @__PURE__ */
|
|
10098
|
+
/* @__PURE__ */ jsx19(
|
|
9964
10099
|
chat_app_bar_default,
|
|
9965
10100
|
{
|
|
9966
10101
|
availableModels,
|
|
@@ -9972,8 +10107,8 @@ var ChatContent = () => {
|
|
|
9972
10107
|
setDrawerOpen
|
|
9973
10108
|
}
|
|
9974
10109
|
),
|
|
9975
|
-
/* @__PURE__ */
|
|
9976
|
-
|
|
10110
|
+
/* @__PURE__ */ jsx19(
|
|
10111
|
+
Box16,
|
|
9977
10112
|
{
|
|
9978
10113
|
ref: chatContainerRef,
|
|
9979
10114
|
sx: {
|
|
@@ -9993,8 +10128,8 @@ var ChatContent = () => {
|
|
|
9993
10128
|
msOverflowStyle: "none",
|
|
9994
10129
|
"&::-webkit-scrollbar": { display: "none" }
|
|
9995
10130
|
},
|
|
9996
|
-
children: /* @__PURE__ */
|
|
9997
|
-
|
|
10131
|
+
children: /* @__PURE__ */ jsxs14(
|
|
10132
|
+
Box16,
|
|
9998
10133
|
{
|
|
9999
10134
|
sx: {
|
|
10000
10135
|
width: "100%",
|
|
@@ -10004,9 +10139,9 @@ var ChatContent = () => {
|
|
|
10004
10139
|
pt: 2
|
|
10005
10140
|
},
|
|
10006
10141
|
children: [
|
|
10007
|
-
logoShouldRender && !brandingLoading && (branding?.logoBase64 ? /* @__PURE__ */
|
|
10008
|
-
/* @__PURE__ */
|
|
10009
|
-
|
|
10142
|
+
logoShouldRender && !brandingLoading && (branding?.logoBase64 ? /* @__PURE__ */ jsx19(custom_logo_default, { visible: logoVisible, atTop: true }) : /* @__PURE__ */ jsx19(bandit_chat_logo_default, { visible: logoVisible, atTop: true })),
|
|
10143
|
+
/* @__PURE__ */ jsx19(
|
|
10144
|
+
Box16,
|
|
10010
10145
|
{
|
|
10011
10146
|
sx: {
|
|
10012
10147
|
margin: "0 auto",
|
|
@@ -10015,7 +10150,7 @@ var ChatContent = () => {
|
|
|
10015
10150
|
flexShrink: 0,
|
|
10016
10151
|
px: isMobile ? 0 : 0
|
|
10017
10152
|
},
|
|
10018
|
-
children: /* @__PURE__ */
|
|
10153
|
+
children: /* @__PURE__ */ jsx19(
|
|
10019
10154
|
chat_messages_default,
|
|
10020
10155
|
{
|
|
10021
10156
|
isStreaming,
|
|
@@ -10039,7 +10174,7 @@ var ChatContent = () => {
|
|
|
10039
10174
|
)
|
|
10040
10175
|
}
|
|
10041
10176
|
),
|
|
10042
|
-
showScrollToBottom && /* @__PURE__ */
|
|
10177
|
+
showScrollToBottom && /* @__PURE__ */ jsx19(
|
|
10043
10178
|
chat_scroll_to_bottom_button_default,
|
|
10044
10179
|
{
|
|
10045
10180
|
inputHeight,
|
|
@@ -10048,8 +10183,8 @@ var ChatContent = () => {
|
|
|
10048
10183
|
onClick: handleScrollToBottomClick
|
|
10049
10184
|
}
|
|
10050
10185
|
),
|
|
10051
|
-
history.length === 0 && componentStatus !== "Loading" && !isMobile && /* @__PURE__ */
|
|
10052
|
-
|
|
10186
|
+
history.length === 0 && componentStatus !== "Loading" && !isMobile && /* @__PURE__ */ jsx19(
|
|
10187
|
+
Box16,
|
|
10053
10188
|
{
|
|
10054
10189
|
sx: (theme) => ({
|
|
10055
10190
|
position: "absolute",
|
|
@@ -10067,8 +10202,8 @@ var ChatContent = () => {
|
|
|
10067
10202
|
})
|
|
10068
10203
|
}
|
|
10069
10204
|
),
|
|
10070
|
-
/* @__PURE__ */
|
|
10071
|
-
|
|
10205
|
+
/* @__PURE__ */ jsxs14(
|
|
10206
|
+
Box16,
|
|
10072
10207
|
{
|
|
10073
10208
|
sx: {
|
|
10074
10209
|
display: "flex",
|
|
@@ -10079,10 +10214,10 @@ var ChatContent = () => {
|
|
|
10079
10214
|
maxWidth: "768px"
|
|
10080
10215
|
},
|
|
10081
10216
|
children: [
|
|
10082
|
-
/* @__PURE__ */
|
|
10083
|
-
history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */
|
|
10084
|
-
/* @__PURE__ */
|
|
10085
|
-
/* @__PURE__ */
|
|
10217
|
+
/* @__PURE__ */ jsx19(Box16, { sx: { flex: "1 1 auto" } }),
|
|
10218
|
+
history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */ jsx19(Box16, { sx: { marginBottom: "20px" }, children: /* @__PURE__ */ jsx19(QuerySuggestionPicker, { onSend: handleSend, inputHeight }) }),
|
|
10219
|
+
/* @__PURE__ */ jsx19(ask_user_card_default, {}),
|
|
10220
|
+
/* @__PURE__ */ jsx19(
|
|
10086
10221
|
chat_input_default,
|
|
10087
10222
|
{
|
|
10088
10223
|
inputValue,
|
|
@@ -10109,7 +10244,7 @@ var ChatContent = () => {
|
|
|
10109
10244
|
]
|
|
10110
10245
|
}
|
|
10111
10246
|
),
|
|
10112
|
-
preferences.feedbackEnabled && !isMobile && /* @__PURE__ */
|
|
10247
|
+
preferences.feedbackEnabled && !isMobile && /* @__PURE__ */ jsx19(
|
|
10113
10248
|
FeedbackButton,
|
|
10114
10249
|
{
|
|
10115
10250
|
fullScreen: false,
|
|
@@ -10122,7 +10257,7 @@ var ChatContent = () => {
|
|
|
10122
10257
|
}
|
|
10123
10258
|
}
|
|
10124
10259
|
),
|
|
10125
|
-
/* @__PURE__ */
|
|
10260
|
+
/* @__PURE__ */ jsx19(ConnectionStatus, { position: "top", showWhenGood: false })
|
|
10126
10261
|
]
|
|
10127
10262
|
}
|
|
10128
10263
|
)
|
|
@@ -10151,13 +10286,13 @@ var Chat = () => {
|
|
|
10151
10286
|
});
|
|
10152
10287
|
if (!allowUnauthenticated && !bypassAuth && !authenticationService.isAuthenticated()) {
|
|
10153
10288
|
debugLogger.debug("User is not authenticated, redirecting to login");
|
|
10154
|
-
return /* @__PURE__ */
|
|
10289
|
+
return /* @__PURE__ */ jsx19(Navigate, { to: "/login", replace: true });
|
|
10155
10290
|
}
|
|
10156
|
-
return /* @__PURE__ */
|
|
10291
|
+
return /* @__PURE__ */ jsx19(ChatContent, {});
|
|
10157
10292
|
};
|
|
10158
10293
|
var chat_default = Chat;
|
|
10159
10294
|
|
|
10160
10295
|
export {
|
|
10161
10296
|
chat_default
|
|
10162
10297
|
};
|
|
10163
|
-
//# sourceMappingURL=chunk-
|
|
10298
|
+
//# sourceMappingURL=chunk-NB3N4BKW.mjs.map
|