@wealthx/shadcn 1.5.23 → 1.5.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +147 -147
- package/CHANGELOG.md +12 -0
- package/dist/{chunk-K4GJTP6N.mjs → chunk-4FJC64FV.mjs} +467 -386
- package/dist/{chunk-FGHM34AV.mjs → chunk-7JVKSZ4O.mjs} +1 -1
- package/dist/{chunk-6HTE24TP.mjs → chunk-EY5YPFKX.mjs} +1 -1
- package/dist/{chunk-3HFOSFOM.mjs → chunk-IG7DEIWU.mjs} +4 -4
- package/dist/{chunk-2VTOF7PW.mjs → chunk-K2KX3NX7.mjs} +1 -1
- package/dist/{chunk-NXZ2F4JA.mjs → chunk-KGBLORCQ.mjs} +1 -1
- package/dist/{chunk-2SDEURIQ.mjs → chunk-PX2B3Q3A.mjs} +7 -7
- package/dist/{chunk-66NM4AX2.mjs → chunk-QM7LU2BR.mjs} +10 -10
- package/dist/{chunk-4UCRTTVL.mjs → chunk-RNLIZRAK.mjs} +1 -1
- package/dist/{chunk-BWG7AX6X.mjs → chunk-SQ54W3JH.mjs} +1 -1
- package/dist/{chunk-RJHE3V4M.mjs → chunk-UMR3HVZF.mjs} +4 -4
- package/dist/{chunk-JGUC3KCA.mjs → chunk-VNB5E7SI.mjs} +5 -5
- package/dist/{chunk-ETT5JAXF.mjs → chunk-Z5QI7CW2.mjs} +1 -1
- package/dist/components/ui/about-you-form.mjs +4 -4
- package/dist/components/ui/ai-assistant-drawer.mjs +2 -2
- package/dist/components/ui/{ai-conversations.js → ai-conversations/index.js} +818 -740
- package/dist/components/ui/ai-conversations/index.mjs +42 -0
- package/dist/components/ui/appointment-action-dialogs.mjs +1 -1
- package/dist/components/ui/appointment-availability-settings.mjs +5 -5
- package/dist/components/ui/appointment-book-dialog.mjs +4 -4
- package/dist/components/ui/appointment-detail-sheet.mjs +3 -3
- package/dist/components/ui/appointment-upcoming-card.mjs +1 -1
- package/dist/components/ui/assets-liabilities-side-card.mjs +6 -6
- package/dist/components/ui/backoffice-signup-steps.mjs +4 -4
- package/dist/components/ui/bank-statement-generate-dialog.mjs +6 -6
- package/dist/components/ui/contact-alert-dialog/index.mjs +2 -2
- package/dist/components/ui/create-contact-modal.mjs +3 -3
- package/dist/components/ui/date-picker.mjs +2 -2
- package/dist/components/ui/expense-detail-item.mjs +3 -3
- package/dist/components/ui/expense-work-details.mjs +9 -9
- package/dist/components/ui/file-preview-dialog.mjs +2 -2
- package/dist/components/ui/financial-drawers.mjs +2 -2
- package/dist/components/ui/form-primitives.mjs +2 -2
- package/dist/components/ui/frontend-signup-steps.mjs +5 -5
- package/dist/components/ui/income-work-details.mjs +3 -3
- package/dist/components/ui/kanban-column.mjs +4 -4
- package/dist/components/ui/opportunity-card.mjs +1 -1
- package/dist/components/ui/opportunity-edit-modals.mjs +6 -6
- package/dist/components/ui/opportunity-summary-tab.mjs +8 -8
- package/dist/components/ui/pipeline-board.mjs +6 -6
- package/dist/components/ui/pipeline-dialogs.mjs +5 -5
- package/dist/components/ui/property-report-dialog.mjs +4 -4
- package/dist/components/ui/savings-goal-modal.mjs +4 -4
- package/dist/components/ui/share-details-dialog.mjs +2 -2
- package/dist/components/ui/signup-form-primitives.mjs +1 -1
- package/dist/index.js +4912 -4834
- package/dist/index.mjs +160 -160
- package/dist/styles.css +1 -1
- package/package.json +4 -4
- package/src/components/index.tsx +1 -0
- package/src/components/ui/ai-conversations/helpers.tsx +31 -0
- package/src/components/ui/ai-conversations/index.tsx +468 -0
- package/src/components/ui/ai-conversations/lead-panel.tsx +517 -0
- package/src/components/ui/ai-conversations/list.tsx +335 -0
- package/src/components/ui/ai-conversations/thread.tsx +919 -0
- package/src/components/ui/ai-conversations/types.ts +83 -0
- package/src/styles/styles-css.ts +1 -1
- package/tsup.config.ts +1 -1
- package/dist/components/ui/ai-conversations.mjs +0 -42
- package/src/components/ui/ai-conversations.tsx +0 -2213
- package/dist/{chunk-A43XIVO6.mjs → chunk-2PWTXE66.mjs} +3 -3
- package/dist/{chunk-PSBQ4I3M.mjs → chunk-53ZB2JWT.mjs} +6 -6
- package/dist/{chunk-G6RCC2SF.mjs → chunk-5ST6BK7R.mjs} +3 -3
- package/dist/{chunk-H5NI6ZIU.mjs → chunk-734FOOJC.mjs} +3 -3
- package/dist/{chunk-ONYADWSO.mjs → chunk-ABVCQWDY.mjs} +3 -3
- package/dist/{chunk-AADJ5IT6.mjs → chunk-ECC2LLZM.mjs} +3 -3
- package/dist/{chunk-DK55HZPN.mjs → chunk-KENLXFJ7.mjs} +6 -6
- package/dist/{chunk-ET4MTPIY.mjs → chunk-LDC6V6DJ.mjs} +3 -3
- package/dist/{chunk-3S4XQTAL.mjs → chunk-SO4RB3XB.mjs} +9 -9
- package/dist/{chunk-UMF6LLQK.mjs → chunk-TRM3KIHT.mjs} +3 -3
|
@@ -37,15 +37,15 @@ import {
|
|
|
37
37
|
import {
|
|
38
38
|
Badge
|
|
39
39
|
} from "./chunk-X6RC5UWB.mjs";
|
|
40
|
-
import {
|
|
41
|
-
ToggleGroup,
|
|
42
|
-
ToggleGroupItem
|
|
43
|
-
} from "./chunk-OWFQSXVD.mjs";
|
|
44
40
|
import {
|
|
45
41
|
Popover,
|
|
46
42
|
PopoverContent,
|
|
47
43
|
PopoverTrigger
|
|
48
44
|
} from "./chunk-HB5BKRMH.mjs";
|
|
45
|
+
import {
|
|
46
|
+
ToggleGroup,
|
|
47
|
+
ToggleGroupItem
|
|
48
|
+
} from "./chunk-OWFQSXVD.mjs";
|
|
49
49
|
import {
|
|
50
50
|
Input
|
|
51
51
|
} from "./chunk-LBTHZSBT.mjs";
|
|
@@ -58,58 +58,30 @@ import {
|
|
|
58
58
|
getInitials
|
|
59
59
|
} from "./chunk-AFML43VJ.mjs";
|
|
60
60
|
|
|
61
|
-
// src/components/ui/ai-conversations.tsx
|
|
62
|
-
import
|
|
63
|
-
import {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
import
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
import
|
|
70
|
-
import {
|
|
71
|
-
Archive,
|
|
72
|
-
ArrowLeft,
|
|
73
|
-
Bold,
|
|
74
|
-
Bot,
|
|
75
|
-
Briefcase,
|
|
76
|
-
Calendar,
|
|
77
|
-
CheckCircle2,
|
|
78
|
-
ChevronLeft,
|
|
79
|
-
ChevronRight,
|
|
80
|
-
ChevronDown,
|
|
81
|
-
Flag,
|
|
82
|
-
HelpCircle,
|
|
83
|
-
Italic,
|
|
84
|
-
Link2,
|
|
85
|
-
Lock,
|
|
86
|
-
Mail,
|
|
87
|
-
MapPin,
|
|
88
|
-
MessageSquare,
|
|
89
|
-
MoreHorizontal,
|
|
90
|
-
Navigation,
|
|
91
|
-
Paperclip,
|
|
92
|
-
Phone,
|
|
93
|
-
PhoneCall,
|
|
94
|
-
Plus,
|
|
95
|
-
Search,
|
|
96
|
-
Send,
|
|
97
|
-
Underline,
|
|
98
|
-
UserCheck,
|
|
99
|
-
UserPlus,
|
|
100
|
-
Video
|
|
101
|
-
} from "lucide-react";
|
|
102
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
61
|
+
// src/components/ui/ai-conversations/index.tsx
|
|
62
|
+
import { useState } from "react";
|
|
63
|
+
import { ChevronLeft, MessageSquare as MessageSquare3, Search as Search2 } from "lucide-react";
|
|
64
|
+
|
|
65
|
+
// src/components/ui/ai-conversations/list.tsx
|
|
66
|
+
import { Flag, Mail, MessageSquare, Search } from "lucide-react";
|
|
67
|
+
|
|
68
|
+
// src/components/ui/ai-conversations/helpers.tsx
|
|
69
|
+
import { jsx } from "react/jsx-runtime";
|
|
103
70
|
function displayContactName(name) {
|
|
104
71
|
return name.trim() || "Website User";
|
|
105
72
|
}
|
|
106
73
|
var PANEL_HEADER_HEIGHT = "h-[94px]";
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
74
|
+
function ContactAvatar({
|
|
75
|
+
name,
|
|
76
|
+
size = "md",
|
|
77
|
+
className
|
|
78
|
+
}) {
|
|
79
|
+
const avatarSize = size === "sm" ? "sm" : size === "lg" ? "lg" : "default";
|
|
80
|
+
return /* @__PURE__ */ jsx(Avatar, { size: avatarSize, className, children: /* @__PURE__ */ jsx(AvatarFallback, { className: "font-semibold", children: getInitials(name) }) });
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// src/components/ui/ai-conversations/list.tsx
|
|
84
|
+
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
113
85
|
var STATUS_CONFIG = {
|
|
114
86
|
"ai-active": {
|
|
115
87
|
label: "AI Active",
|
|
@@ -139,14 +111,10 @@ function ConversationStatusChip({
|
|
|
139
111
|
}) {
|
|
140
112
|
const { label, variant, dotClass } = STATUS_CONFIG[status];
|
|
141
113
|
return /* @__PURE__ */ jsxs(Badge, { variant, className, children: [
|
|
142
|
-
showDot && /* @__PURE__ */
|
|
114
|
+
showDot && /* @__PURE__ */ jsx2("span", { className: cn("size-1.5 shrink-0 rounded-full", dotClass) }),
|
|
143
115
|
label
|
|
144
116
|
] });
|
|
145
117
|
}
|
|
146
|
-
function ContactAvatar({ name, size = "md", className }) {
|
|
147
|
-
const avatarSize = size === "sm" ? "sm" : size === "lg" ? "lg" : "default";
|
|
148
|
-
return /* @__PURE__ */ jsx(Avatar, { size: avatarSize, className, children: /* @__PURE__ */ jsx(AvatarFallback, { className: "font-semibold", children: getInitials(name) }) });
|
|
149
|
-
}
|
|
150
118
|
function ConversationListItem({
|
|
151
119
|
data,
|
|
152
120
|
isActive,
|
|
@@ -167,25 +135,25 @@ function ConversationListItem({
|
|
|
167
135
|
isActive ? "bg-muted" : "hover:bg-muted/40"
|
|
168
136
|
),
|
|
169
137
|
children: [
|
|
170
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ jsx2(ContactAvatar, { name: data.contact.name }),
|
|
171
139
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
172
140
|
/* @__PURE__ */ jsxs("div", { className: "mb-1 flex items-center justify-between gap-2", children: [
|
|
173
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ jsx2("span", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(data.contact.name) }),
|
|
174
142
|
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
175
|
-
data.status === "needs-attention" && /* @__PURE__ */
|
|
176
|
-
data.channel === "email" ? /* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */
|
|
143
|
+
data.status === "needs-attention" && /* @__PURE__ */ jsx2(Flag, { className: "size-3 text-warning-text" }),
|
|
144
|
+
data.channel === "email" ? /* @__PURE__ */ jsx2(Mail, { className: "size-3 text-muted-foreground" }) : /* @__PURE__ */ jsx2(MessageSquare, { className: "size-3 text-muted-foreground" }),
|
|
145
|
+
/* @__PURE__ */ jsx2("span", { className: "whitespace-nowrap text-xs text-muted-foreground", children: data.timestamp })
|
|
178
146
|
] })
|
|
179
147
|
] }),
|
|
180
148
|
/* @__PURE__ */ jsxs("div", { className: "mb-1.5 flex items-center justify-between gap-2", children: [
|
|
181
149
|
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
182
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ jsx2(ConversationStatusChip, { status: data.status, showDot: true }),
|
|
183
151
|
data.assignedTo && /* @__PURE__ */ jsxs("span", { className: "truncate text-xs text-muted-foreground", children: [
|
|
184
152
|
"\u2192 ",
|
|
185
153
|
data.assignedTo
|
|
186
154
|
] })
|
|
187
155
|
] }),
|
|
188
|
-
data.unreadCount ? /* @__PURE__ */
|
|
156
|
+
data.unreadCount ? /* @__PURE__ */ jsx2(
|
|
189
157
|
Badge,
|
|
190
158
|
{
|
|
191
159
|
variant: "default",
|
|
@@ -195,7 +163,7 @@ function ConversationListItem({
|
|
|
195
163
|
) : null
|
|
196
164
|
] }),
|
|
197
165
|
/* @__PURE__ */ jsxs("p", { className: "line-clamp-2 text-sm leading-relaxed text-muted-foreground", children: [
|
|
198
|
-
data.lastMessageRole === "bot" ? /* @__PURE__ */
|
|
166
|
+
data.lastMessageRole === "bot" ? /* @__PURE__ */ jsx2("span", { className: "font-medium text-foreground/60", children: "AI: " }) : data.lastMessageRole === "advisor" ? /* @__PURE__ */ jsx2("span", { className: "font-medium text-foreground/60", children: "You: " }) : data.lastMessageRole === "visitor" ? /* @__PURE__ */ jsxs("span", { className: "font-medium text-foreground/60", children: [
|
|
199
167
|
displayContactName(data.contact.name).split(" ")[0],
|
|
200
168
|
":",
|
|
201
169
|
" "
|
|
@@ -210,44 +178,35 @@ function ConversationListItem({
|
|
|
210
178
|
function filterConversations(conversations, query, filter, channelFilter) {
|
|
211
179
|
const q = query.toLowerCase();
|
|
212
180
|
return conversations.filter((c) => {
|
|
213
|
-
var _a;
|
|
214
|
-
const matchesFilter = filter === "all" || (filter === "
|
|
215
|
-
const matchesChannel = channelFilter === "all" || ((
|
|
181
|
+
var _a, _b;
|
|
182
|
+
const matchesFilter = filter === "all" || (filter === "emails" ? ((_a = c.channel) != null ? _a : "chat") === "email" : c.status === filter);
|
|
183
|
+
const matchesChannel = channelFilter === "all" || ((_b = c.channel) != null ? _b : "chat") === channelFilter;
|
|
216
184
|
const matchesSearch = !q || c.contact.name.toLowerCase().includes(q) || c.lastMessage.toLowerCase().includes(q);
|
|
217
185
|
return matchesFilter && matchesChannel && matchesSearch;
|
|
218
186
|
});
|
|
219
187
|
}
|
|
220
188
|
var FILTER_TABS = [
|
|
221
189
|
{ id: "all", label: "All" },
|
|
222
|
-
{ id: "
|
|
223
|
-
{ id: "ai-active", label: "AI Active" },
|
|
190
|
+
{ id: "emails", label: "Emails" },
|
|
224
191
|
{ id: "needs-attention", label: "Urgent" },
|
|
225
|
-
{ id: "closed", label: "Archived" }
|
|
192
|
+
{ id: "closed", label: "Archived" },
|
|
193
|
+
{ id: "ai-active", label: "AI Active" }
|
|
226
194
|
];
|
|
227
195
|
function ConversationList({
|
|
228
196
|
conversations,
|
|
229
197
|
activeId,
|
|
230
198
|
searchQuery = "",
|
|
231
199
|
activeFilter = "all",
|
|
232
|
-
channelFilter
|
|
200
|
+
channelFilter = "all",
|
|
233
201
|
hasMore,
|
|
234
202
|
isLoadingMore,
|
|
235
203
|
onSearchChange,
|
|
236
204
|
onFilterChange,
|
|
237
|
-
onChannelFilterChange,
|
|
238
205
|
onSelect,
|
|
239
206
|
onRead,
|
|
240
207
|
onLoadMore,
|
|
241
208
|
className
|
|
242
209
|
}) {
|
|
243
|
-
const [channelFilter, setChannelFilter] = useState(channelFilterProp);
|
|
244
|
-
function handleChannelFilterChange(vals) {
|
|
245
|
-
const v = vals[0];
|
|
246
|
-
if (v) {
|
|
247
|
-
setChannelFilter(v);
|
|
248
|
-
onChannelFilterChange == null ? void 0 : onChannelFilterChange(v);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
210
|
return /* @__PURE__ */ jsxs(
|
|
252
211
|
"div",
|
|
253
212
|
{
|
|
@@ -257,49 +216,30 @@ function ConversationList({
|
|
|
257
216
|
),
|
|
258
217
|
children: [
|
|
259
218
|
/* @__PURE__ */ jsxs("div", { className: cn(PANEL_HEADER_HEIGHT, "flex shrink-0 flex-col"), children: [
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
Input,
|
|
265
|
-
{
|
|
266
|
-
value: searchQuery,
|
|
267
|
-
onChange: (e) => onSearchChange == null ? void 0 : onSearchChange(e.target.value),
|
|
268
|
-
placeholder: "Search conversations...",
|
|
269
|
-
className: "h-8 pl-8 text-sm"
|
|
270
|
-
}
|
|
271
|
-
)
|
|
272
|
-
] }),
|
|
273
|
-
/* @__PURE__ */ jsxs(
|
|
274
|
-
ToggleGroup,
|
|
219
|
+
/* @__PURE__ */ jsx2("div", { className: "flex shrink-0 items-center border-b border-border px-3 py-2.5", children: /* @__PURE__ */ jsxs("div", { className: "relative flex-1", children: [
|
|
220
|
+
/* @__PURE__ */ jsx2(Search, { className: "absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
221
|
+
/* @__PURE__ */ jsx2(
|
|
222
|
+
Input,
|
|
275
223
|
{
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
value: [channelFilter],
|
|
281
|
-
onValueChange: handleChannelFilterChange,
|
|
282
|
-
className: "shrink-0",
|
|
283
|
-
children: [
|
|
284
|
-
/* @__PURE__ */ jsx(ToggleGroupItem, { value: "all", "aria-label": "All channels", children: "All" }),
|
|
285
|
-
/* @__PURE__ */ jsx(ToggleGroupItem, { value: "chat", "aria-label": "Chat", children: /* @__PURE__ */ jsx(MessageSquare, { className: "size-3.5" }) }),
|
|
286
|
-
/* @__PURE__ */ jsx(ToggleGroupItem, { value: "email", "aria-label": "Email", children: /* @__PURE__ */ jsx(Mail, { className: "size-3.5" }) })
|
|
287
|
-
]
|
|
224
|
+
value: searchQuery,
|
|
225
|
+
onChange: (e) => onSearchChange == null ? void 0 : onSearchChange(e.target.value),
|
|
226
|
+
placeholder: "Search conversations...",
|
|
227
|
+
className: "h-8 pl-8 text-sm"
|
|
288
228
|
}
|
|
289
229
|
)
|
|
290
|
-
] }),
|
|
291
|
-
/* @__PURE__ */
|
|
230
|
+
] }) }),
|
|
231
|
+
/* @__PURE__ */ jsx2("div", { className: "flex flex-1 items-center border-b border-border", children: /* @__PURE__ */ jsx2(
|
|
292
232
|
Tabs,
|
|
293
233
|
{
|
|
294
234
|
value: activeFilter,
|
|
295
235
|
onValueChange: (v) => v && (onFilterChange == null ? void 0 : onFilterChange(v)),
|
|
296
236
|
className: "w-full",
|
|
297
|
-
children: /* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ jsx2(
|
|
298
238
|
TabsList,
|
|
299
239
|
{
|
|
300
240
|
variant: "line",
|
|
301
241
|
className: "w-full justify-start gap-0 h-auto",
|
|
302
|
-
children: FILTER_TABS.map((tab) => /* @__PURE__ */
|
|
242
|
+
children: FILTER_TABS.map((tab) => /* @__PURE__ */ jsx2(
|
|
303
243
|
TabsTrigger,
|
|
304
244
|
{
|
|
305
245
|
value: tab.id,
|
|
@@ -313,7 +253,7 @@ function ConversationList({
|
|
|
313
253
|
}
|
|
314
254
|
) })
|
|
315
255
|
] }),
|
|
316
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ jsx2("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: (() => {
|
|
317
257
|
const filtered = filterConversations(
|
|
318
258
|
conversations,
|
|
319
259
|
searchQuery,
|
|
@@ -321,9 +261,9 @@ function ConversationList({
|
|
|
321
261
|
channelFilter
|
|
322
262
|
);
|
|
323
263
|
return filtered.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center gap-2 p-8 text-muted-foreground", children: [
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
searchQuery && /* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ jsx2(MessageSquare, { className: "size-8 opacity-30" }),
|
|
265
|
+
/* @__PURE__ */ jsx2("p", { className: "text-sm", children: "No conversations" }),
|
|
266
|
+
searchQuery && /* @__PURE__ */ jsx2(
|
|
327
267
|
Button,
|
|
328
268
|
{
|
|
329
269
|
variant: "outline",
|
|
@@ -332,7 +272,7 @@ function ConversationList({
|
|
|
332
272
|
children: "Clear search"
|
|
333
273
|
}
|
|
334
274
|
),
|
|
335
|
-
!searchQuery && activeFilter !== "all" && /* @__PURE__ */
|
|
275
|
+
!searchQuery && activeFilter !== "all" && /* @__PURE__ */ jsx2(
|
|
336
276
|
Button,
|
|
337
277
|
{
|
|
338
278
|
variant: "outline",
|
|
@@ -342,7 +282,7 @@ function ConversationList({
|
|
|
342
282
|
}
|
|
343
283
|
)
|
|
344
284
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
345
|
-
filtered.map((item) => /* @__PURE__ */
|
|
285
|
+
filtered.map((item) => /* @__PURE__ */ jsx2(
|
|
346
286
|
ConversationListItem,
|
|
347
287
|
{
|
|
348
288
|
data: item,
|
|
@@ -352,7 +292,7 @@ function ConversationList({
|
|
|
352
292
|
},
|
|
353
293
|
item.id
|
|
354
294
|
)),
|
|
355
|
-
hasMore && /* @__PURE__ */
|
|
295
|
+
hasMore && /* @__PURE__ */ jsx2("div", { className: "border-t border-border p-3", children: /* @__PURE__ */ jsx2(
|
|
356
296
|
Button,
|
|
357
297
|
{
|
|
358
298
|
variant: "outline",
|
|
@@ -369,32 +309,63 @@ function ConversationList({
|
|
|
369
309
|
}
|
|
370
310
|
);
|
|
371
311
|
}
|
|
312
|
+
|
|
313
|
+
// src/components/ui/ai-conversations/thread.tsx
|
|
314
|
+
import React from "react";
|
|
315
|
+
import { useEditor, EditorContent } from "@tiptap/react";
|
|
316
|
+
import StarterKit from "@tiptap/starter-kit";
|
|
317
|
+
import TiptapUnderline from "@tiptap/extension-underline";
|
|
318
|
+
import TiptapLink from "@tiptap/extension-link";
|
|
319
|
+
import ReactMarkdown from "react-markdown";
|
|
320
|
+
import rehypeRaw from "rehype-raw";
|
|
321
|
+
import rehypeSanitize, { defaultSchema } from "rehype-sanitize";
|
|
322
|
+
import {
|
|
323
|
+
Archive,
|
|
324
|
+
ArrowLeft,
|
|
325
|
+
Bold,
|
|
326
|
+
Bot,
|
|
327
|
+
ChevronDown,
|
|
328
|
+
ChevronRight,
|
|
329
|
+
Flag as Flag2,
|
|
330
|
+
Italic,
|
|
331
|
+
Link2,
|
|
332
|
+
Lock,
|
|
333
|
+
Mail as Mail2,
|
|
334
|
+
MessageSquare as MessageSquare2,
|
|
335
|
+
MoreHorizontal,
|
|
336
|
+
Paperclip,
|
|
337
|
+
Send,
|
|
338
|
+
Underline,
|
|
339
|
+
UserCheck
|
|
340
|
+
} from "lucide-react";
|
|
341
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
372
342
|
function BubbleAvatar({
|
|
373
343
|
role,
|
|
374
344
|
senderName
|
|
375
345
|
}) {
|
|
376
346
|
if (role === "bot") {
|
|
377
|
-
return /* @__PURE__ */
|
|
347
|
+
return /* @__PURE__ */ jsx3(Avatar, { size: "sm", children: /* @__PURE__ */ jsx3(AvatarFallback, { className: "border border-border bg-muted", children: /* @__PURE__ */ jsx3(Bot, { className: "size-3.5 text-muted-foreground" }) }) });
|
|
378
348
|
}
|
|
379
349
|
if (role === "advisor") {
|
|
380
|
-
return /* @__PURE__ */
|
|
350
|
+
return /* @__PURE__ */ jsx3(Avatar, { size: "sm", children: /* @__PURE__ */ jsx3(AvatarFallback, { className: "font-semibold", children: getInitials(senderName != null ? senderName : "Advisor") }) });
|
|
381
351
|
}
|
|
382
|
-
return /* @__PURE__ */
|
|
352
|
+
return /* @__PURE__ */ jsx3(Avatar, { size: "sm", children: /* @__PURE__ */ jsx3(AvatarFallback, { children: getInitials(senderName != null ? senderName : "?") }) });
|
|
383
353
|
}
|
|
384
|
-
function ChatBubble({ message, className }) {
|
|
385
|
-
const { role, content, timestamp, senderName } = message;
|
|
354
|
+
function ChatBubble({ message, channel, className }) {
|
|
355
|
+
const { role, content, timestamp, senderName, subject } = message;
|
|
356
|
+
const isEmail = channel === "email";
|
|
386
357
|
if (role === "system") {
|
|
387
|
-
return /* @__PURE__ */
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
-
/* @__PURE__ */
|
|
358
|
+
return /* @__PURE__ */ jsxs2("div", { className: cn("my-2 flex items-center gap-3 px-2", className), children: [
|
|
359
|
+
/* @__PURE__ */ jsx3(Separator, { className: "flex-1" }),
|
|
360
|
+
/* @__PURE__ */ jsx3("span", { className: "shrink-0 text-caption text-muted-foreground", children: content }),
|
|
361
|
+
/* @__PURE__ */ jsx3(Separator, { className: "flex-1" })
|
|
391
362
|
] });
|
|
392
363
|
}
|
|
393
364
|
const isAdvisor = role === "advisor";
|
|
394
365
|
const isBot = role === "bot";
|
|
395
366
|
const isVisitor = role === "visitor";
|
|
396
367
|
const displayName = isBot ? "AI Assistant" : isAdvisor ? senderName != null ? senderName : "Advisor" : senderName != null ? senderName : "Lead";
|
|
397
|
-
return /* @__PURE__ */
|
|
368
|
+
return /* @__PURE__ */ jsxs2(
|
|
398
369
|
"div",
|
|
399
370
|
{
|
|
400
371
|
className: cn(
|
|
@@ -403,29 +374,59 @@ function ChatBubble({ message, className }) {
|
|
|
403
374
|
className
|
|
404
375
|
),
|
|
405
376
|
children: [
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ jsx3(BubbleAvatar, { role, senderName }),
|
|
378
|
+
/* @__PURE__ */ jsxs2(
|
|
408
379
|
"div",
|
|
409
380
|
{
|
|
410
381
|
className: cn(
|
|
411
|
-
"flex
|
|
382
|
+
"flex flex-col gap-1",
|
|
383
|
+
isEmail ? "max-w-[85%] w-full" : "max-w-[70%]",
|
|
412
384
|
isAdvisor && "items-end"
|
|
413
385
|
),
|
|
414
386
|
children: [
|
|
415
|
-
/* @__PURE__ */
|
|
416
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ jsx3("span", { className: "text-caption text-muted-foreground", children: displayName }),
|
|
388
|
+
/* @__PURE__ */ jsxs2(
|
|
417
389
|
"div",
|
|
418
390
|
{
|
|
419
391
|
className: cn(
|
|
420
|
-
"
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
392
|
+
"text-sm leading-relaxed break-words",
|
|
393
|
+
!isEmail && "px-3 py-2 [&_p]:m-0 [&_a]:underline",
|
|
394
|
+
isEmail && [
|
|
395
|
+
"border border-border bg-background px-4 py-3 w-full",
|
|
396
|
+
"[&_p]:mb-2 [&_p:last-child]:mb-0",
|
|
397
|
+
"[&_ul]:mb-2 [&_ul]:list-disc [&_ul]:pl-4",
|
|
398
|
+
"[&_ol]:mb-2 [&_ol]:list-decimal [&_ol]:pl-4",
|
|
399
|
+
"[&_li]:mb-0.5",
|
|
400
|
+
"[&_h1]:mb-2 [&_h1]:text-sm [&_h1]:font-bold",
|
|
401
|
+
"[&_h2]:mb-1.5 [&_h2]:text-sm [&_h2]:font-semibold",
|
|
402
|
+
"[&_h3]:mb-1 [&_h3]:text-sm [&_h3]:font-medium",
|
|
403
|
+
"[&_strong]:font-semibold [&_em]:italic",
|
|
404
|
+
"[&_a]:underline [&_a]:text-primary",
|
|
405
|
+
"[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground [&_blockquote]:italic",
|
|
406
|
+
"[&_hr]:my-3 [&_hr]:border-border"
|
|
407
|
+
],
|
|
408
|
+
!isEmail && isBot && "border border-border bg-muted/60 text-foreground [&_a]:text-primary",
|
|
409
|
+
!isEmail && isVisitor && "border border-border bg-background text-foreground [&_a]:text-primary",
|
|
410
|
+
!isEmail && isAdvisor && "bg-primary text-primary-foreground [&_a]:text-primary-foreground",
|
|
411
|
+
isEmail && isAdvisor && "bg-muted/30"
|
|
424
412
|
),
|
|
425
|
-
children:
|
|
413
|
+
children: [
|
|
414
|
+
isEmail && subject && /* @__PURE__ */ jsxs2("div", { className: "mb-2.5 border-b border-border pb-2", children: [
|
|
415
|
+
/* @__PURE__ */ jsx3("span", { className: "text-xs font-medium text-muted-foreground", children: "Subject:" }),
|
|
416
|
+
" ",
|
|
417
|
+
/* @__PURE__ */ jsx3("span", { className: "text-sm font-semibold text-foreground", children: subject })
|
|
418
|
+
] }),
|
|
419
|
+
/* @__PURE__ */ jsx3(
|
|
420
|
+
ReactMarkdown,
|
|
421
|
+
{
|
|
422
|
+
rehypePlugins: [rehypeRaw, [rehypeSanitize, defaultSchema]],
|
|
423
|
+
children: content
|
|
424
|
+
}
|
|
425
|
+
)
|
|
426
|
+
]
|
|
426
427
|
}
|
|
427
428
|
),
|
|
428
|
-
timestamp && /* @__PURE__ */
|
|
429
|
+
timestamp && /* @__PURE__ */ jsx3("span", { className: "text-caption text-muted-foreground", children: timestamp })
|
|
429
430
|
]
|
|
430
431
|
}
|
|
431
432
|
)
|
|
@@ -439,7 +440,7 @@ function ComposerToolbarButton({
|
|
|
439
440
|
pressed,
|
|
440
441
|
onToggle
|
|
441
442
|
}) {
|
|
442
|
-
return /* @__PURE__ */
|
|
443
|
+
return /* @__PURE__ */ jsx3(
|
|
443
444
|
"button",
|
|
444
445
|
{
|
|
445
446
|
type: "button",
|
|
@@ -450,11 +451,13 @@ function ComposerToolbarButton({
|
|
|
450
451
|
"flex size-7 items-center justify-center transition-colors",
|
|
451
452
|
pressed ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
452
453
|
),
|
|
453
|
-
children: /* @__PURE__ */
|
|
454
|
+
children: /* @__PURE__ */ jsx3(Icon, { className: "size-3.5" })
|
|
454
455
|
}
|
|
455
456
|
);
|
|
456
457
|
}
|
|
457
|
-
function ComposerLinkPopover({
|
|
458
|
+
function ComposerLinkPopover({
|
|
459
|
+
editor
|
|
460
|
+
}) {
|
|
458
461
|
const [open, setOpen] = React.useState(false);
|
|
459
462
|
const [url, setUrl] = React.useState("");
|
|
460
463
|
const handleApply = () => {
|
|
@@ -464,7 +467,7 @@ function ComposerLinkPopover({ editor }) {
|
|
|
464
467
|
setOpen(false);
|
|
465
468
|
setUrl("");
|
|
466
469
|
};
|
|
467
|
-
return /* @__PURE__ */
|
|
470
|
+
return /* @__PURE__ */ jsxs2(
|
|
468
471
|
Popover,
|
|
469
472
|
{
|
|
470
473
|
open,
|
|
@@ -477,7 +480,7 @@ function ComposerLinkPopover({ editor }) {
|
|
|
477
480
|
setOpen(newOpen);
|
|
478
481
|
},
|
|
479
482
|
children: [
|
|
480
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ jsx3(
|
|
481
484
|
PopoverTrigger,
|
|
482
485
|
{
|
|
483
486
|
"aria-label": "Insert link",
|
|
@@ -485,11 +488,11 @@ function ComposerLinkPopover({ editor }) {
|
|
|
485
488
|
"flex size-7 items-center justify-center transition-colors",
|
|
486
489
|
(editor == null ? void 0 : editor.isActive("link")) ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
487
490
|
),
|
|
488
|
-
children: /* @__PURE__ */
|
|
491
|
+
children: /* @__PURE__ */ jsx3(Link2, { className: "size-3.5" })
|
|
489
492
|
}
|
|
490
493
|
),
|
|
491
|
-
/* @__PURE__ */
|
|
492
|
-
/* @__PURE__ */
|
|
494
|
+
/* @__PURE__ */ jsx3(PopoverContent, { className: "w-72 p-2", align: "start", children: /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1.5", children: [
|
|
495
|
+
/* @__PURE__ */ jsx3(
|
|
493
496
|
"input",
|
|
494
497
|
{
|
|
495
498
|
type: "url",
|
|
@@ -501,7 +504,7 @@ function ComposerLinkPopover({ editor }) {
|
|
|
501
504
|
autoFocus: true
|
|
502
505
|
}
|
|
503
506
|
),
|
|
504
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ jsx3(Button, { size: "sm", className: "h-8 px-3", onClick: handleApply, children: "Apply" })
|
|
505
508
|
] }) })
|
|
506
509
|
]
|
|
507
510
|
}
|
|
@@ -511,8 +514,8 @@ function ComposerEmailFieldRow({
|
|
|
511
514
|
label,
|
|
512
515
|
children
|
|
513
516
|
}) {
|
|
514
|
-
return /* @__PURE__ */
|
|
515
|
-
/* @__PURE__ */
|
|
517
|
+
return /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-3 border-b border-border px-4 py-2.5", children: [
|
|
518
|
+
/* @__PURE__ */ jsx3("span", { className: "w-14 shrink-0 text-sm text-muted-foreground", children: label }),
|
|
516
519
|
children
|
|
517
520
|
] });
|
|
518
521
|
}
|
|
@@ -528,6 +531,7 @@ function ChatComposer({
|
|
|
528
531
|
onSendEmail,
|
|
529
532
|
onTakeOver,
|
|
530
533
|
onLetAiHandle,
|
|
534
|
+
emailReplySubject,
|
|
531
535
|
className
|
|
532
536
|
}) {
|
|
533
537
|
const [channel, setChannel] = React.useState(
|
|
@@ -536,7 +540,12 @@ function ChatComposer({
|
|
|
536
540
|
const [emailTo, setEmailTo] = React.useState(contactEmail);
|
|
537
541
|
const [emailCc, setEmailCc] = React.useState("");
|
|
538
542
|
const [showCc, setShowCc] = React.useState(false);
|
|
539
|
-
const [emailSubject, setEmailSubject] = React.useState(
|
|
543
|
+
const [emailSubject, setEmailSubject] = React.useState(
|
|
544
|
+
emailReplySubject ? `Re: ${emailReplySubject}` : ""
|
|
545
|
+
);
|
|
546
|
+
const [emailMode, setEmailMode] = React.useState(
|
|
547
|
+
emailReplySubject ? "reply" : "new"
|
|
548
|
+
);
|
|
540
549
|
const [, forceUpdate] = React.useReducer((x) => x + 1, 0);
|
|
541
550
|
const editor = useEditor({
|
|
542
551
|
extensions: [
|
|
@@ -556,7 +565,21 @@ function ChatComposer({
|
|
|
556
565
|
setChannel(c);
|
|
557
566
|
onChannelChange == null ? void 0 : onChannelChange(c);
|
|
558
567
|
};
|
|
559
|
-
|
|
568
|
+
const handleNewEmail = () => {
|
|
569
|
+
setEmailSubject("");
|
|
570
|
+
setEmailCc("");
|
|
571
|
+
setShowCc(false);
|
|
572
|
+
editor == null ? void 0 : editor.commands.clearContent();
|
|
573
|
+
};
|
|
574
|
+
const handleEmailModeChange = (mode2) => {
|
|
575
|
+
setEmailMode(mode2);
|
|
576
|
+
if (mode2 === "new") {
|
|
577
|
+
handleNewEmail();
|
|
578
|
+
} else {
|
|
579
|
+
setEmailSubject(emailReplySubject ? `Re: ${emailReplySubject}` : "");
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
return /* @__PURE__ */ jsxs2(
|
|
560
583
|
"div",
|
|
561
584
|
{
|
|
562
585
|
className: cn(
|
|
@@ -564,27 +587,27 @@ function ChatComposer({
|
|
|
564
587
|
className
|
|
565
588
|
),
|
|
566
589
|
children: [
|
|
567
|
-
isEmailIntegrated && /* @__PURE__ */
|
|
590
|
+
isEmailIntegrated && /* @__PURE__ */ jsx3("div", { className: "border-b border-border px-3 py-2", children: /* @__PURE__ */ jsx3(
|
|
568
591
|
Tabs,
|
|
569
592
|
{
|
|
570
593
|
value: channel,
|
|
571
594
|
onValueChange: (v) => v && handleChannelChange(v),
|
|
572
|
-
children: /* @__PURE__ */
|
|
573
|
-
/* @__PURE__ */
|
|
574
|
-
/* @__PURE__ */
|
|
595
|
+
children: /* @__PURE__ */ jsxs2(TabsList, { variant: "default", className: "w-full", children: [
|
|
596
|
+
/* @__PURE__ */ jsxs2(TabsTrigger, { value: "chat", className: "flex-1 gap-1.5", children: [
|
|
597
|
+
/* @__PURE__ */ jsx3(MessageSquare2, { className: "size-3.5" }),
|
|
575
598
|
"Chat"
|
|
576
599
|
] }),
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */
|
|
600
|
+
/* @__PURE__ */ jsxs2(TabsTrigger, { value: "email", className: "flex-1 gap-1.5", children: [
|
|
601
|
+
/* @__PURE__ */ jsx3(Mail2, { className: "size-3.5" }),
|
|
579
602
|
"Email"
|
|
580
603
|
] })
|
|
581
604
|
] })
|
|
582
605
|
}
|
|
583
606
|
) }),
|
|
584
|
-
mode === "ai" ? /* @__PURE__ */
|
|
585
|
-
/* @__PURE__ */
|
|
586
|
-
/* @__PURE__ */
|
|
587
|
-
/* @__PURE__ */
|
|
607
|
+
mode === "ai" ? /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 bg-muted/30 px-4 py-2.5 text-[12px] text-muted-foreground", children: [
|
|
608
|
+
/* @__PURE__ */ jsx3(Bot, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
609
|
+
/* @__PURE__ */ jsx3("span", { children: "AI is handling this conversation." }),
|
|
610
|
+
/* @__PURE__ */ jsx3(
|
|
588
611
|
Button,
|
|
589
612
|
{
|
|
590
613
|
variant: "link",
|
|
@@ -594,12 +617,12 @@ function ChatComposer({
|
|
|
594
617
|
children: "Take Over"
|
|
595
618
|
}
|
|
596
619
|
),
|
|
597
|
-
/* @__PURE__ */
|
|
620
|
+
/* @__PURE__ */ jsx3("span", { children: "to reply directly." })
|
|
598
621
|
] }) : (
|
|
599
622
|
/* Email panel stays in normal flow to anchor container height;
|
|
600
623
|
chat panel is an absolute overlay so both tabs share identical dimensions */
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ jsxs2("div", { className: "relative", children: [
|
|
625
|
+
/* @__PURE__ */ jsxs2(
|
|
603
626
|
"div",
|
|
604
627
|
{
|
|
605
628
|
className: cn(
|
|
@@ -608,8 +631,8 @@ function ChatComposer({
|
|
|
608
631
|
),
|
|
609
632
|
"aria-hidden": channel !== "email",
|
|
610
633
|
children: [
|
|
611
|
-
/* @__PURE__ */
|
|
612
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ jsxs2(ComposerEmailFieldRow, { label: "To", children: [
|
|
635
|
+
/* @__PURE__ */ jsx3(
|
|
613
636
|
"input",
|
|
614
637
|
{
|
|
615
638
|
type: "email",
|
|
@@ -619,7 +642,7 @@ function ChatComposer({
|
|
|
619
642
|
className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
|
|
620
643
|
}
|
|
621
644
|
),
|
|
622
|
-
/* @__PURE__ */
|
|
645
|
+
/* @__PURE__ */ jsxs2(
|
|
623
646
|
"button",
|
|
624
647
|
{
|
|
625
648
|
type: "button",
|
|
@@ -627,12 +650,12 @@ function ChatComposer({
|
|
|
627
650
|
className: "flex shrink-0 items-center gap-0.5 text-sm text-muted-foreground hover:text-foreground",
|
|
628
651
|
children: [
|
|
629
652
|
"CC",
|
|
630
|
-
/* @__PURE__ */
|
|
653
|
+
/* @__PURE__ */ jsx3(ChevronDown, { className: "size-3.5" })
|
|
631
654
|
]
|
|
632
655
|
}
|
|
633
656
|
)
|
|
634
657
|
] }),
|
|
635
|
-
showCc && /* @__PURE__ */
|
|
658
|
+
showCc && /* @__PURE__ */ jsx3(ComposerEmailFieldRow, { label: "CC", children: /* @__PURE__ */ jsx3(
|
|
636
659
|
"input",
|
|
637
660
|
{
|
|
638
661
|
type: "email",
|
|
@@ -642,7 +665,7 @@ function ChatComposer({
|
|
|
642
665
|
className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
|
|
643
666
|
}
|
|
644
667
|
) }),
|
|
645
|
-
/* @__PURE__ */
|
|
668
|
+
/* @__PURE__ */ jsx3(ComposerEmailFieldRow, { label: "Subject", children: /* @__PURE__ */ jsx3(
|
|
646
669
|
"input",
|
|
647
670
|
{
|
|
648
671
|
type: "text",
|
|
@@ -652,10 +675,32 @@ function ChatComposer({
|
|
|
652
675
|
className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
|
|
653
676
|
}
|
|
654
677
|
) }),
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
-
/* @__PURE__ */
|
|
657
|
-
/* @__PURE__ */
|
|
658
|
-
/* @__PURE__ */
|
|
678
|
+
/* @__PURE__ */ jsx3(EditorContent, { editor }),
|
|
679
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
|
|
680
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-0.5", children: [
|
|
681
|
+
emailReplySubject && /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
682
|
+
/* @__PURE__ */ jsxs2(
|
|
683
|
+
ToggleGroup,
|
|
684
|
+
{
|
|
685
|
+
type: "single",
|
|
686
|
+
variant: "outline",
|
|
687
|
+
size: "sm",
|
|
688
|
+
spacing: 0,
|
|
689
|
+
value: [emailMode],
|
|
690
|
+
onValueChange: (values) => {
|
|
691
|
+
const v = values[0];
|
|
692
|
+
if (v) handleEmailModeChange(v);
|
|
693
|
+
},
|
|
694
|
+
className: "mr-1.5",
|
|
695
|
+
children: [
|
|
696
|
+
/* @__PURE__ */ jsx3(ToggleGroupItem, { value: "reply", children: "Reply" }),
|
|
697
|
+
/* @__PURE__ */ jsx3(ToggleGroupItem, { value: "new", children: "New email" })
|
|
698
|
+
]
|
|
699
|
+
}
|
|
700
|
+
),
|
|
701
|
+
/* @__PURE__ */ jsx3(Separator, { orientation: "vertical", className: "mr-1.5 h-4" })
|
|
702
|
+
] }),
|
|
703
|
+
/* @__PURE__ */ jsx3(
|
|
659
704
|
ComposerToolbarButton,
|
|
660
705
|
{
|
|
661
706
|
label: "Bold",
|
|
@@ -664,7 +709,7 @@ function ChatComposer({
|
|
|
664
709
|
onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run()
|
|
665
710
|
}
|
|
666
711
|
),
|
|
667
|
-
/* @__PURE__ */
|
|
712
|
+
/* @__PURE__ */ jsx3(
|
|
668
713
|
ComposerToolbarButton,
|
|
669
714
|
{
|
|
670
715
|
label: "Italic",
|
|
@@ -673,7 +718,7 @@ function ChatComposer({
|
|
|
673
718
|
onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run()
|
|
674
719
|
}
|
|
675
720
|
),
|
|
676
|
-
/* @__PURE__ */
|
|
721
|
+
/* @__PURE__ */ jsx3(
|
|
677
722
|
ComposerToolbarButton,
|
|
678
723
|
{
|
|
679
724
|
label: "Underline",
|
|
@@ -682,38 +727,44 @@ function ChatComposer({
|
|
|
682
727
|
onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleUnderline().run()
|
|
683
728
|
}
|
|
684
729
|
),
|
|
685
|
-
/* @__PURE__ */
|
|
686
|
-
/* @__PURE__ */
|
|
687
|
-
/* @__PURE__ */
|
|
730
|
+
/* @__PURE__ */ jsx3(Separator, { orientation: "vertical", className: "mx-1.5 h-4" }),
|
|
731
|
+
/* @__PURE__ */ jsx3(ComposerLinkPopover, { editor }),
|
|
732
|
+
/* @__PURE__ */ jsx3(ComposerToolbarButton, { label: "Attach file", icon: Paperclip })
|
|
688
733
|
] }),
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
-
Button,
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
734
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
|
|
735
|
+
onLetAiHandle && /* @__PURE__ */ jsxs2(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
|
|
736
|
+
/* @__PURE__ */ jsx3(Bot, { className: "mr-1.5 size-3.5" }),
|
|
737
|
+
"Let AI Handle"
|
|
738
|
+
] }),
|
|
739
|
+
/* @__PURE__ */ jsxs2(
|
|
740
|
+
Button,
|
|
741
|
+
{
|
|
742
|
+
size: "sm",
|
|
743
|
+
onClick: () => {
|
|
744
|
+
var _a;
|
|
745
|
+
const html = (_a = editor == null ? void 0 : editor.getHTML()) != null ? _a : "";
|
|
746
|
+
onSendEmail == null ? void 0 : onSendEmail({
|
|
747
|
+
content: html,
|
|
748
|
+
to: emailTo,
|
|
749
|
+
cc: emailCc,
|
|
750
|
+
subject: emailSubject
|
|
751
|
+
});
|
|
752
|
+
editor == null ? void 0 : editor.commands.clearContent();
|
|
753
|
+
},
|
|
754
|
+
disabled: !editor || editor.isEmpty || !emailTo.trim(),
|
|
755
|
+
children: [
|
|
756
|
+
/* @__PURE__ */ jsx3(Send, { className: "mr-1.5 size-3.5" }),
|
|
757
|
+
"Send Email"
|
|
758
|
+
]
|
|
759
|
+
}
|
|
760
|
+
)
|
|
761
|
+
] })
|
|
711
762
|
] })
|
|
712
763
|
]
|
|
713
764
|
}
|
|
714
765
|
),
|
|
715
|
-
channel === "chat" && /* @__PURE__ */
|
|
716
|
-
/* @__PURE__ */
|
|
766
|
+
channel === "chat" && /* @__PURE__ */ jsxs2("div", { className: "absolute inset-0 flex flex-col gap-3 p-4", children: [
|
|
767
|
+
/* @__PURE__ */ jsx3(
|
|
717
768
|
Textarea,
|
|
718
769
|
{
|
|
719
770
|
value: inputValue,
|
|
@@ -722,19 +773,19 @@ function ChatComposer({
|
|
|
722
773
|
className: "min-h-0 flex-1 resize-none text-base"
|
|
723
774
|
}
|
|
724
775
|
),
|
|
725
|
-
/* @__PURE__ */
|
|
726
|
-
/* @__PURE__ */
|
|
727
|
-
/* @__PURE__ */
|
|
776
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between", children: [
|
|
777
|
+
/* @__PURE__ */ jsxs2(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
|
|
778
|
+
/* @__PURE__ */ jsx3(Bot, { className: "mr-1.5 size-3.5" }),
|
|
728
779
|
"Let AI Handle"
|
|
729
780
|
] }),
|
|
730
|
-
/* @__PURE__ */
|
|
781
|
+
/* @__PURE__ */ jsxs2(
|
|
731
782
|
Button,
|
|
732
783
|
{
|
|
733
784
|
size: "sm",
|
|
734
785
|
onClick: () => onSend == null ? void 0 : onSend(inputValue),
|
|
735
786
|
disabled: !inputValue.trim(),
|
|
736
787
|
children: [
|
|
737
|
-
/* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ jsx3(Send, { className: "mr-1.5 size-3.5" }),
|
|
738
789
|
"Send"
|
|
739
790
|
]
|
|
740
791
|
}
|
|
@@ -762,6 +813,7 @@ function ChatThread({
|
|
|
762
813
|
onSendEmail,
|
|
763
814
|
onTakeOver,
|
|
764
815
|
onLetAiHandle,
|
|
816
|
+
emailReplySubject,
|
|
765
817
|
onReopen,
|
|
766
818
|
onMarkUrgent,
|
|
767
819
|
onUnmarkUrgent,
|
|
@@ -814,8 +866,8 @@ function ChatThread({
|
|
|
814
866
|
const el = scrollRef.current;
|
|
815
867
|
if (el) el.scrollTop = el.scrollHeight;
|
|
816
868
|
}, [isAiTyping]);
|
|
817
|
-
return /* @__PURE__ */
|
|
818
|
-
/* @__PURE__ */
|
|
869
|
+
return /* @__PURE__ */ jsxs2("div", { className: cn("flex flex-col bg-background", className), children: [
|
|
870
|
+
/* @__PURE__ */ jsxs2(
|
|
819
871
|
"div",
|
|
820
872
|
{
|
|
821
873
|
className: cn(
|
|
@@ -823,7 +875,7 @@ function ChatThread({
|
|
|
823
875
|
"flex items-center gap-3 border-b border-border px-4"
|
|
824
876
|
),
|
|
825
877
|
children: [
|
|
826
|
-
onBack && /* @__PURE__ */
|
|
878
|
+
onBack && /* @__PURE__ */ jsx3(
|
|
827
879
|
Button,
|
|
828
880
|
{
|
|
829
881
|
variant: "ghost",
|
|
@@ -831,28 +883,28 @@ function ChatThread({
|
|
|
831
883
|
className: "size-8 shrink-0 md:hidden",
|
|
832
884
|
onClick: onBack,
|
|
833
885
|
"aria-label": "Back to conversations",
|
|
834
|
-
children: /* @__PURE__ */
|
|
886
|
+
children: /* @__PURE__ */ jsx3(ArrowLeft, { className: "size-4" })
|
|
835
887
|
}
|
|
836
888
|
),
|
|
837
|
-
/* @__PURE__ */
|
|
838
|
-
/* @__PURE__ */
|
|
839
|
-
/* @__PURE__ */
|
|
840
|
-
/* @__PURE__ */
|
|
841
|
-
/* @__PURE__ */
|
|
889
|
+
/* @__PURE__ */ jsx3(ContactAvatar, { name: contact.name, size: "md" }),
|
|
890
|
+
/* @__PURE__ */ jsxs2("div", { className: "min-w-0 flex-1", children: [
|
|
891
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
|
|
892
|
+
/* @__PURE__ */ jsx3("span", { className: "text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
|
|
893
|
+
/* @__PURE__ */ jsx3(ConversationStatusChip, { status, showDot: true })
|
|
842
894
|
] }),
|
|
843
|
-
contact.email && /* @__PURE__ */
|
|
895
|
+
contact.email && /* @__PURE__ */ jsx3("p", { className: "text-sm text-muted-foreground", children: contact.email })
|
|
844
896
|
] }),
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
/* @__PURE__ */
|
|
847
|
-
isClosed && /* @__PURE__ */
|
|
848
|
-
!isClosed && aiIsHandling && /* @__PURE__ */
|
|
849
|
-
!isClosed && !aiIsHandling && /* @__PURE__ */
|
|
850
|
-
/* @__PURE__ */
|
|
897
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
898
|
+
/* @__PURE__ */ jsxs2("div", { className: "hidden items-center gap-2 md:flex", children: [
|
|
899
|
+
isClosed && /* @__PURE__ */ jsx3(Button, { variant: "outline", size: "sm", onClick: onReopen, children: "Reopen" }),
|
|
900
|
+
!isClosed && aiIsHandling && /* @__PURE__ */ jsx3(Button, { size: "sm", onClick: onTakeOver, children: "Take Over" }),
|
|
901
|
+
!isClosed && !aiIsHandling && /* @__PURE__ */ jsxs2(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
|
|
902
|
+
/* @__PURE__ */ jsx3(Bot, { className: "mr-1.5 size-3.5" }),
|
|
851
903
|
"Let AI Handle"
|
|
852
904
|
] })
|
|
853
905
|
] }),
|
|
854
|
-
/* @__PURE__ */
|
|
855
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ jsxs2(DropdownMenu, { children: [
|
|
907
|
+
/* @__PURE__ */ jsx3(
|
|
856
908
|
DropdownMenuTrigger,
|
|
857
909
|
{
|
|
858
910
|
className: cn(
|
|
@@ -860,38 +912,38 @@ function ChatThread({
|
|
|
860
912
|
"size-8"
|
|
861
913
|
),
|
|
862
914
|
"aria-label": "More actions",
|
|
863
|
-
children: /* @__PURE__ */
|
|
915
|
+
children: /* @__PURE__ */ jsx3(MoreHorizontal, { className: "size-4" })
|
|
864
916
|
}
|
|
865
917
|
),
|
|
866
|
-
/* @__PURE__ */
|
|
867
|
-
onShowLeadInfo && /* @__PURE__ */
|
|
868
|
-
/* @__PURE__ */
|
|
918
|
+
/* @__PURE__ */ jsxs2(DropdownMenuContent, { children: [
|
|
919
|
+
onShowLeadInfo && /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
920
|
+
/* @__PURE__ */ jsxs2(
|
|
869
921
|
DropdownMenuItem,
|
|
870
922
|
{
|
|
871
923
|
className: "md:hidden",
|
|
872
924
|
onClick: onShowLeadInfo,
|
|
873
925
|
children: [
|
|
874
|
-
/* @__PURE__ */
|
|
926
|
+
/* @__PURE__ */ jsx3(ChevronRight, { className: "mr-2 size-4" }),
|
|
875
927
|
"Lead Info"
|
|
876
928
|
]
|
|
877
929
|
}
|
|
878
930
|
),
|
|
879
|
-
/* @__PURE__ */
|
|
931
|
+
/* @__PURE__ */ jsx3(DropdownMenuSeparator, { className: "md:hidden" })
|
|
880
932
|
] }),
|
|
881
|
-
status === "needs-attention" ? /* @__PURE__ */
|
|
882
|
-
/* @__PURE__ */
|
|
933
|
+
status === "needs-attention" ? /* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: onUnmarkUrgent, children: [
|
|
934
|
+
/* @__PURE__ */ jsx3(Flag2, { className: "mr-2 size-4" }),
|
|
883
935
|
"Unmark Urgent"
|
|
884
|
-
] }) : /* @__PURE__ */
|
|
885
|
-
/* @__PURE__ */
|
|
936
|
+
] }) : /* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: onMarkUrgent, children: [
|
|
937
|
+
/* @__PURE__ */ jsx3(Flag2, { className: "mr-2 size-4" }),
|
|
886
938
|
"Mark as Urgent"
|
|
887
939
|
] }),
|
|
888
|
-
/* @__PURE__ */
|
|
889
|
-
/* @__PURE__ */
|
|
940
|
+
/* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: onAssignToAdvisor, children: [
|
|
941
|
+
/* @__PURE__ */ jsx3(UserCheck, { className: "mr-2 size-4" }),
|
|
890
942
|
"Assign to advisor"
|
|
891
943
|
] }),
|
|
892
|
-
/* @__PURE__ */
|
|
893
|
-
/* @__PURE__ */
|
|
894
|
-
/* @__PURE__ */
|
|
944
|
+
/* @__PURE__ */ jsx3(DropdownMenuSeparator, {}),
|
|
945
|
+
/* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: onArchive, children: [
|
|
946
|
+
/* @__PURE__ */ jsx3(Archive, { className: "mr-2 size-4" }),
|
|
895
947
|
"Archive"
|
|
896
948
|
] })
|
|
897
949
|
] })
|
|
@@ -900,7 +952,7 @@ function ChatThread({
|
|
|
900
952
|
]
|
|
901
953
|
}
|
|
902
954
|
),
|
|
903
|
-
/* @__PURE__ */
|
|
955
|
+
/* @__PURE__ */ jsxs2(
|
|
904
956
|
"div",
|
|
905
957
|
{
|
|
906
958
|
ref: scrollRef,
|
|
@@ -908,29 +960,29 @@ function ChatThread({
|
|
|
908
960
|
className: "flex flex-1 flex-col gap-4 overflow-y-auto p-4",
|
|
909
961
|
tabIndex: 0,
|
|
910
962
|
children: [
|
|
911
|
-
isLoadingMoreMessages && /* @__PURE__ */
|
|
912
|
-
messages.length === 0 ? /* @__PURE__ */
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
/* @__PURE__ */
|
|
915
|
-
] }) : messages.map((msg) => /* @__PURE__ */
|
|
916
|
-
isAiTyping && !isClosed && /* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
918
|
-
/* @__PURE__ */
|
|
919
|
-
/* @__PURE__ */
|
|
920
|
-
/* @__PURE__ */
|
|
921
|
-
/* @__PURE__ */
|
|
922
|
-
/* @__PURE__ */
|
|
923
|
-
/* @__PURE__ */
|
|
963
|
+
isLoadingMoreMessages && /* @__PURE__ */ jsx3("div", { className: "flex justify-center py-1 text-caption text-muted-foreground", children: "Loading older messages..." }),
|
|
964
|
+
messages.length === 0 ? /* @__PURE__ */ jsxs2("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground", children: [
|
|
965
|
+
/* @__PURE__ */ jsx3(MessageSquare2, { className: "size-8 opacity-30" }),
|
|
966
|
+
/* @__PURE__ */ jsx3("p", { className: "text-sm", children: "No messages yet" })
|
|
967
|
+
] }) : messages.map((msg) => /* @__PURE__ */ jsx3(ChatBubble, { message: msg, channel }, msg.id)),
|
|
968
|
+
isAiTyping && !isClosed && /* @__PURE__ */ jsxs2("div", { className: "flex gap-2.5", children: [
|
|
969
|
+
/* @__PURE__ */ jsx3(BubbleAvatar, { role: "bot" }),
|
|
970
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-1", children: [
|
|
971
|
+
/* @__PURE__ */ jsx3("span", { className: "text-caption text-muted-foreground", children: "AI Assistant" }),
|
|
972
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1 border border-border bg-muted/60 px-3 py-2.5", children: [
|
|
973
|
+
/* @__PURE__ */ jsx3("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:0ms]" }),
|
|
974
|
+
/* @__PURE__ */ jsx3("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:150ms]" }),
|
|
975
|
+
/* @__PURE__ */ jsx3("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:300ms]" })
|
|
924
976
|
] })
|
|
925
977
|
] })
|
|
926
978
|
] })
|
|
927
979
|
]
|
|
928
980
|
}
|
|
929
981
|
),
|
|
930
|
-
isClosed ? /* @__PURE__ */
|
|
931
|
-
/* @__PURE__ */
|
|
932
|
-
/* @__PURE__ */
|
|
933
|
-
/* @__PURE__ */
|
|
982
|
+
isClosed ? /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-3 border-t border-border bg-muted/30 px-4 py-3 text-sm text-muted-foreground", children: [
|
|
983
|
+
/* @__PURE__ */ jsx3(Lock, { className: "size-3.5 shrink-0" }),
|
|
984
|
+
/* @__PURE__ */ jsx3("span", { children: "This conversation is closed." }),
|
|
985
|
+
/* @__PURE__ */ jsx3(
|
|
934
986
|
Button,
|
|
935
987
|
{
|
|
936
988
|
variant: "outline",
|
|
@@ -940,7 +992,7 @@ function ChatThread({
|
|
|
940
992
|
children: "Reopen"
|
|
941
993
|
}
|
|
942
994
|
)
|
|
943
|
-
] }) : /* @__PURE__ */
|
|
995
|
+
] }) : /* @__PURE__ */ jsx3(
|
|
944
996
|
ChatComposer,
|
|
945
997
|
{
|
|
946
998
|
mode,
|
|
@@ -953,30 +1005,57 @@ function ChatThread({
|
|
|
953
1005
|
onSend,
|
|
954
1006
|
onSendEmail,
|
|
955
1007
|
onTakeOver,
|
|
956
|
-
onLetAiHandle
|
|
1008
|
+
onLetAiHandle,
|
|
1009
|
+
emailReplySubject
|
|
957
1010
|
}
|
|
958
1011
|
)
|
|
959
1012
|
] });
|
|
960
1013
|
}
|
|
1014
|
+
|
|
1015
|
+
// src/components/ui/ai-conversations/lead-panel.tsx
|
|
1016
|
+
import {
|
|
1017
|
+
ArrowLeft as ArrowLeft2,
|
|
1018
|
+
Briefcase,
|
|
1019
|
+
Calendar,
|
|
1020
|
+
CheckCircle2,
|
|
1021
|
+
ChevronRight as ChevronRight2,
|
|
1022
|
+
HelpCircle,
|
|
1023
|
+
Link2 as Link22,
|
|
1024
|
+
Mail as Mail3,
|
|
1025
|
+
MapPin,
|
|
1026
|
+
Navigation,
|
|
1027
|
+
Phone,
|
|
1028
|
+
PhoneCall,
|
|
1029
|
+
Plus,
|
|
1030
|
+
UserPlus,
|
|
1031
|
+
Video
|
|
1032
|
+
} from "lucide-react";
|
|
1033
|
+
import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
961
1034
|
function AICollectedDataSection({
|
|
962
1035
|
fields,
|
|
963
1036
|
className
|
|
964
1037
|
}) {
|
|
965
|
-
return /* @__PURE__ */
|
|
1038
|
+
return /* @__PURE__ */ jsx4("div", { className: cn("flex flex-col", className), children: fields.map((field, i) => /* @__PURE__ */ jsxs3(
|
|
966
1039
|
"div",
|
|
967
1040
|
{
|
|
968
1041
|
className: "flex items-center justify-between gap-2 border-b border-border/40 py-1.5 last:border-b-0",
|
|
969
1042
|
children: [
|
|
970
|
-
/* @__PURE__ */
|
|
971
|
-
/* @__PURE__ */
|
|
972
|
-
/* @__PURE__ */
|
|
973
|
-
field.confidence === "confirmed" ? /* @__PURE__ */
|
|
1043
|
+
/* @__PURE__ */ jsx4("span", { className: "shrink-0 text-sm text-muted-foreground", children: field.label }),
|
|
1044
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-1.5", children: [
|
|
1045
|
+
/* @__PURE__ */ jsx4("span", { className: "text-right text-sm font-medium text-foreground", children: field.value }),
|
|
1046
|
+
field.confidence === "confirmed" ? /* @__PURE__ */ jsx4(CheckCircle2, { className: "size-3 shrink-0 text-success-text" }) : /* @__PURE__ */ jsx4(HelpCircle, { className: "size-3 shrink-0 text-warning-text" })
|
|
974
1047
|
] })
|
|
975
1048
|
]
|
|
976
1049
|
},
|
|
977
1050
|
i
|
|
978
1051
|
)) });
|
|
979
1052
|
}
|
|
1053
|
+
var APPOINTMENT_STATUS_LABEL = {
|
|
1054
|
+
requested: "Lead requested",
|
|
1055
|
+
confirmed: "Confirmed",
|
|
1056
|
+
pending: "Pending confirmation",
|
|
1057
|
+
cancelled: "Cancelled"
|
|
1058
|
+
};
|
|
980
1059
|
var MEETING_ICON = {
|
|
981
1060
|
video: Video,
|
|
982
1061
|
phone: Phone,
|
|
@@ -988,7 +1067,7 @@ var MEETING_LABEL = {
|
|
|
988
1067
|
"in-person": "In Person"
|
|
989
1068
|
};
|
|
990
1069
|
var MEETING_DETAIL_ICON = {
|
|
991
|
-
video:
|
|
1070
|
+
video: Link22,
|
|
992
1071
|
phone: PhoneCall,
|
|
993
1072
|
"in-person": Navigation
|
|
994
1073
|
};
|
|
@@ -998,9 +1077,9 @@ function MeetingDetailRow({
|
|
|
998
1077
|
}) {
|
|
999
1078
|
const DetailIcon = MEETING_DETAIL_ICON[meetingType];
|
|
1000
1079
|
const isLink = detail.startsWith("http");
|
|
1001
|
-
return /* @__PURE__ */
|
|
1002
|
-
/* @__PURE__ */
|
|
1003
|
-
isLink ? /* @__PURE__ */
|
|
1080
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
|
|
1081
|
+
/* @__PURE__ */ jsx4(DetailIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
1082
|
+
isLink ? /* @__PURE__ */ jsx4(
|
|
1004
1083
|
"a",
|
|
1005
1084
|
{
|
|
1006
1085
|
href: detail,
|
|
@@ -1009,7 +1088,7 @@ function MeetingDetailRow({
|
|
|
1009
1088
|
className: "text-sm text-primary underline underline-offset-2 break-all hover:text-primary/80",
|
|
1010
1089
|
children: detail
|
|
1011
1090
|
}
|
|
1012
|
-
) : /* @__PURE__ */
|
|
1091
|
+
) : /* @__PURE__ */ jsx4("span", { className: "text-sm text-muted-foreground break-all", children: detail })
|
|
1013
1092
|
] });
|
|
1014
1093
|
}
|
|
1015
1094
|
function AppointmentSection({
|
|
@@ -1022,23 +1101,23 @@ function AppointmentSection({
|
|
|
1022
1101
|
}) {
|
|
1023
1102
|
const AppointmentIcon = MEETING_ICON[appointment.meetingType];
|
|
1024
1103
|
const canReschedule = !isAnonymous && !!onRescheduleAppointment;
|
|
1025
|
-
return /* @__PURE__ */
|
|
1026
|
-
/* @__PURE__ */
|
|
1027
|
-
/* @__PURE__ */
|
|
1028
|
-
/* @__PURE__ */
|
|
1104
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-2", children: [
|
|
1105
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
|
|
1106
|
+
/* @__PURE__ */ jsx4(Calendar, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
1107
|
+
/* @__PURE__ */ jsx4("span", { className: "text-sm font-medium text-foreground", children: appointment.datetime })
|
|
1029
1108
|
] }),
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1109
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
|
|
1110
|
+
/* @__PURE__ */ jsx4(AppointmentIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
1111
|
+
/* @__PURE__ */ jsx4("span", { className: "text-sm text-muted-foreground", children: MEETING_LABEL[appointment.meetingType] })
|
|
1033
1112
|
] }),
|
|
1034
|
-
appointment.meetingDetail && /* @__PURE__ */
|
|
1113
|
+
appointment.meetingDetail && /* @__PURE__ */ jsx4(
|
|
1035
1114
|
MeetingDetailRow,
|
|
1036
1115
|
{
|
|
1037
1116
|
meetingType: appointment.meetingType,
|
|
1038
1117
|
detail: appointment.meetingDetail
|
|
1039
1118
|
}
|
|
1040
1119
|
),
|
|
1041
|
-
/* @__PURE__ */
|
|
1120
|
+
/* @__PURE__ */ jsx4(
|
|
1042
1121
|
"span",
|
|
1043
1122
|
{
|
|
1044
1123
|
className: cn("text-sm font-medium", {
|
|
@@ -1050,9 +1129,9 @@ function AppointmentSection({
|
|
|
1050
1129
|
children: APPOINTMENT_STATUS_LABEL[appointment.status]
|
|
1051
1130
|
}
|
|
1052
1131
|
),
|
|
1053
|
-
appointment.status === "requested" && /* @__PURE__ */
|
|
1054
|
-
/* @__PURE__ */
|
|
1055
|
-
/* @__PURE__ */
|
|
1132
|
+
appointment.status === "requested" && /* @__PURE__ */ jsxs3("div", { className: "flex gap-2 pt-1", children: [
|
|
1133
|
+
/* @__PURE__ */ jsx4(Button, { size: "sm", className: "flex-1", onClick: onApproveAppointment, children: "Approve" }),
|
|
1134
|
+
/* @__PURE__ */ jsx4(
|
|
1056
1135
|
Button,
|
|
1057
1136
|
{
|
|
1058
1137
|
variant: "outline",
|
|
@@ -1062,7 +1141,7 @@ function AppointmentSection({
|
|
|
1062
1141
|
children: "Decline"
|
|
1063
1142
|
}
|
|
1064
1143
|
),
|
|
1065
|
-
canReschedule && /* @__PURE__ */
|
|
1144
|
+
canReschedule && /* @__PURE__ */ jsx4(
|
|
1066
1145
|
Button,
|
|
1067
1146
|
{
|
|
1068
1147
|
variant: "ghost",
|
|
@@ -1073,7 +1152,7 @@ function AppointmentSection({
|
|
|
1073
1152
|
}
|
|
1074
1153
|
)
|
|
1075
1154
|
] }),
|
|
1076
|
-
(appointment.status === "confirmed" || appointment.status === "cancelled") && canReschedule && /* @__PURE__ */
|
|
1155
|
+
(appointment.status === "confirmed" || appointment.status === "cancelled") && canReschedule && /* @__PURE__ */ jsx4(
|
|
1077
1156
|
Button,
|
|
1078
1157
|
{
|
|
1079
1158
|
variant: "outline",
|
|
@@ -1086,13 +1165,13 @@ function AppointmentSection({
|
|
|
1086
1165
|
] });
|
|
1087
1166
|
}
|
|
1088
1167
|
function PanelSectionHeader({ children }) {
|
|
1089
|
-
return /* @__PURE__ */
|
|
1168
|
+
return /* @__PURE__ */ jsx4("p", { className: "mb-2.5 text-overline text-muted-foreground", children });
|
|
1090
1169
|
}
|
|
1091
1170
|
function PanelSection({
|
|
1092
1171
|
children,
|
|
1093
1172
|
last = false
|
|
1094
1173
|
}) {
|
|
1095
|
-
return /* @__PURE__ */
|
|
1174
|
+
return /* @__PURE__ */ jsx4("div", { className: cn("px-4 py-4", !last && "border-b border-border"), children });
|
|
1096
1175
|
}
|
|
1097
1176
|
function LeadInfoPanel({
|
|
1098
1177
|
contact,
|
|
@@ -1118,8 +1197,8 @@ function LeadInfoPanel({
|
|
|
1118
1197
|
}) {
|
|
1119
1198
|
const isAnonymous = !contact.name.trim();
|
|
1120
1199
|
const addToContactsDisabled = isAnonymous || isKnownContact;
|
|
1121
|
-
return /* @__PURE__ */
|
|
1122
|
-
/* @__PURE__ */
|
|
1200
|
+
return /* @__PURE__ */ jsxs3("div", { className: cn("flex flex-col bg-background", className), children: [
|
|
1201
|
+
/* @__PURE__ */ jsxs3(
|
|
1123
1202
|
"div",
|
|
1124
1203
|
{
|
|
1125
1204
|
className: cn(
|
|
@@ -1127,7 +1206,7 @@ function LeadInfoPanel({
|
|
|
1127
1206
|
"flex items-center justify-between border-b border-border px-4"
|
|
1128
1207
|
),
|
|
1129
1208
|
children: [
|
|
1130
|
-
onBack && /* @__PURE__ */
|
|
1209
|
+
onBack && /* @__PURE__ */ jsx4(
|
|
1131
1210
|
Button,
|
|
1132
1211
|
{
|
|
1133
1212
|
variant: "ghost",
|
|
@@ -1135,15 +1214,15 @@ function LeadInfoPanel({
|
|
|
1135
1214
|
className: "size-8 shrink-0 md:hidden",
|
|
1136
1215
|
onClick: onBack,
|
|
1137
1216
|
"aria-label": "Back to conversation",
|
|
1138
|
-
children: /* @__PURE__ */
|
|
1217
|
+
children: /* @__PURE__ */ jsx4(ArrowLeft2, { className: "size-4" })
|
|
1139
1218
|
}
|
|
1140
1219
|
),
|
|
1141
|
-
/* @__PURE__ */
|
|
1142
|
-
onToggleCollapse && /* @__PURE__ */
|
|
1143
|
-
/* @__PURE__ */
|
|
1220
|
+
/* @__PURE__ */ jsx4("span", { className: "text-sm font-semibold text-foreground", children: "Lead Info" }),
|
|
1221
|
+
onToggleCollapse && /* @__PURE__ */ jsxs3(Tooltip, { children: [
|
|
1222
|
+
/* @__PURE__ */ jsx4(
|
|
1144
1223
|
TooltipTrigger,
|
|
1145
1224
|
{
|
|
1146
|
-
render: /* @__PURE__ */
|
|
1225
|
+
render: /* @__PURE__ */ jsx4(
|
|
1147
1226
|
Button,
|
|
1148
1227
|
{
|
|
1149
1228
|
variant: "ghost",
|
|
@@ -1151,8 +1230,8 @@ function LeadInfoPanel({
|
|
|
1151
1230
|
className: "size-7",
|
|
1152
1231
|
onClick: onToggleCollapse,
|
|
1153
1232
|
"aria-label": isCollapsed ? "Expand panel" : "Collapse panel",
|
|
1154
|
-
children: /* @__PURE__ */
|
|
1155
|
-
|
|
1233
|
+
children: /* @__PURE__ */ jsx4(
|
|
1234
|
+
ChevronRight2,
|
|
1156
1235
|
{
|
|
1157
1236
|
className: cn(
|
|
1158
1237
|
"size-4 transition-transform duration-150",
|
|
@@ -1164,26 +1243,26 @@ function LeadInfoPanel({
|
|
|
1164
1243
|
)
|
|
1165
1244
|
}
|
|
1166
1245
|
),
|
|
1167
|
-
/* @__PURE__ */
|
|
1246
|
+
/* @__PURE__ */ jsx4(TooltipContent, { children: isCollapsed ? "Expand panel" : "Collapse panel" })
|
|
1168
1247
|
] })
|
|
1169
1248
|
]
|
|
1170
1249
|
}
|
|
1171
1250
|
),
|
|
1172
|
-
!isCollapsed && /* @__PURE__ */
|
|
1173
|
-
/* @__PURE__ */
|
|
1174
|
-
/* @__PURE__ */
|
|
1175
|
-
/* @__PURE__ */
|
|
1176
|
-
/* @__PURE__ */
|
|
1177
|
-
/* @__PURE__ */
|
|
1178
|
-
/* @__PURE__ */
|
|
1179
|
-
/* @__PURE__ */
|
|
1180
|
-
topic && /* @__PURE__ */
|
|
1251
|
+
!isCollapsed && /* @__PURE__ */ jsxs3("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: [
|
|
1252
|
+
/* @__PURE__ */ jsxs3(PanelSection, { children: [
|
|
1253
|
+
/* @__PURE__ */ jsx4(PanelSectionHeader, { children: "Contact" }),
|
|
1254
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3", children: [
|
|
1255
|
+
/* @__PURE__ */ jsx4(ContactAvatar, { name: contact.name, size: "lg" }),
|
|
1256
|
+
/* @__PURE__ */ jsxs3("div", { className: "min-w-0 flex-1", children: [
|
|
1257
|
+
/* @__PURE__ */ jsx4("p", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
|
|
1258
|
+
/* @__PURE__ */ jsx4("p", { className: "text-sm text-muted-foreground", children: source }),
|
|
1259
|
+
topic && /* @__PURE__ */ jsx4(Badge, { variant: "secondary", className: "mt-1 text-xs", children: topic })
|
|
1181
1260
|
] })
|
|
1182
1261
|
] }),
|
|
1183
|
-
(contact.email || contact.phone || firstSeen) && /* @__PURE__ */
|
|
1184
|
-
contact.email && /* @__PURE__ */
|
|
1185
|
-
/* @__PURE__ */
|
|
1186
|
-
/* @__PURE__ */
|
|
1262
|
+
(contact.email || contact.phone || firstSeen) && /* @__PURE__ */ jsxs3("div", { className: "mt-3 flex flex-col gap-1.5", children: [
|
|
1263
|
+
contact.email && /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
1264
|
+
/* @__PURE__ */ jsx4(Mail3, { className: "size-4 shrink-0" }),
|
|
1265
|
+
/* @__PURE__ */ jsx4(
|
|
1187
1266
|
"a",
|
|
1188
1267
|
{
|
|
1189
1268
|
href: `mailto:${contact.email}`,
|
|
@@ -1192,9 +1271,9 @@ function LeadInfoPanel({
|
|
|
1192
1271
|
}
|
|
1193
1272
|
)
|
|
1194
1273
|
] }),
|
|
1195
|
-
contact.phone && /* @__PURE__ */
|
|
1196
|
-
/* @__PURE__ */
|
|
1197
|
-
/* @__PURE__ */
|
|
1274
|
+
contact.phone && /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
1275
|
+
/* @__PURE__ */ jsx4(PhoneCall, { className: "size-4 shrink-0" }),
|
|
1276
|
+
/* @__PURE__ */ jsx4(
|
|
1198
1277
|
"a",
|
|
1199
1278
|
{
|
|
1200
1279
|
href: `tel:${contact.phone}`,
|
|
@@ -1203,31 +1282,31 @@ function LeadInfoPanel({
|
|
|
1203
1282
|
}
|
|
1204
1283
|
)
|
|
1205
1284
|
] }),
|
|
1206
|
-
firstSeen && /* @__PURE__ */
|
|
1285
|
+
firstSeen && /* @__PURE__ */ jsxs3("p", { className: "text-sm text-muted-foreground", children: [
|
|
1207
1286
|
"First seen: ",
|
|
1208
1287
|
firstSeen
|
|
1209
1288
|
] })
|
|
1210
1289
|
] })
|
|
1211
1290
|
] }),
|
|
1212
|
-
/* @__PURE__ */
|
|
1213
|
-
/* @__PURE__ */
|
|
1214
|
-
aiFields.length > 0 ? /* @__PURE__ */
|
|
1215
|
-
/* @__PURE__ */
|
|
1216
|
-
/* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */
|
|
1218
|
-
/* @__PURE__ */
|
|
1291
|
+
/* @__PURE__ */ jsxs3(PanelSection, { children: [
|
|
1292
|
+
/* @__PURE__ */ jsx4(PanelSectionHeader, { children: "AI-Collected Data" }),
|
|
1293
|
+
aiFields.length > 0 ? /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1294
|
+
/* @__PURE__ */ jsx4(AICollectedDataSection, { fields: aiFields }),
|
|
1295
|
+
/* @__PURE__ */ jsxs3("div", { className: "mt-2.5 flex items-center gap-3 text-xs text-muted-foreground", children: [
|
|
1296
|
+
/* @__PURE__ */ jsxs3("span", { className: "flex items-center gap-1", children: [
|
|
1297
|
+
/* @__PURE__ */ jsx4(CheckCircle2, { className: "size-3 text-success-text" }),
|
|
1219
1298
|
"confirmed"
|
|
1220
1299
|
] }),
|
|
1221
|
-
/* @__PURE__ */
|
|
1222
|
-
/* @__PURE__ */
|
|
1300
|
+
/* @__PURE__ */ jsxs3("span", { className: "flex items-center gap-1", children: [
|
|
1301
|
+
/* @__PURE__ */ jsx4(HelpCircle, { className: "size-3 text-warning-text" }),
|
|
1223
1302
|
"estimated"
|
|
1224
1303
|
] })
|
|
1225
1304
|
] })
|
|
1226
|
-
] }) : /* @__PURE__ */
|
|
1305
|
+
] }) : /* @__PURE__ */ jsx4("p", { className: "text-sm text-muted-foreground", children: "AI is still gathering information..." })
|
|
1227
1306
|
] }),
|
|
1228
|
-
/* @__PURE__ */
|
|
1229
|
-
/* @__PURE__ */
|
|
1230
|
-
appointment ? /* @__PURE__ */
|
|
1307
|
+
/* @__PURE__ */ jsxs3(PanelSection, { children: [
|
|
1308
|
+
/* @__PURE__ */ jsx4(PanelSectionHeader, { children: "Appointment" }),
|
|
1309
|
+
appointment ? /* @__PURE__ */ jsx4(
|
|
1231
1310
|
AppointmentSection,
|
|
1232
1311
|
{
|
|
1233
1312
|
appointment,
|
|
@@ -1237,7 +1316,7 @@ function LeadInfoPanel({
|
|
|
1237
1316
|
onDeclineAppointment,
|
|
1238
1317
|
onRescheduleAppointment
|
|
1239
1318
|
}
|
|
1240
|
-
) : /* @__PURE__ */
|
|
1319
|
+
) : /* @__PURE__ */ jsxs3(
|
|
1241
1320
|
Button,
|
|
1242
1321
|
{
|
|
1243
1322
|
variant: "outline",
|
|
@@ -1246,20 +1325,20 @@ function LeadInfoPanel({
|
|
|
1246
1325
|
disabled: isAnonymous,
|
|
1247
1326
|
onClick: onBookAppointment,
|
|
1248
1327
|
children: [
|
|
1249
|
-
/* @__PURE__ */
|
|
1328
|
+
/* @__PURE__ */ jsx4(Plus, { className: "mr-1.5 size-3.5" }),
|
|
1250
1329
|
"Book Appointment"
|
|
1251
1330
|
]
|
|
1252
1331
|
}
|
|
1253
1332
|
)
|
|
1254
1333
|
] }),
|
|
1255
|
-
/* @__PURE__ */
|
|
1256
|
-
/* @__PURE__ */
|
|
1257
|
-
/* @__PURE__ */
|
|
1258
|
-
/* @__PURE__ */
|
|
1259
|
-
/* @__PURE__ */
|
|
1334
|
+
/* @__PURE__ */ jsxs3(PanelSection, { children: [
|
|
1335
|
+
/* @__PURE__ */ jsx4(PanelSectionHeader, { children: "CRM Actions" }),
|
|
1336
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-2", children: [
|
|
1337
|
+
/* @__PURE__ */ jsxs3(Tooltip, { children: [
|
|
1338
|
+
/* @__PURE__ */ jsx4(
|
|
1260
1339
|
TooltipTrigger,
|
|
1261
1340
|
{
|
|
1262
|
-
render: /* @__PURE__ */
|
|
1341
|
+
render: /* @__PURE__ */ jsxs3(
|
|
1263
1342
|
Button,
|
|
1264
1343
|
{
|
|
1265
1344
|
variant: "outline",
|
|
@@ -1268,16 +1347,16 @@ function LeadInfoPanel({
|
|
|
1268
1347
|
disabled: addToContactsDisabled,
|
|
1269
1348
|
onClick: onAddToContacts,
|
|
1270
1349
|
children: [
|
|
1271
|
-
/* @__PURE__ */
|
|
1350
|
+
/* @__PURE__ */ jsx4(UserPlus, { className: "mr-1.5 size-3.5" }),
|
|
1272
1351
|
"Add to Contacts"
|
|
1273
1352
|
]
|
|
1274
1353
|
}
|
|
1275
1354
|
)
|
|
1276
1355
|
}
|
|
1277
1356
|
),
|
|
1278
|
-
isKnownContact && /* @__PURE__ */
|
|
1357
|
+
isKnownContact && /* @__PURE__ */ jsx4(TooltipContent, { children: "Already in contacts" })
|
|
1279
1358
|
] }),
|
|
1280
|
-
/* @__PURE__ */
|
|
1359
|
+
/* @__PURE__ */ jsxs3(
|
|
1281
1360
|
Button,
|
|
1282
1361
|
{
|
|
1283
1362
|
variant: "outline",
|
|
@@ -1286,23 +1365,23 @@ function LeadInfoPanel({
|
|
|
1286
1365
|
disabled: isAnonymous,
|
|
1287
1366
|
onClick: onCreateOpportunity,
|
|
1288
1367
|
children: [
|
|
1289
|
-
/* @__PURE__ */
|
|
1368
|
+
/* @__PURE__ */ jsx4(Briefcase, { className: "mr-1.5 size-3.5" }),
|
|
1290
1369
|
"Add to CRM"
|
|
1291
1370
|
]
|
|
1292
1371
|
}
|
|
1293
1372
|
)
|
|
1294
1373
|
] })
|
|
1295
1374
|
] }),
|
|
1296
|
-
/* @__PURE__ */
|
|
1297
|
-
/* @__PURE__ */
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
notesSaveStatus === "saving" && /* @__PURE__ */
|
|
1300
|
-
notesSaveStatus === "saved" && /* @__PURE__ */
|
|
1301
|
-
/* @__PURE__ */
|
|
1375
|
+
/* @__PURE__ */ jsxs3(PanelSection, { last: true, children: [
|
|
1376
|
+
/* @__PURE__ */ jsxs3("div", { className: "mb-2.5 flex items-center justify-between", children: [
|
|
1377
|
+
/* @__PURE__ */ jsx4("p", { className: "text-overline text-muted-foreground", children: "Internal Notes" }),
|
|
1378
|
+
notesSaveStatus === "saving" && /* @__PURE__ */ jsx4("span", { className: "text-xs text-muted-foreground", children: "Saving..." }),
|
|
1379
|
+
notesSaveStatus === "saved" && /* @__PURE__ */ jsxs3("span", { className: "flex items-center gap-1 text-xs text-success-text", children: [
|
|
1380
|
+
/* @__PURE__ */ jsx4(CheckCircle2, { className: "size-3" }),
|
|
1302
1381
|
"Saved"
|
|
1303
1382
|
] })
|
|
1304
1383
|
] }),
|
|
1305
|
-
/* @__PURE__ */
|
|
1384
|
+
/* @__PURE__ */ jsx4(
|
|
1306
1385
|
Textarea,
|
|
1307
1386
|
{
|
|
1308
1387
|
value: internalNotes,
|
|
@@ -1316,6 +1395,9 @@ function LeadInfoPanel({
|
|
|
1316
1395
|
] })
|
|
1317
1396
|
] });
|
|
1318
1397
|
}
|
|
1398
|
+
|
|
1399
|
+
// src/components/ui/ai-conversations/index.tsx
|
|
1400
|
+
import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1319
1401
|
function ConversationsPage({
|
|
1320
1402
|
conversations,
|
|
1321
1403
|
activeConversationId,
|
|
@@ -1354,6 +1436,7 @@ function ConversationsPage({
|
|
|
1354
1436
|
onSendEmail,
|
|
1355
1437
|
onTakeOver,
|
|
1356
1438
|
onLetAiHandle,
|
|
1439
|
+
emailReplySubject,
|
|
1357
1440
|
onReopen,
|
|
1358
1441
|
onMarkUrgent,
|
|
1359
1442
|
onUnmarkUrgent,
|
|
@@ -1382,12 +1465,12 @@ function ConversationsPage({
|
|
|
1382
1465
|
onToggleLeadPanel == null ? void 0 : onToggleLeadPanel();
|
|
1383
1466
|
setMobilePanel(showLeadPanel ? "chat" : "lead");
|
|
1384
1467
|
};
|
|
1385
|
-
return /* @__PURE__ */
|
|
1468
|
+
return /* @__PURE__ */ jsx5(TooltipProvider, { children: /* @__PURE__ */ jsxs4(
|
|
1386
1469
|
"div",
|
|
1387
1470
|
{
|
|
1388
1471
|
className: cn("flex h-full overflow-hidden bg-background", className),
|
|
1389
1472
|
children: [
|
|
1390
|
-
/* @__PURE__ */
|
|
1473
|
+
/* @__PURE__ */ jsx5(
|
|
1391
1474
|
ConversationList,
|
|
1392
1475
|
{
|
|
1393
1476
|
conversations,
|
|
@@ -1405,12 +1488,11 @@ function ConversationsPage({
|
|
|
1405
1488
|
onLoadMore,
|
|
1406
1489
|
className: cn(
|
|
1407
1490
|
"shrink-0 md:w-[320px]",
|
|
1408
|
-
// Mobile: full width, visible only on list panel
|
|
1409
1491
|
mobilePanel === "list" ? "flex w-full md:flex" : "hidden md:flex"
|
|
1410
1492
|
)
|
|
1411
1493
|
}
|
|
1412
1494
|
),
|
|
1413
|
-
contact ? /* @__PURE__ */
|
|
1495
|
+
contact ? /* @__PURE__ */ jsx5(
|
|
1414
1496
|
ChatThread,
|
|
1415
1497
|
{
|
|
1416
1498
|
contact,
|
|
@@ -1427,6 +1509,7 @@ function ConversationsPage({
|
|
|
1427
1509
|
onSendEmail,
|
|
1428
1510
|
onTakeOver,
|
|
1429
1511
|
onLetAiHandle,
|
|
1512
|
+
emailReplySubject,
|
|
1430
1513
|
onReopen,
|
|
1431
1514
|
onMarkUrgent,
|
|
1432
1515
|
onUnmarkUrgent,
|
|
@@ -1443,31 +1526,29 @@ function ConversationsPage({
|
|
|
1443
1526
|
)
|
|
1444
1527
|
},
|
|
1445
1528
|
contact.id
|
|
1446
|
-
) : /* @__PURE__ */
|
|
1529
|
+
) : /* @__PURE__ */ jsx5(
|
|
1447
1530
|
"div",
|
|
1448
1531
|
{
|
|
1449
1532
|
className: cn(
|
|
1450
1533
|
"min-w-0 flex-1 items-center justify-center border-r border-border bg-muted/10",
|
|
1451
1534
|
mobilePanel === "chat" ? "flex md:flex" : "hidden md:flex"
|
|
1452
1535
|
),
|
|
1453
|
-
children: /* @__PURE__ */
|
|
1454
|
-
/* @__PURE__ */
|
|
1455
|
-
/* @__PURE__ */
|
|
1536
|
+
children: /* @__PURE__ */ jsxs4("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
|
|
1537
|
+
/* @__PURE__ */ jsx5(MessageSquare3, { className: "size-10 opacity-30" }),
|
|
1538
|
+
/* @__PURE__ */ jsx5("p", { className: "text-sm", children: "Select a conversation" })
|
|
1456
1539
|
] })
|
|
1457
1540
|
}
|
|
1458
1541
|
),
|
|
1459
|
-
contact && /* @__PURE__ */
|
|
1460
|
-
/* @__PURE__ */
|
|
1542
|
+
contact && /* @__PURE__ */ jsxs4(Fragment4, { children: [
|
|
1543
|
+
/* @__PURE__ */ jsx5(
|
|
1461
1544
|
"div",
|
|
1462
1545
|
{
|
|
1463
1546
|
className: cn(
|
|
1464
|
-
// Mobile: full-width, instant show/hide based on mobilePanel
|
|
1465
1547
|
mobilePanel === "lead" ? "flex w-full shrink-0 flex-col" : "hidden",
|
|
1466
|
-
// Desktop: always rendered, animate width open/close
|
|
1467
1548
|
"md:block md:shrink-0 md:overflow-hidden md:transition-[width] md:duration-200 md:ease-in-out",
|
|
1468
1549
|
showLeadPanel ? "md:w-[320px]" : "md:w-0"
|
|
1469
1550
|
),
|
|
1470
|
-
children: /* @__PURE__ */
|
|
1551
|
+
children: /* @__PURE__ */ jsx5(
|
|
1471
1552
|
LeadInfoPanel,
|
|
1472
1553
|
{
|
|
1473
1554
|
contact,
|
|
@@ -1493,11 +1574,11 @@ function ConversationsPage({
|
|
|
1493
1574
|
)
|
|
1494
1575
|
}
|
|
1495
1576
|
),
|
|
1496
|
-
!showLeadPanel && onToggleLeadPanel && /* @__PURE__ */
|
|
1497
|
-
/* @__PURE__ */
|
|
1577
|
+
!showLeadPanel && onToggleLeadPanel && /* @__PURE__ */ jsx5("div", { className: "hidden shrink-0 items-start border-l border-border pt-[29px] md:flex", children: /* @__PURE__ */ jsxs4(Tooltip, { children: [
|
|
1578
|
+
/* @__PURE__ */ jsx5(
|
|
1498
1579
|
TooltipTrigger,
|
|
1499
1580
|
{
|
|
1500
|
-
render: /* @__PURE__ */
|
|
1581
|
+
render: /* @__PURE__ */ jsx5(
|
|
1501
1582
|
Button,
|
|
1502
1583
|
{
|
|
1503
1584
|
variant: "ghost",
|
|
@@ -1505,12 +1586,12 @@ function ConversationsPage({
|
|
|
1505
1586
|
className: "size-8",
|
|
1506
1587
|
"aria-label": "Show lead info",
|
|
1507
1588
|
onClick: handleToggleLeadPanel,
|
|
1508
|
-
children: /* @__PURE__ */
|
|
1589
|
+
children: /* @__PURE__ */ jsx5(ChevronLeft, { className: "size-4" })
|
|
1509
1590
|
}
|
|
1510
1591
|
)
|
|
1511
1592
|
}
|
|
1512
1593
|
),
|
|
1513
|
-
/* @__PURE__ */
|
|
1594
|
+
/* @__PURE__ */ jsx5(TooltipContent, { children: "Show lead info" })
|
|
1514
1595
|
] }) })
|
|
1515
1596
|
] })
|
|
1516
1597
|
]
|
|
@@ -1540,13 +1621,13 @@ function AiConvAssignAdvisorDialog({
|
|
|
1540
1621
|
setRoleFilter("");
|
|
1541
1622
|
}
|
|
1542
1623
|
};
|
|
1543
|
-
return /* @__PURE__ */
|
|
1544
|
-
/* @__PURE__ */
|
|
1545
|
-
/* @__PURE__ */
|
|
1546
|
-
/* @__PURE__ */
|
|
1624
|
+
return /* @__PURE__ */ jsx5(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs4(DialogContent, { children: [
|
|
1625
|
+
/* @__PURE__ */ jsxs4(DialogHeader, { children: [
|
|
1626
|
+
/* @__PURE__ */ jsx5(DialogTitle, { children: "Assign to advisor" }),
|
|
1627
|
+
/* @__PURE__ */ jsx5(DialogDescription, { children: "Choose an advisor to handle this conversation." })
|
|
1547
1628
|
] }),
|
|
1548
|
-
/* @__PURE__ */
|
|
1549
|
-
roles.length > 0 && /* @__PURE__ */
|
|
1629
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-0", children: [
|
|
1630
|
+
roles.length > 0 && /* @__PURE__ */ jsx5("div", { className: "pb-3", children: /* @__PURE__ */ jsxs4(
|
|
1550
1631
|
ToggleGroup,
|
|
1551
1632
|
{
|
|
1552
1633
|
type: "single",
|
|
@@ -1559,14 +1640,14 @@ function AiConvAssignAdvisorDialog({
|
|
|
1559
1640
|
setRoleFilter(!v || v === "__all__" ? "" : v);
|
|
1560
1641
|
},
|
|
1561
1642
|
children: [
|
|
1562
|
-
/* @__PURE__ */
|
|
1563
|
-
roles.map((role) => /* @__PURE__ */
|
|
1643
|
+
/* @__PURE__ */ jsx5(ToggleGroupItem, { value: "__all__", children: "All" }),
|
|
1644
|
+
roles.map((role) => /* @__PURE__ */ jsx5(ToggleGroupItem, { value: role, children: role }, role))
|
|
1564
1645
|
]
|
|
1565
1646
|
}
|
|
1566
1647
|
) }),
|
|
1567
|
-
/* @__PURE__ */
|
|
1568
|
-
/* @__PURE__ */
|
|
1569
|
-
/* @__PURE__ */
|
|
1648
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 border border-input px-3", children: [
|
|
1649
|
+
/* @__PURE__ */ jsx5(Search2, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
1650
|
+
/* @__PURE__ */ jsx5(
|
|
1570
1651
|
"input",
|
|
1571
1652
|
{
|
|
1572
1653
|
type: "text",
|
|
@@ -1577,7 +1658,7 @@ function AiConvAssignAdvisorDialog({
|
|
|
1577
1658
|
}
|
|
1578
1659
|
)
|
|
1579
1660
|
] }),
|
|
1580
|
-
/* @__PURE__ */
|
|
1661
|
+
/* @__PURE__ */ jsx5("div", { className: "max-h-52 overflow-y-auto border border-t-0 border-input", children: filtered.length === 0 ? /* @__PURE__ */ jsx5("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "No advisors found." }) : filtered.map((advisor) => /* @__PURE__ */ jsxs4(
|
|
1581
1662
|
"button",
|
|
1582
1663
|
{
|
|
1583
1664
|
type: "button",
|
|
@@ -1587,19 +1668,19 @@ function AiConvAssignAdvisorDialog({
|
|
|
1587
1668
|
value === advisor.id && "bg-muted font-medium"
|
|
1588
1669
|
),
|
|
1589
1670
|
children: [
|
|
1590
|
-
/* @__PURE__ */
|
|
1591
|
-
/* @__PURE__ */
|
|
1592
|
-
/* @__PURE__ */
|
|
1593
|
-
advisor.role && /* @__PURE__ */
|
|
1671
|
+
/* @__PURE__ */ jsx5(Avatar, { size: "sm", children: /* @__PURE__ */ jsx5(AvatarFallback, { className: "font-semibold", children: advisor.initials }) }),
|
|
1672
|
+
/* @__PURE__ */ jsxs4("div", { className: "min-w-0 flex-1", children: [
|
|
1673
|
+
/* @__PURE__ */ jsx5("p", { className: "truncate text-sm", children: advisor.name }),
|
|
1674
|
+
advisor.role && /* @__PURE__ */ jsx5("p", { className: "truncate text-xs text-muted-foreground", children: advisor.role })
|
|
1594
1675
|
] })
|
|
1595
1676
|
]
|
|
1596
1677
|
},
|
|
1597
1678
|
advisor.id
|
|
1598
1679
|
)) })
|
|
1599
1680
|
] }),
|
|
1600
|
-
/* @__PURE__ */
|
|
1601
|
-
/* @__PURE__ */
|
|
1602
|
-
/* @__PURE__ */
|
|
1681
|
+
/* @__PURE__ */ jsxs4(DialogFooter, { children: [
|
|
1682
|
+
/* @__PURE__ */ jsx5(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
1683
|
+
/* @__PURE__ */ jsx5(Button, { onClick: onConfirm, children: "Assign" })
|
|
1603
1684
|
] })
|
|
1604
1685
|
] }) });
|
|
1605
1686
|
}
|