@copilotz/chat-ui 0.1.1 → 0.1.2
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 +568 -533
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +430 -395
- package/dist/index.js.map +1 -1
- package/dist/styles.css +9 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1123,8 +1123,21 @@ function SheetDescription({
|
|
|
1123
1123
|
);
|
|
1124
1124
|
}
|
|
1125
1125
|
|
|
1126
|
+
// src/components/ui/skeleton.tsx
|
|
1127
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1128
|
+
function Skeleton({ className, ...props }) {
|
|
1129
|
+
return /* @__PURE__ */ jsx11(
|
|
1130
|
+
"div",
|
|
1131
|
+
{
|
|
1132
|
+
"data-slot": "skeleton",
|
|
1133
|
+
className: cn("bg-accent animate-pulse rounded-md", className),
|
|
1134
|
+
...props
|
|
1135
|
+
}
|
|
1136
|
+
);
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1126
1139
|
// src/components/ui/sidebar.tsx
|
|
1127
|
-
import { jsx as
|
|
1140
|
+
import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1128
1141
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
1129
1142
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
1130
1143
|
var SIDEBAR_WIDTH = "16rem";
|
|
@@ -1190,7 +1203,7 @@ function SidebarProvider({
|
|
|
1190
1203
|
}),
|
|
1191
1204
|
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
1192
1205
|
);
|
|
1193
|
-
return /* @__PURE__ */
|
|
1206
|
+
return /* @__PURE__ */ jsx12(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx12(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx12(
|
|
1194
1207
|
"div",
|
|
1195
1208
|
{
|
|
1196
1209
|
"data-slot": "sidebar-wrapper",
|
|
@@ -1218,7 +1231,7 @@ function Sidebar({
|
|
|
1218
1231
|
}) {
|
|
1219
1232
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
1220
1233
|
if (collapsible === "none") {
|
|
1221
|
-
return /* @__PURE__ */
|
|
1234
|
+
return /* @__PURE__ */ jsx12(
|
|
1222
1235
|
"div",
|
|
1223
1236
|
{
|
|
1224
1237
|
"data-slot": "sidebar",
|
|
@@ -1232,7 +1245,7 @@ function Sidebar({
|
|
|
1232
1245
|
);
|
|
1233
1246
|
}
|
|
1234
1247
|
if (isMobile) {
|
|
1235
|
-
return /* @__PURE__ */
|
|
1248
|
+
return /* @__PURE__ */ jsx12(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs4(
|
|
1236
1249
|
SheetContent,
|
|
1237
1250
|
{
|
|
1238
1251
|
"data-sidebar": "sidebar",
|
|
@@ -1245,10 +1258,10 @@ function Sidebar({
|
|
|
1245
1258
|
side,
|
|
1246
1259
|
children: [
|
|
1247
1260
|
/* @__PURE__ */ jsxs4(SheetHeader, { className: "sr-only", children: [
|
|
1248
|
-
/* @__PURE__ */
|
|
1249
|
-
/* @__PURE__ */
|
|
1261
|
+
/* @__PURE__ */ jsx12(SheetTitle, { children: "Sidebar" }),
|
|
1262
|
+
/* @__PURE__ */ jsx12(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
1250
1263
|
] }),
|
|
1251
|
-
/* @__PURE__ */
|
|
1264
|
+
/* @__PURE__ */ jsx12("div", { className: "flex h-full w-full flex-col", children })
|
|
1252
1265
|
]
|
|
1253
1266
|
}
|
|
1254
1267
|
) });
|
|
@@ -1263,7 +1276,7 @@ function Sidebar({
|
|
|
1263
1276
|
"data-side": side,
|
|
1264
1277
|
"data-slot": "sidebar",
|
|
1265
1278
|
children: [
|
|
1266
|
-
/* @__PURE__ */
|
|
1279
|
+
/* @__PURE__ */ jsx12(
|
|
1267
1280
|
"div",
|
|
1268
1281
|
{
|
|
1269
1282
|
"data-slot": "sidebar-gap",
|
|
@@ -1275,7 +1288,7 @@ function Sidebar({
|
|
|
1275
1288
|
)
|
|
1276
1289
|
}
|
|
1277
1290
|
),
|
|
1278
|
-
/* @__PURE__ */
|
|
1291
|
+
/* @__PURE__ */ jsx12(
|
|
1279
1292
|
"div",
|
|
1280
1293
|
{
|
|
1281
1294
|
"data-slot": "sidebar-container",
|
|
@@ -1287,7 +1300,7 @@ function Sidebar({
|
|
|
1287
1300
|
className
|
|
1288
1301
|
),
|
|
1289
1302
|
...props,
|
|
1290
|
-
children: /* @__PURE__ */
|
|
1303
|
+
children: /* @__PURE__ */ jsx12(
|
|
1291
1304
|
"div",
|
|
1292
1305
|
{
|
|
1293
1306
|
"data-sidebar": "sidebar",
|
|
@@ -1322,15 +1335,15 @@ function SidebarTrigger({
|
|
|
1322
1335
|
},
|
|
1323
1336
|
...props,
|
|
1324
1337
|
children: [
|
|
1325
|
-
/* @__PURE__ */
|
|
1326
|
-
/* @__PURE__ */
|
|
1338
|
+
/* @__PURE__ */ jsx12(PanelLeftIcon, {}),
|
|
1339
|
+
/* @__PURE__ */ jsx12("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
1327
1340
|
]
|
|
1328
1341
|
}
|
|
1329
1342
|
);
|
|
1330
1343
|
}
|
|
1331
1344
|
function SidebarRail({ className, ...props }) {
|
|
1332
1345
|
const { toggleSidebar } = useSidebar();
|
|
1333
|
-
return /* @__PURE__ */
|
|
1346
|
+
return /* @__PURE__ */ jsx12(
|
|
1334
1347
|
"button",
|
|
1335
1348
|
{
|
|
1336
1349
|
"data-sidebar": "rail",
|
|
@@ -1353,7 +1366,7 @@ function SidebarRail({ className, ...props }) {
|
|
|
1353
1366
|
);
|
|
1354
1367
|
}
|
|
1355
1368
|
function SidebarInset({ className, ...props }) {
|
|
1356
|
-
return /* @__PURE__ */
|
|
1369
|
+
return /* @__PURE__ */ jsx12(
|
|
1357
1370
|
"main",
|
|
1358
1371
|
{
|
|
1359
1372
|
"data-slot": "sidebar-inset",
|
|
@@ -1367,7 +1380,7 @@ function SidebarInset({ className, ...props }) {
|
|
|
1367
1380
|
);
|
|
1368
1381
|
}
|
|
1369
1382
|
function SidebarHeader({ className, ...props }) {
|
|
1370
|
-
return /* @__PURE__ */
|
|
1383
|
+
return /* @__PURE__ */ jsx12(
|
|
1371
1384
|
"div",
|
|
1372
1385
|
{
|
|
1373
1386
|
"data-slot": "sidebar-header",
|
|
@@ -1378,7 +1391,7 @@ function SidebarHeader({ className, ...props }) {
|
|
|
1378
1391
|
);
|
|
1379
1392
|
}
|
|
1380
1393
|
function SidebarFooter({ className, ...props }) {
|
|
1381
|
-
return /* @__PURE__ */
|
|
1394
|
+
return /* @__PURE__ */ jsx12(
|
|
1382
1395
|
"div",
|
|
1383
1396
|
{
|
|
1384
1397
|
"data-slot": "sidebar-footer",
|
|
@@ -1389,7 +1402,7 @@ function SidebarFooter({ className, ...props }) {
|
|
|
1389
1402
|
);
|
|
1390
1403
|
}
|
|
1391
1404
|
function SidebarContent({ className, ...props }) {
|
|
1392
|
-
return /* @__PURE__ */
|
|
1405
|
+
return /* @__PURE__ */ jsx12(
|
|
1393
1406
|
"div",
|
|
1394
1407
|
{
|
|
1395
1408
|
"data-slot": "sidebar-content",
|
|
@@ -1403,7 +1416,7 @@ function SidebarContent({ className, ...props }) {
|
|
|
1403
1416
|
);
|
|
1404
1417
|
}
|
|
1405
1418
|
function SidebarGroup({ className, ...props }) {
|
|
1406
|
-
return /* @__PURE__ */
|
|
1419
|
+
return /* @__PURE__ */ jsx12(
|
|
1407
1420
|
"div",
|
|
1408
1421
|
{
|
|
1409
1422
|
"data-slot": "sidebar-group",
|
|
@@ -1419,7 +1432,7 @@ function SidebarGroupLabel({
|
|
|
1419
1432
|
...props
|
|
1420
1433
|
}) {
|
|
1421
1434
|
const Comp = asChild ? Slot3 : "div";
|
|
1422
|
-
return /* @__PURE__ */
|
|
1435
|
+
return /* @__PURE__ */ jsx12(
|
|
1423
1436
|
Comp,
|
|
1424
1437
|
{
|
|
1425
1438
|
"data-slot": "sidebar-group-label",
|
|
@@ -1437,7 +1450,7 @@ function SidebarGroupContent({
|
|
|
1437
1450
|
className,
|
|
1438
1451
|
...props
|
|
1439
1452
|
}) {
|
|
1440
|
-
return /* @__PURE__ */
|
|
1453
|
+
return /* @__PURE__ */ jsx12(
|
|
1441
1454
|
"div",
|
|
1442
1455
|
{
|
|
1443
1456
|
"data-slot": "sidebar-group-content",
|
|
@@ -1448,7 +1461,7 @@ function SidebarGroupContent({
|
|
|
1448
1461
|
);
|
|
1449
1462
|
}
|
|
1450
1463
|
function SidebarMenu({ className, ...props }) {
|
|
1451
|
-
return /* @__PURE__ */
|
|
1464
|
+
return /* @__PURE__ */ jsx12(
|
|
1452
1465
|
"ul",
|
|
1453
1466
|
{
|
|
1454
1467
|
"data-slot": "sidebar-menu",
|
|
@@ -1459,7 +1472,7 @@ function SidebarMenu({ className, ...props }) {
|
|
|
1459
1472
|
);
|
|
1460
1473
|
}
|
|
1461
1474
|
function SidebarMenuItem({ className, ...props }) {
|
|
1462
|
-
return /* @__PURE__ */
|
|
1475
|
+
return /* @__PURE__ */ jsx12(
|
|
1463
1476
|
"li",
|
|
1464
1477
|
{
|
|
1465
1478
|
"data-slot": "sidebar-menu-item",
|
|
@@ -1500,7 +1513,7 @@ function SidebarMenuButton({
|
|
|
1500
1513
|
}) {
|
|
1501
1514
|
const Comp = asChild ? Slot3 : "button";
|
|
1502
1515
|
const { isMobile, state } = useSidebar();
|
|
1503
|
-
const button = /* @__PURE__ */
|
|
1516
|
+
const button = /* @__PURE__ */ jsx12(
|
|
1504
1517
|
Comp,
|
|
1505
1518
|
{
|
|
1506
1519
|
"data-slot": "sidebar-menu-button",
|
|
@@ -1520,8 +1533,8 @@ function SidebarMenuButton({
|
|
|
1520
1533
|
};
|
|
1521
1534
|
}
|
|
1522
1535
|
return /* @__PURE__ */ jsxs4(Tooltip, { children: [
|
|
1523
|
-
/* @__PURE__ */
|
|
1524
|
-
/* @__PURE__ */
|
|
1536
|
+
/* @__PURE__ */ jsx12(TooltipTrigger, { asChild: true, children: button }),
|
|
1537
|
+
/* @__PURE__ */ jsx12(
|
|
1525
1538
|
TooltipContent,
|
|
1526
1539
|
{
|
|
1527
1540
|
side: "right",
|
|
@@ -1539,7 +1552,7 @@ function SidebarMenuAction({
|
|
|
1539
1552
|
...props
|
|
1540
1553
|
}) {
|
|
1541
1554
|
const Comp = asChild ? Slot3 : "button";
|
|
1542
|
-
return /* @__PURE__ */
|
|
1555
|
+
return /* @__PURE__ */ jsx12(
|
|
1543
1556
|
Comp,
|
|
1544
1557
|
{
|
|
1545
1558
|
"data-slot": "sidebar-menu-action",
|
|
@@ -1564,7 +1577,7 @@ function SidebarMenuAction({
|
|
|
1564
1577
|
import * as React5 from "react";
|
|
1565
1578
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
1566
1579
|
import { XIcon as XIcon2 } from "lucide-react";
|
|
1567
|
-
import { jsx as
|
|
1580
|
+
import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1568
1581
|
function cleanupBodyStyles2() {
|
|
1569
1582
|
if (typeof document !== "undefined" && document.body.style.pointerEvents === "none") {
|
|
1570
1583
|
document.body.style.pointerEvents = "";
|
|
@@ -1588,23 +1601,23 @@ function Dialog({
|
|
|
1588
1601
|
cleanupBodyStyles2();
|
|
1589
1602
|
};
|
|
1590
1603
|
}, []);
|
|
1591
|
-
return /* @__PURE__ */
|
|
1604
|
+
return /* @__PURE__ */ jsx13(DialogPrimitive.Root, { "data-slot": "dialog", open, onOpenChange, ...props });
|
|
1592
1605
|
}
|
|
1593
1606
|
function DialogTrigger({
|
|
1594
1607
|
...props
|
|
1595
1608
|
}) {
|
|
1596
|
-
return /* @__PURE__ */
|
|
1609
|
+
return /* @__PURE__ */ jsx13(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
1597
1610
|
}
|
|
1598
1611
|
function DialogPortal({
|
|
1599
1612
|
...props
|
|
1600
1613
|
}) {
|
|
1601
|
-
return /* @__PURE__ */
|
|
1614
|
+
return /* @__PURE__ */ jsx13(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
1602
1615
|
}
|
|
1603
1616
|
function DialogOverlay({
|
|
1604
1617
|
className,
|
|
1605
1618
|
...props
|
|
1606
1619
|
}) {
|
|
1607
|
-
return /* @__PURE__ */
|
|
1620
|
+
return /* @__PURE__ */ jsx13(
|
|
1608
1621
|
DialogPrimitive.Overlay,
|
|
1609
1622
|
{
|
|
1610
1623
|
"data-slot": "dialog-overlay",
|
|
@@ -1626,7 +1639,7 @@ function DialogContent({
|
|
|
1626
1639
|
...props
|
|
1627
1640
|
}) {
|
|
1628
1641
|
return /* @__PURE__ */ jsxs5(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
1629
|
-
/* @__PURE__ */
|
|
1642
|
+
/* @__PURE__ */ jsx13(DialogOverlay, {}),
|
|
1630
1643
|
/* @__PURE__ */ jsxs5(
|
|
1631
1644
|
DialogPrimitive.Content,
|
|
1632
1645
|
{
|
|
@@ -1645,8 +1658,8 @@ function DialogContent({
|
|
|
1645
1658
|
"data-slot": "dialog-close",
|
|
1646
1659
|
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",
|
|
1647
1660
|
children: [
|
|
1648
|
-
/* @__PURE__ */
|
|
1649
|
-
/* @__PURE__ */
|
|
1661
|
+
/* @__PURE__ */ jsx13(XIcon2, {}),
|
|
1662
|
+
/* @__PURE__ */ jsx13("span", { className: "sr-only", children: "Close" })
|
|
1650
1663
|
]
|
|
1651
1664
|
}
|
|
1652
1665
|
)
|
|
@@ -1656,7 +1669,7 @@ function DialogContent({
|
|
|
1656
1669
|
] });
|
|
1657
1670
|
}
|
|
1658
1671
|
function DialogHeader({ className, ...props }) {
|
|
1659
|
-
return /* @__PURE__ */
|
|
1672
|
+
return /* @__PURE__ */ jsx13(
|
|
1660
1673
|
"div",
|
|
1661
1674
|
{
|
|
1662
1675
|
"data-slot": "dialog-header",
|
|
@@ -1666,7 +1679,7 @@ function DialogHeader({ className, ...props }) {
|
|
|
1666
1679
|
);
|
|
1667
1680
|
}
|
|
1668
1681
|
function DialogFooter({ className, ...props }) {
|
|
1669
|
-
return /* @__PURE__ */
|
|
1682
|
+
return /* @__PURE__ */ jsx13(
|
|
1670
1683
|
"div",
|
|
1671
1684
|
{
|
|
1672
1685
|
"data-slot": "dialog-footer",
|
|
@@ -1682,7 +1695,7 @@ function DialogTitle({
|
|
|
1682
1695
|
className,
|
|
1683
1696
|
...props
|
|
1684
1697
|
}) {
|
|
1685
|
-
return /* @__PURE__ */
|
|
1698
|
+
return /* @__PURE__ */ jsx13(
|
|
1686
1699
|
DialogPrimitive.Title,
|
|
1687
1700
|
{
|
|
1688
1701
|
"data-slot": "dialog-title",
|
|
@@ -1695,7 +1708,7 @@ function DialogDescription({
|
|
|
1695
1708
|
className,
|
|
1696
1709
|
...props
|
|
1697
1710
|
}) {
|
|
1698
|
-
return /* @__PURE__ */
|
|
1711
|
+
return /* @__PURE__ */ jsx13(
|
|
1699
1712
|
DialogPrimitive.Description,
|
|
1700
1713
|
{
|
|
1701
1714
|
"data-slot": "dialog-description",
|
|
@@ -1708,7 +1721,7 @@ function DialogDescription({
|
|
|
1708
1721
|
// src/components/ui/alert-dialog.tsx
|
|
1709
1722
|
import * as React6 from "react";
|
|
1710
1723
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
1711
|
-
import { jsx as
|
|
1724
|
+
import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1712
1725
|
function cleanupBodyStyles3() {
|
|
1713
1726
|
if (typeof document !== "undefined" && document.body.style.pointerEvents === "none") {
|
|
1714
1727
|
document.body.style.pointerEvents = "";
|
|
@@ -1732,18 +1745,18 @@ function AlertDialog({
|
|
|
1732
1745
|
cleanupBodyStyles3();
|
|
1733
1746
|
};
|
|
1734
1747
|
}, []);
|
|
1735
|
-
return /* @__PURE__ */
|
|
1748
|
+
return /* @__PURE__ */ jsx14(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", open, onOpenChange, ...props });
|
|
1736
1749
|
}
|
|
1737
1750
|
function AlertDialogPortal({
|
|
1738
1751
|
...props
|
|
1739
1752
|
}) {
|
|
1740
|
-
return /* @__PURE__ */
|
|
1753
|
+
return /* @__PURE__ */ jsx14(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props });
|
|
1741
1754
|
}
|
|
1742
1755
|
function AlertDialogOverlay({
|
|
1743
1756
|
className,
|
|
1744
1757
|
...props
|
|
1745
1758
|
}) {
|
|
1746
|
-
return /* @__PURE__ */
|
|
1759
|
+
return /* @__PURE__ */ jsx14(
|
|
1747
1760
|
AlertDialogPrimitive.Overlay,
|
|
1748
1761
|
{
|
|
1749
1762
|
"data-slot": "alert-dialog-overlay",
|
|
@@ -1763,8 +1776,8 @@ function AlertDialogContent({
|
|
|
1763
1776
|
...props
|
|
1764
1777
|
}) {
|
|
1765
1778
|
return /* @__PURE__ */ jsxs6(AlertDialogPortal, { children: [
|
|
1766
|
-
/* @__PURE__ */
|
|
1767
|
-
/* @__PURE__ */
|
|
1779
|
+
/* @__PURE__ */ jsx14(AlertDialogOverlay, {}),
|
|
1780
|
+
/* @__PURE__ */ jsx14(
|
|
1768
1781
|
AlertDialogPrimitive.Content,
|
|
1769
1782
|
{
|
|
1770
1783
|
"data-slot": "alert-dialog-content",
|
|
@@ -1781,7 +1794,7 @@ function AlertDialogHeader({
|
|
|
1781
1794
|
className,
|
|
1782
1795
|
...props
|
|
1783
1796
|
}) {
|
|
1784
|
-
return /* @__PURE__ */
|
|
1797
|
+
return /* @__PURE__ */ jsx14(
|
|
1785
1798
|
"div",
|
|
1786
1799
|
{
|
|
1787
1800
|
"data-slot": "alert-dialog-header",
|
|
@@ -1794,7 +1807,7 @@ function AlertDialogFooter({
|
|
|
1794
1807
|
className,
|
|
1795
1808
|
...props
|
|
1796
1809
|
}) {
|
|
1797
|
-
return /* @__PURE__ */
|
|
1810
|
+
return /* @__PURE__ */ jsx14(
|
|
1798
1811
|
"div",
|
|
1799
1812
|
{
|
|
1800
1813
|
"data-slot": "alert-dialog-footer",
|
|
@@ -1810,7 +1823,7 @@ function AlertDialogTitle({
|
|
|
1810
1823
|
className,
|
|
1811
1824
|
...props
|
|
1812
1825
|
}) {
|
|
1813
|
-
return /* @__PURE__ */
|
|
1826
|
+
return /* @__PURE__ */ jsx14(
|
|
1814
1827
|
AlertDialogPrimitive.Title,
|
|
1815
1828
|
{
|
|
1816
1829
|
"data-slot": "alert-dialog-title",
|
|
@@ -1823,7 +1836,7 @@ function AlertDialogDescription({
|
|
|
1823
1836
|
className,
|
|
1824
1837
|
...props
|
|
1825
1838
|
}) {
|
|
1826
|
-
return /* @__PURE__ */
|
|
1839
|
+
return /* @__PURE__ */ jsx14(
|
|
1827
1840
|
AlertDialogPrimitive.Description,
|
|
1828
1841
|
{
|
|
1829
1842
|
"data-slot": "alert-dialog-description",
|
|
@@ -1836,7 +1849,7 @@ function AlertDialogAction({
|
|
|
1836
1849
|
className,
|
|
1837
1850
|
...props
|
|
1838
1851
|
}) {
|
|
1839
|
-
return /* @__PURE__ */
|
|
1852
|
+
return /* @__PURE__ */ jsx14(
|
|
1840
1853
|
AlertDialogPrimitive.Action,
|
|
1841
1854
|
{
|
|
1842
1855
|
className: cn(buttonVariants(), className),
|
|
@@ -1848,7 +1861,7 @@ function AlertDialogCancel({
|
|
|
1848
1861
|
className,
|
|
1849
1862
|
...props
|
|
1850
1863
|
}) {
|
|
1851
|
-
return /* @__PURE__ */
|
|
1864
|
+
return /* @__PURE__ */ jsx14(
|
|
1852
1865
|
AlertDialogPrimitive.Cancel,
|
|
1853
1866
|
{
|
|
1854
1867
|
className: cn(buttonVariants({ variant: "outline" }), className),
|
|
@@ -1860,16 +1873,16 @@ function AlertDialogCancel({
|
|
|
1860
1873
|
// src/components/ui/dropdown-menu.tsx
|
|
1861
1874
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
1862
1875
|
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
1863
|
-
import { jsx as
|
|
1876
|
+
import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1864
1877
|
function DropdownMenu({
|
|
1865
1878
|
...props
|
|
1866
1879
|
}) {
|
|
1867
|
-
return /* @__PURE__ */
|
|
1880
|
+
return /* @__PURE__ */ jsx15(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
1868
1881
|
}
|
|
1869
1882
|
function DropdownMenuTrigger({
|
|
1870
1883
|
...props
|
|
1871
1884
|
}) {
|
|
1872
|
-
return /* @__PURE__ */
|
|
1885
|
+
return /* @__PURE__ */ jsx15(
|
|
1873
1886
|
DropdownMenuPrimitive.Trigger,
|
|
1874
1887
|
{
|
|
1875
1888
|
"data-slot": "dropdown-menu-trigger",
|
|
@@ -1882,7 +1895,7 @@ function DropdownMenuContent({
|
|
|
1882
1895
|
sideOffset = 4,
|
|
1883
1896
|
...props
|
|
1884
1897
|
}) {
|
|
1885
|
-
return /* @__PURE__ */
|
|
1898
|
+
return /* @__PURE__ */ jsx15(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx15(
|
|
1886
1899
|
DropdownMenuPrimitive.Content,
|
|
1887
1900
|
{
|
|
1888
1901
|
"data-slot": "dropdown-menu-content",
|
|
@@ -1901,7 +1914,7 @@ function DropdownMenuItem({
|
|
|
1901
1914
|
variant = "default",
|
|
1902
1915
|
...props
|
|
1903
1916
|
}) {
|
|
1904
|
-
return /* @__PURE__ */
|
|
1917
|
+
return /* @__PURE__ */ jsx15(
|
|
1905
1918
|
DropdownMenuPrimitive.Item,
|
|
1906
1919
|
{
|
|
1907
1920
|
"data-slot": "dropdown-menu-item",
|
|
@@ -1920,7 +1933,7 @@ function DropdownMenuLabel({
|
|
|
1920
1933
|
inset,
|
|
1921
1934
|
...props
|
|
1922
1935
|
}) {
|
|
1923
|
-
return /* @__PURE__ */
|
|
1936
|
+
return /* @__PURE__ */ jsx15(
|
|
1924
1937
|
DropdownMenuPrimitive.Label,
|
|
1925
1938
|
{
|
|
1926
1939
|
"data-slot": "dropdown-menu-label",
|
|
@@ -1937,7 +1950,7 @@ function DropdownMenuSeparator({
|
|
|
1937
1950
|
className,
|
|
1938
1951
|
...props
|
|
1939
1952
|
}) {
|
|
1940
|
-
return /* @__PURE__ */
|
|
1953
|
+
return /* @__PURE__ */ jsx15(
|
|
1941
1954
|
DropdownMenuPrimitive.Separator,
|
|
1942
1955
|
{
|
|
1943
1956
|
"data-slot": "dropdown-menu-separator",
|
|
@@ -1969,7 +1982,7 @@ import {
|
|
|
1969
1982
|
Sun,
|
|
1970
1983
|
Palette
|
|
1971
1984
|
} from "lucide-react";
|
|
1972
|
-
import { Fragment as Fragment2, jsx as
|
|
1985
|
+
import { Fragment as Fragment2, jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1973
1986
|
var getInitials = (name, email) => {
|
|
1974
1987
|
if (name) {
|
|
1975
1988
|
return name.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase();
|
|
@@ -2004,8 +2017,8 @@ var UserMenu = ({
|
|
|
2004
2017
|
};
|
|
2005
2018
|
const displayName = getDisplayName(user, labels.guest);
|
|
2006
2019
|
const initials = getInitials(user?.name, user?.email);
|
|
2007
|
-
return /* @__PURE__ */
|
|
2008
|
-
/* @__PURE__ */
|
|
2020
|
+
return /* @__PURE__ */ jsx16(SidebarMenu, { children: /* @__PURE__ */ jsx16(SidebarMenuItem, { children: /* @__PURE__ */ jsxs8(DropdownMenu, { children: [
|
|
2021
|
+
/* @__PURE__ */ jsx16(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs8(
|
|
2009
2022
|
SidebarMenuButton,
|
|
2010
2023
|
{
|
|
2011
2024
|
size: "lg",
|
|
@@ -2013,14 +2026,14 @@ var UserMenu = ({
|
|
|
2013
2026
|
tooltip: displayName,
|
|
2014
2027
|
children: [
|
|
2015
2028
|
/* @__PURE__ */ jsxs8(Avatar, { className: "h-8 w-8 rounded-lg", children: [
|
|
2016
|
-
user?.avatar && /* @__PURE__ */
|
|
2017
|
-
/* @__PURE__ */
|
|
2029
|
+
user?.avatar && /* @__PURE__ */ jsx16(AvatarImage, { src: user.avatar, alt: displayName }),
|
|
2030
|
+
/* @__PURE__ */ jsx16(AvatarFallback, { className: "rounded-lg bg-primary/10 text-primary text-xs font-medium", children: initials })
|
|
2018
2031
|
] }),
|
|
2019
2032
|
/* @__PURE__ */ jsxs8("div", { className: "grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden", children: [
|
|
2020
|
-
/* @__PURE__ */
|
|
2021
|
-
user?.email && /* @__PURE__ */
|
|
2033
|
+
/* @__PURE__ */ jsx16("span", { className: "truncate font-medium", children: displayName }),
|
|
2034
|
+
user?.email && /* @__PURE__ */ jsx16("span", { className: "truncate text-xs text-muted-foreground", children: user.email })
|
|
2022
2035
|
] }),
|
|
2023
|
-
/* @__PURE__ */
|
|
2036
|
+
/* @__PURE__ */ jsx16(ChevronsUpDown, { className: "ml-auto size-4 group-data-[collapsible=icon]:hidden" })
|
|
2024
2037
|
]
|
|
2025
2038
|
}
|
|
2026
2039
|
) }),
|
|
@@ -2032,36 +2045,36 @@ var UserMenu = ({
|
|
|
2032
2045
|
align: "end",
|
|
2033
2046
|
sideOffset: 4,
|
|
2034
2047
|
children: [
|
|
2035
|
-
/* @__PURE__ */
|
|
2048
|
+
/* @__PURE__ */ jsx16(DropdownMenuLabel, { className: "p-0 font-normal", children: /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm", children: [
|
|
2036
2049
|
/* @__PURE__ */ jsxs8(Avatar, { className: "h-8 w-8 rounded-lg", children: [
|
|
2037
|
-
user?.avatar && /* @__PURE__ */
|
|
2038
|
-
/* @__PURE__ */
|
|
2050
|
+
user?.avatar && /* @__PURE__ */ jsx16(AvatarImage, { src: user.avatar, alt: displayName }),
|
|
2051
|
+
/* @__PURE__ */ jsx16(AvatarFallback, { className: "rounded-lg bg-primary/10 text-primary text-xs font-medium", children: initials })
|
|
2039
2052
|
] }),
|
|
2040
2053
|
/* @__PURE__ */ jsxs8("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
2041
|
-
/* @__PURE__ */
|
|
2042
|
-
user?.email && /* @__PURE__ */
|
|
2054
|
+
/* @__PURE__ */ jsx16("span", { className: "truncate font-medium", children: displayName }),
|
|
2055
|
+
user?.email && /* @__PURE__ */ jsx16("span", { className: "truncate text-xs text-muted-foreground", children: user.email })
|
|
2043
2056
|
] })
|
|
2044
2057
|
] }) }),
|
|
2045
|
-
/* @__PURE__ */
|
|
2058
|
+
/* @__PURE__ */ jsx16(DropdownMenuSeparator, {}),
|
|
2046
2059
|
callbacks?.onViewProfile && /* @__PURE__ */ jsxs8(DropdownMenuItem, { onClick: callbacks.onViewProfile, children: [
|
|
2047
|
-
/* @__PURE__ */
|
|
2048
|
-
/* @__PURE__ */
|
|
2060
|
+
/* @__PURE__ */ jsx16(User, { className: "mr-2 h-4 w-4" }),
|
|
2061
|
+
/* @__PURE__ */ jsx16("span", { children: labels.profile })
|
|
2049
2062
|
] }),
|
|
2050
2063
|
callbacks?.onOpenSettings && /* @__PURE__ */ jsxs8(DropdownMenuItem, { onClick: callbacks.onOpenSettings, children: [
|
|
2051
|
-
/* @__PURE__ */
|
|
2052
|
-
/* @__PURE__ */
|
|
2064
|
+
/* @__PURE__ */ jsx16(Settings, { className: "mr-2 h-4 w-4" }),
|
|
2065
|
+
/* @__PURE__ */ jsx16("span", { children: labels.settings })
|
|
2053
2066
|
] }),
|
|
2054
2067
|
additionalItems,
|
|
2055
2068
|
showThemeOptions && callbacks?.onThemeChange && /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
2056
|
-
/* @__PURE__ */
|
|
2069
|
+
/* @__PURE__ */ jsx16(DropdownMenuSeparator, {}),
|
|
2057
2070
|
/* @__PURE__ */ jsxs8(
|
|
2058
2071
|
DropdownMenuItem,
|
|
2059
2072
|
{
|
|
2060
2073
|
onClick: () => callbacks.onThemeChange?.("light"),
|
|
2061
2074
|
className: currentTheme === "light" ? "bg-accent" : "",
|
|
2062
2075
|
children: [
|
|
2063
|
-
/* @__PURE__ */
|
|
2064
|
-
/* @__PURE__ */
|
|
2076
|
+
/* @__PURE__ */ jsx16(Sun, { className: "mr-2 h-4 w-4" }),
|
|
2077
|
+
/* @__PURE__ */ jsx16("span", { children: labels.lightMode })
|
|
2065
2078
|
]
|
|
2066
2079
|
}
|
|
2067
2080
|
),
|
|
@@ -2071,8 +2084,8 @@ var UserMenu = ({
|
|
|
2071
2084
|
onClick: () => callbacks.onThemeChange?.("dark"),
|
|
2072
2085
|
className: currentTheme === "dark" ? "bg-accent" : "",
|
|
2073
2086
|
children: [
|
|
2074
|
-
/* @__PURE__ */
|
|
2075
|
-
/* @__PURE__ */
|
|
2087
|
+
/* @__PURE__ */ jsx16(Moon, { className: "mr-2 h-4 w-4" }),
|
|
2088
|
+
/* @__PURE__ */ jsx16("span", { children: labels.darkMode })
|
|
2076
2089
|
]
|
|
2077
2090
|
}
|
|
2078
2091
|
),
|
|
@@ -2082,22 +2095,22 @@ var UserMenu = ({
|
|
|
2082
2095
|
onClick: () => callbacks.onThemeChange?.("system"),
|
|
2083
2096
|
className: currentTheme === "system" ? "bg-accent" : "",
|
|
2084
2097
|
children: [
|
|
2085
|
-
/* @__PURE__ */
|
|
2086
|
-
/* @__PURE__ */
|
|
2098
|
+
/* @__PURE__ */ jsx16(Palette, { className: "mr-2 h-4 w-4" }),
|
|
2099
|
+
/* @__PURE__ */ jsx16("span", { children: labels.systemTheme })
|
|
2087
2100
|
]
|
|
2088
2101
|
}
|
|
2089
2102
|
)
|
|
2090
2103
|
] }),
|
|
2091
2104
|
callbacks?.onLogout && /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
2092
|
-
/* @__PURE__ */
|
|
2105
|
+
/* @__PURE__ */ jsx16(DropdownMenuSeparator, {}),
|
|
2093
2106
|
/* @__PURE__ */ jsxs8(
|
|
2094
2107
|
DropdownMenuItem,
|
|
2095
2108
|
{
|
|
2096
2109
|
onClick: callbacks.onLogout,
|
|
2097
2110
|
className: "text-destructive focus:text-destructive focus:bg-destructive/10",
|
|
2098
2111
|
children: [
|
|
2099
|
-
/* @__PURE__ */
|
|
2100
|
-
/* @__PURE__ */
|
|
2112
|
+
/* @__PURE__ */ jsx16(LogOut, { className: "mr-2 h-4 w-4" }),
|
|
2113
|
+
/* @__PURE__ */ jsx16("span", { children: labels.logout })
|
|
2101
2114
|
]
|
|
2102
2115
|
}
|
|
2103
2116
|
)
|
|
@@ -2109,7 +2122,7 @@ var UserMenu = ({
|
|
|
2109
2122
|
};
|
|
2110
2123
|
|
|
2111
2124
|
// src/components/chat/Sidebar.tsx
|
|
2112
|
-
import { jsx as
|
|
2125
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2113
2126
|
var CreateThreadDialog = ({ config, onCreateThread, trigger }) => {
|
|
2114
2127
|
const [title, setTitle] = useState4("");
|
|
2115
2128
|
const [isOpen, setIsOpen] = useState4(false);
|
|
@@ -2119,16 +2132,16 @@ var CreateThreadDialog = ({ config, onCreateThread, trigger }) => {
|
|
|
2119
2132
|
setIsOpen(false);
|
|
2120
2133
|
};
|
|
2121
2134
|
return /* @__PURE__ */ jsxs9(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
2122
|
-
/* @__PURE__ */
|
|
2123
|
-
/* @__PURE__ */
|
|
2135
|
+
/* @__PURE__ */ jsx17(DialogTrigger, { asChild: true, children: trigger || /* @__PURE__ */ jsxs9(Button, { className: "w-full justify-start", variant: "outline", children: [
|
|
2136
|
+
/* @__PURE__ */ jsx17(Plus, { className: "mr-2 h-4 w-4" }),
|
|
2124
2137
|
config.labels?.newChat || "New Chat"
|
|
2125
2138
|
] }) }),
|
|
2126
2139
|
/* @__PURE__ */ jsxs9(DialogContent, { children: [
|
|
2127
2140
|
/* @__PURE__ */ jsxs9(DialogHeader, { children: [
|
|
2128
|
-
/* @__PURE__ */
|
|
2129
|
-
/* @__PURE__ */
|
|
2141
|
+
/* @__PURE__ */ jsx17(DialogTitle, { children: config.labels?.createNewThread || "New Conversation" }),
|
|
2142
|
+
/* @__PURE__ */ jsx17(DialogDescription, { children: "Give your new conversation a name or leave blank to auto-generate one." })
|
|
2130
2143
|
] }),
|
|
2131
|
-
/* @__PURE__ */
|
|
2144
|
+
/* @__PURE__ */ jsx17(
|
|
2132
2145
|
Input,
|
|
2133
2146
|
{
|
|
2134
2147
|
value: title,
|
|
@@ -2139,15 +2152,15 @@ var CreateThreadDialog = ({ config, onCreateThread, trigger }) => {
|
|
|
2139
2152
|
}
|
|
2140
2153
|
),
|
|
2141
2154
|
/* @__PURE__ */ jsxs9(DialogFooter, { children: [
|
|
2142
|
-
/* @__PURE__ */
|
|
2143
|
-
/* @__PURE__ */
|
|
2155
|
+
/* @__PURE__ */ jsx17(Button, { variant: "outline", onClick: () => setIsOpen(false), children: config.labels?.cancel || "Cancel" }),
|
|
2156
|
+
/* @__PURE__ */ jsx17(Button, { onClick: handleCreate, children: config.labels?.create || "Create" })
|
|
2144
2157
|
] })
|
|
2145
2158
|
] })
|
|
2146
2159
|
] });
|
|
2147
2160
|
};
|
|
2148
2161
|
var ThreadInitialsIcon = ({ title }) => {
|
|
2149
2162
|
const initials = title?.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase() || "?";
|
|
2150
|
-
return /* @__PURE__ */
|
|
2163
|
+
return /* @__PURE__ */ jsx17("div", { className: "flex shrink-0 items-center justify-center rounded bg-muted text-[10px] font-medium", children: initials });
|
|
2151
2164
|
};
|
|
2152
2165
|
var Sidebar2 = ({
|
|
2153
2166
|
threads,
|
|
@@ -2227,26 +2240,26 @@ var Sidebar2 = ({
|
|
|
2227
2240
|
return /* @__PURE__ */ jsxs9(Sidebar, { collapsible: "icon", ...props, children: [
|
|
2228
2241
|
/* @__PURE__ */ jsxs9(SidebarHeader, { children: [
|
|
2229
2242
|
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-3 px-2 py-3", children: [
|
|
2230
|
-
/* @__PURE__ */
|
|
2243
|
+
/* @__PURE__ */ jsx17("div", { className: "flex items-center justify-center shrink-0", children: config.branding?.logo || /* @__PURE__ */ jsx17(Avatar, { className: "h-8 w-8", children: /* @__PURE__ */ jsx17(AvatarFallback, { className: "bg-primary text-primary-foreground", children: /* @__PURE__ */ jsx17(Bot, { className: "h-4 w-4" }) }) }) }),
|
|
2231
2244
|
/* @__PURE__ */ jsxs9("div", { className: "flex flex-col min-w-0 group-data-[collapsible=icon]:hidden", children: [
|
|
2232
|
-
/* @__PURE__ */
|
|
2233
|
-
config.branding?.subtitle && /* @__PURE__ */
|
|
2245
|
+
/* @__PURE__ */ jsx17("span", { className: "text-sm font-semibold truncate", children: config.branding?.title || "Chat" }),
|
|
2246
|
+
config.branding?.subtitle && /* @__PURE__ */ jsx17("span", { className: "text-xs text-muted-foreground truncate", children: config.branding.subtitle })
|
|
2234
2247
|
] })
|
|
2235
2248
|
] }),
|
|
2236
|
-
onCreateThread && /* @__PURE__ */
|
|
2249
|
+
onCreateThread && /* @__PURE__ */ jsx17(
|
|
2237
2250
|
CreateThreadDialog,
|
|
2238
2251
|
{
|
|
2239
2252
|
config,
|
|
2240
2253
|
onCreateThread,
|
|
2241
|
-
trigger: /* @__PURE__ */
|
|
2254
|
+
trigger: /* @__PURE__ */ jsx17(SidebarMenu, { children: /* @__PURE__ */ jsx17(SidebarMenuItem, { children: /* @__PURE__ */ jsxs9(
|
|
2242
2255
|
SidebarMenuButton,
|
|
2243
2256
|
{
|
|
2244
2257
|
size: "lg",
|
|
2245
2258
|
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",
|
|
2246
2259
|
tooltip: config.labels?.newChat || "New Chat",
|
|
2247
2260
|
children: [
|
|
2248
|
-
/* @__PURE__ */
|
|
2249
|
-
/* @__PURE__ */
|
|
2261
|
+
/* @__PURE__ */ jsx17(Plus, { className: "size-4" }),
|
|
2262
|
+
/* @__PURE__ */ jsx17("span", { className: "group-data-[collapsible=icon]:hidden", children: config.labels?.newChat || "New Chat" })
|
|
2250
2263
|
]
|
|
2251
2264
|
}
|
|
2252
2265
|
) }) })
|
|
@@ -2254,8 +2267,8 @@ var Sidebar2 = ({
|
|
|
2254
2267
|
),
|
|
2255
2268
|
/* @__PURE__ */ jsxs9("div", { className: "px-2 py-1 mt-4", children: [
|
|
2256
2269
|
/* @__PURE__ */ jsxs9("div", { className: "relative group-data-[collapsible=icon]:hidden", children: [
|
|
2257
|
-
/* @__PURE__ */
|
|
2258
|
-
/* @__PURE__ */
|
|
2270
|
+
/* @__PURE__ */ jsx17(Search, { className: "pointer-events-none absolute left-2 top-1/2 size-4 -translate-y-1/2 select-none opacity-50" }),
|
|
2271
|
+
/* @__PURE__ */ jsx17(
|
|
2259
2272
|
Input,
|
|
2260
2273
|
{
|
|
2261
2274
|
className: "pl-8 h-8 bg-sidebar-accent/50 border-sidebar-border focus-visible:ring-1 focus-visible:ring-sidebar-ring",
|
|
@@ -2265,7 +2278,7 @@ var Sidebar2 = ({
|
|
|
2265
2278
|
}
|
|
2266
2279
|
)
|
|
2267
2280
|
] }),
|
|
2268
|
-
/* @__PURE__ */
|
|
2281
|
+
/* @__PURE__ */ jsx17("div", { className: "hidden group-data-[collapsible=icon]:flex justify-center", children: /* @__PURE__ */ jsx17(
|
|
2269
2282
|
Button,
|
|
2270
2283
|
{
|
|
2271
2284
|
variant: "ghost",
|
|
@@ -2273,13 +2286,13 @@ var Sidebar2 = ({
|
|
|
2273
2286
|
className: "h-7 w-7",
|
|
2274
2287
|
onClick: () => setOpen(true),
|
|
2275
2288
|
title: config.labels?.search || "Search",
|
|
2276
|
-
children: /* @__PURE__ */
|
|
2289
|
+
children: /* @__PURE__ */ jsx17(Search, { className: "h-4 w-4" })
|
|
2277
2290
|
}
|
|
2278
2291
|
) })
|
|
2279
2292
|
] })
|
|
2280
2293
|
] }),
|
|
2281
2294
|
/* @__PURE__ */ jsxs9(SidebarContent, { children: [
|
|
2282
|
-
threads.some((t) => t.isArchived) && /* @__PURE__ */
|
|
2295
|
+
threads.some((t) => t.isArchived) && /* @__PURE__ */ jsx17("div", { className: "px-4 py-2 mt-2 group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ jsxs9(
|
|
2283
2296
|
Button,
|
|
2284
2297
|
{
|
|
2285
2298
|
variant: "ghost",
|
|
@@ -2287,18 +2300,18 @@ var Sidebar2 = ({
|
|
|
2287
2300
|
onClick: () => setShowArchived(!showArchived),
|
|
2288
2301
|
className: "h-6 text-xs w-full justify-start text-muted-foreground",
|
|
2289
2302
|
children: [
|
|
2290
|
-
/* @__PURE__ */
|
|
2303
|
+
/* @__PURE__ */ jsx17(Filter, { className: "mr-2 h-3 w-3" }),
|
|
2291
2304
|
showArchived ? config.labels?.hideArchived || "Hide Archived" : config.labels?.showArchived || "Show Archived"
|
|
2292
2305
|
]
|
|
2293
2306
|
}
|
|
2294
2307
|
) }),
|
|
2295
2308
|
Object.keys(groupedThreads).length === 0 ? /* @__PURE__ */ jsxs9("div", { className: "px-4 py-8 text-center text-muted-foreground group-data-[collapsible=icon]:hidden", children: [
|
|
2296
|
-
/* @__PURE__ */
|
|
2297
|
-
/* @__PURE__ */
|
|
2309
|
+
/* @__PURE__ */ jsx17("div", { className: "mx-auto h-8 w-8 mb-2 flex items-center justify-center rounded-full bg-muted/50", children: /* @__PURE__ */ jsx17(Plus, { className: "h-4 w-4 opacity-50" }) }),
|
|
2310
|
+
/* @__PURE__ */ jsx17("p", { className: "text-xs", children: searchQuery ? config.labels?.noThreadsFound || "No conversations found" : config.labels?.noThreadsYet || "No conversations yet" })
|
|
2298
2311
|
] }) : Object.entries(groupedThreads).map(([group, groupThreads]) => /* @__PURE__ */ jsxs9(SidebarGroup, { className: "mt-2", children: [
|
|
2299
|
-
/* @__PURE__ */
|
|
2300
|
-
/* @__PURE__ */
|
|
2301
|
-
editingThreadId === thread.id ? /* @__PURE__ */
|
|
2312
|
+
/* @__PURE__ */ jsx17(SidebarGroupLabel, { className: "group-data-[collapsible=icon]:hidden", children: group }),
|
|
2313
|
+
/* @__PURE__ */ jsx17(SidebarGroupContent, { children: /* @__PURE__ */ jsx17(SidebarMenu, { children: groupThreads.map((thread) => /* @__PURE__ */ jsxs9(SidebarMenuItem, { children: [
|
|
2314
|
+
editingThreadId === thread.id ? /* @__PURE__ */ jsx17("div", { className: "flex items-center gap-1 px-2 py-1", children: /* @__PURE__ */ jsx17(
|
|
2302
2315
|
Input,
|
|
2303
2316
|
{
|
|
2304
2317
|
ref: inputRef,
|
|
@@ -2318,35 +2331,35 @@ var Sidebar2 = ({
|
|
|
2318
2331
|
onClick: () => onSelectThread?.(thread.id),
|
|
2319
2332
|
tooltip: thread.title,
|
|
2320
2333
|
children: [
|
|
2321
|
-
/* @__PURE__ */
|
|
2322
|
-
/* @__PURE__ */
|
|
2323
|
-
thread.isArchived && /* @__PURE__ */
|
|
2334
|
+
/* @__PURE__ */ jsx17(ThreadInitialsIcon, { title: thread.title || "?" }),
|
|
2335
|
+
/* @__PURE__ */ jsx17("div", { className: "flex flex-col items-start gap-0.5 flex-1 min-w-0 group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ jsx17("span", { className: "truncate w-full", children: thread.title || "New Chat" }) }),
|
|
2336
|
+
thread.isArchived && /* @__PURE__ */ jsx17(Archive, { className: "ml-auto h-3 w-3 opacity-50 group-data-[collapsible=icon]:hidden" })
|
|
2324
2337
|
]
|
|
2325
2338
|
}
|
|
2326
2339
|
),
|
|
2327
2340
|
!editingThreadId && /* @__PURE__ */ jsxs9(DropdownMenu, { children: [
|
|
2328
|
-
/* @__PURE__ */
|
|
2329
|
-
/* @__PURE__ */
|
|
2330
|
-
/* @__PURE__ */
|
|
2341
|
+
/* @__PURE__ */ jsx17(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs9(SidebarMenuAction, { showOnHover: true, children: [
|
|
2342
|
+
/* @__PURE__ */ jsx17(MoreHorizontal, {}),
|
|
2343
|
+
/* @__PURE__ */ jsx17("span", { className: "sr-only", children: "More" })
|
|
2331
2344
|
] }) }),
|
|
2332
2345
|
/* @__PURE__ */ jsxs9(DropdownMenuContent, { className: "w-48", side: "right", align: "start", children: [
|
|
2333
2346
|
/* @__PURE__ */ jsxs9(DropdownMenuItem, { onClick: () => startEditing(thread), children: [
|
|
2334
|
-
/* @__PURE__ */
|
|
2335
|
-
/* @__PURE__ */
|
|
2347
|
+
/* @__PURE__ */ jsx17(Edit2, { className: "mr-2 h-4 w-4" }),
|
|
2348
|
+
/* @__PURE__ */ jsx17("span", { children: config.labels?.renameThread || "Rename" })
|
|
2336
2349
|
] }),
|
|
2337
2350
|
/* @__PURE__ */ jsxs9(DropdownMenuItem, { onClick: () => onArchiveThread?.(thread.id), children: [
|
|
2338
|
-
/* @__PURE__ */
|
|
2339
|
-
/* @__PURE__ */
|
|
2351
|
+
/* @__PURE__ */ jsx17(Archive, { className: "mr-2 h-4 w-4" }),
|
|
2352
|
+
/* @__PURE__ */ jsx17("span", { children: thread.isArchived ? config.labels?.unarchiveThread || "Unarchive" : config.labels?.archiveThread || "Archive" })
|
|
2340
2353
|
] }),
|
|
2341
|
-
/* @__PURE__ */
|
|
2354
|
+
/* @__PURE__ */ jsx17(DropdownMenuSeparator, {}),
|
|
2342
2355
|
/* @__PURE__ */ jsxs9(
|
|
2343
2356
|
DropdownMenuItem,
|
|
2344
2357
|
{
|
|
2345
2358
|
onClick: () => setDeleteThreadId(thread.id),
|
|
2346
2359
|
className: "text-destructive focus:text-destructive",
|
|
2347
2360
|
children: [
|
|
2348
|
-
/* @__PURE__ */
|
|
2349
|
-
/* @__PURE__ */
|
|
2361
|
+
/* @__PURE__ */ jsx17(Trash2, { className: "mr-2 h-4 w-4" }),
|
|
2362
|
+
/* @__PURE__ */ jsx17("span", { children: config.labels?.deleteThread || "Delete" })
|
|
2350
2363
|
]
|
|
2351
2364
|
}
|
|
2352
2365
|
)
|
|
@@ -2355,7 +2368,7 @@ var Sidebar2 = ({
|
|
|
2355
2368
|
] }, thread.id)) }) })
|
|
2356
2369
|
] }, group))
|
|
2357
2370
|
] }),
|
|
2358
|
-
/* @__PURE__ */
|
|
2371
|
+
/* @__PURE__ */ jsx17(SidebarFooter, { children: /* @__PURE__ */ jsx17(
|
|
2359
2372
|
UserMenu,
|
|
2360
2373
|
{
|
|
2361
2374
|
user,
|
|
@@ -2366,15 +2379,15 @@ var Sidebar2 = ({
|
|
|
2366
2379
|
additionalItems: userMenuAdditionalItems
|
|
2367
2380
|
}
|
|
2368
2381
|
) }),
|
|
2369
|
-
/* @__PURE__ */
|
|
2370
|
-
deleteThreadId && /* @__PURE__ */
|
|
2382
|
+
/* @__PURE__ */ jsx17(SidebarRail, {}),
|
|
2383
|
+
deleteThreadId && /* @__PURE__ */ jsx17(AlertDialog, { open: !!deleteThreadId, onOpenChange: () => setDeleteThreadId(null), children: /* @__PURE__ */ jsxs9(AlertDialogContent, { children: [
|
|
2371
2384
|
/* @__PURE__ */ jsxs9(AlertDialogHeader, { children: [
|
|
2372
|
-
/* @__PURE__ */
|
|
2373
|
-
/* @__PURE__ */
|
|
2385
|
+
/* @__PURE__ */ jsx17(AlertDialogTitle, { children: config.labels?.deleteConfirmTitle || "Delete Conversation" }),
|
|
2386
|
+
/* @__PURE__ */ jsx17(AlertDialogDescription, { children: config.labels?.deleteConfirmDescription || "Are you sure you want to delete this conversation? This action cannot be undone." })
|
|
2374
2387
|
] }),
|
|
2375
2388
|
/* @__PURE__ */ jsxs9(AlertDialogFooter, { children: [
|
|
2376
|
-
/* @__PURE__ */
|
|
2377
|
-
/* @__PURE__ */
|
|
2389
|
+
/* @__PURE__ */ jsx17(AlertDialogCancel, { children: config.labels?.cancel || "Cancel" }),
|
|
2390
|
+
/* @__PURE__ */ jsx17(
|
|
2378
2391
|
AlertDialogAction,
|
|
2379
2392
|
{
|
|
2380
2393
|
onClick: () => deleteThreadId && handleDeleteThread(deleteThreadId),
|
|
@@ -2402,7 +2415,7 @@ import {
|
|
|
2402
2415
|
ChevronDown as ChevronDown2,
|
|
2403
2416
|
Check as Check2
|
|
2404
2417
|
} from "lucide-react";
|
|
2405
|
-
import { Fragment as Fragment3, jsx as
|
|
2418
|
+
import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2406
2419
|
var ChatHeader = ({
|
|
2407
2420
|
config,
|
|
2408
2421
|
currentThreadTitle,
|
|
@@ -2470,35 +2483,35 @@ var ChatHeader = ({
|
|
|
2470
2483
|
};
|
|
2471
2484
|
const selectedAgent = agentOptions.find((agent) => agent.id === selectedAgentId) || null;
|
|
2472
2485
|
const agentPlaceholder = config.agentSelector?.label || "Select agent";
|
|
2473
|
-
return /* @__PURE__ */
|
|
2486
|
+
return /* @__PURE__ */ jsx18(
|
|
2474
2487
|
Card,
|
|
2475
2488
|
{
|
|
2476
2489
|
"data-chat-header": true,
|
|
2477
2490
|
className: `py-0 border-b rounded-none relative z-10 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80 ${className}`,
|
|
2478
2491
|
style: isMobile ? { paddingTop: "env(safe-area-inset-top)" } : void 0,
|
|
2479
|
-
children: /* @__PURE__ */
|
|
2492
|
+
children: /* @__PURE__ */ jsx18(CardHeader, { className: "p-2", children: /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2480
2493
|
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1", children: [
|
|
2481
2494
|
/* @__PURE__ */ jsxs10(Tooltip, { children: [
|
|
2482
|
-
/* @__PURE__ */
|
|
2483
|
-
/* @__PURE__ */
|
|
2495
|
+
/* @__PURE__ */ jsx18(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx18(SidebarTrigger, { className: "-ml-1" }) }),
|
|
2496
|
+
/* @__PURE__ */ jsx18(TooltipContent, { children: config.labels?.sidebarToggle || "Toggle Sidebar" })
|
|
2484
2497
|
] }),
|
|
2485
2498
|
showAgentSelector && /* @__PURE__ */ jsxs10(DropdownMenu, { children: [
|
|
2486
|
-
/* @__PURE__ */
|
|
2499
|
+
/* @__PURE__ */ jsx18(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs10(
|
|
2487
2500
|
Button,
|
|
2488
2501
|
{
|
|
2489
2502
|
variant: "ghost",
|
|
2490
2503
|
className: "h-9 px-3 gap-1.5 font-medium text-base hover:bg-accent/50",
|
|
2491
2504
|
children: [
|
|
2492
2505
|
selectedAgent?.avatarUrl ? /* @__PURE__ */ jsxs10(Avatar, { className: "h-5 w-5", children: [
|
|
2493
|
-
/* @__PURE__ */
|
|
2494
|
-
/* @__PURE__ */
|
|
2506
|
+
/* @__PURE__ */ jsx18(AvatarImage, { src: selectedAgent.avatarUrl, alt: selectedAgent.name }),
|
|
2507
|
+
/* @__PURE__ */ jsx18(AvatarFallback, { className: "text-[10px]", children: selectedAgent.name.charAt(0).toUpperCase() })
|
|
2495
2508
|
] }) : null,
|
|
2496
|
-
/* @__PURE__ */
|
|
2497
|
-
/* @__PURE__ */
|
|
2509
|
+
/* @__PURE__ */ jsx18("span", { className: "max-w-[200px] truncate", children: selectedAgent?.name || agentPlaceholder }),
|
|
2510
|
+
/* @__PURE__ */ jsx18(ChevronDown2, { className: "h-4 w-4 opacity-50" })
|
|
2498
2511
|
]
|
|
2499
2512
|
}
|
|
2500
2513
|
) }),
|
|
2501
|
-
/* @__PURE__ */
|
|
2514
|
+
/* @__PURE__ */ jsx18(DropdownMenuContent, { align: "start", className: "w-[280px]", children: agentOptions.map((agent) => {
|
|
2502
2515
|
const isSelected = agent.id === selectedAgentId;
|
|
2503
2516
|
return /* @__PURE__ */ jsxs10(
|
|
2504
2517
|
DropdownMenuItem,
|
|
@@ -2507,15 +2520,15 @@ var ChatHeader = ({
|
|
|
2507
2520
|
className: "flex items-start gap-3 p-3 cursor-pointer",
|
|
2508
2521
|
children: [
|
|
2509
2522
|
agent.avatarUrl ? /* @__PURE__ */ jsxs10(Avatar, { className: "h-6 w-6 mt-0.5 shrink-0", children: [
|
|
2510
|
-
/* @__PURE__ */
|
|
2511
|
-
/* @__PURE__ */
|
|
2512
|
-
] }) : /* @__PURE__ */
|
|
2523
|
+
/* @__PURE__ */ jsx18(AvatarImage, { src: agent.avatarUrl, alt: agent.name }),
|
|
2524
|
+
/* @__PURE__ */ jsx18(AvatarFallback, { className: "text-[10px]", children: agent.name.charAt(0).toUpperCase() })
|
|
2525
|
+
] }) : /* @__PURE__ */ jsx18("div", { className: "h-6 w-6 mt-0.5 shrink-0 flex items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ jsx18(Bot2, { className: "h-3.5 w-3.5 text-primary" }) }),
|
|
2513
2526
|
/* @__PURE__ */ jsxs10("div", { className: "flex-1 min-w-0", children: [
|
|
2514
2527
|
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
|
|
2515
|
-
/* @__PURE__ */
|
|
2516
|
-
isSelected && /* @__PURE__ */
|
|
2528
|
+
/* @__PURE__ */ jsx18("span", { className: "font-medium text-sm", children: agent.name }),
|
|
2529
|
+
isSelected && /* @__PURE__ */ jsx18(Check2, { className: "h-4 w-4 text-primary shrink-0" })
|
|
2517
2530
|
] }),
|
|
2518
|
-
agent.description && /* @__PURE__ */
|
|
2531
|
+
agent.description && /* @__PURE__ */ jsx18("p", { className: "text-xs text-muted-foreground mt-0.5 line-clamp-2", children: agent.description })
|
|
2519
2532
|
] })
|
|
2520
2533
|
]
|
|
2521
2534
|
},
|
|
@@ -2523,59 +2536,59 @@ var ChatHeader = ({
|
|
|
2523
2536
|
);
|
|
2524
2537
|
}) })
|
|
2525
2538
|
] }),
|
|
2526
|
-
!showAgentSelector && isMobile && /* @__PURE__ */
|
|
2539
|
+
!showAgentSelector && isMobile && /* @__PURE__ */ jsx18("span", { className: "text-sm font-medium truncate max-w-[150px] ml-2", children: currentThreadTitle || config.branding?.title || "Chat" })
|
|
2527
2540
|
] }),
|
|
2528
|
-
/* @__PURE__ */
|
|
2541
|
+
/* @__PURE__ */ jsx18("div", { className: "flex-1" }),
|
|
2529
2542
|
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1", children: [
|
|
2530
2543
|
showCustomComponentButton && config.customComponent && /* @__PURE__ */ jsxs10(Tooltip, { children: [
|
|
2531
|
-
/* @__PURE__ */
|
|
2544
|
+
/* @__PURE__ */ jsx18(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx18(
|
|
2532
2545
|
Button,
|
|
2533
2546
|
{
|
|
2534
2547
|
variant: "ghost",
|
|
2535
2548
|
size: "icon",
|
|
2536
2549
|
className: "h-8 w-8",
|
|
2537
2550
|
onClick: onCustomComponentToggle,
|
|
2538
|
-
children: config.customComponent.icon || /* @__PURE__ */
|
|
2551
|
+
children: config.customComponent.icon || /* @__PURE__ */ jsx18(Menu, { className: "h-4 w-4" })
|
|
2539
2552
|
}
|
|
2540
2553
|
) }),
|
|
2541
|
-
/* @__PURE__ */
|
|
2554
|
+
/* @__PURE__ */ jsx18(TooltipContent, { children: config.customComponent.label || config.labels?.customComponentToggle || "Toggle" })
|
|
2542
2555
|
] }),
|
|
2543
2556
|
config.headerActions,
|
|
2544
2557
|
/* @__PURE__ */ jsxs10(DropdownMenu, { children: [
|
|
2545
|
-
/* @__PURE__ */
|
|
2558
|
+
/* @__PURE__ */ jsx18(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx18(Button, { variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ jsx18(MoreVertical, { className: "h-4 w-4" }) }) }),
|
|
2546
2559
|
/* @__PURE__ */ jsxs10(DropdownMenuContent, { align: "end", children: [
|
|
2547
2560
|
onNewThread && /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
2548
2561
|
/* @__PURE__ */ jsxs10(DropdownMenuItem, { onClick: () => onNewThread?.(), className: "font-medium text-primary", children: [
|
|
2549
|
-
/* @__PURE__ */
|
|
2562
|
+
/* @__PURE__ */ jsx18(Plus2, { className: "h-4 w-4 mr-2" }),
|
|
2550
2563
|
config.labels?.newThread || "New Thread"
|
|
2551
2564
|
] }),
|
|
2552
|
-
/* @__PURE__ */
|
|
2565
|
+
/* @__PURE__ */ jsx18(DropdownMenuSeparator, {})
|
|
2553
2566
|
] }),
|
|
2554
2567
|
onExportData && /* @__PURE__ */ jsxs10(DropdownMenuItem, { onClick: onExportData, children: [
|
|
2555
|
-
/* @__PURE__ */
|
|
2568
|
+
/* @__PURE__ */ jsx18(Download, { className: "h-4 w-4 mr-2" }),
|
|
2556
2569
|
config.labels?.exportData || "Export Data"
|
|
2557
2570
|
] }),
|
|
2558
2571
|
onImportData && /* @__PURE__ */ jsxs10(DropdownMenuItem, { onClick: handleImportClick, children: [
|
|
2559
|
-
/* @__PURE__ */
|
|
2572
|
+
/* @__PURE__ */ jsx18(Upload, { className: "h-4 w-4 mr-2" }),
|
|
2560
2573
|
config.labels?.importData || "Import Data"
|
|
2561
2574
|
] }),
|
|
2562
|
-
(onExportData || onImportData) && /* @__PURE__ */
|
|
2563
|
-
/* @__PURE__ */
|
|
2564
|
-
/* @__PURE__ */
|
|
2575
|
+
(onExportData || onImportData) && /* @__PURE__ */ jsx18(DropdownMenuSeparator, {}),
|
|
2576
|
+
/* @__PURE__ */ jsx18(DropdownMenuItem, { onClick: toggleDarkMode, children: isDarkMode ? /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
2577
|
+
/* @__PURE__ */ jsx18(Sun2, { className: "h-4 w-4 mr-2" }),
|
|
2565
2578
|
config.labels?.lightMode || "Light Mode"
|
|
2566
2579
|
] }) : /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
2567
|
-
/* @__PURE__ */
|
|
2580
|
+
/* @__PURE__ */ jsx18(Moon2, { className: "h-4 w-4 mr-2" }),
|
|
2568
2581
|
config.labels?.darkMode || "Dark Mode"
|
|
2569
2582
|
] }) }),
|
|
2570
2583
|
onClearAll && /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
2571
|
-
/* @__PURE__ */
|
|
2584
|
+
/* @__PURE__ */ jsx18(DropdownMenuSeparator, {}),
|
|
2572
2585
|
/* @__PURE__ */ jsxs10(
|
|
2573
2586
|
DropdownMenuItem,
|
|
2574
2587
|
{
|
|
2575
2588
|
onClick: onClearAll,
|
|
2576
2589
|
className: "text-destructive",
|
|
2577
2590
|
children: [
|
|
2578
|
-
/* @__PURE__ */
|
|
2591
|
+
/* @__PURE__ */ jsx18(Trash22, { className: "h-4 w-4 mr-2" }),
|
|
2579
2592
|
config.labels?.clearAll || "Clear All"
|
|
2580
2593
|
]
|
|
2581
2594
|
}
|
|
@@ -2594,7 +2607,7 @@ import { useState as useState6, useRef as useRef6, useCallback as useCallback3,
|
|
|
2594
2607
|
|
|
2595
2608
|
// src/components/chat/UserContext.tsx
|
|
2596
2609
|
import { createContext as createContext2, useCallback as useCallback2, useContext as useContext2, useEffect as useEffect8, useMemo as useMemo2, useState as useState5 } from "react";
|
|
2597
|
-
import { jsx as
|
|
2610
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2598
2611
|
var Ctx = createContext2(void 0);
|
|
2599
2612
|
var ChatUserContextProvider = ({ children, initial }) => {
|
|
2600
2613
|
const [ctx, setCtx] = useState5(() => ({
|
|
@@ -2620,7 +2633,7 @@ var ChatUserContextProvider = ({ children, initial }) => {
|
|
|
2620
2633
|
setContext: setPartial,
|
|
2621
2634
|
resetContext: () => setCtx({ updatedAt: Date.now() })
|
|
2622
2635
|
}), [ctx, setPartial]);
|
|
2623
|
-
return /* @__PURE__ */
|
|
2636
|
+
return /* @__PURE__ */ jsx19(Ctx.Provider, { value, children });
|
|
2624
2637
|
};
|
|
2625
2638
|
function useChatUserContext() {
|
|
2626
2639
|
const v = useContext2(Ctx);
|
|
@@ -2630,13 +2643,13 @@ function useChatUserContext() {
|
|
|
2630
2643
|
|
|
2631
2644
|
// src/components/ui/progress.tsx
|
|
2632
2645
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
2633
|
-
import { jsx as
|
|
2646
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2634
2647
|
function Progress({
|
|
2635
2648
|
className,
|
|
2636
2649
|
value,
|
|
2637
2650
|
...props
|
|
2638
2651
|
}) {
|
|
2639
|
-
return /* @__PURE__ */
|
|
2652
|
+
return /* @__PURE__ */ jsx20(
|
|
2640
2653
|
ProgressPrimitive.Root,
|
|
2641
2654
|
{
|
|
2642
2655
|
"data-slot": "progress",
|
|
@@ -2645,7 +2658,7 @@ function Progress({
|
|
|
2645
2658
|
className
|
|
2646
2659
|
),
|
|
2647
2660
|
...props,
|
|
2648
|
-
children: /* @__PURE__ */
|
|
2661
|
+
children: /* @__PURE__ */ jsx20(
|
|
2649
2662
|
ProgressPrimitive.Indicator,
|
|
2650
2663
|
{
|
|
2651
2664
|
"data-slot": "progress-indicator",
|
|
@@ -2671,7 +2684,7 @@ import {
|
|
|
2671
2684
|
Pause as Pause2,
|
|
2672
2685
|
Loader2
|
|
2673
2686
|
} from "lucide-react";
|
|
2674
|
-
import { Fragment as Fragment4, jsx as
|
|
2687
|
+
import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2675
2688
|
var FileUploadItem = memo2(function FileUploadItem2({ file, progress, onCancel }) {
|
|
2676
2689
|
const guessTypeFromName = (name) => {
|
|
2677
2690
|
const ext = (name || "").split(".").pop()?.toLowerCase();
|
|
@@ -2700,10 +2713,10 @@ var FileUploadItem = memo2(function FileUploadItem2({ file, progress, onCancel }
|
|
|
2700
2713
|
};
|
|
2701
2714
|
const getFileIcon = (type, name) => {
|
|
2702
2715
|
const t = typeof type === "string" && type.length > 0 ? type : guessTypeFromName(name);
|
|
2703
|
-
if (t.startsWith("image/")) return /* @__PURE__ */
|
|
2704
|
-
if (t.startsWith("video/")) return /* @__PURE__ */
|
|
2705
|
-
if (t.startsWith("audio/")) return /* @__PURE__ */
|
|
2706
|
-
return /* @__PURE__ */
|
|
2716
|
+
if (t.startsWith("image/")) return /* @__PURE__ */ jsx21(Image2, { className: "h-4 w-4" });
|
|
2717
|
+
if (t.startsWith("video/")) return /* @__PURE__ */ jsx21(Video, { className: "h-4 w-4" });
|
|
2718
|
+
if (t.startsWith("audio/")) return /* @__PURE__ */ jsx21(Mic, { className: "h-4 w-4" });
|
|
2719
|
+
return /* @__PURE__ */ jsx21(FileText, { className: "h-4 w-4" });
|
|
2707
2720
|
};
|
|
2708
2721
|
const formatFileSize = (bytes) => {
|
|
2709
2722
|
if (bytes === 0) return "0 Bytes";
|
|
@@ -2712,21 +2725,21 @@ var FileUploadItem = memo2(function FileUploadItem2({ file, progress, onCancel }
|
|
|
2712
2725
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
2713
2726
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
|
|
2714
2727
|
};
|
|
2715
|
-
return /* @__PURE__ */
|
|
2728
|
+
return /* @__PURE__ */ jsx21(Card, { className: "relative", children: /* @__PURE__ */ jsx21(CardContent, { className: "p-3", children: /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-3", children: [
|
|
2716
2729
|
getFileIcon(file.type, file.name),
|
|
2717
2730
|
/* @__PURE__ */ jsxs11("div", { className: "flex-1 min-w-0", children: [
|
|
2718
|
-
/* @__PURE__ */
|
|
2719
|
-
/* @__PURE__ */
|
|
2720
|
-
/* @__PURE__ */
|
|
2731
|
+
/* @__PURE__ */ jsx21("p", { className: "text-sm font-medium truncate", children: file.name }),
|
|
2732
|
+
/* @__PURE__ */ jsx21("p", { className: "text-xs text-muted-foreground", children: formatFileSize(file.size ?? 0) }),
|
|
2733
|
+
/* @__PURE__ */ jsx21(Progress, { value: progress, className: "h-1 mt-1" })
|
|
2721
2734
|
] }),
|
|
2722
|
-
/* @__PURE__ */
|
|
2735
|
+
/* @__PURE__ */ jsx21(
|
|
2723
2736
|
Button,
|
|
2724
2737
|
{
|
|
2725
2738
|
variant: "ghost",
|
|
2726
2739
|
size: "icon",
|
|
2727
2740
|
className: "h-6 w-6",
|
|
2728
2741
|
onClick: onCancel,
|
|
2729
|
-
children: /* @__PURE__ */
|
|
2742
|
+
children: /* @__PURE__ */ jsx21(X2, { className: "h-3 w-3" })
|
|
2730
2743
|
}
|
|
2731
2744
|
)
|
|
2732
2745
|
] }) }) });
|
|
@@ -2750,9 +2763,9 @@ var AttachmentPreview = memo2(function AttachmentPreview2({ attachment, onRemove
|
|
|
2750
2763
|
const minutes = Math.floor(seconds / 60);
|
|
2751
2764
|
return `${minutes}:${(seconds % 60).toString().padStart(2, "0")}`;
|
|
2752
2765
|
};
|
|
2753
|
-
return /* @__PURE__ */
|
|
2766
|
+
return /* @__PURE__ */ jsx21(Card, { className: "relative group", children: /* @__PURE__ */ jsxs11(CardContent, { className: "p-2", children: [
|
|
2754
2767
|
attachment.kind === "image" && /* @__PURE__ */ jsxs11("div", { className: "relative", children: [
|
|
2755
|
-
/* @__PURE__ */
|
|
2768
|
+
/* @__PURE__ */ jsx21(
|
|
2756
2769
|
"img",
|
|
2757
2770
|
{
|
|
2758
2771
|
src: attachment.dataUrl,
|
|
@@ -2760,19 +2773,19 @@ var AttachmentPreview = memo2(function AttachmentPreview2({ attachment, onRemove
|
|
|
2760
2773
|
className: "w-full h-20 object-cover rounded"
|
|
2761
2774
|
}
|
|
2762
2775
|
),
|
|
2763
|
-
/* @__PURE__ */
|
|
2776
|
+
/* @__PURE__ */ jsx21("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity rounded flex items-center justify-center", children: /* @__PURE__ */ jsx21(
|
|
2764
2777
|
Button,
|
|
2765
2778
|
{
|
|
2766
2779
|
variant: "destructive",
|
|
2767
2780
|
size: "icon",
|
|
2768
2781
|
className: "h-6 w-6",
|
|
2769
2782
|
onClick: onRemove,
|
|
2770
|
-
children: /* @__PURE__ */
|
|
2783
|
+
children: /* @__PURE__ */ jsx21(X2, { className: "h-3 w-3" })
|
|
2771
2784
|
}
|
|
2772
2785
|
) })
|
|
2773
2786
|
] }),
|
|
2774
2787
|
attachment.kind === "video" && /* @__PURE__ */ jsxs11("div", { className: "relative", children: [
|
|
2775
|
-
/* @__PURE__ */
|
|
2788
|
+
/* @__PURE__ */ jsx21(
|
|
2776
2789
|
"video",
|
|
2777
2790
|
{
|
|
2778
2791
|
src: attachment.dataUrl,
|
|
@@ -2781,34 +2794,34 @@ var AttachmentPreview = memo2(function AttachmentPreview2({ attachment, onRemove
|
|
|
2781
2794
|
muted: true
|
|
2782
2795
|
}
|
|
2783
2796
|
),
|
|
2784
|
-
/* @__PURE__ */
|
|
2797
|
+
/* @__PURE__ */ jsx21("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity rounded flex items-center justify-center", children: /* @__PURE__ */ jsx21(
|
|
2785
2798
|
Button,
|
|
2786
2799
|
{
|
|
2787
2800
|
variant: "destructive",
|
|
2788
2801
|
size: "icon",
|
|
2789
2802
|
className: "h-6 w-6",
|
|
2790
2803
|
onClick: onRemove,
|
|
2791
|
-
children: /* @__PURE__ */
|
|
2804
|
+
children: /* @__PURE__ */ jsx21(X2, { className: "h-3 w-3" })
|
|
2792
2805
|
}
|
|
2793
2806
|
) }),
|
|
2794
|
-
/* @__PURE__ */
|
|
2807
|
+
/* @__PURE__ */ jsx21(Badge, { className: "absolute bottom-1 right-1 text-xs", children: formatDuration(attachment.durationMs) })
|
|
2795
2808
|
] }),
|
|
2796
2809
|
attachment.kind === "audio" && /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 p-2", children: [
|
|
2797
|
-
/* @__PURE__ */
|
|
2810
|
+
/* @__PURE__ */ jsx21(
|
|
2798
2811
|
Button,
|
|
2799
2812
|
{
|
|
2800
2813
|
variant: "outline",
|
|
2801
2814
|
size: "icon",
|
|
2802
2815
|
className: "h-8 w-8",
|
|
2803
2816
|
onClick: handlePlayPause,
|
|
2804
|
-
children: isPlaying ? /* @__PURE__ */
|
|
2817
|
+
children: isPlaying ? /* @__PURE__ */ jsx21(Pause2, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx21(Play2, { className: "h-3 w-3" })
|
|
2805
2818
|
}
|
|
2806
2819
|
),
|
|
2807
2820
|
/* @__PURE__ */ jsxs11("div", { className: "flex-1", children: [
|
|
2808
|
-
/* @__PURE__ */
|
|
2809
|
-
/* @__PURE__ */
|
|
2821
|
+
/* @__PURE__ */ jsx21("p", { className: "text-xs font-medium", children: attachment.fileName || "\xC1udio" }),
|
|
2822
|
+
/* @__PURE__ */ jsx21("p", { className: "text-xs text-muted-foreground", children: formatDuration(attachment.durationMs) })
|
|
2810
2823
|
] }),
|
|
2811
|
-
/* @__PURE__ */
|
|
2824
|
+
/* @__PURE__ */ jsx21(
|
|
2812
2825
|
"audio",
|
|
2813
2826
|
{
|
|
2814
2827
|
ref: audioRef,
|
|
@@ -2818,18 +2831,18 @@ var AttachmentPreview = memo2(function AttachmentPreview2({ attachment, onRemove
|
|
|
2818
2831
|
onEnded: () => setIsPlaying(false)
|
|
2819
2832
|
}
|
|
2820
2833
|
),
|
|
2821
|
-
/* @__PURE__ */
|
|
2834
|
+
/* @__PURE__ */ jsx21(
|
|
2822
2835
|
Button,
|
|
2823
2836
|
{
|
|
2824
2837
|
variant: "ghost",
|
|
2825
2838
|
size: "icon",
|
|
2826
2839
|
className: "h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
2827
2840
|
onClick: onRemove,
|
|
2828
|
-
children: /* @__PURE__ */
|
|
2841
|
+
children: /* @__PURE__ */ jsx21(X2, { className: "h-3 w-3" })
|
|
2829
2842
|
}
|
|
2830
2843
|
)
|
|
2831
2844
|
] }),
|
|
2832
|
-
attachment.fileName && attachment.kind !== "audio" && /* @__PURE__ */
|
|
2845
|
+
attachment.fileName && attachment.kind !== "audio" && /* @__PURE__ */ jsx21("div", { className: "absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs p-1 rounded-b", children: /* @__PURE__ */ jsx21("p", { className: "truncate", children: attachment.fileName }) })
|
|
2833
2846
|
] }) });
|
|
2834
2847
|
});
|
|
2835
2848
|
var AudioRecorder = memo2(function AudioRecorder2({ isRecording, onStartRecording, onStopRecording, onCancel, recordingDuration, config }) {
|
|
@@ -2840,25 +2853,25 @@ var AudioRecorder = memo2(function AudioRecorder2({ isRecording, onStartRecordin
|
|
|
2840
2853
|
};
|
|
2841
2854
|
if (!isRecording) {
|
|
2842
2855
|
return /* @__PURE__ */ jsxs11(Tooltip, { children: [
|
|
2843
|
-
/* @__PURE__ */
|
|
2856
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
|
|
2844
2857
|
Button,
|
|
2845
2858
|
{
|
|
2846
2859
|
variant: "outline",
|
|
2847
2860
|
size: "icon",
|
|
2848
2861
|
onClick: onStartRecording,
|
|
2849
2862
|
className: "h-10 w-10",
|
|
2850
|
-
children: /* @__PURE__ */
|
|
2863
|
+
children: /* @__PURE__ */ jsx21(Mic, { className: "h-4 w-4" })
|
|
2851
2864
|
}
|
|
2852
2865
|
) }),
|
|
2853
|
-
/* @__PURE__ */
|
|
2866
|
+
/* @__PURE__ */ jsx21(TooltipContent, { children: config?.labels?.recordAudioTooltip })
|
|
2854
2867
|
] });
|
|
2855
2868
|
}
|
|
2856
|
-
return /* @__PURE__ */
|
|
2869
|
+
return /* @__PURE__ */ jsx21(Card, { className: "border-red-200 bg-red-50 dark:border-red-800 dark:bg-red-950", children: /* @__PURE__ */ jsx21(CardContent, { className: "p-3", children: /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-3", children: [
|
|
2857
2870
|
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
|
|
2858
|
-
/* @__PURE__ */
|
|
2859
|
-
/* @__PURE__ */
|
|
2871
|
+
/* @__PURE__ */ jsx21("div", { className: "h-3 w-3 bg-red-500 rounded-full animate-pulse" }),
|
|
2872
|
+
/* @__PURE__ */ jsx21("span", { className: "text-sm font-medium text-red-700 dark:text-red-300", children: "Gravando" })
|
|
2860
2873
|
] }),
|
|
2861
|
-
/* @__PURE__ */
|
|
2874
|
+
/* @__PURE__ */ jsx21(Badge, { variant: "outline", className: "text-xs", children: formatTime(recordingDuration) }),
|
|
2862
2875
|
/* @__PURE__ */ jsxs11("div", { className: "flex gap-1 ml-auto", children: [
|
|
2863
2876
|
/* @__PURE__ */ jsxs11(
|
|
2864
2877
|
Button,
|
|
@@ -2867,7 +2880,7 @@ var AudioRecorder = memo2(function AudioRecorder2({ isRecording, onStartRecordin
|
|
|
2867
2880
|
size: "sm",
|
|
2868
2881
|
onClick: onCancel,
|
|
2869
2882
|
children: [
|
|
2870
|
-
/* @__PURE__ */
|
|
2883
|
+
/* @__PURE__ */ jsx21(X2, { className: "h-3 w-3 mr-1" }),
|
|
2871
2884
|
"Cancelar"
|
|
2872
2885
|
]
|
|
2873
2886
|
}
|
|
@@ -2879,7 +2892,7 @@ var AudioRecorder = memo2(function AudioRecorder2({ isRecording, onStartRecordin
|
|
|
2879
2892
|
size: "sm",
|
|
2880
2893
|
onClick: onStopRecording,
|
|
2881
2894
|
children: [
|
|
2882
|
-
/* @__PURE__ */
|
|
2895
|
+
/* @__PURE__ */ jsx21(Square, { className: "h-3 w-3 mr-1" }),
|
|
2883
2896
|
"Parar"
|
|
2884
2897
|
]
|
|
2885
2898
|
}
|
|
@@ -3105,8 +3118,8 @@ var ChatInput = memo2(function ChatInput2({
|
|
|
3105
3118
|
onAttachmentsChange(newAttachments);
|
|
3106
3119
|
};
|
|
3107
3120
|
const canAddMoreAttachments = attachments.length < maxAttachments;
|
|
3108
|
-
return /* @__PURE__ */
|
|
3109
|
-
uploadProgress.size > 0 && /* @__PURE__ */
|
|
3121
|
+
return /* @__PURE__ */ jsx21(TooltipProvider, { children: /* @__PURE__ */ jsx21("div", { className: `border-t py-0 bg-transparent ${className}`, children: /* @__PURE__ */ jsxs11("div", { className: "px-0 md:p-2 pb-1 space-y-4 bg-transparent", children: [
|
|
3122
|
+
uploadProgress.size > 0 && /* @__PURE__ */ jsx21("div", { className: "space-y-2", children: Array.from(uploadProgress.entries()).map(([id, progress]) => /* @__PURE__ */ jsx21(
|
|
3110
3123
|
FileUploadItem,
|
|
3111
3124
|
{
|
|
3112
3125
|
file: { name: progress.fileName },
|
|
@@ -3121,7 +3134,7 @@ var ChatInput = memo2(function ChatInput2({
|
|
|
3121
3134
|
},
|
|
3122
3135
|
id
|
|
3123
3136
|
)) }),
|
|
3124
|
-
isRecording && /* @__PURE__ */
|
|
3137
|
+
isRecording && /* @__PURE__ */ jsx21(
|
|
3125
3138
|
AudioRecorder,
|
|
3126
3139
|
{
|
|
3127
3140
|
isRecording,
|
|
@@ -3132,7 +3145,7 @@ var ChatInput = memo2(function ChatInput2({
|
|
|
3132
3145
|
config
|
|
3133
3146
|
}
|
|
3134
3147
|
),
|
|
3135
|
-
attachments.length > 0 && /* @__PURE__ */
|
|
3148
|
+
attachments.length > 0 && /* @__PURE__ */ jsx21("div", { className: "grid grid-cols-4 gap-2", children: attachments.map((attachment, index) => /* @__PURE__ */ jsx21(
|
|
3136
3149
|
AttachmentPreview,
|
|
3137
3150
|
{
|
|
3138
3151
|
attachment,
|
|
@@ -3140,7 +3153,7 @@ var ChatInput = memo2(function ChatInput2({
|
|
|
3140
3153
|
},
|
|
3141
3154
|
index
|
|
3142
3155
|
)) }),
|
|
3143
|
-
/* @__PURE__ */
|
|
3156
|
+
/* @__PURE__ */ jsx21("form", { onSubmit: handleSubmit, className: "mb-1 flex justify-center", children: /* @__PURE__ */ jsxs11(
|
|
3144
3157
|
"div",
|
|
3145
3158
|
{
|
|
3146
3159
|
className: "flex items-end gap-2 p-3 border rounded-lg bg-background w-full md:min-w-3xl max-w-3xl",
|
|
@@ -3148,7 +3161,7 @@ var ChatInput = memo2(function ChatInput2({
|
|
|
3148
3161
|
onDragOver: handleDragOver,
|
|
3149
3162
|
children: [
|
|
3150
3163
|
enableFileUpload && canAddMoreAttachments && /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
3151
|
-
/* @__PURE__ */
|
|
3164
|
+
/* @__PURE__ */ jsx21(
|
|
3152
3165
|
"input",
|
|
3153
3166
|
{
|
|
3154
3167
|
ref: fileInputRef,
|
|
@@ -3160,7 +3173,7 @@ var ChatInput = memo2(function ChatInput2({
|
|
|
3160
3173
|
}
|
|
3161
3174
|
),
|
|
3162
3175
|
/* @__PURE__ */ jsxs11(Tooltip, { children: [
|
|
3163
|
-
/* @__PURE__ */
|
|
3176
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
|
|
3164
3177
|
Button,
|
|
3165
3178
|
{
|
|
3166
3179
|
type: "button",
|
|
@@ -3173,13 +3186,13 @@ var ChatInput = memo2(function ChatInput2({
|
|
|
3173
3186
|
fileInputRef.current?.click();
|
|
3174
3187
|
},
|
|
3175
3188
|
disabled,
|
|
3176
|
-
children: /* @__PURE__ */
|
|
3189
|
+
children: /* @__PURE__ */ jsx21(Paperclip, { className: "h-4 w-4" })
|
|
3177
3190
|
}
|
|
3178
3191
|
) }),
|
|
3179
|
-
/* @__PURE__ */
|
|
3192
|
+
/* @__PURE__ */ jsx21(TooltipContent, { children: config?.labels?.attachFileTooltip })
|
|
3180
3193
|
] })
|
|
3181
3194
|
] }),
|
|
3182
|
-
/* @__PURE__ */
|
|
3195
|
+
/* @__PURE__ */ jsx21("div", { className: "flex-1", children: /* @__PURE__ */ jsx21(
|
|
3183
3196
|
Textarea,
|
|
3184
3197
|
{
|
|
3185
3198
|
ref: textareaRef,
|
|
@@ -3192,7 +3205,7 @@ var ChatInput = memo2(function ChatInput2({
|
|
|
3192
3205
|
rows: 1
|
|
3193
3206
|
}
|
|
3194
3207
|
) }),
|
|
3195
|
-
enableAudioRecording && !isRecording && canAddMoreAttachments && !value.trim() && /* @__PURE__ */
|
|
3208
|
+
enableAudioRecording && !isRecording && canAddMoreAttachments && !value.trim() && /* @__PURE__ */ jsx21(
|
|
3196
3209
|
AudioRecorder,
|
|
3197
3210
|
{
|
|
3198
3211
|
isRecording,
|
|
@@ -3204,7 +3217,7 @@ var ChatInput = memo2(function ChatInput2({
|
|
|
3204
3217
|
}
|
|
3205
3218
|
),
|
|
3206
3219
|
isGenerating ? /* @__PURE__ */ jsxs11(Tooltip, { children: [
|
|
3207
|
-
/* @__PURE__ */
|
|
3220
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
|
|
3208
3221
|
Button,
|
|
3209
3222
|
{
|
|
3210
3223
|
type: "button",
|
|
@@ -3212,22 +3225,22 @@ var ChatInput = memo2(function ChatInput2({
|
|
|
3212
3225
|
size: "icon",
|
|
3213
3226
|
className: "h-10 w-10",
|
|
3214
3227
|
onClick: onStopGeneration,
|
|
3215
|
-
children: /* @__PURE__ */
|
|
3228
|
+
children: /* @__PURE__ */ jsx21(Square, { className: "h-4 w-4" })
|
|
3216
3229
|
}
|
|
3217
3230
|
) }),
|
|
3218
|
-
/* @__PURE__ */
|
|
3231
|
+
/* @__PURE__ */ jsx21(TooltipContent, { children: config?.labels?.stopGenerationTooltip })
|
|
3219
3232
|
] }) : /* @__PURE__ */ jsxs11(Tooltip, { children: [
|
|
3220
|
-
/* @__PURE__ */
|
|
3233
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
|
|
3221
3234
|
Button,
|
|
3222
3235
|
{
|
|
3223
3236
|
type: "submit",
|
|
3224
3237
|
size: "icon",
|
|
3225
3238
|
className: "h-10 w-10",
|
|
3226
3239
|
disabled: disabled || !value.trim() && attachments.length === 0,
|
|
3227
|
-
children: disabled ? /* @__PURE__ */
|
|
3240
|
+
children: disabled ? /* @__PURE__ */ jsx21(Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx21(Send, { className: "h-4 w-4" })
|
|
3228
3241
|
}
|
|
3229
3242
|
) }),
|
|
3230
|
-
/* @__PURE__ */
|
|
3243
|
+
/* @__PURE__ */ jsx21(TooltipContent, { children: config?.labels?.sendMessageTooltip })
|
|
3231
3244
|
] })
|
|
3232
3245
|
]
|
|
3233
3246
|
}
|
|
@@ -3255,7 +3268,7 @@ import { useState as useState7 } from "react";
|
|
|
3255
3268
|
// src/components/ui/scroll-area.tsx
|
|
3256
3269
|
import * as React11 from "react";
|
|
3257
3270
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
3258
|
-
import { jsx as
|
|
3271
|
+
import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3259
3272
|
var ScrollArea = React11.forwardRef(({ className, children, viewportClassName, onScroll, onScrollCapture, ...props }, ref) => {
|
|
3260
3273
|
return /* @__PURE__ */ jsxs12(
|
|
3261
3274
|
ScrollAreaPrimitive.Root,
|
|
@@ -3264,7 +3277,7 @@ var ScrollArea = React11.forwardRef(({ className, children, viewportClassName, o
|
|
|
3264
3277
|
className: cn("relative", className),
|
|
3265
3278
|
...props,
|
|
3266
3279
|
children: [
|
|
3267
|
-
/* @__PURE__ */
|
|
3280
|
+
/* @__PURE__ */ jsx22(
|
|
3268
3281
|
ScrollAreaPrimitive.Viewport,
|
|
3269
3282
|
{
|
|
3270
3283
|
ref,
|
|
@@ -3278,8 +3291,8 @@ var ScrollArea = React11.forwardRef(({ className, children, viewportClassName, o
|
|
|
3278
3291
|
children
|
|
3279
3292
|
}
|
|
3280
3293
|
),
|
|
3281
|
-
/* @__PURE__ */
|
|
3282
|
-
/* @__PURE__ */
|
|
3294
|
+
/* @__PURE__ */ jsx22(ScrollBar, {}),
|
|
3295
|
+
/* @__PURE__ */ jsx22(ScrollAreaPrimitive.Corner, {})
|
|
3283
3296
|
]
|
|
3284
3297
|
}
|
|
3285
3298
|
);
|
|
@@ -3290,7 +3303,7 @@ function ScrollBar({
|
|
|
3290
3303
|
orientation = "vertical",
|
|
3291
3304
|
...props
|
|
3292
3305
|
}) {
|
|
3293
|
-
return /* @__PURE__ */
|
|
3306
|
+
return /* @__PURE__ */ jsx22(
|
|
3294
3307
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
3295
3308
|
{
|
|
3296
3309
|
"data-slot": "scroll-area-scrollbar",
|
|
@@ -3302,7 +3315,7 @@ function ScrollBar({
|
|
|
3302
3315
|
className
|
|
3303
3316
|
),
|
|
3304
3317
|
...props,
|
|
3305
|
-
children: /* @__PURE__ */
|
|
3318
|
+
children: /* @__PURE__ */ jsx22(
|
|
3306
3319
|
ScrollAreaPrimitive.ScrollAreaThumb,
|
|
3307
3320
|
{
|
|
3308
3321
|
"data-slot": "scroll-area-thumb",
|
|
@@ -3341,7 +3354,7 @@ import {
|
|
|
3341
3354
|
Check as Check3,
|
|
3342
3355
|
X as X3
|
|
3343
3356
|
} from "lucide-react";
|
|
3344
|
-
import { Fragment as Fragment5, jsx as
|
|
3357
|
+
import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3345
3358
|
var getInitials2 = (name, email) => {
|
|
3346
3359
|
if (name) {
|
|
3347
3360
|
return name.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase();
|
|
@@ -3355,29 +3368,29 @@ var getFieldIcon = (type, key) => {
|
|
|
3355
3368
|
const iconClass = "h-4 w-4 text-muted-foreground";
|
|
3356
3369
|
switch (type) {
|
|
3357
3370
|
case "email":
|
|
3358
|
-
return /* @__PURE__ */
|
|
3371
|
+
return /* @__PURE__ */ jsx23(Mail, { className: iconClass });
|
|
3359
3372
|
case "phone":
|
|
3360
|
-
return /* @__PURE__ */
|
|
3373
|
+
return /* @__PURE__ */ jsx23(Phone, { className: iconClass });
|
|
3361
3374
|
case "url":
|
|
3362
|
-
return /* @__PURE__ */
|
|
3375
|
+
return /* @__PURE__ */ jsx23(Globe, { className: iconClass });
|
|
3363
3376
|
case "date":
|
|
3364
|
-
return /* @__PURE__ */
|
|
3377
|
+
return /* @__PURE__ */ jsx23(Calendar, { className: iconClass });
|
|
3365
3378
|
}
|
|
3366
3379
|
const lowerKey = key?.toLowerCase() || "";
|
|
3367
|
-
if (lowerKey.includes("follower")) return /* @__PURE__ */
|
|
3368
|
-
if (lowerKey.includes("following")) return /* @__PURE__ */
|
|
3369
|
-
if (lowerKey.includes("post") || lowerKey.includes("publication")) return /* @__PURE__ */
|
|
3370
|
-
if (lowerKey.includes("verified") || lowerKey.includes("badge")) return /* @__PURE__ */
|
|
3371
|
-
if (lowerKey.includes("bio")) return /* @__PURE__ */
|
|
3372
|
-
if (lowerKey.includes("email")) return /* @__PURE__ */
|
|
3373
|
-
if (lowerKey.includes("phone") || lowerKey.includes("tel")) return /* @__PURE__ */
|
|
3374
|
-
if (lowerKey.includes("location") || lowerKey.includes("address") || lowerKey.includes("city")) return /* @__PURE__ */
|
|
3375
|
-
if (lowerKey.includes("company") || lowerKey.includes("org")) return /* @__PURE__ */
|
|
3376
|
-
if (lowerKey.includes("job") || lowerKey.includes("role") || lowerKey.includes("title") || lowerKey.includes("position")) return /* @__PURE__ */
|
|
3377
|
-
if (lowerKey.includes("website") || lowerKey.includes("url") || lowerKey.includes("link")) return /* @__PURE__ */
|
|
3378
|
-
if (lowerKey.includes("username") || lowerKey.includes("handle")) return /* @__PURE__ */
|
|
3379
|
-
if (lowerKey.includes("date") || lowerKey.includes("birthday") || lowerKey.includes("joined")) return /* @__PURE__ */
|
|
3380
|
-
return /* @__PURE__ */
|
|
3380
|
+
if (lowerKey.includes("follower")) return /* @__PURE__ */ jsx23(Users, { className: iconClass });
|
|
3381
|
+
if (lowerKey.includes("following")) return /* @__PURE__ */ jsx23(UserPlus, { className: iconClass });
|
|
3382
|
+
if (lowerKey.includes("post") || lowerKey.includes("publication")) return /* @__PURE__ */ jsx23(Image3, { className: iconClass });
|
|
3383
|
+
if (lowerKey.includes("verified") || lowerKey.includes("badge")) return /* @__PURE__ */ jsx23(BadgeCheck, { className: iconClass });
|
|
3384
|
+
if (lowerKey.includes("bio")) return /* @__PURE__ */ jsx23(FileText2, { className: iconClass });
|
|
3385
|
+
if (lowerKey.includes("email")) return /* @__PURE__ */ jsx23(Mail, { className: iconClass });
|
|
3386
|
+
if (lowerKey.includes("phone") || lowerKey.includes("tel")) return /* @__PURE__ */ jsx23(Phone, { className: iconClass });
|
|
3387
|
+
if (lowerKey.includes("location") || lowerKey.includes("address") || lowerKey.includes("city")) return /* @__PURE__ */ jsx23(MapPin, { className: iconClass });
|
|
3388
|
+
if (lowerKey.includes("company") || lowerKey.includes("org")) return /* @__PURE__ */ jsx23(Building, { className: iconClass });
|
|
3389
|
+
if (lowerKey.includes("job") || lowerKey.includes("role") || lowerKey.includes("title") || lowerKey.includes("position")) return /* @__PURE__ */ jsx23(Briefcase, { className: iconClass });
|
|
3390
|
+
if (lowerKey.includes("website") || lowerKey.includes("url") || lowerKey.includes("link")) return /* @__PURE__ */ jsx23(Globe, { className: iconClass });
|
|
3391
|
+
if (lowerKey.includes("username") || lowerKey.includes("handle")) return /* @__PURE__ */ jsx23(AtSign, { className: iconClass });
|
|
3392
|
+
if (lowerKey.includes("date") || lowerKey.includes("birthday") || lowerKey.includes("joined")) return /* @__PURE__ */ jsx23(Calendar, { className: iconClass });
|
|
3393
|
+
return /* @__PURE__ */ jsx23(User2, { className: iconClass });
|
|
3381
3394
|
};
|
|
3382
3395
|
var formatValue = (value, type, key) => {
|
|
3383
3396
|
if (value === null || value === void 0) return "-";
|
|
@@ -3411,15 +3424,15 @@ var getMemoryCategoryIcon = (category) => {
|
|
|
3411
3424
|
const iconClass = "h-4 w-4 text-muted-foreground";
|
|
3412
3425
|
switch (category) {
|
|
3413
3426
|
case "preference":
|
|
3414
|
-
return /* @__PURE__ */
|
|
3427
|
+
return /* @__PURE__ */ jsx23(Heart, { className: iconClass });
|
|
3415
3428
|
case "fact":
|
|
3416
|
-
return /* @__PURE__ */
|
|
3429
|
+
return /* @__PURE__ */ jsx23(Info, { className: iconClass });
|
|
3417
3430
|
case "goal":
|
|
3418
|
-
return /* @__PURE__ */
|
|
3431
|
+
return /* @__PURE__ */ jsx23(Target, { className: iconClass });
|
|
3419
3432
|
case "context":
|
|
3420
|
-
return /* @__PURE__ */
|
|
3433
|
+
return /* @__PURE__ */ jsx23(Lightbulb, { className: iconClass });
|
|
3421
3434
|
default:
|
|
3422
|
-
return /* @__PURE__ */
|
|
3435
|
+
return /* @__PURE__ */ jsx23(Brain, { className: iconClass });
|
|
3423
3436
|
}
|
|
3424
3437
|
};
|
|
3425
3438
|
var getMemoryCategoryLabel = (category) => {
|
|
@@ -3489,66 +3502,66 @@ var UserProfile = ({
|
|
|
3489
3502
|
const displayName = user?.name || user?.email?.split("@")[0] || "User";
|
|
3490
3503
|
const initials = getInitials2(user?.name, user?.email);
|
|
3491
3504
|
const normalizedFields = normalizeCustomFields(customFields);
|
|
3492
|
-
return /* @__PURE__ */
|
|
3505
|
+
return /* @__PURE__ */ jsx23(Sheet, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs13(
|
|
3493
3506
|
SheetContent,
|
|
3494
3507
|
{
|
|
3495
3508
|
side: "right",
|
|
3496
3509
|
className: cn("w-full sm:max-w-md p-0 flex flex-col h-full overflow-hidden", className),
|
|
3497
3510
|
children: [
|
|
3498
|
-
/* @__PURE__ */
|
|
3499
|
-
/* @__PURE__ */
|
|
3511
|
+
/* @__PURE__ */ jsx23(SheetHeader, { className: "px-6 py-4 border-b shrink-0", children: /* @__PURE__ */ jsx23("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsx23(SheetTitle, { children: labels.title }) }) }),
|
|
3512
|
+
/* @__PURE__ */ jsx23(ScrollArea, { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxs13("div", { className: "p-6 space-y-6", children: [
|
|
3500
3513
|
/* @__PURE__ */ jsxs13("div", { className: "flex flex-col items-center text-center space-y-4", children: [
|
|
3501
3514
|
/* @__PURE__ */ jsxs13(Avatar, { className: "h-24 w-24 shrink-0", children: [
|
|
3502
|
-
user?.avatar && /* @__PURE__ */
|
|
3503
|
-
/* @__PURE__ */
|
|
3515
|
+
user?.avatar && /* @__PURE__ */ jsx23(AvatarImage, { src: user.avatar, alt: displayName }),
|
|
3516
|
+
/* @__PURE__ */ jsx23(AvatarFallback, { className: "text-2xl bg-primary/10 text-primary", children: initials })
|
|
3504
3517
|
] }),
|
|
3505
3518
|
/* @__PURE__ */ jsxs13("div", { className: "w-full px-2", children: [
|
|
3506
|
-
/* @__PURE__ */
|
|
3507
|
-
user?.email && /* @__PURE__ */
|
|
3519
|
+
/* @__PURE__ */ jsx23("h2", { className: "text-xl font-semibold break-words", children: displayName }),
|
|
3520
|
+
user?.email && /* @__PURE__ */ jsx23("p", { className: "text-sm text-muted-foreground break-words", children: user.email })
|
|
3508
3521
|
] })
|
|
3509
3522
|
] }),
|
|
3510
|
-
/* @__PURE__ */
|
|
3523
|
+
/* @__PURE__ */ jsx23(Separator, {}),
|
|
3511
3524
|
/* @__PURE__ */ jsxs13("div", { className: "space-y-3", children: [
|
|
3512
|
-
/* @__PURE__ */
|
|
3525
|
+
/* @__PURE__ */ jsx23("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: labels.basicInfo }),
|
|
3513
3526
|
/* @__PURE__ */ jsxs13("div", { className: "space-y-2", children: [
|
|
3514
3527
|
/* @__PURE__ */ jsxs13("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
|
|
3515
|
-
/* @__PURE__ */
|
|
3528
|
+
/* @__PURE__ */ jsx23(User2, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
3516
3529
|
/* @__PURE__ */ jsxs13("div", { className: "flex-1 min-w-0", children: [
|
|
3517
|
-
/* @__PURE__ */
|
|
3518
|
-
/* @__PURE__ */
|
|
3530
|
+
/* @__PURE__ */ jsx23("p", { className: "text-xs text-muted-foreground", children: "Name" }),
|
|
3531
|
+
/* @__PURE__ */ jsx23("p", { className: "text-sm font-medium break-words", children: displayName })
|
|
3519
3532
|
] })
|
|
3520
3533
|
] }),
|
|
3521
3534
|
user?.email && /* @__PURE__ */ jsxs13("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
|
|
3522
|
-
/* @__PURE__ */
|
|
3535
|
+
/* @__PURE__ */ jsx23(AtSign, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
3523
3536
|
/* @__PURE__ */ jsxs13("div", { className: "flex-1 min-w-0", children: [
|
|
3524
|
-
/* @__PURE__ */
|
|
3525
|
-
/* @__PURE__ */
|
|
3537
|
+
/* @__PURE__ */ jsx23("p", { className: "text-xs text-muted-foreground", children: "Handle" }),
|
|
3538
|
+
/* @__PURE__ */ jsx23("p", { className: "text-sm font-medium break-words", children: user.email })
|
|
3526
3539
|
] })
|
|
3527
3540
|
] }),
|
|
3528
3541
|
user?.id && user.id !== user?.name && user.id !== user?.email && /* @__PURE__ */ jsxs13("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
|
|
3529
|
-
/* @__PURE__ */
|
|
3542
|
+
/* @__PURE__ */ jsx23(User2, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
3530
3543
|
/* @__PURE__ */ jsxs13("div", { className: "flex-1 min-w-0", children: [
|
|
3531
|
-
/* @__PURE__ */
|
|
3532
|
-
/* @__PURE__ */
|
|
3544
|
+
/* @__PURE__ */ jsx23("p", { className: "text-xs text-muted-foreground", children: "ID" }),
|
|
3545
|
+
/* @__PURE__ */ jsx23("p", { className: "text-sm font-medium break-words", children: user.id })
|
|
3533
3546
|
] })
|
|
3534
3547
|
] })
|
|
3535
3548
|
] })
|
|
3536
3549
|
] }),
|
|
3537
3550
|
normalizedFields.length > 0 && /* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
3538
|
-
/* @__PURE__ */
|
|
3551
|
+
/* @__PURE__ */ jsx23(Separator, {}),
|
|
3539
3552
|
/* @__PURE__ */ jsxs13("div", { className: "space-y-3", children: [
|
|
3540
|
-
/* @__PURE__ */
|
|
3541
|
-
/* @__PURE__ */
|
|
3553
|
+
/* @__PURE__ */ jsx23("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: labels.customFields }),
|
|
3554
|
+
/* @__PURE__ */ jsx23("div", { className: "space-y-2", children: normalizedFields.map((field) => {
|
|
3542
3555
|
const isBioField = field.key.toLowerCase().includes("bio");
|
|
3543
3556
|
return /* @__PURE__ */ jsxs13(
|
|
3544
3557
|
"div",
|
|
3545
3558
|
{
|
|
3546
3559
|
className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50",
|
|
3547
3560
|
children: [
|
|
3548
|
-
/* @__PURE__ */
|
|
3561
|
+
/* @__PURE__ */ jsx23("div", { className: "mt-0.5 shrink-0", children: field.icon || getFieldIcon(field.type, field.key) }),
|
|
3549
3562
|
/* @__PURE__ */ jsxs13("div", { className: "flex-1 min-w-0", children: [
|
|
3550
|
-
/* @__PURE__ */
|
|
3551
|
-
/* @__PURE__ */
|
|
3563
|
+
/* @__PURE__ */ jsx23("p", { className: "text-xs text-muted-foreground", children: field.label }),
|
|
3564
|
+
/* @__PURE__ */ jsx23("p", { className: cn(
|
|
3552
3565
|
"text-sm font-medium",
|
|
3553
3566
|
isBioField ? "whitespace-pre-wrap break-words" : "break-words"
|
|
3554
3567
|
), children: formatValue(field.value, field.type, field.key) })
|
|
@@ -3560,26 +3573,26 @@ var UserProfile = ({
|
|
|
3560
3573
|
}) })
|
|
3561
3574
|
] })
|
|
3562
3575
|
] }),
|
|
3563
|
-
/* @__PURE__ */
|
|
3576
|
+
/* @__PURE__ */ jsx23(Separator, {}),
|
|
3564
3577
|
/* @__PURE__ */ jsxs13("div", { className: "space-y-3", children: [
|
|
3565
3578
|
/* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between", children: [
|
|
3566
3579
|
/* @__PURE__ */ jsxs13("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider flex items-center gap-2", children: [
|
|
3567
|
-
/* @__PURE__ */
|
|
3580
|
+
/* @__PURE__ */ jsx23(Brain, { className: "h-4 w-4" }),
|
|
3568
3581
|
labels.memories
|
|
3569
3582
|
] }),
|
|
3570
|
-
onAddMemory && /* @__PURE__ */
|
|
3583
|
+
onAddMemory && /* @__PURE__ */ jsx23(
|
|
3571
3584
|
Button,
|
|
3572
3585
|
{
|
|
3573
3586
|
variant: "ghost",
|
|
3574
3587
|
size: "sm",
|
|
3575
3588
|
className: "h-7 px-2",
|
|
3576
3589
|
onClick: () => setIsAddingMemory(true),
|
|
3577
|
-
children: /* @__PURE__ */
|
|
3590
|
+
children: /* @__PURE__ */ jsx23(Plus3, { className: "h-4 w-4" })
|
|
3578
3591
|
}
|
|
3579
3592
|
)
|
|
3580
3593
|
] }),
|
|
3581
3594
|
isAddingMemory && onAddMemory && /* @__PURE__ */ jsxs13("div", { className: "flex gap-2", children: [
|
|
3582
|
-
/* @__PURE__ */
|
|
3595
|
+
/* @__PURE__ */ jsx23(
|
|
3583
3596
|
Input,
|
|
3584
3597
|
{
|
|
3585
3598
|
value: newMemoryContent,
|
|
@@ -3596,24 +3609,24 @@ var UserProfile = ({
|
|
|
3596
3609
|
autoFocus: true
|
|
3597
3610
|
}
|
|
3598
3611
|
),
|
|
3599
|
-
/* @__PURE__ */
|
|
3612
|
+
/* @__PURE__ */ jsx23(Button, { size: "sm", onClick: handleAddMemory, disabled: !newMemoryContent.trim(), children: "Salvar" })
|
|
3600
3613
|
] }),
|
|
3601
|
-
/* @__PURE__ */
|
|
3614
|
+
/* @__PURE__ */ jsx23("div", { className: "space-y-2", children: memories.length === 0 ? /* @__PURE__ */ jsx23("p", { className: "text-sm text-muted-foreground text-center py-4", children: labels.noMemories }) : memories.map((memory) => {
|
|
3602
3615
|
const isEditing = editingMemoryId === memory.id;
|
|
3603
3616
|
return /* @__PURE__ */ jsxs13(
|
|
3604
3617
|
"div",
|
|
3605
3618
|
{
|
|
3606
3619
|
className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50 group",
|
|
3607
3620
|
children: [
|
|
3608
|
-
/* @__PURE__ */
|
|
3621
|
+
/* @__PURE__ */ jsx23("div", { className: "mt-0.5 shrink-0", children: memory.source === "agent" ? /* @__PURE__ */ jsx23(Bot3, { className: "h-4 w-4 text-primary" }) : getMemoryCategoryIcon(memory.category) }),
|
|
3609
3622
|
/* @__PURE__ */ jsxs13("div", { className: "flex-1 min-w-0", children: [
|
|
3610
3623
|
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 mb-0.5", children: [
|
|
3611
|
-
/* @__PURE__ */
|
|
3612
|
-
/* @__PURE__ */
|
|
3613
|
-
/* @__PURE__ */
|
|
3624
|
+
/* @__PURE__ */ jsx23("span", { className: "text-xs text-muted-foreground", children: getMemoryCategoryLabel(memory.category) }),
|
|
3625
|
+
/* @__PURE__ */ jsx23("span", { className: "text-xs text-muted-foreground", children: "\u2022" }),
|
|
3626
|
+
/* @__PURE__ */ jsx23("span", { className: "text-xs text-muted-foreground", children: memory.source === "agent" ? "IA" : "Voc\xEA" })
|
|
3614
3627
|
] }),
|
|
3615
3628
|
isEditing ? /* @__PURE__ */ jsxs13("div", { className: "space-y-2", children: [
|
|
3616
|
-
/* @__PURE__ */
|
|
3629
|
+
/* @__PURE__ */ jsx23(
|
|
3617
3630
|
Textarea,
|
|
3618
3631
|
{
|
|
3619
3632
|
value: editingMemoryContent,
|
|
@@ -3639,7 +3652,7 @@ var UserProfile = ({
|
|
|
3639
3652
|
className: "h-7 px-2",
|
|
3640
3653
|
onClick: handleCancelEdit,
|
|
3641
3654
|
children: [
|
|
3642
|
-
/* @__PURE__ */
|
|
3655
|
+
/* @__PURE__ */ jsx23(X3, { className: "h-3.5 w-3.5 mr-1" }),
|
|
3643
3656
|
"Cancelar"
|
|
3644
3657
|
]
|
|
3645
3658
|
}
|
|
@@ -3652,33 +3665,33 @@ var UserProfile = ({
|
|
|
3652
3665
|
onClick: handleSaveEdit,
|
|
3653
3666
|
disabled: !editingMemoryContent.trim(),
|
|
3654
3667
|
children: [
|
|
3655
|
-
/* @__PURE__ */
|
|
3668
|
+
/* @__PURE__ */ jsx23(Check3, { className: "h-3.5 w-3.5 mr-1" }),
|
|
3656
3669
|
"Salvar"
|
|
3657
3670
|
]
|
|
3658
3671
|
}
|
|
3659
3672
|
)
|
|
3660
3673
|
] })
|
|
3661
|
-
] }) : /* @__PURE__ */
|
|
3674
|
+
] }) : /* @__PURE__ */ jsx23("p", { className: "text-sm break-words", children: memory.content })
|
|
3662
3675
|
] }),
|
|
3663
3676
|
!isEditing && (onUpdateMemory || onDeleteMemory) && /* @__PURE__ */ jsxs13("div", { className: "flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity shrink-0", children: [
|
|
3664
|
-
onUpdateMemory && /* @__PURE__ */
|
|
3677
|
+
onUpdateMemory && /* @__PURE__ */ jsx23(
|
|
3665
3678
|
Button,
|
|
3666
3679
|
{
|
|
3667
3680
|
variant: "ghost",
|
|
3668
3681
|
size: "icon",
|
|
3669
3682
|
className: "h-7 w-7",
|
|
3670
3683
|
onClick: () => handleStartEdit(memory),
|
|
3671
|
-
children: /* @__PURE__ */
|
|
3684
|
+
children: /* @__PURE__ */ jsx23(Pencil, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
3672
3685
|
}
|
|
3673
3686
|
),
|
|
3674
|
-
onDeleteMemory && /* @__PURE__ */
|
|
3687
|
+
onDeleteMemory && /* @__PURE__ */ jsx23(
|
|
3675
3688
|
Button,
|
|
3676
3689
|
{
|
|
3677
3690
|
variant: "ghost",
|
|
3678
3691
|
size: "icon",
|
|
3679
3692
|
className: "h-7 w-7",
|
|
3680
3693
|
onClick: () => onDeleteMemory(memory.id),
|
|
3681
|
-
children: /* @__PURE__ */
|
|
3694
|
+
children: /* @__PURE__ */ jsx23(Trash23, { className: "h-3.5 w-3.5 text-destructive" })
|
|
3682
3695
|
}
|
|
3683
3696
|
)
|
|
3684
3697
|
] })
|
|
@@ -3690,7 +3703,7 @@ var UserProfile = ({
|
|
|
3690
3703
|
] })
|
|
3691
3704
|
] }) }),
|
|
3692
3705
|
/* @__PURE__ */ jsxs13("div", { className: "p-4 border-t space-y-2 shrink-0", children: [
|
|
3693
|
-
onEditProfile && /* @__PURE__ */
|
|
3706
|
+
onEditProfile && /* @__PURE__ */ jsx23(
|
|
3694
3707
|
Button,
|
|
3695
3708
|
{
|
|
3696
3709
|
variant: "outline",
|
|
@@ -3699,7 +3712,7 @@ var UserProfile = ({
|
|
|
3699
3712
|
children: "Edit Profile"
|
|
3700
3713
|
}
|
|
3701
3714
|
),
|
|
3702
|
-
onLogout && /* @__PURE__ */
|
|
3715
|
+
onLogout && /* @__PURE__ */ jsx23(
|
|
3703
3716
|
Button,
|
|
3704
3717
|
{
|
|
3705
3718
|
variant: "destructive",
|
|
@@ -3716,7 +3729,7 @@ var UserProfile = ({
|
|
|
3716
3729
|
|
|
3717
3730
|
// src/components/chat/ChatUI.tsx
|
|
3718
3731
|
import { Sparkles, ArrowRight, MessageSquare, Lightbulb as Lightbulb2, Zap, HelpCircle } from "lucide-react";
|
|
3719
|
-
import { jsx as
|
|
3732
|
+
import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3720
3733
|
var ChatUI = ({
|
|
3721
3734
|
messages = [],
|
|
3722
3735
|
threads = [],
|
|
@@ -3724,6 +3737,7 @@ var ChatUI = ({
|
|
|
3724
3737
|
config: userConfig,
|
|
3725
3738
|
sidebar: _sidebar,
|
|
3726
3739
|
isGenerating = false,
|
|
3740
|
+
isMessagesLoading = false,
|
|
3727
3741
|
callbacks = {},
|
|
3728
3742
|
user,
|
|
3729
3743
|
assistant,
|
|
@@ -3905,11 +3919,11 @@ var ChatUI = ({
|
|
|
3905
3919
|
if (messages.length > 0 || !suggestions.length) return null;
|
|
3906
3920
|
return /* @__PURE__ */ jsxs14("div", { className: "flex flex-col items-center justify-center min-h-[60vh] py-8 px-4", children: [
|
|
3907
3921
|
/* @__PURE__ */ jsxs14("div", { className: "text-center mb-8", children: [
|
|
3908
|
-
/* @__PURE__ */
|
|
3909
|
-
/* @__PURE__ */
|
|
3910
|
-
/* @__PURE__ */
|
|
3922
|
+
/* @__PURE__ */ jsx24("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__ */ jsx24(Sparkles, { className: "w-7 h-7 text-primary" }) }),
|
|
3923
|
+
/* @__PURE__ */ jsx24("h2", { className: "text-xl font-semibold mb-2", children: config.branding.title }),
|
|
3924
|
+
/* @__PURE__ */ jsx24("p", { className: "text-muted-foreground text-sm max-w-md", children: config.branding.subtitle })
|
|
3911
3925
|
] }),
|
|
3912
|
-
/* @__PURE__ */
|
|
3926
|
+
/* @__PURE__ */ jsx24("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 w-full max-w-2xl", children: suggestions.map((suggestion, index) => /* @__PURE__ */ jsxs14(
|
|
3913
3927
|
"button",
|
|
3914
3928
|
{
|
|
3915
3929
|
type: "button",
|
|
@@ -3918,10 +3932,10 @@ var ChatUI = ({
|
|
|
3918
3932
|
children: [
|
|
3919
3933
|
(() => {
|
|
3920
3934
|
const IconComponent = SuggestionIconComponents[index % SuggestionIconComponents.length];
|
|
3921
|
-
return /* @__PURE__ */
|
|
3935
|
+
return /* @__PURE__ */ jsx24("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__ */ jsx24(IconComponent, { className: "h-4 w-4" }) });
|
|
3922
3936
|
})(),
|
|
3923
|
-
/* @__PURE__ */
|
|
3924
|
-
/* @__PURE__ */
|
|
3937
|
+
/* @__PURE__ */ jsx24("div", { className: "flex-1 min-w-0 pr-6", children: /* @__PURE__ */ jsx24("p", { className: "text-sm font-medium leading-snug line-clamp-2", children: suggestion }) }),
|
|
3938
|
+
/* @__PURE__ */ jsx24(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" })
|
|
3925
3939
|
]
|
|
3926
3940
|
},
|
|
3927
3941
|
index
|
|
@@ -3931,25 +3945,44 @@ var ChatUI = ({
|
|
|
3931
3945
|
const renderInlineSuggestions = (messageId) => {
|
|
3932
3946
|
const items = messageSuggestions?.[messageId];
|
|
3933
3947
|
if (!items || items.length === 0) return null;
|
|
3934
|
-
return /* @__PURE__ */
|
|
3948
|
+
return /* @__PURE__ */ jsx24("div", { className: "flex flex-wrap gap-2 mt-2 ml-11", children: items.map((suggestion, index) => /* @__PURE__ */ jsxs14(
|
|
3935
3949
|
"button",
|
|
3936
3950
|
{
|
|
3937
3951
|
type: "button",
|
|
3938
3952
|
onClick: () => handleSendMessage(suggestion),
|
|
3939
3953
|
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",
|
|
3940
3954
|
children: [
|
|
3941
|
-
/* @__PURE__ */
|
|
3942
|
-
/* @__PURE__ */
|
|
3955
|
+
/* @__PURE__ */ jsx24(Sparkles, { className: "h-3 w-3 text-primary opacity-70 group-hover:opacity-100" }),
|
|
3956
|
+
/* @__PURE__ */ jsx24("span", { className: "max-w-[200px] truncate", children: suggestion })
|
|
3943
3957
|
]
|
|
3944
3958
|
},
|
|
3945
3959
|
`${messageId}-suggestion-${index}`
|
|
3946
3960
|
)) });
|
|
3947
3961
|
};
|
|
3962
|
+
const renderMessageLoadingSkeleton = () => /* @__PURE__ */ jsx24("div", { className: "space-y-6 py-2", children: [0, 1, 2, 3].map((index) => {
|
|
3963
|
+
const isUserRow = index % 2 === 1;
|
|
3964
|
+
return /* @__PURE__ */ jsxs14(
|
|
3965
|
+
"div",
|
|
3966
|
+
{
|
|
3967
|
+
className: `flex gap-3 ${isUserRow ? "justify-end" : "justify-start"}`,
|
|
3968
|
+
children: [
|
|
3969
|
+
!isUserRow && /* @__PURE__ */ jsx24(Skeleton, { className: "h-8 w-8 rounded-full shrink-0" }),
|
|
3970
|
+
/* @__PURE__ */ jsxs14("div", { className: `space-y-2 ${isUserRow ? "w-[70%]" : "w-[75%]"}`, children: [
|
|
3971
|
+
/* @__PURE__ */ jsx24(Skeleton, { className: "h-4 w-24" }),
|
|
3972
|
+
/* @__PURE__ */ jsx24(Skeleton, { className: "h-4 w-full" }),
|
|
3973
|
+
/* @__PURE__ */ jsx24(Skeleton, { className: "h-4 w-[85%]" })
|
|
3974
|
+
] }),
|
|
3975
|
+
isUserRow && /* @__PURE__ */ jsx24(Skeleton, { className: "h-8 w-8 rounded-full shrink-0" })
|
|
3976
|
+
]
|
|
3977
|
+
},
|
|
3978
|
+
`message-skeleton-${index}`
|
|
3979
|
+
);
|
|
3980
|
+
}) });
|
|
3948
3981
|
const shouldShowAgentSelector = Boolean(
|
|
3949
3982
|
config.agentSelector?.enabled && onSelectAgent && agentOptions.length > 0 && (!config.agentSelector?.hideIfSingle || agentOptions.length > 1)
|
|
3950
3983
|
);
|
|
3951
|
-
return /* @__PURE__ */
|
|
3952
|
-
/* @__PURE__ */
|
|
3984
|
+
return /* @__PURE__ */ jsx24(TooltipProvider, { children: /* @__PURE__ */ jsx24(SidebarProvider, { defaultOpen: true, children: /* @__PURE__ */ jsxs14("div", { className: `flex h-[100svh] md:h-screen bg-background w-full overflow-hidden ${className}`, children: [
|
|
3985
|
+
/* @__PURE__ */ jsx24(
|
|
3953
3986
|
Sidebar2,
|
|
3954
3987
|
{
|
|
3955
3988
|
threads,
|
|
@@ -3979,8 +4012,8 @@ var ChatUI = ({
|
|
|
3979
4012
|
showThemeOptions: !!callbacks.onThemeChange
|
|
3980
4013
|
}
|
|
3981
4014
|
),
|
|
3982
|
-
/* @__PURE__ */
|
|
3983
|
-
/* @__PURE__ */
|
|
4015
|
+
/* @__PURE__ */ jsx24(SidebarInset, { children: /* @__PURE__ */ jsxs14("div", { className: "flex flex-col h-full min-h-0", children: [
|
|
4016
|
+
/* @__PURE__ */ jsx24(
|
|
3984
4017
|
ChatHeader,
|
|
3985
4018
|
{
|
|
3986
4019
|
config,
|
|
@@ -3997,7 +4030,7 @@ var ChatUI = ({
|
|
|
3997
4030
|
),
|
|
3998
4031
|
/* @__PURE__ */ jsxs14("div", { className: "flex flex-1 flex-row min-h-0 overflow-hidden", children: [
|
|
3999
4032
|
/* @__PURE__ */ jsxs14("div", { className: "flex-1 flex flex-col min-h-0", children: [
|
|
4000
|
-
/* @__PURE__ */
|
|
4033
|
+
/* @__PURE__ */ jsx24(
|
|
4001
4034
|
ScrollArea,
|
|
4002
4035
|
{
|
|
4003
4036
|
ref: scrollAreaRef,
|
|
@@ -4005,40 +4038,42 @@ var ChatUI = ({
|
|
|
4005
4038
|
viewportClassName: "p-4 overscroll-contain",
|
|
4006
4039
|
onScrollCapture: handleScroll,
|
|
4007
4040
|
children: /* @__PURE__ */ jsxs14("div", { className: "max-w-4xl mx-auto space-y-4 pb-4", children: [
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
/* @__PURE__ */
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4041
|
+
isMessagesLoading ? renderMessageLoadingSkeleton() : /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
4042
|
+
renderSuggestions(),
|
|
4043
|
+
messages.map((message, index) => {
|
|
4044
|
+
const prevMessage = index > 0 ? messages[index - 1] : null;
|
|
4045
|
+
const isGrouped = prevMessage !== null && prevMessage.role === message.role;
|
|
4046
|
+
return /* @__PURE__ */ jsxs14("div", { className: isGrouped ? "space-y-1 -mt-2" : "space-y-2", children: [
|
|
4047
|
+
/* @__PURE__ */ jsx24(
|
|
4048
|
+
Message,
|
|
4049
|
+
{
|
|
4050
|
+
message,
|
|
4051
|
+
userAvatar: user?.avatar,
|
|
4052
|
+
userName: user?.name,
|
|
4053
|
+
assistantAvatar: assistant?.avatar,
|
|
4054
|
+
assistantName: assistant?.name,
|
|
4055
|
+
showTimestamp: config.ui.showTimestamps,
|
|
4056
|
+
showAvatar: config.ui.showAvatars,
|
|
4057
|
+
enableCopy: config.features.enableMessageCopy,
|
|
4058
|
+
enableEdit: config.features.enableMessageEditing,
|
|
4059
|
+
enableRegenerate: config.features.enableRegeneration,
|
|
4060
|
+
enableToolCallsDisplay: config.features.enableToolCallsDisplay,
|
|
4061
|
+
compactMode: config.ui.compactMode,
|
|
4062
|
+
onAction: handleMessageAction,
|
|
4063
|
+
toolUsedLabel: config.labels.toolUsed,
|
|
4064
|
+
thinkingLabel: config.labels.thinking,
|
|
4065
|
+
isGrouped
|
|
4066
|
+
}
|
|
4067
|
+
),
|
|
4068
|
+
message.role === "assistant" && renderInlineSuggestions(message.id)
|
|
4069
|
+
] }, message.id);
|
|
4070
|
+
})
|
|
4071
|
+
] }),
|
|
4072
|
+
/* @__PURE__ */ jsx24("div", { ref: messagesEndRef })
|
|
4038
4073
|
] })
|
|
4039
4074
|
}
|
|
4040
4075
|
),
|
|
4041
|
-
/* @__PURE__ */
|
|
4076
|
+
/* @__PURE__ */ jsx24("div", { className: "bg-background pb-[env(safe-area-inset-bottom)]", children: /* @__PURE__ */ jsx24(
|
|
4042
4077
|
ChatInput,
|
|
4043
4078
|
{
|
|
4044
4079
|
value: inputValue,
|
|
@@ -4064,17 +4099,17 @@ var ChatUI = ({
|
|
|
4064
4099
|
}
|
|
4065
4100
|
) })
|
|
4066
4101
|
] }),
|
|
4067
|
-
config?.customComponent?.component && !isMobile && /* @__PURE__ */
|
|
4102
|
+
config?.customComponent?.component && !isMobile && /* @__PURE__ */ jsx24(
|
|
4068
4103
|
"div",
|
|
4069
4104
|
{
|
|
4070
4105
|
className: `h-full transition-all duration-300 ease-in-out overflow-hidden ${state.showSidebar ? "w-80" : "w-0"}`,
|
|
4071
|
-
children: state.showSidebar && /* @__PURE__ */
|
|
4106
|
+
children: state.showSidebar && /* @__PURE__ */ jsx24("div", { className: "flex flex-col h-full border-l bg-background animate-in slide-in-from-right-4 duration-300 w-80", children: renderCustomComponent() })
|
|
4072
4107
|
}
|
|
4073
4108
|
)
|
|
4074
4109
|
] })
|
|
4075
4110
|
] }) }),
|
|
4076
4111
|
isCustomMounted && config.customComponent?.component && isMobile && /* @__PURE__ */ jsxs14("div", { className: "fixed inset-0 z-50", children: [
|
|
4077
|
-
/* @__PURE__ */
|
|
4112
|
+
/* @__PURE__ */ jsx24(
|
|
4078
4113
|
"div",
|
|
4079
4114
|
{
|
|
4080
4115
|
className: `absolute inset-0 bg-background/80 backdrop-blur-sm transition-opacity duration-200 ease-out ${isCustomVisible ? "opacity-100" : "opacity-0"}`,
|
|
@@ -4082,16 +4117,16 @@ var ChatUI = ({
|
|
|
4082
4117
|
onClick: closeSidebar
|
|
4083
4118
|
}
|
|
4084
4119
|
),
|
|
4085
|
-
/* @__PURE__ */
|
|
4120
|
+
/* @__PURE__ */ jsx24(
|
|
4086
4121
|
"div",
|
|
4087
4122
|
{
|
|
4088
4123
|
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"}`,
|
|
4089
4124
|
style: { willChange: "transform" },
|
|
4090
|
-
children: /* @__PURE__ */
|
|
4125
|
+
children: /* @__PURE__ */ jsx24("div", { className: "h-full flex flex-col", children: renderCustomComponent() })
|
|
4091
4126
|
}
|
|
4092
4127
|
)
|
|
4093
4128
|
] }),
|
|
4094
|
-
isUserProfileOpen && /* @__PURE__ */
|
|
4129
|
+
isUserProfileOpen && /* @__PURE__ */ jsx24(
|
|
4095
4130
|
UserProfile,
|
|
4096
4131
|
{
|
|
4097
4132
|
isOpen: isUserProfileOpen,
|
|
@@ -4129,7 +4164,7 @@ import {
|
|
|
4129
4164
|
X as X4,
|
|
4130
4165
|
Check as Check4
|
|
4131
4166
|
} from "lucide-react";
|
|
4132
|
-
import { Fragment as
|
|
4167
|
+
import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4133
4168
|
var ThreadItem = ({ thread, isActive, config, onSelect, onRename, onDelete, onArchive }) => {
|
|
4134
4169
|
const [isEditing, setIsEditing] = useState9(false);
|
|
4135
4170
|
const [editTitle, setEditTitle] = useState9(thread.title);
|
|
@@ -4158,9 +4193,9 @@ var ThreadItem = ({ thread, isActive, config, onSelect, onRename, onDelete, onAr
|
|
|
4158
4193
|
handleCancelEdit();
|
|
4159
4194
|
}
|
|
4160
4195
|
};
|
|
4161
|
-
return /* @__PURE__ */
|
|
4162
|
-
/* @__PURE__ */
|
|
4163
|
-
/* @__PURE__ */
|
|
4196
|
+
return /* @__PURE__ */ jsx25(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__ */ jsx25(CardContent, { className: "p-3 max-w-sm", children: /* @__PURE__ */ jsxs15("div", { className: "flex items-start justify-between gap-2", children: [
|
|
4197
|
+
/* @__PURE__ */ jsx25("div", { className: "flex-1 min-w-0", onClick: onSelect, children: isEditing ? /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
|
|
4198
|
+
/* @__PURE__ */ jsx25(
|
|
4164
4199
|
Input,
|
|
4165
4200
|
{
|
|
4166
4201
|
ref: inputRef,
|
|
@@ -4172,44 +4207,44 @@ var ThreadItem = ({ thread, isActive, config, onSelect, onRename, onDelete, onAr
|
|
|
4172
4207
|
placeholder: config?.labels?.threadNamePlaceholder || "Conversation name"
|
|
4173
4208
|
}
|
|
4174
4209
|
),
|
|
4175
|
-
/* @__PURE__ */
|
|
4176
|
-
/* @__PURE__ */
|
|
4177
|
-
] }) : /* @__PURE__ */ jsxs15(
|
|
4178
|
-
/* @__PURE__ */
|
|
4210
|
+
/* @__PURE__ */ jsx25(Button, { size: "sm", variant: "ghost", onClick: handleSaveEdit, children: /* @__PURE__ */ jsx25(Check4, { className: "h-3 w-3" }) }),
|
|
4211
|
+
/* @__PURE__ */ jsx25(Button, { size: "sm", variant: "ghost", onClick: handleCancelEdit, children: /* @__PURE__ */ jsx25(X4, { className: "h-3 w-3" }) })
|
|
4212
|
+
] }) : /* @__PURE__ */ jsxs15(Fragment7, { children: [
|
|
4213
|
+
/* @__PURE__ */ jsx25("h4", { className: "font-medium text-sm truncate mb-1", children: thread.title }),
|
|
4179
4214
|
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
4180
4215
|
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1", children: [
|
|
4181
|
-
/* @__PURE__ */
|
|
4216
|
+
/* @__PURE__ */ jsx25(Hash, { className: "h-3 w-3" }),
|
|
4182
4217
|
thread.messageCount,
|
|
4183
4218
|
" msgs"
|
|
4184
4219
|
] }),
|
|
4185
|
-
/* @__PURE__ */
|
|
4220
|
+
/* @__PURE__ */ jsx25(Separator, { orientation: "vertical", className: "h-3" }),
|
|
4186
4221
|
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1", children: [
|
|
4187
|
-
/* @__PURE__ */
|
|
4222
|
+
/* @__PURE__ */ jsx25(Calendar2, { className: "h-3 w-3" }),
|
|
4188
4223
|
formatDate(thread.updatedAt, config?.labels)
|
|
4189
4224
|
] }),
|
|
4190
|
-
thread.isArchived && /* @__PURE__ */ jsxs15(
|
|
4191
|
-
/* @__PURE__ */
|
|
4225
|
+
thread.isArchived && /* @__PURE__ */ jsxs15(Fragment7, { children: [
|
|
4226
|
+
/* @__PURE__ */ jsx25(Separator, { orientation: "vertical", className: "h-3" }),
|
|
4192
4227
|
/* @__PURE__ */ jsxs15(Badge, { variant: "secondary", className: "text-xs", children: [
|
|
4193
|
-
/* @__PURE__ */
|
|
4228
|
+
/* @__PURE__ */ jsx25(Archive2, { className: "h-2 w-2 mr-1" }),
|
|
4194
4229
|
config?.labels?.archiveThread || "Archived"
|
|
4195
4230
|
] })
|
|
4196
4231
|
] })
|
|
4197
4232
|
] })
|
|
4198
4233
|
] }) }),
|
|
4199
4234
|
!isEditing && /* @__PURE__ */ jsxs15(DropdownMenu, { children: [
|
|
4200
|
-
/* @__PURE__ */
|
|
4235
|
+
/* @__PURE__ */ jsx25(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(Button, { variant: "ghost", size: "icon", className: "h-6 w-6 m-auto", children: /* @__PURE__ */ jsx25(MoreVertical2, { className: "h-3 w-3" }) }) }),
|
|
4201
4236
|
/* @__PURE__ */ jsxs15(DropdownMenuContent, { align: "end", children: [
|
|
4202
4237
|
/* @__PURE__ */ jsxs15(DropdownMenuItem, { onClick: () => setIsEditing(true), children: [
|
|
4203
|
-
/* @__PURE__ */
|
|
4238
|
+
/* @__PURE__ */ jsx25(Edit22, { className: "h-4 w-4 mr-2" }),
|
|
4204
4239
|
config?.labels?.renameThread || "Rename"
|
|
4205
4240
|
] }),
|
|
4206
4241
|
/* @__PURE__ */ jsxs15(DropdownMenuItem, { onClick: onArchive, children: [
|
|
4207
|
-
/* @__PURE__ */
|
|
4242
|
+
/* @__PURE__ */ jsx25(Archive2, { className: "h-4 w-4 mr-2" }),
|
|
4208
4243
|
thread.isArchived ? config?.labels?.unarchiveThread || "Unarchive" : config?.labels?.archiveThread || "Archive"
|
|
4209
4244
|
] }),
|
|
4210
|
-
/* @__PURE__ */
|
|
4245
|
+
/* @__PURE__ */ jsx25(DropdownMenuSeparator, {}),
|
|
4211
4246
|
/* @__PURE__ */ jsxs15(DropdownMenuItem, { onClick: onDelete, className: "text-destructive", children: [
|
|
4212
|
-
/* @__PURE__ */
|
|
4247
|
+
/* @__PURE__ */ jsx25(Trash24, { className: "h-4 w-4 mr-2" }),
|
|
4213
4248
|
config?.labels?.deleteThread || "Delete"
|
|
4214
4249
|
] })
|
|
4215
4250
|
] })
|
|
@@ -4225,16 +4260,16 @@ var CreateThreadDialog2 = ({ onCreateThread, config }) => {
|
|
|
4225
4260
|
setIsOpen(false);
|
|
4226
4261
|
};
|
|
4227
4262
|
return /* @__PURE__ */ jsxs15(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
4228
|
-
/* @__PURE__ */
|
|
4229
|
-
/* @__PURE__ */
|
|
4263
|
+
/* @__PURE__ */ jsx25(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxs15(Button, { variant: "outline", className: "w-full", children: [
|
|
4264
|
+
/* @__PURE__ */ jsx25(Plus4, { className: "h-4 w-4 mr-2" }),
|
|
4230
4265
|
config?.labels?.createNewThread || "New Conversation"
|
|
4231
4266
|
] }) }),
|
|
4232
4267
|
/* @__PURE__ */ jsxs15(DialogContent, { children: [
|
|
4233
4268
|
/* @__PURE__ */ jsxs15(DialogHeader, { children: [
|
|
4234
|
-
/* @__PURE__ */
|
|
4235
|
-
/* @__PURE__ */
|
|
4269
|
+
/* @__PURE__ */ jsx25(DialogTitle, { children: config?.labels?.createNewThread || "Create New Conversation" }),
|
|
4270
|
+
/* @__PURE__ */ jsx25(DialogDescription, { children: "Give your new conversation a name or leave blank to auto-generate one." })
|
|
4236
4271
|
] }),
|
|
4237
|
-
/* @__PURE__ */
|
|
4272
|
+
/* @__PURE__ */ jsx25(
|
|
4238
4273
|
Input,
|
|
4239
4274
|
{
|
|
4240
4275
|
value: title,
|
|
@@ -4245,8 +4280,8 @@ var CreateThreadDialog2 = ({ onCreateThread, config }) => {
|
|
|
4245
4280
|
}
|
|
4246
4281
|
),
|
|
4247
4282
|
/* @__PURE__ */ jsxs15(DialogFooter, { children: [
|
|
4248
|
-
/* @__PURE__ */
|
|
4249
|
-
/* @__PURE__ */
|
|
4283
|
+
/* @__PURE__ */ jsx25(Button, { variant: "outline", onClick: () => setIsOpen(false), children: config?.labels?.cancel || "Cancel" }),
|
|
4284
|
+
/* @__PURE__ */ jsx25(Button, { onClick: handleCreate, children: config?.labels?.create || "Create" })
|
|
4250
4285
|
] })
|
|
4251
4286
|
] })
|
|
4252
4287
|
] });
|
|
@@ -4300,20 +4335,20 @@ var ThreadManager = ({
|
|
|
4300
4335
|
setDeleteThreadId(null);
|
|
4301
4336
|
};
|
|
4302
4337
|
if (!isOpen) return null;
|
|
4303
|
-
return /* @__PURE__ */
|
|
4304
|
-
/* @__PURE__ */
|
|
4338
|
+
return /* @__PURE__ */ jsx25(TooltipProvider, { children: /* @__PURE__ */ jsxs15("div", { className: `fixed inset-0 z-50 bg-background/80 backdrop-blur-sm ${className}`, children: [
|
|
4339
|
+
/* @__PURE__ */ jsx25("div", { className: "fixed left-0 top-0 h-full w-full max-w-md border-r bg-background shadow-lg", children: /* @__PURE__ */ jsxs15(Card, { className: "h-full border-0 rounded-none", children: [
|
|
4305
4340
|
/* @__PURE__ */ jsxs15(CardHeader, { className: "border-b", children: [
|
|
4306
4341
|
/* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between", children: [
|
|
4307
4342
|
/* @__PURE__ */ jsxs15(CardTitle, { className: "flex items-center gap-2", children: [
|
|
4308
|
-
/* @__PURE__ */
|
|
4343
|
+
/* @__PURE__ */ jsx25(MessageSquare2, { className: "h-5 w-5" }),
|
|
4309
4344
|
config?.labels?.newChat || "Conversations"
|
|
4310
4345
|
] }),
|
|
4311
|
-
/* @__PURE__ */
|
|
4346
|
+
/* @__PURE__ */ jsx25(Button, { variant: "ghost", size: "icon", onClick: onClose, children: /* @__PURE__ */ jsx25(X4, { className: "h-4 w-4" }) })
|
|
4312
4347
|
] }),
|
|
4313
4348
|
/* @__PURE__ */ jsxs15("div", { className: "space-y-3", children: [
|
|
4314
4349
|
/* @__PURE__ */ jsxs15("div", { className: "relative", children: [
|
|
4315
|
-
/* @__PURE__ */
|
|
4316
|
-
/* @__PURE__ */
|
|
4350
|
+
/* @__PURE__ */ jsx25(Search2, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
4351
|
+
/* @__PURE__ */ jsx25(
|
|
4317
4352
|
Input,
|
|
4318
4353
|
{
|
|
4319
4354
|
placeholder: config?.labels?.search || "Search conversations...",
|
|
@@ -4332,7 +4367,7 @@ var ThreadManager = ({
|
|
|
4332
4367
|
onClick: () => setShowArchived(!showArchived),
|
|
4333
4368
|
className: "text-xs",
|
|
4334
4369
|
children: [
|
|
4335
|
-
/* @__PURE__ */
|
|
4370
|
+
/* @__PURE__ */ jsx25(Filter2, { className: "h-3 w-3 mr-1" }),
|
|
4336
4371
|
showArchived ? config?.labels?.hideArchived || "Hide Archived" : config?.labels?.showArchived || "Show Archived"
|
|
4337
4372
|
]
|
|
4338
4373
|
}
|
|
@@ -4346,13 +4381,13 @@ var ThreadManager = ({
|
|
|
4346
4381
|
] })
|
|
4347
4382
|
] }),
|
|
4348
4383
|
/* @__PURE__ */ jsxs15(CardContent, { className: "p-0 flex-1", children: [
|
|
4349
|
-
/* @__PURE__ */
|
|
4350
|
-
/* @__PURE__ */
|
|
4351
|
-
/* @__PURE__ */
|
|
4352
|
-
/* @__PURE__ */
|
|
4384
|
+
/* @__PURE__ */ jsx25("div", { className: "p-4", children: onCreateThread && /* @__PURE__ */ jsx25(CreateThreadDialog2, { onCreateThread, config }) }),
|
|
4385
|
+
/* @__PURE__ */ jsx25(ScrollArea, { className: "h-[calc(100vh-280px)]", children: /* @__PURE__ */ jsx25("div", { className: "px-4 pb-4 space-y-4", children: Object.keys(groupedThreads).length === 0 ? /* @__PURE__ */ jsxs15("div", { className: "text-center py-8 text-muted-foreground", children: [
|
|
4386
|
+
/* @__PURE__ */ jsx25(MessageSquare2, { className: "h-12 w-12 mx-auto mb-3 opacity-50" }),
|
|
4387
|
+
/* @__PURE__ */ jsx25("p", { className: "text-sm", children: searchQuery ? config?.labels?.noThreadsFound || "No conversations found" : config?.labels?.noThreadsYet || "No conversations yet" })
|
|
4353
4388
|
] }) : Object.entries(groupedThreads).map(([group, groupThreads]) => /* @__PURE__ */ jsxs15("div", { children: [
|
|
4354
|
-
/* @__PURE__ */
|
|
4355
|
-
/* @__PURE__ */
|
|
4389
|
+
/* @__PURE__ */ jsx25("h3", { className: "text-sm font-medium text-muted-foreground mb-2 px-2", children: group }),
|
|
4390
|
+
/* @__PURE__ */ jsx25("div", { className: "space-y-2", children: groupThreads.map((thread) => /* @__PURE__ */ jsx25(
|
|
4356
4391
|
ThreadItem,
|
|
4357
4392
|
{
|
|
4358
4393
|
thread,
|
|
@@ -4368,14 +4403,14 @@ var ThreadManager = ({
|
|
|
4368
4403
|
] }, group)) }) })
|
|
4369
4404
|
] })
|
|
4370
4405
|
] }) }),
|
|
4371
|
-
deleteThreadId && /* @__PURE__ */
|
|
4406
|
+
deleteThreadId && /* @__PURE__ */ jsx25(AlertDialog, { open: !!deleteThreadId, onOpenChange: () => setDeleteThreadId(null), children: /* @__PURE__ */ jsxs15(AlertDialogContent, { children: [
|
|
4372
4407
|
/* @__PURE__ */ jsxs15(AlertDialogHeader, { children: [
|
|
4373
|
-
/* @__PURE__ */
|
|
4374
|
-
/* @__PURE__ */
|
|
4408
|
+
/* @__PURE__ */ jsx25(AlertDialogTitle, { children: config?.labels?.deleteConfirmTitle || "Delete Conversation" }),
|
|
4409
|
+
/* @__PURE__ */ jsx25(AlertDialogDescription, { children: config?.labels?.deleteConfirmDescription || "Are you sure you want to delete this conversation? This action cannot be undone." })
|
|
4375
4410
|
] }),
|
|
4376
4411
|
/* @__PURE__ */ jsxs15(AlertDialogFooter, { children: [
|
|
4377
|
-
/* @__PURE__ */
|
|
4378
|
-
/* @__PURE__ */
|
|
4412
|
+
/* @__PURE__ */ jsx25(AlertDialogCancel, { children: config?.labels?.cancel || "Cancel" }),
|
|
4413
|
+
/* @__PURE__ */ jsx25(
|
|
4379
4414
|
AlertDialogAction,
|
|
4380
4415
|
{
|
|
4381
4416
|
onClick: () => deleteThreadId && handleDeleteThread(deleteThreadId),
|