@copilotz/chat-ui 0.1.4 → 0.1.7
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/index.cjs +626 -657
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +490 -521
- package/dist/index.js.map +1 -1
- package/dist/styles.css +63 -23
- package/package.json +1 -2
package/dist/index.cjs
CHANGED
|
@@ -295,7 +295,6 @@ var configUtils = {
|
|
|
295
295
|
var import_react = require("react");
|
|
296
296
|
var import_react_markdown = __toESM(require("react-markdown"), 1);
|
|
297
297
|
var import_remark_gfm = __toESM(require("remark-gfm"), 1);
|
|
298
|
-
var import_remark_breaks = __toESM(require("remark-breaks"), 1);
|
|
299
298
|
var import_rehype_highlight = __toESM(require("rehype-highlight"), 1);
|
|
300
299
|
|
|
301
300
|
// src/components/ui/button.tsx
|
|
@@ -576,24 +575,6 @@ function TooltipContent({
|
|
|
576
575
|
// src/components/chat/Message.tsx
|
|
577
576
|
var import_lucide_react = require("lucide-react");
|
|
578
577
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
579
|
-
var MarkdownErrorBoundary = class extends import_react.Component {
|
|
580
|
-
constructor(props) {
|
|
581
|
-
super(props);
|
|
582
|
-
this.state = { hasError: false };
|
|
583
|
-
}
|
|
584
|
-
static getDerivedStateFromError(_error) {
|
|
585
|
-
return { hasError: true };
|
|
586
|
-
}
|
|
587
|
-
componentDidCatch(error, errorInfo) {
|
|
588
|
-
console.warn("[Markdown] Falling back to simple rendering due to:", error.message);
|
|
589
|
-
}
|
|
590
|
-
render() {
|
|
591
|
-
if (this.state.hasError) {
|
|
592
|
-
return this.props.fallback;
|
|
593
|
-
}
|
|
594
|
-
return this.props.children;
|
|
595
|
-
}
|
|
596
|
-
};
|
|
597
578
|
var ThinkingIndicator = (0, import_react.memo)(function ThinkingIndicator2({ label = "Thinking..." }) {
|
|
598
579
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-2 py-2", children: [
|
|
599
580
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex gap-1", children: [
|
|
@@ -629,38 +610,9 @@ var markdownComponents = {
|
|
|
629
610
|
return !inline && match ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("pre", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("code", { className, ...props, children }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("code", { className: "bg-muted px-1 py-0.5 rounded text-sm", ...props, children });
|
|
630
611
|
}
|
|
631
612
|
};
|
|
632
|
-
var
|
|
633
|
-
var remarkPluginsSimple = [import_remark_breaks.default];
|
|
613
|
+
var remarkPluginsDefault = [import_remark_gfm.default];
|
|
634
614
|
var rehypePluginsDefault = [import_rehype_highlight.default];
|
|
635
615
|
var rehypePluginsEmpty = [];
|
|
636
|
-
var SimpleMarkdown = (0, import_react.memo)(function SimpleMarkdown2({
|
|
637
|
-
content,
|
|
638
|
-
isStreaming = false
|
|
639
|
-
}) {
|
|
640
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
641
|
-
import_react_markdown.default,
|
|
642
|
-
{
|
|
643
|
-
remarkPlugins: remarkPluginsSimple,
|
|
644
|
-
rehypePlugins: isStreaming ? rehypePluginsEmpty : rehypePluginsDefault,
|
|
645
|
-
components: markdownComponents,
|
|
646
|
-
children: content
|
|
647
|
-
}
|
|
648
|
-
);
|
|
649
|
-
});
|
|
650
|
-
var FullMarkdown = (0, import_react.memo)(function FullMarkdown2({
|
|
651
|
-
content,
|
|
652
|
-
isStreaming = false
|
|
653
|
-
}) {
|
|
654
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
655
|
-
import_react_markdown.default,
|
|
656
|
-
{
|
|
657
|
-
remarkPlugins: remarkPluginsWithGfm,
|
|
658
|
-
rehypePlugins: isStreaming ? rehypePluginsEmpty : rehypePluginsDefault,
|
|
659
|
-
components: markdownComponents,
|
|
660
|
-
children: content
|
|
661
|
-
}
|
|
662
|
-
);
|
|
663
|
-
});
|
|
664
616
|
var StreamingText = (0, import_react.memo)(function StreamingText2({
|
|
665
617
|
content,
|
|
666
618
|
isStreaming = false,
|
|
@@ -668,7 +620,15 @@ var StreamingText = (0, import_react.memo)(function StreamingText2({
|
|
|
668
620
|
}) {
|
|
669
621
|
const hasContent = content.trim().length > 0;
|
|
670
622
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "prose prose-sm max-w-none dark:prose-invert", children: [
|
|
671
|
-
hasContent ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
623
|
+
hasContent ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
624
|
+
import_react_markdown.default,
|
|
625
|
+
{
|
|
626
|
+
remarkPlugins: remarkPluginsDefault,
|
|
627
|
+
rehypePlugins: isStreaming ? rehypePluginsEmpty : rehypePluginsDefault,
|
|
628
|
+
components: markdownComponents,
|
|
629
|
+
children: content
|
|
630
|
+
}
|
|
631
|
+
) : isStreaming ? (
|
|
672
632
|
// Show thinking indicator while waiting for first token
|
|
673
633
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ThinkingIndicator, { label: thinkingLabel })
|
|
674
634
|
) : null,
|
|
@@ -821,27 +781,7 @@ var ToolCallsDisplay = (0, import_react.memo)(function ToolCallsDisplay2({ toolC
|
|
|
821
781
|
] });
|
|
822
782
|
});
|
|
823
783
|
var arePropsEqual = (prevProps, nextProps) => {
|
|
824
|
-
if (prevProps.message
|
|
825
|
-
if (prevProps.message.content !== nextProps.message.content) return false;
|
|
826
|
-
if (prevProps.message.isStreaming !== nextProps.message.isStreaming) return false;
|
|
827
|
-
if (prevProps.message.isComplete !== nextProps.message.isComplete) return false;
|
|
828
|
-
if (prevProps.message.isEdited !== nextProps.message.isEdited) return false;
|
|
829
|
-
if (prevProps.message.timestamp !== nextProps.message.timestamp) return false;
|
|
830
|
-
if (prevProps.message.toolCalls !== nextProps.message.toolCalls) {
|
|
831
|
-
const prevCalls = prevProps.message.toolCalls;
|
|
832
|
-
const nextCalls = nextProps.message.toolCalls;
|
|
833
|
-
if (!prevCalls || !nextCalls || prevCalls.length !== nextCalls.length) return false;
|
|
834
|
-
for (let i = 0; i < prevCalls.length; i++) {
|
|
835
|
-
if (prevCalls[i].id !== nextCalls[i].id || prevCalls[i].status !== nextCalls[i].status || prevCalls[i].result !== nextCalls[i].result) {
|
|
836
|
-
return false;
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
if (prevProps.message.attachments !== nextProps.message.attachments) {
|
|
841
|
-
const prevAtt = prevProps.message.attachments;
|
|
842
|
-
const nextAtt = nextProps.message.attachments;
|
|
843
|
-
if (!prevAtt || !nextAtt || prevAtt.length !== nextAtt.length) return false;
|
|
844
|
-
}
|
|
784
|
+
if (prevProps.message !== nextProps.message) return false;
|
|
845
785
|
if (prevProps.isUser !== nextProps.isUser) return false;
|
|
846
786
|
if (prevProps.userAvatar !== nextProps.userAvatar) return false;
|
|
847
787
|
if (prevProps.userName !== nextProps.userName) return false;
|
|
@@ -1050,26 +990,18 @@ var import_lucide_react3 = require("lucide-react");
|
|
|
1050
990
|
// src/hooks/use-mobile.ts
|
|
1051
991
|
var React2 = __toESM(require("react"), 1);
|
|
1052
992
|
var MOBILE_BREAKPOINT = 768;
|
|
1053
|
-
function getInitialIsMobile() {
|
|
1054
|
-
if (typeof window === "undefined") return false;
|
|
1055
|
-
return window.innerWidth < MOBILE_BREAKPOINT;
|
|
1056
|
-
}
|
|
1057
993
|
function useIsMobile() {
|
|
1058
|
-
const [isMobile, setIsMobile] = React2.useState(
|
|
994
|
+
const [isMobile, setIsMobile] = React2.useState(void 0);
|
|
1059
995
|
React2.useEffect(() => {
|
|
1060
996
|
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
1061
997
|
const onChange = () => {
|
|
1062
998
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
1063
999
|
};
|
|
1064
1000
|
mql.addEventListener("change", onChange);
|
|
1065
|
-
window.addEventListener("resize", onChange);
|
|
1066
1001
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
1067
|
-
return () =>
|
|
1068
|
-
mql.removeEventListener("change", onChange);
|
|
1069
|
-
window.removeEventListener("resize", onChange);
|
|
1070
|
-
};
|
|
1002
|
+
return () => mql.removeEventListener("change", onChange);
|
|
1071
1003
|
}, []);
|
|
1072
|
-
return isMobile;
|
|
1004
|
+
return !!isMobile;
|
|
1073
1005
|
}
|
|
1074
1006
|
|
|
1075
1007
|
// src/components/ui/separator.tsx
|
|
@@ -1216,8 +1148,21 @@ function SheetDescription({
|
|
|
1216
1148
|
);
|
|
1217
1149
|
}
|
|
1218
1150
|
|
|
1219
|
-
// src/components/ui/
|
|
1151
|
+
// src/components/ui/skeleton.tsx
|
|
1220
1152
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1153
|
+
function Skeleton({ className, ...props }) {
|
|
1154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1155
|
+
"div",
|
|
1156
|
+
{
|
|
1157
|
+
"data-slot": "skeleton",
|
|
1158
|
+
className: cn("bg-accent animate-pulse rounded-md", className),
|
|
1159
|
+
...props
|
|
1160
|
+
}
|
|
1161
|
+
);
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
// src/components/ui/sidebar.tsx
|
|
1165
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1221
1166
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
1222
1167
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
1223
1168
|
var SIDEBAR_WIDTH = "16rem";
|
|
@@ -1283,7 +1228,7 @@ function SidebarProvider({
|
|
|
1283
1228
|
}),
|
|
1284
1229
|
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
1285
1230
|
);
|
|
1286
|
-
return /* @__PURE__ */ (0,
|
|
1231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1287
1232
|
"div",
|
|
1288
1233
|
{
|
|
1289
1234
|
"data-slot": "sidebar-wrapper",
|
|
@@ -1311,7 +1256,7 @@ function Sidebar({
|
|
|
1311
1256
|
}) {
|
|
1312
1257
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
1313
1258
|
if (collapsible === "none") {
|
|
1314
|
-
return /* @__PURE__ */ (0,
|
|
1259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1315
1260
|
"div",
|
|
1316
1261
|
{
|
|
1317
1262
|
"data-slot": "sidebar",
|
|
@@ -1325,7 +1270,7 @@ function Sidebar({
|
|
|
1325
1270
|
);
|
|
1326
1271
|
}
|
|
1327
1272
|
if (isMobile) {
|
|
1328
|
-
return /* @__PURE__ */ (0,
|
|
1273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1329
1274
|
SheetContent,
|
|
1330
1275
|
{
|
|
1331
1276
|
"data-sidebar": "sidebar",
|
|
@@ -1337,70 +1282,50 @@ function Sidebar({
|
|
|
1337
1282
|
},
|
|
1338
1283
|
side,
|
|
1339
1284
|
children: [
|
|
1340
|
-
/* @__PURE__ */ (0,
|
|
1341
|
-
/* @__PURE__ */ (0,
|
|
1342
|
-
/* @__PURE__ */ (0,
|
|
1285
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(SheetHeader, { className: "sr-only", children: [
|
|
1286
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SheetTitle, { children: "Sidebar" }),
|
|
1287
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
1343
1288
|
] }),
|
|
1344
|
-
/* @__PURE__ */ (0,
|
|
1289
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex h-full w-full flex-col", children })
|
|
1345
1290
|
]
|
|
1346
1291
|
}
|
|
1347
1292
|
) });
|
|
1348
1293
|
}
|
|
1349
|
-
|
|
1350
|
-
const currentCollapsible = isCollapsed ? collapsible : "";
|
|
1351
|
-
const getGapWidth = () => {
|
|
1352
|
-
if (currentCollapsible === "offcanvas") return "0px";
|
|
1353
|
-
if (currentCollapsible === "icon") return SIDEBAR_WIDTH_ICON;
|
|
1354
|
-
return SIDEBAR_WIDTH;
|
|
1355
|
-
};
|
|
1356
|
-
const getContainerWidth = () => {
|
|
1357
|
-
if (currentCollapsible === "icon") return SIDEBAR_WIDTH_ICON;
|
|
1358
|
-
return SIDEBAR_WIDTH;
|
|
1359
|
-
};
|
|
1360
|
-
const getContainerOffset = () => {
|
|
1361
|
-
if (currentCollapsible === "offcanvas") {
|
|
1362
|
-
return side === "left" ? `calc(${SIDEBAR_WIDTH} * -1)` : `calc(${SIDEBAR_WIDTH} * -1)`;
|
|
1363
|
-
}
|
|
1364
|
-
return "0";
|
|
1365
|
-
};
|
|
1366
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1367
1295
|
"div",
|
|
1368
1296
|
{
|
|
1369
|
-
className: "group peer text-sidebar-foreground",
|
|
1297
|
+
className: "group peer text-sidebar-foreground hidden md:block",
|
|
1370
1298
|
"data-state": state,
|
|
1371
|
-
"data-collapsible":
|
|
1299
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
1372
1300
|
"data-variant": variant,
|
|
1373
1301
|
"data-side": side,
|
|
1374
1302
|
"data-slot": "sidebar",
|
|
1375
1303
|
children: [
|
|
1376
|
-
/* @__PURE__ */ (0,
|
|
1304
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1377
1305
|
"div",
|
|
1378
1306
|
{
|
|
1379
1307
|
"data-slot": "sidebar-gap",
|
|
1380
1308
|
className: cn(
|
|
1381
|
-
"relative bg-transparent transition-[width] duration-200 ease-linear",
|
|
1382
|
-
"group-data-[
|
|
1383
|
-
|
|
1384
|
-
|
|
1309
|
+
"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
|
|
1310
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
1311
|
+
"group-data-[side=right]:rotate-180",
|
|
1312
|
+
variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
|
|
1313
|
+
)
|
|
1385
1314
|
}
|
|
1386
1315
|
),
|
|
1387
|
-
/* @__PURE__ */ (0,
|
|
1316
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1388
1317
|
"div",
|
|
1389
1318
|
{
|
|
1390
1319
|
"data-slot": "sidebar-container",
|
|
1391
1320
|
className: cn(
|
|
1392
|
-
"fixed inset-y-0 z-10 h-
|
|
1321
|
+
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
|
|
1322
|
+
side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
1393
1323
|
// Adjust the padding for floating and inset variants.
|
|
1394
|
-
variant === "floating" || variant === "inset" ? "p-2" : side
|
|
1324
|
+
variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
1395
1325
|
className
|
|
1396
1326
|
),
|
|
1397
|
-
style: {
|
|
1398
|
-
display: "flex",
|
|
1399
|
-
width: getContainerWidth(),
|
|
1400
|
-
[side === "left" ? "left" : "right"]: getContainerOffset()
|
|
1401
|
-
},
|
|
1402
1327
|
...props,
|
|
1403
|
-
children: /* @__PURE__ */ (0,
|
|
1328
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1404
1329
|
"div",
|
|
1405
1330
|
{
|
|
1406
1331
|
"data-sidebar": "sidebar",
|
|
@@ -1421,16 +1346,7 @@ function SidebarTrigger({
|
|
|
1421
1346
|
...props
|
|
1422
1347
|
}) {
|
|
1423
1348
|
const { toggleSidebar } = useSidebar();
|
|
1424
|
-
|
|
1425
|
-
if (event.type === "touchend") {
|
|
1426
|
-
event.preventDefault();
|
|
1427
|
-
}
|
|
1428
|
-
if ("onClick" in event && onClick) {
|
|
1429
|
-
onClick(event);
|
|
1430
|
-
}
|
|
1431
|
-
toggleSidebar();
|
|
1432
|
-
}, [onClick, toggleSidebar]);
|
|
1433
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1434
1350
|
Button,
|
|
1435
1351
|
{
|
|
1436
1352
|
"data-sidebar": "trigger",
|
|
@@ -1438,19 +1354,21 @@ function SidebarTrigger({
|
|
|
1438
1354
|
variant: "ghost",
|
|
1439
1355
|
size: "icon",
|
|
1440
1356
|
className: cn("size-7", className),
|
|
1441
|
-
onClick:
|
|
1442
|
-
|
|
1357
|
+
onClick: (event) => {
|
|
1358
|
+
onClick?.(event);
|
|
1359
|
+
toggleSidebar();
|
|
1360
|
+
},
|
|
1443
1361
|
...props,
|
|
1444
1362
|
children: [
|
|
1445
|
-
/* @__PURE__ */ (0,
|
|
1446
|
-
/* @__PURE__ */ (0,
|
|
1363
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react3.PanelLeftIcon, {}),
|
|
1364
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
1447
1365
|
]
|
|
1448
1366
|
}
|
|
1449
1367
|
);
|
|
1450
1368
|
}
|
|
1451
1369
|
function SidebarRail({ className, ...props }) {
|
|
1452
1370
|
const { toggleSidebar } = useSidebar();
|
|
1453
|
-
return /* @__PURE__ */ (0,
|
|
1371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1454
1372
|
"button",
|
|
1455
1373
|
{
|
|
1456
1374
|
"data-sidebar": "rail",
|
|
@@ -1473,7 +1391,7 @@ function SidebarRail({ className, ...props }) {
|
|
|
1473
1391
|
);
|
|
1474
1392
|
}
|
|
1475
1393
|
function SidebarInset({ className, ...props }) {
|
|
1476
|
-
return /* @__PURE__ */ (0,
|
|
1394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1477
1395
|
"main",
|
|
1478
1396
|
{
|
|
1479
1397
|
"data-slot": "sidebar-inset",
|
|
@@ -1487,7 +1405,7 @@ function SidebarInset({ className, ...props }) {
|
|
|
1487
1405
|
);
|
|
1488
1406
|
}
|
|
1489
1407
|
function SidebarHeader({ className, ...props }) {
|
|
1490
|
-
return /* @__PURE__ */ (0,
|
|
1408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1491
1409
|
"div",
|
|
1492
1410
|
{
|
|
1493
1411
|
"data-slot": "sidebar-header",
|
|
@@ -1498,7 +1416,7 @@ function SidebarHeader({ className, ...props }) {
|
|
|
1498
1416
|
);
|
|
1499
1417
|
}
|
|
1500
1418
|
function SidebarFooter({ className, ...props }) {
|
|
1501
|
-
return /* @__PURE__ */ (0,
|
|
1419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1502
1420
|
"div",
|
|
1503
1421
|
{
|
|
1504
1422
|
"data-slot": "sidebar-footer",
|
|
@@ -1509,7 +1427,7 @@ function SidebarFooter({ className, ...props }) {
|
|
|
1509
1427
|
);
|
|
1510
1428
|
}
|
|
1511
1429
|
function SidebarContent({ className, ...props }) {
|
|
1512
|
-
return /* @__PURE__ */ (0,
|
|
1430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1513
1431
|
"div",
|
|
1514
1432
|
{
|
|
1515
1433
|
"data-slot": "sidebar-content",
|
|
@@ -1523,7 +1441,7 @@ function SidebarContent({ className, ...props }) {
|
|
|
1523
1441
|
);
|
|
1524
1442
|
}
|
|
1525
1443
|
function SidebarGroup({ className, ...props }) {
|
|
1526
|
-
return /* @__PURE__ */ (0,
|
|
1444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1527
1445
|
"div",
|
|
1528
1446
|
{
|
|
1529
1447
|
"data-slot": "sidebar-group",
|
|
@@ -1539,7 +1457,7 @@ function SidebarGroupLabel({
|
|
|
1539
1457
|
...props
|
|
1540
1458
|
}) {
|
|
1541
1459
|
const Comp = asChild ? import_react_slot3.Slot : "div";
|
|
1542
|
-
return /* @__PURE__ */ (0,
|
|
1460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1543
1461
|
Comp,
|
|
1544
1462
|
{
|
|
1545
1463
|
"data-slot": "sidebar-group-label",
|
|
@@ -1557,7 +1475,7 @@ function SidebarGroupContent({
|
|
|
1557
1475
|
className,
|
|
1558
1476
|
...props
|
|
1559
1477
|
}) {
|
|
1560
|
-
return /* @__PURE__ */ (0,
|
|
1478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1561
1479
|
"div",
|
|
1562
1480
|
{
|
|
1563
1481
|
"data-slot": "sidebar-group-content",
|
|
@@ -1568,7 +1486,7 @@ function SidebarGroupContent({
|
|
|
1568
1486
|
);
|
|
1569
1487
|
}
|
|
1570
1488
|
function SidebarMenu({ className, ...props }) {
|
|
1571
|
-
return /* @__PURE__ */ (0,
|
|
1489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1572
1490
|
"ul",
|
|
1573
1491
|
{
|
|
1574
1492
|
"data-slot": "sidebar-menu",
|
|
@@ -1579,7 +1497,7 @@ function SidebarMenu({ className, ...props }) {
|
|
|
1579
1497
|
);
|
|
1580
1498
|
}
|
|
1581
1499
|
function SidebarMenuItem({ className, ...props }) {
|
|
1582
|
-
return /* @__PURE__ */ (0,
|
|
1500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1583
1501
|
"li",
|
|
1584
1502
|
{
|
|
1585
1503
|
"data-slot": "sidebar-menu-item",
|
|
@@ -1620,7 +1538,7 @@ function SidebarMenuButton({
|
|
|
1620
1538
|
}) {
|
|
1621
1539
|
const Comp = asChild ? import_react_slot3.Slot : "button";
|
|
1622
1540
|
const { isMobile, state } = useSidebar();
|
|
1623
|
-
const button = /* @__PURE__ */ (0,
|
|
1541
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1624
1542
|
Comp,
|
|
1625
1543
|
{
|
|
1626
1544
|
"data-slot": "sidebar-menu-button",
|
|
@@ -1639,9 +1557,9 @@ function SidebarMenuButton({
|
|
|
1639
1557
|
children: tooltip
|
|
1640
1558
|
};
|
|
1641
1559
|
}
|
|
1642
|
-
return /* @__PURE__ */ (0,
|
|
1643
|
-
/* @__PURE__ */ (0,
|
|
1644
|
-
/* @__PURE__ */ (0,
|
|
1560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Tooltip, { children: [
|
|
1561
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipTrigger, { asChild: true, children: button }),
|
|
1562
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1645
1563
|
TooltipContent,
|
|
1646
1564
|
{
|
|
1647
1565
|
side: "right",
|
|
@@ -1659,7 +1577,7 @@ function SidebarMenuAction({
|
|
|
1659
1577
|
...props
|
|
1660
1578
|
}) {
|
|
1661
1579
|
const Comp = asChild ? import_react_slot3.Slot : "button";
|
|
1662
|
-
return /* @__PURE__ */ (0,
|
|
1580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1663
1581
|
Comp,
|
|
1664
1582
|
{
|
|
1665
1583
|
"data-slot": "sidebar-menu-action",
|
|
@@ -1684,7 +1602,7 @@ function SidebarMenuAction({
|
|
|
1684
1602
|
var React5 = __toESM(require("react"), 1);
|
|
1685
1603
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
1686
1604
|
var import_lucide_react4 = require("lucide-react");
|
|
1687
|
-
var
|
|
1605
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1688
1606
|
function cleanupBodyStyles2() {
|
|
1689
1607
|
if (typeof document !== "undefined" && document.body.style.pointerEvents === "none") {
|
|
1690
1608
|
document.body.style.pointerEvents = "";
|
|
@@ -1708,23 +1626,23 @@ function Dialog({
|
|
|
1708
1626
|
cleanupBodyStyles2();
|
|
1709
1627
|
};
|
|
1710
1628
|
}, []);
|
|
1711
|
-
return /* @__PURE__ */ (0,
|
|
1629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", open, onOpenChange, ...props });
|
|
1712
1630
|
}
|
|
1713
1631
|
function DialogTrigger({
|
|
1714
1632
|
...props
|
|
1715
1633
|
}) {
|
|
1716
|
-
return /* @__PURE__ */ (0,
|
|
1634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
1717
1635
|
}
|
|
1718
1636
|
function DialogPortal({
|
|
1719
1637
|
...props
|
|
1720
1638
|
}) {
|
|
1721
|
-
return /* @__PURE__ */ (0,
|
|
1639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
1722
1640
|
}
|
|
1723
1641
|
function DialogOverlay({
|
|
1724
1642
|
className,
|
|
1725
1643
|
...props
|
|
1726
1644
|
}) {
|
|
1727
|
-
return /* @__PURE__ */ (0,
|
|
1645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1728
1646
|
DialogPrimitive.Overlay,
|
|
1729
1647
|
{
|
|
1730
1648
|
"data-slot": "dialog-overlay",
|
|
@@ -1745,9 +1663,9 @@ function DialogContent({
|
|
|
1745
1663
|
showCloseButton = true,
|
|
1746
1664
|
...props
|
|
1747
1665
|
}) {
|
|
1748
|
-
return /* @__PURE__ */ (0,
|
|
1749
|
-
/* @__PURE__ */ (0,
|
|
1750
|
-
/* @__PURE__ */ (0,
|
|
1666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
1667
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogOverlay, {}),
|
|
1668
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1751
1669
|
DialogPrimitive.Content,
|
|
1752
1670
|
{
|
|
1753
1671
|
"data-slot": "dialog-content",
|
|
@@ -1759,14 +1677,14 @@ function DialogContent({
|
|
|
1759
1677
|
...props,
|
|
1760
1678
|
children: [
|
|
1761
1679
|
children,
|
|
1762
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
1680
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1763
1681
|
DialogPrimitive.Close,
|
|
1764
1682
|
{
|
|
1765
1683
|
"data-slot": "dialog-close",
|
|
1766
1684
|
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1767
1685
|
children: [
|
|
1768
|
-
/* @__PURE__ */ (0,
|
|
1769
|
-
/* @__PURE__ */ (0,
|
|
1686
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react4.XIcon, {}),
|
|
1687
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: "Close" })
|
|
1770
1688
|
]
|
|
1771
1689
|
}
|
|
1772
1690
|
)
|
|
@@ -1776,7 +1694,7 @@ function DialogContent({
|
|
|
1776
1694
|
] });
|
|
1777
1695
|
}
|
|
1778
1696
|
function DialogHeader({ className, ...props }) {
|
|
1779
|
-
return /* @__PURE__ */ (0,
|
|
1697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1780
1698
|
"div",
|
|
1781
1699
|
{
|
|
1782
1700
|
"data-slot": "dialog-header",
|
|
@@ -1786,7 +1704,7 @@ function DialogHeader({ className, ...props }) {
|
|
|
1786
1704
|
);
|
|
1787
1705
|
}
|
|
1788
1706
|
function DialogFooter({ className, ...props }) {
|
|
1789
|
-
return /* @__PURE__ */ (0,
|
|
1707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1790
1708
|
"div",
|
|
1791
1709
|
{
|
|
1792
1710
|
"data-slot": "dialog-footer",
|
|
@@ -1802,7 +1720,7 @@ function DialogTitle({
|
|
|
1802
1720
|
className,
|
|
1803
1721
|
...props
|
|
1804
1722
|
}) {
|
|
1805
|
-
return /* @__PURE__ */ (0,
|
|
1723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1806
1724
|
DialogPrimitive.Title,
|
|
1807
1725
|
{
|
|
1808
1726
|
"data-slot": "dialog-title",
|
|
@@ -1815,7 +1733,7 @@ function DialogDescription({
|
|
|
1815
1733
|
className,
|
|
1816
1734
|
...props
|
|
1817
1735
|
}) {
|
|
1818
|
-
return /* @__PURE__ */ (0,
|
|
1736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1819
1737
|
DialogPrimitive.Description,
|
|
1820
1738
|
{
|
|
1821
1739
|
"data-slot": "dialog-description",
|
|
@@ -1828,7 +1746,7 @@ function DialogDescription({
|
|
|
1828
1746
|
// src/components/ui/alert-dialog.tsx
|
|
1829
1747
|
var React6 = __toESM(require("react"), 1);
|
|
1830
1748
|
var AlertDialogPrimitive = __toESM(require("@radix-ui/react-alert-dialog"), 1);
|
|
1831
|
-
var
|
|
1749
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1832
1750
|
function cleanupBodyStyles3() {
|
|
1833
1751
|
if (typeof document !== "undefined" && document.body.style.pointerEvents === "none") {
|
|
1834
1752
|
document.body.style.pointerEvents = "";
|
|
@@ -1852,18 +1770,18 @@ function AlertDialog({
|
|
|
1852
1770
|
cleanupBodyStyles3();
|
|
1853
1771
|
};
|
|
1854
1772
|
}, []);
|
|
1855
|
-
return /* @__PURE__ */ (0,
|
|
1773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", open, onOpenChange, ...props });
|
|
1856
1774
|
}
|
|
1857
1775
|
function AlertDialogPortal({
|
|
1858
1776
|
...props
|
|
1859
1777
|
}) {
|
|
1860
|
-
return /* @__PURE__ */ (0,
|
|
1778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props });
|
|
1861
1779
|
}
|
|
1862
1780
|
function AlertDialogOverlay({
|
|
1863
1781
|
className,
|
|
1864
1782
|
...props
|
|
1865
1783
|
}) {
|
|
1866
|
-
return /* @__PURE__ */ (0,
|
|
1784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1867
1785
|
AlertDialogPrimitive.Overlay,
|
|
1868
1786
|
{
|
|
1869
1787
|
"data-slot": "alert-dialog-overlay",
|
|
@@ -1882,9 +1800,9 @@ function AlertDialogContent({
|
|
|
1882
1800
|
className,
|
|
1883
1801
|
...props
|
|
1884
1802
|
}) {
|
|
1885
|
-
return /* @__PURE__ */ (0,
|
|
1886
|
-
/* @__PURE__ */ (0,
|
|
1887
|
-
/* @__PURE__ */ (0,
|
|
1803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(AlertDialogPortal, { children: [
|
|
1804
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AlertDialogOverlay, {}),
|
|
1805
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1888
1806
|
AlertDialogPrimitive.Content,
|
|
1889
1807
|
{
|
|
1890
1808
|
"data-slot": "alert-dialog-content",
|
|
@@ -1901,7 +1819,7 @@ function AlertDialogHeader({
|
|
|
1901
1819
|
className,
|
|
1902
1820
|
...props
|
|
1903
1821
|
}) {
|
|
1904
|
-
return /* @__PURE__ */ (0,
|
|
1822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1905
1823
|
"div",
|
|
1906
1824
|
{
|
|
1907
1825
|
"data-slot": "alert-dialog-header",
|
|
@@ -1914,7 +1832,7 @@ function AlertDialogFooter({
|
|
|
1914
1832
|
className,
|
|
1915
1833
|
...props
|
|
1916
1834
|
}) {
|
|
1917
|
-
return /* @__PURE__ */ (0,
|
|
1835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1918
1836
|
"div",
|
|
1919
1837
|
{
|
|
1920
1838
|
"data-slot": "alert-dialog-footer",
|
|
@@ -1930,7 +1848,7 @@ function AlertDialogTitle({
|
|
|
1930
1848
|
className,
|
|
1931
1849
|
...props
|
|
1932
1850
|
}) {
|
|
1933
|
-
return /* @__PURE__ */ (0,
|
|
1851
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1934
1852
|
AlertDialogPrimitive.Title,
|
|
1935
1853
|
{
|
|
1936
1854
|
"data-slot": "alert-dialog-title",
|
|
@@ -1943,7 +1861,7 @@ function AlertDialogDescription({
|
|
|
1943
1861
|
className,
|
|
1944
1862
|
...props
|
|
1945
1863
|
}) {
|
|
1946
|
-
return /* @__PURE__ */ (0,
|
|
1864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1947
1865
|
AlertDialogPrimitive.Description,
|
|
1948
1866
|
{
|
|
1949
1867
|
"data-slot": "alert-dialog-description",
|
|
@@ -1956,7 +1874,7 @@ function AlertDialogAction({
|
|
|
1956
1874
|
className,
|
|
1957
1875
|
...props
|
|
1958
1876
|
}) {
|
|
1959
|
-
return /* @__PURE__ */ (0,
|
|
1877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1960
1878
|
AlertDialogPrimitive.Action,
|
|
1961
1879
|
{
|
|
1962
1880
|
className: cn(buttonVariants(), className),
|
|
@@ -1968,7 +1886,7 @@ function AlertDialogCancel({
|
|
|
1968
1886
|
className,
|
|
1969
1887
|
...props
|
|
1970
1888
|
}) {
|
|
1971
|
-
return /* @__PURE__ */ (0,
|
|
1889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1972
1890
|
AlertDialogPrimitive.Cancel,
|
|
1973
1891
|
{
|
|
1974
1892
|
className: cn(buttonVariants({ variant: "outline" }), className),
|
|
@@ -1980,16 +1898,16 @@ function AlertDialogCancel({
|
|
|
1980
1898
|
// src/components/ui/dropdown-menu.tsx
|
|
1981
1899
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
1982
1900
|
var import_lucide_react5 = require("lucide-react");
|
|
1983
|
-
var
|
|
1901
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1984
1902
|
function DropdownMenu({
|
|
1985
1903
|
...props
|
|
1986
1904
|
}) {
|
|
1987
|
-
return /* @__PURE__ */ (0,
|
|
1905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
1988
1906
|
}
|
|
1989
1907
|
function DropdownMenuTrigger({
|
|
1990
1908
|
...props
|
|
1991
1909
|
}) {
|
|
1992
|
-
return /* @__PURE__ */ (0,
|
|
1910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1993
1911
|
DropdownMenuPrimitive.Trigger,
|
|
1994
1912
|
{
|
|
1995
1913
|
"data-slot": "dropdown-menu-trigger",
|
|
@@ -2002,7 +1920,7 @@ function DropdownMenuContent({
|
|
|
2002
1920
|
sideOffset = 4,
|
|
2003
1921
|
...props
|
|
2004
1922
|
}) {
|
|
2005
|
-
return /* @__PURE__ */ (0,
|
|
1923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2006
1924
|
DropdownMenuPrimitive.Content,
|
|
2007
1925
|
{
|
|
2008
1926
|
"data-slot": "dropdown-menu-content",
|
|
@@ -2021,7 +1939,7 @@ function DropdownMenuItem({
|
|
|
2021
1939
|
variant = "default",
|
|
2022
1940
|
...props
|
|
2023
1941
|
}) {
|
|
2024
|
-
return /* @__PURE__ */ (0,
|
|
1942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2025
1943
|
DropdownMenuPrimitive.Item,
|
|
2026
1944
|
{
|
|
2027
1945
|
"data-slot": "dropdown-menu-item",
|
|
@@ -2040,7 +1958,7 @@ function DropdownMenuLabel({
|
|
|
2040
1958
|
inset,
|
|
2041
1959
|
...props
|
|
2042
1960
|
}) {
|
|
2043
|
-
return /* @__PURE__ */ (0,
|
|
1961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2044
1962
|
DropdownMenuPrimitive.Label,
|
|
2045
1963
|
{
|
|
2046
1964
|
"data-slot": "dropdown-menu-label",
|
|
@@ -2057,7 +1975,7 @@ function DropdownMenuSeparator({
|
|
|
2057
1975
|
className,
|
|
2058
1976
|
...props
|
|
2059
1977
|
}) {
|
|
2060
|
-
return /* @__PURE__ */ (0,
|
|
1978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2061
1979
|
DropdownMenuPrimitive.Separator,
|
|
2062
1980
|
{
|
|
2063
1981
|
"data-slot": "dropdown-menu-separator",
|
|
@@ -2072,7 +1990,7 @@ var import_lucide_react7 = require("lucide-react");
|
|
|
2072
1990
|
|
|
2073
1991
|
// src/components/chat/UserMenu.tsx
|
|
2074
1992
|
var import_lucide_react6 = require("lucide-react");
|
|
2075
|
-
var
|
|
1993
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2076
1994
|
var getInitials = (name, email) => {
|
|
2077
1995
|
if (name) {
|
|
2078
1996
|
return name.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase();
|
|
@@ -2107,27 +2025,27 @@ var UserMenu = ({
|
|
|
2107
2025
|
};
|
|
2108
2026
|
const displayName = getDisplayName(user, labels.guest);
|
|
2109
2027
|
const initials = getInitials(user?.name, user?.email);
|
|
2110
|
-
return /* @__PURE__ */ (0,
|
|
2111
|
-
/* @__PURE__ */ (0,
|
|
2028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SidebarMenu, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SidebarMenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DropdownMenu, { children: [
|
|
2029
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2112
2030
|
SidebarMenuButton,
|
|
2113
2031
|
{
|
|
2114
2032
|
size: "lg",
|
|
2115
2033
|
className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
|
|
2116
2034
|
tooltip: displayName,
|
|
2117
2035
|
children: [
|
|
2118
|
-
/* @__PURE__ */ (0,
|
|
2119
|
-
user?.avatar && /* @__PURE__ */ (0,
|
|
2120
|
-
/* @__PURE__ */ (0,
|
|
2036
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Avatar, { className: "h-8 w-8 rounded-lg", children: [
|
|
2037
|
+
user?.avatar && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AvatarImage, { src: user.avatar, alt: displayName }),
|
|
2038
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AvatarFallback, { className: "rounded-lg bg-primary/10 text-primary text-xs font-medium", children: initials })
|
|
2121
2039
|
] }),
|
|
2122
|
-
/* @__PURE__ */ (0,
|
|
2123
|
-
/* @__PURE__ */ (0,
|
|
2124
|
-
user?.email && /* @__PURE__ */ (0,
|
|
2040
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden", children: [
|
|
2041
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "truncate font-medium", children: displayName }),
|
|
2042
|
+
user?.email && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "truncate text-xs text-muted-foreground", children: user.email })
|
|
2125
2043
|
] }),
|
|
2126
|
-
/* @__PURE__ */ (0,
|
|
2044
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.ChevronsUpDown, { className: "ml-auto size-4 group-data-[collapsible=icon]:hidden" })
|
|
2127
2045
|
]
|
|
2128
2046
|
}
|
|
2129
2047
|
) }),
|
|
2130
|
-
/* @__PURE__ */ (0,
|
|
2048
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2131
2049
|
DropdownMenuContent,
|
|
2132
2050
|
{
|
|
2133
2051
|
className: "w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg",
|
|
@@ -2135,72 +2053,72 @@ var UserMenu = ({
|
|
|
2135
2053
|
align: "end",
|
|
2136
2054
|
sideOffset: 4,
|
|
2137
2055
|
children: [
|
|
2138
|
-
/* @__PURE__ */ (0,
|
|
2139
|
-
/* @__PURE__ */ (0,
|
|
2140
|
-
user?.avatar && /* @__PURE__ */ (0,
|
|
2141
|
-
/* @__PURE__ */ (0,
|
|
2056
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DropdownMenuLabel, { className: "p-0 font-normal", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm", children: [
|
|
2057
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Avatar, { className: "h-8 w-8 rounded-lg", children: [
|
|
2058
|
+
user?.avatar && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AvatarImage, { src: user.avatar, alt: displayName }),
|
|
2059
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AvatarFallback, { className: "rounded-lg bg-primary/10 text-primary text-xs font-medium", children: initials })
|
|
2142
2060
|
] }),
|
|
2143
|
-
/* @__PURE__ */ (0,
|
|
2144
|
-
/* @__PURE__ */ (0,
|
|
2145
|
-
user?.email && /* @__PURE__ */ (0,
|
|
2061
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
2062
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "truncate font-medium", children: displayName }),
|
|
2063
|
+
user?.email && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "truncate text-xs text-muted-foreground", children: user.email })
|
|
2146
2064
|
] })
|
|
2147
2065
|
] }) }),
|
|
2148
|
-
/* @__PURE__ */ (0,
|
|
2149
|
-
callbacks?.onViewProfile && /* @__PURE__ */ (0,
|
|
2150
|
-
/* @__PURE__ */ (0,
|
|
2151
|
-
/* @__PURE__ */ (0,
|
|
2066
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DropdownMenuSeparator, {}),
|
|
2067
|
+
callbacks?.onViewProfile && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DropdownMenuItem, { onClick: callbacks.onViewProfile, children: [
|
|
2068
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.User, { className: "mr-2 h-4 w-4" }),
|
|
2069
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: labels.profile })
|
|
2152
2070
|
] }),
|
|
2153
|
-
callbacks?.onOpenSettings && /* @__PURE__ */ (0,
|
|
2154
|
-
/* @__PURE__ */ (0,
|
|
2155
|
-
/* @__PURE__ */ (0,
|
|
2071
|
+
callbacks?.onOpenSettings && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DropdownMenuItem, { onClick: callbacks.onOpenSettings, children: [
|
|
2072
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.Settings, { className: "mr-2 h-4 w-4" }),
|
|
2073
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: labels.settings })
|
|
2156
2074
|
] }),
|
|
2157
2075
|
additionalItems,
|
|
2158
|
-
showThemeOptions && callbacks?.onThemeChange && /* @__PURE__ */ (0,
|
|
2159
|
-
/* @__PURE__ */ (0,
|
|
2160
|
-
/* @__PURE__ */ (0,
|
|
2076
|
+
showThemeOptions && callbacks?.onThemeChange && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
2077
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DropdownMenuSeparator, {}),
|
|
2078
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2161
2079
|
DropdownMenuItem,
|
|
2162
2080
|
{
|
|
2163
2081
|
onClick: () => callbacks.onThemeChange?.("light"),
|
|
2164
2082
|
className: currentTheme === "light" ? "bg-accent" : "",
|
|
2165
2083
|
children: [
|
|
2166
|
-
/* @__PURE__ */ (0,
|
|
2167
|
-
/* @__PURE__ */ (0,
|
|
2084
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.Sun, { className: "mr-2 h-4 w-4" }),
|
|
2085
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: labels.lightMode })
|
|
2168
2086
|
]
|
|
2169
2087
|
}
|
|
2170
2088
|
),
|
|
2171
|
-
/* @__PURE__ */ (0,
|
|
2089
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2172
2090
|
DropdownMenuItem,
|
|
2173
2091
|
{
|
|
2174
2092
|
onClick: () => callbacks.onThemeChange?.("dark"),
|
|
2175
2093
|
className: currentTheme === "dark" ? "bg-accent" : "",
|
|
2176
2094
|
children: [
|
|
2177
|
-
/* @__PURE__ */ (0,
|
|
2178
|
-
/* @__PURE__ */ (0,
|
|
2095
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.Moon, { className: "mr-2 h-4 w-4" }),
|
|
2096
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: labels.darkMode })
|
|
2179
2097
|
]
|
|
2180
2098
|
}
|
|
2181
2099
|
),
|
|
2182
|
-
/* @__PURE__ */ (0,
|
|
2100
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2183
2101
|
DropdownMenuItem,
|
|
2184
2102
|
{
|
|
2185
2103
|
onClick: () => callbacks.onThemeChange?.("system"),
|
|
2186
2104
|
className: currentTheme === "system" ? "bg-accent" : "",
|
|
2187
2105
|
children: [
|
|
2188
|
-
/* @__PURE__ */ (0,
|
|
2189
|
-
/* @__PURE__ */ (0,
|
|
2106
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.Palette, { className: "mr-2 h-4 w-4" }),
|
|
2107
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: labels.systemTheme })
|
|
2190
2108
|
]
|
|
2191
2109
|
}
|
|
2192
2110
|
)
|
|
2193
2111
|
] }),
|
|
2194
|
-
callbacks?.onLogout && /* @__PURE__ */ (0,
|
|
2195
|
-
/* @__PURE__ */ (0,
|
|
2196
|
-
/* @__PURE__ */ (0,
|
|
2112
|
+
callbacks?.onLogout && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
2113
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DropdownMenuSeparator, {}),
|
|
2114
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2197
2115
|
DropdownMenuItem,
|
|
2198
2116
|
{
|
|
2199
2117
|
onClick: callbacks.onLogout,
|
|
2200
2118
|
className: "text-destructive focus:text-destructive focus:bg-destructive/10",
|
|
2201
2119
|
children: [
|
|
2202
|
-
/* @__PURE__ */ (0,
|
|
2203
|
-
/* @__PURE__ */ (0,
|
|
2120
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.LogOut, { className: "mr-2 h-4 w-4" }),
|
|
2121
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: labels.logout })
|
|
2204
2122
|
]
|
|
2205
2123
|
}
|
|
2206
2124
|
)
|
|
@@ -2212,7 +2130,7 @@ var UserMenu = ({
|
|
|
2212
2130
|
};
|
|
2213
2131
|
|
|
2214
2132
|
// src/components/chat/Sidebar.tsx
|
|
2215
|
-
var
|
|
2133
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2216
2134
|
var CreateThreadDialog = ({ config, onCreateThread, trigger }) => {
|
|
2217
2135
|
const [title, setTitle] = (0, import_react2.useState)("");
|
|
2218
2136
|
const [isOpen, setIsOpen] = (0, import_react2.useState)(false);
|
|
@@ -2221,17 +2139,17 @@ var CreateThreadDialog = ({ config, onCreateThread, trigger }) => {
|
|
|
2221
2139
|
setTitle("");
|
|
2222
2140
|
setIsOpen(false);
|
|
2223
2141
|
};
|
|
2224
|
-
return /* @__PURE__ */ (0,
|
|
2225
|
-
/* @__PURE__ */ (0,
|
|
2226
|
-
/* @__PURE__ */ (0,
|
|
2142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
2143
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogTrigger, { asChild: true, children: trigger || /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Button, { className: "w-full justify-start", variant: "outline", children: [
|
|
2144
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Plus, { className: "mr-2 h-4 w-4" }),
|
|
2227
2145
|
config.labels?.newChat || "New Chat"
|
|
2228
2146
|
] }) }),
|
|
2229
|
-
/* @__PURE__ */ (0,
|
|
2230
|
-
/* @__PURE__ */ (0,
|
|
2231
|
-
/* @__PURE__ */ (0,
|
|
2232
|
-
/* @__PURE__ */ (0,
|
|
2147
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DialogContent, { children: [
|
|
2148
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DialogHeader, { children: [
|
|
2149
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogTitle, { children: config.labels?.createNewThread || "New Conversation" }),
|
|
2150
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogDescription, { children: "Give your new conversation a name or leave blank to auto-generate one." })
|
|
2233
2151
|
] }),
|
|
2234
|
-
/* @__PURE__ */ (0,
|
|
2152
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2235
2153
|
Input,
|
|
2236
2154
|
{
|
|
2237
2155
|
value: title,
|
|
@@ -2241,16 +2159,16 @@ var CreateThreadDialog = ({ config, onCreateThread, trigger }) => {
|
|
|
2241
2159
|
autoFocus: true
|
|
2242
2160
|
}
|
|
2243
2161
|
),
|
|
2244
|
-
/* @__PURE__ */ (0,
|
|
2245
|
-
/* @__PURE__ */ (0,
|
|
2246
|
-
/* @__PURE__ */ (0,
|
|
2162
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DialogFooter, { children: [
|
|
2163
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { variant: "outline", onClick: () => setIsOpen(false), children: config.labels?.cancel || "Cancel" }),
|
|
2164
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { onClick: handleCreate, children: config.labels?.create || "Create" })
|
|
2247
2165
|
] })
|
|
2248
2166
|
] })
|
|
2249
2167
|
] });
|
|
2250
2168
|
};
|
|
2251
2169
|
var ThreadInitialsIcon = ({ title }) => {
|
|
2252
2170
|
const initials = title?.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase() || "?";
|
|
2253
|
-
return /* @__PURE__ */ (0,
|
|
2171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex shrink-0 items-center justify-center rounded bg-muted text-[10px] font-medium", children: initials });
|
|
2254
2172
|
};
|
|
2255
2173
|
var Sidebar2 = ({
|
|
2256
2174
|
threads,
|
|
@@ -2327,38 +2245,38 @@ var Sidebar2 = ({
|
|
|
2327
2245
|
const cancelEdit = () => {
|
|
2328
2246
|
setEditingThreadId(null);
|
|
2329
2247
|
};
|
|
2330
|
-
return /* @__PURE__ */ (0,
|
|
2331
|
-
/* @__PURE__ */ (0,
|
|
2332
|
-
/* @__PURE__ */ (0,
|
|
2333
|
-
/* @__PURE__ */ (0,
|
|
2334
|
-
/* @__PURE__ */ (0,
|
|
2335
|
-
/* @__PURE__ */ (0,
|
|
2336
|
-
config.branding?.subtitle && /* @__PURE__ */ (0,
|
|
2248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Sidebar, { collapsible: "icon", ...props, children: [
|
|
2249
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SidebarHeader, { children: [
|
|
2250
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-3 px-2 py-3", children: [
|
|
2251
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex items-center justify-center shrink-0", children: config.branding?.logo || /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { className: "h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AvatarFallback, { className: "bg-primary text-primary-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Bot, { className: "h-4 w-4" }) }) }) }),
|
|
2252
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col min-w-0 group-data-[collapsible=icon]:hidden", children: [
|
|
2253
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-semibold truncate", children: config.branding?.title || "Chat" }),
|
|
2254
|
+
config.branding?.subtitle && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs text-muted-foreground truncate", children: config.branding.subtitle })
|
|
2337
2255
|
] })
|
|
2338
2256
|
] }),
|
|
2339
|
-
onCreateThread && /* @__PURE__ */ (0,
|
|
2257
|
+
onCreateThread && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2340
2258
|
CreateThreadDialog,
|
|
2341
2259
|
{
|
|
2342
2260
|
config,
|
|
2343
2261
|
onCreateThread,
|
|
2344
|
-
trigger: /* @__PURE__ */ (0,
|
|
2262
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarMenu, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarMenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2345
2263
|
SidebarMenuButton,
|
|
2346
2264
|
{
|
|
2347
2265
|
size: "lg",
|
|
2348
2266
|
className: "w-full justify-start gap-2 border border-sidebar-border shadow-sm hover:bg-sidebar-accent hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:justify-center",
|
|
2349
2267
|
tooltip: config.labels?.newChat || "New Chat",
|
|
2350
2268
|
children: [
|
|
2351
|
-
/* @__PURE__ */ (0,
|
|
2352
|
-
/* @__PURE__ */ (0,
|
|
2269
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Plus, { className: "size-4" }),
|
|
2270
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "group-data-[collapsible=icon]:hidden", children: config.labels?.newChat || "New Chat" })
|
|
2353
2271
|
]
|
|
2354
2272
|
}
|
|
2355
2273
|
) }) })
|
|
2356
2274
|
}
|
|
2357
2275
|
),
|
|
2358
|
-
/* @__PURE__ */ (0,
|
|
2359
|
-
/* @__PURE__ */ (0,
|
|
2360
|
-
/* @__PURE__ */ (0,
|
|
2361
|
-
/* @__PURE__ */ (0,
|
|
2276
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "px-2 py-1 mt-4", children: [
|
|
2277
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative group-data-[collapsible=icon]:hidden", children: [
|
|
2278
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Search, { className: "pointer-events-none absolute left-2 top-1/2 size-4 -translate-y-1/2 select-none opacity-50" }),
|
|
2279
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2362
2280
|
Input,
|
|
2363
2281
|
{
|
|
2364
2282
|
className: "pl-8 h-8 bg-sidebar-accent/50 border-sidebar-border focus-visible:ring-1 focus-visible:ring-sidebar-ring",
|
|
@@ -2368,7 +2286,7 @@ var Sidebar2 = ({
|
|
|
2368
2286
|
}
|
|
2369
2287
|
)
|
|
2370
2288
|
] }),
|
|
2371
|
-
/* @__PURE__ */ (0,
|
|
2289
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "hidden group-data-[collapsible=icon]:flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2372
2290
|
Button,
|
|
2373
2291
|
{
|
|
2374
2292
|
variant: "ghost",
|
|
@@ -2376,13 +2294,13 @@ var Sidebar2 = ({
|
|
|
2376
2294
|
className: "h-7 w-7",
|
|
2377
2295
|
onClick: () => setOpen(true),
|
|
2378
2296
|
title: config.labels?.search || "Search",
|
|
2379
|
-
children: /* @__PURE__ */ (0,
|
|
2297
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Search, { className: "h-4 w-4" })
|
|
2380
2298
|
}
|
|
2381
2299
|
) })
|
|
2382
2300
|
] })
|
|
2383
2301
|
] }),
|
|
2384
|
-
/* @__PURE__ */ (0,
|
|
2385
|
-
threads.some((t) => t.isArchived) && /* @__PURE__ */ (0,
|
|
2302
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SidebarContent, { children: [
|
|
2303
|
+
threads.some((t) => t.isArchived) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "px-4 py-2 mt-2 group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2386
2304
|
Button,
|
|
2387
2305
|
{
|
|
2388
2306
|
variant: "ghost",
|
|
@@ -2390,18 +2308,18 @@ var Sidebar2 = ({
|
|
|
2390
2308
|
onClick: () => setShowArchived(!showArchived),
|
|
2391
2309
|
className: "h-6 text-xs w-full justify-start text-muted-foreground",
|
|
2392
2310
|
children: [
|
|
2393
|
-
/* @__PURE__ */ (0,
|
|
2311
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Filter, { className: "mr-2 h-3 w-3" }),
|
|
2394
2312
|
showArchived ? config.labels?.hideArchived || "Hide Archived" : config.labels?.showArchived || "Show Archived"
|
|
2395
2313
|
]
|
|
2396
2314
|
}
|
|
2397
2315
|
) }),
|
|
2398
|
-
Object.keys(groupedThreads).length === 0 ? /* @__PURE__ */ (0,
|
|
2399
|
-
/* @__PURE__ */ (0,
|
|
2400
|
-
/* @__PURE__ */ (0,
|
|
2401
|
-
] }) : Object.entries(groupedThreads).map(([group, groupThreads]) => /* @__PURE__ */ (0,
|
|
2402
|
-
/* @__PURE__ */ (0,
|
|
2403
|
-
/* @__PURE__ */ (0,
|
|
2404
|
-
editingThreadId === thread.id ? /* @__PURE__ */ (0,
|
|
2316
|
+
Object.keys(groupedThreads).length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "px-4 py-8 text-center text-muted-foreground group-data-[collapsible=icon]:hidden", children: [
|
|
2317
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "mx-auto h-8 w-8 mb-2 flex items-center justify-center rounded-full bg-muted/50", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Plus, { className: "h-4 w-4 opacity-50" }) }),
|
|
2318
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-xs", children: searchQuery ? config.labels?.noThreadsFound || "No conversations found" : config.labels?.noThreadsYet || "No conversations yet" })
|
|
2319
|
+
] }) : Object.entries(groupedThreads).map(([group, groupThreads]) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SidebarGroup, { className: "mt-2", children: [
|
|
2320
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarGroupLabel, { className: "group-data-[collapsible=icon]:hidden", children: group }),
|
|
2321
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarGroupContent, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarMenu, { children: groupThreads.map((thread) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SidebarMenuItem, { children: [
|
|
2322
|
+
editingThreadId === thread.id ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex items-center gap-1 px-2 py-1", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2405
2323
|
Input,
|
|
2406
2324
|
{
|
|
2407
2325
|
ref: inputRef,
|
|
@@ -2414,42 +2332,42 @@ var Sidebar2 = ({
|
|
|
2414
2332
|
onBlur: saveEdit,
|
|
2415
2333
|
className: "h-7 text-sm"
|
|
2416
2334
|
}
|
|
2417
|
-
) }) : /* @__PURE__ */ (0,
|
|
2335
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2418
2336
|
SidebarMenuButton,
|
|
2419
2337
|
{
|
|
2420
2338
|
isActive: currentThreadId === thread.id,
|
|
2421
2339
|
onClick: () => onSelectThread?.(thread.id),
|
|
2422
2340
|
tooltip: thread.title,
|
|
2423
2341
|
children: [
|
|
2424
|
-
/* @__PURE__ */ (0,
|
|
2425
|
-
/* @__PURE__ */ (0,
|
|
2426
|
-
thread.isArchived && /* @__PURE__ */ (0,
|
|
2342
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ThreadInitialsIcon, { title: thread.title || "?" }),
|
|
2343
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex flex-col items-start gap-0.5 flex-1 min-w-0 group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "truncate w-full", children: thread.title || "New Chat" }) }),
|
|
2344
|
+
thread.isArchived && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Archive, { className: "ml-auto h-3 w-3 opacity-50 group-data-[collapsible=icon]:hidden" })
|
|
2427
2345
|
]
|
|
2428
2346
|
}
|
|
2429
2347
|
),
|
|
2430
|
-
!editingThreadId && /* @__PURE__ */ (0,
|
|
2431
|
-
/* @__PURE__ */ (0,
|
|
2432
|
-
/* @__PURE__ */ (0,
|
|
2433
|
-
/* @__PURE__ */ (0,
|
|
2348
|
+
!editingThreadId && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenu, { children: [
|
|
2349
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SidebarMenuAction, { showOnHover: true, children: [
|
|
2350
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.MoreHorizontal, {}),
|
|
2351
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: "More" })
|
|
2434
2352
|
] }) }),
|
|
2435
|
-
/* @__PURE__ */ (0,
|
|
2436
|
-
/* @__PURE__ */ (0,
|
|
2437
|
-
/* @__PURE__ */ (0,
|
|
2438
|
-
/* @__PURE__ */ (0,
|
|
2353
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuContent, { className: "w-48", side: "right", align: "start", children: [
|
|
2354
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: () => startEditing(thread), children: [
|
|
2355
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Edit2, { className: "mr-2 h-4 w-4" }),
|
|
2356
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: config.labels?.renameThread || "Rename" })
|
|
2439
2357
|
] }),
|
|
2440
|
-
/* @__PURE__ */ (0,
|
|
2441
|
-
/* @__PURE__ */ (0,
|
|
2442
|
-
/* @__PURE__ */ (0,
|
|
2358
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: () => onArchiveThread?.(thread.id), children: [
|
|
2359
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Archive, { className: "mr-2 h-4 w-4" }),
|
|
2360
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: thread.isArchived ? config.labels?.unarchiveThread || "Unarchive" : config.labels?.archiveThread || "Archive" })
|
|
2443
2361
|
] }),
|
|
2444
|
-
/* @__PURE__ */ (0,
|
|
2445
|
-
/* @__PURE__ */ (0,
|
|
2362
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuSeparator, {}),
|
|
2363
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2446
2364
|
DropdownMenuItem,
|
|
2447
2365
|
{
|
|
2448
2366
|
onClick: () => setDeleteThreadId(thread.id),
|
|
2449
2367
|
className: "text-destructive focus:text-destructive",
|
|
2450
2368
|
children: [
|
|
2451
|
-
/* @__PURE__ */ (0,
|
|
2452
|
-
/* @__PURE__ */ (0,
|
|
2369
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Trash2, { className: "mr-2 h-4 w-4" }),
|
|
2370
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: config.labels?.deleteThread || "Delete" })
|
|
2453
2371
|
]
|
|
2454
2372
|
}
|
|
2455
2373
|
)
|
|
@@ -2458,7 +2376,7 @@ var Sidebar2 = ({
|
|
|
2458
2376
|
] }, thread.id)) }) })
|
|
2459
2377
|
] }, group))
|
|
2460
2378
|
] }),
|
|
2461
|
-
/* @__PURE__ */ (0,
|
|
2379
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarFooter, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2462
2380
|
UserMenu,
|
|
2463
2381
|
{
|
|
2464
2382
|
user,
|
|
@@ -2469,15 +2387,15 @@ var Sidebar2 = ({
|
|
|
2469
2387
|
additionalItems: userMenuAdditionalItems
|
|
2470
2388
|
}
|
|
2471
2389
|
) }),
|
|
2472
|
-
/* @__PURE__ */ (0,
|
|
2473
|
-
deleteThreadId && /* @__PURE__ */ (0,
|
|
2474
|
-
/* @__PURE__ */ (0,
|
|
2475
|
-
/* @__PURE__ */ (0,
|
|
2476
|
-
/* @__PURE__ */ (0,
|
|
2390
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarRail, {}),
|
|
2391
|
+
deleteThreadId && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AlertDialog, { open: !!deleteThreadId, onOpenChange: () => setDeleteThreadId(null), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(AlertDialogContent, { children: [
|
|
2392
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(AlertDialogHeader, { children: [
|
|
2393
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AlertDialogTitle, { children: config.labels?.deleteConfirmTitle || "Delete Conversation" }),
|
|
2394
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AlertDialogDescription, { children: config.labels?.deleteConfirmDescription || "Are you sure you want to delete this conversation? This action cannot be undone." })
|
|
2477
2395
|
] }),
|
|
2478
|
-
/* @__PURE__ */ (0,
|
|
2479
|
-
/* @__PURE__ */ (0,
|
|
2480
|
-
/* @__PURE__ */ (0,
|
|
2396
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(AlertDialogFooter, { children: [
|
|
2397
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AlertDialogCancel, { children: config.labels?.cancel || "Cancel" }),
|
|
2398
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2481
2399
|
AlertDialogAction,
|
|
2482
2400
|
{
|
|
2483
2401
|
onClick: () => deleteThreadId && handleDeleteThread(deleteThreadId),
|
|
@@ -2493,7 +2411,7 @@ var Sidebar2 = ({
|
|
|
2493
2411
|
// src/components/chat/ChatHeader.tsx
|
|
2494
2412
|
var import_react3 = __toESM(require("react"), 1);
|
|
2495
2413
|
var import_lucide_react8 = require("lucide-react");
|
|
2496
|
-
var
|
|
2414
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2497
2415
|
var ChatHeader = ({
|
|
2498
2416
|
config,
|
|
2499
2417
|
currentThreadTitle,
|
|
@@ -2561,52 +2479,52 @@ var ChatHeader = ({
|
|
|
2561
2479
|
};
|
|
2562
2480
|
const selectedAgent = agentOptions.find((agent) => agent.id === selectedAgentId) || null;
|
|
2563
2481
|
const agentPlaceholder = config.agentSelector?.label || "Select agent";
|
|
2564
|
-
return /* @__PURE__ */ (0,
|
|
2482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2565
2483
|
Card,
|
|
2566
2484
|
{
|
|
2567
2485
|
"data-chat-header": true,
|
|
2568
2486
|
className: `py-0 border-b rounded-none relative z-10 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80 ${className}`,
|
|
2569
2487
|
style: isMobile ? { paddingTop: "env(safe-area-inset-top)" } : void 0,
|
|
2570
|
-
children: /* @__PURE__ */ (0,
|
|
2571
|
-
/* @__PURE__ */ (0,
|
|
2572
|
-
/* @__PURE__ */ (0,
|
|
2573
|
-
/* @__PURE__ */ (0,
|
|
2574
|
-
/* @__PURE__ */ (0,
|
|
2488
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CardHeader, { className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2489
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
2490
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
|
|
2491
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SidebarTrigger, { className: "-ml-1" }) }),
|
|
2492
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipContent, { children: config.labels?.sidebarToggle || "Toggle Sidebar" })
|
|
2575
2493
|
] }),
|
|
2576
|
-
showAgentSelector && /* @__PURE__ */ (0,
|
|
2577
|
-
/* @__PURE__ */ (0,
|
|
2494
|
+
showAgentSelector && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenu, { children: [
|
|
2495
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2578
2496
|
Button,
|
|
2579
2497
|
{
|
|
2580
2498
|
variant: "ghost",
|
|
2581
2499
|
className: "h-9 px-3 gap-1.5 font-medium text-base hover:bg-accent/50",
|
|
2582
2500
|
children: [
|
|
2583
|
-
selectedAgent?.avatarUrl ? /* @__PURE__ */ (0,
|
|
2584
|
-
/* @__PURE__ */ (0,
|
|
2585
|
-
/* @__PURE__ */ (0,
|
|
2501
|
+
selectedAgent?.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Avatar, { className: "h-5 w-5", children: [
|
|
2502
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AvatarImage, { src: selectedAgent.avatarUrl, alt: selectedAgent.name }),
|
|
2503
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AvatarFallback, { className: "text-[10px]", children: selectedAgent.name.charAt(0).toUpperCase() })
|
|
2586
2504
|
] }) : null,
|
|
2587
|
-
/* @__PURE__ */ (0,
|
|
2588
|
-
/* @__PURE__ */ (0,
|
|
2505
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "max-w-[200px] truncate", children: selectedAgent?.name || agentPlaceholder }),
|
|
2506
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.ChevronDown, { className: "h-4 w-4 opacity-50" })
|
|
2589
2507
|
]
|
|
2590
2508
|
}
|
|
2591
2509
|
) }),
|
|
2592
|
-
/* @__PURE__ */ (0,
|
|
2510
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuContent, { align: "start", className: "w-[280px]", children: agentOptions.map((agent) => {
|
|
2593
2511
|
const isSelected = agent.id === selectedAgentId;
|
|
2594
|
-
return /* @__PURE__ */ (0,
|
|
2512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2595
2513
|
DropdownMenuItem,
|
|
2596
2514
|
{
|
|
2597
2515
|
onClick: () => onSelectAgent?.(agent.id),
|
|
2598
2516
|
className: "flex items-start gap-3 p-3 cursor-pointer",
|
|
2599
2517
|
children: [
|
|
2600
|
-
agent.avatarUrl ? /* @__PURE__ */ (0,
|
|
2601
|
-
/* @__PURE__ */ (0,
|
|
2602
|
-
/* @__PURE__ */ (0,
|
|
2603
|
-
] }) : /* @__PURE__ */ (0,
|
|
2604
|
-
/* @__PURE__ */ (0,
|
|
2605
|
-
/* @__PURE__ */ (0,
|
|
2606
|
-
/* @__PURE__ */ (0,
|
|
2607
|
-
isSelected && /* @__PURE__ */ (0,
|
|
2518
|
+
agent.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Avatar, { className: "h-6 w-6 mt-0.5 shrink-0", children: [
|
|
2519
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AvatarImage, { src: agent.avatarUrl, alt: agent.name }),
|
|
2520
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AvatarFallback, { className: "text-[10px]", children: agent.name.charAt(0).toUpperCase() })
|
|
2521
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "h-6 w-6 mt-0.5 shrink-0 flex items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Bot, { className: "h-3.5 w-3.5 text-primary" }) }),
|
|
2522
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
2523
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2524
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "font-medium text-sm", children: agent.name }),
|
|
2525
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Check, { className: "h-4 w-4 text-primary shrink-0" })
|
|
2608
2526
|
] }),
|
|
2609
|
-
agent.description && /* @__PURE__ */ (0,
|
|
2527
|
+
agent.description && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-xs text-muted-foreground mt-0.5 line-clamp-2", children: agent.description })
|
|
2610
2528
|
] })
|
|
2611
2529
|
]
|
|
2612
2530
|
},
|
|
@@ -2614,59 +2532,59 @@ var ChatHeader = ({
|
|
|
2614
2532
|
);
|
|
2615
2533
|
}) })
|
|
2616
2534
|
] }),
|
|
2617
|
-
!showAgentSelector && isMobile && /* @__PURE__ */ (0,
|
|
2535
|
+
!showAgentSelector && isMobile && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm font-medium truncate max-w-[150px] ml-2", children: currentThreadTitle || config.branding?.title || "Chat" })
|
|
2618
2536
|
] }),
|
|
2619
|
-
/* @__PURE__ */ (0,
|
|
2620
|
-
/* @__PURE__ */ (0,
|
|
2621
|
-
showCustomComponentButton && config.customComponent && /* @__PURE__ */ (0,
|
|
2622
|
-
/* @__PURE__ */ (0,
|
|
2537
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex-1" }),
|
|
2538
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
2539
|
+
showCustomComponentButton && config.customComponent && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2623
2541
|
Button,
|
|
2624
2542
|
{
|
|
2625
2543
|
variant: "ghost",
|
|
2626
2544
|
size: "icon",
|
|
2627
2545
|
className: "h-8 w-8",
|
|
2628
2546
|
onClick: onCustomComponentToggle,
|
|
2629
|
-
children: config.customComponent.icon || /* @__PURE__ */ (0,
|
|
2547
|
+
children: config.customComponent.icon || /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Menu, { className: "h-4 w-4" })
|
|
2630
2548
|
}
|
|
2631
2549
|
) }),
|
|
2632
|
-
/* @__PURE__ */ (0,
|
|
2550
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipContent, { children: config.customComponent.label || config.labels?.customComponentToggle || "Toggle" })
|
|
2633
2551
|
] }),
|
|
2634
2552
|
config.headerActions,
|
|
2635
|
-
/* @__PURE__ */ (0,
|
|
2636
|
-
/* @__PURE__ */ (0,
|
|
2637
|
-
/* @__PURE__ */ (0,
|
|
2638
|
-
onNewThread && /* @__PURE__ */ (0,
|
|
2639
|
-
/* @__PURE__ */ (0,
|
|
2640
|
-
/* @__PURE__ */ (0,
|
|
2553
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenu, { children: [
|
|
2554
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.MoreVertical, { className: "h-4 w-4" }) }) }),
|
|
2555
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuContent, { align: "end", children: [
|
|
2556
|
+
onNewThread && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
2557
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuItem, { onClick: () => onNewThread?.(), className: "font-medium text-primary", children: [
|
|
2558
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Plus, { className: "h-4 w-4 mr-2" }),
|
|
2641
2559
|
config.labels?.newThread || "New Thread"
|
|
2642
2560
|
] }),
|
|
2643
|
-
/* @__PURE__ */ (0,
|
|
2561
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuSeparator, {})
|
|
2644
2562
|
] }),
|
|
2645
|
-
onExportData && /* @__PURE__ */ (0,
|
|
2646
|
-
/* @__PURE__ */ (0,
|
|
2563
|
+
onExportData && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuItem, { onClick: onExportData, children: [
|
|
2564
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Download, { className: "h-4 w-4 mr-2" }),
|
|
2647
2565
|
config.labels?.exportData || "Export Data"
|
|
2648
2566
|
] }),
|
|
2649
|
-
onImportData && /* @__PURE__ */ (0,
|
|
2650
|
-
/* @__PURE__ */ (0,
|
|
2567
|
+
onImportData && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuItem, { onClick: handleImportClick, children: [
|
|
2568
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Upload, { className: "h-4 w-4 mr-2" }),
|
|
2651
2569
|
config.labels?.importData || "Import Data"
|
|
2652
2570
|
] }),
|
|
2653
|
-
(onExportData || onImportData) && /* @__PURE__ */ (0,
|
|
2654
|
-
/* @__PURE__ */ (0,
|
|
2655
|
-
/* @__PURE__ */ (0,
|
|
2571
|
+
(onExportData || onImportData) && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuSeparator, {}),
|
|
2572
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuItem, { onClick: toggleDarkMode, children: isDarkMode ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
2573
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Sun, { className: "h-4 w-4 mr-2" }),
|
|
2656
2574
|
config.labels?.lightMode || "Light Mode"
|
|
2657
|
-
] }) : /* @__PURE__ */ (0,
|
|
2658
|
-
/* @__PURE__ */ (0,
|
|
2575
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
2576
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Moon, { className: "h-4 w-4 mr-2" }),
|
|
2659
2577
|
config.labels?.darkMode || "Dark Mode"
|
|
2660
2578
|
] }) }),
|
|
2661
|
-
onClearAll && /* @__PURE__ */ (0,
|
|
2662
|
-
/* @__PURE__ */ (0,
|
|
2663
|
-
/* @__PURE__ */ (0,
|
|
2579
|
+
onClearAll && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
2580
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuSeparator, {}),
|
|
2581
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2664
2582
|
DropdownMenuItem,
|
|
2665
2583
|
{
|
|
2666
2584
|
onClick: onClearAll,
|
|
2667
2585
|
className: "text-destructive",
|
|
2668
2586
|
children: [
|
|
2669
|
-
/* @__PURE__ */ (0,
|
|
2587
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Trash2, { className: "h-4 w-4 mr-2" }),
|
|
2670
2588
|
config.labels?.clearAll || "Clear All"
|
|
2671
2589
|
]
|
|
2672
2590
|
}
|
|
@@ -2685,7 +2603,7 @@ var import_react5 = require("react");
|
|
|
2685
2603
|
|
|
2686
2604
|
// src/components/chat/UserContext.tsx
|
|
2687
2605
|
var import_react4 = require("react");
|
|
2688
|
-
var
|
|
2606
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2689
2607
|
var Ctx = (0, import_react4.createContext)(void 0);
|
|
2690
2608
|
var ChatUserContextProvider = ({ children, initial }) => {
|
|
2691
2609
|
const [ctx, setCtx] = (0, import_react4.useState)(() => ({
|
|
@@ -2711,7 +2629,7 @@ var ChatUserContextProvider = ({ children, initial }) => {
|
|
|
2711
2629
|
setContext: setPartial,
|
|
2712
2630
|
resetContext: () => setCtx({ updatedAt: Date.now() })
|
|
2713
2631
|
}), [ctx, setPartial]);
|
|
2714
|
-
return /* @__PURE__ */ (0,
|
|
2632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Ctx.Provider, { value, children });
|
|
2715
2633
|
};
|
|
2716
2634
|
function useChatUserContext() {
|
|
2717
2635
|
const v = (0, import_react4.useContext)(Ctx);
|
|
@@ -2721,13 +2639,13 @@ function useChatUserContext() {
|
|
|
2721
2639
|
|
|
2722
2640
|
// src/components/ui/progress.tsx
|
|
2723
2641
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"), 1);
|
|
2724
|
-
var
|
|
2642
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2725
2643
|
function Progress({
|
|
2726
2644
|
className,
|
|
2727
2645
|
value,
|
|
2728
2646
|
...props
|
|
2729
2647
|
}) {
|
|
2730
|
-
return /* @__PURE__ */ (0,
|
|
2648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2731
2649
|
ProgressPrimitive.Root,
|
|
2732
2650
|
{
|
|
2733
2651
|
"data-slot": "progress",
|
|
@@ -2736,7 +2654,7 @@ function Progress({
|
|
|
2736
2654
|
className
|
|
2737
2655
|
),
|
|
2738
2656
|
...props,
|
|
2739
|
-
children: /* @__PURE__ */ (0,
|
|
2657
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2740
2658
|
ProgressPrimitive.Indicator,
|
|
2741
2659
|
{
|
|
2742
2660
|
"data-slot": "progress-indicator",
|
|
@@ -2750,7 +2668,7 @@ function Progress({
|
|
|
2750
2668
|
|
|
2751
2669
|
// src/components/chat/ChatInput.tsx
|
|
2752
2670
|
var import_lucide_react9 = require("lucide-react");
|
|
2753
|
-
var
|
|
2671
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2754
2672
|
var FileUploadItem = (0, import_react5.memo)(function FileUploadItem2({ file, progress, onCancel }) {
|
|
2755
2673
|
const guessTypeFromName = (name) => {
|
|
2756
2674
|
const ext = (name || "").split(".").pop()?.toLowerCase();
|
|
@@ -2779,10 +2697,10 @@ var FileUploadItem = (0, import_react5.memo)(function FileUploadItem2({ file, pr
|
|
|
2779
2697
|
};
|
|
2780
2698
|
const getFileIcon = (type, name) => {
|
|
2781
2699
|
const t = typeof type === "string" && type.length > 0 ? type : guessTypeFromName(name);
|
|
2782
|
-
if (t.startsWith("image/")) return /* @__PURE__ */ (0,
|
|
2783
|
-
if (t.startsWith("video/")) return /* @__PURE__ */ (0,
|
|
2784
|
-
if (t.startsWith("audio/")) return /* @__PURE__ */ (0,
|
|
2785
|
-
return /* @__PURE__ */ (0,
|
|
2700
|
+
if (t.startsWith("image/")) return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Image, { className: "h-4 w-4" });
|
|
2701
|
+
if (t.startsWith("video/")) return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Video, { className: "h-4 w-4" });
|
|
2702
|
+
if (t.startsWith("audio/")) return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Mic, { className: "h-4 w-4" });
|
|
2703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.FileText, { className: "h-4 w-4" });
|
|
2786
2704
|
};
|
|
2787
2705
|
const formatFileSize = (bytes) => {
|
|
2788
2706
|
if (bytes === 0) return "0 Bytes";
|
|
@@ -2791,21 +2709,21 @@ var FileUploadItem = (0, import_react5.memo)(function FileUploadItem2({ file, pr
|
|
|
2791
2709
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
2792
2710
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
|
|
2793
2711
|
};
|
|
2794
|
-
return /* @__PURE__ */ (0,
|
|
2712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Card, { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardContent, { className: "p-3", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
2795
2713
|
getFileIcon(file.type, file.name),
|
|
2796
|
-
/* @__PURE__ */ (0,
|
|
2797
|
-
/* @__PURE__ */ (0,
|
|
2798
|
-
/* @__PURE__ */ (0,
|
|
2799
|
-
/* @__PURE__ */ (0,
|
|
2714
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
2715
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-sm font-medium truncate", children: file.name }),
|
|
2716
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xs text-muted-foreground", children: formatFileSize(file.size ?? 0) }),
|
|
2717
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Progress, { value: progress, className: "h-1 mt-1" })
|
|
2800
2718
|
] }),
|
|
2801
|
-
/* @__PURE__ */ (0,
|
|
2719
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2802
2720
|
Button,
|
|
2803
2721
|
{
|
|
2804
2722
|
variant: "ghost",
|
|
2805
2723
|
size: "icon",
|
|
2806
2724
|
className: "h-6 w-6",
|
|
2807
2725
|
onClick: onCancel,
|
|
2808
|
-
children: /* @__PURE__ */ (0,
|
|
2726
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
|
|
2809
2727
|
}
|
|
2810
2728
|
)
|
|
2811
2729
|
] }) }) });
|
|
@@ -2829,9 +2747,9 @@ var AttachmentPreview = (0, import_react5.memo)(function AttachmentPreview2({ at
|
|
|
2829
2747
|
const minutes = Math.floor(seconds / 60);
|
|
2830
2748
|
return `${minutes}:${(seconds % 60).toString().padStart(2, "0")}`;
|
|
2831
2749
|
};
|
|
2832
|
-
return /* @__PURE__ */ (0,
|
|
2833
|
-
attachment.kind === "image" && /* @__PURE__ */ (0,
|
|
2834
|
-
/* @__PURE__ */ (0,
|
|
2750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Card, { className: "relative group", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(CardContent, { className: "p-2", children: [
|
|
2751
|
+
attachment.kind === "image" && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "relative", children: [
|
|
2752
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2835
2753
|
"img",
|
|
2836
2754
|
{
|
|
2837
2755
|
src: attachment.dataUrl,
|
|
@@ -2839,19 +2757,19 @@ var AttachmentPreview = (0, import_react5.memo)(function AttachmentPreview2({ at
|
|
|
2839
2757
|
className: "w-full h-20 object-cover rounded"
|
|
2840
2758
|
}
|
|
2841
2759
|
),
|
|
2842
|
-
/* @__PURE__ */ (0,
|
|
2760
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity rounded flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2843
2761
|
Button,
|
|
2844
2762
|
{
|
|
2845
2763
|
variant: "destructive",
|
|
2846
2764
|
size: "icon",
|
|
2847
2765
|
className: "h-6 w-6",
|
|
2848
2766
|
onClick: onRemove,
|
|
2849
|
-
children: /* @__PURE__ */ (0,
|
|
2767
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
|
|
2850
2768
|
}
|
|
2851
2769
|
) })
|
|
2852
2770
|
] }),
|
|
2853
|
-
attachment.kind === "video" && /* @__PURE__ */ (0,
|
|
2854
|
-
/* @__PURE__ */ (0,
|
|
2771
|
+
attachment.kind === "video" && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "relative", children: [
|
|
2772
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2855
2773
|
"video",
|
|
2856
2774
|
{
|
|
2857
2775
|
src: attachment.dataUrl,
|
|
@@ -2860,34 +2778,34 @@ var AttachmentPreview = (0, import_react5.memo)(function AttachmentPreview2({ at
|
|
|
2860
2778
|
muted: true
|
|
2861
2779
|
}
|
|
2862
2780
|
),
|
|
2863
|
-
/* @__PURE__ */ (0,
|
|
2781
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity rounded flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2864
2782
|
Button,
|
|
2865
2783
|
{
|
|
2866
2784
|
variant: "destructive",
|
|
2867
2785
|
size: "icon",
|
|
2868
2786
|
className: "h-6 w-6",
|
|
2869
2787
|
onClick: onRemove,
|
|
2870
|
-
children: /* @__PURE__ */ (0,
|
|
2788
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
|
|
2871
2789
|
}
|
|
2872
2790
|
) }),
|
|
2873
|
-
/* @__PURE__ */ (0,
|
|
2791
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Badge, { className: "absolute bottom-1 right-1 text-xs", children: formatDuration(attachment.durationMs) })
|
|
2874
2792
|
] }),
|
|
2875
|
-
attachment.kind === "audio" && /* @__PURE__ */ (0,
|
|
2876
|
-
/* @__PURE__ */ (0,
|
|
2793
|
+
attachment.kind === "audio" && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2 p-2", children: [
|
|
2794
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2877
2795
|
Button,
|
|
2878
2796
|
{
|
|
2879
2797
|
variant: "outline",
|
|
2880
2798
|
size: "icon",
|
|
2881
2799
|
className: "h-8 w-8",
|
|
2882
2800
|
onClick: handlePlayPause,
|
|
2883
|
-
children: isPlaying ? /* @__PURE__ */ (0,
|
|
2801
|
+
children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Pause, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Play, { className: "h-3 w-3" })
|
|
2884
2802
|
}
|
|
2885
2803
|
),
|
|
2886
|
-
/* @__PURE__ */ (0,
|
|
2887
|
-
/* @__PURE__ */ (0,
|
|
2888
|
-
/* @__PURE__ */ (0,
|
|
2804
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex-1", children: [
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xs font-medium", children: attachment.fileName || "\xC1udio" }),
|
|
2806
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xs text-muted-foreground", children: formatDuration(attachment.durationMs) })
|
|
2889
2807
|
] }),
|
|
2890
|
-
/* @__PURE__ */ (0,
|
|
2808
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2891
2809
|
"audio",
|
|
2892
2810
|
{
|
|
2893
2811
|
ref: audioRef,
|
|
@@ -2897,18 +2815,18 @@ var AttachmentPreview = (0, import_react5.memo)(function AttachmentPreview2({ at
|
|
|
2897
2815
|
onEnded: () => setIsPlaying(false)
|
|
2898
2816
|
}
|
|
2899
2817
|
),
|
|
2900
|
-
/* @__PURE__ */ (0,
|
|
2818
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2901
2819
|
Button,
|
|
2902
2820
|
{
|
|
2903
2821
|
variant: "ghost",
|
|
2904
2822
|
size: "icon",
|
|
2905
2823
|
className: "h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
2906
2824
|
onClick: onRemove,
|
|
2907
|
-
children: /* @__PURE__ */ (0,
|
|
2825
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
|
|
2908
2826
|
}
|
|
2909
2827
|
)
|
|
2910
2828
|
] }),
|
|
2911
|
-
attachment.fileName && attachment.kind !== "audio" && /* @__PURE__ */ (0,
|
|
2829
|
+
attachment.fileName && attachment.kind !== "audio" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs p-1 rounded-b", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "truncate", children: attachment.fileName }) })
|
|
2912
2830
|
] }) });
|
|
2913
2831
|
});
|
|
2914
2832
|
var AudioRecorder = (0, import_react5.memo)(function AudioRecorder2({ isRecording, onStartRecording, onStopRecording, onCancel, recordingDuration, config }) {
|
|
@@ -2918,47 +2836,47 @@ var AudioRecorder = (0, import_react5.memo)(function AudioRecorder2({ isRecordin
|
|
|
2918
2836
|
return `${mins}:${secs.toString().padStart(2, "0")}`;
|
|
2919
2837
|
};
|
|
2920
2838
|
if (!isRecording) {
|
|
2921
|
-
return /* @__PURE__ */ (0,
|
|
2922
|
-
/* @__PURE__ */ (0,
|
|
2839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
2840
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2923
2841
|
Button,
|
|
2924
2842
|
{
|
|
2925
2843
|
variant: "outline",
|
|
2926
2844
|
size: "icon",
|
|
2927
2845
|
onClick: onStartRecording,
|
|
2928
2846
|
className: "h-10 w-10",
|
|
2929
|
-
children: /* @__PURE__ */ (0,
|
|
2847
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Mic, { className: "h-4 w-4" })
|
|
2930
2848
|
}
|
|
2931
2849
|
) }),
|
|
2932
|
-
/* @__PURE__ */ (0,
|
|
2850
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { children: config?.labels?.recordAudioTooltip })
|
|
2933
2851
|
] });
|
|
2934
2852
|
}
|
|
2935
|
-
return /* @__PURE__ */ (0,
|
|
2936
|
-
/* @__PURE__ */ (0,
|
|
2937
|
-
/* @__PURE__ */ (0,
|
|
2938
|
-
/* @__PURE__ */ (0,
|
|
2853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Card, { className: "border-red-200 bg-red-50 dark:border-red-800 dark:bg-red-950", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardContent, { className: "p-3", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
2854
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2855
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "h-3 w-3 bg-red-500 rounded-full animate-pulse" }),
|
|
2856
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-sm font-medium text-red-700 dark:text-red-300", children: "Gravando" })
|
|
2939
2857
|
] }),
|
|
2940
|
-
/* @__PURE__ */ (0,
|
|
2941
|
-
/* @__PURE__ */ (0,
|
|
2942
|
-
/* @__PURE__ */ (0,
|
|
2858
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Badge, { variant: "outline", className: "text-xs", children: formatTime(recordingDuration) }),
|
|
2859
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex gap-1 ml-auto", children: [
|
|
2860
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2943
2861
|
Button,
|
|
2944
2862
|
{
|
|
2945
2863
|
variant: "outline",
|
|
2946
2864
|
size: "sm",
|
|
2947
2865
|
onClick: onCancel,
|
|
2948
2866
|
children: [
|
|
2949
|
-
/* @__PURE__ */ (0,
|
|
2867
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.X, { className: "h-3 w-3 mr-1" }),
|
|
2950
2868
|
"Cancelar"
|
|
2951
2869
|
]
|
|
2952
2870
|
}
|
|
2953
2871
|
),
|
|
2954
|
-
/* @__PURE__ */ (0,
|
|
2872
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2955
2873
|
Button,
|
|
2956
2874
|
{
|
|
2957
2875
|
variant: "default",
|
|
2958
2876
|
size: "sm",
|
|
2959
2877
|
onClick: onStopRecording,
|
|
2960
2878
|
children: [
|
|
2961
|
-
/* @__PURE__ */ (0,
|
|
2879
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Square, { className: "h-3 w-3 mr-1" }),
|
|
2962
2880
|
"Parar"
|
|
2963
2881
|
]
|
|
2964
2882
|
}
|
|
@@ -3184,8 +3102,8 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3184
3102
|
onAttachmentsChange(newAttachments);
|
|
3185
3103
|
};
|
|
3186
3104
|
const canAddMoreAttachments = attachments.length < maxAttachments;
|
|
3187
|
-
return /* @__PURE__ */ (0,
|
|
3188
|
-
uploadProgress.size > 0 && /* @__PURE__ */ (0,
|
|
3105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: `border-t py-0 bg-transparent ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "px-0 md:p-2 pb-1 space-y-4 bg-transparent", children: [
|
|
3106
|
+
uploadProgress.size > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "space-y-2", children: Array.from(uploadProgress.entries()).map(([id, progress]) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3189
3107
|
FileUploadItem,
|
|
3190
3108
|
{
|
|
3191
3109
|
file: { name: progress.fileName },
|
|
@@ -3200,7 +3118,7 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3200
3118
|
},
|
|
3201
3119
|
id
|
|
3202
3120
|
)) }),
|
|
3203
|
-
isRecording && /* @__PURE__ */ (0,
|
|
3121
|
+
isRecording && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3204
3122
|
AudioRecorder,
|
|
3205
3123
|
{
|
|
3206
3124
|
isRecording,
|
|
@@ -3211,7 +3129,7 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3211
3129
|
config
|
|
3212
3130
|
}
|
|
3213
3131
|
),
|
|
3214
|
-
attachments.length > 0 && /* @__PURE__ */ (0,
|
|
3132
|
+
attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "grid grid-cols-4 gap-2", children: attachments.map((attachment, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3215
3133
|
AttachmentPreview,
|
|
3216
3134
|
{
|
|
3217
3135
|
attachment,
|
|
@@ -3219,15 +3137,15 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3219
3137
|
},
|
|
3220
3138
|
index
|
|
3221
3139
|
)) }),
|
|
3222
|
-
/* @__PURE__ */ (0,
|
|
3140
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("form", { onSubmit: handleSubmit, className: "mb-1 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3223
3141
|
"div",
|
|
3224
3142
|
{
|
|
3225
3143
|
className: "flex items-end gap-2 p-3 border rounded-lg bg-background w-full md:min-w-3xl max-w-3xl",
|
|
3226
3144
|
onDrop: handleDrop,
|
|
3227
3145
|
onDragOver: handleDragOver,
|
|
3228
3146
|
children: [
|
|
3229
|
-
enableFileUpload && canAddMoreAttachments && /* @__PURE__ */ (0,
|
|
3230
|
-
/* @__PURE__ */ (0,
|
|
3147
|
+
enableFileUpload && canAddMoreAttachments && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
3148
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3231
3149
|
"input",
|
|
3232
3150
|
{
|
|
3233
3151
|
ref: fileInputRef,
|
|
@@ -3238,8 +3156,8 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3238
3156
|
className: "hidden"
|
|
3239
3157
|
}
|
|
3240
3158
|
),
|
|
3241
|
-
/* @__PURE__ */ (0,
|
|
3242
|
-
/* @__PURE__ */ (0,
|
|
3159
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
3160
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3243
3161
|
Button,
|
|
3244
3162
|
{
|
|
3245
3163
|
type: "button",
|
|
@@ -3252,13 +3170,13 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3252
3170
|
fileInputRef.current?.click();
|
|
3253
3171
|
},
|
|
3254
3172
|
disabled,
|
|
3255
|
-
children: /* @__PURE__ */ (0,
|
|
3173
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Paperclip, { className: "h-4 w-4" })
|
|
3256
3174
|
}
|
|
3257
3175
|
) }),
|
|
3258
|
-
/* @__PURE__ */ (0,
|
|
3176
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { children: config?.labels?.attachFileTooltip })
|
|
3259
3177
|
] })
|
|
3260
3178
|
] }),
|
|
3261
|
-
/* @__PURE__ */ (0,
|
|
3179
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3262
3180
|
Textarea,
|
|
3263
3181
|
{
|
|
3264
3182
|
ref: textareaRef,
|
|
@@ -3271,7 +3189,7 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3271
3189
|
rows: 1
|
|
3272
3190
|
}
|
|
3273
3191
|
) }),
|
|
3274
|
-
enableAudioRecording && !isRecording && canAddMoreAttachments && !value.trim() && /* @__PURE__ */ (0,
|
|
3192
|
+
enableAudioRecording && !isRecording && canAddMoreAttachments && !value.trim() && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3275
3193
|
AudioRecorder,
|
|
3276
3194
|
{
|
|
3277
3195
|
isRecording,
|
|
@@ -3282,8 +3200,8 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3282
3200
|
config
|
|
3283
3201
|
}
|
|
3284
3202
|
),
|
|
3285
|
-
isGenerating ? /* @__PURE__ */ (0,
|
|
3286
|
-
/* @__PURE__ */ (0,
|
|
3203
|
+
isGenerating ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
3204
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3287
3205
|
Button,
|
|
3288
3206
|
{
|
|
3289
3207
|
type: "button",
|
|
@@ -3291,36 +3209,36 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3291
3209
|
size: "icon",
|
|
3292
3210
|
className: "h-10 w-10",
|
|
3293
3211
|
onClick: onStopGeneration,
|
|
3294
|
-
children: /* @__PURE__ */ (0,
|
|
3212
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Square, { className: "h-4 w-4" })
|
|
3295
3213
|
}
|
|
3296
3214
|
) }),
|
|
3297
|
-
/* @__PURE__ */ (0,
|
|
3298
|
-
] }) : /* @__PURE__ */ (0,
|
|
3299
|
-
/* @__PURE__ */ (0,
|
|
3215
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { children: config?.labels?.stopGenerationTooltip })
|
|
3216
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
3217
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3300
3218
|
Button,
|
|
3301
3219
|
{
|
|
3302
3220
|
type: "submit",
|
|
3303
3221
|
size: "icon",
|
|
3304
3222
|
className: "h-10 w-10",
|
|
3305
3223
|
disabled: disabled || !value.trim() && attachments.length === 0,
|
|
3306
|
-
children: disabled ? /* @__PURE__ */ (0,
|
|
3224
|
+
children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Send, { className: "h-4 w-4" })
|
|
3307
3225
|
}
|
|
3308
3226
|
) }),
|
|
3309
|
-
/* @__PURE__ */ (0,
|
|
3227
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { children: config?.labels?.sendMessageTooltip })
|
|
3310
3228
|
] })
|
|
3311
3229
|
]
|
|
3312
3230
|
}
|
|
3313
3231
|
) }),
|
|
3314
|
-
/* @__PURE__ */ (0,
|
|
3232
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "text-[10px] text-muted-foreground text-center", children: [
|
|
3315
3233
|
window.innerWidth > 768 ? config?.labels?.inputHelpText : "",
|
|
3316
|
-
attachments.length > 0 && /* @__PURE__ */ (0,
|
|
3234
|
+
attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
3317
3235
|
" \u2022 ",
|
|
3318
3236
|
attachments.length,
|
|
3319
3237
|
"/",
|
|
3320
3238
|
maxAttachments,
|
|
3321
3239
|
" anexos"
|
|
3322
3240
|
] }),
|
|
3323
|
-
config?.labels?.footerLabel && /* @__PURE__ */ (0,
|
|
3241
|
+
config?.labels?.footerLabel && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
3324
3242
|
" \u2022 ",
|
|
3325
3243
|
config.labels.footerLabel
|
|
3326
3244
|
] })
|
|
@@ -3334,16 +3252,16 @@ var import_react6 = require("react");
|
|
|
3334
3252
|
// src/components/ui/scroll-area.tsx
|
|
3335
3253
|
var React11 = __toESM(require("react"), 1);
|
|
3336
3254
|
var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"), 1);
|
|
3337
|
-
var
|
|
3255
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3338
3256
|
var ScrollArea = React11.forwardRef(({ className, children, viewportClassName, onScroll, onScrollCapture, ...props }, ref) => {
|
|
3339
|
-
return /* @__PURE__ */ (0,
|
|
3257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3340
3258
|
ScrollAreaPrimitive.Root,
|
|
3341
3259
|
{
|
|
3342
3260
|
"data-slot": "scroll-area",
|
|
3343
3261
|
className: cn("relative", className),
|
|
3344
3262
|
...props,
|
|
3345
3263
|
children: [
|
|
3346
|
-
/* @__PURE__ */ (0,
|
|
3264
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3347
3265
|
ScrollAreaPrimitive.Viewport,
|
|
3348
3266
|
{
|
|
3349
3267
|
ref,
|
|
@@ -3357,8 +3275,8 @@ var ScrollArea = React11.forwardRef(({ className, children, viewportClassName, o
|
|
|
3357
3275
|
children
|
|
3358
3276
|
}
|
|
3359
3277
|
),
|
|
3360
|
-
/* @__PURE__ */ (0,
|
|
3361
|
-
/* @__PURE__ */ (0,
|
|
3278
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ScrollBar, {}),
|
|
3279
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ScrollAreaPrimitive.Corner, {})
|
|
3362
3280
|
]
|
|
3363
3281
|
}
|
|
3364
3282
|
);
|
|
@@ -3369,7 +3287,7 @@ function ScrollBar({
|
|
|
3369
3287
|
orientation = "vertical",
|
|
3370
3288
|
...props
|
|
3371
3289
|
}) {
|
|
3372
|
-
return /* @__PURE__ */ (0,
|
|
3290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3373
3291
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
3374
3292
|
{
|
|
3375
3293
|
"data-slot": "scroll-area-scrollbar",
|
|
@@ -3381,7 +3299,7 @@ function ScrollBar({
|
|
|
3381
3299
|
className
|
|
3382
3300
|
),
|
|
3383
3301
|
...props,
|
|
3384
|
-
children: /* @__PURE__ */ (0,
|
|
3302
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3385
3303
|
ScrollAreaPrimitive.ScrollAreaThumb,
|
|
3386
3304
|
{
|
|
3387
3305
|
"data-slot": "scroll-area-thumb",
|
|
@@ -3394,7 +3312,7 @@ function ScrollBar({
|
|
|
3394
3312
|
|
|
3395
3313
|
// src/components/chat/UserProfile.tsx
|
|
3396
3314
|
var import_lucide_react10 = require("lucide-react");
|
|
3397
|
-
var
|
|
3315
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3398
3316
|
var getInitials2 = (name, email) => {
|
|
3399
3317
|
if (name) {
|
|
3400
3318
|
return name.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase();
|
|
@@ -3408,29 +3326,29 @@ var getFieldIcon = (type, key) => {
|
|
|
3408
3326
|
const iconClass = "h-4 w-4 text-muted-foreground";
|
|
3409
3327
|
switch (type) {
|
|
3410
3328
|
case "email":
|
|
3411
|
-
return /* @__PURE__ */ (0,
|
|
3329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Mail, { className: iconClass });
|
|
3412
3330
|
case "phone":
|
|
3413
|
-
return /* @__PURE__ */ (0,
|
|
3331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Phone, { className: iconClass });
|
|
3414
3332
|
case "url":
|
|
3415
|
-
return /* @__PURE__ */ (0,
|
|
3333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Globe, { className: iconClass });
|
|
3416
3334
|
case "date":
|
|
3417
|
-
return /* @__PURE__ */ (0,
|
|
3335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Calendar, { className: iconClass });
|
|
3418
3336
|
}
|
|
3419
3337
|
const lowerKey = key?.toLowerCase() || "";
|
|
3420
|
-
if (lowerKey.includes("follower")) return /* @__PURE__ */ (0,
|
|
3421
|
-
if (lowerKey.includes("following")) return /* @__PURE__ */ (0,
|
|
3422
|
-
if (lowerKey.includes("post") || lowerKey.includes("publication")) return /* @__PURE__ */ (0,
|
|
3423
|
-
if (lowerKey.includes("verified") || lowerKey.includes("badge")) return /* @__PURE__ */ (0,
|
|
3424
|
-
if (lowerKey.includes("bio")) return /* @__PURE__ */ (0,
|
|
3425
|
-
if (lowerKey.includes("email")) return /* @__PURE__ */ (0,
|
|
3426
|
-
if (lowerKey.includes("phone") || lowerKey.includes("tel")) return /* @__PURE__ */ (0,
|
|
3427
|
-
if (lowerKey.includes("location") || lowerKey.includes("address") || lowerKey.includes("city")) return /* @__PURE__ */ (0,
|
|
3428
|
-
if (lowerKey.includes("company") || lowerKey.includes("org")) return /* @__PURE__ */ (0,
|
|
3429
|
-
if (lowerKey.includes("job") || lowerKey.includes("role") || lowerKey.includes("title") || lowerKey.includes("position")) return /* @__PURE__ */ (0,
|
|
3430
|
-
if (lowerKey.includes("website") || lowerKey.includes("url") || lowerKey.includes("link")) return /* @__PURE__ */ (0,
|
|
3431
|
-
if (lowerKey.includes("username") || lowerKey.includes("handle")) return /* @__PURE__ */ (0,
|
|
3432
|
-
if (lowerKey.includes("date") || lowerKey.includes("birthday") || lowerKey.includes("joined")) return /* @__PURE__ */ (0,
|
|
3433
|
-
return /* @__PURE__ */ (0,
|
|
3338
|
+
if (lowerKey.includes("follower")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Users, { className: iconClass });
|
|
3339
|
+
if (lowerKey.includes("following")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.UserPlus, { className: iconClass });
|
|
3340
|
+
if (lowerKey.includes("post") || lowerKey.includes("publication")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Image, { className: iconClass });
|
|
3341
|
+
if (lowerKey.includes("verified") || lowerKey.includes("badge")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.BadgeCheck, { className: iconClass });
|
|
3342
|
+
if (lowerKey.includes("bio")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.FileText, { className: iconClass });
|
|
3343
|
+
if (lowerKey.includes("email")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Mail, { className: iconClass });
|
|
3344
|
+
if (lowerKey.includes("phone") || lowerKey.includes("tel")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Phone, { className: iconClass });
|
|
3345
|
+
if (lowerKey.includes("location") || lowerKey.includes("address") || lowerKey.includes("city")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.MapPin, { className: iconClass });
|
|
3346
|
+
if (lowerKey.includes("company") || lowerKey.includes("org")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Building, { className: iconClass });
|
|
3347
|
+
if (lowerKey.includes("job") || lowerKey.includes("role") || lowerKey.includes("title") || lowerKey.includes("position")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Briefcase, { className: iconClass });
|
|
3348
|
+
if (lowerKey.includes("website") || lowerKey.includes("url") || lowerKey.includes("link")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Globe, { className: iconClass });
|
|
3349
|
+
if (lowerKey.includes("username") || lowerKey.includes("handle")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.AtSign, { className: iconClass });
|
|
3350
|
+
if (lowerKey.includes("date") || lowerKey.includes("birthday") || lowerKey.includes("joined")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Calendar, { className: iconClass });
|
|
3351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.User, { className: iconClass });
|
|
3434
3352
|
};
|
|
3435
3353
|
var formatValue = (value, type, key) => {
|
|
3436
3354
|
if (value === null || value === void 0) return "-";
|
|
@@ -3464,15 +3382,15 @@ var getMemoryCategoryIcon = (category) => {
|
|
|
3464
3382
|
const iconClass = "h-4 w-4 text-muted-foreground";
|
|
3465
3383
|
switch (category) {
|
|
3466
3384
|
case "preference":
|
|
3467
|
-
return /* @__PURE__ */ (0,
|
|
3385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Heart, { className: iconClass });
|
|
3468
3386
|
case "fact":
|
|
3469
|
-
return /* @__PURE__ */ (0,
|
|
3387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Info, { className: iconClass });
|
|
3470
3388
|
case "goal":
|
|
3471
|
-
return /* @__PURE__ */ (0,
|
|
3389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Target, { className: iconClass });
|
|
3472
3390
|
case "context":
|
|
3473
|
-
return /* @__PURE__ */ (0,
|
|
3391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Lightbulb, { className: iconClass });
|
|
3474
3392
|
default:
|
|
3475
|
-
return /* @__PURE__ */ (0,
|
|
3393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Brain, { className: iconClass });
|
|
3476
3394
|
}
|
|
3477
3395
|
};
|
|
3478
3396
|
var getMemoryCategoryLabel = (category) => {
|
|
@@ -3542,66 +3460,66 @@ var UserProfile = ({
|
|
|
3542
3460
|
const displayName = user?.name || user?.email?.split("@")[0] || "User";
|
|
3543
3461
|
const initials = getInitials2(user?.name, user?.email);
|
|
3544
3462
|
const normalizedFields = normalizeCustomFields(customFields);
|
|
3545
|
-
return /* @__PURE__ */ (0,
|
|
3463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Sheet, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3546
3464
|
SheetContent,
|
|
3547
3465
|
{
|
|
3548
3466
|
side: "right",
|
|
3549
3467
|
className: cn("w-full sm:max-w-md p-0 flex flex-col h-full overflow-hidden", className),
|
|
3550
3468
|
children: [
|
|
3551
|
-
/* @__PURE__ */ (0,
|
|
3552
|
-
/* @__PURE__ */ (0,
|
|
3553
|
-
/* @__PURE__ */ (0,
|
|
3554
|
-
/* @__PURE__ */ (0,
|
|
3555
|
-
user?.avatar && /* @__PURE__ */ (0,
|
|
3556
|
-
/* @__PURE__ */ (0,
|
|
3469
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SheetHeader, { className: "px-6 py-4 border-b shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SheetTitle, { children: labels.title }) }) }),
|
|
3470
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ScrollArea, { className: "flex-1 min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "p-6 space-y-6", children: [
|
|
3471
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col items-center text-center space-y-4", children: [
|
|
3472
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Avatar, { className: "h-24 w-24 shrink-0", children: [
|
|
3473
|
+
user?.avatar && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AvatarImage, { src: user.avatar, alt: displayName }),
|
|
3474
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AvatarFallback, { className: "text-2xl bg-primary/10 text-primary", children: initials })
|
|
3557
3475
|
] }),
|
|
3558
|
-
/* @__PURE__ */ (0,
|
|
3559
|
-
/* @__PURE__ */ (0,
|
|
3560
|
-
user?.email && /* @__PURE__ */ (0,
|
|
3476
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "w-full px-2", children: [
|
|
3477
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h2", { className: "text-xl font-semibold break-words", children: displayName }),
|
|
3478
|
+
user?.email && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm text-muted-foreground break-words", children: user.email })
|
|
3561
3479
|
] })
|
|
3562
3480
|
] }),
|
|
3563
|
-
/* @__PURE__ */ (0,
|
|
3564
|
-
/* @__PURE__ */ (0,
|
|
3565
|
-
/* @__PURE__ */ (0,
|
|
3566
|
-
/* @__PURE__ */ (0,
|
|
3567
|
-
/* @__PURE__ */ (0,
|
|
3568
|
-
/* @__PURE__ */ (0,
|
|
3569
|
-
/* @__PURE__ */ (0,
|
|
3570
|
-
/* @__PURE__ */ (0,
|
|
3571
|
-
/* @__PURE__ */ (0,
|
|
3481
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Separator, {}),
|
|
3482
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-3", children: [
|
|
3483
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: labels.basicInfo }),
|
|
3484
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-2", children: [
|
|
3485
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
|
|
3486
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.User, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
3487
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3488
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs text-muted-foreground", children: "Name" }),
|
|
3489
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm font-medium break-words", children: displayName })
|
|
3572
3490
|
] })
|
|
3573
3491
|
] }),
|
|
3574
|
-
user?.email && /* @__PURE__ */ (0,
|
|
3575
|
-
/* @__PURE__ */ (0,
|
|
3576
|
-
/* @__PURE__ */ (0,
|
|
3577
|
-
/* @__PURE__ */ (0,
|
|
3578
|
-
/* @__PURE__ */ (0,
|
|
3492
|
+
user?.email && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
|
|
3493
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.AtSign, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
3494
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3495
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs text-muted-foreground", children: "Handle" }),
|
|
3496
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm font-medium break-words", children: user.email })
|
|
3579
3497
|
] })
|
|
3580
3498
|
] }),
|
|
3581
|
-
user?.id && user.id !== user?.name && user.id !== user?.email && /* @__PURE__ */ (0,
|
|
3582
|
-
/* @__PURE__ */ (0,
|
|
3583
|
-
/* @__PURE__ */ (0,
|
|
3584
|
-
/* @__PURE__ */ (0,
|
|
3585
|
-
/* @__PURE__ */ (0,
|
|
3499
|
+
user?.id && user.id !== user?.name && user.id !== user?.email && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
|
|
3500
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.User, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
3501
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3502
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs text-muted-foreground", children: "ID" }),
|
|
3503
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm font-medium break-words", children: user.id })
|
|
3586
3504
|
] })
|
|
3587
3505
|
] })
|
|
3588
3506
|
] })
|
|
3589
3507
|
] }),
|
|
3590
|
-
normalizedFields.length > 0 && /* @__PURE__ */ (0,
|
|
3591
|
-
/* @__PURE__ */ (0,
|
|
3592
|
-
/* @__PURE__ */ (0,
|
|
3593
|
-
/* @__PURE__ */ (0,
|
|
3594
|
-
/* @__PURE__ */ (0,
|
|
3508
|
+
normalizedFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
3509
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Separator, {}),
|
|
3510
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-3", children: [
|
|
3511
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: labels.customFields }),
|
|
3512
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "space-y-2", children: normalizedFields.map((field) => {
|
|
3595
3513
|
const isBioField = field.key.toLowerCase().includes("bio");
|
|
3596
|
-
return /* @__PURE__ */ (0,
|
|
3514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3597
3515
|
"div",
|
|
3598
3516
|
{
|
|
3599
3517
|
className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50",
|
|
3600
3518
|
children: [
|
|
3601
|
-
/* @__PURE__ */ (0,
|
|
3602
|
-
/* @__PURE__ */ (0,
|
|
3603
|
-
/* @__PURE__ */ (0,
|
|
3604
|
-
/* @__PURE__ */ (0,
|
|
3519
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "mt-0.5 shrink-0", children: field.icon || getFieldIcon(field.type, field.key) }),
|
|
3520
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3521
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs text-muted-foreground", children: field.label }),
|
|
3522
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: cn(
|
|
3605
3523
|
"text-sm font-medium",
|
|
3606
3524
|
isBioField ? "whitespace-pre-wrap break-words" : "break-words"
|
|
3607
3525
|
), children: formatValue(field.value, field.type, field.key) })
|
|
@@ -3613,26 +3531,26 @@ var UserProfile = ({
|
|
|
3613
3531
|
}) })
|
|
3614
3532
|
] })
|
|
3615
3533
|
] }),
|
|
3616
|
-
/* @__PURE__ */ (0,
|
|
3617
|
-
/* @__PURE__ */ (0,
|
|
3618
|
-
/* @__PURE__ */ (0,
|
|
3619
|
-
/* @__PURE__ */ (0,
|
|
3620
|
-
/* @__PURE__ */ (0,
|
|
3534
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Separator, {}),
|
|
3535
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-3", children: [
|
|
3536
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
3537
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider flex items-center gap-2", children: [
|
|
3538
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Brain, { className: "h-4 w-4" }),
|
|
3621
3539
|
labels.memories
|
|
3622
3540
|
] }),
|
|
3623
|
-
onAddMemory && /* @__PURE__ */ (0,
|
|
3541
|
+
onAddMemory && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3624
3542
|
Button,
|
|
3625
3543
|
{
|
|
3626
3544
|
variant: "ghost",
|
|
3627
3545
|
size: "sm",
|
|
3628
3546
|
className: "h-7 px-2",
|
|
3629
3547
|
onClick: () => setIsAddingMemory(true),
|
|
3630
|
-
children: /* @__PURE__ */ (0,
|
|
3548
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Plus, { className: "h-4 w-4" })
|
|
3631
3549
|
}
|
|
3632
3550
|
)
|
|
3633
3551
|
] }),
|
|
3634
|
-
isAddingMemory && onAddMemory && /* @__PURE__ */ (0,
|
|
3635
|
-
/* @__PURE__ */ (0,
|
|
3552
|
+
isAddingMemory && onAddMemory && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex gap-2", children: [
|
|
3553
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3636
3554
|
Input,
|
|
3637
3555
|
{
|
|
3638
3556
|
value: newMemoryContent,
|
|
@@ -3649,24 +3567,24 @@ var UserProfile = ({
|
|
|
3649
3567
|
autoFocus: true
|
|
3650
3568
|
}
|
|
3651
3569
|
),
|
|
3652
|
-
/* @__PURE__ */ (0,
|
|
3570
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Button, { size: "sm", onClick: handleAddMemory, disabled: !newMemoryContent.trim(), children: "Salvar" })
|
|
3653
3571
|
] }),
|
|
3654
|
-
/* @__PURE__ */ (0,
|
|
3572
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "space-y-2", children: memories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm text-muted-foreground text-center py-4", children: labels.noMemories }) : memories.map((memory) => {
|
|
3655
3573
|
const isEditing = editingMemoryId === memory.id;
|
|
3656
|
-
return /* @__PURE__ */ (0,
|
|
3574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3657
3575
|
"div",
|
|
3658
3576
|
{
|
|
3659
3577
|
className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50 group",
|
|
3660
3578
|
children: [
|
|
3661
|
-
/* @__PURE__ */ (0,
|
|
3662
|
-
/* @__PURE__ */ (0,
|
|
3663
|
-
/* @__PURE__ */ (0,
|
|
3664
|
-
/* @__PURE__ */ (0,
|
|
3665
|
-
/* @__PURE__ */ (0,
|
|
3666
|
-
/* @__PURE__ */ (0,
|
|
3579
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "mt-0.5 shrink-0", children: memory.source === "agent" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Bot, { className: "h-4 w-4 text-primary" }) : getMemoryCategoryIcon(memory.category) }),
|
|
3580
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3581
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center gap-2 mb-0.5", children: [
|
|
3582
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-xs text-muted-foreground", children: getMemoryCategoryLabel(memory.category) }),
|
|
3583
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-xs text-muted-foreground", children: "\u2022" }),
|
|
3584
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-xs text-muted-foreground", children: memory.source === "agent" ? "IA" : "Voc\xEA" })
|
|
3667
3585
|
] }),
|
|
3668
|
-
isEditing ? /* @__PURE__ */ (0,
|
|
3669
|
-
/* @__PURE__ */ (0,
|
|
3586
|
+
isEditing ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-2", children: [
|
|
3587
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3670
3588
|
Textarea,
|
|
3671
3589
|
{
|
|
3672
3590
|
value: editingMemoryContent,
|
|
@@ -3683,8 +3601,8 @@ var UserProfile = ({
|
|
|
3683
3601
|
}
|
|
3684
3602
|
}
|
|
3685
3603
|
),
|
|
3686
|
-
/* @__PURE__ */ (0,
|
|
3687
|
-
/* @__PURE__ */ (0,
|
|
3604
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex gap-1 justify-end", children: [
|
|
3605
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3688
3606
|
Button,
|
|
3689
3607
|
{
|
|
3690
3608
|
variant: "ghost",
|
|
@@ -3692,12 +3610,12 @@ var UserProfile = ({
|
|
|
3692
3610
|
className: "h-7 px-2",
|
|
3693
3611
|
onClick: handleCancelEdit,
|
|
3694
3612
|
children: [
|
|
3695
|
-
/* @__PURE__ */ (0,
|
|
3613
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.X, { className: "h-3.5 w-3.5 mr-1" }),
|
|
3696
3614
|
"Cancelar"
|
|
3697
3615
|
]
|
|
3698
3616
|
}
|
|
3699
3617
|
),
|
|
3700
|
-
/* @__PURE__ */ (0,
|
|
3618
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3701
3619
|
Button,
|
|
3702
3620
|
{
|
|
3703
3621
|
size: "sm",
|
|
@@ -3705,33 +3623,33 @@ var UserProfile = ({
|
|
|
3705
3623
|
onClick: handleSaveEdit,
|
|
3706
3624
|
disabled: !editingMemoryContent.trim(),
|
|
3707
3625
|
children: [
|
|
3708
|
-
/* @__PURE__ */ (0,
|
|
3626
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Check, { className: "h-3.5 w-3.5 mr-1" }),
|
|
3709
3627
|
"Salvar"
|
|
3710
3628
|
]
|
|
3711
3629
|
}
|
|
3712
3630
|
)
|
|
3713
3631
|
] })
|
|
3714
|
-
] }) : /* @__PURE__ */ (0,
|
|
3632
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm break-words", children: memory.content })
|
|
3715
3633
|
] }),
|
|
3716
|
-
!isEditing && (onUpdateMemory || onDeleteMemory) && /* @__PURE__ */ (0,
|
|
3717
|
-
onUpdateMemory && /* @__PURE__ */ (0,
|
|
3634
|
+
!isEditing && (onUpdateMemory || onDeleteMemory) && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity shrink-0", children: [
|
|
3635
|
+
onUpdateMemory && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3718
3636
|
Button,
|
|
3719
3637
|
{
|
|
3720
3638
|
variant: "ghost",
|
|
3721
3639
|
size: "icon",
|
|
3722
3640
|
className: "h-7 w-7",
|
|
3723
3641
|
onClick: () => handleStartEdit(memory),
|
|
3724
|
-
children: /* @__PURE__ */ (0,
|
|
3642
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Pencil, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
3725
3643
|
}
|
|
3726
3644
|
),
|
|
3727
|
-
onDeleteMemory && /* @__PURE__ */ (0,
|
|
3645
|
+
onDeleteMemory && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3728
3646
|
Button,
|
|
3729
3647
|
{
|
|
3730
3648
|
variant: "ghost",
|
|
3731
3649
|
size: "icon",
|
|
3732
3650
|
className: "h-7 w-7",
|
|
3733
3651
|
onClick: () => onDeleteMemory(memory.id),
|
|
3734
|
-
children: /* @__PURE__ */ (0,
|
|
3652
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Trash2, { className: "h-3.5 w-3.5 text-destructive" })
|
|
3735
3653
|
}
|
|
3736
3654
|
)
|
|
3737
3655
|
] })
|
|
@@ -3742,8 +3660,8 @@ var UserProfile = ({
|
|
|
3742
3660
|
}) })
|
|
3743
3661
|
] })
|
|
3744
3662
|
] }) }),
|
|
3745
|
-
/* @__PURE__ */ (0,
|
|
3746
|
-
onEditProfile && /* @__PURE__ */ (0,
|
|
3663
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "p-4 border-t space-y-2 shrink-0", children: [
|
|
3664
|
+
onEditProfile && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3747
3665
|
Button,
|
|
3748
3666
|
{
|
|
3749
3667
|
variant: "outline",
|
|
@@ -3752,7 +3670,7 @@ var UserProfile = ({
|
|
|
3752
3670
|
children: "Edit Profile"
|
|
3753
3671
|
}
|
|
3754
3672
|
),
|
|
3755
|
-
onLogout && /* @__PURE__ */ (0,
|
|
3673
|
+
onLogout && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3756
3674
|
Button,
|
|
3757
3675
|
{
|
|
3758
3676
|
variant: "destructive",
|
|
@@ -3769,7 +3687,7 @@ var UserProfile = ({
|
|
|
3769
3687
|
|
|
3770
3688
|
// src/components/chat/ChatUI.tsx
|
|
3771
3689
|
var import_lucide_react11 = require("lucide-react");
|
|
3772
|
-
var
|
|
3690
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3773
3691
|
var ChatUI = ({
|
|
3774
3692
|
messages = [],
|
|
3775
3693
|
threads = [],
|
|
@@ -3777,6 +3695,7 @@ var ChatUI = ({
|
|
|
3777
3695
|
config: userConfig,
|
|
3778
3696
|
sidebar: _sidebar,
|
|
3779
3697
|
isGenerating = false,
|
|
3698
|
+
isMessagesLoading = false,
|
|
3780
3699
|
callbacks = {},
|
|
3781
3700
|
user,
|
|
3782
3701
|
assistant,
|
|
@@ -3792,7 +3711,10 @@ var ChatUI = ({
|
|
|
3792
3711
|
initialInput,
|
|
3793
3712
|
onInitialInputConsumed
|
|
3794
3713
|
}) => {
|
|
3795
|
-
const config =
|
|
3714
|
+
const config = (0, import_react7.useMemo)(
|
|
3715
|
+
() => mergeConfig(defaultChatConfig, userConfig),
|
|
3716
|
+
[userConfig]
|
|
3717
|
+
);
|
|
3796
3718
|
const [isMobile, setIsMobile] = (0, import_react7.useState)(false);
|
|
3797
3719
|
const [isUserProfileOpen, setIsUserProfileOpen] = (0, import_react7.useState)(false);
|
|
3798
3720
|
let userContext;
|
|
@@ -3956,13 +3878,13 @@ var ChatUI = ({
|
|
|
3956
3878
|
const SuggestionIconComponents = [import_lucide_react11.MessageSquare, import_lucide_react11.Lightbulb, import_lucide_react11.Zap, import_lucide_react11.HelpCircle];
|
|
3957
3879
|
const renderSuggestions = () => {
|
|
3958
3880
|
if (messages.length > 0 || !suggestions.length) return null;
|
|
3959
|
-
return /* @__PURE__ */ (0,
|
|
3960
|
-
/* @__PURE__ */ (0,
|
|
3961
|
-
/* @__PURE__ */ (0,
|
|
3962
|
-
/* @__PURE__ */ (0,
|
|
3963
|
-
/* @__PURE__ */ (0,
|
|
3881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col items-center justify-center min-h-[60vh] py-8 px-4", children: [
|
|
3882
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "text-center mb-8", children: [
|
|
3883
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "inline-flex items-center justify-center w-14 h-14 rounded-2xl bg-gradient-to-br from-primary/20 to-primary/5 mb-4 shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Sparkles, { className: "w-7 h-7 text-primary" }) }),
|
|
3884
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h2", { className: "text-xl font-semibold mb-2", children: config.branding.title }),
|
|
3885
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-muted-foreground text-sm max-w-md", children: config.branding.subtitle })
|
|
3964
3886
|
] }),
|
|
3965
|
-
/* @__PURE__ */ (0,
|
|
3887
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 w-full max-w-2xl", children: suggestions.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3966
3888
|
"button",
|
|
3967
3889
|
{
|
|
3968
3890
|
type: "button",
|
|
@@ -3971,10 +3893,10 @@ var ChatUI = ({
|
|
|
3971
3893
|
children: [
|
|
3972
3894
|
(() => {
|
|
3973
3895
|
const IconComponent = SuggestionIconComponents[index % SuggestionIconComponents.length];
|
|
3974
|
-
return /* @__PURE__ */ (0,
|
|
3896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center justify-center w-8 h-8 rounded-lg bg-primary/10 text-primary shrink-0 group-hover:bg-primary/15 transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IconComponent, { className: "h-4 w-4" }) });
|
|
3975
3897
|
})(),
|
|
3976
|
-
/* @__PURE__ */ (0,
|
|
3977
|
-
/* @__PURE__ */ (0,
|
|
3898
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex-1 min-w-0 pr-6", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm font-medium leading-snug line-clamp-2", children: suggestion }) }),
|
|
3899
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.ArrowRight, { className: "absolute right-4 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" })
|
|
3978
3900
|
]
|
|
3979
3901
|
},
|
|
3980
3902
|
index
|
|
@@ -3984,25 +3906,100 @@ var ChatUI = ({
|
|
|
3984
3906
|
const renderInlineSuggestions = (messageId) => {
|
|
3985
3907
|
const items = messageSuggestions?.[messageId];
|
|
3986
3908
|
if (!items || items.length === 0) return null;
|
|
3987
|
-
return /* @__PURE__ */ (0,
|
|
3909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-wrap gap-2 mt-2 ml-11", children: items.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3988
3910
|
"button",
|
|
3989
3911
|
{
|
|
3990
3912
|
type: "button",
|
|
3991
3913
|
onClick: () => handleSendMessage(suggestion),
|
|
3992
3914
|
className: "group inline-flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-full border border-border bg-background hover:bg-accent hover:border-accent-foreground/20 transition-all duration-150 text-foreground/80 hover:text-foreground",
|
|
3993
3915
|
children: [
|
|
3994
|
-
/* @__PURE__ */ (0,
|
|
3995
|
-
/* @__PURE__ */ (0,
|
|
3916
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Sparkles, { className: "h-3 w-3 text-primary opacity-70 group-hover:opacity-100" }),
|
|
3917
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "max-w-[200px] truncate", children: suggestion })
|
|
3996
3918
|
]
|
|
3997
3919
|
},
|
|
3998
3920
|
`${messageId}-suggestion-${index}`
|
|
3999
3921
|
)) });
|
|
4000
3922
|
};
|
|
3923
|
+
const renderMessageLoadingSkeleton = () => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "space-y-6 py-2", children: [0, 1, 2, 3].map((index) => {
|
|
3924
|
+
const isUserRow = index % 2 === 1;
|
|
3925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3926
|
+
"div",
|
|
3927
|
+
{
|
|
3928
|
+
className: `flex gap-3 ${isUserRow ? "justify-end" : "justify-start"}`,
|
|
3929
|
+
children: [
|
|
3930
|
+
!isUserRow && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Skeleton, { className: "h-8 w-8 rounded-full shrink-0" }),
|
|
3931
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: `space-y-2 ${isUserRow ? "w-[70%]" : "w-[75%]"}`, children: [
|
|
3932
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Skeleton, { className: "h-4 w-24" }),
|
|
3933
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Skeleton, { className: "h-4 w-full" }),
|
|
3934
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Skeleton, { className: "h-4 w-[85%]" })
|
|
3935
|
+
] }),
|
|
3936
|
+
isUserRow && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Skeleton, { className: "h-8 w-8 rounded-full shrink-0" })
|
|
3937
|
+
]
|
|
3938
|
+
},
|
|
3939
|
+
`message-skeleton-${index}`
|
|
3940
|
+
);
|
|
3941
|
+
}) });
|
|
3942
|
+
const renderedMessageList = (0, import_react7.useMemo)(() => {
|
|
3943
|
+
if (isMessagesLoading) return renderMessageLoadingSkeleton();
|
|
3944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
3945
|
+
renderSuggestions(),
|
|
3946
|
+
messages.map((message, index) => {
|
|
3947
|
+
const prevMessage = index > 0 ? messages[index - 1] : null;
|
|
3948
|
+
const isGrouped = prevMessage !== null && prevMessage.role === message.role;
|
|
3949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: isGrouped ? "space-y-1 -mt-2" : "space-y-2", children: [
|
|
3950
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3951
|
+
Message,
|
|
3952
|
+
{
|
|
3953
|
+
message,
|
|
3954
|
+
userAvatar: user?.avatar,
|
|
3955
|
+
userName: user?.name,
|
|
3956
|
+
assistantAvatar: assistant?.avatar,
|
|
3957
|
+
assistantName: assistant?.name,
|
|
3958
|
+
showTimestamp: config.ui.showTimestamps,
|
|
3959
|
+
showAvatar: config.ui.showAvatars,
|
|
3960
|
+
enableCopy: config.features.enableMessageCopy,
|
|
3961
|
+
enableEdit: config.features.enableMessageEditing,
|
|
3962
|
+
enableRegenerate: config.features.enableRegeneration,
|
|
3963
|
+
enableToolCallsDisplay: config.features.enableToolCallsDisplay,
|
|
3964
|
+
compactMode: config.ui.compactMode,
|
|
3965
|
+
onAction: handleMessageAction,
|
|
3966
|
+
toolUsedLabel: config.labels.toolUsed,
|
|
3967
|
+
thinkingLabel: config.labels.thinking,
|
|
3968
|
+
isGrouped
|
|
3969
|
+
}
|
|
3970
|
+
),
|
|
3971
|
+
message.role === "assistant" && renderInlineSuggestions(message.id)
|
|
3972
|
+
] }, message.id);
|
|
3973
|
+
})
|
|
3974
|
+
] });
|
|
3975
|
+
}, [
|
|
3976
|
+
isMessagesLoading,
|
|
3977
|
+
messages,
|
|
3978
|
+
handleSendMessage,
|
|
3979
|
+
user?.avatar,
|
|
3980
|
+
user?.name,
|
|
3981
|
+
assistant?.avatar,
|
|
3982
|
+
assistant?.name,
|
|
3983
|
+
config.branding.title,
|
|
3984
|
+
config.branding.subtitle,
|
|
3985
|
+
config.ui.showTimestamps,
|
|
3986
|
+
config.ui.showAvatars,
|
|
3987
|
+
config.ui.compactMode,
|
|
3988
|
+
config.features.enableMessageCopy,
|
|
3989
|
+
config.features.enableMessageEditing,
|
|
3990
|
+
config.features.enableRegeneration,
|
|
3991
|
+
config.features.enableToolCallsDisplay,
|
|
3992
|
+
config.labels.toolUsed,
|
|
3993
|
+
config.labels.thinking,
|
|
3994
|
+
handleMessageAction,
|
|
3995
|
+
messageSuggestions,
|
|
3996
|
+
suggestions
|
|
3997
|
+
]);
|
|
4001
3998
|
const shouldShowAgentSelector = Boolean(
|
|
4002
3999
|
config.agentSelector?.enabled && onSelectAgent && agentOptions.length > 0 && (!config.agentSelector?.hideIfSingle || agentOptions.length > 1)
|
|
4003
4000
|
);
|
|
4004
|
-
return /* @__PURE__ */ (0,
|
|
4005
|
-
/* @__PURE__ */ (0,
|
|
4001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SidebarProvider, { defaultOpen: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: `flex h-[100svh] md:h-screen bg-background w-full overflow-hidden ${className}`, children: [
|
|
4002
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4006
4003
|
Sidebar2,
|
|
4007
4004
|
{
|
|
4008
4005
|
threads,
|
|
@@ -4032,8 +4029,8 @@ var ChatUI = ({
|
|
|
4032
4029
|
showThemeOptions: !!callbacks.onThemeChange
|
|
4033
4030
|
}
|
|
4034
4031
|
),
|
|
4035
|
-
/* @__PURE__ */ (0,
|
|
4036
|
-
/* @__PURE__ */ (0,
|
|
4032
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SidebarInset, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col h-full min-h-0", children: [
|
|
4033
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4037
4034
|
ChatHeader,
|
|
4038
4035
|
{
|
|
4039
4036
|
config,
|
|
@@ -4048,50 +4045,22 @@ var ChatUI = ({
|
|
|
4048
4045
|
onSelectAgent
|
|
4049
4046
|
}
|
|
4050
4047
|
),
|
|
4051
|
-
/* @__PURE__ */ (0,
|
|
4052
|
-
/* @__PURE__ */ (0,
|
|
4053
|
-
/* @__PURE__ */ (0,
|
|
4048
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-1 flex-row min-h-0 overflow-hidden", children: [
|
|
4049
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex-1 flex flex-col min-h-0", children: [
|
|
4050
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4054
4051
|
ScrollArea,
|
|
4055
4052
|
{
|
|
4056
4053
|
ref: scrollAreaRef,
|
|
4057
4054
|
className: "flex-1 min-h-0",
|
|
4058
4055
|
viewportClassName: "p-4 overscroll-contain",
|
|
4059
4056
|
onScrollCapture: handleScroll,
|
|
4060
|
-
children: /* @__PURE__ */ (0,
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
const prevMessage = index > 0 ? messages[index - 1] : null;
|
|
4064
|
-
const isGrouped = prevMessage !== null && prevMessage.role === message.role;
|
|
4065
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: isGrouped ? "space-y-1 -mt-2" : "space-y-2", children: [
|
|
4066
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4067
|
-
Message,
|
|
4068
|
-
{
|
|
4069
|
-
message,
|
|
4070
|
-
userAvatar: user?.avatar,
|
|
4071
|
-
userName: user?.name,
|
|
4072
|
-
assistantAvatar: assistant?.avatar,
|
|
4073
|
-
assistantName: assistant?.name,
|
|
4074
|
-
showTimestamp: config.ui.showTimestamps,
|
|
4075
|
-
showAvatar: config.ui.showAvatars,
|
|
4076
|
-
enableCopy: config.features.enableMessageCopy,
|
|
4077
|
-
enableEdit: config.features.enableMessageEditing,
|
|
4078
|
-
enableRegenerate: config.features.enableRegeneration,
|
|
4079
|
-
enableToolCallsDisplay: config.features.enableToolCallsDisplay,
|
|
4080
|
-
compactMode: config.ui.compactMode,
|
|
4081
|
-
onAction: handleMessageAction,
|
|
4082
|
-
toolUsedLabel: config.labels.toolUsed,
|
|
4083
|
-
thinkingLabel: config.labels.thinking,
|
|
4084
|
-
isGrouped
|
|
4085
|
-
}
|
|
4086
|
-
),
|
|
4087
|
-
message.role === "assistant" && renderInlineSuggestions(message.id)
|
|
4088
|
-
] }, message.id);
|
|
4089
|
-
}),
|
|
4090
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { ref: messagesEndRef })
|
|
4057
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "max-w-4xl mx-auto space-y-4 pb-4", children: [
|
|
4058
|
+
renderedMessageList,
|
|
4059
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { ref: messagesEndRef })
|
|
4091
4060
|
] })
|
|
4092
4061
|
}
|
|
4093
4062
|
),
|
|
4094
|
-
/* @__PURE__ */ (0,
|
|
4063
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "bg-background pb-[env(safe-area-inset-bottom)]", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4095
4064
|
ChatInput,
|
|
4096
4065
|
{
|
|
4097
4066
|
value: inputValue,
|
|
@@ -4117,17 +4086,17 @@ var ChatUI = ({
|
|
|
4117
4086
|
}
|
|
4118
4087
|
) })
|
|
4119
4088
|
] }),
|
|
4120
|
-
config?.customComponent?.component && !isMobile && /* @__PURE__ */ (0,
|
|
4089
|
+
config?.customComponent?.component && !isMobile && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4121
4090
|
"div",
|
|
4122
4091
|
{
|
|
4123
4092
|
className: `h-full transition-all duration-300 ease-in-out overflow-hidden ${state.showSidebar ? "w-80" : "w-0"}`,
|
|
4124
|
-
children: state.showSidebar && /* @__PURE__ */ (0,
|
|
4093
|
+
children: state.showSidebar && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-col h-full border-l bg-background animate-in slide-in-from-right-4 duration-300 w-80", children: renderCustomComponent() })
|
|
4125
4094
|
}
|
|
4126
4095
|
)
|
|
4127
4096
|
] })
|
|
4128
4097
|
] }) }),
|
|
4129
|
-
isCustomMounted && config.customComponent?.component && isMobile && /* @__PURE__ */ (0,
|
|
4130
|
-
/* @__PURE__ */ (0,
|
|
4098
|
+
isCustomMounted && config.customComponent?.component && isMobile && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "fixed inset-0 z-50", children: [
|
|
4099
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4131
4100
|
"div",
|
|
4132
4101
|
{
|
|
4133
4102
|
className: `absolute inset-0 bg-background/80 backdrop-blur-sm transition-opacity duration-200 ease-out ${isCustomVisible ? "opacity-100" : "opacity-0"}`,
|
|
@@ -4135,16 +4104,16 @@ var ChatUI = ({
|
|
|
4135
4104
|
onClick: closeSidebar
|
|
4136
4105
|
}
|
|
4137
4106
|
),
|
|
4138
|
-
/* @__PURE__ */ (0,
|
|
4107
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4139
4108
|
"div",
|
|
4140
4109
|
{
|
|
4141
4110
|
className: `absolute top-0 right-0 h-full w-full bg-background transform-gpu transition-transform duration-200 ease-out ${isCustomVisible ? "translate-x-0" : "translate-x-full"}`,
|
|
4142
4111
|
style: { willChange: "transform" },
|
|
4143
|
-
children: /* @__PURE__ */ (0,
|
|
4112
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-full flex flex-col", children: renderCustomComponent() })
|
|
4144
4113
|
}
|
|
4145
4114
|
)
|
|
4146
4115
|
] }),
|
|
4147
|
-
isUserProfileOpen && /* @__PURE__ */ (0,
|
|
4116
|
+
isUserProfileOpen && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4148
4117
|
UserProfile,
|
|
4149
4118
|
{
|
|
4150
4119
|
isOpen: isUserProfileOpen,
|
|
@@ -4169,7 +4138,7 @@ var ChatUI = ({
|
|
|
4169
4138
|
// src/components/chat/ThreadManager.tsx
|
|
4170
4139
|
var import_react8 = require("react");
|
|
4171
4140
|
var import_lucide_react12 = require("lucide-react");
|
|
4172
|
-
var
|
|
4141
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4173
4142
|
var ThreadItem = ({ thread, isActive, config, onSelect, onRename, onDelete, onArchive }) => {
|
|
4174
4143
|
const [isEditing, setIsEditing] = (0, import_react8.useState)(false);
|
|
4175
4144
|
const [editTitle, setEditTitle] = (0, import_react8.useState)(thread.title);
|
|
@@ -4198,9 +4167,9 @@ var ThreadItem = ({ thread, isActive, config, onSelect, onRename, onDelete, onAr
|
|
|
4198
4167
|
handleCancelEdit();
|
|
4199
4168
|
}
|
|
4200
4169
|
};
|
|
4201
|
-
return /* @__PURE__ */ (0,
|
|
4202
|
-
/* @__PURE__ */ (0,
|
|
4203
|
-
/* @__PURE__ */ (0,
|
|
4170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Card, { className: `cursor-pointer transition-all duration-200 hover:shadow-md py-0 ${isActive ? "ring-2 ring-primary bg-primary/5" : "hover:bg-muted/50"}`, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CardContent, { className: "p-3 max-w-sm", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
|
|
4171
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex-1 min-w-0", onClick: onSelect, children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4172
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4204
4173
|
Input,
|
|
4205
4174
|
{
|
|
4206
4175
|
ref: inputRef,
|
|
@@ -4212,44 +4181,44 @@ var ThreadItem = ({ thread, isActive, config, onSelect, onRename, onDelete, onAr
|
|
|
4212
4181
|
placeholder: config?.labels?.threadNamePlaceholder || "Conversation name"
|
|
4213
4182
|
}
|
|
4214
4183
|
),
|
|
4215
|
-
/* @__PURE__ */ (0,
|
|
4216
|
-
/* @__PURE__ */ (0,
|
|
4217
|
-
] }) : /* @__PURE__ */ (0,
|
|
4218
|
-
/* @__PURE__ */ (0,
|
|
4219
|
-
/* @__PURE__ */ (0,
|
|
4220
|
-
/* @__PURE__ */ (0,
|
|
4221
|
-
/* @__PURE__ */ (0,
|
|
4184
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { size: "sm", variant: "ghost", onClick: handleSaveEdit, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Check, { className: "h-3 w-3" }) }),
|
|
4185
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { size: "sm", variant: "ghost", onClick: handleCancelEdit, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.X, { className: "h-3 w-3" }) })
|
|
4186
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
4187
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h4", { className: "font-medium text-sm truncate mb-1", children: thread.title }),
|
|
4188
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
4189
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
4190
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Hash, { className: "h-3 w-3" }),
|
|
4222
4191
|
thread.messageCount,
|
|
4223
4192
|
" msgs"
|
|
4224
4193
|
] }),
|
|
4225
|
-
/* @__PURE__ */ (0,
|
|
4226
|
-
/* @__PURE__ */ (0,
|
|
4227
|
-
/* @__PURE__ */ (0,
|
|
4194
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Separator, { orientation: "vertical", className: "h-3" }),
|
|
4195
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
4196
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Calendar, { className: "h-3 w-3" }),
|
|
4228
4197
|
formatDate(thread.updatedAt, config?.labels)
|
|
4229
4198
|
] }),
|
|
4230
|
-
thread.isArchived && /* @__PURE__ */ (0,
|
|
4231
|
-
/* @__PURE__ */ (0,
|
|
4232
|
-
/* @__PURE__ */ (0,
|
|
4233
|
-
/* @__PURE__ */ (0,
|
|
4199
|
+
thread.isArchived && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
4200
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Separator, { orientation: "vertical", className: "h-3" }),
|
|
4201
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Badge, { variant: "secondary", className: "text-xs", children: [
|
|
4202
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Archive, { className: "h-2 w-2 mr-1" }),
|
|
4234
4203
|
config?.labels?.archiveThread || "Archived"
|
|
4235
4204
|
] })
|
|
4236
4205
|
] })
|
|
4237
4206
|
] })
|
|
4238
4207
|
] }) }),
|
|
4239
|
-
!isEditing && /* @__PURE__ */ (0,
|
|
4240
|
-
/* @__PURE__ */ (0,
|
|
4241
|
-
/* @__PURE__ */ (0,
|
|
4242
|
-
/* @__PURE__ */ (0,
|
|
4243
|
-
/* @__PURE__ */ (0,
|
|
4208
|
+
!isEditing && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DropdownMenu, { children: [
|
|
4209
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { variant: "ghost", size: "icon", className: "h-6 w-6 m-auto", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.MoreVertical, { className: "h-3 w-3" }) }) }),
|
|
4210
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DropdownMenuContent, { align: "end", children: [
|
|
4211
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DropdownMenuItem, { onClick: () => setIsEditing(true), children: [
|
|
4212
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Edit2, { className: "h-4 w-4 mr-2" }),
|
|
4244
4213
|
config?.labels?.renameThread || "Rename"
|
|
4245
4214
|
] }),
|
|
4246
|
-
/* @__PURE__ */ (0,
|
|
4247
|
-
/* @__PURE__ */ (0,
|
|
4215
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DropdownMenuItem, { onClick: onArchive, children: [
|
|
4216
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Archive, { className: "h-4 w-4 mr-2" }),
|
|
4248
4217
|
thread.isArchived ? config?.labels?.unarchiveThread || "Unarchive" : config?.labels?.archiveThread || "Archive"
|
|
4249
4218
|
] }),
|
|
4250
|
-
/* @__PURE__ */ (0,
|
|
4251
|
-
/* @__PURE__ */ (0,
|
|
4252
|
-
/* @__PURE__ */ (0,
|
|
4219
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropdownMenuSeparator, {}),
|
|
4220
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DropdownMenuItem, { onClick: onDelete, className: "text-destructive", children: [
|
|
4221
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Trash2, { className: "h-4 w-4 mr-2" }),
|
|
4253
4222
|
config?.labels?.deleteThread || "Delete"
|
|
4254
4223
|
] })
|
|
4255
4224
|
] })
|
|
@@ -4264,17 +4233,17 @@ var CreateThreadDialog2 = ({ onCreateThread, config }) => {
|
|
|
4264
4233
|
setTitle("");
|
|
4265
4234
|
setIsOpen(false);
|
|
4266
4235
|
};
|
|
4267
|
-
return /* @__PURE__ */ (0,
|
|
4268
|
-
/* @__PURE__ */ (0,
|
|
4269
|
-
/* @__PURE__ */ (0,
|
|
4236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
4237
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DialogTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Button, { variant: "outline", className: "w-full", children: [
|
|
4238
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Plus, { className: "h-4 w-4 mr-2" }),
|
|
4270
4239
|
config?.labels?.createNewThread || "New Conversation"
|
|
4271
4240
|
] }) }),
|
|
4272
|
-
/* @__PURE__ */ (0,
|
|
4273
|
-
/* @__PURE__ */ (0,
|
|
4274
|
-
/* @__PURE__ */ (0,
|
|
4275
|
-
/* @__PURE__ */ (0,
|
|
4241
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DialogContent, { children: [
|
|
4242
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DialogHeader, { children: [
|
|
4243
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DialogTitle, { children: config?.labels?.createNewThread || "Create New Conversation" }),
|
|
4244
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DialogDescription, { children: "Give your new conversation a name or leave blank to auto-generate one." })
|
|
4276
4245
|
] }),
|
|
4277
|
-
/* @__PURE__ */ (0,
|
|
4246
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4278
4247
|
Input,
|
|
4279
4248
|
{
|
|
4280
4249
|
value: title,
|
|
@@ -4284,9 +4253,9 @@ var CreateThreadDialog2 = ({ onCreateThread, config }) => {
|
|
|
4284
4253
|
autoFocus: true
|
|
4285
4254
|
}
|
|
4286
4255
|
),
|
|
4287
|
-
/* @__PURE__ */ (0,
|
|
4288
|
-
/* @__PURE__ */ (0,
|
|
4289
|
-
/* @__PURE__ */ (0,
|
|
4256
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DialogFooter, { children: [
|
|
4257
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { variant: "outline", onClick: () => setIsOpen(false), children: config?.labels?.cancel || "Cancel" }),
|
|
4258
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { onClick: handleCreate, children: config?.labels?.create || "Create" })
|
|
4290
4259
|
] })
|
|
4291
4260
|
] })
|
|
4292
4261
|
] });
|
|
@@ -4340,20 +4309,20 @@ var ThreadManager = ({
|
|
|
4340
4309
|
setDeleteThreadId(null);
|
|
4341
4310
|
};
|
|
4342
4311
|
if (!isOpen) return null;
|
|
4343
|
-
return /* @__PURE__ */ (0,
|
|
4344
|
-
/* @__PURE__ */ (0,
|
|
4345
|
-
/* @__PURE__ */ (0,
|
|
4346
|
-
/* @__PURE__ */ (0,
|
|
4347
|
-
/* @__PURE__ */ (0,
|
|
4348
|
-
/* @__PURE__ */ (0,
|
|
4312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: `fixed inset-0 z-50 bg-background/80 backdrop-blur-sm ${className}`, children: [
|
|
4313
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "fixed left-0 top-0 h-full w-full max-w-md border-r bg-background shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Card, { className: "h-full border-0 rounded-none", children: [
|
|
4314
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(CardHeader, { className: "border-b", children: [
|
|
4315
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
4316
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(CardTitle, { className: "flex items-center gap-2", children: [
|
|
4317
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.MessageSquare, { className: "h-5 w-5" }),
|
|
4349
4318
|
config?.labels?.newChat || "Conversations"
|
|
4350
4319
|
] }),
|
|
4351
|
-
/* @__PURE__ */ (0,
|
|
4320
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { variant: "ghost", size: "icon", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.X, { className: "h-4 w-4" }) })
|
|
4352
4321
|
] }),
|
|
4353
|
-
/* @__PURE__ */ (0,
|
|
4354
|
-
/* @__PURE__ */ (0,
|
|
4355
|
-
/* @__PURE__ */ (0,
|
|
4356
|
-
/* @__PURE__ */ (0,
|
|
4322
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-3", children: [
|
|
4323
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "relative", children: [
|
|
4324
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
4325
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4357
4326
|
Input,
|
|
4358
4327
|
{
|
|
4359
4328
|
placeholder: config?.labels?.search || "Search conversations...",
|
|
@@ -4363,8 +4332,8 @@ var ThreadManager = ({
|
|
|
4363
4332
|
}
|
|
4364
4333
|
)
|
|
4365
4334
|
] }),
|
|
4366
|
-
/* @__PURE__ */ (0,
|
|
4367
|
-
/* @__PURE__ */ (0,
|
|
4335
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
4336
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4368
4337
|
Button,
|
|
4369
4338
|
{
|
|
4370
4339
|
variant: "outline",
|
|
@@ -4372,12 +4341,12 @@ var ThreadManager = ({
|
|
|
4372
4341
|
onClick: () => setShowArchived(!showArchived),
|
|
4373
4342
|
className: "text-xs",
|
|
4374
4343
|
children: [
|
|
4375
|
-
/* @__PURE__ */ (0,
|
|
4344
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Filter, { className: "h-3 w-3 mr-1" }),
|
|
4376
4345
|
showArchived ? config?.labels?.hideArchived || "Hide Archived" : config?.labels?.showArchived || "Show Archived"
|
|
4377
4346
|
]
|
|
4378
4347
|
}
|
|
4379
4348
|
),
|
|
4380
|
-
/* @__PURE__ */ (0,
|
|
4349
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Badge, { variant: "secondary", className: "text-xs", children: [
|
|
4381
4350
|
filteredThreads.length,
|
|
4382
4351
|
" / ",
|
|
4383
4352
|
threads.length
|
|
@@ -4385,14 +4354,14 @@ var ThreadManager = ({
|
|
|
4385
4354
|
] })
|
|
4386
4355
|
] })
|
|
4387
4356
|
] }),
|
|
4388
|
-
/* @__PURE__ */ (0,
|
|
4389
|
-
/* @__PURE__ */ (0,
|
|
4390
|
-
/* @__PURE__ */ (0,
|
|
4391
|
-
/* @__PURE__ */ (0,
|
|
4392
|
-
/* @__PURE__ */ (0,
|
|
4393
|
-
] }) : Object.entries(groupedThreads).map(([group, groupThreads]) => /* @__PURE__ */ (0,
|
|
4394
|
-
/* @__PURE__ */ (0,
|
|
4395
|
-
/* @__PURE__ */ (0,
|
|
4357
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(CardContent, { className: "p-0 flex-1", children: [
|
|
4358
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "p-4", children: onCreateThread && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CreateThreadDialog2, { onCreateThread, config }) }),
|
|
4359
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ScrollArea, { className: "h-[calc(100vh-280px)]", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "px-4 pb-4 space-y-4", children: Object.keys(groupedThreads).length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "text-center py-8 text-muted-foreground", children: [
|
|
4360
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.MessageSquare, { className: "h-12 w-12 mx-auto mb-3 opacity-50" }),
|
|
4361
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-sm", children: searchQuery ? config?.labels?.noThreadsFound || "No conversations found" : config?.labels?.noThreadsYet || "No conversations yet" })
|
|
4362
|
+
] }) : Object.entries(groupedThreads).map(([group, groupThreads]) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
|
|
4363
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h3", { className: "text-sm font-medium text-muted-foreground mb-2 px-2", children: group }),
|
|
4364
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "space-y-2", children: groupThreads.map((thread) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4396
4365
|
ThreadItem,
|
|
4397
4366
|
{
|
|
4398
4367
|
thread,
|
|
@@ -4408,14 +4377,14 @@ var ThreadManager = ({
|
|
|
4408
4377
|
] }, group)) }) })
|
|
4409
4378
|
] })
|
|
4410
4379
|
] }) }),
|
|
4411
|
-
deleteThreadId && /* @__PURE__ */ (0,
|
|
4412
|
-
/* @__PURE__ */ (0,
|
|
4413
|
-
/* @__PURE__ */ (0,
|
|
4414
|
-
/* @__PURE__ */ (0,
|
|
4380
|
+
deleteThreadId && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AlertDialog, { open: !!deleteThreadId, onOpenChange: () => setDeleteThreadId(null), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AlertDialogContent, { children: [
|
|
4381
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AlertDialogHeader, { children: [
|
|
4382
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AlertDialogTitle, { children: config?.labels?.deleteConfirmTitle || "Delete Conversation" }),
|
|
4383
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AlertDialogDescription, { children: config?.labels?.deleteConfirmDescription || "Are you sure you want to delete this conversation? This action cannot be undone." })
|
|
4415
4384
|
] }),
|
|
4416
|
-
/* @__PURE__ */ (0,
|
|
4417
|
-
/* @__PURE__ */ (0,
|
|
4418
|
-
/* @__PURE__ */ (0,
|
|
4385
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AlertDialogFooter, { children: [
|
|
4386
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AlertDialogCancel, { children: config?.labels?.cancel || "Cancel" }),
|
|
4387
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4419
4388
|
AlertDialogAction,
|
|
4420
4389
|
{
|
|
4421
4390
|
onClick: () => deleteThreadId && handleDeleteThread(deleteThreadId),
|