@wealthx/shadcn 1.5.34 → 1.5.36

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.
@@ -72,7 +72,7 @@ __export(ai_conversations_exports, {
72
72
  });
73
73
  module.exports = __toCommonJS(ai_conversations_exports);
74
74
  var import_react5 = require("react");
75
- var import_lucide_react7 = require("lucide-react");
75
+ var import_lucide_react8 = require("lucide-react");
76
76
 
77
77
  // src/lib/utils.ts
78
78
  var import_clsx = require("clsx");
@@ -120,8 +120,8 @@ function getInitials(name) {
120
120
  // src/components/ui/avatar.tsx
121
121
  var import_avatar = require("@base-ui/react/avatar");
122
122
  var import_jsx_runtime = require("react/jsx-runtime");
123
- function Avatar(_a) {
124
- var _b = _a, {
123
+ function Avatar(_a2) {
124
+ var _b = _a2, {
125
125
  className,
126
126
  size = "default"
127
127
  } = _b, props = __objRest(_b, [
@@ -140,8 +140,8 @@ function Avatar(_a) {
140
140
  }, props)
141
141
  );
142
142
  }
143
- function AvatarFallback(_a) {
144
- var _b = _a, {
143
+ function AvatarFallback(_a2) {
144
+ var _b = _a2, {
145
145
  className
146
146
  } = _b, props = __objRest(_b, [
147
147
  "className"
@@ -175,8 +175,8 @@ function mergeRefs(...refs) {
175
175
  };
176
176
  }
177
177
  var Slot = React.forwardRef(
178
- (_a, forwardedRef) => {
179
- var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
178
+ (_a2, forwardedRef) => {
179
+ var _b = _a2, { children } = _b, props = __objRest(_b, ["children"]);
180
180
  const child = React.Children.only(children);
181
181
  if (!React.isValidElement(child)) return null;
182
182
  const childProps = child.props;
@@ -243,8 +243,8 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
243
243
  }
244
244
  }
245
245
  );
246
- var Button = (0, import_react.forwardRef)(function Button2(_a, ref) {
247
- var _b = _a, {
246
+ var Button = (0, import_react.forwardRef)(function Button2(_a2, ref) {
247
+ var _b = _a2, {
248
248
  className,
249
249
  variant,
250
250
  size,
@@ -298,16 +298,16 @@ function useThemeVars() {
298
298
 
299
299
  // src/components/ui/dialog.tsx
300
300
  var import_jsx_runtime4 = require("react/jsx-runtime");
301
- function Dialog(_a) {
302
- var props = __objRest(_a, []);
301
+ function Dialog(_a2) {
302
+ var props = __objRest(_a2, []);
303
303
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dialog.Dialog.Root, __spreadValues({ "data-slot": "dialog" }, props));
304
304
  }
305
- function DialogPortal(_a) {
306
- var props = __objRest(_a, []);
305
+ function DialogPortal(_a2) {
306
+ var props = __objRest(_a2, []);
307
307
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dialog.Dialog.Portal, __spreadValues({ "data-slot": "dialog-portal" }, props));
308
308
  }
309
- function DialogOverlay(_a) {
310
- var _b = _a, {
309
+ function DialogOverlay(_a2) {
310
+ var _b = _a2, {
311
311
  className
312
312
  } = _b, props = __objRest(_b, [
313
313
  "className"
@@ -335,8 +335,8 @@ var DIALOG_MAX_WIDTHS = {
335
335
  full: "100%"
336
336
  };
337
337
  var DIALOG_AUTO_MIN_WIDTH = "20rem";
338
- function DialogContent(_a) {
339
- var _b = _a, {
338
+ function DialogContent(_a2) {
339
+ var _b = _a2, {
340
340
  className,
341
341
  children,
342
342
  showCloseButton = true,
@@ -397,8 +397,8 @@ function DialogContent(_a) {
397
397
  )
398
398
  ] });
399
399
  }
400
- function DialogHeader(_a) {
401
- var _b = _a, {
400
+ function DialogHeader(_a2) {
401
+ var _b = _a2, {
402
402
  className
403
403
  } = _b, props = __objRest(_b, [
404
404
  "className"
@@ -411,8 +411,8 @@ function DialogHeader(_a) {
411
411
  }, props)
412
412
  );
413
413
  }
414
- function DialogFooter(_a) {
415
- var _b = _a, {
414
+ function DialogFooter(_a2) {
415
+ var _b = _a2, {
416
416
  className,
417
417
  showCloseButton = false,
418
418
  children
@@ -445,8 +445,8 @@ function DialogFooter(_a) {
445
445
  })
446
446
  );
447
447
  }
448
- function DialogTitle(_a) {
449
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
448
+ function DialogTitle(_a2) {
449
+ var _b = _a2, { className } = _b, props = __objRest(_b, ["className"]);
450
450
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
451
451
  import_dialog.Dialog.Title,
452
452
  __spreadValues({
@@ -455,8 +455,8 @@ function DialogTitle(_a) {
455
455
  }, props)
456
456
  );
457
457
  }
458
- function DialogDescription(_a) {
459
- var _b = _a, {
458
+ function DialogDescription(_a2) {
459
+ var _b = _a2, {
460
460
  className
461
461
  } = _b, props = __objRest(_b, [
462
462
  "className"
@@ -507,8 +507,8 @@ var ToggleGroupContext = React3.createContext({
507
507
  variant: "default",
508
508
  spacing: 0
509
509
  });
510
- function ToggleGroup(_a) {
511
- var _b = _a, {
510
+ function ToggleGroup(_a2) {
511
+ var _b = _a2, {
512
512
  className,
513
513
  variant,
514
514
  size,
@@ -542,8 +542,8 @@ function ToggleGroup(_a) {
542
542
  })
543
543
  );
544
544
  }
545
- function ToggleGroupItem(_a) {
546
- var _b = _a, {
545
+ function ToggleGroupItem(_a2) {
546
+ var _b = _a2, {
547
547
  className,
548
548
  children,
549
549
  variant,
@@ -581,8 +581,8 @@ function ToggleGroupItem(_a) {
581
581
  // src/components/ui/tooltip.tsx
582
582
  var import_tooltip = require("@base-ui/react/tooltip");
583
583
  var import_jsx_runtime7 = require("react/jsx-runtime");
584
- function TooltipProvider(_a) {
585
- var _b = _a, {
584
+ function TooltipProvider(_a2) {
585
+ var _b = _a2, {
586
586
  delay = 0
587
587
  } = _b, props = __objRest(_b, [
588
588
  "delay"
@@ -595,16 +595,16 @@ function TooltipProvider(_a) {
595
595
  }, props)
596
596
  );
597
597
  }
598
- function Tooltip(_a) {
599
- var props = __objRest(_a, []);
598
+ function Tooltip(_a2) {
599
+ var props = __objRest(_a2, []);
600
600
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_tooltip.Tooltip.Root, __spreadValues({ "data-slot": "tooltip" }, props));
601
601
  }
602
- function TooltipTrigger(_a) {
603
- var props = __objRest(_a, []);
602
+ function TooltipTrigger(_a2) {
603
+ var props = __objRest(_a2, []);
604
604
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_tooltip.Tooltip.Trigger, __spreadValues({ "data-slot": "tooltip-trigger" }, props));
605
605
  }
606
- function TooltipContent(_a) {
607
- var _b = _a, {
606
+ function TooltipContent(_a2) {
607
+ var _b = _a2, {
608
608
  className,
609
609
  sideOffset = 8,
610
610
  side,
@@ -663,8 +663,8 @@ var badgeVariants = (0, import_class_variance_authority3.cva)(
663
663
  }
664
664
  }
665
665
  );
666
- function Badge(_a) {
667
- var _b = _a, {
666
+ function Badge(_a2) {
667
+ var _b = _a2, {
668
668
  className,
669
669
  variant = "default",
670
670
  asChild = false
@@ -686,8 +686,8 @@ function Badge(_a) {
686
686
 
687
687
  // src/components/ui/input.tsx
688
688
  var import_jsx_runtime9 = require("react/jsx-runtime");
689
- function Input(_a) {
690
- var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
689
+ function Input(_a2) {
690
+ var _b = _a2, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
691
691
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
692
692
  "input",
693
693
  __spreadValues({
@@ -707,8 +707,8 @@ function Input(_a) {
707
707
  var import_class_variance_authority4 = require("class-variance-authority");
708
708
  var import_tabs = require("@base-ui/react/tabs");
709
709
  var import_jsx_runtime10 = require("react/jsx-runtime");
710
- function Tabs(_a) {
711
- var _b = _a, {
710
+ function Tabs(_a2) {
711
+ var _b = _a2, {
712
712
  className,
713
713
  orientation = "horizontal"
714
714
  } = _b, props = __objRest(_b, [
@@ -741,8 +741,8 @@ var tabsListVariants = (0, import_class_variance_authority4.cva)(
741
741
  }
742
742
  }
743
743
  );
744
- function TabsList(_a) {
745
- var _b = _a, {
744
+ function TabsList(_a2) {
745
+ var _b = _a2, {
746
746
  className,
747
747
  variant = "default"
748
748
  } = _b, props = __objRest(_b, [
@@ -758,8 +758,8 @@ function TabsList(_a) {
758
758
  }, props)
759
759
  );
760
760
  }
761
- function TabsTrigger(_a) {
762
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
761
+ function TabsTrigger(_a2) {
762
+ var _b = _a2, { className } = _b, props = __objRest(_b, ["className"]);
763
763
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
764
764
  import_tabs.Tabs.Tab,
765
765
  __spreadValues({
@@ -909,8 +909,8 @@ function ConversationListItem({
909
909
  function filterConversations(conversations, query, filter, channelFilter) {
910
910
  const q = query.toLowerCase();
911
911
  return conversations.filter((c) => {
912
- var _a, _b;
913
- const matchesFilter = filter === "all" || (filter === "emails" ? ((_a = c.channel) != null ? _a : "chat") === "email" : c.status === filter);
912
+ var _a2, _b;
913
+ const matchesFilter = filter === "all" || (filter === "emails" ? ((_a2 = c.channel) != null ? _a2 : "chat") === "email" : c.status === filter);
914
914
  const matchesChannel = channelFilter === "all" || ((_b = c.channel) != null ? _b : "chat") === channelFilter;
915
915
  const matchesSearch = !q || c.contact.name.toLowerCase().includes(q) || c.lastMessage.toLowerCase().includes(q);
916
916
  return matchesFilter && matchesChannel && matchesSearch;
@@ -1047,25 +1047,22 @@ var import_react4 = require("@tiptap/react");
1047
1047
  var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
1048
1048
  var import_extension_underline = __toESM(require("@tiptap/extension-underline"));
1049
1049
  var import_extension_link = __toESM(require("@tiptap/extension-link"));
1050
- var import_react_markdown = __toESM(require("react-markdown"));
1051
- var import_rehype_raw = __toESM(require("rehype-raw"));
1052
- var import_rehype_sanitize = __toESM(require("rehype-sanitize"));
1053
- var import_lucide_react5 = require("lucide-react");
1050
+ var import_lucide_react6 = require("lucide-react");
1054
1051
 
1055
1052
  // src/components/ui/dropdown-menu.tsx
1056
1053
  var import_lucide_react4 = require("lucide-react");
1057
1054
  var import_menu = require("@base-ui/react/menu");
1058
1055
  var import_jsx_runtime13 = require("react/jsx-runtime");
1059
- function DropdownMenu(_a) {
1060
- var props = __objRest(_a, []);
1056
+ function DropdownMenu(_a2) {
1057
+ var props = __objRest(_a2, []);
1061
1058
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_menu.Menu.Root, __spreadValues({ "data-slot": "dropdown-menu" }, props));
1062
1059
  }
1063
- function DropdownMenuTrigger(_a) {
1064
- var props = __objRest(_a, []);
1060
+ function DropdownMenuTrigger(_a2) {
1061
+ var props = __objRest(_a2, []);
1065
1062
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_menu.Menu.Trigger, __spreadValues({ "data-slot": "dropdown-menu-trigger" }, props));
1066
1063
  }
1067
- function DropdownMenuContent(_a) {
1068
- var _b = _a, {
1064
+ function DropdownMenuContent(_a2) {
1065
+ var _b = _a2, {
1069
1066
  className,
1070
1067
  sideOffset = 4,
1071
1068
  style
@@ -1087,8 +1084,8 @@ function DropdownMenuContent(_a) {
1087
1084
  }, props)
1088
1085
  ) }) });
1089
1086
  }
1090
- function DropdownMenuItem(_a) {
1091
- var _b = _a, {
1087
+ function DropdownMenuItem(_a2) {
1088
+ var _b = _a2, {
1092
1089
  className,
1093
1090
  inset,
1094
1091
  variant = "default"
@@ -1110,8 +1107,8 @@ function DropdownMenuItem(_a) {
1110
1107
  }, props)
1111
1108
  );
1112
1109
  }
1113
- function DropdownMenuSeparator(_a) {
1114
- var _b = _a, {
1110
+ function DropdownMenuSeparator(_a2) {
1111
+ var _b = _a2, {
1115
1112
  className
1116
1113
  } = _b, props = __objRest(_b, [
1117
1114
  "className"
@@ -1130,16 +1127,16 @@ var React4 = __toESM(require("react"));
1130
1127
  var import_popover = require("@base-ui/react/popover");
1131
1128
  var import_jsx_runtime14 = require("react/jsx-runtime");
1132
1129
  var PopoverPortalContext = React4.createContext(void 0);
1133
- function Popover(_a) {
1134
- var props = __objRest(_a, []);
1130
+ function Popover(_a2) {
1131
+ var props = __objRest(_a2, []);
1135
1132
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_popover.Popover.Root, __spreadValues({ "data-slot": "popover" }, props));
1136
1133
  }
1137
- function PopoverTrigger(_a) {
1138
- var props = __objRest(_a, []);
1134
+ function PopoverTrigger(_a2) {
1135
+ var props = __objRest(_a2, []);
1139
1136
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_popover.Popover.Trigger, __spreadValues({ "data-slot": "popover-trigger" }, props));
1140
1137
  }
1141
- function PopoverContent(_a) {
1142
- var _b = _a, {
1138
+ function PopoverContent(_a2) {
1139
+ var _b = _a2, {
1143
1140
  className,
1144
1141
  align = "center",
1145
1142
  sideOffset = 4,
@@ -1176,8 +1173,8 @@ function PopoverContent(_a) {
1176
1173
  // src/components/ui/separator.tsx
1177
1174
  var import_separator = require("@base-ui/react/separator");
1178
1175
  var import_jsx_runtime15 = require("react/jsx-runtime");
1179
- function Separator(_a) {
1180
- var _b = _a, {
1176
+ function Separator(_a2) {
1177
+ var _b = _a2, {
1181
1178
  className,
1182
1179
  orientation = "horizontal"
1183
1180
  } = _b, props = __objRest(_b, [
@@ -1199,8 +1196,8 @@ function Separator(_a) {
1199
1196
 
1200
1197
  // src/components/ui/textarea.tsx
1201
1198
  var import_jsx_runtime16 = require("react/jsx-runtime");
1202
- function Textarea(_a) {
1203
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1199
+ function Textarea(_a2) {
1200
+ var _b = _a2, { className } = _b, props = __objRest(_b, ["className"]);
1204
1201
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1205
1202
  "textarea",
1206
1203
  __spreadValues({
@@ -1214,9 +1211,17 @@ function Textarea(_a) {
1214
1211
  );
1215
1212
  }
1216
1213
 
1217
- // src/components/ui/ai-conversations/thread.tsx
1214
+ // src/components/ui/ai-conversations/bubble.tsx
1215
+ var import_react_markdown = __toESM(require("react-markdown"));
1216
+ var import_rehype_raw = __toESM(require("rehype-raw"));
1217
+ var import_rehype_sanitize = __toESM(require("rehype-sanitize"));
1218
+ var import_lucide_react5 = require("lucide-react");
1218
1219
  var import_jsx_runtime17 = require("react/jsx-runtime");
1219
- function BubbleAvatar({
1220
+ var _a;
1221
+ var EMAIL_SANITIZE_SCHEMA = __spreadProps(__spreadValues({}, import_rehype_sanitize.defaultSchema), {
1222
+ strip: ["script", "style", "head", ...(_a = import_rehype_sanitize.defaultSchema.strip) != null ? _a : []]
1223
+ });
1224
+ function BubbleAvatar2({
1220
1225
  role,
1221
1226
  senderName
1222
1227
  }) {
@@ -1228,16 +1233,21 @@ function BubbleAvatar({
1228
1233
  }
1229
1234
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AvatarFallback, { children: getInitials(senderName != null ? senderName : "?") }) });
1230
1235
  }
1231
- function ChatBubble({ message, channel, className }) {
1232
- const { role, content, timestamp, senderName, subject } = message;
1233
- const isEmail = channel === "email";
1234
- if (role === "system") {
1235
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("my-2 flex items-center gap-3 px-2", className), children: [
1236
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { className: "flex-1" }),
1237
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "shrink-0 text-caption text-muted-foreground", children: content }),
1238
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { className: "flex-1" })
1239
- ] });
1240
- }
1236
+ function SystemDivider({
1237
+ content,
1238
+ className
1239
+ }) {
1240
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("my-2 flex items-center gap-3 px-2", className), children: [
1241
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { className: "flex-1" }),
1242
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "shrink-0 text-caption text-muted-foreground", children: content }),
1243
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { className: "flex-1" })
1244
+ ] });
1245
+ }
1246
+ function ChatMessageBubble({
1247
+ message,
1248
+ className
1249
+ }) {
1250
+ const { role, content, timestamp, senderName } = message;
1241
1251
  const isAdvisor = role === "advisor";
1242
1252
  const isBot = role === "bot";
1243
1253
  const isVisitor = role === "visitor";
@@ -1251,13 +1261,65 @@ function ChatBubble({ message, channel, className }) {
1251
1261
  className
1252
1262
  ),
1253
1263
  children: [
1254
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BubbleAvatar, { role, senderName }),
1264
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BubbleAvatar2, { role, senderName }),
1255
1265
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1256
1266
  "div",
1257
1267
  {
1258
1268
  className: cn(
1259
- "flex flex-col gap-1",
1260
- isEmail ? "max-w-[85%] w-full" : "max-w-[70%]",
1269
+ "flex max-w-[70%] flex-col gap-1",
1270
+ isAdvisor && "items-end"
1271
+ ),
1272
+ children: [
1273
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-caption text-muted-foreground", children: displayName }),
1274
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1275
+ "div",
1276
+ {
1277
+ className: cn(
1278
+ "break-words px-3 py-2 text-sm leading-relaxed [&_a]:underline [&_p]:m-0",
1279
+ isBot && "border border-border bg-muted/60 text-foreground [&_a]:text-primary",
1280
+ isVisitor && "border border-border bg-background text-foreground [&_a]:text-primary",
1281
+ isAdvisor && "bg-primary text-primary-foreground [&_a]:text-primary-foreground"
1282
+ ),
1283
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1284
+ import_react_markdown.default,
1285
+ {
1286
+ rehypePlugins: [import_rehype_raw.default, [import_rehype_sanitize.default, import_rehype_sanitize.defaultSchema]],
1287
+ children: content
1288
+ }
1289
+ )
1290
+ }
1291
+ ),
1292
+ timestamp && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-caption text-muted-foreground", children: timestamp })
1293
+ ]
1294
+ }
1295
+ )
1296
+ ]
1297
+ }
1298
+ );
1299
+ }
1300
+ function EmailMessageBubble({
1301
+ message,
1302
+ className
1303
+ }) {
1304
+ const { role, content, timestamp, senderName, subject } = message;
1305
+ const isAdvisor = role === "advisor";
1306
+ const isBot = role === "bot";
1307
+ const displayName = isBot ? "AI Assistant" : isAdvisor ? senderName != null ? senderName : "Advisor" : senderName != null ? senderName : "Lead";
1308
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1309
+ "div",
1310
+ {
1311
+ className: cn(
1312
+ "flex gap-2.5",
1313
+ isAdvisor ? "flex-row-reverse" : "flex-row",
1314
+ className
1315
+ ),
1316
+ children: [
1317
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BubbleAvatar2, { role, senderName }),
1318
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1319
+ "div",
1320
+ {
1321
+ className: cn(
1322
+ "flex w-full max-w-[85%] flex-col gap-1",
1261
1323
  isAdvisor && "items-end"
1262
1324
  ),
1263
1325
  children: [
@@ -1266,29 +1328,24 @@ function ChatBubble({ message, channel, className }) {
1266
1328
  "div",
1267
1329
  {
1268
1330
  className: cn(
1269
- "text-sm leading-relaxed break-words",
1270
- !isEmail && "px-3 py-2 [&_p]:m-0 [&_a]:underline",
1271
- isEmail && [
1272
- "border border-border bg-background px-4 py-3 w-full",
1273
- "[&_p]:mb-2 [&_p:last-child]:mb-0",
1274
- "[&_ul]:mb-2 [&_ul]:list-disc [&_ul]:pl-4",
1275
- "[&_ol]:mb-2 [&_ol]:list-decimal [&_ol]:pl-4",
1276
- "[&_li]:mb-0.5",
1277
- "[&_h1]:mb-2 [&_h1]:text-sm [&_h1]:font-bold",
1278
- "[&_h2]:mb-1.5 [&_h2]:text-sm [&_h2]:font-semibold",
1279
- "[&_h3]:mb-1 [&_h3]:text-sm [&_h3]:font-medium",
1280
- "[&_strong]:font-semibold [&_em]:italic",
1281
- "[&_a]:underline [&_a]:text-primary",
1282
- "[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground [&_blockquote]:italic",
1283
- "[&_hr]:my-3 [&_hr]:border-border"
1284
- ],
1285
- !isEmail && isBot && "border border-border bg-muted/60 text-foreground [&_a]:text-primary",
1286
- !isEmail && isVisitor && "border border-border bg-background text-foreground [&_a]:text-primary",
1287
- !isEmail && isAdvisor && "bg-primary text-primary-foreground [&_a]:text-primary-foreground",
1288
- isEmail && isAdvisor && "bg-muted/30"
1331
+ "w-full min-w-0 break-words whitespace-pre-line border border-border bg-background px-4 py-3 text-sm leading-relaxed [overflow-wrap:anywhere]",
1332
+ "[&_p]:mb-2 [&_p:last-child]:mb-0",
1333
+ "[&_ul]:mb-2 [&_ul]:list-disc [&_ul]:pl-4",
1334
+ "[&_ol]:mb-2 [&_ol]:list-decimal [&_ol]:pl-4",
1335
+ "[&_li]:mb-0.5",
1336
+ "[&_h1]:mb-2 [&_h1]:text-sm [&_h1]:font-bold",
1337
+ "[&_h2]:mb-1.5 [&_h2]:text-sm [&_h2]:font-semibold",
1338
+ "[&_h3]:mb-1 [&_h3]:text-sm [&_h3]:font-medium",
1339
+ "[&_strong]:font-semibold [&_em]:italic",
1340
+ "[&_a]:text-primary [&_a]:underline",
1341
+ "[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:italic [&_blockquote]:text-muted-foreground",
1342
+ "[&_hr]:my-3 [&_hr]:border-border",
1343
+ "[&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:bg-transparent [&_pre]:p-0 [&_pre]:font-[inherit] [&_pre]:text-[length:inherit]",
1344
+ "[&_code]:whitespace-pre-wrap [&_code]:break-words [&_code]:bg-transparent [&_code]:p-0 [&_code]:font-[inherit] [&_code]:text-[length:inherit]",
1345
+ isAdvisor && "bg-muted/30"
1289
1346
  ),
1290
1347
  children: [
1291
- isEmail && subject && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "mb-2.5 border-b border-border pb-2", children: [
1348
+ subject && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "mb-2.5 border-b border-border pb-2", children: [
1292
1349
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs font-medium text-muted-foreground", children: "Subject:" }),
1293
1350
  " ",
1294
1351
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-semibold text-foreground", children: subject })
@@ -1296,7 +1353,7 @@ function ChatBubble({ message, channel, className }) {
1296
1353
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1297
1354
  import_react_markdown.default,
1298
1355
  {
1299
- rehypePlugins: [import_rehype_raw.default, [import_rehype_sanitize.default, import_rehype_sanitize.defaultSchema]],
1356
+ rehypePlugins: [import_rehype_raw.default, [import_rehype_sanitize.default, EMAIL_SANITIZE_SCHEMA]],
1300
1357
  children: content
1301
1358
  }
1302
1359
  )
@@ -1311,13 +1368,25 @@ function ChatBubble({ message, channel, className }) {
1311
1368
  }
1312
1369
  );
1313
1370
  }
1371
+ function ChatBubble({ message, channel, className }) {
1372
+ if (message.role === "system") {
1373
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SystemDivider, { content: message.content, className });
1374
+ }
1375
+ if (channel === "email") {
1376
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(EmailMessageBubble, { message, className });
1377
+ }
1378
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChatMessageBubble, { message, className });
1379
+ }
1380
+
1381
+ // src/components/ui/ai-conversations/thread.tsx
1382
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1314
1383
  function ComposerToolbarButton({
1315
1384
  label,
1316
1385
  icon: Icon,
1317
1386
  pressed,
1318
1387
  onToggle
1319
1388
  }) {
1320
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1389
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1321
1390
  "button",
1322
1391
  {
1323
1392
  type: "button",
@@ -1328,7 +1397,7 @@ function ComposerToolbarButton({
1328
1397
  "flex size-7 items-center justify-center transition-colors",
1329
1398
  pressed ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted hover:text-foreground"
1330
1399
  ),
1331
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { className: "size-3.5" })
1400
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { className: "size-3.5" })
1332
1401
  }
1333
1402
  );
1334
1403
  }
@@ -1344,7 +1413,7 @@ function ComposerLinkPopover({
1344
1413
  setOpen(false);
1345
1414
  setUrl("");
1346
1415
  };
1347
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1416
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1348
1417
  Popover,
1349
1418
  {
1350
1419
  open,
@@ -1357,7 +1426,7 @@ function ComposerLinkPopover({
1357
1426
  setOpen(newOpen);
1358
1427
  },
1359
1428
  children: [
1360
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1429
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1361
1430
  PopoverTrigger,
1362
1431
  {
1363
1432
  "aria-label": "Insert link",
@@ -1365,11 +1434,11 @@ function ComposerLinkPopover({
1365
1434
  "flex size-7 items-center justify-center transition-colors",
1366
1435
  (editor == null ? void 0 : editor.isActive("link")) ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted hover:text-foreground"
1367
1436
  ),
1368
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Link2, { className: "size-3.5" })
1437
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Link2, { className: "size-3.5" })
1369
1438
  }
1370
1439
  ),
1371
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PopoverContent, { className: "w-72 p-2", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-1.5", children: [
1372
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1440
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PopoverContent, { className: "w-72 p-2", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-1.5", children: [
1441
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1373
1442
  "input",
1374
1443
  {
1375
1444
  type: "url",
@@ -1381,7 +1450,7 @@ function ComposerLinkPopover({
1381
1450
  autoFocus: true
1382
1451
  }
1383
1452
  ),
1384
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { size: "sm", className: "h-8 px-3", onClick: handleApply, children: "Apply" })
1453
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { size: "sm", className: "h-8 px-3", onClick: handleApply, children: "Apply" })
1385
1454
  ] }) })
1386
1455
  ]
1387
1456
  }
@@ -1391,8 +1460,8 @@ function ComposerEmailFieldRow({
1391
1460
  label,
1392
1461
  children
1393
1462
  }) {
1394
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-3 border-b border-border px-4 py-2.5", children: [
1395
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w-14 shrink-0 text-sm text-muted-foreground", children: label }),
1463
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-3 border-b border-border px-4 py-2.5", children: [
1464
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w-14 shrink-0 text-sm text-muted-foreground", children: label }),
1396
1465
  children
1397
1466
  ] });
1398
1467
  }
@@ -1457,7 +1526,7 @@ function ChatComposer({
1457
1526
  setEmailSubject(emailReplySubject ? `Re: ${emailReplySubject}` : "");
1458
1527
  }
1459
1528
  };
1460
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1529
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1461
1530
  "div",
1462
1531
  {
1463
1532
  className: cn(
@@ -1465,27 +1534,27 @@ function ChatComposer({
1465
1534
  className
1466
1535
  ),
1467
1536
  children: [
1468
- isEmailIntegrated && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "border-b border-border px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1537
+ isEmailIntegrated && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "border-b border-border px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1469
1538
  Tabs,
1470
1539
  {
1471
1540
  value: channel,
1472
1541
  onValueChange: (v) => v && handleChannelChange(v),
1473
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TabsList, { variant: "default", className: "w-full", children: [
1474
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TabsTrigger, { value: "chat", className: "flex-1 gap-1.5", children: [
1475
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.MessageSquare, { className: "size-3.5" }),
1542
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(TabsList, { variant: "default", className: "w-full", children: [
1543
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(TabsTrigger, { value: "chat", className: "flex-1 gap-1.5", children: [
1544
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.MessageSquare, { className: "size-3.5" }),
1476
1545
  "Chat"
1477
1546
  ] }),
1478
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TabsTrigger, { value: "email", className: "flex-1 gap-1.5", children: [
1479
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Mail, { className: "size-3.5" }),
1547
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(TabsTrigger, { value: "email", className: "flex-1 gap-1.5", children: [
1548
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Mail, { className: "size-3.5" }),
1480
1549
  "Email"
1481
1550
  ] })
1482
1551
  ] })
1483
1552
  }
1484
1553
  ) }),
1485
- mode === "ai" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2 bg-muted/30 px-4 py-2.5 text-[12px] text-muted-foreground", children: [
1486
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Bot, { className: "size-3.5 shrink-0 text-muted-foreground" }),
1487
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "AI is handling this conversation." }),
1488
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1554
+ mode === "ai" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2 bg-muted/30 px-4 py-2.5 text-[12px] text-muted-foreground", children: [
1555
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Bot, { className: "size-3.5 shrink-0 text-muted-foreground" }),
1556
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: "AI is handling this conversation." }),
1557
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1489
1558
  Button,
1490
1559
  {
1491
1560
  variant: "link",
@@ -1495,12 +1564,12 @@ function ChatComposer({
1495
1564
  children: "Take Over"
1496
1565
  }
1497
1566
  ),
1498
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "to reply directly." })
1567
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: "to reply directly." })
1499
1568
  ] }) : (
1500
1569
  /* Email panel stays in normal flow to anchor container height;
1501
1570
  chat panel is an absolute overlay so both tabs share identical dimensions */
1502
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative", children: [
1503
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1571
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "relative", children: [
1572
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1504
1573
  "div",
1505
1574
  {
1506
1575
  className: cn(
@@ -1509,8 +1578,8 @@ function ChatComposer({
1509
1578
  ),
1510
1579
  "aria-hidden": channel !== "email",
1511
1580
  children: [
1512
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(ComposerEmailFieldRow, { label: "To", children: [
1513
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1581
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(ComposerEmailFieldRow, { label: "To", children: [
1582
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1514
1583
  "input",
1515
1584
  {
1516
1585
  type: "email",
@@ -1520,7 +1589,7 @@ function ChatComposer({
1520
1589
  className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
1521
1590
  }
1522
1591
  ),
1523
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1592
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1524
1593
  "button",
1525
1594
  {
1526
1595
  type: "button",
@@ -1528,12 +1597,12 @@ function ChatComposer({
1528
1597
  className: "flex shrink-0 items-center gap-0.5 text-sm text-muted-foreground hover:text-foreground",
1529
1598
  children: [
1530
1599
  "CC",
1531
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ChevronDown, { className: "size-3.5" })
1600
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.ChevronDown, { className: "size-3.5" })
1532
1601
  ]
1533
1602
  }
1534
1603
  )
1535
1604
  ] }),
1536
- showCc && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComposerEmailFieldRow, { label: "CC", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1605
+ showCc && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ComposerEmailFieldRow, { label: "CC", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1537
1606
  "input",
1538
1607
  {
1539
1608
  type: "email",
@@ -1543,7 +1612,7 @@ function ChatComposer({
1543
1612
  className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
1544
1613
  }
1545
1614
  ) }),
1546
- emailMode !== "reply" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComposerEmailFieldRow, { label: "Subject", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1615
+ emailMode !== "reply" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ComposerEmailFieldRow, { label: "Subject", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1547
1616
  "input",
1548
1617
  {
1549
1618
  type: "text",
@@ -1553,11 +1622,11 @@ function ChatComposer({
1553
1622
  className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
1554
1623
  }
1555
1624
  ) }),
1556
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react4.EditorContent, { editor }),
1557
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
1558
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-0.5", children: [
1559
- emailReplySubject && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
1560
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1625
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react4.EditorContent, { editor }),
1626
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
1627
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-0.5", children: [
1628
+ emailReplySubject && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
1629
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1561
1630
  ToggleGroup,
1562
1631
  {
1563
1632
  type: "single",
@@ -1571,51 +1640,51 @@ function ChatComposer({
1571
1640
  },
1572
1641
  className: "mr-1.5",
1573
1642
  children: [
1574
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ToggleGroupItem, { value: "reply", children: "Reply" }),
1575
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ToggleGroupItem, { value: "new", children: "New email" })
1643
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ToggleGroupItem, { value: "reply", children: "Reply" }),
1644
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ToggleGroupItem, { value: "new", children: "New email" })
1576
1645
  ]
1577
1646
  }
1578
1647
  ),
1579
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { orientation: "vertical", className: "mr-1.5 h-4" })
1648
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Separator, { orientation: "vertical", className: "mr-1.5 h-4" })
1580
1649
  ] }),
1581
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1650
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1582
1651
  ComposerToolbarButton,
1583
1652
  {
1584
1653
  label: "Bold",
1585
- icon: import_lucide_react5.Bold,
1654
+ icon: import_lucide_react6.Bold,
1586
1655
  pressed: editor == null ? void 0 : editor.isActive("bold"),
1587
1656
  onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run()
1588
1657
  }
1589
1658
  ),
1590
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1659
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1591
1660
  ComposerToolbarButton,
1592
1661
  {
1593
1662
  label: "Italic",
1594
- icon: import_lucide_react5.Italic,
1663
+ icon: import_lucide_react6.Italic,
1595
1664
  pressed: editor == null ? void 0 : editor.isActive("italic"),
1596
1665
  onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run()
1597
1666
  }
1598
1667
  ),
1599
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1668
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1600
1669
  ComposerToolbarButton,
1601
1670
  {
1602
1671
  label: "Underline",
1603
- icon: import_lucide_react5.Underline,
1672
+ icon: import_lucide_react6.Underline,
1604
1673
  pressed: editor == null ? void 0 : editor.isActive("underline"),
1605
1674
  onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleUnderline().run()
1606
1675
  }
1607
1676
  ),
1608
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { orientation: "vertical", className: "mx-1.5 h-4" }),
1609
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComposerLinkPopover, { editor }),
1610
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComposerToolbarButton, { label: "Attach file", icon: import_lucide_react5.Paperclip })
1677
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Separator, { orientation: "vertical", className: "mx-1.5 h-4" }),
1678
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ComposerLinkPopover, { editor }),
1679
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ComposerToolbarButton, { label: "Attach file", icon: import_lucide_react6.Paperclip })
1611
1680
  ] }),
1612
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1681
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1613
1682
  Button,
1614
1683
  {
1615
1684
  size: "sm",
1616
1685
  onClick: () => {
1617
- var _a;
1618
- const html = (_a = editor == null ? void 0 : editor.getHTML()) != null ? _a : "";
1686
+ var _a2;
1687
+ const html = (_a2 = editor == null ? void 0 : editor.getHTML()) != null ? _a2 : "";
1619
1688
  onSendEmail == null ? void 0 : onSendEmail({
1620
1689
  content: html,
1621
1690
  to: emailTo,
@@ -1627,7 +1696,7 @@ function ChatComposer({
1627
1696
  },
1628
1697
  disabled: !editor || editor.isEmpty || !emailTo.trim(),
1629
1698
  children: [
1630
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Send, { className: "mr-1.5 size-3.5" }),
1699
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Send, { className: "mr-1.5 size-3.5" }),
1631
1700
  "Send Email"
1632
1701
  ]
1633
1702
  }
@@ -1636,8 +1705,8 @@ function ChatComposer({
1636
1705
  ]
1637
1706
  }
1638
1707
  ),
1639
- channel === "chat" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "absolute inset-0 flex flex-col gap-3 p-4", children: [
1640
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1708
+ channel === "chat" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "absolute inset-0 flex flex-col gap-3 p-4", children: [
1709
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1641
1710
  Textarea,
1642
1711
  {
1643
1712
  value: inputValue,
@@ -1646,12 +1715,12 @@ function ChatComposer({
1646
1715
  className: "min-h-0 flex-1 resize-none text-base"
1647
1716
  }
1648
1717
  ),
1649
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-between", children: [
1650
- initialChannelRef.current !== "email" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
1651
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Bot, { className: "mr-1.5 size-3.5" }),
1718
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center justify-between", children: [
1719
+ initialChannelRef.current !== "email" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
1720
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Bot, { className: "mr-1.5 size-3.5" }),
1652
1721
  "Let AI Handle"
1653
1722
  ] }),
1654
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1723
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1655
1724
  Button,
1656
1725
  {
1657
1726
  size: "sm",
@@ -1659,7 +1728,7 @@ function ChatComposer({
1659
1728
  onClick: () => onSend == null ? void 0 : onSend(inputValue),
1660
1729
  disabled: !inputValue.trim(),
1661
1730
  children: [
1662
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Send, { className: "mr-1.5 size-3.5" }),
1731
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Send, { className: "mr-1.5 size-3.5" }),
1663
1732
  "Send"
1664
1733
  ]
1665
1734
  }
@@ -1716,13 +1785,13 @@ function ChatThread({
1716
1785
  const prevLastMessageIdRef = import_react3.default.useRef(void 0);
1717
1786
  const prevContactIdRef = import_react3.default.useRef(contact.id);
1718
1787
  import_react3.default.useLayoutEffect(() => {
1719
- var _a, _b;
1788
+ var _a2, _b;
1720
1789
  const el = scrollRef.current;
1721
1790
  if (!el) return;
1722
1791
  if (preLoadScrollHeightRef.current !== null) {
1723
1792
  el.scrollTop = el.scrollHeight - preLoadScrollHeightRef.current;
1724
1793
  preLoadScrollHeightRef.current = null;
1725
- prevLastMessageIdRef.current = (_a = messages[messages.length - 1]) == null ? void 0 : _a.id;
1794
+ prevLastMessageIdRef.current = (_a2 = messages[messages.length - 1]) == null ? void 0 : _a2.id;
1726
1795
  prevContactIdRef.current = contact.id;
1727
1796
  return;
1728
1797
  }
@@ -1740,8 +1809,8 @@ function ChatThread({
1740
1809
  const el = scrollRef.current;
1741
1810
  if (el) el.scrollTop = el.scrollHeight;
1742
1811
  }, [isAiTyping]);
1743
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("flex flex-col bg-background", className), children: [
1744
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1812
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: cn("flex flex-col bg-background", className), children: [
1813
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1745
1814
  "div",
1746
1815
  {
1747
1816
  className: cn(
@@ -1749,7 +1818,7 @@ function ChatThread({
1749
1818
  "flex items-center gap-3 border-b border-border px-4"
1750
1819
  ),
1751
1820
  children: [
1752
- onBack && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1821
+ onBack && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1753
1822
  Button,
1754
1823
  {
1755
1824
  variant: "ghost",
@@ -1757,28 +1826,28 @@ function ChatThread({
1757
1826
  className: "size-8 shrink-0 md:hidden",
1758
1827
  onClick: onBack,
1759
1828
  "aria-label": "Back to conversations",
1760
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ArrowLeft, { className: "size-4" })
1829
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.ArrowLeft, { className: "size-4" })
1761
1830
  }
1762
1831
  ),
1763
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ContactAvatar, { name: contact.name, size: "md" }),
1764
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "min-w-0 flex-1", children: [
1765
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2", children: [
1766
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
1767
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ConversationStatusChip, { status, showDot: true })
1832
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ContactAvatar, { name: contact.name, size: "md" }),
1833
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "min-w-0 flex-1", children: [
1834
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
1835
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
1836
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ConversationStatusChip, { status, showDot: true })
1768
1837
  ] }),
1769
- contact.email && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-sm text-muted-foreground", children: contact.email })
1838
+ contact.email && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-muted-foreground", children: contact.email })
1770
1839
  ] }),
1771
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex shrink-0 items-center gap-2", children: [
1772
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "hidden items-center gap-2 md:flex", children: [
1773
- isClosed && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { variant: "outline", size: "sm", onClick: onReopen, children: "Reopen" }),
1774
- !isClosed && aiIsHandling && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { size: "sm", onClick: onTakeOver, children: "Take Over" }),
1775
- !isClosed && !aiIsHandling && channel !== "email" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
1776
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Bot, { className: "mr-1.5 size-3.5" }),
1840
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex shrink-0 items-center gap-2", children: [
1841
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "hidden items-center gap-2 md:flex", children: [
1842
+ isClosed && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { variant: "outline", size: "sm", onClick: onReopen, children: "Reopen" }),
1843
+ !isClosed && aiIsHandling && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { size: "sm", onClick: onTakeOver, children: "Take Over" }),
1844
+ !isClosed && !aiIsHandling && channel !== "email" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
1845
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Bot, { className: "mr-1.5 size-3.5" }),
1777
1846
  "Let AI Handle"
1778
1847
  ] })
1779
1848
  ] }),
1780
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenu, { children: [
1781
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1849
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenu, { children: [
1850
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1782
1851
  DropdownMenuTrigger,
1783
1852
  {
1784
1853
  className: cn(
@@ -1786,38 +1855,38 @@ function ChatThread({
1786
1855
  "size-8"
1787
1856
  ),
1788
1857
  "aria-label": "More actions",
1789
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.MoreHorizontal, { className: "size-4" })
1858
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.MoreHorizontal, { className: "size-4" })
1790
1859
  }
1791
1860
  ),
1792
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuContent, { children: [
1793
- onShowLeadInfo && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
1794
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1861
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuContent, { children: [
1862
+ onShowLeadInfo && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
1863
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1795
1864
  DropdownMenuItem,
1796
1865
  {
1797
1866
  className: "md:hidden",
1798
1867
  onClick: onShowLeadInfo,
1799
1868
  children: [
1800
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ChevronRight, { className: "mr-2 size-4" }),
1869
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.ChevronRight, { className: "mr-2 size-4" }),
1801
1870
  "Lead Info"
1802
1871
  ]
1803
1872
  }
1804
1873
  ),
1805
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuSeparator, { className: "md:hidden" })
1874
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuSeparator, { className: "md:hidden" })
1806
1875
  ] }),
1807
- status === "needs-attention" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onUnmarkUrgent, children: [
1808
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Flag, { className: "mr-2 size-4" }),
1876
+ status === "needs-attention" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuItem, { onClick: onUnmarkUrgent, children: [
1877
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Flag, { className: "mr-2 size-4" }),
1809
1878
  "Unmark Urgent"
1810
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onMarkUrgent, children: [
1811
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Flag, { className: "mr-2 size-4" }),
1879
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuItem, { onClick: onMarkUrgent, children: [
1880
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Flag, { className: "mr-2 size-4" }),
1812
1881
  "Mark as Urgent"
1813
1882
  ] }),
1814
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onAssignToAdvisor, children: [
1815
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.UserCheck, { className: "mr-2 size-4" }),
1883
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuItem, { onClick: onAssignToAdvisor, children: [
1884
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.UserCheck, { className: "mr-2 size-4" }),
1816
1885
  "Assign to advisor"
1817
1886
  ] }),
1818
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuSeparator, {}),
1819
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onArchive, children: [
1820
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Archive, { className: "mr-2 size-4" }),
1887
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuSeparator, {}),
1888
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuItem, { onClick: onArchive, children: [
1889
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Archive, { className: "mr-2 size-4" }),
1821
1890
  "Archive"
1822
1891
  ] })
1823
1892
  ] })
@@ -1826,7 +1895,7 @@ function ChatThread({
1826
1895
  ]
1827
1896
  }
1828
1897
  ),
1829
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1898
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1830
1899
  "div",
1831
1900
  {
1832
1901
  ref: scrollRef,
@@ -1834,29 +1903,29 @@ function ChatThread({
1834
1903
  className: "flex flex-1 flex-col gap-4 overflow-y-auto p-4",
1835
1904
  tabIndex: 0,
1836
1905
  children: [
1837
- isLoadingMoreMessages && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex justify-center py-1 text-caption text-muted-foreground", children: "Loading older messages..." }),
1838
- messages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground", children: [
1839
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.MessageSquare, { className: "size-8 opacity-30" }),
1840
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-sm", children: "No messages yet" })
1841
- ] }) : messages.map((msg) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChatBubble, { message: msg, channel }, msg.id)),
1842
- isAiTyping && !isClosed && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex gap-2.5", children: [
1843
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BubbleAvatar, { role: "bot" }),
1844
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col gap-1", children: [
1845
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-caption text-muted-foreground", children: "AI Assistant" }),
1846
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-1 border border-border bg-muted/60 px-3 py-2.5", children: [
1847
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:0ms]" }),
1848
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:150ms]" }),
1849
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:300ms]" })
1906
+ isLoadingMoreMessages && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex justify-center py-1 text-caption text-muted-foreground", children: "Loading older messages..." }),
1907
+ messages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground", children: [
1908
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.MessageSquare, { className: "size-8 opacity-30" }),
1909
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm", children: "No messages yet" })
1910
+ ] }) : messages.map((msg) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChatBubble, { message: msg, channel }, msg.id)),
1911
+ isAiTyping && !isClosed && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex gap-2.5", children: [
1912
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(BubbleAvatar, { role: "bot" }),
1913
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col gap-1", children: [
1914
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-caption text-muted-foreground", children: "AI Assistant" }),
1915
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-1 border border-border bg-muted/60 px-3 py-2.5", children: [
1916
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:0ms]" }),
1917
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:150ms]" }),
1918
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:300ms]" })
1850
1919
  ] })
1851
1920
  ] })
1852
1921
  ] })
1853
1922
  ]
1854
1923
  }
1855
1924
  ),
1856
- isClosed ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-3 border-t border-border bg-muted/30 px-4 py-3 text-sm text-muted-foreground", children: [
1857
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Lock, { className: "size-3.5 shrink-0" }),
1858
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "This conversation is closed." }),
1859
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1925
+ isClosed ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-3 border-t border-border bg-muted/30 px-4 py-3 text-sm text-muted-foreground", children: [
1926
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Lock, { className: "size-3.5 shrink-0" }),
1927
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: "This conversation is closed." }),
1928
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1860
1929
  Button,
1861
1930
  {
1862
1931
  variant: "outline",
@@ -1866,7 +1935,7 @@ function ChatThread({
1866
1935
  children: "Reopen"
1867
1936
  }
1868
1937
  )
1869
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1938
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1870
1939
  ChatComposer,
1871
1940
  {
1872
1941
  mode,
@@ -1887,21 +1956,21 @@ function ChatThread({
1887
1956
  }
1888
1957
 
1889
1958
  // src/components/ui/ai-conversations/lead-panel.tsx
1890
- var import_lucide_react6 = require("lucide-react");
1891
- var import_jsx_runtime18 = require("react/jsx-runtime");
1959
+ var import_lucide_react7 = require("lucide-react");
1960
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1892
1961
  function AICollectedDataSection({
1893
1962
  fields,
1894
1963
  className
1895
1964
  }) {
1896
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: cn("flex flex-col", className), children: fields.map((field, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1965
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn("flex flex-col", className), children: fields.map((field, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
1897
1966
  "div",
1898
1967
  {
1899
1968
  className: "flex items-center justify-between gap-2 border-b border-border/40 py-1.5 last:border-b-0",
1900
1969
  children: [
1901
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "shrink-0 text-sm text-muted-foreground", children: field.label }),
1902
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-1.5", children: [
1903
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-right text-sm font-medium text-foreground", children: field.value }),
1904
- field.confidence === "confirmed" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.CheckCircle2, { className: "size-3 shrink-0 text-success-text" }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.HelpCircle, { className: "size-3 shrink-0 text-warning-text" })
1970
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "shrink-0 text-sm text-muted-foreground", children: field.label }),
1971
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-1.5", children: [
1972
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-right text-sm font-medium text-foreground", children: field.value }),
1973
+ field.confidence === "confirmed" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.CheckCircle2, { className: "size-3 shrink-0 text-success-text" }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.HelpCircle, { className: "size-3 shrink-0 text-warning-text" })
1905
1974
  ] })
1906
1975
  ]
1907
1976
  },
@@ -1915,9 +1984,9 @@ var APPOINTMENT_STATUS_LABEL = {
1915
1984
  cancelled: "Cancelled"
1916
1985
  };
1917
1986
  var MEETING_ICON = {
1918
- video: import_lucide_react6.Video,
1919
- phone: import_lucide_react6.Phone,
1920
- "in-person": import_lucide_react6.MapPin
1987
+ video: import_lucide_react7.Video,
1988
+ phone: import_lucide_react7.Phone,
1989
+ "in-person": import_lucide_react7.MapPin
1921
1990
  };
1922
1991
  var MEETING_LABEL = {
1923
1992
  video: "Video Call",
@@ -1925,9 +1994,9 @@ var MEETING_LABEL = {
1925
1994
  "in-person": "In Person"
1926
1995
  };
1927
1996
  var MEETING_DETAIL_ICON = {
1928
- video: import_lucide_react6.Link2,
1929
- phone: import_lucide_react6.PhoneCall,
1930
- "in-person": import_lucide_react6.Navigation
1997
+ video: import_lucide_react7.Link2,
1998
+ phone: import_lucide_react7.PhoneCall,
1999
+ "in-person": import_lucide_react7.Navigation
1931
2000
  };
1932
2001
  function MeetingDetailRow({
1933
2002
  meetingType,
@@ -1935,9 +2004,9 @@ function MeetingDetailRow({
1935
2004
  }) {
1936
2005
  const DetailIcon = MEETING_DETAIL_ICON[meetingType];
1937
2006
  const isLink = detail.startsWith("http");
1938
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
1939
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DetailIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
1940
- isLink ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2007
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2", children: [
2008
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DetailIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
2009
+ isLink ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1941
2010
  "a",
1942
2011
  {
1943
2012
  href: detail,
@@ -1946,7 +2015,7 @@ function MeetingDetailRow({
1946
2015
  className: "text-sm text-primary underline underline-offset-2 break-all hover:text-primary/80",
1947
2016
  children: detail
1948
2017
  }
1949
- ) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm text-muted-foreground break-all", children: detail })
2018
+ ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-sm text-muted-foreground break-all", children: detail })
1950
2019
  ] });
1951
2020
  }
1952
2021
  function AppointmentSection({
@@ -1959,23 +2028,23 @@ function AppointmentSection({
1959
2028
  }) {
1960
2029
  const AppointmentIcon = MEETING_ICON[appointment.meetingType];
1961
2030
  const canReschedule = !isAnonymous && !!onRescheduleAppointment;
1962
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col gap-2", children: [
1963
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
1964
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Calendar, { className: "size-3.5 shrink-0 text-muted-foreground" }),
1965
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm font-medium text-foreground", children: appointment.datetime })
2031
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col gap-2", children: [
2032
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2", children: [
2033
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.Calendar, { className: "size-3.5 shrink-0 text-muted-foreground" }),
2034
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-sm font-medium text-foreground", children: appointment.datetime })
1966
2035
  ] }),
1967
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
1968
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AppointmentIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
1969
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm text-muted-foreground", children: MEETING_LABEL[appointment.meetingType] })
2036
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2", children: [
2037
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AppointmentIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
2038
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-sm text-muted-foreground", children: MEETING_LABEL[appointment.meetingType] })
1970
2039
  ] }),
1971
- appointment.meetingDetail && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2040
+ appointment.meetingDetail && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1972
2041
  MeetingDetailRow,
1973
2042
  {
1974
2043
  meetingType: appointment.meetingType,
1975
2044
  detail: appointment.meetingDetail
1976
2045
  }
1977
2046
  ),
1978
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2047
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1979
2048
  "span",
1980
2049
  {
1981
2050
  className: cn("text-sm font-medium", {
@@ -1987,9 +2056,9 @@ function AppointmentSection({
1987
2056
  children: APPOINTMENT_STATUS_LABEL[appointment.status]
1988
2057
  }
1989
2058
  ),
1990
- appointment.status === "requested" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex gap-2 pt-1", children: [
1991
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { size: "sm", className: "flex-1", onClick: onApproveAppointment, children: "Approve" }),
1992
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2059
+ appointment.status === "requested" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex gap-2 pt-1", children: [
2060
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { size: "sm", className: "flex-1", onClick: onApproveAppointment, children: "Approve" }),
2061
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1993
2062
  Button,
1994
2063
  {
1995
2064
  variant: "outline",
@@ -1999,7 +2068,7 @@ function AppointmentSection({
1999
2068
  children: "Decline"
2000
2069
  }
2001
2070
  ),
2002
- canReschedule && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2071
+ canReschedule && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2003
2072
  Button,
2004
2073
  {
2005
2074
  variant: "ghost",
@@ -2010,7 +2079,7 @@ function AppointmentSection({
2010
2079
  }
2011
2080
  )
2012
2081
  ] }),
2013
- (appointment.status === "confirmed" || appointment.status === "cancelled") && canReschedule && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2082
+ (appointment.status === "confirmed" || appointment.status === "cancelled") && canReschedule && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2014
2083
  Button,
2015
2084
  {
2016
2085
  variant: "outline",
@@ -2023,13 +2092,13 @@ function AppointmentSection({
2023
2092
  ] });
2024
2093
  }
2025
2094
  function PanelSectionHeader({ children }) {
2026
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mb-2.5 text-overline text-muted-foreground", children });
2095
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "mb-2.5 text-overline text-muted-foreground", children });
2027
2096
  }
2028
2097
  function PanelSection({
2029
2098
  children,
2030
2099
  last = false
2031
2100
  }) {
2032
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: cn("px-4 py-4", !last && "border-b border-border"), children });
2101
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn("px-4 py-4", !last && "border-b border-border"), children });
2033
2102
  }
2034
2103
  function LeadInfoPanel({
2035
2104
  contact,
@@ -2055,8 +2124,8 @@ function LeadInfoPanel({
2055
2124
  }) {
2056
2125
  const isAnonymous = !contact.name.trim();
2057
2126
  const addToContactsDisabled = isAnonymous || isKnownContact;
2058
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: cn("flex flex-col bg-background", className), children: [
2059
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2127
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cn("flex flex-col bg-background", className), children: [
2128
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2060
2129
  "div",
2061
2130
  {
2062
2131
  className: cn(
@@ -2064,7 +2133,7 @@ function LeadInfoPanel({
2064
2133
  "flex items-center justify-between border-b border-border px-4"
2065
2134
  ),
2066
2135
  children: [
2067
- onBack && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2136
+ onBack && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2068
2137
  Button,
2069
2138
  {
2070
2139
  variant: "ghost",
@@ -2072,15 +2141,15 @@ function LeadInfoPanel({
2072
2141
  className: "size-8 shrink-0 md:hidden",
2073
2142
  onClick: onBack,
2074
2143
  "aria-label": "Back to conversation",
2075
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.ArrowLeft, { className: "size-4" })
2144
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.ArrowLeft, { className: "size-4" })
2076
2145
  }
2077
2146
  ),
2078
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm font-semibold text-foreground", children: "Lead Info" }),
2079
- onToggleCollapse && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
2080
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2147
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-sm font-semibold text-foreground", children: "Lead Info" }),
2148
+ onToggleCollapse && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Tooltip, { children: [
2149
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2081
2150
  TooltipTrigger,
2082
2151
  {
2083
- render: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2152
+ render: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2084
2153
  Button,
2085
2154
  {
2086
2155
  variant: "ghost",
@@ -2088,8 +2157,8 @@ function LeadInfoPanel({
2088
2157
  className: "size-7",
2089
2158
  onClick: onToggleCollapse,
2090
2159
  "aria-label": isCollapsed ? "Expand panel" : "Collapse panel",
2091
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2092
- import_lucide_react6.ChevronRight,
2160
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2161
+ import_lucide_react7.ChevronRight,
2093
2162
  {
2094
2163
  className: cn(
2095
2164
  "size-4 transition-transform duration-150",
@@ -2101,26 +2170,26 @@ function LeadInfoPanel({
2101
2170
  )
2102
2171
  }
2103
2172
  ),
2104
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipContent, { children: isCollapsed ? "Expand panel" : "Collapse panel" })
2173
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TooltipContent, { children: isCollapsed ? "Expand panel" : "Collapse panel" })
2105
2174
  ] })
2106
2175
  ]
2107
2176
  }
2108
2177
  ),
2109
- !isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: [
2110
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { children: [
2111
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelSectionHeader, { children: "Contact" }),
2112
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-3", children: [
2113
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ContactAvatar, { name: contact.name, size: "lg" }),
2114
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "min-w-0 flex-1", children: [
2115
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
2116
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-muted-foreground", children: source }),
2117
- topic && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Badge, { variant: "secondary", className: "mt-1 text-xs", children: topic })
2178
+ !isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: [
2179
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(PanelSection, { children: [
2180
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PanelSectionHeader, { children: "Contact" }),
2181
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-3", children: [
2182
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ContactAvatar, { name: contact.name, size: "lg" }),
2183
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "min-w-0 flex-1", children: [
2184
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
2185
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm text-muted-foreground", children: source }),
2186
+ topic && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Badge, { variant: "secondary", className: "mt-1 text-xs", children: topic })
2118
2187
  ] })
2119
2188
  ] }),
2120
- (contact.email || contact.phone || firstSeen) && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mt-3 flex flex-col gap-1.5", children: [
2121
- contact.email && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
2122
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Mail, { className: "size-4 shrink-0" }),
2123
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2189
+ (contact.email || contact.phone || firstSeen) && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "mt-3 flex flex-col gap-1.5", children: [
2190
+ contact.email && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
2191
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.Mail, { className: "size-4 shrink-0" }),
2192
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2124
2193
  "a",
2125
2194
  {
2126
2195
  href: `mailto:${contact.email}`,
@@ -2129,9 +2198,9 @@ function LeadInfoPanel({
2129
2198
  }
2130
2199
  )
2131
2200
  ] }),
2132
- contact.phone && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
2133
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.PhoneCall, { className: "size-4 shrink-0" }),
2134
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2201
+ contact.phone && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
2202
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.PhoneCall, { className: "size-4 shrink-0" }),
2203
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2135
2204
  "a",
2136
2205
  {
2137
2206
  href: `tel:${contact.phone}`,
@@ -2140,31 +2209,31 @@ function LeadInfoPanel({
2140
2209
  }
2141
2210
  )
2142
2211
  ] }),
2143
- firstSeen && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { className: "text-sm text-muted-foreground", children: [
2212
+ firstSeen && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("p", { className: "text-sm text-muted-foreground", children: [
2144
2213
  "First seen: ",
2145
2214
  firstSeen
2146
2215
  ] })
2147
2216
  ] })
2148
2217
  ] }),
2149
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { children: [
2150
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelSectionHeader, { children: "AI-Collected Data" }),
2151
- aiFields.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
2152
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AICollectedDataSection, { fields: aiFields }),
2153
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mt-2.5 flex items-center gap-3 text-xs text-muted-foreground", children: [
2154
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-1", children: [
2155
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.CheckCircle2, { className: "size-3 text-success-text" }),
2218
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(PanelSection, { children: [
2219
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PanelSectionHeader, { children: "AI-Collected Data" }),
2220
+ aiFields.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
2221
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AICollectedDataSection, { fields: aiFields }),
2222
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "mt-2.5 flex items-center gap-3 text-xs text-muted-foreground", children: [
2223
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "flex items-center gap-1", children: [
2224
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.CheckCircle2, { className: "size-3 text-success-text" }),
2156
2225
  "confirmed"
2157
2226
  ] }),
2158
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-1", children: [
2159
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.HelpCircle, { className: "size-3 text-warning-text" }),
2227
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "flex items-center gap-1", children: [
2228
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.HelpCircle, { className: "size-3 text-warning-text" }),
2160
2229
  "estimated"
2161
2230
  ] })
2162
2231
  ] })
2163
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-muted-foreground", children: "AI is still gathering information..." })
2232
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm text-muted-foreground", children: "AI is still gathering information..." })
2164
2233
  ] }),
2165
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { children: [
2166
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelSectionHeader, { children: "Appointment" }),
2167
- appointment ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2234
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(PanelSection, { children: [
2235
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PanelSectionHeader, { children: "Appointment" }),
2236
+ appointment ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2168
2237
  AppointmentSection,
2169
2238
  {
2170
2239
  appointment,
@@ -2174,7 +2243,7 @@ function LeadInfoPanel({
2174
2243
  onDeclineAppointment,
2175
2244
  onRescheduleAppointment
2176
2245
  }
2177
- ) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2246
+ ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2178
2247
  Button,
2179
2248
  {
2180
2249
  variant: "outline",
@@ -2183,20 +2252,20 @@ function LeadInfoPanel({
2183
2252
  disabled: isAnonymous,
2184
2253
  onClick: onBookAppointment,
2185
2254
  children: [
2186
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Plus, { className: "mr-1.5 size-3.5" }),
2255
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.Plus, { className: "mr-1.5 size-3.5" }),
2187
2256
  "Book Appointment"
2188
2257
  ]
2189
2258
  }
2190
2259
  )
2191
2260
  ] }),
2192
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { children: [
2193
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelSectionHeader, { children: "CRM Actions" }),
2194
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col gap-2", children: [
2195
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
2196
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2261
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(PanelSection, { children: [
2262
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PanelSectionHeader, { children: "CRM Actions" }),
2263
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col gap-2", children: [
2264
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Tooltip, { children: [
2265
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2197
2266
  TooltipTrigger,
2198
2267
  {
2199
- render: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2268
+ render: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2200
2269
  Button,
2201
2270
  {
2202
2271
  variant: "outline",
@@ -2205,16 +2274,16 @@ function LeadInfoPanel({
2205
2274
  disabled: addToContactsDisabled,
2206
2275
  onClick: onAddToContacts,
2207
2276
  children: [
2208
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.UserPlus, { className: "mr-1.5 size-3.5" }),
2277
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.UserPlus, { className: "mr-1.5 size-3.5" }),
2209
2278
  "Add to Contacts"
2210
2279
  ]
2211
2280
  }
2212
2281
  )
2213
2282
  }
2214
2283
  ),
2215
- isKnownContact && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipContent, { children: "Already in contacts" })
2284
+ isKnownContact && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TooltipContent, { children: "Already in contacts" })
2216
2285
  ] }),
2217
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2286
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2218
2287
  Button,
2219
2288
  {
2220
2289
  variant: "outline",
@@ -2223,23 +2292,23 @@ function LeadInfoPanel({
2223
2292
  disabled: isAnonymous,
2224
2293
  onClick: onCreateOpportunity,
2225
2294
  children: [
2226
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Briefcase, { className: "mr-1.5 size-3.5" }),
2295
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.Briefcase, { className: "mr-1.5 size-3.5" }),
2227
2296
  "Add to CRM"
2228
2297
  ]
2229
2298
  }
2230
2299
  )
2231
2300
  ] })
2232
2301
  ] }),
2233
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { last: true, children: [
2234
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mb-2.5 flex items-center justify-between", children: [
2235
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-overline text-muted-foreground", children: "Internal Notes" }),
2236
- notesSaveStatus === "saving" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xs text-muted-foreground", children: "Saving..." }),
2237
- notesSaveStatus === "saved" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-1 text-xs text-success-text", children: [
2238
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.CheckCircle2, { className: "size-3" }),
2302
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(PanelSection, { last: true, children: [
2303
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "mb-2.5 flex items-center justify-between", children: [
2304
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-overline text-muted-foreground", children: "Internal Notes" }),
2305
+ notesSaveStatus === "saving" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-xs text-muted-foreground", children: "Saving..." }),
2306
+ notesSaveStatus === "saved" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "flex items-center gap-1 text-xs text-success-text", children: [
2307
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.CheckCircle2, { className: "size-3" }),
2239
2308
  "Saved"
2240
2309
  ] })
2241
2310
  ] }),
2242
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2311
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2243
2312
  Textarea,
2244
2313
  {
2245
2314
  value: internalNotes,
@@ -2255,7 +2324,7 @@ function LeadInfoPanel({
2255
2324
  }
2256
2325
 
2257
2326
  // src/components/ui/ai-conversations/index.tsx
2258
- var import_jsx_runtime19 = require("react/jsx-runtime");
2327
+ var import_jsx_runtime20 = require("react/jsx-runtime");
2259
2328
  function ConversationsPage({
2260
2329
  conversations,
2261
2330
  activeConversationId,
@@ -2323,12 +2392,12 @@ function ConversationsPage({
2323
2392
  onToggleLeadPanel == null ? void 0 : onToggleLeadPanel();
2324
2393
  setMobilePanel(showLeadPanel ? "chat" : "lead");
2325
2394
  };
2326
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2395
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2327
2396
  "div",
2328
2397
  {
2329
2398
  className: cn("flex h-full overflow-hidden bg-background", className),
2330
2399
  children: [
2331
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2400
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2332
2401
  ConversationList,
2333
2402
  {
2334
2403
  conversations,
@@ -2350,7 +2419,7 @@ function ConversationsPage({
2350
2419
  )
2351
2420
  }
2352
2421
  ),
2353
- contact ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2422
+ contact ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2354
2423
  ChatThread,
2355
2424
  {
2356
2425
  contact,
@@ -2384,21 +2453,21 @@ function ConversationsPage({
2384
2453
  )
2385
2454
  },
2386
2455
  contact.id
2387
- ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2456
+ ) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2388
2457
  "div",
2389
2458
  {
2390
2459
  className: cn(
2391
2460
  "min-w-0 flex-1 items-center justify-center border-r border-border bg-muted/10",
2392
2461
  mobilePanel === "chat" ? "flex md:flex" : "hidden md:flex"
2393
2462
  ),
2394
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
2395
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.MessageSquare, { className: "size-10 opacity-30" }),
2396
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm", children: "Select a conversation" })
2463
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
2464
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.MessageSquare, { className: "size-10 opacity-30" }),
2465
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm", children: "Select a conversation" })
2397
2466
  ] })
2398
2467
  }
2399
2468
  ),
2400
- contact && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
2401
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2469
+ contact && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
2470
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2402
2471
  "div",
2403
2472
  {
2404
2473
  className: cn(
@@ -2406,7 +2475,7 @@ function ConversationsPage({
2406
2475
  "md:block md:shrink-0 md:overflow-hidden md:transition-[width] md:duration-200 md:ease-in-out",
2407
2476
  showLeadPanel ? "md:w-[320px]" : "md:w-0"
2408
2477
  ),
2409
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2478
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2410
2479
  LeadInfoPanel,
2411
2480
  {
2412
2481
  contact,
@@ -2432,11 +2501,11 @@ function ConversationsPage({
2432
2501
  )
2433
2502
  }
2434
2503
  ),
2435
- !showLeadPanel && onToggleLeadPanel && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "hidden shrink-0 items-start border-l border-border pt-[29px] md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Tooltip, { children: [
2436
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2504
+ !showLeadPanel && onToggleLeadPanel && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "hidden shrink-0 items-start border-l border-border pt-[29px] md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Tooltip, { children: [
2505
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2437
2506
  TooltipTrigger,
2438
2507
  {
2439
- render: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2508
+ render: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2440
2509
  Button,
2441
2510
  {
2442
2511
  variant: "ghost",
@@ -2444,12 +2513,12 @@ function ConversationsPage({
2444
2513
  className: "size-8",
2445
2514
  "aria-label": "Show lead info",
2446
2515
  onClick: handleToggleLeadPanel,
2447
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.ChevronLeft, { className: "size-4" })
2516
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.ChevronLeft, { className: "size-4" })
2448
2517
  }
2449
2518
  )
2450
2519
  }
2451
2520
  ),
2452
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TooltipContent, { children: "Show lead info" })
2521
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipContent, { children: "Show lead info" })
2453
2522
  ] }) })
2454
2523
  ] })
2455
2524
  ]
@@ -2479,13 +2548,13 @@ function AiConvAssignAdvisorDialog({
2479
2548
  setRoleFilter("");
2480
2549
  }
2481
2550
  };
2482
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DialogContent, { children: [
2483
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DialogHeader, { children: [
2484
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DialogTitle, { children: "Assign to advisor" }),
2485
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DialogDescription, { children: "Choose an advisor to handle this conversation." })
2551
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogContent, { children: [
2552
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogHeader, { children: [
2553
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DialogTitle, { children: "Assign to advisor" }),
2554
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DialogDescription, { children: "Choose an advisor to handle this conversation." })
2486
2555
  ] }),
2487
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col gap-0", children: [
2488
- roles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pb-3", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2556
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-0", children: [
2557
+ roles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "pb-3", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2489
2558
  ToggleGroup,
2490
2559
  {
2491
2560
  type: "single",
@@ -2498,14 +2567,14 @@ function AiConvAssignAdvisorDialog({
2498
2567
  setRoleFilter(!v || v === "__all__" ? "" : v);
2499
2568
  },
2500
2569
  children: [
2501
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ToggleGroupItem, { value: "__all__", children: "All" }),
2502
- roles.map((role) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ToggleGroupItem, { value: role, children: role }, role))
2570
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ToggleGroupItem, { value: "__all__", children: "All" }),
2571
+ roles.map((role) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ToggleGroupItem, { value: role, children: role }, role))
2503
2572
  ]
2504
2573
  }
2505
2574
  ) }),
2506
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2 border border-input px-3", children: [
2507
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.Search, { className: "size-4 shrink-0 text-muted-foreground" }),
2508
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2575
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2 border border-input px-3", children: [
2576
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Search, { className: "size-4 shrink-0 text-muted-foreground" }),
2577
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2509
2578
  "input",
2510
2579
  {
2511
2580
  type: "text",
@@ -2516,7 +2585,7 @@ function AiConvAssignAdvisorDialog({
2516
2585
  }
2517
2586
  )
2518
2587
  ] }),
2519
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "max-h-52 overflow-y-auto border border-t-0 border-input", children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "No advisors found." }) : filtered.map((advisor) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2588
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "max-h-52 overflow-y-auto border border-t-0 border-input", children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "No advisors found." }) : filtered.map((advisor) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2520
2589
  "button",
2521
2590
  {
2522
2591
  type: "button",
@@ -2526,19 +2595,19 @@ function AiConvAssignAdvisorDialog({
2526
2595
  value === advisor.id && "bg-muted font-medium"
2527
2596
  ),
2528
2597
  children: [
2529
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Avatar, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AvatarFallback, { className: "font-semibold", children: advisor.initials }) }),
2530
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "min-w-0 flex-1", children: [
2531
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "truncate text-sm", children: advisor.name }),
2532
- advisor.role && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "truncate text-xs text-muted-foreground", children: advisor.role })
2598
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Avatar, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AvatarFallback, { className: "font-semibold", children: advisor.initials }) }),
2599
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "min-w-0 flex-1", children: [
2600
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "truncate text-sm", children: advisor.name }),
2601
+ advisor.role && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "truncate text-xs text-muted-foreground", children: advisor.role })
2533
2602
  ] })
2534
2603
  ]
2535
2604
  },
2536
2605
  advisor.id
2537
2606
  )) })
2538
2607
  ] }),
2539
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DialogFooter, { children: [
2540
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
2541
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { onClick: onConfirm, children: "Assign" })
2608
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogFooter, { children: [
2609
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
2610
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Button, { onClick: onConfirm, children: "Assign" })
2542
2611
  ] })
2543
2612
  ] }) });
2544
2613
  }