@copilotz/chat-ui 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +713 -742
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +69 -26
- package/dist/index.d.ts +69 -26
- package/dist/index.js +841 -872
- package/dist/index.js.map +1 -1
- package/dist/styles.css +22 -53
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -33,8 +33,10 @@ __export(index_exports, {
|
|
|
33
33
|
AssistantActivity: () => AssistantActivity,
|
|
34
34
|
ChatUI: () => ChatUI,
|
|
35
35
|
ChatUserContextProvider: () => ChatUserContextProvider,
|
|
36
|
+
MessageSenderAvatar: () => MessageSenderAvatar,
|
|
36
37
|
defaultChatConfig: () => defaultChatConfig,
|
|
37
38
|
mergeConfig: () => mergeConfig,
|
|
39
|
+
resolveMessageSenderDisplay: () => resolveMessageSenderDisplay,
|
|
38
40
|
useChatUserContext: () => useChatUserContext
|
|
39
41
|
});
|
|
40
42
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -123,12 +125,13 @@ var defaultChatConfig = {
|
|
|
123
125
|
footerLabel: "Assistant can make mistakes. Check the AI results.",
|
|
124
126
|
daysAgo: "days ago",
|
|
125
127
|
inputHelpText: "Press Enter to send, Shift+Enter to add a new line.",
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
activityThinkingActive: "Thinking",
|
|
129
|
+
activityThinkingComplete: "Thought through request",
|
|
130
|
+
activityToolActive: "Using {{tool}}",
|
|
131
|
+
activityToolComplete: "Used {{tool}}",
|
|
132
|
+
activityToolFailed: "{{tool}} failed",
|
|
133
|
+
activityAnsweringActive: "Preparing response",
|
|
134
|
+
activityAnsweringComplete: "Prepared response",
|
|
132
135
|
activityShowDetails: "Show details",
|
|
133
136
|
activityHideDetails: "Hide details",
|
|
134
137
|
defaultThreadName: "Main Thread",
|
|
@@ -144,7 +147,8 @@ var defaultChatConfig = {
|
|
|
144
147
|
enableMessageEditing: true,
|
|
145
148
|
enableMessageCopy: true,
|
|
146
149
|
enableRegeneration: true,
|
|
147
|
-
|
|
150
|
+
showActivity: true,
|
|
151
|
+
showActivityDetails: true,
|
|
148
152
|
maxAttachments: 4,
|
|
149
153
|
maxFileSize: 10 * 1024 * 1024
|
|
150
154
|
// 10MB
|
|
@@ -221,50 +225,6 @@ var import_react_markdown = __toESM(require("react-markdown"), 1);
|
|
|
221
225
|
var import_remark_gfm = __toESM(require("remark-gfm"), 1);
|
|
222
226
|
var import_rehype_highlight = __toESM(require("rehype-highlight"), 1);
|
|
223
227
|
|
|
224
|
-
// src/lib/chatUtils.ts
|
|
225
|
-
var AGENT_COLORS = [
|
|
226
|
-
"#6366f1",
|
|
227
|
-
// indigo
|
|
228
|
-
"#8b5cf6",
|
|
229
|
-
// violet
|
|
230
|
-
"#ec4899",
|
|
231
|
-
// pink
|
|
232
|
-
"#f59e0b",
|
|
233
|
-
// amber
|
|
234
|
-
"#10b981",
|
|
235
|
-
// emerald
|
|
236
|
-
"#3b82f6",
|
|
237
|
-
// blue
|
|
238
|
-
"#ef4444",
|
|
239
|
-
// red
|
|
240
|
-
"#14b8a6",
|
|
241
|
-
// teal
|
|
242
|
-
"#f97316",
|
|
243
|
-
// orange
|
|
244
|
-
"#84cc16"
|
|
245
|
-
// lime
|
|
246
|
-
];
|
|
247
|
-
function getAgentColor(agentId) {
|
|
248
|
-
let hash = 0;
|
|
249
|
-
for (let i = 0; i < agentId.length; i++) {
|
|
250
|
-
hash = (hash << 5) - hash + agentId.charCodeAt(i) | 0;
|
|
251
|
-
}
|
|
252
|
-
return AGENT_COLORS[Math.abs(hash) % AGENT_COLORS.length];
|
|
253
|
-
}
|
|
254
|
-
function getAgentInitials(name) {
|
|
255
|
-
const parts = name.trim().split(/\s+/);
|
|
256
|
-
if (parts.length >= 2) {
|
|
257
|
-
return (parts[0][0] + parts[1][0]).toUpperCase();
|
|
258
|
-
}
|
|
259
|
-
return name.slice(0, 2).toUpperCase();
|
|
260
|
-
}
|
|
261
|
-
function assignAgentColors(agents) {
|
|
262
|
-
return agents.map((agent) => ({
|
|
263
|
-
...agent,
|
|
264
|
-
color: agent.color || getAgentColor(agent.id)
|
|
265
|
-
}));
|
|
266
|
-
}
|
|
267
|
-
|
|
268
228
|
// src/components/ui/button.tsx
|
|
269
229
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
270
230
|
var import_class_variance_authority = require("class-variance-authority");
|
|
@@ -339,59 +299,10 @@ function Button({
|
|
|
339
299
|
);
|
|
340
300
|
}
|
|
341
301
|
|
|
342
|
-
// src/components/ui/avatar.tsx
|
|
343
|
-
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"), 1);
|
|
344
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
345
|
-
function Avatar({
|
|
346
|
-
className,
|
|
347
|
-
...props
|
|
348
|
-
}) {
|
|
349
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
350
|
-
AvatarPrimitive.Root,
|
|
351
|
-
{
|
|
352
|
-
"data-slot": "avatar",
|
|
353
|
-
className: cn(
|
|
354
|
-
"relative flex size-8 shrink-0 overflow-hidden rounded-full",
|
|
355
|
-
className
|
|
356
|
-
),
|
|
357
|
-
...props
|
|
358
|
-
}
|
|
359
|
-
);
|
|
360
|
-
}
|
|
361
|
-
function AvatarImage({
|
|
362
|
-
className,
|
|
363
|
-
...props
|
|
364
|
-
}) {
|
|
365
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
366
|
-
AvatarPrimitive.Image,
|
|
367
|
-
{
|
|
368
|
-
"data-slot": "avatar-image",
|
|
369
|
-
className: cn("aspect-square size-full", className),
|
|
370
|
-
...props
|
|
371
|
-
}
|
|
372
|
-
);
|
|
373
|
-
}
|
|
374
|
-
function AvatarFallback({
|
|
375
|
-
className,
|
|
376
|
-
...props
|
|
377
|
-
}) {
|
|
378
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
379
|
-
AvatarPrimitive.Fallback,
|
|
380
|
-
{
|
|
381
|
-
"data-slot": "avatar-fallback",
|
|
382
|
-
className: cn(
|
|
383
|
-
"bg-muted flex size-full items-center justify-center rounded-full",
|
|
384
|
-
className
|
|
385
|
-
),
|
|
386
|
-
...props
|
|
387
|
-
}
|
|
388
|
-
);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
302
|
// src/components/ui/badge.tsx
|
|
392
303
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
393
304
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
394
|
-
var
|
|
305
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
395
306
|
var badgeVariants = (0, import_class_variance_authority2.cva)(
|
|
396
307
|
"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
397
308
|
{
|
|
@@ -415,7 +326,7 @@ function Badge({
|
|
|
415
326
|
...props
|
|
416
327
|
}) {
|
|
417
328
|
const Comp = asChild ? import_react_slot2.Slot : "span";
|
|
418
|
-
return /* @__PURE__ */ (0,
|
|
329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
419
330
|
Comp,
|
|
420
331
|
{
|
|
421
332
|
"data-slot": "badge",
|
|
@@ -426,9 +337,9 @@ function Badge({
|
|
|
426
337
|
}
|
|
427
338
|
|
|
428
339
|
// src/components/ui/textarea.tsx
|
|
429
|
-
var
|
|
340
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
430
341
|
function Textarea({ className, ...props }) {
|
|
431
|
-
return /* @__PURE__ */ (0,
|
|
342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
432
343
|
"textarea",
|
|
433
344
|
{
|
|
434
345
|
"data-slot": "textarea",
|
|
@@ -443,12 +354,12 @@ function Textarea({ className, ...props }) {
|
|
|
443
354
|
|
|
444
355
|
// src/components/ui/tooltip.tsx
|
|
445
356
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
446
|
-
var
|
|
357
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
447
358
|
function TooltipProvider({
|
|
448
359
|
delayDuration = 0,
|
|
449
360
|
...props
|
|
450
361
|
}) {
|
|
451
|
-
return /* @__PURE__ */ (0,
|
|
362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
452
363
|
TooltipPrimitive.Provider,
|
|
453
364
|
{
|
|
454
365
|
"data-slot": "tooltip-provider",
|
|
@@ -460,12 +371,12 @@ function TooltipProvider({
|
|
|
460
371
|
function Tooltip({
|
|
461
372
|
...props
|
|
462
373
|
}) {
|
|
463
|
-
return /* @__PURE__ */ (0,
|
|
374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
|
|
464
375
|
}
|
|
465
376
|
function TooltipTrigger({
|
|
466
377
|
...props
|
|
467
378
|
}) {
|
|
468
|
-
return /* @__PURE__ */ (0,
|
|
379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
469
380
|
}
|
|
470
381
|
function TooltipContent({
|
|
471
382
|
className,
|
|
@@ -473,7 +384,7 @@ function TooltipContent({
|
|
|
473
384
|
children,
|
|
474
385
|
...props
|
|
475
386
|
}) {
|
|
476
|
-
return /* @__PURE__ */ (0,
|
|
387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
477
388
|
TooltipPrimitive.Content,
|
|
478
389
|
{
|
|
479
390
|
"data-slot": "tooltip-content",
|
|
@@ -485,7 +396,7 @@ function TooltipContent({
|
|
|
485
396
|
...props,
|
|
486
397
|
children: [
|
|
487
398
|
children,
|
|
488
|
-
/* @__PURE__ */ (0,
|
|
399
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TooltipPrimitive.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
489
400
|
]
|
|
490
401
|
}
|
|
491
402
|
) });
|
|
@@ -493,225 +404,259 @@ function TooltipContent({
|
|
|
493
404
|
|
|
494
405
|
// src/components/chat/AssistantActivity.tsx
|
|
495
406
|
var import_react = require("react");
|
|
496
|
-
|
|
497
|
-
// src/components/ui/card.tsx
|
|
498
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
499
|
-
function Card({ className, ...props }) {
|
|
500
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
501
|
-
"div",
|
|
502
|
-
{
|
|
503
|
-
"data-slot": "card",
|
|
504
|
-
className: cn(
|
|
505
|
-
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
506
|
-
className
|
|
507
|
-
),
|
|
508
|
-
...props
|
|
509
|
-
}
|
|
510
|
-
);
|
|
511
|
-
}
|
|
512
|
-
function CardHeader({ className, ...props }) {
|
|
513
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
514
|
-
"div",
|
|
515
|
-
{
|
|
516
|
-
"data-slot": "card-header",
|
|
517
|
-
className: cn(
|
|
518
|
-
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
519
|
-
className
|
|
520
|
-
),
|
|
521
|
-
...props
|
|
522
|
-
}
|
|
523
|
-
);
|
|
524
|
-
}
|
|
525
|
-
function CardContent({ className, ...props }) {
|
|
526
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
527
|
-
"div",
|
|
528
|
-
{
|
|
529
|
-
"data-slot": "card-content",
|
|
530
|
-
className: cn("px-6", className),
|
|
531
|
-
...props
|
|
532
|
-
}
|
|
533
|
-
);
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
// src/components/ui/collapsible.tsx
|
|
537
|
-
var CollapsiblePrimitive = __toESM(require("@radix-ui/react-collapsible"), 1);
|
|
538
|
-
var Collapsible = CollapsiblePrimitive.Root;
|
|
539
|
-
var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
|
|
540
|
-
var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
|
|
541
|
-
|
|
542
|
-
// src/components/chat/AssistantActivity.tsx
|
|
543
407
|
var import_lucide_react = require("lucide-react");
|
|
544
|
-
var
|
|
545
|
-
var
|
|
546
|
-
var ACTION_SLOT_CLASS = "inline-flex h-9 min-w-[132px] items-center justify-end px-2 text-xs";
|
|
408
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
409
|
+
var ROOT_CLASS = "mb-4 w-full max-w-full min-w-0";
|
|
547
410
|
var interpolate = (template, replacements) => Object.entries(replacements).reduce(
|
|
548
411
|
(output, [key, value]) => output.replaceAll(`{{${key}}}`, String(value ?? "")),
|
|
549
412
|
template
|
|
550
413
|
);
|
|
551
|
-
var
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
});
|
|
558
|
-
}
|
|
559
|
-
if (
|
|
560
|
-
return interpolate(labels?.
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
}
|
|
564
|
-
return labels?.activityUsingTools || "Using tools...";
|
|
414
|
+
var hasActiveItem = (activity) => activity.items.some((item) => item.status === "active");
|
|
415
|
+
var hasDetails = (item) => Boolean(item.details?.reasoning || item.details?.toolCall || item.details?.result !== void 0 || item.details?.error);
|
|
416
|
+
var resolveActivityLabel = (item, labels) => {
|
|
417
|
+
const tool = item.toolName || item.details?.toolCall?.name || "tool";
|
|
418
|
+
if (item.kind === "tool") {
|
|
419
|
+
if (item.status === "failed") {
|
|
420
|
+
return interpolate(labels?.activityToolFailed || "{{tool}} failed", { tool });
|
|
421
|
+
}
|
|
422
|
+
if (item.status === "complete") {
|
|
423
|
+
return interpolate(labels?.activityToolComplete || "Used {{tool}}", { tool });
|
|
424
|
+
}
|
|
425
|
+
return interpolate(labels?.activityToolActive || "Using {{tool}}", { tool });
|
|
565
426
|
}
|
|
566
|
-
if (
|
|
567
|
-
return labels?.
|
|
427
|
+
if (item.kind === "answering") {
|
|
428
|
+
return item.status === "active" ? labels?.activityAnsweringActive || "Preparing response" : labels?.activityAnsweringComplete || "Prepared response";
|
|
568
429
|
}
|
|
569
|
-
|
|
570
|
-
return labels?.activityWorking || "Working...";
|
|
571
|
-
}
|
|
572
|
-
return labels?.activityThinking || "Thinking...";
|
|
430
|
+
return item.status === "active" ? labels?.activityThinkingActive || "Thinking" : labels?.activityThinkingComplete || "Thought through request";
|
|
573
431
|
};
|
|
574
|
-
var
|
|
575
|
-
if (
|
|
576
|
-
|
|
577
|
-
}
|
|
578
|
-
if (
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
variant: "secondary",
|
|
583
|
-
className: "bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",
|
|
584
|
-
children: "done"
|
|
585
|
-
}
|
|
586
|
-
);
|
|
587
|
-
}
|
|
588
|
-
if (toolCall.status === "running") {
|
|
589
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { variant: "secondary", className: "bg-primary/10 text-primary", children: "running" });
|
|
590
|
-
}
|
|
591
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { variant: "secondary", children: "pending" });
|
|
432
|
+
var ActivityIcon = ({ item }) => {
|
|
433
|
+
if (item.status === "active") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.LoaderCircle, { className: "h-4 w-4 animate-spin text-primary" });
|
|
434
|
+
if (item.status === "failed") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.CircleAlert, { className: "h-4 w-4 text-destructive" });
|
|
435
|
+
if (item.status === "complete") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.CheckCircle2, { className: "h-4 w-4 text-muted-foreground" });
|
|
436
|
+
if (item.kind === "tool") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.Wrench, { className: "h-4 w-4 text-muted-foreground" });
|
|
437
|
+
if (item.kind === "answering") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.Sparkles, { className: "h-4 w-4 text-muted-foreground" });
|
|
438
|
+
if (item.kind === "thinking") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.Brain, { className: "h-4 w-4 text-muted-foreground" });
|
|
439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.CheckCircle2, { className: "h-4 w-4 text-muted-foreground" });
|
|
592
440
|
};
|
|
593
|
-
var ActivitySummaryCard = (0, import_react.memo)(function ActivitySummaryCard2({
|
|
594
|
-
activity,
|
|
595
|
-
labels
|
|
596
|
-
}) {
|
|
597
|
-
const label = (0, import_react.useMemo)(() => resolveSummaryLabel(activity, labels), [activity, labels]);
|
|
598
|
-
const isActive = activity.isActive;
|
|
599
|
-
const icon = activity.summary.kind === "using_tools" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react.Wrench, { className: cn("h-4 w-4 shrink-0", isActive ? "text-primary" : "text-muted-foreground") }) : activity.summary.kind === "preparing_answer" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react.Sparkles, { className: cn("h-4 w-4 shrink-0", isActive ? "text-primary" : "text-muted-foreground") }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react.Brain, { className: cn("h-4 w-4 shrink-0", isActive ? "text-primary" : "text-muted-foreground") });
|
|
600
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
601
|
-
"div",
|
|
602
|
-
{
|
|
603
|
-
className: cn(
|
|
604
|
-
"flex w-full min-w-0 items-center gap-2 rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
605
|
-
isActive ? "border-primary/30 bg-primary/5 text-foreground" : "border-border/60 bg-muted/20 text-muted-foreground"
|
|
606
|
-
),
|
|
607
|
-
children: [
|
|
608
|
-
icon,
|
|
609
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "min-w-0 flex-1 truncate", children: label }),
|
|
610
|
-
isActive && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react.LoaderCircle, { className: "h-4 w-4 shrink-0 animate-spin text-primary" })
|
|
611
|
-
]
|
|
612
|
-
}
|
|
613
|
-
);
|
|
614
|
-
});
|
|
615
|
-
var ActivitySummaryRow = (0, import_react.memo)(function ActivitySummaryRow2({
|
|
616
|
-
activity,
|
|
617
|
-
labels,
|
|
618
|
-
hasDetails,
|
|
619
|
-
open
|
|
620
|
-
}) {
|
|
621
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "grid w-full min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2", children: [
|
|
622
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ActivitySummaryCard, { activity, labels }) }),
|
|
623
|
-
hasDetails ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Button, { variant: "ghost", size: "sm", className: cn(ACTION_SLOT_CLASS, "shrink-0 text-muted-foreground"), children: [
|
|
624
|
-
open ? labels?.activityHideDetails || "Hide details" : labels?.activityShowDetails || "Show details",
|
|
625
|
-
open ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react.ChevronDown, { className: "ml-1 h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react.ChevronRight, { className: "ml-1 h-3.5 w-3.5" })
|
|
626
|
-
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { "aria-hidden": "true", className: cn(ACTION_SLOT_CLASS, "pointer-events-none invisible shrink-0"), children: [
|
|
627
|
-
labels?.activityShowDetails || "Show details",
|
|
628
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react.ChevronRight, { className: "ml-1 h-3.5 w-3.5" })
|
|
629
|
-
] })
|
|
630
|
-
] });
|
|
631
|
-
});
|
|
632
441
|
var ActivityDetails = (0, import_react.memo)(function ActivityDetails2({
|
|
633
|
-
|
|
442
|
+
item
|
|
634
443
|
}) {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: "Tools" }),
|
|
642
|
-
activity.toolCalls.map((toolCall) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Card, { className: "border-border/60 bg-background/70", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(CardContent, { className: "space-y-2 px-3 py-3", children: [
|
|
643
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center justify-between gap-3", children: [
|
|
644
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "truncate text-sm font-medium", children: toolCall.name }) }),
|
|
645
|
-
getStatusBadge(toolCall)
|
|
646
|
-
] }),
|
|
647
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-2", children: [
|
|
648
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
649
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: "Args" }),
|
|
650
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("pre", { className: "overflow-x-auto rounded-md bg-muted/70 p-2 text-xs text-muted-foreground", children: JSON.stringify(toolCall.arguments, null, 2) })
|
|
651
|
-
] }),
|
|
652
|
-
typeof toolCall.result !== "undefined" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
653
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: "Result" }),
|
|
654
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("pre", { className: "overflow-x-auto rounded-md bg-muted/70 p-2 text-xs text-muted-foreground", children: JSON.stringify(toolCall.result, null, 2) })
|
|
655
|
-
] })
|
|
656
|
-
] })
|
|
657
|
-
] }) }, toolCall.id))
|
|
658
|
-
] })
|
|
444
|
+
const toolCall = item.details?.toolCall;
|
|
445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "space-y-3 pb-1 pl-7 pt-2 text-sm text-muted-foreground", children: [
|
|
446
|
+
item.details?.reasoning && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "whitespace-pre-wrap break-words leading-6", children: item.details.reasoning }),
|
|
447
|
+
item.details?.error && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "text-destructive", children: item.details.error }),
|
|
448
|
+
toolCall && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pre", { className: "overflow-x-auto rounded-md bg-muted/60 p-2 text-xs", children: JSON.stringify(toolCall.arguments, null, 2) }),
|
|
449
|
+
item.details?.result !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pre", { className: "overflow-x-auto rounded-md bg-muted/60 p-2 text-xs", children: JSON.stringify(item.details.result, null, 2) })
|
|
659
450
|
] });
|
|
660
451
|
});
|
|
661
452
|
var ActivitySkeleton = (0, import_react.memo)(function ActivitySkeleton2() {
|
|
662
|
-
return /* @__PURE__ */ (0,
|
|
663
|
-
/* @__PURE__ */ (0,
|
|
664
|
-
/* @__PURE__ */ (0,
|
|
665
|
-
/* @__PURE__ */ (0,
|
|
666
|
-
/* @__PURE__ */ (0,
|
|
453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: ROOT_CLASS, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex w-full min-w-0 items-center gap-3 rounded-md border border-border/50 bg-muted/20 px-3 py-2", children: [
|
|
454
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
455
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "inline-block h-2 w-2 animate-pulse rounded-full bg-primary/80" }),
|
|
456
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "inline-block h-2 w-2 animate-pulse rounded-full bg-primary/60 [animation-delay:120ms]" }),
|
|
457
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "inline-block h-2 w-2 animate-pulse rounded-full bg-primary/40 [animation-delay:240ms]" })
|
|
667
458
|
] }),
|
|
668
|
-
/* @__PURE__ */ (0,
|
|
459
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "h-3 w-28 animate-pulse rounded-full bg-muted" })
|
|
669
460
|
] }) });
|
|
670
461
|
});
|
|
671
|
-
var
|
|
462
|
+
var ActivityTimeline = (0, import_react.memo)(function ActivityTimeline2({
|
|
672
463
|
activity,
|
|
673
|
-
|
|
464
|
+
showActivityDetails,
|
|
674
465
|
labels
|
|
675
466
|
}) {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
const [open, setOpen] = (0, import_react.useState)(activity.isActive && hasDetails);
|
|
688
|
-
(0, import_react.useEffect)(() => {
|
|
689
|
-
if (activity.isActive && hasDetails) {
|
|
690
|
-
setOpen(true);
|
|
691
|
-
}
|
|
692
|
-
}, [activity.isActive, hasDetails]);
|
|
693
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
694
|
-
Collapsible,
|
|
695
|
-
{
|
|
696
|
-
open: hasDetails ? open : false,
|
|
697
|
-
onOpenChange: hasDetails ? setOpen : void 0,
|
|
698
|
-
className: ROOT_SPACING_CLASS,
|
|
699
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-2", children: [
|
|
700
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
701
|
-
ActivitySummaryRow,
|
|
467
|
+
const [openById, setOpenById] = (0, import_react.useState)({});
|
|
468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: ROOT_CLASS, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "space-y-1", children: activity.items.map((item, index) => {
|
|
469
|
+
const detailsAvailable = showActivityDetails && hasDetails(item);
|
|
470
|
+
const open = Boolean(openById[item.id]);
|
|
471
|
+
const isLast = index === activity.items.length - 1;
|
|
472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "relative grid grid-cols-[1rem_minmax(0,1fr)] gap-3", children: [
|
|
473
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "absolute left-2 top-5 h-[calc(100%-0.25rem)] w-px bg-border" }),
|
|
474
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "relative z-10 mt-1 flex h-4 w-4 items-center justify-center bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActivityIcon, { item }) }),
|
|
475
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "min-w-0", children: [
|
|
476
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
477
|
+
Button,
|
|
702
478
|
{
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
479
|
+
type: "button",
|
|
480
|
+
variant: "ghost",
|
|
481
|
+
disabled: !detailsAvailable,
|
|
482
|
+
onClick: () => setOpenById((prev) => ({ ...prev, [item.id]: !prev[item.id] })),
|
|
483
|
+
className: cn(
|
|
484
|
+
"h-auto min-h-6 w-full justify-start gap-1 px-0 py-0 text-left text-sm font-normal text-muted-foreground hover:bg-transparent",
|
|
485
|
+
item.status === "active" && "text-foreground",
|
|
486
|
+
!detailsAvailable && "pointer-events-none opacity-100"
|
|
487
|
+
),
|
|
488
|
+
children: [
|
|
489
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "min-w-0 truncate", children: resolveActivityLabel(item, labels) }),
|
|
490
|
+
detailsAvailable && (open ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.ChevronDown, { className: "h-3.5 w-3.5 shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.ChevronRight, { className: "h-3.5 w-3.5 shrink-0" }))
|
|
491
|
+
]
|
|
707
492
|
}
|
|
708
493
|
),
|
|
709
|
-
|
|
494
|
+
detailsAvailable && open && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActivityDetails, { item })
|
|
710
495
|
] })
|
|
496
|
+
] }, item.id);
|
|
497
|
+
}) }) });
|
|
498
|
+
});
|
|
499
|
+
var AssistantActivity = (0, import_react.memo)(function AssistantActivity2({
|
|
500
|
+
activity,
|
|
501
|
+
showActivity = true,
|
|
502
|
+
showActivityDetails = true,
|
|
503
|
+
labels
|
|
504
|
+
}) {
|
|
505
|
+
if (!activity || activity.items.length === 0) return null;
|
|
506
|
+
if (!showActivity) return hasActiveItem(activity) ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActivitySkeleton, {}) : null;
|
|
507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
508
|
+
ActivityTimeline,
|
|
509
|
+
{
|
|
510
|
+
activity,
|
|
511
|
+
showActivityDetails,
|
|
512
|
+
labels
|
|
711
513
|
}
|
|
712
514
|
);
|
|
713
515
|
});
|
|
714
516
|
|
|
517
|
+
// src/lib/chatUtils.ts
|
|
518
|
+
var AGENT_COLORS = [
|
|
519
|
+
"#6366f1",
|
|
520
|
+
// indigo
|
|
521
|
+
"#8b5cf6",
|
|
522
|
+
// violet
|
|
523
|
+
"#ec4899",
|
|
524
|
+
// pink
|
|
525
|
+
"#f59e0b",
|
|
526
|
+
// amber
|
|
527
|
+
"#10b981",
|
|
528
|
+
// emerald
|
|
529
|
+
"#3b82f6",
|
|
530
|
+
// blue
|
|
531
|
+
"#ef4444",
|
|
532
|
+
// red
|
|
533
|
+
"#14b8a6",
|
|
534
|
+
// teal
|
|
535
|
+
"#f97316",
|
|
536
|
+
// orange
|
|
537
|
+
"#84cc16"
|
|
538
|
+
// lime
|
|
539
|
+
];
|
|
540
|
+
function getAgentColor(agentId) {
|
|
541
|
+
let hash = 0;
|
|
542
|
+
for (let i = 0; i < agentId.length; i++) {
|
|
543
|
+
hash = (hash << 5) - hash + agentId.charCodeAt(i) | 0;
|
|
544
|
+
}
|
|
545
|
+
return AGENT_COLORS[Math.abs(hash) % AGENT_COLORS.length];
|
|
546
|
+
}
|
|
547
|
+
function getAgentInitials(name) {
|
|
548
|
+
const parts = name.trim().split(/\s+/);
|
|
549
|
+
if (parts.length >= 2) {
|
|
550
|
+
return (parts[0][0] + parts[1][0]).toUpperCase();
|
|
551
|
+
}
|
|
552
|
+
return name.slice(0, 2).toUpperCase();
|
|
553
|
+
}
|
|
554
|
+
function assignAgentColors(agents) {
|
|
555
|
+
return agents.map((agent) => ({
|
|
556
|
+
...agent,
|
|
557
|
+
color: agent.color || getAgentColor(agent.id)
|
|
558
|
+
}));
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
// src/components/ui/avatar.tsx
|
|
562
|
+
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"), 1);
|
|
563
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
564
|
+
function Avatar({
|
|
565
|
+
className,
|
|
566
|
+
...props
|
|
567
|
+
}) {
|
|
568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
569
|
+
AvatarPrimitive.Root,
|
|
570
|
+
{
|
|
571
|
+
"data-slot": "avatar",
|
|
572
|
+
className: cn(
|
|
573
|
+
"relative flex size-8 shrink-0 overflow-hidden rounded-full",
|
|
574
|
+
className
|
|
575
|
+
),
|
|
576
|
+
...props
|
|
577
|
+
}
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
function AvatarImage({
|
|
581
|
+
className,
|
|
582
|
+
...props
|
|
583
|
+
}) {
|
|
584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
585
|
+
AvatarPrimitive.Image,
|
|
586
|
+
{
|
|
587
|
+
"data-slot": "avatar-image",
|
|
588
|
+
className: cn("aspect-square size-full", className),
|
|
589
|
+
...props
|
|
590
|
+
}
|
|
591
|
+
);
|
|
592
|
+
}
|
|
593
|
+
function AvatarFallback({
|
|
594
|
+
className,
|
|
595
|
+
...props
|
|
596
|
+
}) {
|
|
597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
598
|
+
AvatarPrimitive.Fallback,
|
|
599
|
+
{
|
|
600
|
+
"data-slot": "avatar-fallback",
|
|
601
|
+
className: cn(
|
|
602
|
+
"bg-muted flex size-full items-center justify-center rounded-full",
|
|
603
|
+
className
|
|
604
|
+
),
|
|
605
|
+
...props
|
|
606
|
+
}
|
|
607
|
+
);
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
// src/components/chat/MessageSender.tsx
|
|
611
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
612
|
+
var resolveMessageSenderDisplay = ({
|
|
613
|
+
sender,
|
|
614
|
+
fallbackName,
|
|
615
|
+
fallbackAvatar,
|
|
616
|
+
fallbackAvatarUrl,
|
|
617
|
+
compactMode = false
|
|
618
|
+
}) => {
|
|
619
|
+
const name = sender?.name?.trim() || fallbackName;
|
|
620
|
+
const isAgentLike = sender?.type === "agent" || sender?.type === "tool";
|
|
621
|
+
const color = sender?.color || (isAgentLike && sender?.id ? getAgentColor(sender.id) : void 0);
|
|
622
|
+
const fallbackClassName = color ? `${compactMode ? "text-[10px]" : ""}` : sender?.type === "user" ? "bg-primary text-primary-foreground" : "bg-secondary text-secondary-foreground";
|
|
623
|
+
const fallbackContent = isAgentLike ? getAgentInitials(name) : name.charAt(0).toUpperCase();
|
|
624
|
+
const shouldUseFallbackAvatar = Boolean(
|
|
625
|
+
fallbackAvatar && (!sender || sender.id === "assistant" && !sender.avatarUrl)
|
|
626
|
+
);
|
|
627
|
+
return {
|
|
628
|
+
name,
|
|
629
|
+
color,
|
|
630
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
631
|
+
sender?.avatarUrl || fallbackAvatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AvatarImage, { src: sender?.avatarUrl || fallbackAvatarUrl, alt: name }) : null,
|
|
632
|
+
shouldUseFallbackAvatar ? fallbackAvatar : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
633
|
+
AvatarFallback,
|
|
634
|
+
{
|
|
635
|
+
className: fallbackClassName,
|
|
636
|
+
style: color ? { backgroundColor: color, color: "white" } : void 0,
|
|
637
|
+
children: fallbackContent
|
|
638
|
+
}
|
|
639
|
+
)
|
|
640
|
+
] })
|
|
641
|
+
};
|
|
642
|
+
};
|
|
643
|
+
var MessageSenderAvatar = ({
|
|
644
|
+
sender,
|
|
645
|
+
fallbackName,
|
|
646
|
+
fallbackAvatar,
|
|
647
|
+
fallbackAvatarUrl,
|
|
648
|
+
compactMode = false
|
|
649
|
+
}) => {
|
|
650
|
+
const display = resolveMessageSenderDisplay({
|
|
651
|
+
sender,
|
|
652
|
+
fallbackName,
|
|
653
|
+
fallbackAvatar,
|
|
654
|
+
fallbackAvatarUrl,
|
|
655
|
+
compactMode
|
|
656
|
+
});
|
|
657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Avatar, { className: compactMode ? "h-6 w-6" : "h-8 w-8", children: display.avatar });
|
|
658
|
+
};
|
|
659
|
+
|
|
715
660
|
// src/components/chat/Message.tsx
|
|
716
661
|
var import_lucide_react2 = require("lucide-react");
|
|
717
662
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
@@ -719,7 +664,7 @@ var hasRenderableAssistantBody = (message) => {
|
|
|
719
664
|
if (message.role !== "assistant") return true;
|
|
720
665
|
if (typeof message.content === "string" && message.content.trim().length > 0) return true;
|
|
721
666
|
if (Array.isArray(message.attachments) && message.attachments.length > 0) return true;
|
|
722
|
-
return Boolean(message.activity);
|
|
667
|
+
return Boolean(message.activity?.items.length);
|
|
723
668
|
};
|
|
724
669
|
var defaultMarkdownComponents = {
|
|
725
670
|
code: ({ node, className, children, ...props }) => {
|
|
@@ -912,7 +857,8 @@ var arePropsEqual = (prevProps, nextProps) => {
|
|
|
912
857
|
if (prevProps.enableCopy !== nextProps.enableCopy) return false;
|
|
913
858
|
if (prevProps.enableEdit !== nextProps.enableEdit) return false;
|
|
914
859
|
if (prevProps.enableRegenerate !== nextProps.enableRegenerate) return false;
|
|
915
|
-
if (prevProps.
|
|
860
|
+
if (prevProps.showActivity !== nextProps.showActivity) return false;
|
|
861
|
+
if (prevProps.showActivityDetails !== nextProps.showActivityDetails) return false;
|
|
916
862
|
if (prevProps.compactMode !== nextProps.compactMode) return false;
|
|
917
863
|
if (prevProps.className !== nextProps.className) return false;
|
|
918
864
|
if (prevProps.labels !== nextProps.labels) return false;
|
|
@@ -941,7 +887,8 @@ var Message = (0, import_react2.memo)(({
|
|
|
941
887
|
enableCopy = true,
|
|
942
888
|
enableEdit = true,
|
|
943
889
|
enableRegenerate = true,
|
|
944
|
-
|
|
890
|
+
showActivity = true,
|
|
891
|
+
showActivityDetails = true,
|
|
945
892
|
compactMode = false,
|
|
946
893
|
onAction,
|
|
947
894
|
className = "",
|
|
@@ -955,8 +902,7 @@ var Message = (0, import_react2.memo)(({
|
|
|
955
902
|
renderUserMarkdown = true,
|
|
956
903
|
markdown,
|
|
957
904
|
isExpanded = false,
|
|
958
|
-
onToggleExpanded
|
|
959
|
-
agentOptions = []
|
|
905
|
+
onToggleExpanded
|
|
960
906
|
}) => {
|
|
961
907
|
const [isEditing, setIsEditing] = (0, import_react2.useState)(false);
|
|
962
908
|
const [editContent, setEditContent] = (0, import_react2.useState)(message.content);
|
|
@@ -966,12 +912,13 @@ var Message = (0, import_react2.memo)(({
|
|
|
966
912
|
if (!hasRenderableAssistantBody(message)) {
|
|
967
913
|
return null;
|
|
968
914
|
}
|
|
969
|
-
const
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
915
|
+
const senderDisplay = resolveMessageSenderDisplay({
|
|
916
|
+
sender: message.sender,
|
|
917
|
+
fallbackName: messageIsUser ? userName : assistantName,
|
|
918
|
+
fallbackAvatar: messageIsUser ? void 0 : assistantAvatar,
|
|
919
|
+
fallbackAvatarUrl: messageIsUser ? userAvatar : void 0,
|
|
920
|
+
compactMode
|
|
921
|
+
});
|
|
975
922
|
const canEdit = enableEdit && messageIsUser;
|
|
976
923
|
const canRegenerate = enableRegenerate && !messageIsUser;
|
|
977
924
|
const normalizedPreviewChars = Math.max(longMessagePreviewChars, 1);
|
|
@@ -1027,27 +974,23 @@ var Message = (0, import_react2.memo)(({
|
|
|
1027
974
|
onMouseLeave: () => setShowActions(false),
|
|
1028
975
|
children: [
|
|
1029
976
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: `flex gap-3 ${messageIsUser ? "flex-row-reverse" : "flex-row"} w-full mb-1`, children: [
|
|
1030
|
-
showAvatar && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `flex-shrink-0 ${compactMode ? "mt-1" : "mt-0"}`, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
children: getAgentInitials(agentSender.name)
|
|
1041
|
-
}
|
|
1042
|
-
)
|
|
1043
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: assistantAvatar || /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AvatarFallback, { className: "bg-secondary text-secondary-foreground", children: "AI" }) }) }) }),
|
|
977
|
+
showAvatar && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `flex-shrink-0 ${compactMode ? "mt-1" : "mt-0"}`, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
978
|
+
MessageSenderAvatar,
|
|
979
|
+
{
|
|
980
|
+
sender: message.sender,
|
|
981
|
+
fallbackName: messageIsUser ? userName : assistantName,
|
|
982
|
+
fallbackAvatar: messageIsUser ? void 0 : assistantAvatar,
|
|
983
|
+
fallbackAvatarUrl: messageIsUser ? userAvatar : void 0,
|
|
984
|
+
compactMode
|
|
985
|
+
}
|
|
986
|
+
) }),
|
|
1044
987
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: `flex items-center gap-2 mb-1 ${messageIsUser ? "flex-row-reverse" : "flex-row"}`, children: [
|
|
1045
988
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1046
989
|
"span",
|
|
1047
990
|
{
|
|
1048
991
|
className: `font-medium ${compactMode ? "text-sm" : "text-base"}`,
|
|
1049
|
-
style: !messageIsUser &&
|
|
1050
|
-
children:
|
|
992
|
+
style: !messageIsUser && senderDisplay.color ? { color: senderDisplay.color } : void 0,
|
|
993
|
+
children: senderDisplay.name
|
|
1051
994
|
}
|
|
1052
995
|
),
|
|
1053
996
|
showTimestamp && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-xs text-muted-foreground", children: formatTime(message.timestamp) }),
|
|
@@ -1080,7 +1023,8 @@ var Message = (0, import_react2.memo)(({
|
|
|
1080
1023
|
AssistantActivity,
|
|
1081
1024
|
{
|
|
1082
1025
|
activity: message.activity,
|
|
1083
|
-
|
|
1026
|
+
showActivity,
|
|
1027
|
+
showActivityDetails,
|
|
1084
1028
|
labels
|
|
1085
1029
|
}
|
|
1086
1030
|
),
|
|
@@ -2664,12 +2608,53 @@ var Sidebar2 = ({
|
|
|
2664
2608
|
|
|
2665
2609
|
// src/components/chat/ChatHeader.tsx
|
|
2666
2610
|
var import_react6 = __toESM(require("react"), 1);
|
|
2611
|
+
|
|
2612
|
+
// src/components/ui/card.tsx
|
|
2613
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2614
|
+
function Card({ className, ...props }) {
|
|
2615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2616
|
+
"div",
|
|
2617
|
+
{
|
|
2618
|
+
"data-slot": "card",
|
|
2619
|
+
className: cn(
|
|
2620
|
+
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
2621
|
+
className
|
|
2622
|
+
),
|
|
2623
|
+
...props
|
|
2624
|
+
}
|
|
2625
|
+
);
|
|
2626
|
+
}
|
|
2627
|
+
function CardHeader({ className, ...props }) {
|
|
2628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2629
|
+
"div",
|
|
2630
|
+
{
|
|
2631
|
+
"data-slot": "card-header",
|
|
2632
|
+
className: cn(
|
|
2633
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
2634
|
+
className
|
|
2635
|
+
),
|
|
2636
|
+
...props
|
|
2637
|
+
}
|
|
2638
|
+
);
|
|
2639
|
+
}
|
|
2640
|
+
function CardContent({ className, ...props }) {
|
|
2641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2642
|
+
"div",
|
|
2643
|
+
{
|
|
2644
|
+
"data-slot": "card-content",
|
|
2645
|
+
className: cn("px-6", className),
|
|
2646
|
+
...props
|
|
2647
|
+
}
|
|
2648
|
+
);
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
// src/components/chat/ChatHeader.tsx
|
|
2667
2652
|
var import_lucide_react10 = require("lucide-react");
|
|
2668
2653
|
|
|
2669
2654
|
// src/components/chat/AgentSelectors.tsx
|
|
2670
2655
|
var import_react5 = require("react");
|
|
2671
2656
|
var import_lucide_react9 = require("lucide-react");
|
|
2672
|
-
var
|
|
2657
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2673
2658
|
var ParticipantsSelector = (0, import_react5.memo)(({
|
|
2674
2659
|
agents,
|
|
2675
2660
|
participantIds,
|
|
@@ -2697,19 +2682,19 @@ var ParticipantsSelector = (0, import_react5.memo)(({
|
|
|
2697
2682
|
};
|
|
2698
2683
|
const visibleAgents = selectedAgents.slice(0, maxVisible);
|
|
2699
2684
|
const hiddenCount = selectedAgents.length - maxVisible;
|
|
2700
|
-
return /* @__PURE__ */ (0,
|
|
2701
|
-
/* @__PURE__ */ (0,
|
|
2685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DropdownMenu, { children: [
|
|
2686
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2702
2687
|
Button,
|
|
2703
2688
|
{
|
|
2704
2689
|
variant: "ghost",
|
|
2705
2690
|
className: "h-9 px-2 gap-1.5 text-sm hover:bg-accent/50",
|
|
2706
2691
|
disabled,
|
|
2707
2692
|
children: [
|
|
2708
|
-
/* @__PURE__ */ (0,
|
|
2709
|
-
/* @__PURE__ */ (0,
|
|
2710
|
-
/* @__PURE__ */ (0,
|
|
2711
|
-
/* @__PURE__ */ (0,
|
|
2712
|
-
/* @__PURE__ */ (0,
|
|
2693
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.Users, { className: "h-4 w-4 text-muted-foreground" }),
|
|
2694
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex items-center gap-1", children: visibleAgents.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2695
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex -space-x-1.5", children: visibleAgents.map((agent) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Avatar, { className: "h-5 w-5 border-2 border-background", children: [
|
|
2696
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AvatarImage, { src: agent.avatarUrl, alt: agent.name }),
|
|
2697
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2713
2698
|
AvatarFallback,
|
|
2714
2699
|
{
|
|
2715
2700
|
style: { backgroundColor: agent.color || getAgentColor(agent.id), color: "white" },
|
|
@@ -2718,34 +2703,34 @@ var ParticipantsSelector = (0, import_react5.memo)(({
|
|
|
2718
2703
|
}
|
|
2719
2704
|
)
|
|
2720
2705
|
] }, agent.id)) }),
|
|
2721
|
-
hiddenCount > 0 && /* @__PURE__ */ (0,
|
|
2706
|
+
hiddenCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "text-xs text-muted-foreground", children: [
|
|
2722
2707
|
"+",
|
|
2723
2708
|
hiddenCount
|
|
2724
2709
|
] })
|
|
2725
|
-
] }) : /* @__PURE__ */ (0,
|
|
2726
|
-
/* @__PURE__ */ (0,
|
|
2710
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-muted-foreground", children: label }) }),
|
|
2711
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.ChevronDown, { className: "h-3 w-3 opacity-50" })
|
|
2727
2712
|
]
|
|
2728
2713
|
}
|
|
2729
2714
|
) }),
|
|
2730
|
-
/* @__PURE__ */ (0,
|
|
2731
|
-
/* @__PURE__ */ (0,
|
|
2732
|
-
/* @__PURE__ */ (0,
|
|
2733
|
-
selectedAgents.length < agentsWithColors.length && /* @__PURE__ */ (0,
|
|
2715
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DropdownMenuContent, { align: "start", className: "w-[260px]", children: [
|
|
2716
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DropdownMenuLabel, { className: "flex items-center justify-between", children: [
|
|
2717
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "Participants" }),
|
|
2718
|
+
selectedAgents.length < agentsWithColors.length && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Button, { variant: "ghost", size: "sm", className: "h-6 text-xs", onClick: selectAll, children: "Select All" })
|
|
2734
2719
|
] }),
|
|
2735
|
-
/* @__PURE__ */ (0,
|
|
2720
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownMenuSeparator, {}),
|
|
2736
2721
|
agentsWithColors.map((agent) => {
|
|
2737
2722
|
const isSelected = participantIds.includes(agent.id);
|
|
2738
2723
|
const isLastSelected = isSelected && participantIds.length === 1;
|
|
2739
|
-
return /* @__PURE__ */ (0,
|
|
2724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2740
2725
|
DropdownMenuItem,
|
|
2741
2726
|
{
|
|
2742
2727
|
onClick: () => toggleParticipant(agent.id),
|
|
2743
2728
|
className: "flex items-center gap-3 p-2 cursor-pointer",
|
|
2744
2729
|
disabled: isLastSelected,
|
|
2745
2730
|
children: [
|
|
2746
|
-
/* @__PURE__ */ (0,
|
|
2747
|
-
/* @__PURE__ */ (0,
|
|
2748
|
-
/* @__PURE__ */ (0,
|
|
2731
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Avatar, { className: "h-6 w-6", children: [
|
|
2732
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AvatarImage, { src: agent.avatarUrl, alt: agent.name }),
|
|
2733
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2749
2734
|
AvatarFallback,
|
|
2750
2735
|
{
|
|
2751
2736
|
style: { backgroundColor: agent.color || getAgentColor(agent.id), color: "white" },
|
|
@@ -2754,11 +2739,11 @@ var ParticipantsSelector = (0, import_react5.memo)(({
|
|
|
2754
2739
|
}
|
|
2755
2740
|
)
|
|
2756
2741
|
] }),
|
|
2757
|
-
/* @__PURE__ */ (0,
|
|
2758
|
-
/* @__PURE__ */ (0,
|
|
2759
|
-
agent.description && /* @__PURE__ */ (0,
|
|
2742
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
2743
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "font-medium text-sm truncate", children: agent.name }),
|
|
2744
|
+
agent.description && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "text-xs text-muted-foreground truncate", children: agent.description })
|
|
2760
2745
|
] }),
|
|
2761
|
-
isSelected && /* @__PURE__ */ (0,
|
|
2746
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.Check, { className: "h-4 w-4 text-primary shrink-0" })
|
|
2762
2747
|
]
|
|
2763
2748
|
},
|
|
2764
2749
|
agent.id
|
|
@@ -2781,19 +2766,19 @@ var TargetAgentSelector = (0, import_react5.memo)(({
|
|
|
2781
2766
|
() => agentsWithColors.find((a) => a.id === targetAgentId),
|
|
2782
2767
|
[agentsWithColors, targetAgentId]
|
|
2783
2768
|
);
|
|
2784
|
-
return /* @__PURE__ */ (0,
|
|
2785
|
-
/* @__PURE__ */ (0,
|
|
2769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DropdownMenu, { children: [
|
|
2770
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2786
2771
|
Button,
|
|
2787
2772
|
{
|
|
2788
2773
|
variant: "ghost",
|
|
2789
2774
|
className: "h-9 px-3 gap-1.5 font-medium text-base hover:bg-accent/50",
|
|
2790
2775
|
disabled,
|
|
2791
2776
|
children: [
|
|
2792
|
-
/* @__PURE__ */ (0,
|
|
2793
|
-
selectedAgent ? /* @__PURE__ */ (0,
|
|
2794
|
-
/* @__PURE__ */ (0,
|
|
2795
|
-
/* @__PURE__ */ (0,
|
|
2796
|
-
/* @__PURE__ */ (0,
|
|
2777
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.AtSign, { className: "h-4 w-4 text-muted-foreground" }),
|
|
2778
|
+
selectedAgent ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2779
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Avatar, { className: "h-5 w-5", children: [
|
|
2780
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AvatarImage, { src: selectedAgent.avatarUrl, alt: selectedAgent.name }),
|
|
2781
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2797
2782
|
AvatarFallback,
|
|
2798
2783
|
{
|
|
2799
2784
|
style: { backgroundColor: selectedAgent.color || getAgentColor(selectedAgent.id), color: "white" },
|
|
@@ -2802,26 +2787,26 @@ var TargetAgentSelector = (0, import_react5.memo)(({
|
|
|
2802
2787
|
}
|
|
2803
2788
|
)
|
|
2804
2789
|
] }),
|
|
2805
|
-
/* @__PURE__ */ (0,
|
|
2806
|
-
] }) : /* @__PURE__ */ (0,
|
|
2807
|
-
/* @__PURE__ */ (0,
|
|
2790
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "max-w-[150px] truncate", children: selectedAgent.name })
|
|
2791
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-muted-foreground", children: placeholder }),
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.ChevronDown, { className: "h-4 w-4 opacity-50" })
|
|
2808
2793
|
]
|
|
2809
2794
|
}
|
|
2810
2795
|
) }),
|
|
2811
|
-
/* @__PURE__ */ (0,
|
|
2812
|
-
/* @__PURE__ */ (0,
|
|
2813
|
-
/* @__PURE__ */ (0,
|
|
2796
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DropdownMenuContent, { align: "start", className: "w-[280px]", children: [
|
|
2797
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownMenuLabel, { children: label }),
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownMenuSeparator, {}),
|
|
2814
2799
|
agentsWithColors.map((agent) => {
|
|
2815
2800
|
const isSelected = agent.id === targetAgentId;
|
|
2816
|
-
return /* @__PURE__ */ (0,
|
|
2801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2817
2802
|
DropdownMenuItem,
|
|
2818
2803
|
{
|
|
2819
2804
|
onClick: () => onTargetChange(agent.id),
|
|
2820
2805
|
className: "flex items-start gap-3 p-3 cursor-pointer",
|
|
2821
2806
|
children: [
|
|
2822
|
-
/* @__PURE__ */ (0,
|
|
2823
|
-
/* @__PURE__ */ (0,
|
|
2824
|
-
/* @__PURE__ */ (0,
|
|
2807
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Avatar, { className: "h-6 w-6 mt-0.5 shrink-0", children: [
|
|
2808
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AvatarImage, { src: agent.avatarUrl, alt: agent.name }),
|
|
2809
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2825
2810
|
AvatarFallback,
|
|
2826
2811
|
{
|
|
2827
2812
|
style: { backgroundColor: agent.color || getAgentColor(agent.id), color: "white" },
|
|
@@ -2830,12 +2815,12 @@ var TargetAgentSelector = (0, import_react5.memo)(({
|
|
|
2830
2815
|
}
|
|
2831
2816
|
)
|
|
2832
2817
|
] }),
|
|
2833
|
-
/* @__PURE__ */ (0,
|
|
2834
|
-
/* @__PURE__ */ (0,
|
|
2835
|
-
/* @__PURE__ */ (0,
|
|
2836
|
-
isSelected && /* @__PURE__ */ (0,
|
|
2818
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
2819
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2820
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "font-medium text-sm", children: agent.name }),
|
|
2821
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.Check, { className: "h-4 w-4 text-primary shrink-0" })
|
|
2837
2822
|
] }),
|
|
2838
|
-
agent.description && /* @__PURE__ */ (0,
|
|
2823
|
+
agent.description && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-xs text-muted-foreground mt-0.5 line-clamp-2", children: agent.description })
|
|
2839
2824
|
] })
|
|
2840
2825
|
]
|
|
2841
2826
|
},
|
|
@@ -2855,16 +2840,16 @@ var AgentBadge = (0, import_react5.memo)(({
|
|
|
2855
2840
|
const color = agent.color || getAgentColor(agent.id);
|
|
2856
2841
|
const avatarSize = size === "sm" ? "h-4 w-4" : "h-5 w-5";
|
|
2857
2842
|
const textSize = size === "sm" ? "text-xs" : "text-sm";
|
|
2858
|
-
return /* @__PURE__ */ (0,
|
|
2843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2859
2844
|
Badge,
|
|
2860
2845
|
{
|
|
2861
2846
|
variant: "secondary",
|
|
2862
2847
|
className: "flex items-center gap-1.5 pr-1",
|
|
2863
2848
|
style: { borderColor: color, borderWidth: 1 },
|
|
2864
2849
|
children: [
|
|
2865
|
-
/* @__PURE__ */ (0,
|
|
2866
|
-
/* @__PURE__ */ (0,
|
|
2867
|
-
/* @__PURE__ */ (0,
|
|
2850
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Avatar, { className: avatarSize, children: [
|
|
2851
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AvatarImage, { src: agent.avatarUrl, alt: agent.name }),
|
|
2852
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2868
2853
|
AvatarFallback,
|
|
2869
2854
|
{
|
|
2870
2855
|
style: { backgroundColor: color, color: "white" },
|
|
@@ -2873,8 +2858,8 @@ var AgentBadge = (0, import_react5.memo)(({
|
|
|
2873
2858
|
}
|
|
2874
2859
|
)
|
|
2875
2860
|
] }),
|
|
2876
|
-
/* @__PURE__ */ (0,
|
|
2877
|
-
showRemove && onRemove && /* @__PURE__ */ (0,
|
|
2861
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: textSize, children: agent.name }),
|
|
2862
|
+
showRemove && onRemove && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2878
2863
|
Button,
|
|
2879
2864
|
{
|
|
2880
2865
|
variant: "ghost",
|
|
@@ -2884,7 +2869,7 @@ var AgentBadge = (0, import_react5.memo)(({
|
|
|
2884
2869
|
e.stopPropagation();
|
|
2885
2870
|
onRemove();
|
|
2886
2871
|
},
|
|
2887
|
-
children: /* @__PURE__ */ (0,
|
|
2872
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
|
|
2888
2873
|
}
|
|
2889
2874
|
)
|
|
2890
2875
|
]
|
|
@@ -2894,7 +2879,7 @@ var AgentBadge = (0, import_react5.memo)(({
|
|
|
2894
2879
|
AgentBadge.displayName = "AgentBadge";
|
|
2895
2880
|
|
|
2896
2881
|
// src/components/chat/ChatHeader.tsx
|
|
2897
|
-
var
|
|
2882
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2898
2883
|
var ChatHeader = ({
|
|
2899
2884
|
config,
|
|
2900
2885
|
currentThreadTitle,
|
|
@@ -2965,19 +2950,19 @@ var ChatHeader = ({
|
|
|
2965
2950
|
};
|
|
2966
2951
|
const selectedAgent = agentOptions.find((agent) => agent.id === selectedAgentId) || null;
|
|
2967
2952
|
const agentPlaceholder = config.agentSelector?.label || "Select agent";
|
|
2968
|
-
return /* @__PURE__ */ (0,
|
|
2953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2969
2954
|
Card,
|
|
2970
2955
|
{
|
|
2971
2956
|
"data-chat-header": true,
|
|
2972
2957
|
className: `py-0 border-b rounded-none relative z-10 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80 ${className}`,
|
|
2973
2958
|
style: isMobile ? { paddingTop: "env(safe-area-inset-top)" } : void 0,
|
|
2974
|
-
children: /* @__PURE__ */ (0,
|
|
2975
|
-
/* @__PURE__ */ (0,
|
|
2976
|
-
/* @__PURE__ */ (0,
|
|
2977
|
-
/* @__PURE__ */ (0,
|
|
2978
|
-
/* @__PURE__ */ (0,
|
|
2959
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardHeader, { className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2960
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
2962
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SidebarTrigger, { className: "-ml-1" }) }),
|
|
2963
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { children: config.labels?.sidebarToggle || "Toggle Sidebar" })
|
|
2979
2964
|
] }),
|
|
2980
|
-
showAgentSelector && isMultiAgentMode && onParticipantsChange && /* @__PURE__ */ (0,
|
|
2965
|
+
showAgentSelector && isMultiAgentMode && onParticipantsChange && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2981
2966
|
ParticipantsSelector,
|
|
2982
2967
|
{
|
|
2983
2968
|
agents: agentOptions,
|
|
@@ -2985,40 +2970,40 @@ var ChatHeader = ({
|
|
|
2985
2970
|
onParticipantsChange
|
|
2986
2971
|
}
|
|
2987
2972
|
),
|
|
2988
|
-
showAgentSelector && !isMultiAgentMode && /* @__PURE__ */ (0,
|
|
2989
|
-
/* @__PURE__ */ (0,
|
|
2973
|
+
showAgentSelector && !isMultiAgentMode && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenu, { children: [
|
|
2974
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2990
2975
|
Button,
|
|
2991
2976
|
{
|
|
2992
2977
|
variant: "ghost",
|
|
2993
2978
|
className: "h-9 px-3 gap-1.5 font-medium text-base hover:bg-accent/50",
|
|
2994
2979
|
children: [
|
|
2995
|
-
selectedAgent?.avatarUrl ? /* @__PURE__ */ (0,
|
|
2996
|
-
/* @__PURE__ */ (0,
|
|
2997
|
-
/* @__PURE__ */ (0,
|
|
2980
|
+
selectedAgent?.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Avatar, { className: "h-5 w-5", children: [
|
|
2981
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(AvatarImage, { src: selectedAgent.avatarUrl, alt: selectedAgent.name }),
|
|
2982
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(AvatarFallback, { className: "text-[10px]", children: selectedAgent.name.charAt(0).toUpperCase() })
|
|
2998
2983
|
] }) : null,
|
|
2999
|
-
/* @__PURE__ */ (0,
|
|
3000
|
-
/* @__PURE__ */ (0,
|
|
2984
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "max-w-[200px] truncate", children: selectedAgent?.name || agentPlaceholder }),
|
|
2985
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react10.ChevronDown, { className: "h-4 w-4 opacity-50" })
|
|
3001
2986
|
]
|
|
3002
2987
|
}
|
|
3003
2988
|
) }),
|
|
3004
|
-
/* @__PURE__ */ (0,
|
|
2989
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuContent, { align: "start", className: "w-[280px]", children: agentOptions.map((agent) => {
|
|
3005
2990
|
const isSelected = agent.id === selectedAgentId;
|
|
3006
|
-
return /* @__PURE__ */ (0,
|
|
2991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3007
2992
|
DropdownMenuItem,
|
|
3008
2993
|
{
|
|
3009
2994
|
onClick: () => onSelectAgent?.(agent.id),
|
|
3010
2995
|
className: "flex items-start gap-3 p-3 cursor-pointer",
|
|
3011
2996
|
children: [
|
|
3012
|
-
agent.avatarUrl ? /* @__PURE__ */ (0,
|
|
3013
|
-
/* @__PURE__ */ (0,
|
|
3014
|
-
/* @__PURE__ */ (0,
|
|
3015
|
-
] }) : /* @__PURE__ */ (0,
|
|
3016
|
-
/* @__PURE__ */ (0,
|
|
3017
|
-
/* @__PURE__ */ (0,
|
|
3018
|
-
/* @__PURE__ */ (0,
|
|
3019
|
-
isSelected && /* @__PURE__ */ (0,
|
|
2997
|
+
agent.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Avatar, { className: "h-6 w-6 mt-0.5 shrink-0", children: [
|
|
2998
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(AvatarImage, { src: agent.avatarUrl, alt: agent.name }),
|
|
2999
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(AvatarFallback, { className: "text-[10px]", children: agent.name.charAt(0).toUpperCase() })
|
|
3000
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "h-6 w-6 mt-0.5 shrink-0 flex items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react10.Bot, { className: "h-3.5 w-3.5 text-primary" }) }),
|
|
3001
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3002
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3003
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "font-medium text-sm", children: agent.name }),
|
|
3004
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react10.Check, { className: "h-4 w-4 text-primary shrink-0" })
|
|
3020
3005
|
] }),
|
|
3021
|
-
agent.description && /* @__PURE__ */ (0,
|
|
3006
|
+
agent.description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xs text-muted-foreground mt-0.5 line-clamp-2", children: agent.description })
|
|
3022
3007
|
] })
|
|
3023
3008
|
]
|
|
3024
3009
|
},
|
|
@@ -3026,59 +3011,59 @@ var ChatHeader = ({
|
|
|
3026
3011
|
);
|
|
3027
3012
|
}) })
|
|
3028
3013
|
] }),
|
|
3029
|
-
!showAgentSelector && isMobile && /* @__PURE__ */ (0,
|
|
3014
|
+
!showAgentSelector && isMobile && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-sm font-medium truncate max-w-[150px] ml-2", children: currentThreadTitle || config.branding?.title || "Chat" })
|
|
3030
3015
|
] }),
|
|
3031
|
-
/* @__PURE__ */ (0,
|
|
3032
|
-
/* @__PURE__ */ (0,
|
|
3033
|
-
showCustomComponentButton && config.customComponent && /* @__PURE__ */ (0,
|
|
3034
|
-
/* @__PURE__ */ (0,
|
|
3016
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex-1" }),
|
|
3017
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
3018
|
+
showCustomComponentButton && config.customComponent && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
3019
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3035
3020
|
Button,
|
|
3036
3021
|
{
|
|
3037
3022
|
variant: "ghost",
|
|
3038
3023
|
size: "icon",
|
|
3039
3024
|
className: "h-8 w-8",
|
|
3040
3025
|
onClick: onCustomComponentToggle,
|
|
3041
|
-
children: config.customComponent.icon || /* @__PURE__ */ (0,
|
|
3026
|
+
children: config.customComponent.icon || /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react10.Menu, { className: "h-4 w-4" })
|
|
3042
3027
|
}
|
|
3043
3028
|
) }),
|
|
3044
|
-
/* @__PURE__ */ (0,
|
|
3029
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { children: config.customComponent.label || config.labels?.customComponentToggle || "Toggle" })
|
|
3045
3030
|
] }),
|
|
3046
3031
|
config.headerActions,
|
|
3047
|
-
/* @__PURE__ */ (0,
|
|
3048
|
-
/* @__PURE__ */ (0,
|
|
3049
|
-
/* @__PURE__ */ (0,
|
|
3050
|
-
onNewThread && /* @__PURE__ */ (0,
|
|
3051
|
-
/* @__PURE__ */ (0,
|
|
3052
|
-
/* @__PURE__ */ (0,
|
|
3032
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenu, { children: [
|
|
3033
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react10.MoreVertical, { className: "h-4 w-4" }) }) }),
|
|
3034
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenuContent, { align: "end", children: [
|
|
3035
|
+
onNewThread && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
3036
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenuItem, { onClick: () => onNewThread?.(), className: "font-medium text-primary", children: [
|
|
3037
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react10.Plus, { className: "h-4 w-4 mr-2" }),
|
|
3053
3038
|
config.labels?.newThread || "New Thread"
|
|
3054
3039
|
] }),
|
|
3055
|
-
/* @__PURE__ */ (0,
|
|
3040
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuSeparator, {})
|
|
3056
3041
|
] }),
|
|
3057
|
-
onExportData && /* @__PURE__ */ (0,
|
|
3058
|
-
/* @__PURE__ */ (0,
|
|
3042
|
+
onExportData && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenuItem, { onClick: onExportData, children: [
|
|
3043
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react10.Download, { className: "h-4 w-4 mr-2" }),
|
|
3059
3044
|
config.labels?.exportData || "Export Data"
|
|
3060
3045
|
] }),
|
|
3061
|
-
onImportData && /* @__PURE__ */ (0,
|
|
3062
|
-
/* @__PURE__ */ (0,
|
|
3046
|
+
onImportData && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenuItem, { onClick: handleImportClick, children: [
|
|
3047
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react10.Upload, { className: "h-4 w-4 mr-2" }),
|
|
3063
3048
|
config.labels?.importData || "Import Data"
|
|
3064
3049
|
] }),
|
|
3065
|
-
(onExportData || onImportData) && /* @__PURE__ */ (0,
|
|
3066
|
-
/* @__PURE__ */ (0,
|
|
3067
|
-
/* @__PURE__ */ (0,
|
|
3050
|
+
(onExportData || onImportData) && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuSeparator, {}),
|
|
3051
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuItem, { onClick: toggleDarkMode, children: isDarkMode ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
3052
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react10.Sun, { className: "h-4 w-4 mr-2" }),
|
|
3068
3053
|
config.labels?.lightMode || "Light Mode"
|
|
3069
|
-
] }) : /* @__PURE__ */ (0,
|
|
3070
|
-
/* @__PURE__ */ (0,
|
|
3054
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
3055
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react10.Moon, { className: "h-4 w-4 mr-2" }),
|
|
3071
3056
|
config.labels?.darkMode || "Dark Mode"
|
|
3072
3057
|
] }) }),
|
|
3073
|
-
onClearAll && /* @__PURE__ */ (0,
|
|
3074
|
-
/* @__PURE__ */ (0,
|
|
3075
|
-
/* @__PURE__ */ (0,
|
|
3058
|
+
onClearAll && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
3059
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuSeparator, {}),
|
|
3060
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3076
3061
|
DropdownMenuItem,
|
|
3077
3062
|
{
|
|
3078
3063
|
onClick: onClearAll,
|
|
3079
3064
|
className: "text-destructive",
|
|
3080
3065
|
children: [
|
|
3081
|
-
/* @__PURE__ */ (0,
|
|
3066
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react10.Trash2, { className: "h-4 w-4 mr-2" }),
|
|
3082
3067
|
config.labels?.clearAll || "Clear All"
|
|
3083
3068
|
]
|
|
3084
3069
|
}
|
|
@@ -3097,7 +3082,7 @@ var import_react8 = __toESM(require("react"), 1);
|
|
|
3097
3082
|
|
|
3098
3083
|
// src/components/chat/UserContext.tsx
|
|
3099
3084
|
var import_react7 = require("react");
|
|
3100
|
-
var
|
|
3085
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3101
3086
|
var Ctx = (0, import_react7.createContext)(void 0);
|
|
3102
3087
|
var ChatUserContextProvider = ({ children, initial }) => {
|
|
3103
3088
|
const [ctx, setCtx] = (0, import_react7.useState)(() => ({
|
|
@@ -3124,7 +3109,7 @@ var ChatUserContextProvider = ({ children, initial }) => {
|
|
|
3124
3109
|
setContext: setPartial,
|
|
3125
3110
|
resetContext: () => setCtx({ updatedAt: Date.now() })
|
|
3126
3111
|
}), [ctx, setPartial]);
|
|
3127
|
-
return /* @__PURE__ */ (0,
|
|
3112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Ctx.Provider, { value, children });
|
|
3128
3113
|
};
|
|
3129
3114
|
function useChatUserContext() {
|
|
3130
3115
|
const v = (0, import_react7.useContext)(Ctx);
|
|
@@ -3458,13 +3443,13 @@ var resolveVoiceProviderFactory = (createProvider) => createProvider ?? createMa
|
|
|
3458
3443
|
|
|
3459
3444
|
// src/components/ui/progress.tsx
|
|
3460
3445
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"), 1);
|
|
3461
|
-
var
|
|
3446
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3462
3447
|
function Progress({
|
|
3463
3448
|
className,
|
|
3464
3449
|
value,
|
|
3465
3450
|
...props
|
|
3466
3451
|
}) {
|
|
3467
|
-
return /* @__PURE__ */ (0,
|
|
3452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3468
3453
|
ProgressPrimitive.Root,
|
|
3469
3454
|
{
|
|
3470
3455
|
"data-slot": "progress",
|
|
@@ -3473,7 +3458,7 @@ function Progress({
|
|
|
3473
3458
|
className
|
|
3474
3459
|
),
|
|
3475
3460
|
...props,
|
|
3476
|
-
children: /* @__PURE__ */ (0,
|
|
3461
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3477
3462
|
ProgressPrimitive.Indicator,
|
|
3478
3463
|
{
|
|
3479
3464
|
"data-slot": "progress-indicator",
|
|
@@ -3487,7 +3472,7 @@ function Progress({
|
|
|
3487
3472
|
|
|
3488
3473
|
// src/components/chat/VoiceComposer.tsx
|
|
3489
3474
|
var import_lucide_react11 = require("lucide-react");
|
|
3490
|
-
var
|
|
3475
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3491
3476
|
var formatDuration = (durationMs) => {
|
|
3492
3477
|
const totalSeconds = Math.max(0, Math.floor(durationMs / 1e3));
|
|
3493
3478
|
const minutes = Math.floor(totalSeconds / 60);
|
|
@@ -3582,13 +3567,13 @@ var VoiceComposer = ({
|
|
|
3582
3567
|
}
|
|
3583
3568
|
onRecordAgain();
|
|
3584
3569
|
};
|
|
3585
|
-
return /* @__PURE__ */ (0,
|
|
3586
|
-
/* @__PURE__ */ (0,
|
|
3587
|
-
/* @__PURE__ */ (0,
|
|
3588
|
-
/* @__PURE__ */ (0,
|
|
3589
|
-
/* @__PURE__ */ (0,
|
|
3570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "w-full max-w-3xl rounded-2xl border bg-background p-3 shadow-sm sm:p-4 md:min-w-3xl", children: [
|
|
3571
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center justify-between gap-2 sm:gap-3", children: [
|
|
3572
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
3573
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Badge, { variant: "outline", children: labels?.voiceTitle || "Voice" }),
|
|
3574
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "truncate rounded-full bg-muted px-2.5 py-1 text-[11px] sm:text-xs text-muted-foreground", children: headerLabel })
|
|
3590
3575
|
] }),
|
|
3591
|
-
/* @__PURE__ */ (0,
|
|
3576
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3592
3577
|
Button,
|
|
3593
3578
|
{
|
|
3594
3579
|
type: "button",
|
|
@@ -3598,14 +3583,14 @@ var VoiceComposer = ({
|
|
|
3598
3583
|
onClick: onExit,
|
|
3599
3584
|
disabled: disabled || isBusy,
|
|
3600
3585
|
children: [
|
|
3601
|
-
/* @__PURE__ */ (0,
|
|
3602
|
-
/* @__PURE__ */ (0,
|
|
3586
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Keyboard, { className: "h-4 w-4" }),
|
|
3587
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "hidden sm:inline", children: labels?.voiceExit || "Use keyboard" })
|
|
3603
3588
|
]
|
|
3604
3589
|
}
|
|
3605
3590
|
)
|
|
3606
3591
|
] }),
|
|
3607
|
-
!isDraftLayout ? /* @__PURE__ */ (0,
|
|
3608
|
-
/* @__PURE__ */ (0,
|
|
3592
|
+
!isDraftLayout ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "mt-3 rounded-xl border border-dashed border-primary/30 bg-primary/5 px-3 py-3 text-center sm:px-4 sm:py-4", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "mx-auto flex w-full max-w-sm flex-col items-center gap-3", children: [
|
|
3593
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3609
3594
|
Button,
|
|
3610
3595
|
{
|
|
3611
3596
|
type: "button",
|
|
@@ -3614,21 +3599,21 @@ var VoiceComposer = ({
|
|
|
3614
3599
|
className: `h-16 w-16 rounded-full sm:h-20 sm:w-20 ${isCapturing ? "bg-red-500 hover:bg-red-600 text-white border-red-500" : "border-red-200 bg-red-50 text-red-600 hover:bg-red-100 hover:text-red-700"}`,
|
|
3615
3600
|
onClick: isCapturing ? onStop : onStart,
|
|
3616
3601
|
disabled: disabled || isBusy,
|
|
3617
|
-
children: isBusy ? /* @__PURE__ */ (0,
|
|
3602
|
+
children: isBusy ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Loader2, { className: "h-7 w-7 animate-spin" }) : isCapturing ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Square, { className: "h-7 w-7" }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Mic, { className: "h-7 w-7" })
|
|
3618
3603
|
}
|
|
3619
3604
|
),
|
|
3620
|
-
/* @__PURE__ */ (0,
|
|
3621
|
-
/* @__PURE__ */ (0,
|
|
3622
|
-
/* @__PURE__ */ (0,
|
|
3623
|
-
/* @__PURE__ */ (0,
|
|
3624
|
-
/* @__PURE__ */ (0,
|
|
3605
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "w-full space-y-2", children: [
|
|
3606
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Progress, { value: levelValue, className: "h-2" }),
|
|
3607
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
|
|
3608
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: formatDuration(durationMs) }),
|
|
3609
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: isCapturing ? labels?.voiceStop || "Stop recording" : labels?.voiceStart || "Start recording" })
|
|
3625
3610
|
] })
|
|
3626
3611
|
] }),
|
|
3627
|
-
showTranscriptPreview && transcriptMode !== "none" && transcriptText && /* @__PURE__ */ (0,
|
|
3628
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
3629
|
-
/* @__PURE__ */ (0,
|
|
3630
|
-
/* @__PURE__ */ (0,
|
|
3631
|
-
/* @__PURE__ */ (0,
|
|
3612
|
+
showTranscriptPreview && transcriptMode !== "none" && transcriptText && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-full rounded-lg border bg-background px-3 py-2 text-left text-sm", children: transcriptText })
|
|
3613
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "mt-3 rounded-xl border bg-muted/20 p-3 sm:p-4", children: [
|
|
3614
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center justify-between gap-2 text-xs text-muted-foreground", children: [
|
|
3615
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: formatDuration(durationMs) }),
|
|
3616
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3632
3617
|
Button,
|
|
3633
3618
|
{
|
|
3634
3619
|
type: "button",
|
|
@@ -3639,12 +3624,12 @@ var VoiceComposer = ({
|
|
|
3639
3624
|
disabled,
|
|
3640
3625
|
"aria-label": labels?.voiceDiscard || "Delete recording",
|
|
3641
3626
|
title: labels?.voiceDiscard || "Delete recording",
|
|
3642
|
-
children: /* @__PURE__ */ (0,
|
|
3627
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Trash2, { className: "h-4 w-4" })
|
|
3643
3628
|
}
|
|
3644
3629
|
)
|
|
3645
3630
|
] }),
|
|
3646
|
-
/* @__PURE__ */ (0,
|
|
3647
|
-
/* @__PURE__ */ (0,
|
|
3631
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "mt-4 flex flex-col items-center gap-4 text-center", children: [
|
|
3632
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3648
3633
|
Button,
|
|
3649
3634
|
{
|
|
3650
3635
|
type: "button",
|
|
@@ -3653,12 +3638,12 @@ var VoiceComposer = ({
|
|
|
3653
3638
|
className: `h-20 w-20 rounded-full sm:h-24 sm:w-24 ${orbIsListening ? "border-red-500 bg-red-500 text-white hover:bg-red-600" : isArmedDraft ? "border-red-200 bg-red-50 text-red-600 shadow-[0_0_0_10px_rgba(239,68,68,0.08)] hover:bg-red-100 hover:text-red-700" : "border-red-200 bg-red-50 text-red-600 hover:bg-red-100 hover:text-red-700"}`,
|
|
3654
3639
|
onClick: handleReviewOrbClick,
|
|
3655
3640
|
disabled: disabled || orbIsReviewBusy,
|
|
3656
|
-
children: orbIsReviewBusy ? /* @__PURE__ */ (0,
|
|
3641
|
+
children: orbIsReviewBusy ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Loader2, { className: "h-7 w-7 animate-spin" }) : orbIsListening ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Square, { className: "h-7 w-7" }) : isArmedDraft ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Mic, { className: "h-7 w-7 animate-pulse" }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Mic, { className: "h-7 w-7" })
|
|
3657
3642
|
}
|
|
3658
3643
|
),
|
|
3659
|
-
/* @__PURE__ */ (0,
|
|
3660
|
-
/* @__PURE__ */ (0,
|
|
3661
|
-
isCapturing && /* @__PURE__ */ (0,
|
|
3644
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "max-w-sm space-y-1 px-2", children: [
|
|
3645
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm text-foreground", children: reviewHelperText }),
|
|
3646
|
+
isCapturing && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "mx-auto h-1.5 w-32 overflow-hidden rounded-full bg-red-100", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3662
3647
|
"div",
|
|
3663
3648
|
{
|
|
3664
3649
|
className: "h-full rounded-full bg-red-500 transition-[width] duration-150",
|
|
@@ -3667,27 +3652,27 @@ var VoiceComposer = ({
|
|
|
3667
3652
|
) })
|
|
3668
3653
|
] })
|
|
3669
3654
|
] }),
|
|
3670
|
-
attachment && /* @__PURE__ */ (0,
|
|
3671
|
-
showTranscriptPreview && transcriptMode !== "none" && transcriptText && /* @__PURE__ */ (0,
|
|
3672
|
-
isAutoSendActive && autoSendDelayMs > 0 && /* @__PURE__ */ (0,
|
|
3673
|
-
/* @__PURE__ */ (0,
|
|
3674
|
-
isAutoSendActive && /* @__PURE__ */ (0,
|
|
3675
|
-
/* @__PURE__ */ (0,
|
|
3655
|
+
attachment && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "mt-4 rounded-lg border bg-background/90 p-2 shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("audio", { controls: true, preload: "metadata", className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("source", { src: attachment.dataUrl, type: attachment.mimeType }) }) }),
|
|
3656
|
+
showTranscriptPreview && transcriptMode !== "none" && transcriptText && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "mt-3 rounded-lg border bg-background px-3 py-2 text-left text-sm", children: transcriptText }),
|
|
3657
|
+
isAutoSendActive && autoSendDelayMs > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "mt-3 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "inline-flex items-center rounded-full border bg-background px-3 py-1 text-xs text-muted-foreground", children: interpolateSeconds(labels?.voiceAutoSendIn, countdownSeconds) }) }),
|
|
3658
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "mt-4 grid grid-cols-1 gap-2 sm:flex sm:items-center sm:justify-end", children: [
|
|
3659
|
+
isAutoSendActive && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Button, { type: "button", variant: "ghost", size: "sm", onClick: onCancelAutoSend, disabled, className: "w-full sm:w-auto", children: [
|
|
3660
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.X, { className: "h-4 w-4" }),
|
|
3676
3661
|
labels?.voiceCancel || "Cancel"
|
|
3677
3662
|
] }),
|
|
3678
|
-
/* @__PURE__ */ (0,
|
|
3679
|
-
/* @__PURE__ */ (0,
|
|
3663
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Button, { type: "button", size: "sm", onClick: onSendNow, disabled, className: "w-full sm:w-auto", children: [
|
|
3664
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Send, { className: "h-4 w-4" }),
|
|
3680
3665
|
labels?.voiceSendNow || "Send now"
|
|
3681
3666
|
] })
|
|
3682
3667
|
] })
|
|
3683
3668
|
] }),
|
|
3684
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
3669
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "mt-3 rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive", children: errorMessage })
|
|
3685
3670
|
] });
|
|
3686
3671
|
};
|
|
3687
3672
|
|
|
3688
3673
|
// src/components/chat/ChatInput.tsx
|
|
3689
3674
|
var import_lucide_react12 = require("lucide-react");
|
|
3690
|
-
var
|
|
3675
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3691
3676
|
function getActiveMentionMatch(value, caret) {
|
|
3692
3677
|
const prefix = value.slice(0, caret);
|
|
3693
3678
|
const match = /(^|\s)@([\w.-]*)$/.exec(prefix);
|
|
@@ -3739,10 +3724,10 @@ var FileUploadItem = (0, import_react8.memo)(function FileUploadItem2({ file, pr
|
|
|
3739
3724
|
};
|
|
3740
3725
|
const getFileIcon = (type, name) => {
|
|
3741
3726
|
const t = typeof type === "string" && type.length > 0 ? type : guessTypeFromName(name);
|
|
3742
|
-
if (t.startsWith("image/")) return /* @__PURE__ */ (0,
|
|
3743
|
-
if (t.startsWith("video/")) return /* @__PURE__ */ (0,
|
|
3744
|
-
if (t.startsWith("audio/")) return /* @__PURE__ */ (0,
|
|
3745
|
-
return /* @__PURE__ */ (0,
|
|
3727
|
+
if (t.startsWith("image/")) return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Image, { className: "h-4 w-4" });
|
|
3728
|
+
if (t.startsWith("video/")) return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Video, { className: "h-4 w-4" });
|
|
3729
|
+
if (t.startsWith("audio/")) return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Mic, { className: "h-4 w-4" });
|
|
3730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.FileText, { className: "h-4 w-4" });
|
|
3746
3731
|
};
|
|
3747
3732
|
const formatFileSize = (bytes) => {
|
|
3748
3733
|
if (bytes === 0) return "0 Bytes";
|
|
@@ -3751,21 +3736,21 @@ var FileUploadItem = (0, import_react8.memo)(function FileUploadItem2({ file, pr
|
|
|
3751
3736
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
3752
3737
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
|
|
3753
3738
|
};
|
|
3754
|
-
return /* @__PURE__ */ (0,
|
|
3739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Card, { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CardContent, { className: "p-3", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
3755
3740
|
getFileIcon(file.type, file.name),
|
|
3756
|
-
/* @__PURE__ */ (0,
|
|
3757
|
-
/* @__PURE__ */ (0,
|
|
3758
|
-
/* @__PURE__ */ (0,
|
|
3759
|
-
/* @__PURE__ */ (0,
|
|
3741
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3742
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-sm font-medium truncate", children: file.name }),
|
|
3743
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-xs text-muted-foreground", children: formatFileSize(file.size ?? 0) }),
|
|
3744
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Progress, { value: progress, className: "h-1 mt-1" })
|
|
3760
3745
|
] }),
|
|
3761
|
-
/* @__PURE__ */ (0,
|
|
3746
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3762
3747
|
Button,
|
|
3763
3748
|
{
|
|
3764
3749
|
variant: "ghost",
|
|
3765
3750
|
size: "icon",
|
|
3766
3751
|
className: "h-6 w-6",
|
|
3767
3752
|
onClick: onCancel,
|
|
3768
|
-
children: /* @__PURE__ */ (0,
|
|
3753
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.X, { className: "h-3 w-3" })
|
|
3769
3754
|
}
|
|
3770
3755
|
)
|
|
3771
3756
|
] }) }) });
|
|
@@ -3805,9 +3790,9 @@ var AttachmentPreview = (0, import_react8.memo)(function AttachmentPreview2({ at
|
|
|
3805
3790
|
const minutes = Math.floor(seconds / 60);
|
|
3806
3791
|
return `${minutes}:${(seconds % 60).toString().padStart(2, "0")}`;
|
|
3807
3792
|
};
|
|
3808
|
-
return /* @__PURE__ */ (0,
|
|
3809
|
-
attachment.kind === "image" && /* @__PURE__ */ (0,
|
|
3810
|
-
/* @__PURE__ */ (0,
|
|
3793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Card, { className: "relative group", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(CardContent, { className: "p-2", children: [
|
|
3794
|
+
attachment.kind === "image" && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "relative", children: [
|
|
3795
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3811
3796
|
"img",
|
|
3812
3797
|
{
|
|
3813
3798
|
src: attachment.dataUrl,
|
|
@@ -3815,19 +3800,19 @@ var AttachmentPreview = (0, import_react8.memo)(function AttachmentPreview2({ at
|
|
|
3815
3800
|
className: "w-full h-20 object-cover rounded"
|
|
3816
3801
|
}
|
|
3817
3802
|
),
|
|
3818
|
-
/* @__PURE__ */ (0,
|
|
3803
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity rounded flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3819
3804
|
Button,
|
|
3820
3805
|
{
|
|
3821
3806
|
variant: "destructive",
|
|
3822
3807
|
size: "icon",
|
|
3823
3808
|
className: "h-6 w-6",
|
|
3824
3809
|
onClick: onRemove,
|
|
3825
|
-
children: /* @__PURE__ */ (0,
|
|
3810
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.X, { className: "h-3 w-3" })
|
|
3826
3811
|
}
|
|
3827
3812
|
) })
|
|
3828
3813
|
] }),
|
|
3829
|
-
attachment.kind === "video" && /* @__PURE__ */ (0,
|
|
3830
|
-
/* @__PURE__ */ (0,
|
|
3814
|
+
attachment.kind === "video" && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "relative", children: [
|
|
3815
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3831
3816
|
"video",
|
|
3832
3817
|
{
|
|
3833
3818
|
src: attachment.dataUrl,
|
|
@@ -3836,34 +3821,34 @@ var AttachmentPreview = (0, import_react8.memo)(function AttachmentPreview2({ at
|
|
|
3836
3821
|
muted: true
|
|
3837
3822
|
}
|
|
3838
3823
|
),
|
|
3839
|
-
/* @__PURE__ */ (0,
|
|
3824
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity rounded flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3840
3825
|
Button,
|
|
3841
3826
|
{
|
|
3842
3827
|
variant: "destructive",
|
|
3843
3828
|
size: "icon",
|
|
3844
3829
|
className: "h-6 w-6",
|
|
3845
3830
|
onClick: onRemove,
|
|
3846
|
-
children: /* @__PURE__ */ (0,
|
|
3831
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.X, { className: "h-3 w-3" })
|
|
3847
3832
|
}
|
|
3848
3833
|
) }),
|
|
3849
|
-
/* @__PURE__ */ (0,
|
|
3834
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Badge, { className: "absolute bottom-1 right-1 text-xs", children: formatDuration2(attachment.durationMs) })
|
|
3850
3835
|
] }),
|
|
3851
|
-
attachment.kind === "audio" && /* @__PURE__ */ (0,
|
|
3852
|
-
/* @__PURE__ */ (0,
|
|
3836
|
+
attachment.kind === "audio" && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-2 p-2", children: [
|
|
3837
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3853
3838
|
Button,
|
|
3854
3839
|
{
|
|
3855
3840
|
variant: "outline",
|
|
3856
3841
|
size: "icon",
|
|
3857
3842
|
className: "h-8 w-8",
|
|
3858
3843
|
onClick: handlePlayPause,
|
|
3859
|
-
children: isPlaying ? /* @__PURE__ */ (0,
|
|
3844
|
+
children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Pause, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Play, { className: "h-3 w-3" })
|
|
3860
3845
|
}
|
|
3861
3846
|
),
|
|
3862
|
-
/* @__PURE__ */ (0,
|
|
3863
|
-
/* @__PURE__ */ (0,
|
|
3864
|
-
/* @__PURE__ */ (0,
|
|
3847
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex-1", children: [
|
|
3848
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-xs font-medium", children: attachment.fileName || "Audio" }),
|
|
3849
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-xs text-muted-foreground", children: formatDuration2(attachment.durationMs) })
|
|
3865
3850
|
] }),
|
|
3866
|
-
/* @__PURE__ */ (0,
|
|
3851
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3867
3852
|
"audio",
|
|
3868
3853
|
{
|
|
3869
3854
|
ref: audioRef,
|
|
@@ -3871,21 +3856,21 @@ var AttachmentPreview = (0, import_react8.memo)(function AttachmentPreview2({ at
|
|
|
3871
3856
|
onPause: () => setIsPlaying(false),
|
|
3872
3857
|
onEnded: () => setIsPlaying(false),
|
|
3873
3858
|
preload: "metadata",
|
|
3874
|
-
children: /* @__PURE__ */ (0,
|
|
3859
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("source", { src: audioPlaybackSrc, type: attachment.mimeType })
|
|
3875
3860
|
}
|
|
3876
3861
|
),
|
|
3877
|
-
/* @__PURE__ */ (0,
|
|
3862
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3878
3863
|
Button,
|
|
3879
3864
|
{
|
|
3880
3865
|
variant: "ghost",
|
|
3881
3866
|
size: "icon",
|
|
3882
3867
|
className: "h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
3883
3868
|
onClick: onRemove,
|
|
3884
|
-
children: /* @__PURE__ */ (0,
|
|
3869
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.X, { className: "h-3 w-3" })
|
|
3885
3870
|
}
|
|
3886
3871
|
)
|
|
3887
3872
|
] }),
|
|
3888
|
-
attachment.fileName && attachment.kind !== "audio" && /* @__PURE__ */ (0,
|
|
3873
|
+
attachment.fileName && attachment.kind !== "audio" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs p-1 rounded-b", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "truncate", children: attachment.fileName }) })
|
|
3889
3874
|
] }) });
|
|
3890
3875
|
});
|
|
3891
3876
|
var resolveVoiceErrorMessage = (error, config) => {
|
|
@@ -4436,8 +4421,8 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
4436
4421
|
};
|
|
4437
4422
|
const canAddMoreAttachments = attachments.length < maxAttachments;
|
|
4438
4423
|
const showVoiceComposer = enableAudioRecording && isVoiceComposerOpen;
|
|
4439
|
-
return /* @__PURE__ */ (0,
|
|
4440
|
-
uploadProgress.size > 0 && /* @__PURE__ */ (0,
|
|
4424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: `border-t py-0 bg-transparent ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "px-0 md:p-2 pb-1 space-y-4 bg-transparent", children: [
|
|
4425
|
+
uploadProgress.size > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "space-y-2", children: Array.from(uploadProgress.entries()).map(([id, progress]) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4441
4426
|
FileUploadItem,
|
|
4442
4427
|
{
|
|
4443
4428
|
file: { name: progress.fileName },
|
|
@@ -4452,7 +4437,7 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
4452
4437
|
},
|
|
4453
4438
|
id
|
|
4454
4439
|
)) }),
|
|
4455
|
-
attachments.length > 0 && /* @__PURE__ */ (0,
|
|
4440
|
+
attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "grid grid-cols-4 gap-2", children: attachments.map((attachment, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4456
4441
|
AttachmentPreview,
|
|
4457
4442
|
{
|
|
4458
4443
|
attachment,
|
|
@@ -4460,7 +4445,7 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
4460
4445
|
},
|
|
4461
4446
|
index
|
|
4462
4447
|
)) }),
|
|
4463
|
-
showVoiceComposer ? /* @__PURE__ */ (0,
|
|
4448
|
+
showVoiceComposer ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "mb-1 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4464
4449
|
VoiceComposer,
|
|
4465
4450
|
{
|
|
4466
4451
|
state: voiceState,
|
|
@@ -4500,15 +4485,15 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
4500
4485
|
void closeVoiceComposer();
|
|
4501
4486
|
}
|
|
4502
4487
|
}
|
|
4503
|
-
) }) : /* @__PURE__ */ (0,
|
|
4488
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("form", { onSubmit: handleSubmit, className: "mb-1 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4504
4489
|
"div",
|
|
4505
4490
|
{
|
|
4506
4491
|
className: "flex items-end gap-2 p-3 border rounded-lg bg-background w-full md:min-w-3xl max-w-3xl",
|
|
4507
4492
|
onDrop: handleDrop,
|
|
4508
4493
|
onDragOver: handleDragOver,
|
|
4509
4494
|
children: [
|
|
4510
|
-
enableFileUpload && canAddMoreAttachments && /* @__PURE__ */ (0,
|
|
4511
|
-
/* @__PURE__ */ (0,
|
|
4495
|
+
enableFileUpload && canAddMoreAttachments && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
4496
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4512
4497
|
"input",
|
|
4513
4498
|
{
|
|
4514
4499
|
ref: fileInputRef,
|
|
@@ -4519,8 +4504,8 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
4519
4504
|
className: "hidden"
|
|
4520
4505
|
}
|
|
4521
4506
|
),
|
|
4522
|
-
/* @__PURE__ */ (0,
|
|
4523
|
-
/* @__PURE__ */ (0,
|
|
4507
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Tooltip, { children: [
|
|
4508
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4524
4509
|
Button,
|
|
4525
4510
|
{
|
|
4526
4511
|
type: "button",
|
|
@@ -4533,14 +4518,14 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
4533
4518
|
fileInputRef.current?.click();
|
|
4534
4519
|
},
|
|
4535
4520
|
disabled,
|
|
4536
|
-
children: /* @__PURE__ */ (0,
|
|
4521
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Paperclip, { className: "h-4 w-4" })
|
|
4537
4522
|
}
|
|
4538
4523
|
) }),
|
|
4539
|
-
/* @__PURE__ */ (0,
|
|
4524
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { children: config?.labels?.attachFileTooltip })
|
|
4540
4525
|
] })
|
|
4541
4526
|
] }),
|
|
4542
|
-
/* @__PURE__ */ (0,
|
|
4543
|
-
/* @__PURE__ */ (0,
|
|
4527
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "relative flex-1", children: [
|
|
4528
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4544
4529
|
Textarea,
|
|
4545
4530
|
{
|
|
4546
4531
|
ref: textareaRef,
|
|
@@ -4564,7 +4549,7 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
4564
4549
|
rows: 1
|
|
4565
4550
|
}
|
|
4566
4551
|
),
|
|
4567
|
-
isMentionMenuOpen && /* @__PURE__ */ (0,
|
|
4552
|
+
isMentionMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "absolute bottom-full left-0 right-0 mb-2 overflow-hidden rounded-md border bg-popover shadow-md", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "p-1", children: filteredMentionAgents.map((agent, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4568
4553
|
"button",
|
|
4569
4554
|
{
|
|
4570
4555
|
type: "button",
|
|
@@ -4574,15 +4559,15 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
4574
4559
|
selectMentionAgent(agent);
|
|
4575
4560
|
},
|
|
4576
4561
|
children: [
|
|
4577
|
-
/* @__PURE__ */ (0,
|
|
4578
|
-
agent.description && /* @__PURE__ */ (0,
|
|
4562
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "font-medium", children: agent.name }),
|
|
4563
|
+
agent.description && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "truncate text-xs text-muted-foreground", children: agent.description })
|
|
4579
4564
|
]
|
|
4580
4565
|
},
|
|
4581
4566
|
agent.id
|
|
4582
4567
|
)) }) })
|
|
4583
4568
|
] }),
|
|
4584
|
-
enableAudioRecording && canAddMoreAttachments && !value.trim() && /* @__PURE__ */ (0,
|
|
4585
|
-
/* @__PURE__ */ (0,
|
|
4569
|
+
enableAudioRecording && canAddMoreAttachments && !value.trim() && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Tooltip, { children: [
|
|
4570
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4586
4571
|
Button,
|
|
4587
4572
|
{
|
|
4588
4573
|
type: "button",
|
|
@@ -4593,13 +4578,13 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
4593
4578
|
void startVoiceCapture();
|
|
4594
4579
|
},
|
|
4595
4580
|
disabled: disabled || isGenerating,
|
|
4596
|
-
children: /* @__PURE__ */ (0,
|
|
4581
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Mic, { className: "h-4 w-4" })
|
|
4597
4582
|
}
|
|
4598
4583
|
) }),
|
|
4599
|
-
/* @__PURE__ */ (0,
|
|
4584
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { children: config?.labels?.voiceEnter })
|
|
4600
4585
|
] }),
|
|
4601
|
-
isGenerating ? /* @__PURE__ */ (0,
|
|
4602
|
-
/* @__PURE__ */ (0,
|
|
4586
|
+
isGenerating ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Tooltip, { children: [
|
|
4587
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4603
4588
|
Button,
|
|
4604
4589
|
{
|
|
4605
4590
|
type: "button",
|
|
@@ -4607,36 +4592,36 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
4607
4592
|
size: "icon",
|
|
4608
4593
|
className: "h-10 w-10",
|
|
4609
4594
|
onClick: onStopGeneration,
|
|
4610
|
-
children: /* @__PURE__ */ (0,
|
|
4595
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Square, { className: "h-4 w-4" })
|
|
4611
4596
|
}
|
|
4612
4597
|
) }),
|
|
4613
|
-
/* @__PURE__ */ (0,
|
|
4614
|
-
] }) : /* @__PURE__ */ (0,
|
|
4615
|
-
/* @__PURE__ */ (0,
|
|
4598
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { children: config?.labels?.stopGenerationTooltip })
|
|
4599
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Tooltip, { children: [
|
|
4600
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4616
4601
|
Button,
|
|
4617
4602
|
{
|
|
4618
4603
|
type: "submit",
|
|
4619
4604
|
size: "icon",
|
|
4620
4605
|
className: "h-10 w-10",
|
|
4621
4606
|
disabled: disabled || !value.trim() && attachments.length === 0,
|
|
4622
|
-
children: disabled ? /* @__PURE__ */ (0,
|
|
4607
|
+
children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Send, { className: "h-4 w-4" })
|
|
4623
4608
|
}
|
|
4624
4609
|
) }),
|
|
4625
|
-
/* @__PURE__ */ (0,
|
|
4610
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { children: config?.labels?.sendMessageTooltip })
|
|
4626
4611
|
] })
|
|
4627
4612
|
]
|
|
4628
4613
|
}
|
|
4629
4614
|
) }),
|
|
4630
|
-
/* @__PURE__ */ (0,
|
|
4615
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "text-[10px] text-muted-foreground text-center", children: [
|
|
4631
4616
|
window.innerWidth > 768 ? config?.labels?.inputHelpText : "",
|
|
4632
|
-
attachments.length > 0 && /* @__PURE__ */ (0,
|
|
4617
|
+
attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
4633
4618
|
" \u2022 ",
|
|
4634
4619
|
attachments.length,
|
|
4635
4620
|
"/",
|
|
4636
4621
|
maxAttachments,
|
|
4637
4622
|
" anexos"
|
|
4638
4623
|
] }),
|
|
4639
|
-
config?.labels?.footerLabel && /* @__PURE__ */ (0,
|
|
4624
|
+
config?.labels?.footerLabel && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
4640
4625
|
" \u2022 ",
|
|
4641
4626
|
config.labels.footerLabel
|
|
4642
4627
|
] })
|
|
@@ -4650,16 +4635,16 @@ var import_react9 = require("react");
|
|
|
4650
4635
|
// src/components/ui/scroll-area.tsx
|
|
4651
4636
|
var React14 = __toESM(require("react"), 1);
|
|
4652
4637
|
var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"), 1);
|
|
4653
|
-
var
|
|
4638
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4654
4639
|
var ScrollArea = React14.forwardRef(({ className, children, viewportClassName, onScroll, onScrollCapture, ...props }, ref) => {
|
|
4655
|
-
return /* @__PURE__ */ (0,
|
|
4640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4656
4641
|
ScrollAreaPrimitive.Root,
|
|
4657
4642
|
{
|
|
4658
4643
|
"data-slot": "scroll-area",
|
|
4659
4644
|
className: cn("relative", className),
|
|
4660
4645
|
...props,
|
|
4661
4646
|
children: [
|
|
4662
|
-
/* @__PURE__ */ (0,
|
|
4647
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4663
4648
|
ScrollAreaPrimitive.Viewport,
|
|
4664
4649
|
{
|
|
4665
4650
|
ref,
|
|
@@ -4673,8 +4658,8 @@ var ScrollArea = React14.forwardRef(({ className, children, viewportClassName, o
|
|
|
4673
4658
|
children
|
|
4674
4659
|
}
|
|
4675
4660
|
),
|
|
4676
|
-
/* @__PURE__ */ (0,
|
|
4677
|
-
/* @__PURE__ */ (0,
|
|
4661
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ScrollBar, {}),
|
|
4662
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ScrollAreaPrimitive.Corner, {})
|
|
4678
4663
|
]
|
|
4679
4664
|
}
|
|
4680
4665
|
);
|
|
@@ -4685,7 +4670,7 @@ function ScrollBar({
|
|
|
4685
4670
|
orientation = "vertical",
|
|
4686
4671
|
...props
|
|
4687
4672
|
}) {
|
|
4688
|
-
return /* @__PURE__ */ (0,
|
|
4673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4689
4674
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
4690
4675
|
{
|
|
4691
4676
|
"data-slot": "scroll-area-scrollbar",
|
|
@@ -4697,7 +4682,7 @@ function ScrollBar({
|
|
|
4697
4682
|
className
|
|
4698
4683
|
),
|
|
4699
4684
|
...props,
|
|
4700
|
-
children: /* @__PURE__ */ (0,
|
|
4685
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4701
4686
|
ScrollAreaPrimitive.ScrollAreaThumb,
|
|
4702
4687
|
{
|
|
4703
4688
|
"data-slot": "scroll-area-thumb",
|
|
@@ -4710,7 +4695,7 @@ function ScrollBar({
|
|
|
4710
4695
|
|
|
4711
4696
|
// src/components/chat/UserProfile.tsx
|
|
4712
4697
|
var import_lucide_react13 = require("lucide-react");
|
|
4713
|
-
var
|
|
4698
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4714
4699
|
var getInitials2 = (name, email) => {
|
|
4715
4700
|
if (name) {
|
|
4716
4701
|
return name.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase();
|
|
@@ -4724,29 +4709,29 @@ var getFieldIcon = (type, key) => {
|
|
|
4724
4709
|
const iconClass = "h-4 w-4 text-muted-foreground";
|
|
4725
4710
|
switch (type) {
|
|
4726
4711
|
case "email":
|
|
4727
|
-
return /* @__PURE__ */ (0,
|
|
4712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Mail, { className: iconClass });
|
|
4728
4713
|
case "phone":
|
|
4729
|
-
return /* @__PURE__ */ (0,
|
|
4714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Phone, { className: iconClass });
|
|
4730
4715
|
case "url":
|
|
4731
|
-
return /* @__PURE__ */ (0,
|
|
4716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Globe, { className: iconClass });
|
|
4732
4717
|
case "date":
|
|
4733
|
-
return /* @__PURE__ */ (0,
|
|
4718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Calendar, { className: iconClass });
|
|
4734
4719
|
}
|
|
4735
4720
|
const lowerKey = key?.toLowerCase() || "";
|
|
4736
|
-
if (lowerKey.includes("follower")) return /* @__PURE__ */ (0,
|
|
4737
|
-
if (lowerKey.includes("following")) return /* @__PURE__ */ (0,
|
|
4738
|
-
if (lowerKey.includes("post") || lowerKey.includes("publication")) return /* @__PURE__ */ (0,
|
|
4739
|
-
if (lowerKey.includes("verified") || lowerKey.includes("badge")) return /* @__PURE__ */ (0,
|
|
4740
|
-
if (lowerKey.includes("bio")) return /* @__PURE__ */ (0,
|
|
4741
|
-
if (lowerKey.includes("email")) return /* @__PURE__ */ (0,
|
|
4742
|
-
if (lowerKey.includes("phone") || lowerKey.includes("tel")) return /* @__PURE__ */ (0,
|
|
4743
|
-
if (lowerKey.includes("location") || lowerKey.includes("address") || lowerKey.includes("city")) return /* @__PURE__ */ (0,
|
|
4744
|
-
if (lowerKey.includes("company") || lowerKey.includes("org")) return /* @__PURE__ */ (0,
|
|
4745
|
-
if (lowerKey.includes("job") || lowerKey.includes("role") || lowerKey.includes("title") || lowerKey.includes("position")) return /* @__PURE__ */ (0,
|
|
4746
|
-
if (lowerKey.includes("website") || lowerKey.includes("url") || lowerKey.includes("link")) return /* @__PURE__ */ (0,
|
|
4747
|
-
if (lowerKey.includes("username") || lowerKey.includes("handle")) return /* @__PURE__ */ (0,
|
|
4748
|
-
if (lowerKey.includes("date") || lowerKey.includes("birthday") || lowerKey.includes("joined")) return /* @__PURE__ */ (0,
|
|
4749
|
-
return /* @__PURE__ */ (0,
|
|
4721
|
+
if (lowerKey.includes("follower")) return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Users, { className: iconClass });
|
|
4722
|
+
if (lowerKey.includes("following")) return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.UserPlus, { className: iconClass });
|
|
4723
|
+
if (lowerKey.includes("post") || lowerKey.includes("publication")) return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Image, { className: iconClass });
|
|
4724
|
+
if (lowerKey.includes("verified") || lowerKey.includes("badge")) return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.BadgeCheck, { className: iconClass });
|
|
4725
|
+
if (lowerKey.includes("bio")) return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.FileText, { className: iconClass });
|
|
4726
|
+
if (lowerKey.includes("email")) return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Mail, { className: iconClass });
|
|
4727
|
+
if (lowerKey.includes("phone") || lowerKey.includes("tel")) return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Phone, { className: iconClass });
|
|
4728
|
+
if (lowerKey.includes("location") || lowerKey.includes("address") || lowerKey.includes("city")) return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.MapPin, { className: iconClass });
|
|
4729
|
+
if (lowerKey.includes("company") || lowerKey.includes("org")) return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Building, { className: iconClass });
|
|
4730
|
+
if (lowerKey.includes("job") || lowerKey.includes("role") || lowerKey.includes("title") || lowerKey.includes("position")) return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Briefcase, { className: iconClass });
|
|
4731
|
+
if (lowerKey.includes("website") || lowerKey.includes("url") || lowerKey.includes("link")) return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Globe, { className: iconClass });
|
|
4732
|
+
if (lowerKey.includes("username") || lowerKey.includes("handle")) return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.AtSign, { className: iconClass });
|
|
4733
|
+
if (lowerKey.includes("date") || lowerKey.includes("birthday") || lowerKey.includes("joined")) return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Calendar, { className: iconClass });
|
|
4734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.User, { className: iconClass });
|
|
4750
4735
|
};
|
|
4751
4736
|
var formatValue = (value, type, key) => {
|
|
4752
4737
|
if (value === null || value === void 0) return "-";
|
|
@@ -4780,15 +4765,15 @@ var getMemoryCategoryIcon = (category) => {
|
|
|
4780
4765
|
const iconClass = "h-4 w-4 text-muted-foreground";
|
|
4781
4766
|
switch (category) {
|
|
4782
4767
|
case "preference":
|
|
4783
|
-
return /* @__PURE__ */ (0,
|
|
4768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Heart, { className: iconClass });
|
|
4784
4769
|
case "fact":
|
|
4785
|
-
return /* @__PURE__ */ (0,
|
|
4770
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Info, { className: iconClass });
|
|
4786
4771
|
case "goal":
|
|
4787
|
-
return /* @__PURE__ */ (0,
|
|
4772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Target, { className: iconClass });
|
|
4788
4773
|
case "context":
|
|
4789
|
-
return /* @__PURE__ */ (0,
|
|
4774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Lightbulb, { className: iconClass });
|
|
4790
4775
|
default:
|
|
4791
|
-
return /* @__PURE__ */ (0,
|
|
4776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Brain, { className: iconClass });
|
|
4792
4777
|
}
|
|
4793
4778
|
};
|
|
4794
4779
|
var getMemoryCategoryLabel = (category) => {
|
|
@@ -4858,66 +4843,66 @@ var UserProfile = ({
|
|
|
4858
4843
|
const displayName = user?.name || user?.email?.split("@")[0] || "User";
|
|
4859
4844
|
const initials = getInitials2(user?.name, user?.email);
|
|
4860
4845
|
const normalizedFields = normalizeCustomFields(customFields);
|
|
4861
|
-
return /* @__PURE__ */ (0,
|
|
4846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Sheet, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4862
4847
|
SheetContent,
|
|
4863
4848
|
{
|
|
4864
4849
|
side: "right",
|
|
4865
4850
|
className: cn("w-full sm:max-w-md p-0 flex flex-col h-full overflow-hidden", className),
|
|
4866
4851
|
children: [
|
|
4867
|
-
/* @__PURE__ */ (0,
|
|
4868
|
-
/* @__PURE__ */ (0,
|
|
4869
|
-
/* @__PURE__ */ (0,
|
|
4870
|
-
/* @__PURE__ */ (0,
|
|
4871
|
-
user?.avatar && /* @__PURE__ */ (0,
|
|
4872
|
-
/* @__PURE__ */ (0,
|
|
4852
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SheetHeader, { className: "px-6 py-4 border-b shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SheetTitle, { children: labels.title }) }) }),
|
|
4853
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ScrollArea, { className: "flex-1 min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "p-6 space-y-6", children: [
|
|
4854
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col items-center text-center space-y-4", children: [
|
|
4855
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Avatar, { className: "h-24 w-24 shrink-0", children: [
|
|
4856
|
+
user?.avatar && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(AvatarImage, { src: user.avatar, alt: displayName }),
|
|
4857
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(AvatarFallback, { className: "text-2xl bg-primary/10 text-primary", children: initials })
|
|
4873
4858
|
] }),
|
|
4874
|
-
/* @__PURE__ */ (0,
|
|
4875
|
-
/* @__PURE__ */ (0,
|
|
4876
|
-
user?.email && /* @__PURE__ */ (0,
|
|
4859
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "w-full px-2", children: [
|
|
4860
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h2", { className: "text-xl font-semibold break-words", children: displayName }),
|
|
4861
|
+
user?.email && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm text-muted-foreground break-words", children: user.email })
|
|
4877
4862
|
] })
|
|
4878
4863
|
] }),
|
|
4879
|
-
/* @__PURE__ */ (0,
|
|
4880
|
-
/* @__PURE__ */ (0,
|
|
4881
|
-
/* @__PURE__ */ (0,
|
|
4882
|
-
/* @__PURE__ */ (0,
|
|
4883
|
-
/* @__PURE__ */ (0,
|
|
4884
|
-
/* @__PURE__ */ (0,
|
|
4885
|
-
/* @__PURE__ */ (0,
|
|
4886
|
-
/* @__PURE__ */ (0,
|
|
4887
|
-
/* @__PURE__ */ (0,
|
|
4864
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Separator, {}),
|
|
4865
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "space-y-3", children: [
|
|
4866
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: labels.basicInfo }),
|
|
4867
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "space-y-2", children: [
|
|
4868
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
|
|
4869
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.User, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
4870
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
4871
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-xs text-muted-foreground", children: "Name" }),
|
|
4872
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm font-medium break-words", children: displayName })
|
|
4888
4873
|
] })
|
|
4889
4874
|
] }),
|
|
4890
|
-
user?.email && /* @__PURE__ */ (0,
|
|
4891
|
-
/* @__PURE__ */ (0,
|
|
4892
|
-
/* @__PURE__ */ (0,
|
|
4893
|
-
/* @__PURE__ */ (0,
|
|
4894
|
-
/* @__PURE__ */ (0,
|
|
4875
|
+
user?.email && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
|
|
4876
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.AtSign, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
4877
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
4878
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-xs text-muted-foreground", children: "Handle" }),
|
|
4879
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm font-medium break-words", children: user.email })
|
|
4895
4880
|
] })
|
|
4896
4881
|
] }),
|
|
4897
|
-
user?.id && user.id !== user?.name && user.id !== user?.email && /* @__PURE__ */ (0,
|
|
4898
|
-
/* @__PURE__ */ (0,
|
|
4899
|
-
/* @__PURE__ */ (0,
|
|
4900
|
-
/* @__PURE__ */ (0,
|
|
4901
|
-
/* @__PURE__ */ (0,
|
|
4882
|
+
user?.id && user.id !== user?.name && user.id !== user?.email && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
|
|
4883
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.User, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
4884
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
4885
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-xs text-muted-foreground", children: "ID" }),
|
|
4886
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm font-medium break-words", children: user.id })
|
|
4902
4887
|
] })
|
|
4903
4888
|
] })
|
|
4904
4889
|
] })
|
|
4905
4890
|
] }),
|
|
4906
|
-
normalizedFields.length > 0 && /* @__PURE__ */ (0,
|
|
4907
|
-
/* @__PURE__ */ (0,
|
|
4908
|
-
/* @__PURE__ */ (0,
|
|
4909
|
-
/* @__PURE__ */ (0,
|
|
4910
|
-
/* @__PURE__ */ (0,
|
|
4891
|
+
normalizedFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
4892
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Separator, {}),
|
|
4893
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "space-y-3", children: [
|
|
4894
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: labels.customFields }),
|
|
4895
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "space-y-2", children: normalizedFields.map((field) => {
|
|
4911
4896
|
const isBioField = field.key.toLowerCase().includes("bio");
|
|
4912
|
-
return /* @__PURE__ */ (0,
|
|
4897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4913
4898
|
"div",
|
|
4914
4899
|
{
|
|
4915
4900
|
className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50",
|
|
4916
4901
|
children: [
|
|
4917
|
-
/* @__PURE__ */ (0,
|
|
4918
|
-
/* @__PURE__ */ (0,
|
|
4919
|
-
/* @__PURE__ */ (0,
|
|
4920
|
-
/* @__PURE__ */ (0,
|
|
4902
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mt-0.5 shrink-0", children: field.icon || getFieldIcon(field.type, field.key) }),
|
|
4903
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
4904
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-xs text-muted-foreground", children: field.label }),
|
|
4905
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: cn(
|
|
4921
4906
|
"text-sm font-medium",
|
|
4922
4907
|
isBioField ? "whitespace-pre-wrap break-words" : "break-words"
|
|
4923
4908
|
), children: formatValue(field.value, field.type, field.key) })
|
|
@@ -4929,26 +4914,26 @@ var UserProfile = ({
|
|
|
4929
4914
|
}) })
|
|
4930
4915
|
] })
|
|
4931
4916
|
] }),
|
|
4932
|
-
/* @__PURE__ */ (0,
|
|
4933
|
-
/* @__PURE__ */ (0,
|
|
4934
|
-
/* @__PURE__ */ (0,
|
|
4935
|
-
/* @__PURE__ */ (0,
|
|
4936
|
-
/* @__PURE__ */ (0,
|
|
4917
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Separator, {}),
|
|
4918
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "space-y-3", children: [
|
|
4919
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
4920
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider flex items-center gap-2", children: [
|
|
4921
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Brain, { className: "h-4 w-4" }),
|
|
4937
4922
|
labels.memories
|
|
4938
4923
|
] }),
|
|
4939
|
-
onAddMemory && /* @__PURE__ */ (0,
|
|
4924
|
+
onAddMemory && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4940
4925
|
Button,
|
|
4941
4926
|
{
|
|
4942
4927
|
variant: "ghost",
|
|
4943
4928
|
size: "sm",
|
|
4944
4929
|
className: "h-7 px-2",
|
|
4945
4930
|
onClick: () => setIsAddingMemory(true),
|
|
4946
|
-
children: /* @__PURE__ */ (0,
|
|
4931
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Plus, { className: "h-4 w-4" })
|
|
4947
4932
|
}
|
|
4948
4933
|
)
|
|
4949
4934
|
] }),
|
|
4950
|
-
isAddingMemory && onAddMemory && /* @__PURE__ */ (0,
|
|
4951
|
-
/* @__PURE__ */ (0,
|
|
4935
|
+
isAddingMemory && onAddMemory && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex gap-2", children: [
|
|
4936
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4952
4937
|
Input,
|
|
4953
4938
|
{
|
|
4954
4939
|
value: newMemoryContent,
|
|
@@ -4965,24 +4950,24 @@ var UserProfile = ({
|
|
|
4965
4950
|
autoFocus: true
|
|
4966
4951
|
}
|
|
4967
4952
|
),
|
|
4968
|
-
/* @__PURE__ */ (0,
|
|
4953
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { size: "sm", onClick: handleAddMemory, disabled: !newMemoryContent.trim(), children: "Salvar" })
|
|
4969
4954
|
] }),
|
|
4970
|
-
/* @__PURE__ */ (0,
|
|
4955
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "space-y-2", children: memories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm text-muted-foreground text-center py-4", children: labels.noMemories }) : memories.map((memory) => {
|
|
4971
4956
|
const isEditing = editingMemoryId === memory.id;
|
|
4972
|
-
return /* @__PURE__ */ (0,
|
|
4957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4973
4958
|
"div",
|
|
4974
4959
|
{
|
|
4975
4960
|
className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50 group",
|
|
4976
4961
|
children: [
|
|
4977
|
-
/* @__PURE__ */ (0,
|
|
4978
|
-
/* @__PURE__ */ (0,
|
|
4979
|
-
/* @__PURE__ */ (0,
|
|
4980
|
-
/* @__PURE__ */ (0,
|
|
4981
|
-
/* @__PURE__ */ (0,
|
|
4982
|
-
/* @__PURE__ */ (0,
|
|
4962
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mt-0.5 shrink-0", children: memory.source === "agent" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Bot, { className: "h-4 w-4 text-primary" }) : getMemoryCategoryIcon(memory.category) }),
|
|
4963
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
4964
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-2 mb-0.5", children: [
|
|
4965
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-xs text-muted-foreground", children: getMemoryCategoryLabel(memory.category) }),
|
|
4966
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-xs text-muted-foreground", children: "\u2022" }),
|
|
4967
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-xs text-muted-foreground", children: memory.source === "agent" ? "IA" : "Voc\xEA" })
|
|
4983
4968
|
] }),
|
|
4984
|
-
isEditing ? /* @__PURE__ */ (0,
|
|
4985
|
-
/* @__PURE__ */ (0,
|
|
4969
|
+
isEditing ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "space-y-2", children: [
|
|
4970
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4986
4971
|
Textarea,
|
|
4987
4972
|
{
|
|
4988
4973
|
value: editingMemoryContent,
|
|
@@ -4999,8 +4984,8 @@ var UserProfile = ({
|
|
|
4999
4984
|
}
|
|
5000
4985
|
}
|
|
5001
4986
|
),
|
|
5002
|
-
/* @__PURE__ */ (0,
|
|
5003
|
-
/* @__PURE__ */ (0,
|
|
4987
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex gap-1 justify-end", children: [
|
|
4988
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
5004
4989
|
Button,
|
|
5005
4990
|
{
|
|
5006
4991
|
variant: "ghost",
|
|
@@ -5008,12 +4993,12 @@ var UserProfile = ({
|
|
|
5008
4993
|
className: "h-7 px-2",
|
|
5009
4994
|
onClick: handleCancelEdit,
|
|
5010
4995
|
children: [
|
|
5011
|
-
/* @__PURE__ */ (0,
|
|
4996
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.X, { className: "h-3.5 w-3.5 mr-1" }),
|
|
5012
4997
|
"Cancelar"
|
|
5013
4998
|
]
|
|
5014
4999
|
}
|
|
5015
5000
|
),
|
|
5016
|
-
/* @__PURE__ */ (0,
|
|
5001
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
5017
5002
|
Button,
|
|
5018
5003
|
{
|
|
5019
5004
|
size: "sm",
|
|
@@ -5021,33 +5006,33 @@ var UserProfile = ({
|
|
|
5021
5006
|
onClick: handleSaveEdit,
|
|
5022
5007
|
disabled: !editingMemoryContent.trim(),
|
|
5023
5008
|
children: [
|
|
5024
|
-
/* @__PURE__ */ (0,
|
|
5009
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Check, { className: "h-3.5 w-3.5 mr-1" }),
|
|
5025
5010
|
"Salvar"
|
|
5026
5011
|
]
|
|
5027
5012
|
}
|
|
5028
5013
|
)
|
|
5029
5014
|
] })
|
|
5030
|
-
] }) : /* @__PURE__ */ (0,
|
|
5015
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm break-words", children: memory.content })
|
|
5031
5016
|
] }),
|
|
5032
|
-
!isEditing && (onUpdateMemory || onDeleteMemory) && /* @__PURE__ */ (0,
|
|
5033
|
-
onUpdateMemory && /* @__PURE__ */ (0,
|
|
5017
|
+
!isEditing && (onUpdateMemory || onDeleteMemory) && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity shrink-0", children: [
|
|
5018
|
+
onUpdateMemory && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5034
5019
|
Button,
|
|
5035
5020
|
{
|
|
5036
5021
|
variant: "ghost",
|
|
5037
5022
|
size: "icon",
|
|
5038
5023
|
className: "h-7 w-7",
|
|
5039
5024
|
onClick: () => handleStartEdit(memory),
|
|
5040
|
-
children: /* @__PURE__ */ (0,
|
|
5025
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Pencil, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
5041
5026
|
}
|
|
5042
5027
|
),
|
|
5043
|
-
onDeleteMemory && /* @__PURE__ */ (0,
|
|
5028
|
+
onDeleteMemory && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5044
5029
|
Button,
|
|
5045
5030
|
{
|
|
5046
5031
|
variant: "ghost",
|
|
5047
5032
|
size: "icon",
|
|
5048
5033
|
className: "h-7 w-7",
|
|
5049
5034
|
onClick: () => onDeleteMemory(memory.id),
|
|
5050
|
-
children: /* @__PURE__ */ (0,
|
|
5035
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Trash2, { className: "h-3.5 w-3.5 text-destructive" })
|
|
5051
5036
|
}
|
|
5052
5037
|
)
|
|
5053
5038
|
] })
|
|
@@ -5058,8 +5043,8 @@ var UserProfile = ({
|
|
|
5058
5043
|
}) })
|
|
5059
5044
|
] })
|
|
5060
5045
|
] }) }),
|
|
5061
|
-
/* @__PURE__ */ (0,
|
|
5062
|
-
onEditProfile && /* @__PURE__ */ (0,
|
|
5046
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "p-4 border-t space-y-2 shrink-0", children: [
|
|
5047
|
+
onEditProfile && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5063
5048
|
Button,
|
|
5064
5049
|
{
|
|
5065
5050
|
variant: "outline",
|
|
@@ -5068,7 +5053,7 @@ var UserProfile = ({
|
|
|
5068
5053
|
children: "Edit Profile"
|
|
5069
5054
|
}
|
|
5070
5055
|
),
|
|
5071
|
-
onLogout && /* @__PURE__ */ (0,
|
|
5056
|
+
onLogout && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5072
5057
|
Button,
|
|
5073
5058
|
{
|
|
5074
5059
|
variant: "destructive",
|
|
@@ -5083,30 +5068,31 @@ var UserProfile = ({
|
|
|
5083
5068
|
) });
|
|
5084
5069
|
};
|
|
5085
5070
|
|
|
5086
|
-
// src/
|
|
5087
|
-
var
|
|
5088
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
5089
|
-
function getMessageSpeakerKey(message) {
|
|
5071
|
+
// src/lib/messageGrouping.ts
|
|
5072
|
+
var getMessageSpeakerKey = (message) => {
|
|
5090
5073
|
if (!message) return null;
|
|
5091
|
-
if (message.
|
|
5092
|
-
return message.
|
|
5074
|
+
if (message.sender) {
|
|
5075
|
+
return `${message.sender.type}:${message.sender.id}`;
|
|
5093
5076
|
}
|
|
5094
5077
|
if (message.role === "user") {
|
|
5095
5078
|
return "user";
|
|
5096
5079
|
}
|
|
5097
5080
|
return message.role;
|
|
5098
|
-
}
|
|
5099
|
-
|
|
5081
|
+
};
|
|
5082
|
+
var getAssistantSpeakerTokens = (message) => {
|
|
5100
5083
|
if (!message || message.role !== "assistant") return [];
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5084
|
+
if (message.sender) {
|
|
5085
|
+
return Array.from(new Set([
|
|
5086
|
+
`${message.sender.type}:${message.sender.id}`,
|
|
5087
|
+
message.sender.agentId ? `agent:${message.sender.agentId}` : "",
|
|
5088
|
+
message.sender.externalId ? `external:${message.sender.externalId}` : ""
|
|
5089
|
+
].filter(Boolean).map((value) => value.toLowerCase())));
|
|
5106
5090
|
}
|
|
5107
5091
|
return ["assistant"];
|
|
5108
|
-
}
|
|
5109
|
-
|
|
5092
|
+
};
|
|
5093
|
+
var hasAssistantContent = (message) => message.role === "assistant" && (message.content.trim().length > 0 || Boolean(message.attachments?.length));
|
|
5094
|
+
var hasActivity = (message) => Boolean(message.activity?.items.length);
|
|
5095
|
+
var canGroupMessages = (previous, next) => {
|
|
5110
5096
|
if (previous.role !== next.role) {
|
|
5111
5097
|
return false;
|
|
5112
5098
|
}
|
|
@@ -5115,39 +5101,20 @@ function canGroupMessages(previous, next) {
|
|
|
5115
5101
|
}
|
|
5116
5102
|
const previousTokens = getAssistantSpeakerTokens(previous);
|
|
5117
5103
|
const nextTokens = getAssistantSpeakerTokens(next);
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
var mergeToolCalls = (activities) => {
|
|
5121
|
-
const merged = /* @__PURE__ */ new Map();
|
|
5122
|
-
for (const activity of activities) {
|
|
5123
|
-
if (!Array.isArray(activity.toolCalls)) continue;
|
|
5124
|
-
for (const toolCall of activity.toolCalls) {
|
|
5125
|
-
const key = toolCall.id || `${toolCall.name}:${JSON.stringify(toolCall.arguments ?? {})}`;
|
|
5126
|
-
merged.set(key, toolCall);
|
|
5127
|
-
}
|
|
5128
|
-
}
|
|
5129
|
-
return merged.size > 0 ? Array.from(merged.values()) : void 0;
|
|
5130
|
-
};
|
|
5131
|
-
var mergeReasoning = (activities) => {
|
|
5132
|
-
const segments = activities.map((activity) => activity.reasoning?.trim()).filter((value) => Boolean(value));
|
|
5133
|
-
if (segments.length === 0) return void 0;
|
|
5134
|
-
return segments.filter((segment, index) => index === 0 || segment !== segments[index - 1]).join("\n\n");
|
|
5104
|
+
if (!previousTokens.some((token) => nextTokens.includes(token))) return false;
|
|
5105
|
+
return !(hasAssistantContent(previous) && hasActivity(next));
|
|
5135
5106
|
};
|
|
5136
5107
|
var mergeGroupActivity = (messages) => {
|
|
5137
|
-
const
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
const mergedReasoning = mergeReasoning(activities);
|
|
5143
|
-
const mergedToolCalls = mergeToolCalls(activities);
|
|
5144
|
-
return {
|
|
5145
|
-
...lastActivity,
|
|
5146
|
-
...mergedReasoning ? { reasoning: mergedReasoning } : {},
|
|
5147
|
-
...mergedToolCalls ? { toolCalls: mergedToolCalls } : {}
|
|
5148
|
-
};
|
|
5108
|
+
const merged = /* @__PURE__ */ new Map();
|
|
5109
|
+
for (const activity of messages.map((message) => message.activity).filter((activity2) => Boolean(activity2))) {
|
|
5110
|
+
for (const item of activity.items) merged.set(item.id, item);
|
|
5111
|
+
}
|
|
5112
|
+
return merged.size > 0 ? { items: Array.from(merged.values()) } : void 0;
|
|
5149
5113
|
};
|
|
5150
5114
|
var mergeMessageGroup = (messages) => {
|
|
5115
|
+
if (messages.length === 1) {
|
|
5116
|
+
return messages[0];
|
|
5117
|
+
}
|
|
5151
5118
|
const firstMessage = messages[0];
|
|
5152
5119
|
const lastMessage = messages[messages.length - 1];
|
|
5153
5120
|
const content = messages.map((message) => message.content.trim()).filter((value) => value.length > 0).join("\n\n");
|
|
@@ -5164,8 +5131,7 @@ var mergeMessageGroup = (messages) => {
|
|
|
5164
5131
|
originalContent: void 0,
|
|
5165
5132
|
editedAt: lastMessage.editedAt,
|
|
5166
5133
|
activity: mergeGroupActivity(messages),
|
|
5167
|
-
|
|
5168
|
-
senderAgentId: lastMessage.senderAgentId ?? firstMessage.senderAgentId,
|
|
5134
|
+
sender: lastMessage.sender ?? firstMessage.sender,
|
|
5169
5135
|
metadata: lastMessage.metadata
|
|
5170
5136
|
};
|
|
5171
5137
|
};
|
|
@@ -5194,6 +5160,10 @@ var groupMessagesForRender = (messages) => {
|
|
|
5194
5160
|
flushGroup();
|
|
5195
5161
|
return groups;
|
|
5196
5162
|
};
|
|
5163
|
+
|
|
5164
|
+
// src/components/chat/ChatUI.tsx
|
|
5165
|
+
var import_lucide_react14 = require("lucide-react");
|
|
5166
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
5197
5167
|
var ChatUI = ({
|
|
5198
5168
|
messages = [],
|
|
5199
5169
|
threads = [],
|
|
@@ -5567,13 +5537,13 @@ var ChatUI = ({
|
|
|
5567
5537
|
const SuggestionIconComponents = [import_lucide_react14.MessageSquare, import_lucide_react14.Lightbulb, import_lucide_react14.Zap, import_lucide_react14.HelpCircle];
|
|
5568
5538
|
const renderSuggestions = () => {
|
|
5569
5539
|
if (groupedMessages.length > 0 || !suggestions.length) return null;
|
|
5570
|
-
return /* @__PURE__ */ (0,
|
|
5571
|
-
/* @__PURE__ */ (0,
|
|
5572
|
-
/* @__PURE__ */ (0,
|
|
5573
|
-
/* @__PURE__ */ (0,
|
|
5574
|
-
/* @__PURE__ */ (0,
|
|
5540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col items-center justify-center min-h-[60vh] py-8 px-4", children: [
|
|
5541
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "text-center mb-8", children: [
|
|
5542
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "inline-flex items-center justify-center w-14 h-14 rounded-2xl bg-gradient-to-br from-primary/20 to-primary/5 mb-4 shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.Sparkles, { className: "w-7 h-7 text-primary" }) }),
|
|
5543
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h2", { className: "text-xl font-semibold mb-2", children: config.branding.title }),
|
|
5544
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-muted-foreground text-sm max-w-md", children: config.branding.subtitle })
|
|
5575
5545
|
] }),
|
|
5576
|
-
/* @__PURE__ */ (0,
|
|
5546
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 w-full max-w-2xl", children: suggestions.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5577
5547
|
"button",
|
|
5578
5548
|
{
|
|
5579
5549
|
type: "button",
|
|
@@ -5582,10 +5552,10 @@ var ChatUI = ({
|
|
|
5582
5552
|
children: [
|
|
5583
5553
|
(() => {
|
|
5584
5554
|
const IconComponent = SuggestionIconComponents[index % SuggestionIconComponents.length];
|
|
5585
|
-
return /* @__PURE__ */ (0,
|
|
5555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex items-center justify-center w-8 h-8 rounded-lg bg-primary/10 text-primary shrink-0 group-hover:bg-primary/15 transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(IconComponent, { className: "h-4 w-4" }) });
|
|
5586
5556
|
})(),
|
|
5587
|
-
/* @__PURE__ */ (0,
|
|
5588
|
-
/* @__PURE__ */ (0,
|
|
5557
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex-1 min-w-0 pr-6", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-sm font-medium leading-snug line-clamp-2", children: suggestion }) }),
|
|
5558
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.ArrowRight, { className: "absolute right-4 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" })
|
|
5589
5559
|
]
|
|
5590
5560
|
},
|
|
5591
5561
|
index
|
|
@@ -5596,19 +5566,19 @@ var ChatUI = ({
|
|
|
5596
5566
|
const items = messageSuggestions?.[messageId];
|
|
5597
5567
|
if (!items || items.length === 0) return null;
|
|
5598
5568
|
const inlineSuggestionOffsetClass = config.ui.showAvatars ? config.ui.compactMode ? "ml-9" : "ml-11" : "";
|
|
5599
|
-
return /* @__PURE__ */ (0,
|
|
5569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5600
5570
|
"div",
|
|
5601
5571
|
{
|
|
5602
5572
|
className: `flex flex-wrap gap-2 mt-2 ${inlineSuggestionOffsetClass}`,
|
|
5603
|
-
children: items.map((suggestion, index) => /* @__PURE__ */ (0,
|
|
5573
|
+
children: items.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5604
5574
|
"button",
|
|
5605
5575
|
{
|
|
5606
5576
|
type: "button",
|
|
5607
5577
|
onClick: () => handleSendMessage(suggestion),
|
|
5608
5578
|
className: "group inline-flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-full border border-border bg-background hover:bg-accent hover:border-accent-foreground/20 transition-all duration-150 text-foreground/80 hover:text-foreground",
|
|
5609
5579
|
children: [
|
|
5610
|
-
/* @__PURE__ */ (0,
|
|
5611
|
-
/* @__PURE__ */ (0,
|
|
5580
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.Sparkles, { className: "h-3 w-3 text-primary opacity-70 group-hover:opacity-100" }),
|
|
5581
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "max-w-[200px] truncate", children: suggestion })
|
|
5612
5582
|
]
|
|
5613
5583
|
},
|
|
5614
5584
|
`${messageId}-suggestion-${index}`
|
|
@@ -5616,20 +5586,20 @@ var ChatUI = ({
|
|
|
5616
5586
|
}
|
|
5617
5587
|
);
|
|
5618
5588
|
};
|
|
5619
|
-
const renderMessageLoadingSkeleton = () => /* @__PURE__ */ (0,
|
|
5589
|
+
const renderMessageLoadingSkeleton = () => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "space-y-6 py-2", children: [0, 1, 2, 3].map((index) => {
|
|
5620
5590
|
const isUserRow = index % 2 === 1;
|
|
5621
|
-
return /* @__PURE__ */ (0,
|
|
5591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5622
5592
|
"div",
|
|
5623
5593
|
{
|
|
5624
5594
|
className: `flex gap-3 ${isUserRow ? "justify-end" : "justify-start"}`,
|
|
5625
5595
|
children: [
|
|
5626
|
-
!isUserRow && /* @__PURE__ */ (0,
|
|
5627
|
-
/* @__PURE__ */ (0,
|
|
5628
|
-
/* @__PURE__ */ (0,
|
|
5629
|
-
/* @__PURE__ */ (0,
|
|
5630
|
-
/* @__PURE__ */ (0,
|
|
5596
|
+
!isUserRow && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Skeleton, { className: "h-8 w-8 rounded-full shrink-0" }),
|
|
5597
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: `space-y-2 ${isUserRow ? "w-[70%]" : "w-[75%]"}`, children: [
|
|
5598
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Skeleton, { className: "h-4 w-24" }),
|
|
5599
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Skeleton, { className: "h-4 w-full" }),
|
|
5600
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Skeleton, { className: "h-4 w-[85%]" })
|
|
5631
5601
|
] }),
|
|
5632
|
-
isUserRow && /* @__PURE__ */ (0,
|
|
5602
|
+
isUserRow && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Skeleton, { className: "h-8 w-8 rounded-full shrink-0" })
|
|
5633
5603
|
]
|
|
5634
5604
|
},
|
|
5635
5605
|
`message-skeleton-${index}`
|
|
@@ -5646,7 +5616,8 @@ var ChatUI = ({
|
|
|
5646
5616
|
enableCopy: config.features.enableMessageCopy,
|
|
5647
5617
|
enableEdit: config.features.enableMessageEditing,
|
|
5648
5618
|
enableRegenerate: config.features.enableRegeneration,
|
|
5649
|
-
|
|
5619
|
+
showActivity: config.features.showActivity,
|
|
5620
|
+
showActivityDetails: config.features.showActivityDetails,
|
|
5650
5621
|
compactMode: config.ui.compactMode,
|
|
5651
5622
|
onAction: handleMessageAction,
|
|
5652
5623
|
labels: config.labels,
|
|
@@ -5658,22 +5629,20 @@ var ChatUI = ({
|
|
|
5658
5629
|
longMessageChunkChars: config.ui.longMessageChunkChars,
|
|
5659
5630
|
renderUserMarkdown: config.ui.renderUserMarkdown,
|
|
5660
5631
|
markdown: config.markdown,
|
|
5661
|
-
onToggleExpanded: handleToggleMessageExpansion
|
|
5662
|
-
agentOptions: isMultiAgentMode ? agentOptions : void 0
|
|
5632
|
+
onToggleExpanded: handleToggleMessageExpansion
|
|
5663
5633
|
}), [
|
|
5664
5634
|
user?.avatar,
|
|
5665
5635
|
user?.name,
|
|
5666
5636
|
assistant?.avatar,
|
|
5667
5637
|
assistant?.name,
|
|
5668
|
-
isMultiAgentMode,
|
|
5669
|
-
agentOptions,
|
|
5670
5638
|
config.ui.showTimestamps,
|
|
5671
5639
|
config.ui.showAvatars,
|
|
5672
5640
|
config.ui.compactMode,
|
|
5673
5641
|
config.features.enableMessageCopy,
|
|
5674
5642
|
config.features.enableMessageEditing,
|
|
5675
5643
|
config.features.enableRegeneration,
|
|
5676
|
-
config.features.
|
|
5644
|
+
config.features.showActivity,
|
|
5645
|
+
config.features.showActivityDetails,
|
|
5677
5646
|
config.labels,
|
|
5678
5647
|
config.labels.showMoreMessage,
|
|
5679
5648
|
config.labels.showLessMessage,
|
|
@@ -5689,12 +5658,12 @@ var ChatUI = ({
|
|
|
5689
5658
|
const shouldShowAgentSelector = Boolean(
|
|
5690
5659
|
config.agentSelector?.enabled && agentOptions.length > 0 && (!config.agentSelector?.hideIfSingle || agentOptions.length > 1) && (isMultiAgentMode ? onParticipantsChange : onSelectAgent)
|
|
5691
5660
|
);
|
|
5692
|
-
return /* @__PURE__ */ (0,
|
|
5661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SidebarProvider, { defaultOpen: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5693
5662
|
"div",
|
|
5694
5663
|
{
|
|
5695
5664
|
className: `flex h-[100svh] md:h-screen bg-background w-full overflow-hidden ${className}`,
|
|
5696
5665
|
children: [
|
|
5697
|
-
/* @__PURE__ */ (0,
|
|
5666
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5698
5667
|
Sidebar2,
|
|
5699
5668
|
{
|
|
5700
5669
|
threads,
|
|
@@ -5713,8 +5682,8 @@ var ChatUI = ({
|
|
|
5713
5682
|
userMenuAdditionalItems
|
|
5714
5683
|
}
|
|
5715
5684
|
),
|
|
5716
|
-
/* @__PURE__ */ (0,
|
|
5717
|
-
/* @__PURE__ */ (0,
|
|
5685
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SidebarInset, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col h-full min-h-0", children: [
|
|
5686
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5718
5687
|
ChatHeader,
|
|
5719
5688
|
{
|
|
5720
5689
|
config,
|
|
@@ -5734,9 +5703,9 @@ var ChatUI = ({
|
|
|
5734
5703
|
onParticipantsChange
|
|
5735
5704
|
}
|
|
5736
5705
|
),
|
|
5737
|
-
/* @__PURE__ */ (0,
|
|
5738
|
-
/* @__PURE__ */ (0,
|
|
5739
|
-
/* @__PURE__ */ (0,
|
|
5706
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-1 flex-row min-h-0 overflow-hidden", children: [
|
|
5707
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex-1 flex flex-col min-h-0", children: [
|
|
5708
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5740
5709
|
ScrollArea,
|
|
5741
5710
|
{
|
|
5742
5711
|
ref: scrollAreaRef,
|
|
@@ -5744,8 +5713,8 @@ var ChatUI = ({
|
|
|
5744
5713
|
viewportClassName: "p-4 overscroll-contain",
|
|
5745
5714
|
onScrollCapture: handleScroll,
|
|
5746
5715
|
style: { contain: "content" },
|
|
5747
|
-
children: /* @__PURE__ */ (0,
|
|
5748
|
-
groupedMessages.length > 0 && /* @__PURE__ */ (0,
|
|
5716
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "max-w-4xl mx-auto pb-4", children: [
|
|
5717
|
+
groupedMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex justify-center py-2", children: isLoadingOlderMessages ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-xs text-muted-foreground", children: config.labels.loadingOlderMessages }) : hasMoreMessagesBefore ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5749
5718
|
"button",
|
|
5750
5719
|
{
|
|
5751
5720
|
type: "button",
|
|
@@ -5754,7 +5723,7 @@ var ChatUI = ({
|
|
|
5754
5723
|
children: config.labels.loadOlderMessages
|
|
5755
5724
|
}
|
|
5756
5725
|
) : null }),
|
|
5757
|
-
isMessagesLoading ? renderMessageLoadingSkeleton() : groupedMessages.length === 0 ? renderSuggestions() : /* @__PURE__ */ (0,
|
|
5726
|
+
isMessagesLoading ? renderMessageLoadingSkeleton() : groupedMessages.length === 0 ? renderSuggestions() : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5758
5727
|
"div",
|
|
5759
5728
|
{
|
|
5760
5729
|
style: {
|
|
@@ -5765,7 +5734,7 @@ var ChatUI = ({
|
|
|
5765
5734
|
children: virtualizer.getVirtualItems().map((virtualRow) => {
|
|
5766
5735
|
const group = groupedMessages[virtualRow.index];
|
|
5767
5736
|
const message = group.message;
|
|
5768
|
-
return /* @__PURE__ */ (0,
|
|
5737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5769
5738
|
"div",
|
|
5770
5739
|
{
|
|
5771
5740
|
"data-index": virtualRow.index,
|
|
@@ -5777,12 +5746,12 @@ var ChatUI = ({
|
|
|
5777
5746
|
width: "100%",
|
|
5778
5747
|
transform: `translateY(${virtualRow.start}px)`
|
|
5779
5748
|
},
|
|
5780
|
-
children: /* @__PURE__ */ (0,
|
|
5749
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5781
5750
|
"div",
|
|
5782
5751
|
{
|
|
5783
5752
|
className: virtualRow.index === 0 ? "" : "pt-4",
|
|
5784
5753
|
children: [
|
|
5785
|
-
/* @__PURE__ */ (0,
|
|
5754
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5786
5755
|
Message,
|
|
5787
5756
|
{
|
|
5788
5757
|
message,
|
|
@@ -5807,8 +5776,8 @@ var ChatUI = ({
|
|
|
5807
5776
|
] })
|
|
5808
5777
|
}
|
|
5809
5778
|
),
|
|
5810
|
-
/* @__PURE__ */ (0,
|
|
5811
|
-
isMultiAgentMode && shouldShowAgentSelector && onTargetAgentChange && /* @__PURE__ */ (0,
|
|
5779
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "bg-background pb-[env(safe-area-inset-bottom)]", children: [
|
|
5780
|
+
isMultiAgentMode && shouldShowAgentSelector && onTargetAgentChange && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "px-4 pt-1", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5812
5781
|
TargetAgentSelector,
|
|
5813
5782
|
{
|
|
5814
5783
|
agents: participantIds && participantIds.length > 0 ? agentOptions.filter(
|
|
@@ -5820,7 +5789,7 @@ var ChatUI = ({
|
|
|
5820
5789
|
disabled: isGenerating
|
|
5821
5790
|
}
|
|
5822
5791
|
) }),
|
|
5823
|
-
/* @__PURE__ */ (0,
|
|
5792
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5824
5793
|
ChatInput,
|
|
5825
5794
|
{
|
|
5826
5795
|
value: inputValue,
|
|
@@ -5851,14 +5820,14 @@ var ChatUI = ({
|
|
|
5851
5820
|
)
|
|
5852
5821
|
] })
|
|
5853
5822
|
] }),
|
|
5854
|
-
config?.customComponent?.component && !isMobile && /* @__PURE__ */ (0,
|
|
5823
|
+
config?.customComponent?.component && !isMobile && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5855
5824
|
"div",
|
|
5856
5825
|
{
|
|
5857
5826
|
className: "h-full transition-all duration-300 ease-in-out overflow-hidden",
|
|
5858
5827
|
style: {
|
|
5859
5828
|
width: state.showSidebar ? config.customComponent.panelWidth ?? 320 : 0
|
|
5860
5829
|
},
|
|
5861
|
-
children: state.showSidebar && /* @__PURE__ */ (0,
|
|
5830
|
+
children: state.showSidebar && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5862
5831
|
"div",
|
|
5863
5832
|
{
|
|
5864
5833
|
className: "h-full overflow-hidden border-l bg-background animate-in slide-in-from-right-4 duration-300",
|
|
@@ -5872,8 +5841,8 @@ var ChatUI = ({
|
|
|
5872
5841
|
)
|
|
5873
5842
|
] })
|
|
5874
5843
|
] }) }),
|
|
5875
|
-
isCustomMounted && config.customComponent?.component && isMobile && /* @__PURE__ */ (0,
|
|
5876
|
-
/* @__PURE__ */ (0,
|
|
5844
|
+
isCustomMounted && config.customComponent?.component && isMobile && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "fixed inset-0 z-50", children: [
|
|
5845
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5877
5846
|
"div",
|
|
5878
5847
|
{
|
|
5879
5848
|
className: `absolute inset-0 bg-background/80 backdrop-blur-sm transition-opacity duration-200 ease-out ${isCustomVisible ? "opacity-100" : "opacity-0"}`,
|
|
@@ -5881,16 +5850,16 @@ var ChatUI = ({
|
|
|
5881
5850
|
onClick: closeSidebar
|
|
5882
5851
|
}
|
|
5883
5852
|
),
|
|
5884
|
-
/* @__PURE__ */ (0,
|
|
5853
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5885
5854
|
"div",
|
|
5886
5855
|
{
|
|
5887
5856
|
className: `absolute top-0 right-0 h-full w-full bg-background transform-gpu transition-transform duration-200 ease-out ${isCustomVisible ? "translate-x-0" : "translate-x-full"}`,
|
|
5888
5857
|
style: { willChange: "transform" },
|
|
5889
|
-
children: /* @__PURE__ */ (0,
|
|
5858
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "h-full overflow-hidden", children: renderCustomComponent() })
|
|
5890
5859
|
}
|
|
5891
5860
|
)
|
|
5892
5861
|
] }),
|
|
5893
|
-
isUserProfileOpen && /* @__PURE__ */ (0,
|
|
5862
|
+
isUserProfileOpen && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5894
5863
|
UserProfile,
|
|
5895
5864
|
{
|
|
5896
5865
|
isOpen: isUserProfileOpen,
|
|
@@ -5918,8 +5887,10 @@ var ChatUI = ({
|
|
|
5918
5887
|
AssistantActivity,
|
|
5919
5888
|
ChatUI,
|
|
5920
5889
|
ChatUserContextProvider,
|
|
5890
|
+
MessageSenderAvatar,
|
|
5921
5891
|
defaultChatConfig,
|
|
5922
5892
|
mergeConfig,
|
|
5893
|
+
resolveMessageSenderDisplay,
|
|
5923
5894
|
useChatUserContext
|
|
5924
5895
|
});
|
|
5925
5896
|
//# sourceMappingURL=index.cjs.map
|