@copilotz/chat-ui 0.1.1 → 0.1.3

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 CHANGED
@@ -781,27 +781,7 @@ var ToolCallsDisplay = (0, import_react.memo)(function ToolCallsDisplay2({ toolC
781
781
  ] });
782
782
  });
783
783
  var arePropsEqual = (prevProps, nextProps) => {
784
- if (prevProps.message.id !== nextProps.message.id) return false;
785
- if (prevProps.message.content !== nextProps.message.content) return false;
786
- if (prevProps.message.isStreaming !== nextProps.message.isStreaming) return false;
787
- if (prevProps.message.isComplete !== nextProps.message.isComplete) return false;
788
- if (prevProps.message.isEdited !== nextProps.message.isEdited) return false;
789
- if (prevProps.message.timestamp !== nextProps.message.timestamp) return false;
790
- if (prevProps.message.toolCalls !== nextProps.message.toolCalls) {
791
- const prevCalls = prevProps.message.toolCalls;
792
- const nextCalls = nextProps.message.toolCalls;
793
- if (!prevCalls || !nextCalls || prevCalls.length !== nextCalls.length) return false;
794
- for (let i = 0; i < prevCalls.length; i++) {
795
- if (prevCalls[i].id !== nextCalls[i].id || prevCalls[i].status !== nextCalls[i].status || prevCalls[i].result !== nextCalls[i].result) {
796
- return false;
797
- }
798
- }
799
- }
800
- if (prevProps.message.attachments !== nextProps.message.attachments) {
801
- const prevAtt = prevProps.message.attachments;
802
- const nextAtt = nextProps.message.attachments;
803
- if (!prevAtt || !nextAtt || prevAtt.length !== nextAtt.length) return false;
804
- }
784
+ if (prevProps.message !== nextProps.message) return false;
805
785
  if (prevProps.isUser !== nextProps.isUser) return false;
806
786
  if (prevProps.userAvatar !== nextProps.userAvatar) return false;
807
787
  if (prevProps.userName !== nextProps.userName) return false;
@@ -1168,8 +1148,21 @@ function SheetDescription({
1168
1148
  );
1169
1149
  }
1170
1150
 
1171
- // src/components/ui/sidebar.tsx
1151
+ // src/components/ui/skeleton.tsx
1172
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");
1173
1166
  var SIDEBAR_COOKIE_NAME = "sidebar_state";
1174
1167
  var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
1175
1168
  var SIDEBAR_WIDTH = "16rem";
@@ -1235,7 +1228,7 @@ function SidebarProvider({
1235
1228
  }),
1236
1229
  [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
1237
1230
  );
1238
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
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)(
1239
1232
  "div",
1240
1233
  {
1241
1234
  "data-slot": "sidebar-wrapper",
@@ -1263,7 +1256,7 @@ function Sidebar({
1263
1256
  }) {
1264
1257
  const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
1265
1258
  if (collapsible === "none") {
1266
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1259
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1267
1260
  "div",
1268
1261
  {
1269
1262
  "data-slot": "sidebar",
@@ -1277,7 +1270,7 @@ function Sidebar({
1277
1270
  );
1278
1271
  }
1279
1272
  if (isMobile) {
1280
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1273
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1281
1274
  SheetContent,
1282
1275
  {
1283
1276
  "data-sidebar": "sidebar",
@@ -1289,16 +1282,16 @@ function Sidebar({
1289
1282
  },
1290
1283
  side,
1291
1284
  children: [
1292
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(SheetHeader, { className: "sr-only", children: [
1293
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SheetTitle, { children: "Sidebar" }),
1294
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SheetDescription, { children: "Displays the mobile sidebar." })
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." })
1295
1288
  ] }),
1296
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex h-full w-full flex-col", children })
1289
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex h-full w-full flex-col", children })
1297
1290
  ]
1298
1291
  }
1299
1292
  ) });
1300
1293
  }
1301
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1294
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1302
1295
  "div",
1303
1296
  {
1304
1297
  className: "group peer text-sidebar-foreground hidden md:block",
@@ -1308,7 +1301,7 @@ function Sidebar({
1308
1301
  "data-side": side,
1309
1302
  "data-slot": "sidebar",
1310
1303
  children: [
1311
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1304
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1312
1305
  "div",
1313
1306
  {
1314
1307
  "data-slot": "sidebar-gap",
@@ -1320,7 +1313,7 @@ function Sidebar({
1320
1313
  )
1321
1314
  }
1322
1315
  ),
1323
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1316
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1324
1317
  "div",
1325
1318
  {
1326
1319
  "data-slot": "sidebar-container",
@@ -1332,7 +1325,7 @@ function Sidebar({
1332
1325
  className
1333
1326
  ),
1334
1327
  ...props,
1335
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1328
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1336
1329
  "div",
1337
1330
  {
1338
1331
  "data-sidebar": "sidebar",
@@ -1353,7 +1346,7 @@ function SidebarTrigger({
1353
1346
  ...props
1354
1347
  }) {
1355
1348
  const { toggleSidebar } = useSidebar();
1356
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1349
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1357
1350
  Button,
1358
1351
  {
1359
1352
  "data-sidebar": "trigger",
@@ -1367,15 +1360,15 @@ function SidebarTrigger({
1367
1360
  },
1368
1361
  ...props,
1369
1362
  children: [
1370
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react3.PanelLeftIcon, {}),
1371
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "Toggle Sidebar" })
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" })
1372
1365
  ]
1373
1366
  }
1374
1367
  );
1375
1368
  }
1376
1369
  function SidebarRail({ className, ...props }) {
1377
1370
  const { toggleSidebar } = useSidebar();
1378
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1371
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1379
1372
  "button",
1380
1373
  {
1381
1374
  "data-sidebar": "rail",
@@ -1398,7 +1391,7 @@ function SidebarRail({ className, ...props }) {
1398
1391
  );
1399
1392
  }
1400
1393
  function SidebarInset({ className, ...props }) {
1401
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1394
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1402
1395
  "main",
1403
1396
  {
1404
1397
  "data-slot": "sidebar-inset",
@@ -1412,7 +1405,7 @@ function SidebarInset({ className, ...props }) {
1412
1405
  );
1413
1406
  }
1414
1407
  function SidebarHeader({ className, ...props }) {
1415
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1408
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1416
1409
  "div",
1417
1410
  {
1418
1411
  "data-slot": "sidebar-header",
@@ -1423,7 +1416,7 @@ function SidebarHeader({ className, ...props }) {
1423
1416
  );
1424
1417
  }
1425
1418
  function SidebarFooter({ className, ...props }) {
1426
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1419
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1427
1420
  "div",
1428
1421
  {
1429
1422
  "data-slot": "sidebar-footer",
@@ -1434,7 +1427,7 @@ function SidebarFooter({ className, ...props }) {
1434
1427
  );
1435
1428
  }
1436
1429
  function SidebarContent({ className, ...props }) {
1437
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1430
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1438
1431
  "div",
1439
1432
  {
1440
1433
  "data-slot": "sidebar-content",
@@ -1448,7 +1441,7 @@ function SidebarContent({ className, ...props }) {
1448
1441
  );
1449
1442
  }
1450
1443
  function SidebarGroup({ className, ...props }) {
1451
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1444
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1452
1445
  "div",
1453
1446
  {
1454
1447
  "data-slot": "sidebar-group",
@@ -1464,7 +1457,7 @@ function SidebarGroupLabel({
1464
1457
  ...props
1465
1458
  }) {
1466
1459
  const Comp = asChild ? import_react_slot3.Slot : "div";
1467
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1460
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1468
1461
  Comp,
1469
1462
  {
1470
1463
  "data-slot": "sidebar-group-label",
@@ -1482,7 +1475,7 @@ function SidebarGroupContent({
1482
1475
  className,
1483
1476
  ...props
1484
1477
  }) {
1485
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1478
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1486
1479
  "div",
1487
1480
  {
1488
1481
  "data-slot": "sidebar-group-content",
@@ -1493,7 +1486,7 @@ function SidebarGroupContent({
1493
1486
  );
1494
1487
  }
1495
1488
  function SidebarMenu({ className, ...props }) {
1496
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1489
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1497
1490
  "ul",
1498
1491
  {
1499
1492
  "data-slot": "sidebar-menu",
@@ -1504,7 +1497,7 @@ function SidebarMenu({ className, ...props }) {
1504
1497
  );
1505
1498
  }
1506
1499
  function SidebarMenuItem({ className, ...props }) {
1507
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1500
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1508
1501
  "li",
1509
1502
  {
1510
1503
  "data-slot": "sidebar-menu-item",
@@ -1545,7 +1538,7 @@ function SidebarMenuButton({
1545
1538
  }) {
1546
1539
  const Comp = asChild ? import_react_slot3.Slot : "button";
1547
1540
  const { isMobile, state } = useSidebar();
1548
- const button = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1541
+ const button = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1549
1542
  Comp,
1550
1543
  {
1551
1544
  "data-slot": "sidebar-menu-button",
@@ -1564,9 +1557,9 @@ function SidebarMenuButton({
1564
1557
  children: tooltip
1565
1558
  };
1566
1559
  }
1567
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Tooltip, { children: [
1568
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipTrigger, { asChild: true, children: button }),
1569
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
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)(
1570
1563
  TooltipContent,
1571
1564
  {
1572
1565
  side: "right",
@@ -1584,7 +1577,7 @@ function SidebarMenuAction({
1584
1577
  ...props
1585
1578
  }) {
1586
1579
  const Comp = asChild ? import_react_slot3.Slot : "button";
1587
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1580
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1588
1581
  Comp,
1589
1582
  {
1590
1583
  "data-slot": "sidebar-menu-action",
@@ -1609,7 +1602,7 @@ function SidebarMenuAction({
1609
1602
  var React5 = __toESM(require("react"), 1);
1610
1603
  var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
1611
1604
  var import_lucide_react4 = require("lucide-react");
1612
- var import_jsx_runtime12 = require("react/jsx-runtime");
1605
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1613
1606
  function cleanupBodyStyles2() {
1614
1607
  if (typeof document !== "undefined" && document.body.style.pointerEvents === "none") {
1615
1608
  document.body.style.pointerEvents = "";
@@ -1633,23 +1626,23 @@ function Dialog({
1633
1626
  cleanupBodyStyles2();
1634
1627
  };
1635
1628
  }, []);
1636
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", open, onOpenChange, ...props });
1629
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", open, onOpenChange, ...props });
1637
1630
  }
1638
1631
  function DialogTrigger({
1639
1632
  ...props
1640
1633
  }) {
1641
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
1634
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
1642
1635
  }
1643
1636
  function DialogPortal({
1644
1637
  ...props
1645
1638
  }) {
1646
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
1639
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
1647
1640
  }
1648
1641
  function DialogOverlay({
1649
1642
  className,
1650
1643
  ...props
1651
1644
  }) {
1652
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1645
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1653
1646
  DialogPrimitive.Overlay,
1654
1647
  {
1655
1648
  "data-slot": "dialog-overlay",
@@ -1670,9 +1663,9 @@ function DialogContent({
1670
1663
  showCloseButton = true,
1671
1664
  ...props
1672
1665
  }) {
1673
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
1674
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DialogOverlay, {}),
1675
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
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)(
1676
1669
  DialogPrimitive.Content,
1677
1670
  {
1678
1671
  "data-slot": "dialog-content",
@@ -1684,14 +1677,14 @@ function DialogContent({
1684
1677
  ...props,
1685
1678
  children: [
1686
1679
  children,
1687
- showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1680
+ showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1688
1681
  DialogPrimitive.Close,
1689
1682
  {
1690
1683
  "data-slot": "dialog-close",
1691
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",
1692
1685
  children: [
1693
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.XIcon, {}),
1694
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "sr-only", children: "Close" })
1686
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react4.XIcon, {}),
1687
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: "Close" })
1695
1688
  ]
1696
1689
  }
1697
1690
  )
@@ -1701,7 +1694,7 @@ function DialogContent({
1701
1694
  ] });
1702
1695
  }
1703
1696
  function DialogHeader({ className, ...props }) {
1704
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1697
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1705
1698
  "div",
1706
1699
  {
1707
1700
  "data-slot": "dialog-header",
@@ -1711,7 +1704,7 @@ function DialogHeader({ className, ...props }) {
1711
1704
  );
1712
1705
  }
1713
1706
  function DialogFooter({ className, ...props }) {
1714
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1707
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1715
1708
  "div",
1716
1709
  {
1717
1710
  "data-slot": "dialog-footer",
@@ -1727,7 +1720,7 @@ function DialogTitle({
1727
1720
  className,
1728
1721
  ...props
1729
1722
  }) {
1730
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1723
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1731
1724
  DialogPrimitive.Title,
1732
1725
  {
1733
1726
  "data-slot": "dialog-title",
@@ -1740,7 +1733,7 @@ function DialogDescription({
1740
1733
  className,
1741
1734
  ...props
1742
1735
  }) {
1743
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1736
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1744
1737
  DialogPrimitive.Description,
1745
1738
  {
1746
1739
  "data-slot": "dialog-description",
@@ -1753,7 +1746,7 @@ function DialogDescription({
1753
1746
  // src/components/ui/alert-dialog.tsx
1754
1747
  var React6 = __toESM(require("react"), 1);
1755
1748
  var AlertDialogPrimitive = __toESM(require("@radix-ui/react-alert-dialog"), 1);
1756
- var import_jsx_runtime13 = require("react/jsx-runtime");
1749
+ var import_jsx_runtime14 = require("react/jsx-runtime");
1757
1750
  function cleanupBodyStyles3() {
1758
1751
  if (typeof document !== "undefined" && document.body.style.pointerEvents === "none") {
1759
1752
  document.body.style.pointerEvents = "";
@@ -1777,18 +1770,18 @@ function AlertDialog({
1777
1770
  cleanupBodyStyles3();
1778
1771
  };
1779
1772
  }, []);
1780
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", open, onOpenChange, ...props });
1773
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", open, onOpenChange, ...props });
1781
1774
  }
1782
1775
  function AlertDialogPortal({
1783
1776
  ...props
1784
1777
  }) {
1785
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props });
1778
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props });
1786
1779
  }
1787
1780
  function AlertDialogOverlay({
1788
1781
  className,
1789
1782
  ...props
1790
1783
  }) {
1791
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1784
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1792
1785
  AlertDialogPrimitive.Overlay,
1793
1786
  {
1794
1787
  "data-slot": "alert-dialog-overlay",
@@ -1807,9 +1800,9 @@ function AlertDialogContent({
1807
1800
  className,
1808
1801
  ...props
1809
1802
  }) {
1810
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(AlertDialogPortal, { children: [
1811
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AlertDialogOverlay, {}),
1812
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
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)(
1813
1806
  AlertDialogPrimitive.Content,
1814
1807
  {
1815
1808
  "data-slot": "alert-dialog-content",
@@ -1826,7 +1819,7 @@ function AlertDialogHeader({
1826
1819
  className,
1827
1820
  ...props
1828
1821
  }) {
1829
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1822
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1830
1823
  "div",
1831
1824
  {
1832
1825
  "data-slot": "alert-dialog-header",
@@ -1839,7 +1832,7 @@ function AlertDialogFooter({
1839
1832
  className,
1840
1833
  ...props
1841
1834
  }) {
1842
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1835
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1843
1836
  "div",
1844
1837
  {
1845
1838
  "data-slot": "alert-dialog-footer",
@@ -1855,7 +1848,7 @@ function AlertDialogTitle({
1855
1848
  className,
1856
1849
  ...props
1857
1850
  }) {
1858
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1851
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1859
1852
  AlertDialogPrimitive.Title,
1860
1853
  {
1861
1854
  "data-slot": "alert-dialog-title",
@@ -1868,7 +1861,7 @@ function AlertDialogDescription({
1868
1861
  className,
1869
1862
  ...props
1870
1863
  }) {
1871
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1864
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1872
1865
  AlertDialogPrimitive.Description,
1873
1866
  {
1874
1867
  "data-slot": "alert-dialog-description",
@@ -1881,7 +1874,7 @@ function AlertDialogAction({
1881
1874
  className,
1882
1875
  ...props
1883
1876
  }) {
1884
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1877
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1885
1878
  AlertDialogPrimitive.Action,
1886
1879
  {
1887
1880
  className: cn(buttonVariants(), className),
@@ -1893,7 +1886,7 @@ function AlertDialogCancel({
1893
1886
  className,
1894
1887
  ...props
1895
1888
  }) {
1896
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1889
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1897
1890
  AlertDialogPrimitive.Cancel,
1898
1891
  {
1899
1892
  className: cn(buttonVariants({ variant: "outline" }), className),
@@ -1905,16 +1898,16 @@ function AlertDialogCancel({
1905
1898
  // src/components/ui/dropdown-menu.tsx
1906
1899
  var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
1907
1900
  var import_lucide_react5 = require("lucide-react");
1908
- var import_jsx_runtime14 = require("react/jsx-runtime");
1901
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1909
1902
  function DropdownMenu({
1910
1903
  ...props
1911
1904
  }) {
1912
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
1905
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
1913
1906
  }
1914
1907
  function DropdownMenuTrigger({
1915
1908
  ...props
1916
1909
  }) {
1917
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1910
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1918
1911
  DropdownMenuPrimitive.Trigger,
1919
1912
  {
1920
1913
  "data-slot": "dropdown-menu-trigger",
@@ -1927,7 +1920,7 @@ function DropdownMenuContent({
1927
1920
  sideOffset = 4,
1928
1921
  ...props
1929
1922
  }) {
1930
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1923
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1931
1924
  DropdownMenuPrimitive.Content,
1932
1925
  {
1933
1926
  "data-slot": "dropdown-menu-content",
@@ -1946,7 +1939,7 @@ function DropdownMenuItem({
1946
1939
  variant = "default",
1947
1940
  ...props
1948
1941
  }) {
1949
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1942
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1950
1943
  DropdownMenuPrimitive.Item,
1951
1944
  {
1952
1945
  "data-slot": "dropdown-menu-item",
@@ -1965,7 +1958,7 @@ function DropdownMenuLabel({
1965
1958
  inset,
1966
1959
  ...props
1967
1960
  }) {
1968
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1961
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1969
1962
  DropdownMenuPrimitive.Label,
1970
1963
  {
1971
1964
  "data-slot": "dropdown-menu-label",
@@ -1982,7 +1975,7 @@ function DropdownMenuSeparator({
1982
1975
  className,
1983
1976
  ...props
1984
1977
  }) {
1985
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1978
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1986
1979
  DropdownMenuPrimitive.Separator,
1987
1980
  {
1988
1981
  "data-slot": "dropdown-menu-separator",
@@ -1997,7 +1990,7 @@ var import_lucide_react7 = require("lucide-react");
1997
1990
 
1998
1991
  // src/components/chat/UserMenu.tsx
1999
1992
  var import_lucide_react6 = require("lucide-react");
2000
- var import_jsx_runtime15 = require("react/jsx-runtime");
1993
+ var import_jsx_runtime16 = require("react/jsx-runtime");
2001
1994
  var getInitials = (name, email) => {
2002
1995
  if (name) {
2003
1996
  return name.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase();
@@ -2032,27 +2025,27 @@ var UserMenu = ({
2032
2025
  };
2033
2026
  const displayName = getDisplayName(user, labels.guest);
2034
2027
  const initials = getInitials(user?.name, user?.email);
2035
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SidebarMenu, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SidebarMenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(DropdownMenu, { children: [
2036
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
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)(
2037
2030
  SidebarMenuButton,
2038
2031
  {
2039
2032
  size: "lg",
2040
2033
  className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
2041
2034
  tooltip: displayName,
2042
2035
  children: [
2043
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Avatar, { className: "h-8 w-8 rounded-lg", children: [
2044
- user?.avatar && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AvatarImage, { src: user.avatar, alt: displayName }),
2045
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AvatarFallback, { className: "rounded-lg bg-primary/10 text-primary text-xs font-medium", children: initials })
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 })
2046
2039
  ] }),
2047
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden", children: [
2048
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "truncate font-medium", children: displayName }),
2049
- user?.email && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "truncate text-xs text-muted-foreground", children: user.email })
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 })
2050
2043
  ] }),
2051
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react6.ChevronsUpDown, { className: "ml-auto size-4 group-data-[collapsible=icon]:hidden" })
2044
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.ChevronsUpDown, { className: "ml-auto size-4 group-data-[collapsible=icon]:hidden" })
2052
2045
  ]
2053
2046
  }
2054
2047
  ) }),
2055
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2048
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2056
2049
  DropdownMenuContent,
2057
2050
  {
2058
2051
  className: "w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg",
@@ -2060,72 +2053,72 @@ var UserMenu = ({
2060
2053
  align: "end",
2061
2054
  sideOffset: 4,
2062
2055
  children: [
2063
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuLabel, { className: "p-0 font-normal", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm", children: [
2064
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Avatar, { className: "h-8 w-8 rounded-lg", children: [
2065
- user?.avatar && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AvatarImage, { src: user.avatar, alt: displayName }),
2066
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AvatarFallback, { className: "rounded-lg bg-primary/10 text-primary text-xs font-medium", children: initials })
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 })
2067
2060
  ] }),
2068
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
2069
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "truncate font-medium", children: displayName }),
2070
- user?.email && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "truncate text-xs text-muted-foreground", children: user.email })
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 })
2071
2064
  ] })
2072
2065
  ] }) }),
2073
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuSeparator, {}),
2074
- callbacks?.onViewProfile && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(DropdownMenuItem, { onClick: callbacks.onViewProfile, children: [
2075
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react6.User, { className: "mr-2 h-4 w-4" }),
2076
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: labels.profile })
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 })
2077
2070
  ] }),
2078
- callbacks?.onOpenSettings && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(DropdownMenuItem, { onClick: callbacks.onOpenSettings, children: [
2079
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react6.Settings, { className: "mr-2 h-4 w-4" }),
2080
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: labels.settings })
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 })
2081
2074
  ] }),
2082
2075
  additionalItems,
2083
- showThemeOptions && callbacks?.onThemeChange && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
2084
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuSeparator, {}),
2085
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
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)(
2086
2079
  DropdownMenuItem,
2087
2080
  {
2088
2081
  onClick: () => callbacks.onThemeChange?.("light"),
2089
2082
  className: currentTheme === "light" ? "bg-accent" : "",
2090
2083
  children: [
2091
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react6.Sun, { className: "mr-2 h-4 w-4" }),
2092
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: labels.lightMode })
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 })
2093
2086
  ]
2094
2087
  }
2095
2088
  ),
2096
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2089
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2097
2090
  DropdownMenuItem,
2098
2091
  {
2099
2092
  onClick: () => callbacks.onThemeChange?.("dark"),
2100
2093
  className: currentTheme === "dark" ? "bg-accent" : "",
2101
2094
  children: [
2102
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react6.Moon, { className: "mr-2 h-4 w-4" }),
2103
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: labels.darkMode })
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 })
2104
2097
  ]
2105
2098
  }
2106
2099
  ),
2107
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2100
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2108
2101
  DropdownMenuItem,
2109
2102
  {
2110
2103
  onClick: () => callbacks.onThemeChange?.("system"),
2111
2104
  className: currentTheme === "system" ? "bg-accent" : "",
2112
2105
  children: [
2113
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react6.Palette, { className: "mr-2 h-4 w-4" }),
2114
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: labels.systemTheme })
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 })
2115
2108
  ]
2116
2109
  }
2117
2110
  )
2118
2111
  ] }),
2119
- callbacks?.onLogout && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
2120
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuSeparator, {}),
2121
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
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)(
2122
2115
  DropdownMenuItem,
2123
2116
  {
2124
2117
  onClick: callbacks.onLogout,
2125
2118
  className: "text-destructive focus:text-destructive focus:bg-destructive/10",
2126
2119
  children: [
2127
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react6.LogOut, { className: "mr-2 h-4 w-4" }),
2128
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: labels.logout })
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 })
2129
2122
  ]
2130
2123
  }
2131
2124
  )
@@ -2137,7 +2130,7 @@ var UserMenu = ({
2137
2130
  };
2138
2131
 
2139
2132
  // src/components/chat/Sidebar.tsx
2140
- var import_jsx_runtime16 = require("react/jsx-runtime");
2133
+ var import_jsx_runtime17 = require("react/jsx-runtime");
2141
2134
  var CreateThreadDialog = ({ config, onCreateThread, trigger }) => {
2142
2135
  const [title, setTitle] = (0, import_react2.useState)("");
2143
2136
  const [isOpen, setIsOpen] = (0, import_react2.useState)(false);
@@ -2146,17 +2139,17 @@ var CreateThreadDialog = ({ config, onCreateThread, trigger }) => {
2146
2139
  setTitle("");
2147
2140
  setIsOpen(false);
2148
2141
  };
2149
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: [
2150
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DialogTrigger, { asChild: true, children: trigger || /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Button, { className: "w-full justify-start", variant: "outline", children: [
2151
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react7.Plus, { className: "mr-2 h-4 w-4" }),
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" }),
2152
2145
  config.labels?.newChat || "New Chat"
2153
2146
  ] }) }),
2154
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DialogContent, { children: [
2155
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DialogHeader, { children: [
2156
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DialogTitle, { children: config.labels?.createNewThread || "New Conversation" }),
2157
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DialogDescription, { children: "Give your new conversation a name or leave blank to auto-generate one." })
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." })
2158
2151
  ] }),
2159
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2152
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2160
2153
  Input,
2161
2154
  {
2162
2155
  value: title,
@@ -2166,16 +2159,16 @@ var CreateThreadDialog = ({ config, onCreateThread, trigger }) => {
2166
2159
  autoFocus: true
2167
2160
  }
2168
2161
  ),
2169
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DialogFooter, { children: [
2170
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "outline", onClick: () => setIsOpen(false), children: config.labels?.cancel || "Cancel" }),
2171
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { onClick: handleCreate, children: config.labels?.create || "Create" })
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" })
2172
2165
  ] })
2173
2166
  ] })
2174
2167
  ] });
2175
2168
  };
2176
2169
  var ThreadInitialsIcon = ({ title }) => {
2177
2170
  const initials = title?.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase() || "?";
2178
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex shrink-0 items-center justify-center rounded bg-muted text-[10px] font-medium", children: initials });
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 });
2179
2172
  };
2180
2173
  var Sidebar2 = ({
2181
2174
  threads,
@@ -2252,38 +2245,38 @@ var Sidebar2 = ({
2252
2245
  const cancelEdit = () => {
2253
2246
  setEditingThreadId(null);
2254
2247
  };
2255
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Sidebar, { collapsible: "icon", ...props, children: [
2256
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(SidebarHeader, { children: [
2257
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-3 px-2 py-3", children: [
2258
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex items-center justify-center shrink-0", children: config.branding?.logo || /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Avatar, { className: "h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AvatarFallback, { className: "bg-primary text-primary-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react7.Bot, { className: "h-4 w-4" }) }) }) }),
2259
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex flex-col min-w-0 group-data-[collapsible=icon]:hidden", children: [
2260
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-sm font-semibold truncate", children: config.branding?.title || "Chat" }),
2261
- config.branding?.subtitle && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-xs text-muted-foreground truncate", children: config.branding.subtitle })
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 })
2262
2255
  ] })
2263
2256
  ] }),
2264
- onCreateThread && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2257
+ onCreateThread && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2265
2258
  CreateThreadDialog,
2266
2259
  {
2267
2260
  config,
2268
2261
  onCreateThread,
2269
- trigger: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SidebarMenu, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SidebarMenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2262
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarMenu, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarMenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2270
2263
  SidebarMenuButton,
2271
2264
  {
2272
2265
  size: "lg",
2273
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",
2274
2267
  tooltip: config.labels?.newChat || "New Chat",
2275
2268
  children: [
2276
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react7.Plus, { className: "size-4" }),
2277
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "group-data-[collapsible=icon]:hidden", children: config.labels?.newChat || "New Chat" })
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" })
2278
2271
  ]
2279
2272
  }
2280
2273
  ) }) })
2281
2274
  }
2282
2275
  ),
2283
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "px-2 py-1 mt-4", children: [
2284
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "relative group-data-[collapsible=icon]:hidden", children: [
2285
- /* @__PURE__ */ (0, import_jsx_runtime16.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" }),
2286
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
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)(
2287
2280
  Input,
2288
2281
  {
2289
2282
  className: "pl-8 h-8 bg-sidebar-accent/50 border-sidebar-border focus-visible:ring-1 focus-visible:ring-sidebar-ring",
@@ -2293,7 +2286,7 @@ var Sidebar2 = ({
2293
2286
  }
2294
2287
  )
2295
2288
  ] }),
2296
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "hidden group-data-[collapsible=icon]:flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2289
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "hidden group-data-[collapsible=icon]:flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2297
2290
  Button,
2298
2291
  {
2299
2292
  variant: "ghost",
@@ -2301,13 +2294,13 @@ var Sidebar2 = ({
2301
2294
  className: "h-7 w-7",
2302
2295
  onClick: () => setOpen(true),
2303
2296
  title: config.labels?.search || "Search",
2304
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react7.Search, { className: "h-4 w-4" })
2297
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Search, { className: "h-4 w-4" })
2305
2298
  }
2306
2299
  ) })
2307
2300
  ] })
2308
2301
  ] }),
2309
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(SidebarContent, { children: [
2310
- threads.some((t) => t.isArchived) && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "px-4 py-2 mt-2 group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
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)(
2311
2304
  Button,
2312
2305
  {
2313
2306
  variant: "ghost",
@@ -2315,18 +2308,18 @@ var Sidebar2 = ({
2315
2308
  onClick: () => setShowArchived(!showArchived),
2316
2309
  className: "h-6 text-xs w-full justify-start text-muted-foreground",
2317
2310
  children: [
2318
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react7.Filter, { className: "mr-2 h-3 w-3" }),
2311
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Filter, { className: "mr-2 h-3 w-3" }),
2319
2312
  showArchived ? config.labels?.hideArchived || "Hide Archived" : config.labels?.showArchived || "Show Archived"
2320
2313
  ]
2321
2314
  }
2322
2315
  ) }),
2323
- Object.keys(groupedThreads).length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "px-4 py-8 text-center text-muted-foreground group-data-[collapsible=icon]:hidden", children: [
2324
- /* @__PURE__ */ (0, import_jsx_runtime16.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_runtime16.jsx)(import_lucide_react7.Plus, { className: "h-4 w-4 opacity-50" }) }),
2325
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-xs", children: searchQuery ? config.labels?.noThreadsFound || "No conversations found" : config.labels?.noThreadsYet || "No conversations yet" })
2326
- ] }) : Object.entries(groupedThreads).map(([group, groupThreads]) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(SidebarGroup, { className: "mt-2", children: [
2327
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SidebarGroupLabel, { className: "group-data-[collapsible=icon]:hidden", children: group }),
2328
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SidebarGroupContent, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SidebarMenu, { children: groupThreads.map((thread) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(SidebarMenuItem, { children: [
2329
- editingThreadId === thread.id ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex items-center gap-1 px-2 py-1", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
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)(
2330
2323
  Input,
2331
2324
  {
2332
2325
  ref: inputRef,
@@ -2339,42 +2332,42 @@ var Sidebar2 = ({
2339
2332
  onBlur: saveEdit,
2340
2333
  className: "h-7 text-sm"
2341
2334
  }
2342
- ) }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2335
+ ) }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2343
2336
  SidebarMenuButton,
2344
2337
  {
2345
2338
  isActive: currentThreadId === thread.id,
2346
2339
  onClick: () => onSelectThread?.(thread.id),
2347
2340
  tooltip: thread.title,
2348
2341
  children: [
2349
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ThreadInitialsIcon, { title: thread.title || "?" }),
2350
- /* @__PURE__ */ (0, import_jsx_runtime16.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_runtime16.jsx)("span", { className: "truncate w-full", children: thread.title || "New Chat" }) }),
2351
- thread.isArchived && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react7.Archive, { className: "ml-auto h-3 w-3 opacity-50 group-data-[collapsible=icon]:hidden" })
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" })
2352
2345
  ]
2353
2346
  }
2354
2347
  ),
2355
- !editingThreadId && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DropdownMenu, { children: [
2356
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(SidebarMenuAction, { showOnHover: true, children: [
2357
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react7.MoreHorizontal, {}),
2358
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "sr-only", children: "More" })
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" })
2359
2352
  ] }) }),
2360
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DropdownMenuContent, { className: "w-48", side: "right", align: "start", children: [
2361
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DropdownMenuItem, { onClick: () => startEditing(thread), children: [
2362
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react7.Edit2, { className: "mr-2 h-4 w-4" }),
2363
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: config.labels?.renameThread || "Rename" })
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" })
2364
2357
  ] }),
2365
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DropdownMenuItem, { onClick: () => onArchiveThread?.(thread.id), children: [
2366
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react7.Archive, { className: "mr-2 h-4 w-4" }),
2367
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: thread.isArchived ? config.labels?.unarchiveThread || "Unarchive" : config.labels?.archiveThread || "Archive" })
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" })
2368
2361
  ] }),
2369
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DropdownMenuSeparator, {}),
2370
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2362
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuSeparator, {}),
2363
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2371
2364
  DropdownMenuItem,
2372
2365
  {
2373
2366
  onClick: () => setDeleteThreadId(thread.id),
2374
2367
  className: "text-destructive focus:text-destructive",
2375
2368
  children: [
2376
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react7.Trash2, { className: "mr-2 h-4 w-4" }),
2377
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: config.labels?.deleteThread || "Delete" })
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" })
2378
2371
  ]
2379
2372
  }
2380
2373
  )
@@ -2383,7 +2376,7 @@ var Sidebar2 = ({
2383
2376
  ] }, thread.id)) }) })
2384
2377
  ] }, group))
2385
2378
  ] }),
2386
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SidebarFooter, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2379
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarFooter, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2387
2380
  UserMenu,
2388
2381
  {
2389
2382
  user,
@@ -2394,15 +2387,15 @@ var Sidebar2 = ({
2394
2387
  additionalItems: userMenuAdditionalItems
2395
2388
  }
2396
2389
  ) }),
2397
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SidebarRail, {}),
2398
- deleteThreadId && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AlertDialog, { open: !!deleteThreadId, onOpenChange: () => setDeleteThreadId(null), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(AlertDialogContent, { children: [
2399
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(AlertDialogHeader, { children: [
2400
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AlertDialogTitle, { children: config.labels?.deleteConfirmTitle || "Delete Conversation" }),
2401
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AlertDialogDescription, { children: config.labels?.deleteConfirmDescription || "Are you sure you want to delete this conversation? This action cannot be undone." })
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." })
2402
2395
  ] }),
2403
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(AlertDialogFooter, { children: [
2404
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AlertDialogCancel, { children: config.labels?.cancel || "Cancel" }),
2405
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
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)(
2406
2399
  AlertDialogAction,
2407
2400
  {
2408
2401
  onClick: () => deleteThreadId && handleDeleteThread(deleteThreadId),
@@ -2418,7 +2411,7 @@ var Sidebar2 = ({
2418
2411
  // src/components/chat/ChatHeader.tsx
2419
2412
  var import_react3 = __toESM(require("react"), 1);
2420
2413
  var import_lucide_react8 = require("lucide-react");
2421
- var import_jsx_runtime17 = require("react/jsx-runtime");
2414
+ var import_jsx_runtime18 = require("react/jsx-runtime");
2422
2415
  var ChatHeader = ({
2423
2416
  config,
2424
2417
  currentThreadTitle,
@@ -2486,52 +2479,52 @@ var ChatHeader = ({
2486
2479
  };
2487
2480
  const selectedAgent = agentOptions.find((agent) => agent.id === selectedAgentId) || null;
2488
2481
  const agentPlaceholder = config.agentSelector?.label || "Select agent";
2489
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2482
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2490
2483
  Card,
2491
2484
  {
2492
2485
  "data-chat-header": true,
2493
2486
  className: `py-0 border-b rounded-none relative z-10 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80 ${className}`,
2494
2487
  style: isMobile ? { paddingTop: "env(safe-area-inset-top)" } : void 0,
2495
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CardHeader, { className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
2496
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-1", children: [
2497
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Tooltip, { children: [
2498
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarTrigger, { className: "-ml-1" }) }),
2499
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TooltipContent, { children: config.labels?.sidebarToggle || "Toggle Sidebar" })
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" })
2500
2493
  ] }),
2501
- showAgentSelector && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenu, { children: [
2502
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
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)(
2503
2496
  Button,
2504
2497
  {
2505
2498
  variant: "ghost",
2506
2499
  className: "h-9 px-3 gap-1.5 font-medium text-base hover:bg-accent/50",
2507
2500
  children: [
2508
- selectedAgent?.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Avatar, { className: "h-5 w-5", children: [
2509
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AvatarImage, { src: selectedAgent.avatarUrl, alt: selectedAgent.name }),
2510
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AvatarFallback, { className: "text-[10px]", children: selectedAgent.name.charAt(0).toUpperCase() })
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() })
2511
2504
  ] }) : null,
2512
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "max-w-[200px] truncate", children: selectedAgent?.name || agentPlaceholder }),
2513
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react8.ChevronDown, { className: "h-4 w-4 opacity-50" })
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" })
2514
2507
  ]
2515
2508
  }
2516
2509
  ) }),
2517
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuContent, { align: "start", className: "w-[280px]", children: agentOptions.map((agent) => {
2510
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuContent, { align: "start", className: "w-[280px]", children: agentOptions.map((agent) => {
2518
2511
  const isSelected = agent.id === selectedAgentId;
2519
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2512
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2520
2513
  DropdownMenuItem,
2521
2514
  {
2522
2515
  onClick: () => onSelectAgent?.(agent.id),
2523
2516
  className: "flex items-start gap-3 p-3 cursor-pointer",
2524
2517
  children: [
2525
- agent.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Avatar, { className: "h-6 w-6 mt-0.5 shrink-0", children: [
2526
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AvatarImage, { src: agent.avatarUrl, alt: agent.name }),
2527
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AvatarFallback, { className: "text-[10px]", children: agent.name.charAt(0).toUpperCase() })
2528
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.jsx)(import_lucide_react8.Bot, { className: "h-3.5 w-3.5 text-primary" }) }),
2529
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex-1 min-w-0", children: [
2530
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2", children: [
2531
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "font-medium text-sm", children: agent.name }),
2532
- isSelected && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react8.Check, { className: "h-4 w-4 text-primary shrink-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" })
2533
2526
  ] }),
2534
- agent.description && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-xs text-muted-foreground mt-0.5 line-clamp-2", children: agent.description })
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 })
2535
2528
  ] })
2536
2529
  ]
2537
2530
  },
@@ -2539,59 +2532,59 @@ var ChatHeader = ({
2539
2532
  );
2540
2533
  }) })
2541
2534
  ] }),
2542
- !showAgentSelector && isMobile && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-medium truncate max-w-[150px] ml-2", children: currentThreadTitle || config.branding?.title || "Chat" })
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" })
2543
2536
  ] }),
2544
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex-1" }),
2545
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-1", children: [
2546
- showCustomComponentButton && config.customComponent && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Tooltip, { children: [
2547
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
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)(
2548
2541
  Button,
2549
2542
  {
2550
2543
  variant: "ghost",
2551
2544
  size: "icon",
2552
2545
  className: "h-8 w-8",
2553
2546
  onClick: onCustomComponentToggle,
2554
- children: config.customComponent.icon || /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react8.Menu, { className: "h-4 w-4" })
2547
+ children: config.customComponent.icon || /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Menu, { className: "h-4 w-4" })
2555
2548
  }
2556
2549
  ) }),
2557
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TooltipContent, { children: config.customComponent.label || config.labels?.customComponentToggle || "Toggle" })
2550
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipContent, { children: config.customComponent.label || config.labels?.customComponentToggle || "Toggle" })
2558
2551
  ] }),
2559
2552
  config.headerActions,
2560
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenu, { children: [
2561
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react8.MoreVertical, { className: "h-4 w-4" }) }) }),
2562
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuContent, { align: "end", children: [
2563
- onNewThread && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
2564
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: () => onNewThread?.(), className: "font-medium text-primary", children: [
2565
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react8.Plus, { className: "h-4 w-4 mr-2" }),
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" }),
2566
2559
  config.labels?.newThread || "New Thread"
2567
2560
  ] }),
2568
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuSeparator, {})
2561
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuSeparator, {})
2569
2562
  ] }),
2570
- onExportData && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onExportData, children: [
2571
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react8.Download, { className: "h-4 w-4 mr-2" }),
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" }),
2572
2565
  config.labels?.exportData || "Export Data"
2573
2566
  ] }),
2574
- onImportData && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: handleImportClick, children: [
2575
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react8.Upload, { className: "h-4 w-4 mr-2" }),
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" }),
2576
2569
  config.labels?.importData || "Import Data"
2577
2570
  ] }),
2578
- (onExportData || onImportData) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuSeparator, {}),
2579
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuItem, { onClick: toggleDarkMode, children: isDarkMode ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
2580
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react8.Sun, { className: "h-4 w-4 mr-2" }),
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" }),
2581
2574
  config.labels?.lightMode || "Light Mode"
2582
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
2583
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react8.Moon, { className: "h-4 w-4 mr-2" }),
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" }),
2584
2577
  config.labels?.darkMode || "Dark Mode"
2585
2578
  ] }) }),
2586
- onClearAll && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
2587
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuSeparator, {}),
2588
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
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)(
2589
2582
  DropdownMenuItem,
2590
2583
  {
2591
2584
  onClick: onClearAll,
2592
2585
  className: "text-destructive",
2593
2586
  children: [
2594
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react8.Trash2, { className: "h-4 w-4 mr-2" }),
2587
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Trash2, { className: "h-4 w-4 mr-2" }),
2595
2588
  config.labels?.clearAll || "Clear All"
2596
2589
  ]
2597
2590
  }
@@ -2610,7 +2603,7 @@ var import_react5 = require("react");
2610
2603
 
2611
2604
  // src/components/chat/UserContext.tsx
2612
2605
  var import_react4 = require("react");
2613
- var import_jsx_runtime18 = require("react/jsx-runtime");
2606
+ var import_jsx_runtime19 = require("react/jsx-runtime");
2614
2607
  var Ctx = (0, import_react4.createContext)(void 0);
2615
2608
  var ChatUserContextProvider = ({ children, initial }) => {
2616
2609
  const [ctx, setCtx] = (0, import_react4.useState)(() => ({
@@ -2636,7 +2629,7 @@ var ChatUserContextProvider = ({ children, initial }) => {
2636
2629
  setContext: setPartial,
2637
2630
  resetContext: () => setCtx({ updatedAt: Date.now() })
2638
2631
  }), [ctx, setPartial]);
2639
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Ctx.Provider, { value, children });
2632
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Ctx.Provider, { value, children });
2640
2633
  };
2641
2634
  function useChatUserContext() {
2642
2635
  const v = (0, import_react4.useContext)(Ctx);
@@ -2646,13 +2639,13 @@ function useChatUserContext() {
2646
2639
 
2647
2640
  // src/components/ui/progress.tsx
2648
2641
  var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"), 1);
2649
- var import_jsx_runtime19 = require("react/jsx-runtime");
2642
+ var import_jsx_runtime20 = require("react/jsx-runtime");
2650
2643
  function Progress({
2651
2644
  className,
2652
2645
  value,
2653
2646
  ...props
2654
2647
  }) {
2655
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2648
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2656
2649
  ProgressPrimitive.Root,
2657
2650
  {
2658
2651
  "data-slot": "progress",
@@ -2661,7 +2654,7 @@ function Progress({
2661
2654
  className
2662
2655
  ),
2663
2656
  ...props,
2664
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2657
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2665
2658
  ProgressPrimitive.Indicator,
2666
2659
  {
2667
2660
  "data-slot": "progress-indicator",
@@ -2675,7 +2668,7 @@ function Progress({
2675
2668
 
2676
2669
  // src/components/chat/ChatInput.tsx
2677
2670
  var import_lucide_react9 = require("lucide-react");
2678
- var import_jsx_runtime20 = require("react/jsx-runtime");
2671
+ var import_jsx_runtime21 = require("react/jsx-runtime");
2679
2672
  var FileUploadItem = (0, import_react5.memo)(function FileUploadItem2({ file, progress, onCancel }) {
2680
2673
  const guessTypeFromName = (name) => {
2681
2674
  const ext = (name || "").split(".").pop()?.toLowerCase();
@@ -2704,10 +2697,10 @@ var FileUploadItem = (0, import_react5.memo)(function FileUploadItem2({ file, pr
2704
2697
  };
2705
2698
  const getFileIcon = (type, name) => {
2706
2699
  const t = typeof type === "string" && type.length > 0 ? type : guessTypeFromName(name);
2707
- if (t.startsWith("image/")) return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.Image, { className: "h-4 w-4" });
2708
- if (t.startsWith("video/")) return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.Video, { className: "h-4 w-4" });
2709
- if (t.startsWith("audio/")) return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.Mic, { className: "h-4 w-4" });
2710
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.FileText, { className: "h-4 w-4" });
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" });
2711
2704
  };
2712
2705
  const formatFileSize = (bytes) => {
2713
2706
  if (bytes === 0) return "0 Bytes";
@@ -2716,21 +2709,21 @@ var FileUploadItem = (0, import_react5.memo)(function FileUploadItem2({ file, pr
2716
2709
  const i = Math.floor(Math.log(bytes) / Math.log(k));
2717
2710
  return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
2718
2711
  };
2719
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Card, { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CardContent, { className: "p-3", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-3", children: [
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: [
2720
2713
  getFileIcon(file.type, file.name),
2721
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex-1 min-w-0", children: [
2722
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm font-medium truncate", children: file.name }),
2723
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-xs text-muted-foreground", children: formatFileSize(file.size ?? 0) }),
2724
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Progress, { value: progress, className: "h-1 mt-1" })
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" })
2725
2718
  ] }),
2726
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2719
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2727
2720
  Button,
2728
2721
  {
2729
2722
  variant: "ghost",
2730
2723
  size: "icon",
2731
2724
  className: "h-6 w-6",
2732
2725
  onClick: onCancel,
2733
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
2726
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
2734
2727
  }
2735
2728
  )
2736
2729
  ] }) }) });
@@ -2754,9 +2747,9 @@ var AttachmentPreview = (0, import_react5.memo)(function AttachmentPreview2({ at
2754
2747
  const minutes = Math.floor(seconds / 60);
2755
2748
  return `${minutes}:${(seconds % 60).toString().padStart(2, "0")}`;
2756
2749
  };
2757
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Card, { className: "relative group", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(CardContent, { className: "p-2", children: [
2758
- attachment.kind === "image" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "relative", children: [
2759
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
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)(
2760
2753
  "img",
2761
2754
  {
2762
2755
  src: attachment.dataUrl,
@@ -2764,19 +2757,19 @@ var AttachmentPreview = (0, import_react5.memo)(function AttachmentPreview2({ at
2764
2757
  className: "w-full h-20 object-cover rounded"
2765
2758
  }
2766
2759
  ),
2767
- /* @__PURE__ */ (0, import_jsx_runtime20.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_runtime20.jsx)(
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)(
2768
2761
  Button,
2769
2762
  {
2770
2763
  variant: "destructive",
2771
2764
  size: "icon",
2772
2765
  className: "h-6 w-6",
2773
2766
  onClick: onRemove,
2774
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
2767
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
2775
2768
  }
2776
2769
  ) })
2777
2770
  ] }),
2778
- attachment.kind === "video" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "relative", children: [
2779
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2771
+ attachment.kind === "video" && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "relative", children: [
2772
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2780
2773
  "video",
2781
2774
  {
2782
2775
  src: attachment.dataUrl,
@@ -2785,34 +2778,34 @@ var AttachmentPreview = (0, import_react5.memo)(function AttachmentPreview2({ at
2785
2778
  muted: true
2786
2779
  }
2787
2780
  ),
2788
- /* @__PURE__ */ (0, import_jsx_runtime20.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_runtime20.jsx)(
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)(
2789
2782
  Button,
2790
2783
  {
2791
2784
  variant: "destructive",
2792
2785
  size: "icon",
2793
2786
  className: "h-6 w-6",
2794
2787
  onClick: onRemove,
2795
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
2788
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
2796
2789
  }
2797
2790
  ) }),
2798
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Badge, { className: "absolute bottom-1 right-1 text-xs", children: formatDuration(attachment.durationMs) })
2791
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Badge, { className: "absolute bottom-1 right-1 text-xs", children: formatDuration(attachment.durationMs) })
2799
2792
  ] }),
2800
- attachment.kind === "audio" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2 p-2", children: [
2801
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
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)(
2802
2795
  Button,
2803
2796
  {
2804
2797
  variant: "outline",
2805
2798
  size: "icon",
2806
2799
  className: "h-8 w-8",
2807
2800
  onClick: handlePlayPause,
2808
- children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.Pause, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.Play, { className: "h-3 w-3" })
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" })
2809
2802
  }
2810
2803
  ),
2811
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex-1", children: [
2812
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-xs font-medium", children: attachment.fileName || "\xC1udio" }),
2813
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-xs text-muted-foreground", children: formatDuration(attachment.durationMs) })
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) })
2814
2807
  ] }),
2815
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2808
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2816
2809
  "audio",
2817
2810
  {
2818
2811
  ref: audioRef,
@@ -2822,18 +2815,18 @@ var AttachmentPreview = (0, import_react5.memo)(function AttachmentPreview2({ at
2822
2815
  onEnded: () => setIsPlaying(false)
2823
2816
  }
2824
2817
  ),
2825
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2818
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2826
2819
  Button,
2827
2820
  {
2828
2821
  variant: "ghost",
2829
2822
  size: "icon",
2830
2823
  className: "h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",
2831
2824
  onClick: onRemove,
2832
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
2825
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
2833
2826
  }
2834
2827
  )
2835
2828
  ] }),
2836
- attachment.fileName && attachment.kind !== "audio" && /* @__PURE__ */ (0, import_jsx_runtime20.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_runtime20.jsx)("p", { className: "truncate", children: attachment.fileName }) })
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 }) })
2837
2830
  ] }) });
2838
2831
  });
2839
2832
  var AudioRecorder = (0, import_react5.memo)(function AudioRecorder2({ isRecording, onStartRecording, onStopRecording, onCancel, recordingDuration, config }) {
@@ -2843,47 +2836,47 @@ var AudioRecorder = (0, import_react5.memo)(function AudioRecorder2({ isRecordin
2843
2836
  return `${mins}:${secs.toString().padStart(2, "0")}`;
2844
2837
  };
2845
2838
  if (!isRecording) {
2846
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Tooltip, { children: [
2847
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
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)(
2848
2841
  Button,
2849
2842
  {
2850
2843
  variant: "outline",
2851
2844
  size: "icon",
2852
2845
  onClick: onStartRecording,
2853
2846
  className: "h-10 w-10",
2854
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.Mic, { className: "h-4 w-4" })
2847
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Mic, { className: "h-4 w-4" })
2855
2848
  }
2856
2849
  ) }),
2857
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipContent, { children: config?.labels?.recordAudioTooltip })
2850
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { children: config?.labels?.recordAudioTooltip })
2858
2851
  ] });
2859
2852
  }
2860
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Card, { className: "border-red-200 bg-red-50 dark:border-red-800 dark:bg-red-950", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CardContent, { className: "p-3", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-3", children: [
2861
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2", children: [
2862
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "h-3 w-3 bg-red-500 rounded-full animate-pulse" }),
2863
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-sm font-medium text-red-700 dark:text-red-300", children: "Gravando" })
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" })
2864
2857
  ] }),
2865
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Badge, { variant: "outline", className: "text-xs", children: formatTime(recordingDuration) }),
2866
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex gap-1 ml-auto", children: [
2867
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
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)(
2868
2861
  Button,
2869
2862
  {
2870
2863
  variant: "outline",
2871
2864
  size: "sm",
2872
2865
  onClick: onCancel,
2873
2866
  children: [
2874
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.X, { className: "h-3 w-3 mr-1" }),
2867
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.X, { className: "h-3 w-3 mr-1" }),
2875
2868
  "Cancelar"
2876
2869
  ]
2877
2870
  }
2878
2871
  ),
2879
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2872
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2880
2873
  Button,
2881
2874
  {
2882
2875
  variant: "default",
2883
2876
  size: "sm",
2884
2877
  onClick: onStopRecording,
2885
2878
  children: [
2886
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.Square, { className: "h-3 w-3 mr-1" }),
2879
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Square, { className: "h-3 w-3 mr-1" }),
2887
2880
  "Parar"
2888
2881
  ]
2889
2882
  }
@@ -3109,8 +3102,8 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
3109
3102
  onAttachmentsChange(newAttachments);
3110
3103
  };
3111
3104
  const canAddMoreAttachments = attachments.length < maxAttachments;
3112
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: `border-t py-0 bg-transparent ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "px-0 md:p-2 pb-1 space-y-4 bg-transparent", children: [
3113
- uploadProgress.size > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "space-y-2", children: Array.from(uploadProgress.entries()).map(([id, progress]) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
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)(
3114
3107
  FileUploadItem,
3115
3108
  {
3116
3109
  file: { name: progress.fileName },
@@ -3125,7 +3118,7 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
3125
3118
  },
3126
3119
  id
3127
3120
  )) }),
3128
- isRecording && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3121
+ isRecording && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3129
3122
  AudioRecorder,
3130
3123
  {
3131
3124
  isRecording,
@@ -3136,7 +3129,7 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
3136
3129
  config
3137
3130
  }
3138
3131
  ),
3139
- attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "grid grid-cols-4 gap-2", children: attachments.map((attachment, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
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)(
3140
3133
  AttachmentPreview,
3141
3134
  {
3142
3135
  attachment,
@@ -3144,15 +3137,15 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
3144
3137
  },
3145
3138
  index
3146
3139
  )) }),
3147
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("form", { onSubmit: handleSubmit, className: "mb-1 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
3140
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("form", { onSubmit: handleSubmit, className: "mb-1 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
3148
3141
  "div",
3149
3142
  {
3150
3143
  className: "flex items-end gap-2 p-3 border rounded-lg bg-background w-full md:min-w-3xl max-w-3xl",
3151
3144
  onDrop: handleDrop,
3152
3145
  onDragOver: handleDragOver,
3153
3146
  children: [
3154
- enableFileUpload && canAddMoreAttachments && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
3155
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3147
+ enableFileUpload && canAddMoreAttachments && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
3148
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3156
3149
  "input",
3157
3150
  {
3158
3151
  ref: fileInputRef,
@@ -3163,8 +3156,8 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
3163
3156
  className: "hidden"
3164
3157
  }
3165
3158
  ),
3166
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Tooltip, { children: [
3167
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
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)(
3168
3161
  Button,
3169
3162
  {
3170
3163
  type: "button",
@@ -3177,13 +3170,13 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
3177
3170
  fileInputRef.current?.click();
3178
3171
  },
3179
3172
  disabled,
3180
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.Paperclip, { className: "h-4 w-4" })
3173
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Paperclip, { className: "h-4 w-4" })
3181
3174
  }
3182
3175
  ) }),
3183
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipContent, { children: config?.labels?.attachFileTooltip })
3176
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { children: config?.labels?.attachFileTooltip })
3184
3177
  ] })
3185
3178
  ] }),
3186
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3179
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3187
3180
  Textarea,
3188
3181
  {
3189
3182
  ref: textareaRef,
@@ -3196,7 +3189,7 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
3196
3189
  rows: 1
3197
3190
  }
3198
3191
  ) }),
3199
- enableAudioRecording && !isRecording && canAddMoreAttachments && !value.trim() && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3192
+ enableAudioRecording && !isRecording && canAddMoreAttachments && !value.trim() && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3200
3193
  AudioRecorder,
3201
3194
  {
3202
3195
  isRecording,
@@ -3207,8 +3200,8 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
3207
3200
  config
3208
3201
  }
3209
3202
  ),
3210
- isGenerating ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Tooltip, { children: [
3211
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
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)(
3212
3205
  Button,
3213
3206
  {
3214
3207
  type: "button",
@@ -3216,36 +3209,36 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
3216
3209
  size: "icon",
3217
3210
  className: "h-10 w-10",
3218
3211
  onClick: onStopGeneration,
3219
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.Square, { className: "h-4 w-4" })
3212
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Square, { className: "h-4 w-4" })
3220
3213
  }
3221
3214
  ) }),
3222
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipContent, { children: config?.labels?.stopGenerationTooltip })
3223
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Tooltip, { children: [
3224
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
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)(
3225
3218
  Button,
3226
3219
  {
3227
3220
  type: "submit",
3228
3221
  size: "icon",
3229
3222
  className: "h-10 w-10",
3230
3223
  disabled: disabled || !value.trim() && attachments.length === 0,
3231
- children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.Send, { className: "h-4 w-4" })
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" })
3232
3225
  }
3233
3226
  ) }),
3234
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipContent, { children: config?.labels?.sendMessageTooltip })
3227
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { children: config?.labels?.sendMessageTooltip })
3235
3228
  ] })
3236
3229
  ]
3237
3230
  }
3238
3231
  ) }),
3239
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "text-[10px] text-muted-foreground text-center", children: [
3232
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "text-[10px] text-muted-foreground text-center", children: [
3240
3233
  window.innerWidth > 768 ? config?.labels?.inputHelpText : "",
3241
- attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
3234
+ attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
3242
3235
  " \u2022 ",
3243
3236
  attachments.length,
3244
3237
  "/",
3245
3238
  maxAttachments,
3246
3239
  " anexos"
3247
3240
  ] }),
3248
- config?.labels?.footerLabel && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
3241
+ config?.labels?.footerLabel && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
3249
3242
  " \u2022 ",
3250
3243
  config.labels.footerLabel
3251
3244
  ] })
@@ -3259,16 +3252,16 @@ var import_react6 = require("react");
3259
3252
  // src/components/ui/scroll-area.tsx
3260
3253
  var React11 = __toESM(require("react"), 1);
3261
3254
  var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"), 1);
3262
- var import_jsx_runtime21 = require("react/jsx-runtime");
3255
+ var import_jsx_runtime22 = require("react/jsx-runtime");
3263
3256
  var ScrollArea = React11.forwardRef(({ className, children, viewportClassName, onScroll, onScrollCapture, ...props }, ref) => {
3264
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
3257
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
3265
3258
  ScrollAreaPrimitive.Root,
3266
3259
  {
3267
3260
  "data-slot": "scroll-area",
3268
3261
  className: cn("relative", className),
3269
3262
  ...props,
3270
3263
  children: [
3271
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3264
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3272
3265
  ScrollAreaPrimitive.Viewport,
3273
3266
  {
3274
3267
  ref,
@@ -3282,8 +3275,8 @@ var ScrollArea = React11.forwardRef(({ className, children, viewportClassName, o
3282
3275
  children
3283
3276
  }
3284
3277
  ),
3285
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ScrollBar, {}),
3286
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ScrollAreaPrimitive.Corner, {})
3278
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ScrollBar, {}),
3279
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ScrollAreaPrimitive.Corner, {})
3287
3280
  ]
3288
3281
  }
3289
3282
  );
@@ -3294,7 +3287,7 @@ function ScrollBar({
3294
3287
  orientation = "vertical",
3295
3288
  ...props
3296
3289
  }) {
3297
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3290
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3298
3291
  ScrollAreaPrimitive.ScrollAreaScrollbar,
3299
3292
  {
3300
3293
  "data-slot": "scroll-area-scrollbar",
@@ -3306,7 +3299,7 @@ function ScrollBar({
3306
3299
  className
3307
3300
  ),
3308
3301
  ...props,
3309
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3302
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3310
3303
  ScrollAreaPrimitive.ScrollAreaThumb,
3311
3304
  {
3312
3305
  "data-slot": "scroll-area-thumb",
@@ -3319,7 +3312,7 @@ function ScrollBar({
3319
3312
 
3320
3313
  // src/components/chat/UserProfile.tsx
3321
3314
  var import_lucide_react10 = require("lucide-react");
3322
- var import_jsx_runtime22 = require("react/jsx-runtime");
3315
+ var import_jsx_runtime23 = require("react/jsx-runtime");
3323
3316
  var getInitials2 = (name, email) => {
3324
3317
  if (name) {
3325
3318
  return name.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase();
@@ -3333,29 +3326,29 @@ var getFieldIcon = (type, key) => {
3333
3326
  const iconClass = "h-4 w-4 text-muted-foreground";
3334
3327
  switch (type) {
3335
3328
  case "email":
3336
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Mail, { className: iconClass });
3329
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Mail, { className: iconClass });
3337
3330
  case "phone":
3338
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Phone, { className: iconClass });
3331
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Phone, { className: iconClass });
3339
3332
  case "url":
3340
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Globe, { className: iconClass });
3333
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Globe, { className: iconClass });
3341
3334
  case "date":
3342
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Calendar, { className: iconClass });
3335
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Calendar, { className: iconClass });
3343
3336
  }
3344
3337
  const lowerKey = key?.toLowerCase() || "";
3345
- if (lowerKey.includes("follower")) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Users, { className: iconClass });
3346
- if (lowerKey.includes("following")) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.UserPlus, { className: iconClass });
3347
- if (lowerKey.includes("post") || lowerKey.includes("publication")) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Image, { className: iconClass });
3348
- if (lowerKey.includes("verified") || lowerKey.includes("badge")) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.BadgeCheck, { className: iconClass });
3349
- if (lowerKey.includes("bio")) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.FileText, { className: iconClass });
3350
- if (lowerKey.includes("email")) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Mail, { className: iconClass });
3351
- if (lowerKey.includes("phone") || lowerKey.includes("tel")) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Phone, { className: iconClass });
3352
- if (lowerKey.includes("location") || lowerKey.includes("address") || lowerKey.includes("city")) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.MapPin, { className: iconClass });
3353
- if (lowerKey.includes("company") || lowerKey.includes("org")) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Building, { className: iconClass });
3354
- if (lowerKey.includes("job") || lowerKey.includes("role") || lowerKey.includes("title") || lowerKey.includes("position")) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Briefcase, { className: iconClass });
3355
- if (lowerKey.includes("website") || lowerKey.includes("url") || lowerKey.includes("link")) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Globe, { className: iconClass });
3356
- if (lowerKey.includes("username") || lowerKey.includes("handle")) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.AtSign, { className: iconClass });
3357
- if (lowerKey.includes("date") || lowerKey.includes("birthday") || lowerKey.includes("joined")) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Calendar, { className: iconClass });
3358
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.User, { className: iconClass });
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 });
3359
3352
  };
3360
3353
  var formatValue = (value, type, key) => {
3361
3354
  if (value === null || value === void 0) return "-";
@@ -3389,15 +3382,15 @@ var getMemoryCategoryIcon = (category) => {
3389
3382
  const iconClass = "h-4 w-4 text-muted-foreground";
3390
3383
  switch (category) {
3391
3384
  case "preference":
3392
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Heart, { className: iconClass });
3385
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Heart, { className: iconClass });
3393
3386
  case "fact":
3394
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Info, { className: iconClass });
3387
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Info, { className: iconClass });
3395
3388
  case "goal":
3396
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Target, { className: iconClass });
3389
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Target, { className: iconClass });
3397
3390
  case "context":
3398
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Lightbulb, { className: iconClass });
3391
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Lightbulb, { className: iconClass });
3399
3392
  default:
3400
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Brain, { className: iconClass });
3393
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Brain, { className: iconClass });
3401
3394
  }
3402
3395
  };
3403
3396
  var getMemoryCategoryLabel = (category) => {
@@ -3467,66 +3460,66 @@ var UserProfile = ({
3467
3460
  const displayName = user?.name || user?.email?.split("@")[0] || "User";
3468
3461
  const initials = getInitials2(user?.name, user?.email);
3469
3462
  const normalizedFields = normalizeCustomFields(customFields);
3470
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Sheet, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
3463
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Sheet, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
3471
3464
  SheetContent,
3472
3465
  {
3473
3466
  side: "right",
3474
3467
  className: cn("w-full sm:max-w-md p-0 flex flex-col h-full overflow-hidden", className),
3475
3468
  children: [
3476
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SheetHeader, { className: "px-6 py-4 border-b shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SheetTitle, { children: labels.title }) }) }),
3477
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ScrollArea, { className: "flex-1 min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "p-6 space-y-6", children: [
3478
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-col items-center text-center space-y-4", children: [
3479
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Avatar, { className: "h-24 w-24 shrink-0", children: [
3480
- user?.avatar && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AvatarImage, { src: user.avatar, alt: displayName }),
3481
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AvatarFallback, { className: "text-2xl bg-primary/10 text-primary", children: initials })
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 })
3482
3475
  ] }),
3483
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "w-full px-2", children: [
3484
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { className: "text-xl font-semibold break-words", children: displayName }),
3485
- user?.email && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-sm text-muted-foreground break-words", children: user.email })
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 })
3486
3479
  ] })
3487
3480
  ] }),
3488
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Separator, {}),
3489
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "space-y-3", children: [
3490
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: labels.basicInfo }),
3491
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "space-y-2", children: [
3492
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
3493
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.User, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
3494
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex-1 min-w-0", children: [
3495
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-xs text-muted-foreground", children: "Name" }),
3496
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-sm font-medium break-words", children: displayName })
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 })
3497
3490
  ] })
3498
3491
  ] }),
3499
- user?.email && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
3500
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.AtSign, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
3501
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex-1 min-w-0", children: [
3502
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-xs text-muted-foreground", children: "Handle" }),
3503
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-sm font-medium break-words", children: user.email })
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 })
3504
3497
  ] })
3505
3498
  ] }),
3506
- user?.id && user.id !== user?.name && user.id !== user?.email && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
3507
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.User, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
3508
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex-1 min-w-0", children: [
3509
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-xs text-muted-foreground", children: "ID" }),
3510
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-sm font-medium break-words", children: user.id })
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 })
3511
3504
  ] })
3512
3505
  ] })
3513
3506
  ] })
3514
3507
  ] }),
3515
- normalizedFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
3516
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Separator, {}),
3517
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "space-y-3", children: [
3518
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: labels.customFields }),
3519
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "space-y-2", children: normalizedFields.map((field) => {
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) => {
3520
3513
  const isBioField = field.key.toLowerCase().includes("bio");
3521
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
3514
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
3522
3515
  "div",
3523
3516
  {
3524
3517
  className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50",
3525
3518
  children: [
3526
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "mt-0.5 shrink-0", children: field.icon || getFieldIcon(field.type, field.key) }),
3527
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex-1 min-w-0", children: [
3528
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-xs text-muted-foreground", children: field.label }),
3529
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: cn(
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(
3530
3523
  "text-sm font-medium",
3531
3524
  isBioField ? "whitespace-pre-wrap break-words" : "break-words"
3532
3525
  ), children: formatValue(field.value, field.type, field.key) })
@@ -3538,26 +3531,26 @@ var UserProfile = ({
3538
3531
  }) })
3539
3532
  ] })
3540
3533
  ] }),
3541
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Separator, {}),
3542
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "space-y-3", children: [
3543
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center justify-between", children: [
3544
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider flex items-center gap-2", children: [
3545
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Brain, { className: "h-4 w-4" }),
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" }),
3546
3539
  labels.memories
3547
3540
  ] }),
3548
- onAddMemory && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3541
+ onAddMemory && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3549
3542
  Button,
3550
3543
  {
3551
3544
  variant: "ghost",
3552
3545
  size: "sm",
3553
3546
  className: "h-7 px-2",
3554
3547
  onClick: () => setIsAddingMemory(true),
3555
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Plus, { className: "h-4 w-4" })
3548
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Plus, { className: "h-4 w-4" })
3556
3549
  }
3557
3550
  )
3558
3551
  ] }),
3559
- isAddingMemory && onAddMemory && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex gap-2", children: [
3560
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3552
+ isAddingMemory && onAddMemory && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex gap-2", children: [
3553
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3561
3554
  Input,
3562
3555
  {
3563
3556
  value: newMemoryContent,
@@ -3574,24 +3567,24 @@ var UserProfile = ({
3574
3567
  autoFocus: true
3575
3568
  }
3576
3569
  ),
3577
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Button, { size: "sm", onClick: handleAddMemory, disabled: !newMemoryContent.trim(), children: "Salvar" })
3570
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Button, { size: "sm", onClick: handleAddMemory, disabled: !newMemoryContent.trim(), children: "Salvar" })
3578
3571
  ] }),
3579
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "space-y-2", children: memories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-sm text-muted-foreground text-center py-4", children: labels.noMemories }) : memories.map((memory) => {
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) => {
3580
3573
  const isEditing = editingMemoryId === memory.id;
3581
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
3574
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
3582
3575
  "div",
3583
3576
  {
3584
3577
  className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50 group",
3585
3578
  children: [
3586
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "mt-0.5 shrink-0", children: memory.source === "agent" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Bot, { className: "h-4 w-4 text-primary" }) : getMemoryCategoryIcon(memory.category) }),
3587
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex-1 min-w-0", children: [
3588
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-2 mb-0.5", children: [
3589
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-xs text-muted-foreground", children: getMemoryCategoryLabel(memory.category) }),
3590
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-xs text-muted-foreground", children: "\u2022" }),
3591
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-xs text-muted-foreground", children: memory.source === "agent" ? "IA" : "Voc\xEA" })
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" })
3592
3585
  ] }),
3593
- isEditing ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "space-y-2", children: [
3594
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3586
+ isEditing ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-2", children: [
3587
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3595
3588
  Textarea,
3596
3589
  {
3597
3590
  value: editingMemoryContent,
@@ -3608,8 +3601,8 @@ var UserProfile = ({
3608
3601
  }
3609
3602
  }
3610
3603
  ),
3611
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex gap-1 justify-end", children: [
3612
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
3604
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex gap-1 justify-end", children: [
3605
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
3613
3606
  Button,
3614
3607
  {
3615
3608
  variant: "ghost",
@@ -3617,12 +3610,12 @@ var UserProfile = ({
3617
3610
  className: "h-7 px-2",
3618
3611
  onClick: handleCancelEdit,
3619
3612
  children: [
3620
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.X, { className: "h-3.5 w-3.5 mr-1" }),
3613
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.X, { className: "h-3.5 w-3.5 mr-1" }),
3621
3614
  "Cancelar"
3622
3615
  ]
3623
3616
  }
3624
3617
  ),
3625
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
3618
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
3626
3619
  Button,
3627
3620
  {
3628
3621
  size: "sm",
@@ -3630,33 +3623,33 @@ var UserProfile = ({
3630
3623
  onClick: handleSaveEdit,
3631
3624
  disabled: !editingMemoryContent.trim(),
3632
3625
  children: [
3633
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Check, { className: "h-3.5 w-3.5 mr-1" }),
3626
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Check, { className: "h-3.5 w-3.5 mr-1" }),
3634
3627
  "Salvar"
3635
3628
  ]
3636
3629
  }
3637
3630
  )
3638
3631
  ] })
3639
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-sm break-words", children: memory.content })
3632
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm break-words", children: memory.content })
3640
3633
  ] }),
3641
- !isEditing && (onUpdateMemory || onDeleteMemory) && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity shrink-0", children: [
3642
- onUpdateMemory && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
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)(
3643
3636
  Button,
3644
3637
  {
3645
3638
  variant: "ghost",
3646
3639
  size: "icon",
3647
3640
  className: "h-7 w-7",
3648
3641
  onClick: () => handleStartEdit(memory),
3649
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Pencil, { className: "h-3.5 w-3.5 text-muted-foreground" })
3642
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Pencil, { className: "h-3.5 w-3.5 text-muted-foreground" })
3650
3643
  }
3651
3644
  ),
3652
- onDeleteMemory && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3645
+ onDeleteMemory && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3653
3646
  Button,
3654
3647
  {
3655
3648
  variant: "ghost",
3656
3649
  size: "icon",
3657
3650
  className: "h-7 w-7",
3658
3651
  onClick: () => onDeleteMemory(memory.id),
3659
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Trash2, { className: "h-3.5 w-3.5 text-destructive" })
3652
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Trash2, { className: "h-3.5 w-3.5 text-destructive" })
3660
3653
  }
3661
3654
  )
3662
3655
  ] })
@@ -3667,8 +3660,8 @@ var UserProfile = ({
3667
3660
  }) })
3668
3661
  ] })
3669
3662
  ] }) }),
3670
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "p-4 border-t space-y-2 shrink-0", children: [
3671
- onEditProfile && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
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)(
3672
3665
  Button,
3673
3666
  {
3674
3667
  variant: "outline",
@@ -3677,7 +3670,7 @@ var UserProfile = ({
3677
3670
  children: "Edit Profile"
3678
3671
  }
3679
3672
  ),
3680
- onLogout && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3673
+ onLogout && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3681
3674
  Button,
3682
3675
  {
3683
3676
  variant: "destructive",
@@ -3694,7 +3687,7 @@ var UserProfile = ({
3694
3687
 
3695
3688
  // src/components/chat/ChatUI.tsx
3696
3689
  var import_lucide_react11 = require("lucide-react");
3697
- var import_jsx_runtime23 = require("react/jsx-runtime");
3690
+ var import_jsx_runtime24 = require("react/jsx-runtime");
3698
3691
  var ChatUI = ({
3699
3692
  messages = [],
3700
3693
  threads = [],
@@ -3702,6 +3695,7 @@ var ChatUI = ({
3702
3695
  config: userConfig,
3703
3696
  sidebar: _sidebar,
3704
3697
  isGenerating = false,
3698
+ isMessagesLoading = false,
3705
3699
  callbacks = {},
3706
3700
  user,
3707
3701
  assistant,
@@ -3717,7 +3711,10 @@ var ChatUI = ({
3717
3711
  initialInput,
3718
3712
  onInitialInputConsumed
3719
3713
  }) => {
3720
- const config = mergeConfig(defaultChatConfig, userConfig);
3714
+ const config = (0, import_react7.useMemo)(
3715
+ () => mergeConfig(defaultChatConfig, userConfig),
3716
+ [userConfig]
3717
+ );
3721
3718
  const [isMobile, setIsMobile] = (0, import_react7.useState)(false);
3722
3719
  const [isUserProfileOpen, setIsUserProfileOpen] = (0, import_react7.useState)(false);
3723
3720
  let userContext;
@@ -3881,13 +3878,13 @@ var ChatUI = ({
3881
3878
  const SuggestionIconComponents = [import_lucide_react11.MessageSquare, import_lucide_react11.Lightbulb, import_lucide_react11.Zap, import_lucide_react11.HelpCircle];
3882
3879
  const renderSuggestions = () => {
3883
3880
  if (messages.length > 0 || !suggestions.length) return null;
3884
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col items-center justify-center min-h-[60vh] py-8 px-4", children: [
3885
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "text-center mb-8", children: [
3886
- /* @__PURE__ */ (0, import_jsx_runtime23.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_runtime23.jsx)(import_lucide_react11.Sparkles, { className: "w-7 h-7 text-primary" }) }),
3887
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h2", { className: "text-xl font-semibold mb-2", children: config.branding.title }),
3888
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-muted-foreground text-sm max-w-md", children: config.branding.subtitle })
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 })
3889
3886
  ] }),
3890
- /* @__PURE__ */ (0, import_jsx_runtime23.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_runtime23.jsxs)(
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)(
3891
3888
  "button",
3892
3889
  {
3893
3890
  type: "button",
@@ -3896,10 +3893,10 @@ var ChatUI = ({
3896
3893
  children: [
3897
3894
  (() => {
3898
3895
  const IconComponent = SuggestionIconComponents[index % SuggestionIconComponents.length];
3899
- return /* @__PURE__ */ (0, import_jsx_runtime23.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_runtime23.jsx)(IconComponent, { className: "h-4 w-4" }) });
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" }) });
3900
3897
  })(),
3901
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex-1 min-w-0 pr-6", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm font-medium leading-snug line-clamp-2", children: suggestion }) }),
3902
- /* @__PURE__ */ (0, import_jsx_runtime23.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" })
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" })
3903
3900
  ]
3904
3901
  },
3905
3902
  index
@@ -3909,25 +3906,100 @@ var ChatUI = ({
3909
3906
  const renderInlineSuggestions = (messageId) => {
3910
3907
  const items = messageSuggestions?.[messageId];
3911
3908
  if (!items || items.length === 0) return null;
3912
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex flex-wrap gap-2 mt-2 ml-11", children: items.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
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)(
3913
3910
  "button",
3914
3911
  {
3915
3912
  type: "button",
3916
3913
  onClick: () => handleSendMessage(suggestion),
3917
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",
3918
3915
  children: [
3919
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Sparkles, { className: "h-3 w-3 text-primary opacity-70 group-hover:opacity-100" }),
3920
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "max-w-[200px] truncate", children: suggestion })
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 })
3921
3918
  ]
3922
3919
  },
3923
3920
  `${messageId}-suggestion-${index}`
3924
3921
  )) });
3925
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
+ ]);
3926
3998
  const shouldShowAgentSelector = Boolean(
3927
3999
  config.agentSelector?.enabled && onSelectAgent && agentOptions.length > 0 && (!config.agentSelector?.hideIfSingle || agentOptions.length > 1)
3928
4000
  );
3929
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SidebarProvider, { defaultOpen: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: `flex h-[100svh] md:h-screen bg-background w-full overflow-hidden ${className}`, children: [
3930
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
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)(
3931
4003
  Sidebar2,
3932
4004
  {
3933
4005
  threads,
@@ -3957,8 +4029,8 @@ var ChatUI = ({
3957
4029
  showThemeOptions: !!callbacks.onThemeChange
3958
4030
  }
3959
4031
  ),
3960
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SidebarInset, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col h-full min-h-0", children: [
3961
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
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)(
3962
4034
  ChatHeader,
3963
4035
  {
3964
4036
  config,
@@ -3973,50 +4045,22 @@ var ChatUI = ({
3973
4045
  onSelectAgent
3974
4046
  }
3975
4047
  ),
3976
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-1 flex-row min-h-0 overflow-hidden", children: [
3977
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex-1 flex flex-col min-h-0", children: [
3978
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
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)(
3979
4051
  ScrollArea,
3980
4052
  {
3981
4053
  ref: scrollAreaRef,
3982
4054
  className: "flex-1 min-h-0",
3983
4055
  viewportClassName: "p-4 overscroll-contain",
3984
4056
  onScrollCapture: handleScroll,
3985
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "max-w-4xl mx-auto space-y-4 pb-4", children: [
3986
- renderSuggestions(),
3987
- messages.map((message, index) => {
3988
- const prevMessage = index > 0 ? messages[index - 1] : null;
3989
- const isGrouped = prevMessage !== null && prevMessage.role === message.role;
3990
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: isGrouped ? "space-y-1 -mt-2" : "space-y-2", children: [
3991
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3992
- Message,
3993
- {
3994
- message,
3995
- userAvatar: user?.avatar,
3996
- userName: user?.name,
3997
- assistantAvatar: assistant?.avatar,
3998
- assistantName: assistant?.name,
3999
- showTimestamp: config.ui.showTimestamps,
4000
- showAvatar: config.ui.showAvatars,
4001
- enableCopy: config.features.enableMessageCopy,
4002
- enableEdit: config.features.enableMessageEditing,
4003
- enableRegenerate: config.features.enableRegeneration,
4004
- enableToolCallsDisplay: config.features.enableToolCallsDisplay,
4005
- compactMode: config.ui.compactMode,
4006
- onAction: handleMessageAction,
4007
- toolUsedLabel: config.labels.toolUsed,
4008
- thinkingLabel: config.labels.thinking,
4009
- isGrouped
4010
- }
4011
- ),
4012
- message.role === "assistant" && renderInlineSuggestions(message.id)
4013
- ] }, message.id);
4014
- }),
4015
- /* @__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 })
4016
4060
  ] })
4017
4061
  }
4018
4062
  ),
4019
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "bg-background pb-[env(safe-area-inset-bottom)]", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4063
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "bg-background pb-[env(safe-area-inset-bottom)]", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4020
4064
  ChatInput,
4021
4065
  {
4022
4066
  value: inputValue,
@@ -4042,17 +4086,17 @@ var ChatUI = ({
4042
4086
  }
4043
4087
  ) })
4044
4088
  ] }),
4045
- config?.customComponent?.component && !isMobile && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4089
+ config?.customComponent?.component && !isMobile && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4046
4090
  "div",
4047
4091
  {
4048
4092
  className: `h-full transition-all duration-300 ease-in-out overflow-hidden ${state.showSidebar ? "w-80" : "w-0"}`,
4049
- children: state.showSidebar && /* @__PURE__ */ (0, import_jsx_runtime23.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() })
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() })
4050
4094
  }
4051
4095
  )
4052
4096
  ] })
4053
4097
  ] }) }),
4054
- isCustomMounted && config.customComponent?.component && isMobile && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "fixed inset-0 z-50", children: [
4055
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
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)(
4056
4100
  "div",
4057
4101
  {
4058
4102
  className: `absolute inset-0 bg-background/80 backdrop-blur-sm transition-opacity duration-200 ease-out ${isCustomVisible ? "opacity-100" : "opacity-0"}`,
@@ -4060,16 +4104,16 @@ var ChatUI = ({
4060
4104
  onClick: closeSidebar
4061
4105
  }
4062
4106
  ),
4063
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4107
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4064
4108
  "div",
4065
4109
  {
4066
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"}`,
4067
4111
  style: { willChange: "transform" },
4068
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "h-full flex flex-col", children: renderCustomComponent() })
4112
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-full flex flex-col", children: renderCustomComponent() })
4069
4113
  }
4070
4114
  )
4071
4115
  ] }),
4072
- isUserProfileOpen && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4116
+ isUserProfileOpen && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4073
4117
  UserProfile,
4074
4118
  {
4075
4119
  isOpen: isUserProfileOpen,
@@ -4094,7 +4138,7 @@ var ChatUI = ({
4094
4138
  // src/components/chat/ThreadManager.tsx
4095
4139
  var import_react8 = require("react");
4096
4140
  var import_lucide_react12 = require("lucide-react");
4097
- var import_jsx_runtime24 = require("react/jsx-runtime");
4141
+ var import_jsx_runtime25 = require("react/jsx-runtime");
4098
4142
  var ThreadItem = ({ thread, isActive, config, onSelect, onRename, onDelete, onArchive }) => {
4099
4143
  const [isEditing, setIsEditing] = (0, import_react8.useState)(false);
4100
4144
  const [editTitle, setEditTitle] = (0, import_react8.useState)(thread.title);
@@ -4123,9 +4167,9 @@ var ThreadItem = ({ thread, isActive, config, onSelect, onRename, onDelete, onAr
4123
4167
  handleCancelEdit();
4124
4168
  }
4125
4169
  };
4126
- return /* @__PURE__ */ (0, import_jsx_runtime24.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_runtime24.jsx)(CardContent, { className: "p-3 max-w-sm", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
4127
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex-1 min-w-0", onClick: onSelect, children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2", children: [
4128
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
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)(
4129
4173
  Input,
4130
4174
  {
4131
4175
  ref: inputRef,
@@ -4137,44 +4181,44 @@ var ThreadItem = ({ thread, isActive, config, onSelect, onRename, onDelete, onAr
4137
4181
  placeholder: config?.labels?.threadNamePlaceholder || "Conversation name"
4138
4182
  }
4139
4183
  ),
4140
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { size: "sm", variant: "ghost", onClick: handleSaveEdit, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Check, { className: "h-3 w-3" }) }),
4141
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { size: "sm", variant: "ghost", onClick: handleCancelEdit, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.X, { className: "h-3 w-3" }) })
4142
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
4143
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h4", { className: "font-medium text-sm truncate mb-1", children: thread.title }),
4144
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
4145
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-1", children: [
4146
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Hash, { className: "h-3 w-3" }),
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" }),
4147
4191
  thread.messageCount,
4148
4192
  " msgs"
4149
4193
  ] }),
4150
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Separator, { orientation: "vertical", className: "h-3" }),
4151
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-1", children: [
4152
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Calendar, { className: "h-3 w-3" }),
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" }),
4153
4197
  formatDate(thread.updatedAt, config?.labels)
4154
4198
  ] }),
4155
- thread.isArchived && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
4156
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Separator, { orientation: "vertical", className: "h-3" }),
4157
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Badge, { variant: "secondary", className: "text-xs", children: [
4158
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Archive, { className: "h-2 w-2 mr-1" }),
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" }),
4159
4203
  config?.labels?.archiveThread || "Archived"
4160
4204
  ] })
4161
4205
  ] })
4162
4206
  ] })
4163
4207
  ] }) }),
4164
- !isEditing && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DropdownMenu, { children: [
4165
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { variant: "ghost", size: "icon", className: "h-6 w-6 m-auto", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.MoreVertical, { className: "h-3 w-3" }) }) }),
4166
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DropdownMenuContent, { align: "end", children: [
4167
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DropdownMenuItem, { onClick: () => setIsEditing(true), children: [
4168
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Edit2, { className: "h-4 w-4 mr-2" }),
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" }),
4169
4213
  config?.labels?.renameThread || "Rename"
4170
4214
  ] }),
4171
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DropdownMenuItem, { onClick: onArchive, children: [
4172
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Archive, { className: "h-4 w-4 mr-2" }),
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" }),
4173
4217
  thread.isArchived ? config?.labels?.unarchiveThread || "Unarchive" : config?.labels?.archiveThread || "Archive"
4174
4218
  ] }),
4175
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenuSeparator, {}),
4176
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DropdownMenuItem, { onClick: onDelete, className: "text-destructive", children: [
4177
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Trash2, { className: "h-4 w-4 mr-2" }),
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" }),
4178
4222
  config?.labels?.deleteThread || "Delete"
4179
4223
  ] })
4180
4224
  ] })
@@ -4189,17 +4233,17 @@ var CreateThreadDialog2 = ({ onCreateThread, config }) => {
4189
4233
  setTitle("");
4190
4234
  setIsOpen(false);
4191
4235
  };
4192
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: [
4193
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Button, { variant: "outline", className: "w-full", children: [
4194
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Plus, { className: "h-4 w-4 mr-2" }),
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" }),
4195
4239
  config?.labels?.createNewThread || "New Conversation"
4196
4240
  ] }) }),
4197
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogContent, { children: [
4198
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogHeader, { children: [
4199
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogTitle, { children: config?.labels?.createNewThread || "Create New Conversation" }),
4200
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogDescription, { children: "Give your new conversation a name or leave blank to auto-generate one." })
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." })
4201
4245
  ] }),
4202
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4246
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4203
4247
  Input,
4204
4248
  {
4205
4249
  value: title,
@@ -4209,9 +4253,9 @@ var CreateThreadDialog2 = ({ onCreateThread, config }) => {
4209
4253
  autoFocus: true
4210
4254
  }
4211
4255
  ),
4212
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogFooter, { children: [
4213
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { variant: "outline", onClick: () => setIsOpen(false), children: config?.labels?.cancel || "Cancel" }),
4214
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { onClick: handleCreate, children: config?.labels?.create || "Create" })
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" })
4215
4259
  ] })
4216
4260
  ] })
4217
4261
  ] });
@@ -4265,20 +4309,20 @@ var ThreadManager = ({
4265
4309
  setDeleteThreadId(null);
4266
4310
  };
4267
4311
  if (!isOpen) return null;
4268
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: `fixed inset-0 z-50 bg-background/80 backdrop-blur-sm ${className}`, children: [
4269
- /* @__PURE__ */ (0, import_jsx_runtime24.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_runtime24.jsxs)(Card, { className: "h-full border-0 rounded-none", children: [
4270
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(CardHeader, { className: "border-b", children: [
4271
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center justify-between", children: [
4272
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(CardTitle, { className: "flex items-center gap-2", children: [
4273
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.MessageSquare, { className: "h-5 w-5" }),
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" }),
4274
4318
  config?.labels?.newChat || "Conversations"
4275
4319
  ] }),
4276
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { variant: "ghost", size: "icon", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.X, { className: "h-4 w-4" }) })
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" }) })
4277
4321
  ] }),
4278
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-3", children: [
4279
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "relative", children: [
4280
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
4281
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
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)(
4282
4326
  Input,
4283
4327
  {
4284
4328
  placeholder: config?.labels?.search || "Search conversations...",
@@ -4288,8 +4332,8 @@ var ThreadManager = ({
4288
4332
  }
4289
4333
  )
4290
4334
  ] }),
4291
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center justify-between", children: [
4292
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
4335
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center justify-between", children: [
4336
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
4293
4337
  Button,
4294
4338
  {
4295
4339
  variant: "outline",
@@ -4297,12 +4341,12 @@ var ThreadManager = ({
4297
4341
  onClick: () => setShowArchived(!showArchived),
4298
4342
  className: "text-xs",
4299
4343
  children: [
4300
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Filter, { className: "h-3 w-3 mr-1" }),
4344
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Filter, { className: "h-3 w-3 mr-1" }),
4301
4345
  showArchived ? config?.labels?.hideArchived || "Hide Archived" : config?.labels?.showArchived || "Show Archived"
4302
4346
  ]
4303
4347
  }
4304
4348
  ),
4305
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Badge, { variant: "secondary", className: "text-xs", children: [
4349
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Badge, { variant: "secondary", className: "text-xs", children: [
4306
4350
  filteredThreads.length,
4307
4351
  " / ",
4308
4352
  threads.length
@@ -4310,14 +4354,14 @@ var ThreadManager = ({
4310
4354
  ] })
4311
4355
  ] })
4312
4356
  ] }),
4313
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(CardContent, { className: "p-0 flex-1", children: [
4314
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "p-4", children: onCreateThread && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CreateThreadDialog2, { onCreateThread, config }) }),
4315
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ScrollArea, { className: "h-[calc(100vh-280px)]", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "px-4 pb-4 space-y-4", children: Object.keys(groupedThreads).length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "text-center py-8 text-muted-foreground", children: [
4316
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.MessageSquare, { className: "h-12 w-12 mx-auto mb-3 opacity-50" }),
4317
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm", children: searchQuery ? config?.labels?.noThreadsFound || "No conversations found" : config?.labels?.noThreadsYet || "No conversations yet" })
4318
- ] }) : Object.entries(groupedThreads).map(([group, groupThreads]) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
4319
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h3", { className: "text-sm font-medium text-muted-foreground mb-2 px-2", children: group }),
4320
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "space-y-2", children: groupThreads.map((thread) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
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)(
4321
4365
  ThreadItem,
4322
4366
  {
4323
4367
  thread,
@@ -4333,14 +4377,14 @@ var ThreadManager = ({
4333
4377
  ] }, group)) }) })
4334
4378
  ] })
4335
4379
  ] }) }),
4336
- deleteThreadId && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AlertDialog, { open: !!deleteThreadId, onOpenChange: () => setDeleteThreadId(null), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(AlertDialogContent, { children: [
4337
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(AlertDialogHeader, { children: [
4338
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AlertDialogTitle, { children: config?.labels?.deleteConfirmTitle || "Delete Conversation" }),
4339
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AlertDialogDescription, { children: config?.labels?.deleteConfirmDescription || "Are you sure you want to delete this conversation? This action cannot be undone." })
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." })
4340
4384
  ] }),
4341
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(AlertDialogFooter, { children: [
4342
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AlertDialogCancel, { children: config?.labels?.cancel || "Cancel" }),
4343
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
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)(
4344
4388
  AlertDialogAction,
4345
4389
  {
4346
4390
  onClick: () => deleteThreadId && handleDeleteThread(deleteThreadId),