@docyrus/ui-pro-ai-assistant 0.6.8 → 0.6.9

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.js CHANGED
@@ -10,13 +10,13 @@ import { Input } from '@docyrus/ui-pro-shared/components/input';
10
10
  import { Tabs as Tabs$1, TabsList as TabsList$1, TabsTrigger as TabsTrigger$1, TabsContent as TabsContent$1 } from '@docyrus/ui-pro-shared/components/tabs';
11
11
  import { cn } from '@docyrus/ui-pro-shared/lib/utils';
12
12
  import { DefaultChatTransport, lastAssistantMessageIsCompleteWithToolCalls } from 'ai';
13
- import { Pencil, PilcrowIcon, Heading1Icon, Heading2Icon, Heading3Icon, SquareIcon, ListIcon, ListOrderedIcon, ChevronDownIcon, Code2Icon, QuoteIcon, LightbulbIcon, Columns3Icon, GripVertical, FileUpIcon, TableIcon, ImageIcon, FilmIcon, AudioLinesIcon, TableOfContentsIcon, RadicalIcon, RectangleVerticalIcon, CalendarIcon, PlusIcon, FileCodeIcon, MinusIcon, ChevronRightIcon, ListTree, PenToolIcon, Link2Icon, Check, X, Copy, FilesIcon, Link, Text, ExternalLink, Unlink, Bold, Italic, Underline, Strikethrough, Code2, MoreHorizontal, ArrowLeftIcon, ArrowRightIcon, Minus, Plus, CircleArrowDown, Minimize2, Trash2, FileUp, CheckCircle2, FileText, Loader2, Wrench, CornerDownLeftIcon, PencilLineIcon, MessageSquareTextIcon, MessagesSquareIcon, ArrowUpIcon, CheckIcon, CaptionsIcon, ZoomInIcon, CircleArrowDownIcon, MoveUpRightIcon, MoreHorizontalIcon, Eye, PlusCircle, HelpCircle, Maximize2, Download, FileSpreadsheet, ChevronDown, ChevronLeft, ChevronRight, CheckCircle, XCircle, Search, Globe, User, ArrowRight, MapPin, CalendarClock, List, RefreshCw, FilePlus, XIcon, CornerUpLeftIcon, AlbumIcon, FeatherIcon, ListMinusIcon, ListPlusIcon, ListEnd, Wand, LanguagesIcon, BadgeHelpIcon, PenLineIcon, SearchIcon, MusicIcon, CompassIcon, SmileIcon, LeafIcon, ClockIcon, AppleIcon, FlagIcon, StarIcon, DeleteIcon, AlignLeft, AlignCenter, AlignRight, RotateCcw, AlertTriangle, AlertCircle, ArrowUpDown, ArrowDownToLine, PenLine, PencilIcon, TrashIcon, FileIcon, Star, ChevronsUpDown, FolderIcon, MessageSquare, Hash, Table, CheckSquare, Calendar as Calendar$1, Clock, Phone, Mail, Send, RefreshCcw, Undo2, ChevronsUpDownIcon, ChevronsRight, ChevronsLeft, CalendarDays, RefreshCwIcon, PaintRoller, MessageSquareText, ArrowLeft, Boxes, Users, Bot, Brain, Lightbulb, BookOpen, PenTool, SlidersHorizontal, Wand2, Mic, Code, Trash, Edit, Share, FolderInput, Archive, Building2, ShieldCheck, Sparkles, PanelLeft, NotebookText, CirclePlus, MoreVertical, FileSearch, Microscope, Ruler, AudioLines, BrainCircuit, Circle, Zap, Upload, ThumbsUp, ThumbsDown, Sun, Shield, Settings, Play, Pause, Moon, Menu, Lock, Info, Image, Home, Heart, Folder, Filter, File as File$1, CreditCard, Cog, Cloud, ChevronUp, Bookmark, Bell, Plug, Inbox, LayoutGrid, FolderOpen, LayoutDashboard, Table2, WandSparklesIcon, ArrowUpToLineIcon, BoldIcon, ItalicIcon, UnderlineIcon, StrikethroughIcon, HighlighterIcon, Undo2Icon, Redo2Icon, ArrowDownToLineIcon, AlignLeftIcon, AlignCenterIcon, AlignRightIcon, AlignJustifyIcon, ListOrdered, ListTodoIcon, ListCollapseIcon, Grid3x3Icon, Combine, Ungroup, ArrowUp, ArrowDown, Trash2Icon, LinkIcon, WrapText, OutdentIcon, IndentIcon, EyeIcon, PenIcon } from 'lucide-react';
14
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
13
+ import { Pencil, PilcrowIcon, Heading1Icon, Heading2Icon, Heading3Icon, SquareIcon, ListIcon, ListOrderedIcon, ChevronDownIcon, Code2Icon, QuoteIcon, LightbulbIcon, Columns3Icon, GripVertical, FileUpIcon, TableIcon, ImageIcon, FilmIcon, AudioLinesIcon, TableOfContentsIcon, RadicalIcon, RectangleVerticalIcon, CalendarIcon, PlusIcon, FileCodeIcon, MinusIcon, ChevronRightIcon, ListTree, PenToolIcon, Link2Icon, Check, X, Copy, FilesIcon, Link, Text, ExternalLink, Unlink, Bold, Italic, Underline, Strikethrough, Code2, MoreHorizontal, ArrowLeftIcon, ArrowRightIcon, Minus, Plus, CircleArrowDown, Minimize2, Trash2, FileUp, CheckCircle2, FileText, Loader2, Wrench, CornerDownLeftIcon, PencilLineIcon, MessageSquareTextIcon, MessagesSquareIcon, ArrowUpIcon, CheckIcon, CaptionsIcon, ZoomInIcon, CircleArrowDownIcon, MoveUpRightIcon, MoreHorizontalIcon, Eye, PlusCircle, HelpCircle, Maximize2, Download, FileSpreadsheet, ChevronDown, ChevronLeft, ChevronRight, CheckCircle, XCircle, Search, Globe, User, ArrowRight, MapPin, CalendarClock, List, RefreshCw, FilePlus, XIcon, CornerUpLeftIcon, AlbumIcon, FeatherIcon, ListMinusIcon, ListPlusIcon, ListEnd, Wand, LanguagesIcon, BadgeHelpIcon, PenLineIcon, SearchIcon, MusicIcon, CompassIcon, SmileIcon, LeafIcon, ClockIcon, AppleIcon, FlagIcon, StarIcon, DeleteIcon, AlignLeft, AlignCenter, AlignRight, RotateCcw, AlertTriangle, AlertCircle, ArrowUpDown, ArrowDownToLine, PenLine, PencilIcon, TrashIcon, FileIcon, Star, ChevronsUpDown, FolderIcon, MessageSquare, Hash, Table, CheckSquare, Calendar as Calendar$1, Clock, Phone, Mail, Send, RefreshCcw, Undo2, ChevronsUpDownIcon, ChevronsRight, ChevronsLeft, CalendarDays, RefreshCwIcon, PaintRoller, MessageSquareText, ArrowLeft, Boxes, Users, Bot, Brain, Lightbulb, BookOpen, PenTool, SlidersHorizontal, Wand2, Mic, Code, Trash, Edit, Share, FolderInput, Archive, Building2, ShieldCheck, PanelLeft, NotebookText, CirclePlus, MoreVertical, FileSearch, Microscope, Ruler, AudioLines, BrainCircuit, Circle, Zap, Upload, ThumbsUp, ThumbsDown, Sun, Shield, Settings, Play, Pause, Moon, Menu, Lock, Info, Image, Home, Heart, Folder, Filter, File as File$1, CreditCard, Cog, Cloud, ChevronUp, Bookmark, Bell, Plug, Inbox, LayoutGrid, FolderOpen, LayoutDashboard, Table2, WandSparklesIcon, ArrowUpToLineIcon, BoldIcon, ItalicIcon, UnderlineIcon, StrikethroughIcon, HighlighterIcon, Undo2Icon, Redo2Icon, ArrowDownToLineIcon, AlignLeftIcon, AlignCenterIcon, AlignRightIcon, AlignJustifyIcon, ListOrdered, ListTodoIcon, ListCollapseIcon, Grid3x3Icon, Combine, Ungroup, ArrowUp, ArrowDown, Trash2Icon, LinkIcon, WrapText, OutdentIcon, IndentIcon, EyeIcon, PenIcon } from 'lucide-react';
14
+ import { Avatar, AvatarImage, AvatarFallback } from '@docyrus/ui-pro-shared/components/avatar';
15
15
  import { ScrollArea as ScrollArea$1 } from '@docyrus/ui-pro-shared/components/scroll-area';
16
16
  import { AsyncTokenManager, RestApiClient } from '@docyrus/api-client';
17
17
  import { TooltipProvider as TooltipProvider$1, Tooltip as Tooltip$2, TooltipTrigger as TooltipTrigger$1, TooltipContent as TooltipContent$1 } from '@docyrus/ui-pro-shared/components/tooltip';
18
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
18
19
  import { createPortal } from 'react-dom';
19
- import { Avatar as Avatar$1, AvatarImage as AvatarImage$1, AvatarFallback as AvatarFallback$1 } from '@docyrus/ui-pro-shared/components/avatar';
20
20
  import { Message, AIMessageAvatar, MessageContent, MessageActions, MessageAction, AIConversation, AIConversationContent, MessageResponse, AIConversationScrollButton, Tool, ToolHeader, ToolContent, ToolInput, ToolOutput, CodeBlock, CodeBlockCopyButton, resolveToolIcon, PromptInputButton, PromptInput, PromptInputTextarea, PromptInputFooter, PromptInputTools, PromptInputSubmit, usePromptInputAttachments } from '@docyrus/ui-pro-shared/ai';
21
21
  import { Spinner } from '@docyrus/ui-pro-shared/components/spinner';
22
22
  import { DocyrusIcon } from '@docyrus/ui-pro-shared/docyrus-icon';
@@ -44,7 +44,7 @@ import { Calendar } from '@docyrus/ui-pro-shared/calendar';
44
44
  import { Label } from '@docyrus/ui-pro-shared/label';
45
45
  import { Separator as Separator$2 } from '@docyrus/ui-pro-shared/separator';
46
46
  import { TooltipProvider, Tooltip as Tooltip$1, TooltipTrigger, TooltipContent } from '@docyrus/ui-pro-shared/tooltip';
47
- import { Avatar, AvatarImage, AvatarFallback, AvatarGroup } from '@docyrus/ui-pro-shared/avatar';
47
+ import { Avatar as Avatar$1, AvatarImage as AvatarImage$1, AvatarFallback as AvatarFallback$1, AvatarGroup } from '@docyrus/ui-pro-shared/avatar';
48
48
  import { cva } from 'class-variance-authority';
49
49
  import { useDebounce } from '@docyrus/ui-pro-shared/hooks/use-debounce';
50
50
  import { TimePicker, TimePickerInputGroup, TimePickerInput, TimePickerSeparator, TimePickerTrigger, TimePickerContent, TimePickerHour, TimePickerMinute } from '@docyrus/ui-pro-shared/time-picker';
@@ -280,227 +280,6 @@ import { BaseTogglePlugin } from '@platejs/toggle';
280
280
  import { useFilePicker } from 'use-file-picker';
281
281
 
282
282
  // src/docy-assistant.tsx
283
- function AssistantDialogs({
284
- projectState,
285
- projectActions,
286
- sessionState,
287
- sessionActions,
288
- onUpdateProject,
289
- onDeleteProject,
290
- onUpdateSession,
291
- onDeleteSession,
292
- onUpdateProjectInstructions,
293
- t
294
- }) {
295
- return /* @__PURE__ */ jsxs(Fragment, { children: [
296
- /* @__PURE__ */ jsx(
297
- Dialog$1,
298
- {
299
- open: projectState.isEditing,
300
- onOpenChange: (open) => open ? projectActions.startEditing() : projectActions.stopEditing(),
301
- children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md z-[200]", children: [
302
- /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("dialogs.edit_project") }) }),
303
- /* @__PURE__ */ jsxs("div", { className: "space-y-4 py-4", children: [
304
- /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
305
- /* @__PURE__ */ jsx("label", { htmlFor: "project-name", className: "text-sm font-medium leading-none", children: t("labels.project_name") }),
306
- /* @__PURE__ */ jsx(
307
- Input,
308
- {
309
- id: "project-name",
310
- value: projectState.name,
311
- onChange: (e) => projectActions.setName(e.target.value),
312
- placeholder: t("placeholders.enter_project_name")
313
- }
314
- )
315
- ] }),
316
- /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
317
- /* @__PURE__ */ jsx("label", { htmlFor: "project-description", className: "text-sm font-medium leading-none", children: t("labels.description") }),
318
- /* @__PURE__ */ jsx(
319
- Textarea,
320
- {
321
- className: "resize-none",
322
- id: "project-description",
323
- value: projectState.description,
324
- onChange: (e) => projectActions.setDescription(e.target.value),
325
- placeholder: t("placeholders.enter_project_description"),
326
- rows: 3
327
- }
328
- )
329
- ] })
330
- ] }),
331
- /* @__PURE__ */ jsxs(DialogFooter, { children: [
332
- /* @__PURE__ */ jsx(Button, { className: "cursor-pointer", variant: "outline", onClick: () => projectActions.stopEditing(), children: t("buttons.cancel") }),
333
- /* @__PURE__ */ jsx(
334
- Button,
335
- {
336
- className: "bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer",
337
- onClick: onUpdateProject,
338
- disabled: projectState.isSaving || !projectState.name.trim(),
339
- children: projectState.isSaving ? t("buttons.saving") : t("buttons.save_changes")
340
- }
341
- )
342
- ] })
343
- ] })
344
- }
345
- ),
346
- /* @__PURE__ */ jsx(Dialog$1, { open: projectState.isDeleteDialogOpen, onOpenChange: projectActions.setDeleteDialogOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md z-[200]", children: [
347
- /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("dialogs.delete_project") }) }),
348
- /* @__PURE__ */ jsx("div", { className: "space-y-4 py-4", children: /* @__PURE__ */ jsx("p", { children: t("messages.delete_project_confirm") }) }),
349
- /* @__PURE__ */ jsxs(DialogFooter, { children: [
350
- /* @__PURE__ */ jsx(
351
- Button,
352
- {
353
- className: "cursor-pointer",
354
- variant: "outline",
355
- onClick: () => projectActions.setDeleteDialogOpen(false),
356
- children: t("buttons.cancel")
357
- }
358
- ),
359
- /* @__PURE__ */ jsx(
360
- Button,
361
- {
362
- className: "bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer",
363
- onClick: onDeleteProject,
364
- disabled: projectState.isDeleting,
365
- children: projectState.isDeleting ? t("buttons.deleting") : t("buttons.delete_project")
366
- }
367
- )
368
- ] })
369
- ] }) }),
370
- /* @__PURE__ */ jsx(
371
- Dialog$1,
372
- {
373
- open: sessionState.isEditing,
374
- onOpenChange: (open) => open ? sessionActions.startEditing() : sessionActions.stopEditing(),
375
- children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md z-[200]", children: [
376
- /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("dialogs.rename_session") }) }),
377
- /* @__PURE__ */ jsx("div", { className: "space-y-4 py-4", children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
378
- /* @__PURE__ */ jsx("label", { htmlFor: "session-name", className: "text-sm font-medium leading-none", children: t("labels.session_name") }),
379
- /* @__PURE__ */ jsx(
380
- Input,
381
- {
382
- id: "session-name",
383
- value: sessionState.name,
384
- onChange: (e) => sessionActions.setName(e.target.value),
385
- placeholder: t("placeholders.enter_session_name")
386
- }
387
- )
388
- ] }) }),
389
- /* @__PURE__ */ jsxs(DialogFooter, { children: [
390
- /* @__PURE__ */ jsx(Button, { className: "cursor-pointer", variant: "outline", onClick: () => sessionActions.stopEditing(), children: t("buttons.cancel") }),
391
- /* @__PURE__ */ jsx(
392
- Button,
393
- {
394
- className: "bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer",
395
- onClick: onUpdateSession,
396
- disabled: sessionState.isSaving || !sessionState.name.trim(),
397
- children: sessionState.isSaving ? t("buttons.saving") : t("buttons.save_changes")
398
- }
399
- )
400
- ] })
401
- ] })
402
- }
403
- ),
404
- /* @__PURE__ */ jsx(Dialog$1, { open: sessionState.isDeleteDialogOpen, onOpenChange: sessionActions.setDeleteDialogOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md z-[200]", children: [
405
- /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("dialogs.delete_session") }) }),
406
- /* @__PURE__ */ jsx("div", { className: "space-y-4 py-4", children: /* @__PURE__ */ jsx("p", { children: t("messages.delete_session_confirm") }) }),
407
- /* @__PURE__ */ jsxs(DialogFooter, { children: [
408
- /* @__PURE__ */ jsx(
409
- Button,
410
- {
411
- className: "cursor-pointer",
412
- variant: "outline",
413
- onClick: () => sessionActions.setDeleteDialogOpen(false),
414
- children: t("buttons.cancel")
415
- }
416
- ),
417
- /* @__PURE__ */ jsx(
418
- Button,
419
- {
420
- className: "bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer",
421
- onClick: onDeleteSession,
422
- disabled: sessionState.isDeleting,
423
- children: sessionState.isDeleting ? t("buttons.deleting") : t("buttons.delete_session")
424
- }
425
- )
426
- ] })
427
- ] }) }),
428
- /* @__PURE__ */ jsx(
429
- Dialog$1,
430
- {
431
- open: projectState.isEditingInstructions,
432
- onOpenChange: (open) => open ? projectActions.startEditingInstructions() : projectActions.stopEditingInstructions(),
433
- children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-lg z-[200]", children: [
434
- /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("dialogs.edit_instructions") }) }),
435
- /* @__PURE__ */ jsx("div", { className: "space-y-4 py-4", children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
436
- /* @__PURE__ */ jsx("label", { htmlFor: "project-instructions", className: "text-sm font-medium leading-none", children: t("sections.instructions") }),
437
- /* @__PURE__ */ jsx(
438
- Textarea,
439
- {
440
- id: "project-instructions",
441
- value: projectState.instructions,
442
- onChange: (e) => projectActions.setInstructions(e.target.value),
443
- placeholder: t("placeholders.add_instructions"),
444
- className: "min-h-30 resize-none",
445
- rows: 6
446
- }
447
- ),
448
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("descriptions.instructions_help") })
449
- ] }) }),
450
- /* @__PURE__ */ jsxs(DialogFooter, { children: [
451
- /* @__PURE__ */ jsx(
452
- Button,
453
- {
454
- className: "cursor-pointer",
455
- variant: "outline",
456
- onClick: () => projectActions.stopEditingInstructions(),
457
- children: t("buttons.cancel")
458
- }
459
- ),
460
- /* @__PURE__ */ jsx(
461
- Button,
462
- {
463
- className: "bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer",
464
- onClick: onUpdateProjectInstructions,
465
- disabled: projectState.isSavingInstructions,
466
- children: projectState.isSavingInstructions ? t("buttons.saving") : t("buttons.save_instructions")
467
- }
468
- )
469
- ] })
470
- ] })
471
- }
472
- )
473
- ] });
474
- }
475
-
476
- // src/types/index.ts
477
- var WorkTypes = {
478
- Record: "record",
479
- Data: "data",
480
- Text: "text",
481
- Code: "code",
482
- Image: "image",
483
- Xlsx: "xlsx",
484
- App: "app"
485
- };
486
- var BASE_DATA_SOURCE_ID = {
487
- thread: "f42b3daa-ca43-11ed-be9d-6fe3a1a7b37c",
488
- message: "010e9ce2-ca44-11ed-bda6-6b0c6905cf5e"
489
- };
490
- var SHARE_PERMISSIONS = {
491
- READ: 1,
492
- WRITE: 2,
493
- COMMENT: 4,
494
- SHARE: 8,
495
- DELETE: 16
496
- };
497
- var SHARE_PERMISSION_LEVELS = [
498
- { value: 1, label: "Can view" },
499
- { value: 3, label: "Can edit" },
500
- { value: 7, label: "Can comment" },
501
- { value: 11, label: "Can share" },
502
- { value: 31, label: "Full access" }
503
- ];
504
283
 
505
284
  // src/i18n/locales/de.json
506
285
  var de_default = {
@@ -2876,6 +2655,388 @@ function useApiClient() {
2876
2655
  };
2877
2656
  }, [config3]);
2878
2657
  }
2658
+ var pickAvatar = (raw) => {
2659
+ const candidate = raw?.agentAvatar ?? raw?.avatar;
2660
+ if (!candidate) return void 0;
2661
+ if (typeof candidate === "string") return candidate;
2662
+ if (typeof candidate === "object" && typeof candidate.signed_url === "string") return candidate.signed_url;
2663
+ return void 0;
2664
+ };
2665
+ var AgentTabs = ({
2666
+ tabs,
2667
+ activeTabId,
2668
+ onTabSelect,
2669
+ onTabClose,
2670
+ onAddTab,
2671
+ agentSelectorUrl,
2672
+ isFullscreen,
2673
+ fallbackLogo,
2674
+ fallbackTitle
2675
+ }) => {
2676
+ const apiClient = useApiClient();
2677
+ const [open, setOpen] = useState(false);
2678
+ const [search, setSearch] = useState("");
2679
+ const [loading, setLoading] = useState(false);
2680
+ const [agents, setAgents] = useState([]);
2681
+ const hasFetchedRef = useRef(false);
2682
+ const searchRef = useRef(null);
2683
+ useEffect(() => {
2684
+ if (!open) return;
2685
+ if (hasFetchedRef.current) return;
2686
+ if (!agentSelectorUrl) return;
2687
+ hasFetchedRef.current = true;
2688
+ const fetchAgents = async () => {
2689
+ setLoading(true);
2690
+ try {
2691
+ const res = await apiClient.get(agentSelectorUrl);
2692
+ if (res.success) {
2693
+ const raw = Array.isArray(res.data) ? res.data : [];
2694
+ setAgents(raw.map((d) => ({
2695
+ id: d.deploymentId ?? d.agentId ?? d.id,
2696
+ name: d.agentName ?? d.name,
2697
+ avatar: pickAvatar(d)
2698
+ })));
2699
+ }
2700
+ } catch {
2701
+ } finally {
2702
+ setLoading(false);
2703
+ }
2704
+ };
2705
+ fetchAgents();
2706
+ }, [open, agentSelectorUrl, apiClient]);
2707
+ const q = search.trim().toLowerCase();
2708
+ const filteredAgents = q ? agents.filter((a) => (a.name ?? "").toLowerCase().includes(q)) : agents;
2709
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 min-w-0 flex-1 overflow-hidden", children: [
2710
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-0.5 min-w-0 overflow-x-auto scrollbar-none", children: tabs.map((tab) => {
2711
+ const isActive = tab.id === activeTabId;
2712
+ const name = tab.name ?? (tab.pinned ? fallbackTitle : void 0);
2713
+ const avatar = tab.avatar ?? (tab.pinned ? fallbackLogo : void 0);
2714
+ return /* @__PURE__ */ jsxs(
2715
+ "div",
2716
+ {
2717
+ className: cn(
2718
+ "group/tab flex items-center gap-1.5 h-8 pl-2 pr-1 rounded-md cursor-pointer text-sm font-medium max-w-[200px] shrink-0 transition-colors",
2719
+ isActive ? "bg-accent text-foreground" : "text-muted-foreground hover:bg-accent/50 hover:text-foreground"
2720
+ ),
2721
+ onClick: () => onTabSelect(tab.id),
2722
+ children: [
2723
+ avatar ? /* @__PURE__ */ jsxs(Avatar, { className: "w-5 h-5 shrink-0 after:border-0", children: [
2724
+ /* @__PURE__ */ jsx(AvatarImage, { src: avatar, alt: name ?? "" }),
2725
+ /* @__PURE__ */ jsx(AvatarFallback, { className: "text-[10px] bg-transparent" })
2726
+ ] }) : /* @__PURE__ */ jsx("span", { className: "w-5 h-5 shrink-0" }),
2727
+ /* @__PURE__ */ jsx("span", { className: "truncate min-w-0", children: name ?? "" }),
2728
+ !tab.pinned ? /* @__PURE__ */ jsx(
2729
+ Button,
2730
+ {
2731
+ variant: "ghost",
2732
+ size: "icon",
2733
+ className: "h-5 w-5 shrink-0 rounded text-muted-foreground hover:text-foreground hover:bg-background/50 opacity-60 group-hover/tab:opacity-100",
2734
+ onClick: (e) => {
2735
+ e.stopPropagation();
2736
+ onTabClose(tab.id);
2737
+ },
2738
+ children: /* @__PURE__ */ jsx(X, { className: "w-3 h-3" })
2739
+ }
2740
+ ) : /* @__PURE__ */ jsx("span", { className: "w-5 shrink-0" })
2741
+ ]
2742
+ },
2743
+ tab.id
2744
+ );
2745
+ }) }),
2746
+ /* @__PURE__ */ jsxs(
2747
+ DropdownMenu$1,
2748
+ {
2749
+ open,
2750
+ onOpenChange: (o) => {
2751
+ setOpen(o);
2752
+ if (!o) setSearch("");
2753
+ },
2754
+ children: [
2755
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
2756
+ Button,
2757
+ {
2758
+ variant: "ghost",
2759
+ size: "icon",
2760
+ className: "h-7 w-7 shrink-0 text-muted-foreground hover:text-foreground rounded-md",
2761
+ title: "Add agent tab",
2762
+ children: /* @__PURE__ */ jsx(Plus, { className: "w-4 h-4" })
2763
+ }
2764
+ ) }),
2765
+ /* @__PURE__ */ jsxs(
2766
+ DropdownMenuContent,
2767
+ {
2768
+ align: "start",
2769
+ className: cn("w-64 p-0", isFullscreen && "z-[10000]"),
2770
+ onCloseAutoFocus: (e) => e.preventDefault(),
2771
+ children: [
2772
+ /* @__PURE__ */ jsx("div", { className: "p-2 border-b", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
2773
+ /* @__PURE__ */ jsx(Search, { className: "absolute left-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground pointer-events-none" }),
2774
+ /* @__PURE__ */ jsx(
2775
+ Input,
2776
+ {
2777
+ ref: searchRef,
2778
+ value: search,
2779
+ onChange: (e) => setSearch(e.target.value),
2780
+ onKeyDown: (e) => e.stopPropagation(),
2781
+ placeholder: "Search agents...",
2782
+ className: "h-7 pl-7 text-sm",
2783
+ autoFocus: true
2784
+ }
2785
+ )
2786
+ ] }) }),
2787
+ /* @__PURE__ */ jsx(ScrollArea$1, { className: "max-h-56", children: loading ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ jsx(Loader2, { className: "w-4 h-4 animate-spin text-muted-foreground" }) }) : filteredAgents.length === 0 ? /* @__PURE__ */ jsx("div", { className: "py-4 text-center text-xs text-muted-foreground", children: "No agents found" }) : /* @__PURE__ */ jsx(Fragment, { children: filteredAgents.map((agent) => /* @__PURE__ */ jsxs(
2788
+ DropdownMenuItem,
2789
+ {
2790
+ className: "cursor-pointer gap-2 px-3 py-2",
2791
+ onClick: () => {
2792
+ onAddTab({
2793
+ id: agent.id,
2794
+ type: "base",
2795
+ name: agent.name,
2796
+ avatar: agent.avatar
2797
+ });
2798
+ setOpen(false);
2799
+ setSearch("");
2800
+ },
2801
+ children: [
2802
+ /* @__PURE__ */ jsxs(Avatar, { className: "w-5 h-5 shrink-0 after:border-0", children: [
2803
+ agent.avatar && /* @__PURE__ */ jsx(AvatarImage, { src: agent.avatar, alt: agent.name ?? "" }),
2804
+ /* @__PURE__ */ jsx(AvatarFallback, { className: "bg-muted", children: /* @__PURE__ */ jsx(Brain, { className: "w-3 h-3 text-muted-foreground" }) })
2805
+ ] }),
2806
+ /* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: agent.name })
2807
+ ]
2808
+ },
2809
+ `agent-${agent.id}`
2810
+ )) }) })
2811
+ ]
2812
+ }
2813
+ )
2814
+ ]
2815
+ }
2816
+ )
2817
+ ] });
2818
+ };
2819
+ function AssistantDialogs({
2820
+ projectState,
2821
+ projectActions,
2822
+ sessionState,
2823
+ sessionActions,
2824
+ onUpdateProject,
2825
+ onDeleteProject,
2826
+ onUpdateSession,
2827
+ onDeleteSession,
2828
+ onUpdateProjectInstructions,
2829
+ t
2830
+ }) {
2831
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2832
+ /* @__PURE__ */ jsx(
2833
+ Dialog$1,
2834
+ {
2835
+ open: projectState.isEditing,
2836
+ onOpenChange: (open) => open ? projectActions.startEditing() : projectActions.stopEditing(),
2837
+ children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md z-[200]", children: [
2838
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("dialogs.edit_project") }) }),
2839
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4 py-4", children: [
2840
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2841
+ /* @__PURE__ */ jsx("label", { htmlFor: "project-name", className: "text-sm font-medium leading-none", children: t("labels.project_name") }),
2842
+ /* @__PURE__ */ jsx(
2843
+ Input,
2844
+ {
2845
+ id: "project-name",
2846
+ value: projectState.name,
2847
+ onChange: (e) => projectActions.setName(e.target.value),
2848
+ placeholder: t("placeholders.enter_project_name")
2849
+ }
2850
+ )
2851
+ ] }),
2852
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2853
+ /* @__PURE__ */ jsx("label", { htmlFor: "project-description", className: "text-sm font-medium leading-none", children: t("labels.description") }),
2854
+ /* @__PURE__ */ jsx(
2855
+ Textarea,
2856
+ {
2857
+ className: "resize-none",
2858
+ id: "project-description",
2859
+ value: projectState.description,
2860
+ onChange: (e) => projectActions.setDescription(e.target.value),
2861
+ placeholder: t("placeholders.enter_project_description"),
2862
+ rows: 3
2863
+ }
2864
+ )
2865
+ ] })
2866
+ ] }),
2867
+ /* @__PURE__ */ jsxs(DialogFooter, { children: [
2868
+ /* @__PURE__ */ jsx(Button, { className: "cursor-pointer", variant: "outline", onClick: () => projectActions.stopEditing(), children: t("buttons.cancel") }),
2869
+ /* @__PURE__ */ jsx(
2870
+ Button,
2871
+ {
2872
+ className: "bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer",
2873
+ onClick: onUpdateProject,
2874
+ disabled: projectState.isSaving || !projectState.name.trim(),
2875
+ children: projectState.isSaving ? t("buttons.saving") : t("buttons.save_changes")
2876
+ }
2877
+ )
2878
+ ] })
2879
+ ] })
2880
+ }
2881
+ ),
2882
+ /* @__PURE__ */ jsx(Dialog$1, { open: projectState.isDeleteDialogOpen, onOpenChange: projectActions.setDeleteDialogOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md z-[200]", children: [
2883
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("dialogs.delete_project") }) }),
2884
+ /* @__PURE__ */ jsx("div", { className: "space-y-4 py-4", children: /* @__PURE__ */ jsx("p", { children: t("messages.delete_project_confirm") }) }),
2885
+ /* @__PURE__ */ jsxs(DialogFooter, { children: [
2886
+ /* @__PURE__ */ jsx(
2887
+ Button,
2888
+ {
2889
+ className: "cursor-pointer",
2890
+ variant: "outline",
2891
+ onClick: () => projectActions.setDeleteDialogOpen(false),
2892
+ children: t("buttons.cancel")
2893
+ }
2894
+ ),
2895
+ /* @__PURE__ */ jsx(
2896
+ Button,
2897
+ {
2898
+ className: "bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer",
2899
+ onClick: onDeleteProject,
2900
+ disabled: projectState.isDeleting,
2901
+ children: projectState.isDeleting ? t("buttons.deleting") : t("buttons.delete_project")
2902
+ }
2903
+ )
2904
+ ] })
2905
+ ] }) }),
2906
+ /* @__PURE__ */ jsx(
2907
+ Dialog$1,
2908
+ {
2909
+ open: sessionState.isEditing,
2910
+ onOpenChange: (open) => open ? sessionActions.startEditing() : sessionActions.stopEditing(),
2911
+ children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md z-[200]", children: [
2912
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("dialogs.rename_session") }) }),
2913
+ /* @__PURE__ */ jsx("div", { className: "space-y-4 py-4", children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2914
+ /* @__PURE__ */ jsx("label", { htmlFor: "session-name", className: "text-sm font-medium leading-none", children: t("labels.session_name") }),
2915
+ /* @__PURE__ */ jsx(
2916
+ Input,
2917
+ {
2918
+ id: "session-name",
2919
+ value: sessionState.name,
2920
+ onChange: (e) => sessionActions.setName(e.target.value),
2921
+ placeholder: t("placeholders.enter_session_name")
2922
+ }
2923
+ )
2924
+ ] }) }),
2925
+ /* @__PURE__ */ jsxs(DialogFooter, { children: [
2926
+ /* @__PURE__ */ jsx(Button, { className: "cursor-pointer", variant: "outline", onClick: () => sessionActions.stopEditing(), children: t("buttons.cancel") }),
2927
+ /* @__PURE__ */ jsx(
2928
+ Button,
2929
+ {
2930
+ className: "bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer",
2931
+ onClick: onUpdateSession,
2932
+ disabled: sessionState.isSaving || !sessionState.name.trim(),
2933
+ children: sessionState.isSaving ? t("buttons.saving") : t("buttons.save_changes")
2934
+ }
2935
+ )
2936
+ ] })
2937
+ ] })
2938
+ }
2939
+ ),
2940
+ /* @__PURE__ */ jsx(Dialog$1, { open: sessionState.isDeleteDialogOpen, onOpenChange: sessionActions.setDeleteDialogOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md z-[200]", children: [
2941
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("dialogs.delete_session") }) }),
2942
+ /* @__PURE__ */ jsx("div", { className: "space-y-4 py-4", children: /* @__PURE__ */ jsx("p", { children: t("messages.delete_session_confirm") }) }),
2943
+ /* @__PURE__ */ jsxs(DialogFooter, { children: [
2944
+ /* @__PURE__ */ jsx(
2945
+ Button,
2946
+ {
2947
+ className: "cursor-pointer",
2948
+ variant: "outline",
2949
+ onClick: () => sessionActions.setDeleteDialogOpen(false),
2950
+ children: t("buttons.cancel")
2951
+ }
2952
+ ),
2953
+ /* @__PURE__ */ jsx(
2954
+ Button,
2955
+ {
2956
+ className: "bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer",
2957
+ onClick: onDeleteSession,
2958
+ disabled: sessionState.isDeleting,
2959
+ children: sessionState.isDeleting ? t("buttons.deleting") : t("buttons.delete_session")
2960
+ }
2961
+ )
2962
+ ] })
2963
+ ] }) }),
2964
+ /* @__PURE__ */ jsx(
2965
+ Dialog$1,
2966
+ {
2967
+ open: projectState.isEditingInstructions,
2968
+ onOpenChange: (open) => open ? projectActions.startEditingInstructions() : projectActions.stopEditingInstructions(),
2969
+ children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-lg z-[200]", children: [
2970
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("dialogs.edit_instructions") }) }),
2971
+ /* @__PURE__ */ jsx("div", { className: "space-y-4 py-4", children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2972
+ /* @__PURE__ */ jsx("label", { htmlFor: "project-instructions", className: "text-sm font-medium leading-none", children: t("sections.instructions") }),
2973
+ /* @__PURE__ */ jsx(
2974
+ Textarea,
2975
+ {
2976
+ id: "project-instructions",
2977
+ value: projectState.instructions,
2978
+ onChange: (e) => projectActions.setInstructions(e.target.value),
2979
+ placeholder: t("placeholders.add_instructions"),
2980
+ className: "min-h-30 resize-none",
2981
+ rows: 6
2982
+ }
2983
+ ),
2984
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("descriptions.instructions_help") })
2985
+ ] }) }),
2986
+ /* @__PURE__ */ jsxs(DialogFooter, { children: [
2987
+ /* @__PURE__ */ jsx(
2988
+ Button,
2989
+ {
2990
+ className: "cursor-pointer",
2991
+ variant: "outline",
2992
+ onClick: () => projectActions.stopEditingInstructions(),
2993
+ children: t("buttons.cancel")
2994
+ }
2995
+ ),
2996
+ /* @__PURE__ */ jsx(
2997
+ Button,
2998
+ {
2999
+ className: "bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer",
3000
+ onClick: onUpdateProjectInstructions,
3001
+ disabled: projectState.isSavingInstructions,
3002
+ children: projectState.isSavingInstructions ? t("buttons.saving") : t("buttons.save_instructions")
3003
+ }
3004
+ )
3005
+ ] })
3006
+ ] })
3007
+ }
3008
+ )
3009
+ ] });
3010
+ }
3011
+
3012
+ // src/types/index.ts
3013
+ var WorkTypes = {
3014
+ Record: "record",
3015
+ Data: "data",
3016
+ Text: "text",
3017
+ Code: "code",
3018
+ Image: "image",
3019
+ Xlsx: "xlsx",
3020
+ App: "app"
3021
+ };
3022
+ var BASE_DATA_SOURCE_ID = {
3023
+ thread: "f42b3daa-ca43-11ed-be9d-6fe3a1a7b37c",
3024
+ message: "010e9ce2-ca44-11ed-bda6-6b0c6905cf5e"
3025
+ };
3026
+ var SHARE_PERMISSIONS = {
3027
+ READ: 1,
3028
+ WRITE: 2,
3029
+ COMMENT: 4,
3030
+ SHARE: 8,
3031
+ DELETE: 16
3032
+ };
3033
+ var SHARE_PERMISSION_LEVELS = [
3034
+ { value: 1, label: "Can view" },
3035
+ { value: 3, label: "Can edit" },
3036
+ { value: 7, label: "Can comment" },
3037
+ { value: 11, label: "Can share" },
3038
+ { value: 31, label: "Full access" }
3039
+ ];
2879
3040
 
2880
3041
  // src/lib/message-utils.ts
2881
3042
  function processMessagesData(rawData) {
@@ -3909,6 +4070,7 @@ function useAssistantApi({
3909
4070
  const apiClient = useApiClient();
3910
4071
  const { user: configUser } = useAssistantConfig();
3911
4072
  const [agentDetails, setAgentDetails] = useState(null);
4073
+ const [agentDetailsForId, setAgentDetailsForId] = useState(null);
3912
4074
  const [isLoadingAgentDetails, setIsLoadingAgentDetails] = useState(!!tenantAiAgentId);
3913
4075
  const [subagents, setSubagents] = useState([]);
3914
4076
  const [agentTools, setAgentTools] = useState([]);
@@ -3922,6 +4084,7 @@ function useAssistantApi({
3922
4084
  let cancelled = false;
3923
4085
  const fetchAgentDetails = async () => {
3924
4086
  setAgentDetails(null);
4087
+ setAgentDetailsForId(null);
3925
4088
  setSubagents([]);
3926
4089
  setAgentTools([]);
3927
4090
  setIsLoadingAgentDetails(true);
@@ -3935,6 +4098,7 @@ function useAssistantApi({
3935
4098
  const name = data.name || data.agent?.agentName || data.agent?.name;
3936
4099
  const welcomeMessage = data.welcomeMessage || data.agent?.welcomeMessage;
3937
4100
  setAgentDetails({ logo: avatar, name, welcomeMessage });
4101
+ setAgentDetailsForId(effectiveId);
3938
4102
  const direct = data.agent?.agents || [];
3939
4103
  const connected = (data.agent?.connectedAgents || []).map((c) => ({
3940
4104
  ...c,
@@ -3947,12 +4111,14 @@ function useAssistantApi({
3947
4111
  setAgentTools([...rootTools, ...childTools]);
3948
4112
  } else {
3949
4113
  setAgentDetails({ logo, name: title });
4114
+ setAgentDetailsForId(effectiveId);
3950
4115
  }
3951
4116
  } catch (err) {
3952
4117
  console.error("[useAssistantApi] fetch error:", err);
3953
4118
  if (cancelled) return;
3954
4119
  fetchedAgentIdRef.current = effectiveId;
3955
4120
  setAgentDetails({ logo, name: title });
4121
+ setAgentDetailsForId(effectiveId);
3956
4122
  } finally {
3957
4123
  if (!cancelled) setIsLoadingAgentDetails(false);
3958
4124
  }
@@ -4229,6 +4395,7 @@ function useAssistantApi({
4229
4395
  }, [apiClient, t]);
4230
4396
  return {
4231
4397
  agentDetails,
4398
+ agentDetailsForId,
4232
4399
  isLoadingAgentDetails,
4233
4400
  subagents,
4234
4401
  agentTools,
@@ -7877,9 +8044,9 @@ function UserSelectFormField({
7877
8044
  className: "w-full justify-between",
7878
8045
  children: [
7879
8046
  selectedUser ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
7880
- /* @__PURE__ */ jsxs(Avatar, { size: "sm", children: [
7881
- /* @__PURE__ */ jsx(AvatarImage, { src: selectedUser.icon }),
7882
- /* @__PURE__ */ jsx(AvatarFallback, { children: selectedUser.name.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) })
8047
+ /* @__PURE__ */ jsxs(Avatar$1, { size: "sm", children: [
8048
+ /* @__PURE__ */ jsx(AvatarImage$1, { src: selectedUser.icon }),
8049
+ /* @__PURE__ */ jsx(AvatarFallback$1, { children: selectedUser.name.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) })
7883
8050
  ] }),
7884
8051
  selectedUser.name
7885
8052
  ] }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Select user..." }),
@@ -7911,9 +8078,9 @@ function UserSelectFormField({
7911
8078
  )
7912
8079
  }
7913
8080
  ),
7914
- /* @__PURE__ */ jsxs(Avatar, { size: "sm", className: "mr-2", children: [
7915
- /* @__PURE__ */ jsx(AvatarImage, { src: option.icon }),
7916
- /* @__PURE__ */ jsx(AvatarFallback, { children: option.name.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) })
8081
+ /* @__PURE__ */ jsxs(Avatar$1, { size: "sm", className: "mr-2", children: [
8082
+ /* @__PURE__ */ jsx(AvatarImage$1, { src: option.icon }),
8083
+ /* @__PURE__ */ jsx(AvatarFallback$1, { children: option.name.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) })
7917
8084
  ] }),
7918
8085
  option.name
7919
8086
  ]
@@ -7972,9 +8139,9 @@ function UserMultiSelectFormField({
7972
8139
  const user = enumOptions.find((o) => o.id === id);
7973
8140
  if (!user) return null;
7974
8141
  return /* @__PURE__ */ jsxs(Badge, { variant: "secondary", className: "gap-1", children: [
7975
- /* @__PURE__ */ jsxs(Avatar, { size: "sm", className: "size-4", children: [
7976
- /* @__PURE__ */ jsx(AvatarImage, { src: user.icon }),
7977
- /* @__PURE__ */ jsx(AvatarFallback, { className: "text-[8px]", children: user.name.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) })
8142
+ /* @__PURE__ */ jsxs(Avatar$1, { size: "sm", className: "size-4", children: [
8143
+ /* @__PURE__ */ jsx(AvatarImage$1, { src: user.icon }),
8144
+ /* @__PURE__ */ jsx(AvatarFallback$1, { className: "text-[8px]", children: user.name.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) })
7978
8145
  ] }),
7979
8146
  user.name,
7980
8147
  /* @__PURE__ */ jsx(
@@ -8017,9 +8184,9 @@ function UserMultiSelectFormField({
8017
8184
  )
8018
8185
  }
8019
8186
  ),
8020
- /* @__PURE__ */ jsxs(Avatar, { size: "sm", className: "mr-2", children: [
8021
- /* @__PURE__ */ jsx(AvatarImage, { src: option.icon }),
8022
- /* @__PURE__ */ jsx(AvatarFallback, { children: option.name.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) })
8187
+ /* @__PURE__ */ jsxs(Avatar$1, { size: "sm", className: "mr-2", children: [
8188
+ /* @__PURE__ */ jsx(AvatarImage$1, { src: option.icon }),
8189
+ /* @__PURE__ */ jsx(AvatarFallback$1, { children: option.name.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) })
8023
8190
  ] }),
8024
8191
  option.name
8025
8192
  ]
@@ -8101,9 +8268,9 @@ function RelationDropdown({
8101
8268
  className: "flex min-w-0 items-start gap-2",
8102
8269
  style: depth > 0 ? { paddingLeft: `${depth * 1}rem` } : void 0,
8103
8270
  children: [
8104
- imageValue ? /* @__PURE__ */ jsxs(Avatar, { size: "sm", className: "mt-0.5 shrink-0", children: [
8105
- /* @__PURE__ */ jsx(AvatarImage, { src: imageValue }),
8106
- /* @__PURE__ */ jsx(AvatarFallback, { children: option.name.slice(0, 2).toUpperCase() })
8271
+ imageValue ? /* @__PURE__ */ jsxs(Avatar$1, { size: "sm", className: "mt-0.5 shrink-0", children: [
8272
+ /* @__PURE__ */ jsx(AvatarImage$1, { src: imageValue }),
8273
+ /* @__PURE__ */ jsx(AvatarFallback$1, { children: option.name.slice(0, 2).toUpperCase() })
8107
8274
  ] }) : iconValue ? /* @__PURE__ */ jsx(
8108
8275
  "span",
8109
8276
  {
@@ -8401,9 +8568,9 @@ function RelationCardGrid({
8401
8568
  className: "flex min-w-0 flex-1 items-start gap-2",
8402
8569
  style: depth > 0 ? { paddingLeft: `${depth * 1}rem` } : void 0,
8403
8570
  children: [
8404
- imageValue ? /* @__PURE__ */ jsxs(Avatar, { size: "sm", className: "mt-0.5 shrink-0", children: [
8405
- /* @__PURE__ */ jsx(AvatarImage, { src: imageValue }),
8406
- /* @__PURE__ */ jsx(AvatarFallback, { children: option.name.slice(0, 2).toUpperCase() })
8571
+ imageValue ? /* @__PURE__ */ jsxs(Avatar$1, { size: "sm", className: "mt-0.5 shrink-0", children: [
8572
+ /* @__PURE__ */ jsx(AvatarImage$1, { src: imageValue }),
8573
+ /* @__PURE__ */ jsx(AvatarFallback$1, { children: option.name.slice(0, 2).toUpperCase() })
8407
8574
  ] }) : iconValue ? /* @__PURE__ */ jsx(
8408
8575
  "span",
8409
8576
  {
@@ -9746,9 +9913,9 @@ function ApprovalStatusSummary({
9746
9913
  const hasMeta = !!approval.comments || !!approval.respondedAt || !!approval.respondedBy || !!approval.respondedByUser;
9747
9914
  if (!hasMeta) return null;
9748
9915
  return /* @__PURE__ */ jsxs("div", { className: "flex w-fit items-start gap-2 rounded-md bg-slate-100 px-2 py-2 dark:bg-slate-900/50", children: [
9749
- /* @__PURE__ */ jsxs(Avatar, { size: "lg", children: [
9750
- avatarUrl && /* @__PURE__ */ jsx(AvatarImage, { src: avatarUrl, alt: actorName }),
9751
- /* @__PURE__ */ jsx(AvatarFallback, { children: getApprovalUserInitials(actorName) })
9916
+ /* @__PURE__ */ jsxs(Avatar$1, { size: "lg", children: [
9917
+ avatarUrl && /* @__PURE__ */ jsx(AvatarImage$1, { src: avatarUrl, alt: actorName }),
9918
+ /* @__PURE__ */ jsx(AvatarFallback$1, { children: getApprovalUserInitials(actorName) })
9752
9919
  ] }),
9753
9920
  /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1.5", children: [
9754
9921
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [
@@ -11228,21 +11395,21 @@ function UserValue({ value, enumOptions, className }) {
11228
11395
  const name = value.display_name ?? value.name ?? value.email ?? enumMatch?.name ?? value.id;
11229
11396
  const avatarUrl = value.avatar_url ?? value.profile_image_url;
11230
11397
  return /* @__PURE__ */ jsxs("span", { className: cn("inline-flex items-center gap-1.5", className), children: [
11231
- /* @__PURE__ */ jsxs(Avatar, { size: "sm", children: [
11232
- avatarUrl && /* @__PURE__ */ jsx(AvatarImage, { src: avatarUrl, alt: name }),
11233
- /* @__PURE__ */ jsx(AvatarFallback, { children: getInitials(name) })
11398
+ /* @__PURE__ */ jsxs(Avatar$1, { size: "sm", children: [
11399
+ avatarUrl && /* @__PURE__ */ jsx(AvatarImage$1, { src: avatarUrl, alt: name }),
11400
+ /* @__PURE__ */ jsx(AvatarFallback$1, { children: getInitials(name) })
11234
11401
  ] }),
11235
11402
  /* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: name })
11236
11403
  ] });
11237
11404
  }
11238
11405
  if (enumMatch) {
11239
11406
  return /* @__PURE__ */ jsxs("span", { className: cn("inline-flex items-center gap-1.5", className), children: [
11240
- /* @__PURE__ */ jsx(Avatar, { size: "sm", children: /* @__PURE__ */ jsx(AvatarFallback, { children: getInitials(enumMatch.name) }) }),
11407
+ /* @__PURE__ */ jsx(Avatar$1, { size: "sm", children: /* @__PURE__ */ jsx(AvatarFallback$1, { children: getInitials(enumMatch.name) }) }),
11241
11408
  /* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: enumMatch.name })
11242
11409
  ] });
11243
11410
  }
11244
11411
  return /* @__PURE__ */ jsxs("span", { className: cn("inline-flex items-center gap-1.5", className), children: [
11245
- /* @__PURE__ */ jsx(Avatar, { size: "sm", children: /* @__PURE__ */ jsx(AvatarFallback, { children: /* @__PURE__ */ jsx(User, { className: "size-3" }) }) }),
11412
+ /* @__PURE__ */ jsx(Avatar$1, { size: "sm", children: /* @__PURE__ */ jsx(AvatarFallback$1, { children: /* @__PURE__ */ jsx(User, { className: "size-3" }) }) }),
11246
11413
  /* @__PURE__ */ jsx("span", { className: "truncate text-sm text-muted-foreground", children: String(value).slice(0, 8) })
11247
11414
  ] });
11248
11415
  }
@@ -11263,16 +11430,16 @@ function UserMultiValue({ value, enumOptions, className }) {
11263
11430
  const enumMatch2 = userId ? enumOptions?.find((o) => o.id === userId) : void 0;
11264
11431
  const name = item.display_name ?? item.name ?? item.email ?? enumMatch2?.name ?? item.id;
11265
11432
  const avatarUrl = item.avatar_url ?? item.profile_image_url;
11266
- return /* @__PURE__ */ jsxs(Avatar, { size: "sm", children: [
11267
- avatarUrl && /* @__PURE__ */ jsx(AvatarImage, { src: avatarUrl, alt: name }),
11268
- /* @__PURE__ */ jsx(AvatarFallback, { children: getInitials2(name) })
11433
+ return /* @__PURE__ */ jsxs(Avatar$1, { size: "sm", children: [
11434
+ avatarUrl && /* @__PURE__ */ jsx(AvatarImage$1, { src: avatarUrl, alt: name }),
11435
+ /* @__PURE__ */ jsx(AvatarFallback$1, { children: getInitials2(name) })
11269
11436
  ] }, item.id);
11270
11437
  }
11271
11438
  const enumMatch = typeof item === "string" ? enumOptions?.find((o) => o.id === item) : void 0;
11272
11439
  if (enumMatch) {
11273
- return /* @__PURE__ */ jsx(Avatar, { size: "sm", children: /* @__PURE__ */ jsx(AvatarFallback, { children: getInitials2(enumMatch.name) }) }, `user-${String(item)}-${idx}`);
11440
+ return /* @__PURE__ */ jsx(Avatar$1, { size: "sm", children: /* @__PURE__ */ jsx(AvatarFallback$1, { children: getInitials2(enumMatch.name) }) }, `user-${String(item)}-${idx}`);
11274
11441
  }
11275
- return /* @__PURE__ */ jsx(Avatar, { size: "sm", children: /* @__PURE__ */ jsx(AvatarFallback, { children: /* @__PURE__ */ jsx(User, { className: "size-3" }) }) }, `user-${String(item)}-${idx}`);
11442
+ return /* @__PURE__ */ jsx(Avatar$1, { size: "sm", children: /* @__PURE__ */ jsx(AvatarFallback$1, { children: /* @__PURE__ */ jsx(User, { className: "size-3" }) }) }, `user-${String(item)}-${idx}`);
11276
11443
  }) });
11277
11444
  }
11278
11445
  function isExpandedRelation(val) {
@@ -11640,9 +11807,9 @@ function ApprovalSummary({
11640
11807
  const hasMeta = !!respondedAt || !!respondedBy || !!respondedByUser || !!comments;
11641
11808
  if (!hasMeta) return null;
11642
11809
  return /* @__PURE__ */ jsxs("div", { className: "flex w-fit max-w-full items-start gap-2 rounded-md bg-slate-100 px-2 py-2 dark:bg-slate-900/50", children: [
11643
- /* @__PURE__ */ jsxs(Avatar, { size: "sm", children: [
11644
- avatarUrl && /* @__PURE__ */ jsx(AvatarImage, { src: avatarUrl, alt: actorName }),
11645
- /* @__PURE__ */ jsx(AvatarFallback, { children: getApprovalUserInitials(actorName) })
11810
+ /* @__PURE__ */ jsxs(Avatar$1, { size: "sm", children: [
11811
+ avatarUrl && /* @__PURE__ */ jsx(AvatarImage$1, { src: avatarUrl, alt: actorName }),
11812
+ /* @__PURE__ */ jsx(AvatarFallback$1, { children: getApprovalUserInitials(actorName) })
11646
11813
  ] }),
11647
11814
  /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [
11648
11815
  comments && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground truncate text-xs", children: comments }),
@@ -13929,9 +14096,9 @@ function ImageElement({ element }) {
13929
14096
  width: style.width ?? void 0,
13930
14097
  height: style.height ?? void 0
13931
14098
  };
13932
- img = /* @__PURE__ */ jsxs(Avatar$1, { className: cn("overflow-hidden rounded-full", dimension.className), style: sizeStyle, children: [
13933
- /* @__PURE__ */ jsx(AvatarImage$1, { src: element.url, alt: altText }),
13934
- /* @__PURE__ */ jsx(AvatarFallback$1, { children: altText.charAt(0)?.toUpperCase() || "\xB7" })
14099
+ img = /* @__PURE__ */ jsxs(Avatar, { className: cn("overflow-hidden rounded-full", dimension.className), style: sizeStyle, children: [
14100
+ /* @__PURE__ */ jsx(AvatarImage, { src: element.url, alt: altText }),
14101
+ /* @__PURE__ */ jsx(AvatarFallback, { children: altText.charAt(0)?.toUpperCase() || "\xB7" })
13935
14102
  ] });
13936
14103
  } else {
13937
14104
  img = /* @__PURE__ */ jsx(
@@ -16480,7 +16647,7 @@ function ForwardToAgent({ agentId, onForward }) {
16480
16647
  const apiClient = useApiClient();
16481
16648
  const [agentName, setAgentName] = useState("");
16482
16649
  const [avatar, setAvatar] = useState("");
16483
- const [loading, setLoading] = useState(false);
16650
+ const [forwarded, setForwarded] = useState(false);
16484
16651
  useEffect(() => {
16485
16652
  if (!agentId) {
16486
16653
  setAgentName("");
@@ -16488,7 +16655,6 @@ function ForwardToAgent({ agentId, onForward }) {
16488
16655
  return;
16489
16656
  }
16490
16657
  const fetchAgent = async () => {
16491
- setLoading(true);
16492
16658
  try {
16493
16659
  const response = await apiClient.get(`/ai/agents/${agentId}`);
16494
16660
  if (response.success && response.data) {
@@ -16499,38 +16665,35 @@ function ForwardToAgent({ agentId, onForward }) {
16499
16665
  }
16500
16666
  } catch (err) {
16501
16667
  console.error("[ForwardToAgent] Error fetching agent:", err);
16502
- } finally {
16503
- setLoading(false);
16504
16668
  }
16505
16669
  };
16506
16670
  fetchAgent();
16507
16671
  }, [agentId, apiClient]);
16508
- return /* @__PURE__ */ jsxs("div", { className: "p-4 m-2 border bg-white border-slate-200 max-w-[500px] rounded-lg animate-bounce-subtle", children: [
16672
+ const handleClick = () => {
16673
+ if (forwarded) return;
16674
+ setForwarded(true);
16675
+ onForward?.();
16676
+ };
16677
+ return /* @__PURE__ */ jsxs("div", { className: "p-3 m-2 border bg-background border-border max-w-[500px] rounded-lg animate-bounce-subtle", children: [
16509
16678
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
16510
- /* @__PURE__ */ jsx(ArrowRight, { className: "size-5 text-blue-500 flex-shrink-0" }),
16511
- /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-slate-700 whitespace-nowrap", children: "Forwarding to agent" }),
16512
- (avatar || agentName) && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 ml-1", children: [
16513
- avatar && /* @__PURE__ */ jsx(
16514
- "img",
16515
- {
16516
- src: avatar,
16517
- alt: "Agent Avatar",
16518
- className: "w-5 h-5 rounded-full object-cover"
16519
- }
16520
- ),
16521
- agentName && /* @__PURE__ */ jsx("span", { className: "inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-700", children: agentName })
16522
- ] })
16679
+ /* @__PURE__ */ jsx(ArrowRight, { className: "size-4 text-blue-500 shrink-0" }),
16680
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground whitespace-nowrap", children: forwarded ? "Forwarded to" : "Forward to" }),
16681
+ /* @__PURE__ */ jsxs(Avatar, { className: "w-6 h-6 shrink-0 after:border-0", children: [
16682
+ avatar && /* @__PURE__ */ jsx(AvatarImage, { src: avatar, alt: agentName }),
16683
+ /* @__PURE__ */ jsx(AvatarFallback, { className: "text-[10px]", children: (agentName || "A").slice(0, 2).toUpperCase() })
16684
+ ] }),
16685
+ agentName && /* @__PURE__ */ jsx("span", { className: "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300", children: agentName })
16523
16686
  ] }),
16524
- /* @__PURE__ */ jsx("div", { className: "mt-3 flex justify-end", children: /* @__PURE__ */ jsxs(
16687
+ !forwarded && /* @__PURE__ */ jsx("div", { className: "mt-3 flex justify-end", children: /* @__PURE__ */ jsxs(
16525
16688
  Button,
16526
16689
  {
16527
16690
  size: "sm",
16528
- disabled: loading,
16529
- onClick: onForward,
16691
+ onClick: handleClick,
16692
+ disabled: !agentId,
16530
16693
  className: "gap-1.5 bg-emerald-600 hover:bg-emerald-700 text-white",
16531
16694
  children: [
16532
16695
  /* @__PURE__ */ jsx(ArrowRight, { className: "size-3.5" }),
16533
- agentName ? `Forward to ${agentName}` : "Forward to agent"
16696
+ agentName ? `Forward to ${agentName}` : "Forward"
16534
16697
  ]
16535
16698
  }
16536
16699
  ) })
@@ -19400,7 +19563,8 @@ function ChatPanel({
19400
19563
  agentTools,
19401
19564
  onManageMemories,
19402
19565
  appContext,
19403
- onClearAppContext
19566
+ onClearAppContext,
19567
+ onForwardToAgent
19404
19568
  }) {
19405
19569
  const renderAppContextChip = () => {
19406
19570
  if (!appContext) return null;
@@ -19517,6 +19681,7 @@ function ChatPanel({
19517
19681
  agents: subagents,
19518
19682
  agentTools,
19519
19683
  onToolAction,
19684
+ onForwardToAgent,
19520
19685
  openCanvasView,
19521
19686
  onEditPrompt,
19522
19687
  className: messagesClassName
@@ -22264,7 +22429,7 @@ var buttonVariants = cva(
22264
22429
  }
22265
22430
  }
22266
22431
  );
22267
- var Button38 = withTooltip(({
22432
+ var Button39 = withTooltip(({
22268
22433
  active,
22269
22434
  asChild = false,
22270
22435
  children,
@@ -22872,7 +23037,7 @@ function AIMenu() {
22872
23037
  }
22873
23038
  ),
22874
23039
  /* @__PURE__ */ jsx(
22875
- Button38,
23040
+ Button39,
22876
23041
  {
22877
23042
  className: "no-focus-ring mt-1 shrink-0",
22878
23043
  disabled: !isLoading && input.trim().length === 0,
@@ -23456,10 +23621,10 @@ var dropdownMenuLabelVariants = cva(
23456
23621
  }
23457
23622
  }
23458
23623
  );
23459
- function DropdownMenu4(props) {
23624
+ function DropdownMenu5(props) {
23460
23625
  return /* @__PURE__ */ jsx(DropdownMenu.Root, { ...props });
23461
23626
  }
23462
- function DropdownMenuTrigger4(props) {
23627
+ function DropdownMenuTrigger5(props) {
23463
23628
  return /* @__PURE__ */ jsx(DropdownMenu.Trigger, { ...props });
23464
23629
  }
23465
23630
  function DropdownMenuGroup(props) {
@@ -23513,7 +23678,7 @@ function DropdownMenuSubContent({
23513
23678
  }
23514
23679
  );
23515
23680
  }
23516
- function DropdownMenuContent4({
23681
+ function DropdownMenuContent5({
23517
23682
  className,
23518
23683
  portal,
23519
23684
  ...props
@@ -23535,7 +23700,7 @@ function DropdownMenuContent4({
23535
23700
  }
23536
23701
  return content;
23537
23702
  }
23538
- function DropdownMenuItem4({
23703
+ function DropdownMenuItem5({
23539
23704
  className,
23540
23705
  ...props
23541
23706
  }) {
@@ -23735,9 +23900,9 @@ function Comment(props) {
23735
23900
  onMouseLeave: () => setHovering(false),
23736
23901
  children: [
23737
23902
  /* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
23738
- userInfo && /* @__PURE__ */ jsxs(Avatar, { className: "size-6", children: [
23739
- /* @__PURE__ */ jsx(AvatarImage, { alt: userInfo.name, src: userInfo.avatarUrl }),
23740
- /* @__PURE__ */ jsx(AvatarFallback, { children: userInfo.name?.[0] })
23903
+ userInfo && /* @__PURE__ */ jsxs(Avatar$1, { className: "size-6", children: [
23904
+ /* @__PURE__ */ jsx(AvatarImage$1, { alt: userInfo.name, src: userInfo.avatarUrl }),
23905
+ /* @__PURE__ */ jsx(AvatarFallback$1, { children: userInfo.name?.[0] })
23741
23906
  ] }),
23742
23907
  /* @__PURE__ */ jsx("h4", { className: "mx-2 font-semibold text-sm leading-none", children: userInfo?.name }),
23743
23908
  /* @__PURE__ */ jsxs("div", { className: "text-muted-foreground/80 text-xs leading-none", children: [
@@ -23746,7 +23911,7 @@ function Comment(props) {
23746
23911
  ] }),
23747
23912
  isMyComment && (hovering || dropdownOpen) && /* @__PURE__ */ jsxs("div", { className: "absolute top-0 right-0 flex space-x-1", children: [
23748
23913
  index === 0 && /* @__PURE__ */ jsx(
23749
- Button38,
23914
+ Button39,
23750
23915
  {
23751
23916
  className: "h-6 p-1 text-muted-foreground",
23752
23917
  onClick: onResolveComment,
@@ -23795,7 +23960,7 @@ function Comment(props) {
23795
23960
  ),
23796
23961
  isEditing && /* @__PURE__ */ jsxs("div", { className: "ml-auto flex shrink-0 gap-1", children: [
23797
23962
  /* @__PURE__ */ jsx(
23798
- Button38,
23963
+ Button39,
23799
23964
  {
23800
23965
  className: "size-[28px]",
23801
23966
  onClick: (e) => {
@@ -23808,7 +23973,7 @@ function Comment(props) {
23808
23973
  }
23809
23974
  ),
23810
23975
  /* @__PURE__ */ jsx(
23811
- Button38,
23976
+ Button39,
23812
23977
  {
23813
23978
  onClick: (e) => {
23814
23979
  e.stopPropagation();
@@ -23870,15 +24035,15 @@ function CommentMoreDropdown(props) {
23870
24035
  setEditingId(comment.id);
23871
24036
  }, [comment.id, setEditingId]);
23872
24037
  return /* @__PURE__ */ jsxs(
23873
- DropdownMenu4,
24038
+ DropdownMenu5,
23874
24039
  {
23875
24040
  modal: false,
23876
24041
  onOpenChange: setDropdownOpen,
23877
24042
  open: dropdownOpen,
23878
24043
  children: [
23879
- /* @__PURE__ */ jsx(DropdownMenuTrigger4, { asChild: true, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(Button38, { className: cn("h-6 p-1 text-muted-foreground"), variant: "ghost", children: /* @__PURE__ */ jsx(MoreHorizontalIcon, { className: "size-4" }) }) }),
24044
+ /* @__PURE__ */ jsx(DropdownMenuTrigger5, { asChild: true, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(Button39, { className: cn("h-6 p-1 text-muted-foreground"), variant: "ghost", children: /* @__PURE__ */ jsx(MoreHorizontalIcon, { className: "size-4" }) }) }),
23880
24045
  /* @__PURE__ */ jsx(
23881
- DropdownMenuContent4,
24046
+ DropdownMenuContent5,
23882
24047
  {
23883
24048
  className: "w-48",
23884
24049
  onCloseAutoFocus: (e) => {
@@ -23889,11 +24054,11 @@ function CommentMoreDropdown(props) {
23889
24054
  return e.preventDefault();
23890
24055
  },
23891
24056
  children: /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
23892
- /* @__PURE__ */ jsxs(DropdownMenuItem4, { onClick: onEditComment, children: [
24057
+ /* @__PURE__ */ jsxs(DropdownMenuItem5, { onClick: onEditComment, children: [
23893
24058
  /* @__PURE__ */ jsx(PencilIcon, { className: "size-4" }),
23894
24059
  "Edit comment"
23895
24060
  ] }),
23896
- /* @__PURE__ */ jsxs(DropdownMenuItem4, { onClick: onDeleteComment, children: [
24061
+ /* @__PURE__ */ jsxs(DropdownMenuItem5, { onClick: onDeleteComment, children: [
23897
24062
  /* @__PURE__ */ jsx(TrashIcon, { className: "size-4" }),
23898
24063
  "Delete comment"
23899
24064
  ] })
@@ -24019,9 +24184,9 @@ function CommentCreateForm({
24019
24184
  discussions
24020
24185
  ]);
24021
24186
  return /* @__PURE__ */ jsxs("div", { className: cn("flex w-full", className), children: [
24022
- /* @__PURE__ */ jsx("div", { className: "mt-1 mr-1 shrink-0", children: /* @__PURE__ */ jsxs(Avatar, { className: "size-5", children: [
24023
- /* @__PURE__ */ jsx(AvatarImage, { alt: userInfo?.name, src: userInfo?.avatarUrl }),
24024
- /* @__PURE__ */ jsx(AvatarFallback, { children: userInfo?.name?.[0] })
24187
+ /* @__PURE__ */ jsx("div", { className: "mt-1 mr-1 shrink-0", children: /* @__PURE__ */ jsxs(Avatar$1, { className: "size-5", children: [
24188
+ /* @__PURE__ */ jsx(AvatarImage$1, { alt: userInfo?.name, src: userInfo?.avatarUrl }),
24189
+ /* @__PURE__ */ jsx(AvatarFallback$1, { children: userInfo?.name?.[0] })
24025
24190
  ] }) }),
24026
24191
  /* @__PURE__ */ jsx("div", { className: "relative flex grow gap-2", children: /* @__PURE__ */ jsx(
24027
24192
  Plate,
@@ -24048,7 +24213,7 @@ function CommentCreateForm({
24048
24213
  }
24049
24214
  ),
24050
24215
  /* @__PURE__ */ jsx(
24051
- Button38,
24216
+ Button39,
24052
24217
  {
24053
24218
  className: "absolute right-0 bottom-0 ml-auto shrink-0",
24054
24219
  disabled: commentContent.trim().length === 0,
@@ -24322,9 +24487,9 @@ function BlockSuggestionCard({
24322
24487
  children: [
24323
24488
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col p-4", children: [
24324
24489
  /* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
24325
- /* @__PURE__ */ jsxs(Avatar, { className: "size-5", children: [
24326
- /* @__PURE__ */ jsx(AvatarImage, { alt: userInfo?.name, src: userInfo?.avatarUrl }),
24327
- /* @__PURE__ */ jsx(AvatarFallback, { children: userInfo?.name?.[0] })
24490
+ /* @__PURE__ */ jsxs(Avatar$1, { className: "size-5", children: [
24491
+ /* @__PURE__ */ jsx(AvatarImage$1, { alt: userInfo?.name, src: userInfo?.avatarUrl }),
24492
+ /* @__PURE__ */ jsx(AvatarFallback$1, { children: userInfo?.name?.[0] })
24328
24493
  ] }),
24329
24494
  /* @__PURE__ */ jsx("h4", { className: "mx-2 font-semibold text-sm leading-none", children: userInfo?.name }),
24330
24495
  /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/80 text-xs leading-none", children: /* @__PURE__ */ jsx("span", { className: "mr-1", children: formatCommentDate(new Date(suggestion.createdAt)) }) })
@@ -24382,7 +24547,7 @@ function BlockSuggestionCard({
24382
24547
  )),
24383
24548
  hovering && /* @__PURE__ */ jsxs("div", { className: "absolute top-4 right-4 flex gap-2", children: [
24384
24549
  /* @__PURE__ */ jsx(
24385
- Button38,
24550
+ Button39,
24386
24551
  {
24387
24552
  variant: "ghost",
24388
24553
  className: "size-6 p-1 text-muted-foreground",
@@ -24391,7 +24556,7 @@ function BlockSuggestionCard({
24391
24556
  }
24392
24557
  ),
24393
24558
  /* @__PURE__ */ jsx(
24394
- Button38,
24559
+ Button39,
24395
24560
  {
24396
24561
  variant: "ghost",
24397
24562
  className: "size-6 p-1 text-muted-foreground",
@@ -24861,7 +25026,7 @@ var BlockCommentsContent = ({
24861
25026
  }
24862
25027
  ),
24863
25028
  totalCount > 0 && /* @__PURE__ */ jsx("div", { className: "relative left-0 size-0 select-none", children: /* @__PURE__ */ jsx(PopoverTrigger13, { asChild: true, children: /* @__PURE__ */ jsxs(
24864
- Button38,
25029
+ Button39,
24865
25030
  {
24866
25031
  className: "mt-1 ml-1 flex h-6 gap-1 px-1.5 py-0 text-muted-foreground/80 hover:text-muted-foreground/80 data-[active=true]:bg-muted",
24867
25032
  contentEditable: false,
@@ -25553,7 +25718,7 @@ var inputVariants = cva(
25553
25718
  }
25554
25719
  }
25555
25720
  );
25556
- function Input21({ className, variant, ...props }) {
25721
+ function Input22({ className, variant, ...props }) {
25557
25722
  return /* @__PURE__ */ jsx("input", { className: cn(inputVariants({ variant }), className), ...props });
25558
25723
  }
25559
25724
  var ACTION_THREE_COLUMNS = "action_three_columns";
@@ -26033,8 +26198,8 @@ function FontColorToolbarButton(props) {
26033
26198
  onBackgroundChange(lastUsed.value);
26034
26199
  }
26035
26200
  }, [lastUsed]);
26036
- return /* @__PURE__ */ jsxs(DropdownMenu4, { modal: false, ...props, onOpenChange, children: [
26037
- /* @__PURE__ */ jsx(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarButton, { isDropdown: true, pressed: false, tooltip: "Color", children: /* @__PURE__ */ jsx(
26201
+ return /* @__PURE__ */ jsxs(DropdownMenu5, { modal: false, ...props, onOpenChange, children: [
26202
+ /* @__PURE__ */ jsx(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarButton, { isDropdown: true, pressed: false, tooltip: "Color", children: /* @__PURE__ */ jsx(
26038
26203
  "div",
26039
26204
  {
26040
26205
  className: "size-4 rounded-full",
@@ -26044,7 +26209,7 @@ function FontColorToolbarButton(props) {
26044
26209
  }
26045
26210
  ) }) }),
26046
26211
  /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsxs(
26047
- DropdownMenuContent4,
26212
+ DropdownMenuContent5,
26048
26213
  {
26049
26214
  align: "start",
26050
26215
  className: "ignore-click-outside/toolbar h-96 overflow-y-auto",
@@ -26248,10 +26413,10 @@ function TurnIntoToolbarButton(props) {
26248
26413
  () => turnIntoItems.find((item) => item.value === (value ?? KEYS.p)) ?? turnIntoItems[0],
26249
26414
  [value]
26250
26415
  );
26251
- return /* @__PURE__ */ jsxs(DropdownMenu4, { modal: false, ...openState, ...props, children: [
26252
- /* @__PURE__ */ jsx(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarButton, { isDropdown: true, pressed: openState.open, tooltip: "Turn into", children: selectedItem.label }) }),
26416
+ return /* @__PURE__ */ jsxs(DropdownMenu5, { modal: false, ...openState, ...props, children: [
26417
+ /* @__PURE__ */ jsx(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarButton, { isDropdown: true, pressed: openState.open, tooltip: "Turn into", children: selectedItem.label }) }),
26253
26418
  /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(
26254
- DropdownMenuContent4,
26419
+ DropdownMenuContent5,
26255
26420
  {
26256
26421
  align: "start",
26257
26422
  className: "ignore-click-outside/toolbar min-w-0",
@@ -26373,7 +26538,7 @@ function BlockMenuInput({ onHide }) {
26373
26538
  },
26374
26539
  { enableOnFormTags: true }
26375
26540
  );
26376
- return /* @__PURE__ */ jsx(ComboboxInput, { children: /* @__PURE__ */ jsx(Input21, { placeholder: "Search actions..." }) });
26541
+ return /* @__PURE__ */ jsx(ComboboxInput, { children: /* @__PURE__ */ jsx(Input22, { placeholder: "Search actions..." }) });
26377
26542
  }
26378
26543
  function AIIcon(props) {
26379
26544
  return /* @__PURE__ */ jsxs(
@@ -26777,7 +26942,7 @@ function BlockActionButton({
26777
26942
  const editor = useEditorRef();
26778
26943
  const element = useElement();
26779
26944
  return /* @__PURE__ */ jsx(
26780
- Button38,
26945
+ Button39,
26781
26946
  {
26782
26947
  className: cn(
26783
26948
  defaultStyles && "absolute top-1 right-1 opacity-0 transition-opacity group-hover:opacity-100",
@@ -27116,7 +27281,7 @@ function EmojiPickerSearchAndClear({
27116
27281
  }
27117
27282
  ),
27118
27283
  searchValue && /* @__PURE__ */ jsx(
27119
- Button38,
27284
+ Button39,
27120
27285
  {
27121
27286
  "aria-label": "Clear",
27122
27287
  className: cn(
@@ -27205,7 +27370,7 @@ function EmojiPickerNavigation({
27205
27370
  id: "emoji-nav",
27206
27371
  children: /* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
27207
27372
  emojiLibrary.getGrid().sections().map(({ id }) => /* @__PURE__ */ jsx(
27208
- Button38,
27373
+ Button39,
27209
27374
  {
27210
27375
  "aria-label": i18n.categories[id],
27211
27376
  className: cn(
@@ -27367,7 +27532,7 @@ function CalloutElement(props) {
27367
27532
  {
27368
27533
  ...emojiToolbarDropdownProps,
27369
27534
  control: /* @__PURE__ */ jsx(
27370
- Button38,
27535
+ Button39,
27371
27536
  {
27372
27537
  className: "size-6 select-none p-1 text-[18px] hover:bg-muted-foreground/15",
27373
27538
  contentEditable: false,
@@ -27606,7 +27771,7 @@ function CodeBlockElement2(props) {
27606
27771
  contentEditable: false,
27607
27772
  children: [
27608
27773
  /* @__PURE__ */ jsxs(
27609
- Button38,
27774
+ Button39,
27610
27775
  {
27611
27776
  className: "relative top-0 right-0 w-auto",
27612
27777
  onClick: () => {
@@ -27651,7 +27816,7 @@ function CodeBlockCombobox({ className }) {
27651
27816
  if (readOnly) return null;
27652
27817
  return /* @__PURE__ */ jsxs(Popover13, { onOpenChange: setOpen, open, children: [
27653
27818
  /* @__PURE__ */ jsx(PopoverTrigger13, { asChild: true, children: /* @__PURE__ */ jsxs(
27654
- Button38,
27819
+ Button39,
27655
27820
  {
27656
27821
  "aria-expanded": open,
27657
27822
  className: cn(
@@ -27680,7 +27845,7 @@ function CodeBlockCombobox({ className }) {
27680
27845
  asChild: true,
27681
27846
  onValueChange: (v) => setSearchValue(v),
27682
27847
  value: searchValue,
27683
- children: /* @__PURE__ */ jsx(Input21, { placeholder: "Search language..." })
27848
+ children: /* @__PURE__ */ jsx(Input22, { placeholder: "Search language..." })
27684
27849
  }
27685
27850
  ),
27686
27851
  /* @__PURE__ */ jsx(CommandEmpty5, { children: "No language found." }),
@@ -28012,7 +28177,7 @@ function Draggable(props) {
28012
28177
  ),
28013
28178
  children: [
28014
28179
  /* @__PURE__ */ jsx(
28015
- Button38,
28180
+ Button39,
28016
28181
  {
28017
28182
  className: "absolute right-0 h-6 w-6 p-0",
28018
28183
  "data-plate-prevent-deselect": true,
@@ -28199,7 +28364,7 @@ var DraggableInsertHandle = () => {
28199
28364
  const editor = useEditorRef();
28200
28365
  const element = useElement();
28201
28366
  return /* @__PURE__ */ jsx(
28202
- Button38,
28367
+ Button39,
28203
28368
  {
28204
28369
  className: "size-6 shrink-0 p-1",
28205
28370
  onClick: (event) => {
@@ -29430,7 +29595,7 @@ function EquationPopoverContent({
29430
29595
  ...props
29431
29596
  }
29432
29597
  ),
29433
- /* @__PURE__ */ jsxs(Button38, { className: "px-3", onClick: onClose, variant: "brand", children: [
29598
+ /* @__PURE__ */ jsxs(Button39, { className: "px-3", onClick: onClose, variant: "brand", children: [
29434
29599
  "Done ",
29435
29600
  /* @__PURE__ */ jsx(CornerDownLeftIcon, { className: "size-3.5" })
29436
29601
  ] })
@@ -29627,8 +29792,8 @@ function MediaAlignButton({
29627
29792
  openState,
29628
29793
  setAlignOpen: props.setAlignOpen
29629
29794
  });
29630
- return /* @__PURE__ */ jsxs(DropdownMenu4, { modal: false, ...openState, ...props, children: [
29631
- /* @__PURE__ */ jsx(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx(
29795
+ return /* @__PURE__ */ jsxs(DropdownMenu5, { modal: false, ...openState, ...props, children: [
29796
+ /* @__PURE__ */ jsx(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsx(
29632
29797
  ToolbarButton,
29633
29798
  {
29634
29799
  "data-state": openState.open ? "open" : "closed",
@@ -29639,7 +29804,7 @@ function MediaAlignButton({
29639
29804
  }
29640
29805
  ) }),
29641
29806
  /* @__PURE__ */ jsx(
29642
- DropdownMenuContent4,
29807
+ DropdownMenuContent5,
29643
29808
  {
29644
29809
  align: "start",
29645
29810
  className: "min-w-0 rounded-md border-none bg-black/60 p-0 shadow-none",
@@ -30308,7 +30473,7 @@ function MediaPlaceholderPopover({ children }) {
30308
30473
  /* @__PURE__ */ jsx(TabsTrigger, { value: "password", children: "Embed link" })
30309
30474
  ] }),
30310
30475
  /* @__PURE__ */ jsxs(TabsContent, { className: "w-[300px] px-3 py-2", value: "account", children: [
30311
- /* @__PURE__ */ jsx(Button38, { className: "w-full", onClick: openFilePicker, variant: "brand", children: currentMedia.buttonText }),
30476
+ /* @__PURE__ */ jsx(Button39, { className: "w-full", onClick: openFilePicker, variant: "brand", children: currentMedia.buttonText }),
30312
30477
  /* @__PURE__ */ jsx("div", { className: "mt-3 text-muted-foreground text-xs", children: "The maximum size per file is 5MB" })
30313
30478
  ] }),
30314
30479
  /* @__PURE__ */ jsxs(
@@ -30318,7 +30483,7 @@ function MediaPlaceholderPopover({ children }) {
30318
30483
  value: "password",
30319
30484
  children: [
30320
30485
  /* @__PURE__ */ jsx(
30321
- Input21,
30486
+ Input22,
30322
30487
  {
30323
30488
  onChange: (e) => setEmbedValue(e.target.value),
30324
30489
  placeholder: "Paste the link...",
@@ -30326,7 +30491,7 @@ function MediaPlaceholderPopover({ children }) {
30326
30491
  }
30327
30492
  ),
30328
30493
  /* @__PURE__ */ jsx(
30329
- Button38,
30494
+ Button39,
30330
30495
  {
30331
30496
  className: "mt-2 w-full max-w-[300px]",
30332
30497
  onClick: () => onEmbed(embedValue),
@@ -30446,12 +30611,12 @@ function ImagePreview() {
30446
30611
  onClick: (e) => e.stopPropagation(),
30447
30612
  children: [
30448
30613
  !prevDisabled && !nextDisabled && /* @__PURE__ */ jsxs("div", { className: "flex rounded-sm bg-black/70", children: [
30449
- /* @__PURE__ */ jsx(Button38, { ...prevProps, disabled: prevDisabled, children: /* @__PURE__ */ jsx(ArrowLeftIcon, { className: "size-5" }) }),
30450
- /* @__PURE__ */ jsx(Button38, { ...nextProps, disabled: nextDisabled, children: /* @__PURE__ */ jsx(ArrowRightIcon, { className: "size-5" }) })
30614
+ /* @__PURE__ */ jsx(Button39, { ...prevProps, disabled: prevDisabled, children: /* @__PURE__ */ jsx(ArrowLeftIcon, { className: "size-5" }) }),
30615
+ /* @__PURE__ */ jsx(Button39, { ...nextProps, disabled: nextDisabled, children: /* @__PURE__ */ jsx(ArrowRightIcon, { className: "size-5" }) })
30451
30616
  ] }),
30452
30617
  currentPreview && /* @__PURE__ */ jsxs("div", { className: "flex rounded-sm bg-black/70", children: [
30453
30618
  /* @__PURE__ */ jsx(
30454
- Button38,
30619
+ Button39,
30455
30620
  {
30456
30621
  ...zommOutProps,
30457
30622
  disabled: zoomOutDisabled,
@@ -30464,7 +30629,7 @@ function ImagePreview() {
30464
30629
  /* @__PURE__ */ jsx("div", { children: "%" })
30465
30630
  ] }),
30466
30631
  /* @__PURE__ */ jsx(
30467
- Button38,
30632
+ Button39,
30468
30633
  {
30469
30634
  ...zoomInProps,
30470
30635
  disabled: zoomInDisabled,
@@ -30473,7 +30638,7 @@ function ImagePreview() {
30473
30638
  }
30474
30639
  ),
30475
30640
  /* @__PURE__ */ jsx(
30476
- Button38,
30641
+ Button39,
30477
30642
  {
30478
30643
  onClick: () => {
30479
30644
  void downloadFile(currentPreview.url, currentPreview.id);
@@ -30482,7 +30647,7 @@ function ImagePreview() {
30482
30647
  children: /* @__PURE__ */ jsx(CircleArrowDown, { className: "size-4" })
30483
30648
  }
30484
30649
  ),
30485
- /* @__PURE__ */ jsx(Button38, { ...closeProps, tooltip: "Close", children: /* @__PURE__ */ jsx(Minimize2, { className: "size-4" }) })
30650
+ /* @__PURE__ */ jsx(Button39, { ...closeProps, tooltip: "Close", children: /* @__PURE__ */ jsx(Minimize2, { className: "size-4" }) })
30486
30651
  ] })
30487
30652
  ]
30488
30653
  }
@@ -31122,7 +31287,7 @@ var TableElement2 = withHOC(
31122
31287
  "group-has-[tr:last-child:hover]/table:opacity-100 max-sm:group-has-[tr[data-selected]:last-child]/table:opacity-100"
31123
31288
  ),
31124
31289
  children: /* @__PURE__ */ jsx(
31125
- Button38,
31290
+ Button39,
31126
31291
  {
31127
31292
  className: "flex h-4 w-full grow items-center justify-center bg-muted",
31128
31293
  onClick: () => tf.insert.tableRow({ at: editor.api.findPath(element) }),
@@ -31144,7 +31309,7 @@ var TableElement2 = withHOC(
31144
31309
  "group-has-[td:last-child:hover,th:last-child:hover]/table:opacity-100 max-sm:group-has-[td[data-selected]:last-child,th[data-selected]:last-child]/table:opacity-100"
31145
31310
  ),
31146
31311
  children: /* @__PURE__ */ jsx(
31147
- Button38,
31312
+ Button39,
31148
31313
  {
31149
31314
  className: "flex h-full w-4 grow items-center justify-center bg-muted",
31150
31315
  onClick: () => tf.insert.tableColumn({
@@ -31168,7 +31333,7 @@ var TableElement2 = withHOC(
31168
31333
  "group-has-[td:last-child:hover,th:last-child:hover]/table:group-has-[tr:last-child:hover]/table:opacity-100 max-sm:group-has-[td[data-selected]:last-child,th[data-selected]:last-child]/table:group-has-[tr[data-selected]:last-child]/table:opacity-100"
31169
31334
  ),
31170
31335
  children: /* @__PURE__ */ jsx(
31171
- Button38,
31336
+ Button39,
31172
31337
  {
31173
31338
  className: "flex size-4 items-center justify-center rounded-full bg-muted",
31174
31339
  onClick: () => {
@@ -31374,7 +31539,7 @@ function TocElement(props) {
31374
31539
  const { headingList } = state;
31375
31540
  return /* @__PURE__ */ jsxs(PlateElement, { ...props, className: "my-1", children: [
31376
31541
  /* @__PURE__ */ jsx("div", { contentEditable: false, children: headingList.length > 0 ? headingList.map((item) => /* @__PURE__ */ jsx(
31377
- Button38,
31542
+ Button39,
31378
31543
  {
31379
31544
  "aria-current": true,
31380
31545
  className: headingItemVariants({ depth: item.depth }),
@@ -31522,9 +31687,9 @@ function AlignToolbarButton(props) {
31522
31687
  }) ?? "left";
31523
31688
  const [open, setOpen] = useState(false);
31524
31689
  const IconValue2 = items.find((item) => item.value === value)?.icon ?? AlignLeftIcon;
31525
- return /* @__PURE__ */ jsxs(DropdownMenu4, { open, onOpenChange: setOpen, modal: false, ...props, children: [
31526
- /* @__PURE__ */ jsx(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarButton, { pressed: open, tooltip: "Align", isDropdown: true, children: /* @__PURE__ */ jsx(IconValue2, {}) }) }),
31527
- /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(DropdownMenuContent4, { className: "min-w-0", align: "start", children: /* @__PURE__ */ jsx(
31690
+ return /* @__PURE__ */ jsxs(DropdownMenu5, { open, onOpenChange: setOpen, modal: false, ...props, children: [
31691
+ /* @__PURE__ */ jsx(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarButton, { pressed: open, tooltip: "Align", isDropdown: true, children: /* @__PURE__ */ jsx(IconValue2, {}) }) }),
31692
+ /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(DropdownMenuContent5, { className: "min-w-0", align: "start", children: /* @__PURE__ */ jsx(
31528
31693
  DropdownMenuRadioGroup,
31529
31694
  {
31530
31695
  value,
@@ -32476,7 +32641,7 @@ function TocElementStatic(props) {
32476
32641
  const headingList = getHeadingList(editor);
32477
32642
  return /* @__PURE__ */ jsxs(SlateElement, { ...props, className: "mb-1 p-0", children: [
32478
32643
  /* @__PURE__ */ jsx("div", { children: headingList.length > 0 ? headingList.map((item) => /* @__PURE__ */ jsx(
32479
- Button38,
32644
+ Button39,
32480
32645
  {
32481
32646
  className: headingItemVariants2({ depth: item.depth }),
32482
32647
  variant: "ghost",
@@ -32740,14 +32905,14 @@ function ExportToolbarButton(props) {
32740
32905
  link.remove();
32741
32906
  URL.revokeObjectURL(url);
32742
32907
  };
32743
- return /* @__PURE__ */ jsxs(DropdownMenu4, { open, onOpenChange: setOpen, modal: false, ...props, children: [
32744
- /* @__PURE__ */ jsx(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarButton, { pressed: open, tooltip: "Export", isDropdown: true, children: /* @__PURE__ */ jsx(ArrowDownToLineIcon, { className: "size-4" }) }) }),
32745
- /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(DropdownMenuContent4, { align: "start", children: /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
32746
- /* @__PURE__ */ jsx(DropdownMenuItem4, { onSelect: exportToHtml, children: "Export as HTML" }),
32747
- /* @__PURE__ */ jsx(DropdownMenuItem4, { onSelect: exportToPdf, children: "Export as PDF" }),
32748
- /* @__PURE__ */ jsx(DropdownMenuItem4, { onSelect: exportToImage, children: "Export as Image" }),
32749
- /* @__PURE__ */ jsx(DropdownMenuItem4, { onSelect: exportToMarkdown, children: "Export as Markdown" }),
32750
- /* @__PURE__ */ jsx(DropdownMenuItem4, { onSelect: exportToWord, children: "Export as Word" })
32908
+ return /* @__PURE__ */ jsxs(DropdownMenu5, { open, onOpenChange: setOpen, modal: false, ...props, children: [
32909
+ /* @__PURE__ */ jsx(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarButton, { pressed: open, tooltip: "Export", isDropdown: true, children: /* @__PURE__ */ jsx(ArrowDownToLineIcon, { className: "size-4" }) }) }),
32910
+ /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(DropdownMenuContent5, { align: "start", children: /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
32911
+ /* @__PURE__ */ jsx(DropdownMenuItem5, { onSelect: exportToHtml, children: "Export as HTML" }),
32912
+ /* @__PURE__ */ jsx(DropdownMenuItem5, { onSelect: exportToPdf, children: "Export as PDF" }),
32913
+ /* @__PURE__ */ jsx(DropdownMenuItem5, { onSelect: exportToImage, children: "Export as Image" }),
32914
+ /* @__PURE__ */ jsx(DropdownMenuItem5, { onSelect: exportToMarkdown, children: "Export as Markdown" }),
32915
+ /* @__PURE__ */ jsx(DropdownMenuItem5, { onSelect: exportToWord, children: "Export as Word" })
32751
32916
  ] }) }) })
32752
32917
  ] });
32753
32918
  }
@@ -32942,11 +33107,11 @@ function ImportToolbarButton(props) {
32942
33107
  editor.tf.insertNodes(result.nodes);
32943
33108
  }
32944
33109
  });
32945
- return /* @__PURE__ */ jsxs(DropdownMenu4, { open, onOpenChange: setOpen, modal: false, ...props, children: [
32946
- /* @__PURE__ */ jsx(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarButton, { pressed: open, tooltip: "Import", isDropdown: true, children: /* @__PURE__ */ jsx(ArrowUpToLineIcon, { className: "size-4" }) }) }),
32947
- /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(DropdownMenuContent4, { align: "start", children: /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
33110
+ return /* @__PURE__ */ jsxs(DropdownMenu5, { open, onOpenChange: setOpen, modal: false, ...props, children: [
33111
+ /* @__PURE__ */ jsx(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarButton, { pressed: open, tooltip: "Import", isDropdown: true, children: /* @__PURE__ */ jsx(ArrowUpToLineIcon, { className: "size-4" }) }) }),
33112
+ /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(DropdownMenuContent5, { align: "start", children: /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
32948
33113
  /* @__PURE__ */ jsx(
32949
- DropdownMenuItem4,
33114
+ DropdownMenuItem5,
32950
33115
  {
32951
33116
  onSelect: () => {
32952
33117
  openHtmlFilePicker();
@@ -32955,7 +33120,7 @@ function ImportToolbarButton(props) {
32955
33120
  }
32956
33121
  ),
32957
33122
  /* @__PURE__ */ jsx(
32958
- DropdownMenuItem4,
33123
+ DropdownMenuItem5,
32959
33124
  {
32960
33125
  onSelect: () => {
32961
33126
  openMdFilePicker();
@@ -32964,7 +33129,7 @@ function ImportToolbarButton(props) {
32964
33129
  }
32965
33130
  ),
32966
33131
  /* @__PURE__ */ jsx(
32967
- DropdownMenuItem4,
33132
+ DropdownMenuItem5,
32968
33133
  {
32969
33134
  onSelect: () => {
32970
33135
  openDocxFilePicker();
@@ -33146,10 +33311,10 @@ var groups2 = [
33146
33311
  function InsertToolbarButton(props) {
33147
33312
  const editor = useEditorRef();
33148
33313
  const [open, setOpen] = useState(false);
33149
- return /* @__PURE__ */ jsxs(DropdownMenu4, { open, onOpenChange: setOpen, modal: false, ...props, children: [
33150
- /* @__PURE__ */ jsx(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarButton, { pressed: open, tooltip: "Insert", isDropdown: true, children: /* @__PURE__ */ jsx(PlusIcon, {}) }) }),
33314
+ return /* @__PURE__ */ jsxs(DropdownMenu5, { open, onOpenChange: setOpen, modal: false, ...props, children: [
33315
+ /* @__PURE__ */ jsx(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarButton, { pressed: open, tooltip: "Insert", isDropdown: true, children: /* @__PURE__ */ jsx(PlusIcon, {}) }) }),
33151
33316
  /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(
33152
- DropdownMenuContent4,
33317
+ DropdownMenuContent5,
33153
33318
  {
33154
33319
  className: "flex max-h-[500px] min-w-0 flex-col overflow-y-auto",
33155
33320
  align: "start",
@@ -33159,7 +33324,7 @@ function InsertToolbarButton(props) {
33159
33324
  value,
33160
33325
  onSelect
33161
33326
  }) => /* @__PURE__ */ jsxs(
33162
- DropdownMenuItem4,
33327
+ DropdownMenuItem5,
33163
33328
  {
33164
33329
  className: "min-w-[180px]",
33165
33330
  onSelect: () => {
@@ -33188,9 +33353,9 @@ function LineHeightToolbarButton(props) {
33188
33353
  getProp: (node) => node.lineHeight
33189
33354
  });
33190
33355
  const [open, setOpen] = useState(false);
33191
- return /* @__PURE__ */ jsxs(DropdownMenu4, { open, onOpenChange: setOpen, modal: false, ...props, children: [
33192
- /* @__PURE__ */ jsx(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarButton, { pressed: open, tooltip: "Line height", isDropdown: true, children: /* @__PURE__ */ jsx(WrapText, {}) }) }),
33193
- /* @__PURE__ */ jsx(DropdownMenuContent4, { className: "min-w-0", align: "start", portal: true, children: /* @__PURE__ */ jsx(
33356
+ return /* @__PURE__ */ jsxs(DropdownMenu5, { open, onOpenChange: setOpen, modal: false, ...props, children: [
33357
+ /* @__PURE__ */ jsx(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarButton, { pressed: open, tooltip: "Line height", isDropdown: true, children: /* @__PURE__ */ jsx(WrapText, {}) }) }),
33358
+ /* @__PURE__ */ jsx(DropdownMenuContent5, { className: "min-w-0", align: "start", portal: true, children: /* @__PURE__ */ jsx(
33194
33359
  DropdownMenuRadioGroup,
33195
33360
  {
33196
33361
  value,
@@ -33235,11 +33400,11 @@ function BulletedListToolbarButton() {
33235
33400
  children: /* @__PURE__ */ jsx(List, { className: "size-4" })
33236
33401
  }
33237
33402
  ),
33238
- /* @__PURE__ */ jsxs(DropdownMenu4, { open, onOpenChange: setOpen, modal: false, children: [
33239
- /* @__PURE__ */ jsx(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarSplitButtonSecondary, {}) }),
33240
- /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(DropdownMenuContent4, { align: "start", alignOffset: -32, children: /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
33403
+ /* @__PURE__ */ jsxs(DropdownMenu5, { open, onOpenChange: setOpen, modal: false, children: [
33404
+ /* @__PURE__ */ jsx(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarSplitButtonSecondary, {}) }),
33405
+ /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(DropdownMenuContent5, { align: "start", alignOffset: -32, children: /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
33241
33406
  /* @__PURE__ */ jsx(
33242
- DropdownMenuItem4,
33407
+ DropdownMenuItem5,
33243
33408
  {
33244
33409
  onClick: () => toggleList(editor, {
33245
33410
  listStyleType: ListStyleType.Disc
@@ -33251,7 +33416,7 @@ function BulletedListToolbarButton() {
33251
33416
  }
33252
33417
  ),
33253
33418
  /* @__PURE__ */ jsx(
33254
- DropdownMenuItem4,
33419
+ DropdownMenuItem5,
33255
33420
  {
33256
33421
  onClick: () => toggleList(editor, {
33257
33422
  listStyleType: ListStyleType.Circle
@@ -33263,7 +33428,7 @@ function BulletedListToolbarButton() {
33263
33428
  }
33264
33429
  ),
33265
33430
  /* @__PURE__ */ jsx(
33266
- DropdownMenuItem4,
33431
+ DropdownMenuItem5,
33267
33432
  {
33268
33433
  onClick: () => toggleList(editor, {
33269
33434
  listStyleType: ListStyleType.Square
@@ -33303,11 +33468,11 @@ function NumberedListToolbarButton() {
33303
33468
  children: /* @__PURE__ */ jsx(ListOrdered, { className: "size-4" })
33304
33469
  }
33305
33470
  ),
33306
- /* @__PURE__ */ jsxs(DropdownMenu4, { open, onOpenChange: setOpen, modal: false, children: [
33307
- /* @__PURE__ */ jsx(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarSplitButtonSecondary, {}) }),
33308
- /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(DropdownMenuContent4, { align: "start", alignOffset: -32, children: /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
33471
+ /* @__PURE__ */ jsxs(DropdownMenu5, { open, onOpenChange: setOpen, modal: false, children: [
33472
+ /* @__PURE__ */ jsx(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarSplitButtonSecondary, {}) }),
33473
+ /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(DropdownMenuContent5, { align: "start", alignOffset: -32, children: /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
33309
33474
  /* @__PURE__ */ jsx(
33310
- DropdownMenuItem4,
33475
+ DropdownMenuItem5,
33311
33476
  {
33312
33477
  onSelect: () => toggleList(editor, {
33313
33478
  listStyleType: ListStyleType.Decimal
@@ -33316,7 +33481,7 @@ function NumberedListToolbarButton() {
33316
33481
  }
33317
33482
  ),
33318
33483
  /* @__PURE__ */ jsx(
33319
- DropdownMenuItem4,
33484
+ DropdownMenuItem5,
33320
33485
  {
33321
33486
  onSelect: () => toggleList(editor, {
33322
33487
  listStyleType: ListStyleType.LowerAlpha
@@ -33325,7 +33490,7 @@ function NumberedListToolbarButton() {
33325
33490
  }
33326
33491
  ),
33327
33492
  /* @__PURE__ */ jsx(
33328
- DropdownMenuItem4,
33493
+ DropdownMenuItem5,
33329
33494
  {
33330
33495
  onSelect: () => toggleList(editor, {
33331
33496
  listStyleType: ListStyleType.UpperAlpha
@@ -33334,7 +33499,7 @@ function NumberedListToolbarButton() {
33334
33499
  }
33335
33500
  ),
33336
33501
  /* @__PURE__ */ jsx(
33337
- DropdownMenuItem4,
33502
+ DropdownMenuItem5,
33338
33503
  {
33339
33504
  onSelect: () => toggleList(editor, {
33340
33505
  listStyleType: ListStyleType.LowerRoman
@@ -33343,7 +33508,7 @@ function NumberedListToolbarButton() {
33343
33508
  }
33344
33509
  ),
33345
33510
  /* @__PURE__ */ jsx(
33346
- DropdownMenuItem4,
33511
+ DropdownMenuItem5,
33347
33512
  {
33348
33513
  onSelect: () => toggleList(editor, {
33349
33514
  listStyleType: ListStyleType.UpperRoman
@@ -33529,26 +33694,26 @@ function MediaToolbarButton({
33529
33694
  children: [
33530
33695
  /* @__PURE__ */ jsx(ToolbarSplitButtonPrimary, { children: currentConfig.icon }),
33531
33696
  /* @__PURE__ */ jsxs(
33532
- DropdownMenu4,
33697
+ DropdownMenu5,
33533
33698
  {
33534
33699
  open,
33535
33700
  onOpenChange: setOpen,
33536
33701
  modal: false,
33537
33702
  ...props,
33538
33703
  children: [
33539
- /* @__PURE__ */ jsx(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarSplitButtonSecondary, {}) }),
33704
+ /* @__PURE__ */ jsx(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarSplitButtonSecondary, {}) }),
33540
33705
  /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(
33541
- DropdownMenuContent4,
33706
+ DropdownMenuContent5,
33542
33707
  {
33543
33708
  onClick: (e) => e.stopPropagation(),
33544
33709
  align: "start",
33545
33710
  alignOffset: -32,
33546
33711
  children: /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
33547
- /* @__PURE__ */ jsxs(DropdownMenuItem4, { onSelect: () => openFilePicker(), children: [
33712
+ /* @__PURE__ */ jsxs(DropdownMenuItem5, { onSelect: () => openFilePicker(), children: [
33548
33713
  currentConfig.icon,
33549
33714
  "Upload from computer"
33550
33715
  ] }),
33551
- /* @__PURE__ */ jsxs(DropdownMenuItem4, { onSelect: () => setDialogOpen(true), children: [
33716
+ /* @__PURE__ */ jsxs(DropdownMenuItem5, { onSelect: () => setDialogOpen(true), children: [
33552
33717
  /* @__PURE__ */ jsx(LinkIcon, {}),
33553
33718
  "Insert via URL"
33554
33719
  ] })
@@ -33614,7 +33779,7 @@ function MediaUrlDialogContent({
33614
33779
  }
33615
33780
  ),
33616
33781
  /* @__PURE__ */ jsx(
33617
- Input21,
33782
+ Input22,
33618
33783
  {
33619
33784
  id: "url",
33620
33785
  className: "w-full",
@@ -33666,12 +33831,12 @@ function ModeToolbarButton(props) {
33666
33831
  label: "Viewing"
33667
33832
  }
33668
33833
  };
33669
- return /* @__PURE__ */ jsxs(DropdownMenu4, { open, onOpenChange: setOpen, modal: false, ...props, children: [
33670
- /* @__PURE__ */ jsx(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsxs(ToolbarButton, { pressed: open, tooltip: "Editing mode", isDropdown: true, children: [
33834
+ return /* @__PURE__ */ jsxs(DropdownMenu5, { open, onOpenChange: setOpen, modal: false, ...props, children: [
33835
+ /* @__PURE__ */ jsx(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsxs(ToolbarButton, { pressed: open, tooltip: "Editing mode", isDropdown: true, children: [
33671
33836
  item[value].icon,
33672
33837
  /* @__PURE__ */ jsx("span", { className: "hidden lg:inline", children: item[value].label })
33673
33838
  ] }) }),
33674
- /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(DropdownMenuContent4, { className: "min-w-[180px]", align: "start", children: /* @__PURE__ */ jsxs(
33839
+ /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(DropdownMenuContent5, { className: "min-w-[180px]", align: "start", children: /* @__PURE__ */ jsxs(
33675
33840
  DropdownMenuRadioGroup,
33676
33841
  {
33677
33842
  value,
@@ -33744,10 +33909,10 @@ function TableToolbarButton(props) {
33744
33909
  const { editor, tf } = useEditorPlugin(TablePlugin);
33745
33910
  const [open, setOpen] = useState(false);
33746
33911
  const mergeState = useTableMergeState();
33747
- return /* @__PURE__ */ jsxs(DropdownMenu4, { open, onOpenChange: setOpen, modal: false, ...props, children: [
33748
- /* @__PURE__ */ jsx(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarButton, { pressed: open, tooltip: "Table", isDropdown: true, children: /* @__PURE__ */ jsx(Table, {}) }) }),
33912
+ return /* @__PURE__ */ jsxs(DropdownMenu5, { open, onOpenChange: setOpen, modal: false, ...props, children: [
33913
+ /* @__PURE__ */ jsx(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsx(ToolbarButton, { pressed: open, tooltip: "Table", isDropdown: true, children: /* @__PURE__ */ jsx(Table, {}) }) }),
33749
33914
  /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(
33750
- DropdownMenuContent4,
33915
+ DropdownMenuContent5,
33751
33916
  {
33752
33917
  className: "flex w-[180px] min-w-0 flex-col",
33753
33918
  align: "start",
@@ -33773,7 +33938,7 @@ function TableToolbarButton(props) {
33773
33938
  ),
33774
33939
  /* @__PURE__ */ jsxs(DropdownMenuSubContent, { children: [
33775
33940
  /* @__PURE__ */ jsxs(
33776
- DropdownMenuItem4,
33941
+ DropdownMenuItem5,
33777
33942
  {
33778
33943
  className: "min-w-[180px]",
33779
33944
  disabled: !mergeState.canMerge,
@@ -33788,7 +33953,7 @@ function TableToolbarButton(props) {
33788
33953
  }
33789
33954
  ),
33790
33955
  /* @__PURE__ */ jsxs(
33791
- DropdownMenuItem4,
33956
+ DropdownMenuItem5,
33792
33957
  {
33793
33958
  className: "min-w-[180px]",
33794
33959
  disabled: !mergeState.canSplit,
@@ -33818,7 +33983,7 @@ function TableToolbarButton(props) {
33818
33983
  ),
33819
33984
  /* @__PURE__ */ jsxs(DropdownMenuSubContent, { children: [
33820
33985
  /* @__PURE__ */ jsxs(
33821
- DropdownMenuItem4,
33986
+ DropdownMenuItem5,
33822
33987
  {
33823
33988
  className: "min-w-[180px]",
33824
33989
  disabled: !tableSelected,
@@ -33833,7 +33998,7 @@ function TableToolbarButton(props) {
33833
33998
  }
33834
33999
  ),
33835
34000
  /* @__PURE__ */ jsxs(
33836
- DropdownMenuItem4,
34001
+ DropdownMenuItem5,
33837
34002
  {
33838
34003
  className: "min-w-[180px]",
33839
34004
  disabled: !tableSelected,
@@ -33848,7 +34013,7 @@ function TableToolbarButton(props) {
33848
34013
  }
33849
34014
  ),
33850
34015
  /* @__PURE__ */ jsxs(
33851
- DropdownMenuItem4,
34016
+ DropdownMenuItem5,
33852
34017
  {
33853
34018
  className: "min-w-[180px]",
33854
34019
  disabled: !tableSelected,
@@ -33878,7 +34043,7 @@ function TableToolbarButton(props) {
33878
34043
  ),
33879
34044
  /* @__PURE__ */ jsxs(DropdownMenuSubContent, { children: [
33880
34045
  /* @__PURE__ */ jsxs(
33881
- DropdownMenuItem4,
34046
+ DropdownMenuItem5,
33882
34047
  {
33883
34048
  className: "min-w-[180px]",
33884
34049
  disabled: !tableSelected,
@@ -33893,7 +34058,7 @@ function TableToolbarButton(props) {
33893
34058
  }
33894
34059
  ),
33895
34060
  /* @__PURE__ */ jsxs(
33896
- DropdownMenuItem4,
34061
+ DropdownMenuItem5,
33897
34062
  {
33898
34063
  className: "min-w-[180px]",
33899
34064
  disabled: !tableSelected,
@@ -33908,7 +34073,7 @@ function TableToolbarButton(props) {
33908
34073
  }
33909
34074
  ),
33910
34075
  /* @__PURE__ */ jsxs(
33911
- DropdownMenuItem4,
34076
+ DropdownMenuItem5,
33912
34077
  {
33913
34078
  className: "min-w-[180px]",
33914
34079
  disabled: !tableSelected,
@@ -33925,7 +34090,7 @@ function TableToolbarButton(props) {
33925
34090
  ] })
33926
34091
  ] }),
33927
34092
  /* @__PURE__ */ jsxs(
33928
- DropdownMenuItem4,
34093
+ DropdownMenuItem5,
33929
34094
  {
33930
34095
  className: "min-w-[180px]",
33931
34096
  disabled: !tableSelected,
@@ -34166,13 +34331,6 @@ var AssistantView = ({ ref, ...props }) => {
34166
34331
  const [activeCanvasTab, setActiveCanvasTab] = useState(0);
34167
34332
  const [canvasSpreadsheetCommands, setCanvasSpreadsheetCommands] = useState([]);
34168
34333
  const apiClient = useApiClient();
34169
- const [agentSelectorOpen, setAgentSelectorOpen] = useState(false);
34170
- const [agents, setAgents] = useState([]);
34171
- const [baseAgents, setBaseAgents] = useState([]);
34172
- const [agentsLoading, setAgentsLoading] = useState(false);
34173
- const [agentSearch, setAgentSearch] = useState("");
34174
- const [selectedAgent, setSelectedAgent] = useState(null);
34175
- const agentSearchRef = useRef(null);
34176
34334
  const handleOpenCanvasViewInline = (options3) => {
34177
34335
  if (options3.type === "xlsx" && canvasWork?.id === options3.id && canvasWork?.type === WorkTypes.Xlsx) {
34178
34336
  setCanvasSpreadsheetCommands(options3.commands ?? []);
@@ -34301,65 +34459,6 @@ var AssistantView = ({ ref, ...props }) => {
34301
34459
  canvasWork?.type,
34302
34460
  handleCanvasVersionSelect
34303
34461
  ]);
34304
- const tenantAiAgentId = props.mode !== "conversation" ? props.tenantAiAgentId : void 0;
34305
- const inlineProps = props.mode !== "conversation" ? props : null;
34306
- const agentUrl = inlineProps?.agentSelectorUrl;
34307
- const baseAgentUrl = inlineProps?.baseAgentSelectorUrl;
34308
- const hasFetchedRef = useRef(false);
34309
- useEffect(() => {
34310
- if (!agentSelectorOpen) return;
34311
- if (hasFetchedRef.current) return;
34312
- if (!agentUrl && !baseAgentUrl) return;
34313
- hasFetchedRef.current = true;
34314
- const fetchAgents = async () => {
34315
- setAgentsLoading(true);
34316
- try {
34317
- const deployedRes = agentUrl ? await apiClient.get(agentUrl) : { success: true, data: [] };
34318
- const baseRes = baseAgentUrl ? await apiClient.get(baseAgentUrl) : { success: true, data: [] };
34319
- if (deployedRes.success) {
34320
- const raw = Array.isArray(deployedRes.data) ? deployedRes.data : [];
34321
- setAgents(raw.map((d) => ({
34322
- id: d.deploymentId ?? d.id,
34323
- name: d.agentName ?? d.name,
34324
- avatar: d.agentAvatar?.signed_url ?? d.avatar
34325
- })));
34326
- }
34327
- if (baseRes.success) {
34328
- const rawBase = Array.isArray(baseRes.data) ? baseRes.data : [];
34329
- setBaseAgents(rawBase.map((d) => ({
34330
- id: d.agentId ?? d.id,
34331
- name: d.agentName ?? d.name,
34332
- avatar: d.agentAvatar?.signed_url ?? d.agentAvatar ?? d.avatar
34333
- })));
34334
- }
34335
- } catch {
34336
- } finally {
34337
- setAgentsLoading(false);
34338
- }
34339
- };
34340
- fetchAgents();
34341
- }, [
34342
- agentSelectorOpen,
34343
- agentUrl,
34344
- baseAgentUrl,
34345
- apiClient
34346
- ]);
34347
- const allAgents = [...agents, ...baseAgents];
34348
- let activeAgent;
34349
- if (selectedAgent != null) {
34350
- activeAgent = selectedAgent;
34351
- } else if (props.deploymentId) {
34352
- activeAgent = agents.find((a) => a.id === props.deploymentId) ?? null;
34353
- } else {
34354
- activeAgent = tenantAiAgentId ? allAgents.find((a) => a.id === tenantAiAgentId) ?? null : null;
34355
- }
34356
- const filteredDeployedAgents = agents.filter(
34357
- (a) => !agentSearch || a.name?.toLowerCase().includes(agentSearch.toLowerCase())
34358
- );
34359
- const filteredBaseAgents = baseAgents.filter(
34360
- (a) => !agentSearch || a.name?.toLowerCase().includes(agentSearch.toLowerCase())
34361
- );
34362
- const hasAnyAgents = filteredDeployedAgents.length > 0 || filteredBaseAgents.length > 0;
34363
34462
  if (props.mode === "conversation") {
34364
34463
  const { onWorkSelect, onOpenRightSidebar, ...commonProps2 } = props;
34365
34464
  const handleOpenCanvasView = (options3) => {
@@ -34435,6 +34534,7 @@ var AssistantView = ({ ref, ...props }) => {
34435
34534
  recognition: commonProps2.recognition,
34436
34535
  onMicrophoneClick: commonProps2.onMicrophoneClick,
34437
34536
  onToolAction: commonProps2.onToolAction,
34537
+ onForwardToAgent: commonProps2.onForwardToAgent,
34438
34538
  openCanvasView: handleOpenCanvasView,
34439
34539
  onEditPrompt: commonProps2.onEditPrompt,
34440
34540
  showWelcome: commonProps2.showWelcome,
@@ -34463,18 +34563,14 @@ var AssistantView = ({ ref, ...props }) => {
34463
34563
  onTabChange,
34464
34564
  onExpand,
34465
34565
  onNewChat,
34466
- enableNavDropdown = false,
34467
34566
  isFullscreen = false,
34468
34567
  renderSessionsView,
34469
34568
  renderProjectsView,
34470
34569
  renderWorksView,
34471
34570
  renderMemoriesView,
34472
34571
  renderThreadHeader,
34473
- agentSelectorUrl,
34474
- baseAgentSelectorUrl,
34475
- onAgentChange,
34572
+ renderHeaderTabs,
34476
34573
  hideCloseButton,
34477
- hideAgentSelector,
34478
34574
  hideBorder,
34479
34575
  showHeader = true,
34480
34576
  hideHeaderOnWelcome = true,
@@ -34482,7 +34578,7 @@ var AssistantView = ({ ref, ...props }) => {
34482
34578
  ...commonProps
34483
34579
  } = props;
34484
34580
  if (!isOpen) return null;
34485
- const content = /* @__PURE__ */ jsx(
34581
+ const content = /* @__PURE__ */ jsxs(
34486
34582
  "div",
34487
34583
  {
34488
34584
  className: cn(
@@ -34493,546 +34589,377 @@ var AssistantView = ({ ref, ...props }) => {
34493
34589
  ),
34494
34590
  "data-render-mode": "inline",
34495
34591
  ref,
34496
- children: (() => {
34497
- const agentSelectorElement = (agentSelectorUrl || baseAgentSelectorUrl) && !hideAgentSelector ? /* @__PURE__ */ jsxs(
34498
- DropdownMenu$1,
34499
- {
34500
- open: agentSelectorOpen,
34501
- onOpenChange: (o) => {
34502
- setAgentSelectorOpen(o);
34503
- if (!o) setAgentSearch("");
34504
- },
34505
- children: [
34506
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
34507
- Button,
34508
- {
34509
- variant: "ghost",
34510
- className: "h-8 px-2 gap-1.5 text-sm font-medium text-foreground hover:bg-accent rounded-md max-w-[260px]",
34511
- children: [
34512
- (activeAgent?.avatar || commonProps.logo) && /* @__PURE__ */ jsxs(Avatar$1, { className: "w-5 h-5 shrink-0 after:border-0", children: [
34513
- /* @__PURE__ */ jsx(AvatarImage$1, { src: activeAgent?.avatar || commonProps.logo, alt: activeAgent?.name ?? commonProps.title ?? "Assistant" }),
34514
- /* @__PURE__ */ jsx(AvatarFallback$1, { className: "text-[10px]", children: (activeAgent?.name ?? commonProps.title ?? "A").slice(0, 2).toUpperCase() })
34515
- ] }),
34516
- /* @__PURE__ */ jsx("span", { className: "truncate", children: activeAgent?.name ?? commonProps.title ?? "Assistant" }),
34517
- /* @__PURE__ */ jsx(ChevronDown, { className: "w-3 h-3 shrink-0 text-muted-foreground" })
34518
- ]
34519
- }
34520
- ) }),
34521
- /* @__PURE__ */ jsxs(
34522
- DropdownMenuContent,
34523
- {
34524
- align: "start",
34525
- className: cn("w-64 p-0", isFullscreen && "z-[10000]"),
34526
- onCloseAutoFocus: (e) => e.preventDefault(),
34527
- children: [
34528
- /* @__PURE__ */ jsx("div", { className: "p-2 border-b", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
34529
- /* @__PURE__ */ jsx(Search, { className: "absolute left-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground pointer-events-none" }),
34530
- /* @__PURE__ */ jsx(
34531
- Input,
34532
- {
34533
- ref: agentSearchRef,
34534
- value: agentSearch,
34535
- onChange: (e) => setAgentSearch(e.target.value),
34536
- onKeyDown: (e) => e.stopPropagation(),
34537
- placeholder: "Search agents...",
34538
- className: "h-7 pl-7 text-sm",
34539
- autoFocus: true
34540
- }
34541
- )
34542
- ] }) }),
34543
- /* @__PURE__ */ jsx(ScrollArea$1, { className: "max-h-56", children: agentsLoading ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ jsx(Loader2, { className: "w-4 h-4 animate-spin text-muted-foreground" }) }) : !hasAnyAgents ? /* @__PURE__ */ jsx("div", { className: "py-4 text-center text-xs text-muted-foreground", children: "No agents found" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
34544
- filteredBaseAgents.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
34545
- /* @__PURE__ */ jsx("div", { className: "px-3 py-1.5 text-xs font-medium text-muted-foreground", children: "Base Agents" }),
34546
- filteredBaseAgents.map((agent) => /* @__PURE__ */ jsxs(
34547
- DropdownMenuItem,
34548
- {
34549
- className: "cursor-pointer gap-2 px-3 py-2",
34550
- onClick: () => {
34551
- setSelectedAgent(agent);
34552
- setAgentSelectorOpen(false);
34553
- setAgentSearch("");
34554
- onAgentChange?.(agent.id, "base");
34555
- },
34556
- children: [
34557
- agent.avatar ? /* @__PURE__ */ jsx("img", { src: typeof agent.avatar === "string" ? agent.avatar : agent.avatar?.signed_url, alt: "", className: "w-5 h-5 rounded-full shrink-0 object-cover" }) : /* @__PURE__ */ jsx("div", { className: "w-5 h-5 rounded-full shrink-0 bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsx(Brain, { className: "w-3 h-3 text-muted-foreground" }) }),
34558
- /* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: agent.name })
34559
- ]
34560
- },
34561
- agent.id
34562
- ))
34563
- ] }),
34564
- filteredDeployedAgents.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
34565
- filteredBaseAgents.length > 0 && /* @__PURE__ */ jsx(DropdownMenuSeparator$1, {}),
34566
- /* @__PURE__ */ jsx("div", { className: "px-3 py-1.5 text-xs font-medium text-muted-foreground", children: "Deployed Agents" }),
34567
- filteredDeployedAgents.map((agent) => /* @__PURE__ */ jsxs(
34568
- DropdownMenuItem,
34569
- {
34570
- className: "cursor-pointer gap-2 px-3 py-2",
34571
- onClick: () => {
34572
- setSelectedAgent(agent);
34573
- setAgentSelectorOpen(false);
34574
- setAgentSearch("");
34575
- onAgentChange?.(agent.id, "deployment");
34576
- },
34577
- children: [
34578
- agent.avatar ? /* @__PURE__ */ jsx("img", { src: typeof agent.avatar === "string" ? agent.avatar : agent.avatar?.signed_url, alt: "", className: "w-5 h-5 rounded-full shrink-0 object-cover" }) : /* @__PURE__ */ jsx("div", { className: "w-5 h-5 rounded-full shrink-0 bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsx(Brain, { className: "w-3 h-3 text-muted-foreground" }) }),
34579
- /* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: agent.name })
34580
- ]
34581
- },
34582
- agent.id
34583
- ))
34584
- ] })
34585
- ] }) })
34586
- ]
34587
- }
34588
- )
34589
- ]
34590
- }
34591
- ) : !hideAgentSelector ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5 text-sm font-medium text-foreground", children: [
34592
- (activeAgent?.avatar || commonProps.logo) && /* @__PURE__ */ jsxs(Avatar$1, { className: "w-5 h-5 shrink-0", children: [
34593
- /* @__PURE__ */ jsx(AvatarImage$1, { src: activeAgent?.avatar || commonProps.logo, alt: activeAgent?.name ?? commonProps.title ?? "Assistant" }),
34594
- /* @__PURE__ */ jsx(AvatarFallback$1, { className: "text-[10px]", children: (activeAgent?.name ?? commonProps.title ?? "A").slice(0, 2).toUpperCase() })
34592
+ children: [
34593
+ showHeader && (!hideHeaderOnWelcome || !(commonProps.showWelcome && commonProps.messages.length === 0)) && /* @__PURE__ */ jsxs("div", { className: "relative z-50 flex items-center justify-between h-12 px-3 border-b shrink-0 bg-background gap-2", children: [
34594
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 min-w-0 flex-1", children: renderHeaderTabs ? renderHeaderTabs({ isFullscreen }) : null }),
34595
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [
34596
+ onExpand && /* @__PURE__ */ jsx(
34597
+ Button,
34598
+ {
34599
+ variant: "ghost",
34600
+ size: "icon",
34601
+ className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
34602
+ onClick: onExpand,
34603
+ title: isFullscreen ? t("actions.minimize") : t("actions.expand_fullscreen"),
34604
+ children: isFullscreen ? /* @__PURE__ */ jsx(Minimize2, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx(Maximize2, { className: "w-4 h-4" })
34605
+ }
34606
+ ),
34607
+ !hideCloseButton && /* @__PURE__ */ jsx(
34608
+ Button,
34609
+ {
34610
+ variant: "ghost",
34611
+ size: "icon",
34612
+ className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
34613
+ onClick: () => onClose?.(),
34614
+ title: t("common.close"),
34615
+ children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
34616
+ }
34617
+ )
34618
+ ] })
34619
+ ] }),
34620
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-row min-h-0 overflow-hidden relative", children: [
34621
+ !isSidebarOpen && !(commonProps.showWelcome && commonProps.messages.length === 0) && /* @__PURE__ */ jsxs("div", { className: "absolute top-2 left-2 z-40 flex flex-col gap-1 rounded-md bg-background/80 backdrop-blur-sm p-0.5", children: [
34622
+ enableSidebar && onToggleSidebar && /* @__PURE__ */ jsx(
34623
+ Button,
34624
+ {
34625
+ variant: "ghost",
34626
+ size: "icon",
34627
+ onClick: onToggleSidebar,
34628
+ className: "h-8 w-8 text-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
34629
+ title: t("tabs.sessions"),
34630
+ children: /* @__PURE__ */ jsx(PanelLeft, { className: "w-4 h-4" })
34631
+ }
34632
+ ),
34633
+ onNewChat && /* @__PURE__ */ jsx(
34634
+ Button,
34635
+ {
34636
+ variant: "ghost",
34637
+ size: "icon",
34638
+ onClick: onNewChat,
34639
+ className: "h-8 w-8 text-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
34640
+ title: t("buttons.start_new_thread"),
34641
+ children: /* @__PURE__ */ jsx(Edit, { className: "w-4 h-4" })
34642
+ }
34643
+ )
34595
34644
  ] }),
34596
- activeAgent?.name ?? commonProps.title ?? "Assistant"
34597
- ] }) : null;
34598
- return /* @__PURE__ */ jsxs(Fragment, { children: [
34599
- showHeader && (!hideHeaderOnWelcome || !(commonProps.showWelcome && commonProps.messages.length === 0)) && /* @__PURE__ */ jsxs("div", { className: cn(
34600
- "relative z-50 flex items-center justify-between h-12 px-3 border-b shrink-0 bg-background",
34601
- !isSidebarOpen && enableSidebar && "pl-12"
34602
- ), children: [
34603
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
34604
- enableNavDropdown && /* @__PURE__ */ jsxs(DropdownMenu$1, { children: [
34605
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
34645
+ enableSidebar && isSidebarOpen && renderSidebar && !(commonProps.showWelcome && commonProps.messages.length === 0) && /* @__PURE__ */ jsxs(Fragment, { children: [
34646
+ /* @__PURE__ */ jsx(
34647
+ "div",
34648
+ {
34649
+ className: "absolute inset-0 bg-black/20 z-[99] @3xl:hidden",
34650
+ onClick: onToggleSidebar
34651
+ }
34652
+ ),
34653
+ /* @__PURE__ */ jsx("div", { className: "absolute left-0 top-0 h-full w-72 bg-background z-[100] shadow-xl border-r @3xl:hidden", children: /* @__PURE__ */ jsxs("div", { className: "w-full h-full flex flex-col", children: [
34654
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between h-12 px-3 border-b shrink-0", children: [
34655
+ commonProps.logo || commonProps.title ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
34656
+ /* @__PURE__ */ jsxs(Avatar, { className: "h-7 w-7 shrink-0 after:hidden", children: [
34657
+ /* @__PURE__ */ jsx(AvatarImage, { src: commonProps.logo, alt: commonProps.title }),
34658
+ /* @__PURE__ */ jsx(AvatarFallback, { className: "text-xs", children: (commonProps.title || "AI").substring(0, 2).toUpperCase() })
34659
+ ] }),
34660
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium truncate", children: commonProps.title })
34661
+ ] }) : /* @__PURE__ */ jsx("div", {}),
34662
+ /* @__PURE__ */ jsx(
34606
34663
  Button,
34607
34664
  {
34608
34665
  variant: "ghost",
34609
34666
  size: "icon",
34610
- className: "h-8 w-8 rounded-md hover:bg-accent relative overflow-hidden group",
34611
- children: [
34612
- /* @__PURE__ */ jsx(
34613
- "span",
34614
- {
34615
- className: "pointer-events-none absolute inset-0 -translate-x-full bg-gradient-to-r from-transparent via-violet-200/60 to-transparent group-hover:translate-x-full transition-transform duration-700 ease-in-out",
34616
- "aria-hidden": "true"
34617
- }
34618
- ),
34619
- /* @__PURE__ */ jsx(Sparkles, { className: "w-4 h-4 text-brown-500 relative z-10" })
34620
- ]
34667
+ onClick: onToggleSidebar,
34668
+ className: "h-8 w-8 shrink-0 text-muted-foreground hover:text-foreground",
34669
+ children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
34621
34670
  }
34622
- ) }),
34623
- /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", className: cn("w-40", isFullscreen && "z-[10000]"), children: [
34624
- /* @__PURE__ */ jsx(
34625
- DropdownMenuItem,
34626
- {
34627
- className: "cursor-pointer",
34628
- onClick: () => onTabChange?.(activeTab === 1 ? 0 : 1),
34629
- children: t("tabs.sessions")
34630
- }
34631
- ),
34632
- /* @__PURE__ */ jsx(DropdownMenuSeparator$1, {}),
34633
- /* @__PURE__ */ jsx(
34634
- DropdownMenuItem,
34635
- {
34636
- className: "cursor-pointer",
34637
- onClick: () => onTabChange?.(activeTab === 2 ? 0 : 2),
34638
- children: t("sections.projects")
34639
- }
34640
- ),
34641
- /* @__PURE__ */ jsx(DropdownMenuSeparator$1, {}),
34642
- /* @__PURE__ */ jsx(
34643
- DropdownMenuItem,
34644
- {
34645
- className: "cursor-pointer",
34646
- onClick: () => onTabChange?.(activeTab === 3 ? 0 : 3),
34647
- children: t("tabs.works")
34648
- }
34649
- )
34650
- ] })
34671
+ )
34651
34672
  ] }),
34652
- agentSelectorElement
34653
- ] }),
34654
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
34655
- enableNavDropdown && onNewChat && /* @__PURE__ */ jsx(
34656
- Button,
34657
- {
34658
- variant: "ghost",
34659
- size: "icon",
34660
- className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
34661
- onClick: onNewChat,
34662
- title: t("buttons.start_new_thread"),
34663
- children: /* @__PURE__ */ jsx(Edit, { className: "w-4 h-4" })
34664
- }
34673
+ /* @__PURE__ */ jsx("div", { className: "flex-1 p-4 flex flex-col min-h-0 overflow-hidden", children: renderSidebar(true) })
34674
+ ] }) })
34675
+ ] }),
34676
+ enableSidebar && renderSidebar && !(commonProps.showWelcome && commonProps.messages.length === 0) && /* @__PURE__ */ jsx(
34677
+ "div",
34678
+ {
34679
+ className: cn(
34680
+ "hidden @3xl:flex flex-col flex-none bg-background border-r transition-all duration-300 overflow-hidden",
34681
+ isSidebarOpen ? "w-72" : "w-0"
34665
34682
  ),
34666
- onExpand && /* @__PURE__ */ jsx(
34683
+ children: /* @__PURE__ */ jsxs("div", { className: "w-72 h-full flex flex-col relative", children: [
34684
+ isSidebarOpen && /* @__PURE__ */ jsx("div", { className: "absolute top-2 right-2 z-10 flex flex-col gap-1", children: onToggleSidebar && /* @__PURE__ */ jsx(
34685
+ Button,
34686
+ {
34687
+ variant: "ghost",
34688
+ size: "icon",
34689
+ onClick: onToggleSidebar,
34690
+ className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
34691
+ children: /* @__PURE__ */ jsx(PanelLeft, { className: "w-4 h-4" })
34692
+ }
34693
+ ) }),
34694
+ /* @__PURE__ */ jsx("div", { className: "flex-1 p-4 flex flex-col min-h-0 overflow-hidden", children: renderSidebar(false) })
34695
+ ] })
34696
+ }
34697
+ ),
34698
+ /* @__PURE__ */ jsx("div", { className: cn(
34699
+ "flex flex-col min-h-0 overflow-hidden transition-all duration-200",
34700
+ canvasWork ? "w-2/5" : "flex-1",
34701
+ ""
34702
+ ), children: activeTab === 1 ? (
34703
+ // Sessions View
34704
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
34705
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-3 h-10 shrink-0", children: /* @__PURE__ */ jsx(
34667
34706
  Button,
34668
34707
  {
34669
34708
  variant: "ghost",
34670
34709
  size: "icon",
34671
- className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
34672
- onClick: onExpand,
34673
- title: isFullscreen ? t("actions.minimize") : t("actions.expand_fullscreen"),
34674
- children: isFullscreen ? /* @__PURE__ */ jsx(Minimize2, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx(Maximize2, { className: "w-4 h-4" })
34710
+ className: "h-7 w-7 text-muted-foreground hover:text-foreground",
34711
+ onClick: () => onTabChange?.(0),
34712
+ children: /* @__PURE__ */ jsx(ArrowLeft, { className: "w-4 h-4" })
34675
34713
  }
34676
- ),
34677
- !hideCloseButton && /* @__PURE__ */ jsx(
34714
+ ) }),
34715
+ renderSessionsView ? renderSessionsView() : /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center text-muted-foreground", children: "Sessions view not available" })
34716
+ ] })
34717
+ ) : activeTab === 2 ? (
34718
+ // Projects View
34719
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
34720
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-3 h-10 shrink-0", children: /* @__PURE__ */ jsx(
34678
34721
  Button,
34679
34722
  {
34680
34723
  variant: "ghost",
34681
34724
  size: "icon",
34682
- className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
34683
- onClick: () => onClose?.(),
34684
- title: t("common.close"),
34685
- children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
34725
+ className: "h-7 w-7 text-muted-foreground hover:text-foreground",
34726
+ onClick: () => onTabChange?.(0),
34727
+ children: /* @__PURE__ */ jsx(ArrowLeft, { className: "w-4 h-4" })
34686
34728
  }
34687
- )
34729
+ ) }),
34730
+ renderProjectsView ? renderProjectsView() : /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center text-muted-foreground", children: "Projects view not available" })
34688
34731
  ] })
34689
- ] }),
34690
- /* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-row min-h-0 overflow-hidden relative", children: [
34691
- !isSidebarOpen && !(commonProps.showWelcome && commonProps.messages.length === 0) && /* @__PURE__ */ jsxs("div", { className: "absolute top-2 left-2 z-40 flex flex-col gap-1 rounded-md bg-background/80 backdrop-blur-sm p-0.5", children: [
34692
- enableSidebar && onToggleSidebar && /* @__PURE__ */ jsx(
34732
+ ) : activeTab === 4 ? (
34733
+ // Memories View
34734
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
34735
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-3 h-10 shrink-0", children: /* @__PURE__ */ jsx(
34693
34736
  Button,
34694
34737
  {
34695
34738
  variant: "ghost",
34696
34739
  size: "icon",
34697
- onClick: onToggleSidebar,
34698
- className: "h-8 w-8 text-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
34699
- title: t("tabs.sessions"),
34700
- children: /* @__PURE__ */ jsx(PanelLeft, { className: "w-4 h-4" })
34740
+ className: "h-7 w-7 text-muted-foreground hover:text-foreground",
34741
+ onClick: () => onTabChange?.(0),
34742
+ children: /* @__PURE__ */ jsx(ArrowLeft, { className: "w-4 h-4" })
34701
34743
  }
34702
- ),
34703
- onNewChat && /* @__PURE__ */ jsx(
34744
+ ) }),
34745
+ renderMemoriesView ? renderMemoriesView() : /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center text-muted-foreground", children: "Memories view not available" })
34746
+ ] })
34747
+ ) : activeTab === 3 ? (
34748
+ // Works View
34749
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
34750
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-3 h-10 shrink-0", children: /* @__PURE__ */ jsx(
34704
34751
  Button,
34705
34752
  {
34706
34753
  variant: "ghost",
34707
34754
  size: "icon",
34708
- onClick: onNewChat,
34709
- className: "h-8 w-8 text-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
34710
- title: t("buttons.start_new_thread"),
34711
- children: /* @__PURE__ */ jsx(Edit, { className: "w-4 h-4" })
34755
+ className: "h-7 w-7 text-muted-foreground hover:text-foreground",
34756
+ onClick: () => onTabChange?.(0),
34757
+ children: /* @__PURE__ */ jsx(ArrowLeft, { className: "w-4 h-4" })
34712
34758
  }
34713
- )
34714
- ] }),
34715
- enableSidebar && isSidebarOpen && renderSidebar && !(commonProps.showWelcome && commonProps.messages.length === 0) && /* @__PURE__ */ jsxs(Fragment, { children: [
34716
- /* @__PURE__ */ jsx(
34717
- "div",
34718
- {
34719
- className: "absolute inset-0 bg-black/20 z-[99] @3xl:hidden",
34720
- onClick: onToggleSidebar
34721
- }
34722
- ),
34723
- /* @__PURE__ */ jsx("div", { className: "absolute left-0 top-0 h-full w-72 bg-background z-[100] shadow-xl border-r @3xl:hidden", children: /* @__PURE__ */ jsxs("div", { className: "w-full h-full flex flex-col", children: [
34724
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between h-12 px-3 border-b shrink-0", children: [
34725
- commonProps.logo || commonProps.title ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
34726
- /* @__PURE__ */ jsxs(Avatar$1, { className: "h-7 w-7 shrink-0 after:hidden", children: [
34727
- /* @__PURE__ */ jsx(AvatarImage$1, { src: commonProps.logo, alt: commonProps.title }),
34728
- /* @__PURE__ */ jsx(AvatarFallback$1, { className: "text-xs", children: (commonProps.title || "AI").substring(0, 2).toUpperCase() })
34729
- ] }),
34730
- /* @__PURE__ */ jsx("span", { className: "text-sm font-medium truncate", children: commonProps.title })
34731
- ] }) : /* @__PURE__ */ jsx("div", {}),
34732
- /* @__PURE__ */ jsx(
34733
- Button,
34734
- {
34735
- variant: "ghost",
34736
- size: "icon",
34737
- onClick: onToggleSidebar,
34738
- className: "h-8 w-8 shrink-0 text-muted-foreground hover:text-foreground",
34739
- children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
34740
- }
34741
- )
34742
- ] }),
34743
- /* @__PURE__ */ jsx("div", { className: "flex-1 p-4 flex flex-col min-h-0 overflow-hidden", children: renderSidebar(true) })
34744
- ] }) })
34745
- ] }),
34746
- enableSidebar && renderSidebar && !(commonProps.showWelcome && commonProps.messages.length === 0) && /* @__PURE__ */ jsx(
34747
- "div",
34759
+ ) }),
34760
+ renderWorksView ? renderWorksView() : /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center text-muted-foreground", children: "Works view not available" })
34761
+ ] })
34762
+ ) : (
34763
+ // Default: Chat View
34764
+ /* @__PURE__ */ jsx(
34765
+ ChatPanel,
34748
34766
  {
34749
- className: cn(
34750
- "hidden @3xl:flex flex-col flex-none bg-background border-r transition-all duration-300 overflow-hidden",
34751
- isSidebarOpen ? "w-72" : "w-0"
34752
- ),
34753
- children: /* @__PURE__ */ jsxs("div", { className: "w-72 h-full flex flex-col relative", children: [
34754
- isSidebarOpen && /* @__PURE__ */ jsx("div", { className: "absolute top-2 right-2 z-10 flex flex-col gap-1", children: onToggleSidebar && /* @__PURE__ */ jsx(
34755
- Button,
34756
- {
34757
- variant: "ghost",
34758
- size: "icon",
34759
- onClick: onToggleSidebar,
34760
- className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
34761
- children: /* @__PURE__ */ jsx(PanelLeft, { className: "w-4 h-4" })
34762
- }
34763
- ) }),
34764
- /* @__PURE__ */ jsxs("div", { className: "flex-1 p-4 flex flex-col min-h-0 overflow-hidden", children: [
34765
- !showHeader && agentSelectorElement && /* @__PURE__ */ jsx("div", { className: "mb-3 shrink-0", children: agentSelectorElement }),
34766
- renderSidebar(false)
34767
- ] })
34768
- ] })
34767
+ messages: filteredMessages,
34768
+ isLoading: commonProps.isLoading,
34769
+ input: commonProps.input,
34770
+ onInputChange: commonProps.onInputChange,
34771
+ onSendMessage: commonProps.onSendMessage,
34772
+ onStop: commonProps.onStop,
34773
+ logo: commonProps.logo,
34774
+ userPhoto: commonProps.userPhoto,
34775
+ userDisplayName: commonProps.userDisplayName,
34776
+ description: commonProps.description,
34777
+ title: commonProps.title,
34778
+ welcomeMessage: commonProps.welcomeMessage,
34779
+ isLoadingAgent: commonProps.isLoadingAgent,
34780
+ placeholder: commonProps.placeholder,
34781
+ footerText: commonProps.footerText,
34782
+ supportFiles: commonProps.supportFiles,
34783
+ supportWebSearch: commonProps.supportWebSearch,
34784
+ supportDocumentSearch: commonProps.supportDocumentSearch,
34785
+ supportDeepResearch: commonProps.supportDeepResearch,
34786
+ supportThinking: commonProps.supportThinking,
34787
+ supportWorkCanvas: commonProps.supportWorkCanvas,
34788
+ supportMultiModels: commonProps.supportMultiModels,
34789
+ deploymentId: commonProps.deploymentId,
34790
+ tenantAiAgentId: commonProps.tenantAiAgentId,
34791
+ enableMicrophone: commonProps.enableMicrophone,
34792
+ enableVoice: commonProps.enableVoice,
34793
+ isRecording: commonProps.isRecording,
34794
+ recognition: commonProps.recognition,
34795
+ onMicrophoneClick: commonProps.onMicrophoneClick,
34796
+ onToolAction: commonProps.onToolAction,
34797
+ onForwardToAgent: commonProps.onForwardToAgent,
34798
+ openCanvasView: handleOpenCanvasViewInline,
34799
+ onEditPrompt: commonProps.onEditPrompt,
34800
+ renderThreadHeader,
34801
+ showWelcome: commonProps.showWelcome,
34802
+ recentSessions: commonProps.recentSessions,
34803
+ onSessionClick: commonProps.onSessionClick,
34804
+ threadId: commonProps.threadId,
34805
+ initialModelId: commonProps.initialModelId,
34806
+ initialFeatures: commonProps.initialFeatures,
34807
+ subagents: commonProps.subagents,
34808
+ agentTools: commonProps.agentTools,
34809
+ appContext: commonProps.appContext,
34810
+ onClearAppContext: commonProps.onClearAppContext,
34811
+ onManageMemories: onTabChange ? () => onTabChange(4) : void 0,
34812
+ compactToolbar: !isFullscreen
34769
34813
  }
34770
- ),
34771
- /* @__PURE__ */ jsx("div", { className: cn(
34772
- "flex flex-col min-h-0 overflow-hidden transition-all duration-200",
34773
- canvasWork ? "w-2/5" : "flex-1",
34774
- ""
34775
- ), children: activeTab === 1 ? (
34776
- // Sessions View
34777
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
34778
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-3 h-10 shrink-0", children: /* @__PURE__ */ jsx(
34779
- Button,
34780
- {
34781
- variant: "ghost",
34782
- size: "icon",
34783
- className: "h-7 w-7 text-muted-foreground hover:text-foreground",
34784
- onClick: () => onTabChange?.(0),
34785
- children: /* @__PURE__ */ jsx(ArrowLeft, { className: "w-4 h-4" })
34786
- }
34787
- ) }),
34788
- renderSessionsView ? renderSessionsView() : /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center text-muted-foreground", children: "Sessions view not available" })
34789
- ] })
34790
- ) : activeTab === 2 ? (
34791
- // Projects View
34792
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
34793
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-3 h-10 shrink-0", children: /* @__PURE__ */ jsx(
34814
+ )
34815
+ ) }),
34816
+ canvasWork && /* @__PURE__ */ jsxs("div", { className: "w-3/5 border-l bg-background flex flex-col shrink-0", children: [
34817
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 h-12 px-3 border-b shrink-0", children: [
34818
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium truncate flex-1", children: canvasWork.title }),
34819
+ canvasWork.type === WorkTypes.Code && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5 bg-muted rounded-md p-0.5 shrink-0", children: [
34820
+ /* @__PURE__ */ jsxs(
34794
34821
  Button,
34795
34822
  {
34796
34823
  variant: "ghost",
34797
- size: "icon",
34798
- className: "h-7 w-7 text-muted-foreground hover:text-foreground",
34799
- onClick: () => onTabChange?.(0),
34800
- children: /* @__PURE__ */ jsx(ArrowLeft, { className: "w-4 h-4" })
34824
+ size: "sm",
34825
+ className: cn(
34826
+ "h-6 px-2 text-xs rounded-sm",
34827
+ activeCanvasTab === 0 ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
34828
+ ),
34829
+ onClick: () => setActiveCanvasTab(0),
34830
+ children: [
34831
+ /* @__PURE__ */ jsx(Eye, { className: "w-3 h-3 mr-1" }),
34832
+ "Preview"
34833
+ ]
34801
34834
  }
34802
- ) }),
34803
- renderProjectsView ? renderProjectsView() : /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center text-muted-foreground", children: "Projects view not available" })
34804
- ] })
34805
- ) : activeTab === 4 ? (
34806
- // Memories View
34807
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
34808
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-3 h-10 shrink-0", children: /* @__PURE__ */ jsx(
34835
+ ),
34836
+ /* @__PURE__ */ jsxs(
34809
34837
  Button,
34810
34838
  {
34811
34839
  variant: "ghost",
34812
- size: "icon",
34813
- className: "h-7 w-7 text-muted-foreground hover:text-foreground",
34814
- onClick: () => onTabChange?.(0),
34815
- children: /* @__PURE__ */ jsx(ArrowLeft, { className: "w-4 h-4" })
34840
+ size: "sm",
34841
+ className: cn(
34842
+ "h-6 px-2 text-xs rounded-sm",
34843
+ activeCanvasTab === 1 ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
34844
+ ),
34845
+ onClick: () => setActiveCanvasTab(1),
34846
+ children: [
34847
+ /* @__PURE__ */ jsx(Code2, { className: "w-3 h-3 mr-1" }),
34848
+ "Code"
34849
+ ]
34816
34850
  }
34817
- ) }),
34818
- renderMemoriesView ? renderMemoriesView() : /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center text-muted-foreground", children: "Memories view not available" })
34819
- ] })
34820
- ) : activeTab === 3 ? (
34821
- // Works View
34822
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
34823
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-3 h-10 shrink-0", children: /* @__PURE__ */ jsx(
34824
- Button,
34851
+ )
34852
+ ] }),
34853
+ canvasWork.type !== WorkTypes.Record && canvasWork.type !== WorkTypes.Data && canvasWork.type !== WorkTypes.App && /* @__PURE__ */ jsxs(DropdownMenu$1, { children: [
34854
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", className: "h-7 text-xs px-2 shrink-0", disabled: canvasVersionsLoading, children: [
34855
+ canvasVersionsLoading ? "..." : canvasVersions.find((v) => v.id === canvasSelectedVersionId)?.name ?? t("labels.select_version"),
34856
+ /* @__PURE__ */ jsx(ChevronDown, { className: "ml-1 h-3 w-3" })
34857
+ ] }) }),
34858
+ /* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", className: "max-h-60 overflow-y-auto", children: canvasVersions.length === 0 ? /* @__PURE__ */ jsx(DropdownMenuItem, { disabled: true, className: "text-xs text-muted-foreground", children: t("messages.no_versions_found") }) : canvasVersions.map((v) => /* @__PURE__ */ jsx(
34859
+ DropdownMenuItem,
34825
34860
  {
34826
- variant: "ghost",
34827
- size: "icon",
34828
- className: "h-7 w-7 text-muted-foreground hover:text-foreground",
34829
- onClick: () => onTabChange?.(0),
34830
- children: /* @__PURE__ */ jsx(ArrowLeft, { className: "w-4 h-4" })
34831
- }
34832
- ) }),
34833
- renderWorksView ? renderWorksView() : /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center text-muted-foreground", children: "Works view not available" })
34834
- ] })
34835
- ) : (
34836
- // Default: Chat View
34861
+ className: `cursor-pointer text-xs ${canvasSelectedVersionId === v.id ? "bg-accent text-accent-foreground" : ""}`,
34862
+ onClick: () => handleCanvasVersionSelect(v.id),
34863
+ children: v.name
34864
+ },
34865
+ v.id
34866
+ )) })
34867
+ ] }),
34837
34868
  /* @__PURE__ */ jsx(
34838
- ChatPanel,
34869
+ Button,
34839
34870
  {
34840
- messages: filteredMessages,
34841
- isLoading: commonProps.isLoading,
34842
- input: commonProps.input,
34843
- onInputChange: commonProps.onInputChange,
34844
- onSendMessage: commonProps.onSendMessage,
34845
- onStop: commonProps.onStop,
34846
- logo: commonProps.logo,
34847
- userPhoto: commonProps.userPhoto,
34848
- userDisplayName: commonProps.userDisplayName,
34849
- description: commonProps.description,
34850
- title: commonProps.title,
34851
- welcomeMessage: commonProps.welcomeMessage,
34852
- isLoadingAgent: commonProps.isLoadingAgent,
34853
- placeholder: commonProps.placeholder,
34854
- footerText: commonProps.footerText,
34855
- supportFiles: commonProps.supportFiles,
34856
- supportWebSearch: commonProps.supportWebSearch,
34857
- supportDocumentSearch: commonProps.supportDocumentSearch,
34858
- supportDeepResearch: commonProps.supportDeepResearch,
34859
- supportThinking: commonProps.supportThinking,
34860
- supportWorkCanvas: commonProps.supportWorkCanvas,
34861
- supportMultiModels: commonProps.supportMultiModels,
34862
- deploymentId: commonProps.deploymentId,
34863
- tenantAiAgentId: commonProps.tenantAiAgentId,
34864
- enableMicrophone: commonProps.enableMicrophone,
34865
- enableVoice: commonProps.enableVoice,
34866
- isRecording: commonProps.isRecording,
34867
- recognition: commonProps.recognition,
34868
- onMicrophoneClick: commonProps.onMicrophoneClick,
34869
- onToolAction: commonProps.onToolAction,
34870
- openCanvasView: handleOpenCanvasViewInline,
34871
- onEditPrompt: commonProps.onEditPrompt,
34872
- renderThreadHeader,
34873
- showWelcome: commonProps.showWelcome,
34874
- recentSessions: commonProps.recentSessions,
34875
- onSessionClick: commonProps.onSessionClick,
34876
- threadId: commonProps.threadId,
34877
- initialModelId: commonProps.initialModelId,
34878
- initialFeatures: commonProps.initialFeatures,
34879
- subagents: commonProps.subagents,
34880
- agentTools: commonProps.agentTools,
34881
- appContext: commonProps.appContext,
34882
- onClearAppContext: commonProps.onClearAppContext,
34883
- onManageMemories: onTabChange ? () => onTabChange(4) : void 0,
34884
- compactToolbar: !isFullscreen
34871
+ variant: "ghost",
34872
+ size: "icon",
34873
+ onClick: () => setCanvasWork(null),
34874
+ className: "h-8 w-8 shrink-0 text-muted-foreground hover:text-foreground",
34875
+ children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
34885
34876
  }
34886
34877
  )
34887
- ) }),
34888
- canvasWork && /* @__PURE__ */ jsxs("div", { className: "w-3/5 border-l bg-background flex flex-col shrink-0", children: [
34889
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 h-12 px-3 border-b shrink-0", children: [
34890
- /* @__PURE__ */ jsx("span", { className: "text-sm font-medium truncate flex-1", children: canvasWork.title }),
34891
- canvasWork.type === WorkTypes.Code && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5 bg-muted rounded-md p-0.5 shrink-0", children: [
34892
- /* @__PURE__ */ jsxs(
34893
- Button,
34894
- {
34895
- variant: "ghost",
34896
- size: "sm",
34897
- className: cn(
34898
- "h-6 px-2 text-xs rounded-sm",
34899
- activeCanvasTab === 0 ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
34900
- ),
34901
- onClick: () => setActiveCanvasTab(0),
34902
- children: [
34903
- /* @__PURE__ */ jsx(Eye, { className: "w-3 h-3 mr-1" }),
34904
- "Preview"
34905
- ]
34906
- }
34907
- ),
34908
- /* @__PURE__ */ jsxs(
34909
- Button,
34910
- {
34911
- variant: "ghost",
34912
- size: "sm",
34913
- className: cn(
34914
- "h-6 px-2 text-xs rounded-sm",
34915
- activeCanvasTab === 1 ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
34916
- ),
34917
- onClick: () => setActiveCanvasTab(1),
34918
- children: [
34919
- /* @__PURE__ */ jsx(Code2, { className: "w-3 h-3 mr-1" }),
34920
- "Code"
34921
- ]
34922
- }
34923
- )
34924
- ] }),
34925
- canvasWork.type !== WorkTypes.Record && canvasWork.type !== WorkTypes.Data && canvasWork.type !== WorkTypes.App && /* @__PURE__ */ jsxs(DropdownMenu$1, { children: [
34926
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", className: "h-7 text-xs px-2 shrink-0", disabled: canvasVersionsLoading, children: [
34927
- canvasVersionsLoading ? "..." : canvasVersions.find((v) => v.id === canvasSelectedVersionId)?.name ?? t("labels.select_version"),
34928
- /* @__PURE__ */ jsx(ChevronDown, { className: "ml-1 h-3 w-3" })
34929
- ] }) }),
34930
- /* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", className: "max-h-60 overflow-y-auto", children: canvasVersions.length === 0 ? /* @__PURE__ */ jsx(DropdownMenuItem, { disabled: true, className: "text-xs text-muted-foreground", children: t("messages.no_versions_found") }) : canvasVersions.map((v) => /* @__PURE__ */ jsx(
34931
- DropdownMenuItem,
34932
- {
34933
- className: `cursor-pointer text-xs ${canvasSelectedVersionId === v.id ? "bg-accent text-accent-foreground" : ""}`,
34934
- onClick: () => handleCanvasVersionSelect(v.id),
34935
- children: v.name
34936
- },
34937
- v.id
34938
- )) })
34939
- ] }),
34940
- /* @__PURE__ */ jsx(
34941
- Button,
34942
- {
34943
- variant: "ghost",
34944
- size: "icon",
34945
- onClick: () => setCanvasWork(null),
34946
- className: "h-8 w-8 shrink-0 text-muted-foreground hover:text-foreground",
34947
- children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
34948
- }
34949
- )
34950
- ] }),
34951
- /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto", children: [
34952
- canvasVersionsLoading && /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx(Loader2, { className: "size-5 animate-spin text-muted-foreground" }) }),
34953
- !canvasVersionsLoading && canvasWork.type === WorkTypes.Record && /* @__PURE__ */ jsx(
34954
- CanvasRecordView,
34955
- {
34956
- dataSourceId: canvasWork.content_json?.dataSourceId ?? "",
34957
- mode: canvasWork.content_json?.mode ?? "add",
34958
- defaultValues: canvasWork.content_json?.data,
34959
- recordId: canvasWork.content_json?.recordId,
34960
- onClose: () => setCanvasWork(null),
34961
- onSave: (id, data) => {
34962
- console.info("[CanvasRecordView] saved:", id, data);
34963
- }
34964
- }
34965
- ),
34966
- !canvasVersionsLoading && canvasWork.type === WorkTypes.Image && /* @__PURE__ */ jsx(
34967
- CanvasImageView,
34968
- {
34969
- title: canvasWork.title,
34970
- images: canvasVersionImages ?? canvasWork.content_json
34971
- }
34972
- ),
34973
- !canvasVersionsLoading && canvasWork.type === WorkTypes.Text && /* @__PURE__ */ jsx(
34974
- CanvasTextView,
34975
- {
34976
- contentText: canvasVersionContent ?? "",
34977
- language: canvasVersionLanguage ?? "markdown",
34978
- title: canvasWork.title
34979
- }
34980
- ),
34981
- !canvasVersionsLoading && canvasWork.type === WorkTypes.Data && /* @__PURE__ */ jsx(
34982
- CanvasDeepResearchView,
34983
- {
34984
- title: canvasWork.title,
34985
- output_schema: canvasWork.content_json?.output_schema,
34986
- content: canvasWork.content_json?.content,
34987
- basis: canvasWork.content_json?.basis
34878
+ ] }),
34879
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto", children: [
34880
+ canvasVersionsLoading && /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx(Loader2, { className: "size-5 animate-spin text-muted-foreground" }) }),
34881
+ !canvasVersionsLoading && canvasWork.type === WorkTypes.Record && /* @__PURE__ */ jsx(
34882
+ CanvasRecordView,
34883
+ {
34884
+ dataSourceId: canvasWork.content_json?.dataSourceId ?? "",
34885
+ mode: canvasWork.content_json?.mode ?? "add",
34886
+ defaultValues: canvasWork.content_json?.data,
34887
+ recordId: canvasWork.content_json?.recordId,
34888
+ onClose: () => setCanvasWork(null),
34889
+ onSave: (id, data) => {
34890
+ console.info("[CanvasRecordView] saved:", id, data);
34988
34891
  }
34989
- ),
34990
- !canvasVersionsLoading && canvasWork.type === WorkTypes.Xlsx && (canvasSelectedVersionId && !canvasVersionImages ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx(Loader2, { className: "size-5 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ jsx(
34991
- CanvasSpreadsheetView,
34992
- {
34993
- title: canvasWork.title,
34994
- content: canvasVersionImages ?? canvasWork.content_json,
34995
- workId: canvasWork.id,
34996
- versionId: canvasSelectedVersionId ?? void 0,
34997
- commands: canvasSpreadsheetCommands,
34998
- onData: async (data) => {
34999
- const workId = canvasWork.id;
35000
- if (!workId || workId === "streaming") return;
35001
- try {
35002
- await apiClient.post(`/ai/works/${workId}/modify`, {
35003
- content_json: {
35004
- ...canvasWork.content_json ?? {},
35005
- workbook: data.workbook
35006
- }
35007
- });
35008
- } catch {
35009
- console.warn("Version didn't save succesfully.");
35010
- }
34892
+ }
34893
+ ),
34894
+ !canvasVersionsLoading && canvasWork.type === WorkTypes.Image && /* @__PURE__ */ jsx(
34895
+ CanvasImageView,
34896
+ {
34897
+ title: canvasWork.title,
34898
+ images: canvasVersionImages ?? canvasWork.content_json
34899
+ }
34900
+ ),
34901
+ !canvasVersionsLoading && canvasWork.type === WorkTypes.Text && /* @__PURE__ */ jsx(
34902
+ CanvasTextView,
34903
+ {
34904
+ contentText: canvasVersionContent ?? "",
34905
+ language: canvasVersionLanguage ?? "markdown",
34906
+ title: canvasWork.title
34907
+ }
34908
+ ),
34909
+ !canvasVersionsLoading && canvasWork.type === WorkTypes.Data && /* @__PURE__ */ jsx(
34910
+ CanvasDeepResearchView,
34911
+ {
34912
+ title: canvasWork.title,
34913
+ output_schema: canvasWork.content_json?.output_schema,
34914
+ content: canvasWork.content_json?.content,
34915
+ basis: canvasWork.content_json?.basis
34916
+ }
34917
+ ),
34918
+ !canvasVersionsLoading && canvasWork.type === WorkTypes.Xlsx && (canvasSelectedVersionId && !canvasVersionImages ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx(Loader2, { className: "size-5 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ jsx(
34919
+ CanvasSpreadsheetView,
34920
+ {
34921
+ title: canvasWork.title,
34922
+ content: canvasVersionImages ?? canvasWork.content_json,
34923
+ workId: canvasWork.id,
34924
+ versionId: canvasSelectedVersionId ?? void 0,
34925
+ commands: canvasSpreadsheetCommands,
34926
+ onData: async (data) => {
34927
+ const workId = canvasWork.id;
34928
+ if (!workId || workId === "streaming") return;
34929
+ try {
34930
+ await apiClient.post(`/ai/works/${workId}/modify`, {
34931
+ content_json: {
34932
+ ...canvasWork.content_json ?? {},
34933
+ workbook: data.workbook
34934
+ }
34935
+ });
34936
+ } catch {
34937
+ console.warn("Version didn't save succesfully.");
35011
34938
  }
35012
- },
35013
- canvasSelectedVersionId ?? canvasWork.id
35014
- )),
35015
- !canvasVersionsLoading && canvasWork.type === WorkTypes.App && /* @__PURE__ */ jsx(CanvasAppView, { app: canvasWork.content_json }),
35016
- !canvasVersionsLoading && canvasWork.type === WorkTypes.Code && canvasWork.id && (activeCanvasTab === 0 ? /* @__PURE__ */ jsx(
35017
- ShellCanvas,
35018
- {
35019
- workId: canvasWork.id,
35020
- versionId: canvasSelectedVersionId,
35021
- title: canvasWork.title
35022
- }
35023
- ) : /* @__PURE__ */ jsx(
35024
- CanvasCodeView,
35025
- {
35026
- contentText: canvasVersionContent ?? "",
35027
- language: canvasVersionLanguage,
35028
- title: canvasWork.title
35029
34939
  }
35030
- ))
35031
- ] })
34940
+ },
34941
+ canvasSelectedVersionId ?? canvasWork.id
34942
+ )),
34943
+ !canvasVersionsLoading && canvasWork.type === WorkTypes.App && /* @__PURE__ */ jsx(CanvasAppView, { app: canvasWork.content_json }),
34944
+ !canvasVersionsLoading && canvasWork.type === WorkTypes.Code && canvasWork.id && (activeCanvasTab === 0 ? /* @__PURE__ */ jsx(
34945
+ ShellCanvas,
34946
+ {
34947
+ workId: canvasWork.id,
34948
+ versionId: canvasSelectedVersionId,
34949
+ title: canvasWork.title
34950
+ }
34951
+ ) : /* @__PURE__ */ jsx(
34952
+ CanvasCodeView,
34953
+ {
34954
+ contentText: canvasVersionContent ?? "",
34955
+ language: canvasVersionLanguage,
34956
+ title: canvasWork.title
34957
+ }
34958
+ ))
35032
34959
  ] })
35033
34960
  ] })
35034
- ] });
35035
- })()
34961
+ ] })
34962
+ ]
35036
34963
  }
35037
34964
  );
35038
34965
  if (isFullscreen && typeof document !== "undefined") {
@@ -36000,7 +35927,7 @@ var AssistantWorkDetailView = ({ work, onBack }) => {
36000
35927
  }
36001
35928
  ) }),
36002
35929
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
36003
- /* @__PURE__ */ jsx(Avatar$1, { className: "w-8 h-8 rounded-full bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsxs("span", { className: "text-lg font-medium text-foreground", children: [
35930
+ /* @__PURE__ */ jsx(Avatar, { className: "w-8 h-8 rounded-full bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsxs("span", { className: "text-lg font-medium text-foreground", children: [
36004
35931
  work.title.charAt(0).toUpperCase(),
36005
35932
  " "
36006
35933
  ] }) }),
@@ -36194,7 +36121,6 @@ var DocyAssistant = ({
36194
36121
  variant = "default",
36195
36122
  renderMode = "modal",
36196
36123
  enableSidebar = true,
36197
- enableNavDropdown = false,
36198
36124
  enableVoice = false,
36199
36125
  enableMicrophone = true,
36200
36126
  enableWelcomePage = true,
@@ -36206,13 +36132,12 @@ var DocyAssistant = ({
36206
36132
  defaultFullscreen = false,
36207
36133
  hideExpand = false,
36208
36134
  hideCloseButton = false,
36209
- hideAgentSelector = false,
36210
36135
  hideBorder = false,
36211
36136
  showHeader = true,
36212
36137
  hideHeaderOnWelcome = true,
36213
- agentSelectorUrl = "/ai/agent-deployments",
36214
- baseAgentSelectorUrl = "/ai/agent-deployments/base",
36138
+ agentSelectorUrl = "/ai/agent-deployments/base",
36215
36139
  onAgentChange,
36140
+ onFullscreenChange,
36216
36141
  enableSharing = false,
36217
36142
  onShare: onShareProp,
36218
36143
  initialPrompt,
@@ -36230,19 +36155,46 @@ var DocyAssistant = ({
36230
36155
  const { apiBaseUrl: baseUrl, getAuthToken, user: configUser } = config3;
36231
36156
  const apiClient = useApiClient();
36232
36157
  const { t } = useAssistantTranslation();
36233
- const agentStorageKey = `docyrus_agent_id_${tenantAiAgentId}`;
36234
- const deploymentStorageKey = `docyrus_deployment_id_${tenantAiAgentId}`;
36235
- const resolveInitialAgentId = () => {
36236
- if (tenantAiAgentId) return tenantAiAgentId;
36237
- return localStorage.getItem(agentStorageKey) ?? tenantAiAgentId;
36238
- };
36239
- const resolveInitialDeploymentId = () => {
36240
- if (tenantAiAgentId) return void 0;
36241
- return localStorage.getItem(deploymentStorageKey) ?? void 0;
36158
+ const tabsStorageKey = `docyrus_assistant_tabs_${tenantAiAgentId ?? "default"}`;
36159
+ const pinnedTabId = `pinned:${tenantAiAgentId ?? "default"}`;
36160
+ const buildPinnedTab = () => ({
36161
+ id: pinnedTabId,
36162
+ agentId: tenantAiAgentId ?? "",
36163
+ agentType: "base",
36164
+ pinned: true,
36165
+ name: titleProp,
36166
+ avatar: typeof logo === "string" ? logo : void 0
36167
+ });
36168
+ const resolveInitialTabs = () => {
36169
+ const pinned = buildPinnedTab();
36170
+ if (typeof window === "undefined") return [pinned];
36171
+ try {
36172
+ const raw = localStorage.getItem(tabsStorageKey);
36173
+ if (!raw) return [pinned];
36174
+ const parsed = JSON.parse(raw);
36175
+ const extras = Array.isArray(parsed) ? parsed.filter((t2) => t2 && t2.id && t2.agentId && t2.id !== pinnedTabId && !t2.pinned) : [];
36176
+ return [pinned, ...extras];
36177
+ } catch {
36178
+ return [pinned];
36179
+ }
36242
36180
  };
36243
- const [activeAgentId, setActiveAgentId] = useState(resolveInitialAgentId);
36244
- const [deploymentId, setDeploymentId] = useState(resolveInitialDeploymentId);
36245
- const isBaseAgent = !deploymentId && !!tenantAiAgentId;
36181
+ const [tabs, setTabs] = useState(resolveInitialTabs);
36182
+ const [activeTabId, setActiveTabId] = useState(pinnedTabId);
36183
+ const activeTab = useMemo(
36184
+ () => tabs.find((t2) => t2.id === activeTabId) ?? tabs[0],
36185
+ [tabs, activeTabId]
36186
+ );
36187
+ const activeAgentId = activeTab?.agentId ?? tenantAiAgentId ?? "";
36188
+ const deploymentId = activeTab?.deploymentId;
36189
+ useEffect(() => {
36190
+ if (typeof window === "undefined") return;
36191
+ try {
36192
+ const extras = tabs.filter((t2) => !t2.pinned);
36193
+ localStorage.setItem(tabsStorageKey, JSON.stringify(extras));
36194
+ } catch {
36195
+ }
36196
+ }, [tabs, tabsStorageKey]);
36197
+ const isBaseAgent = !deploymentId && !!activeAgentId;
36246
36198
  const { capabilities: agentCapabilities } = useDeploymentData(deploymentId || activeAgentId, supportMultiModels, isBaseAgent);
36247
36199
  const effectiveSupportWorkCanvas = agentCapabilities ? agentCapabilities.supportWorkCanvas : supportWorkCanvas;
36248
36200
  const title = titleProp || "DocyAssistant";
@@ -36254,7 +36206,7 @@ var DocyAssistant = ({
36254
36206
  const { state: projectState, actions: projectActions } = useProjectState();
36255
36207
  const { state: worksState, actions: worksActions } = useWorksState();
36256
36208
  const [input, setInput] = useState(initialPrompt || "");
36257
- const [showWelcome, setShowWelcome] = useState(enableWelcomePage);
36209
+ const [showWelcome, setShowWelcome] = useState(() => enableWelcomePage && tabs.length <= 1);
36258
36210
  const currentUserId = configUser.id;
36259
36211
  const [projectSearchQuery, setProjectSearchQuery] = useState("");
36260
36212
  const [isInlineFullscreen, setIsInlineFullscreen] = useState(defaultFullscreen);
@@ -36277,6 +36229,8 @@ var DocyAssistant = ({
36277
36229
  const messageOptionsRef = useRef(null);
36278
36230
  const initialPromptSentRef = useRef(false);
36279
36231
  const isSendingRef = useRef(false);
36232
+ const handleSendMessageRef = useRef(async () => {
36233
+ });
36280
36234
  const clientToolMap = useMemo(() => buildClientToolMap(clientTools), [clientTools]);
36281
36235
  const clientToolDefs = useMemo(() => serializeClientTools(clientTools), [clientTools]);
36282
36236
  const clientToolMapRef = useRef(clientToolMap);
@@ -36351,7 +36305,7 @@ var DocyAssistant = ({
36351
36305
  stop,
36352
36306
  addToolOutput
36353
36307
  } = useChat$1({
36354
- id: `docy-assistant:${activeAgentId}`,
36308
+ id: `docy-assistant:${activeTabId}`,
36355
36309
  transport,
36356
36310
  experimental_throttle: 80,
36357
36311
  sendAutomaticallyWhen: lastAssistantMessageIsCompleteWithToolCalls,
@@ -36432,6 +36386,7 @@ var DocyAssistant = ({
36432
36386
  apiClientRef.current = apiClient;
36433
36387
  const {
36434
36388
  agentDetails,
36389
+ agentDetailsForId,
36435
36390
  isLoadingAgentDetails,
36436
36391
  subagents,
36437
36392
  agentTools
@@ -36442,6 +36397,24 @@ var DocyAssistant = ({
36442
36397
  title,
36443
36398
  t
36444
36399
  });
36400
+ const activeAgentMatchesDetails = agentDetailsForId === activeAgentId;
36401
+ const liveAgentDetails = activeAgentMatchesDetails ? agentDetails : null;
36402
+ useEffect(() => {
36403
+ if (!agentDetailsForId || !agentDetails) return;
36404
+ setTabs((prev) => {
36405
+ let changed = false;
36406
+ const next = prev.map((tab) => {
36407
+ if (tab.agentId !== agentDetailsForId) return tab;
36408
+ if (tab.name && tab.avatar) return tab;
36409
+ const nextName = tab.name || agentDetails.name;
36410
+ const nextAvatar = tab.avatar || agentDetails.logo;
36411
+ if (nextName === tab.name && nextAvatar === tab.avatar) return tab;
36412
+ changed = true;
36413
+ return { ...tab, name: nextName, avatar: nextAvatar };
36414
+ });
36415
+ return changed ? next : prev;
36416
+ });
36417
+ }, [agentDetails, agentDetailsForId]);
36445
36418
  const fetchThreads = useCallback(async () => {
36446
36419
  await fetchAgentThreads(apiClient, activeAgentId, sessionActions.setSessions, currentUserId, deploymentId);
36447
36420
  }, [
@@ -36487,35 +36460,28 @@ var DocyAssistant = ({
36487
36460
  currentUserId
36488
36461
  ]);
36489
36462
  useEffect(() => {
36490
- if (isOpen && (enableSidebar || enableNavDropdown)) {
36463
+ if (isOpen && enableSidebar) {
36491
36464
  fetchThreads();
36492
36465
  }
36493
- }, [
36494
- isOpen,
36495
- enableSidebar,
36496
- enableNavDropdown,
36497
- fetchThreads
36498
- ]);
36466
+ }, [isOpen, enableSidebar, fetchThreads]);
36499
36467
  useEffect(() => {
36500
- if (isOpen && (enableSidebar || enableNavDropdown)) {
36468
+ if (isOpen && enableSidebar) {
36501
36469
  projectActions.setProjectsLoaded(false);
36502
36470
  fetchProjects2();
36503
36471
  }
36504
36472
  }, [
36505
36473
  isOpen,
36506
36474
  enableSidebar,
36507
- enableNavDropdown,
36508
36475
  projectActions,
36509
36476
  fetchProjects2
36510
36477
  ]);
36511
36478
  useEffect(() => {
36512
- if (isOpen && (enableSidebar || enableNavDropdown) && uiState.activeTab === 3) {
36479
+ if (isOpen && enableSidebar && uiState.activeTab === 3) {
36513
36480
  fetchWorks2();
36514
36481
  }
36515
36482
  }, [
36516
36483
  isOpen,
36517
36484
  enableSidebar,
36518
- enableNavDropdown,
36519
36485
  uiState.activeTab,
36520
36486
  fetchWorks2
36521
36487
  ]);
@@ -36558,6 +36524,115 @@ var DocyAssistant = ({
36558
36524
  setMessages([]);
36559
36525
  setShowWelcome(false);
36560
36526
  };
36527
+ const tabSnapshotsRef = useRef(/* @__PURE__ */ new Map());
36528
+ const previousTabIdRef = useRef(activeTabId);
36529
+ const handleTabSelect = useCallback((nextTabId) => {
36530
+ if (nextTabId === activeTabId) return;
36531
+ tabSnapshotsRef.current.set(activeTabId, {
36532
+ sessionId: selectedSessionIdRef.current,
36533
+ messages
36534
+ });
36535
+ setActiveTabId(nextTabId);
36536
+ }, [activeTabId, messages]);
36537
+ const handleAddTab = useCallback((agent) => {
36538
+ const existing = tabs.find((t2) => t2.agentId === agent.id && t2.agentType === agent.type);
36539
+ if (existing) {
36540
+ handleTabSelect(existing.id);
36541
+ return;
36542
+ }
36543
+ const newTab = {
36544
+ id: `${agent.type}:${agent.id}:${Date.now()}`,
36545
+ agentId: agent.id,
36546
+ deploymentId: agent.type === "deployment" ? agent.id : void 0,
36547
+ agentType: agent.type,
36548
+ name: agent.name,
36549
+ avatar: agent.avatar
36550
+ };
36551
+ tabSnapshotsRef.current.set(activeTabId, {
36552
+ sessionId: selectedSessionIdRef.current,
36553
+ messages
36554
+ });
36555
+ setTabs((prev) => [...prev, newTab]);
36556
+ setActiveTabId(newTab.id);
36557
+ onAgentChange?.(agent.id, agent.type);
36558
+ }, [
36559
+ tabs,
36560
+ activeTabId,
36561
+ messages,
36562
+ handleTabSelect,
36563
+ onAgentChange
36564
+ ]);
36565
+ const pendingForwardRef = useRef(null);
36566
+ const handleForwardToAgent = useCallback(({ agentId: targetAgentId, prompt }) => {
36567
+ if (!targetAgentId) return;
36568
+ const existing = tabs.find((t2) => t2.agentId === targetAgentId && t2.agentType === "base");
36569
+ let targetTabId;
36570
+ if (existing) {
36571
+ targetTabId = existing.id;
36572
+ } else {
36573
+ targetTabId = `base:${targetAgentId}:${Date.now()}`;
36574
+ const newTab = {
36575
+ id: targetTabId,
36576
+ agentId: targetAgentId,
36577
+ agentType: "base"
36578
+ };
36579
+ tabSnapshotsRef.current.set(activeTabId, {
36580
+ sessionId: selectedSessionIdRef.current,
36581
+ messages
36582
+ });
36583
+ setTabs((prev) => [...prev, newTab]);
36584
+ }
36585
+ if (prompt && prompt.trim()) {
36586
+ pendingForwardRef.current = { targetTabId, prompt };
36587
+ }
36588
+ if (targetTabId !== activeTabId) {
36589
+ setActiveTabId(targetTabId);
36590
+ } else if (prompt && prompt.trim()) {
36591
+ queueMicrotask(() => {
36592
+ const pending = pendingForwardRef.current;
36593
+ if (!pending) return;
36594
+ pendingForwardRef.current = null;
36595
+ void handleSendMessageRef.current(void 0, void 0, pending.prompt);
36596
+ });
36597
+ }
36598
+ }, [tabs, activeTabId, messages]);
36599
+ const handleTabClose = useCallback((tabId) => {
36600
+ const target = tabs.find((t2) => t2.id === tabId);
36601
+ if (!target || target.pinned) return;
36602
+ tabSnapshotsRef.current.delete(tabId);
36603
+ setTabs((prev) => {
36604
+ const next = prev.filter((t2) => t2.id !== tabId);
36605
+ if (tabId === activeTabId) {
36606
+ const fallback = next[next.length - 1] ?? next[0];
36607
+ if (fallback) {
36608
+ setActiveTabId(fallback.id);
36609
+ }
36610
+ }
36611
+ return next;
36612
+ });
36613
+ }, [tabs, activeTabId]);
36614
+ useEffect(() => {
36615
+ const prevId = previousTabIdRef.current;
36616
+ if (prevId === activeTabId) return;
36617
+ previousTabIdRef.current = activeTabId;
36618
+ const snap = tabSnapshotsRef.current.get(activeTabId);
36619
+ if (snap) {
36620
+ sessionActions.selectSessionId(snap.sessionId);
36621
+ setMessages(snap.messages);
36622
+ } else {
36623
+ sessionActions.selectSessionId(null);
36624
+ sessionActions.selectSession(null);
36625
+ setMessages([]);
36626
+ }
36627
+ setShowWelcome(false);
36628
+ const pending = pendingForwardRef.current;
36629
+ if (pending && pending.targetTabId === activeTabId) {
36630
+ pendingForwardRef.current = null;
36631
+ queueMicrotask(() => {
36632
+ void handleSendMessageRef.current(void 0, void 0, pending.prompt);
36633
+ });
36634
+ }
36635
+ }, [activeTabId]);
36561
36636
  const handleSendMessage = async (e, options3, overrideText) => {
36562
36637
  e?.preventDefault();
36563
36638
  if (isSendingRef.current) return;
@@ -36637,6 +36712,7 @@ var DocyAssistant = ({
36637
36712
  isSendingRef.current = false;
36638
36713
  }
36639
36714
  };
36715
+ handleSendMessageRef.current = handleSendMessage;
36640
36716
  useEffect(() => {
36641
36717
  if (!initialPrompt || initialPromptSentRef.current) return;
36642
36718
  initialPromptSentRef.current = true;
@@ -36719,17 +36795,24 @@ var DocyAssistant = ({
36719
36795
  };
36720
36796
  const handleExpand = () => {
36721
36797
  if (isInlineMode) {
36722
- setIsInlineFullscreen((prev) => !prev);
36798
+ setIsInlineFullscreen((prev) => {
36799
+ const next = !prev;
36800
+ onFullscreenChange?.(next);
36801
+ return next;
36802
+ });
36723
36803
  return;
36724
36804
  }
36725
36805
  if (uiState.isExpanded && renderMode === "inline") {
36726
36806
  uiActions.setRenderMode("inline");
36727
36807
  uiActions.setExpanded(false);
36728
36808
  uiActions.setDocked(false);
36809
+ onFullscreenChange?.(false);
36729
36810
  return;
36730
36811
  }
36731
- uiActions.setExpanded(!uiState.isExpanded);
36812
+ const nextExpanded = !uiState.isExpanded;
36813
+ uiActions.setExpanded(nextExpanded);
36732
36814
  uiActions.setDocked(false);
36815
+ onFullscreenChange?.(nextExpanded);
36733
36816
  };
36734
36817
  const handleCreateProject = async (e) => {
36735
36818
  e.preventDefault();
@@ -36843,11 +36926,11 @@ var DocyAssistant = ({
36843
36926
  onSendMessage: handleSendMessage,
36844
36927
  onEditPrompt: handleEditPrompt,
36845
36928
  onStop: stop,
36846
- title: isLoadingAgentDetails ? "" : agentDetails?.name ?? title,
36929
+ title: liveAgentDetails?.name ?? activeTab?.name ?? "",
36847
36930
  description,
36848
- welcomeMessage: isLoadingAgentDetails ? void 0 : agentDetails?.welcomeMessage,
36849
- isLoadingAgent: isLoadingAgentDetails,
36850
- logo: isLoadingAgentDetails ? void 0 : agentDetails?.logo ?? logo,
36931
+ welcomeMessage: liveAgentDetails?.welcomeMessage,
36932
+ isLoadingAgent: isLoadingAgentDetails && !liveAgentDetails && !activeTab?.avatar,
36933
+ logo: liveAgentDetails?.logo ?? activeTab?.avatar ?? logo,
36851
36934
  placeholder,
36852
36935
  footerText,
36853
36936
  className: opts.className,
@@ -36863,8 +36946,8 @@ var DocyAssistant = ({
36863
36946
  supportMultiModels,
36864
36947
  deploymentId,
36865
36948
  tenantAiAgentId: activeAgentId,
36866
- subagents,
36867
- agentTools,
36949
+ subagents: activeAgentMatchesDetails ? subagents : [],
36950
+ agentTools: activeAgentMatchesDetails ? agentTools : [],
36868
36951
  appContext,
36869
36952
  onClearAppContext: clearAppContext,
36870
36953
  initialModelId,
@@ -36886,7 +36969,6 @@ var DocyAssistant = ({
36886
36969
  createNewThread();
36887
36970
  projectActions.setContext(null);
36888
36971
  },
36889
- enableNavDropdown: opts.enableNavDropdown,
36890
36972
  isFullscreen: opts.isFullscreen,
36891
36973
  onExpand: opts.onExpand,
36892
36974
  renderThreadHeader: sessionState.selectedSession && sessionState.selectedSession.id === sessionState.selectedSessionId ? () => {
@@ -37118,7 +37200,6 @@ var DocyAssistant = ({
37118
37200
  projectActions.selectProject(project);
37119
37201
  projectActions.setDeleteDialogOpen(true);
37120
37202
  },
37121
- compact: enableNavDropdown,
37122
37203
  sidebarOffset: !uiState.isSidebarOpen && enableSidebar,
37123
37204
  t
37124
37205
  }
@@ -37216,27 +37297,26 @@ var DocyAssistant = ({
37216
37297
  ] })
37217
37298
  ] }),
37218
37299
  onToolAction: handleToolAction,
37300
+ onForwardToAgent: handleForwardToAgent,
37219
37301
  threadId: sessionState.selectedSessionId ?? void 0,
37220
37302
  hideCloseButton,
37221
- hideAgentSelector,
37222
37303
  hideBorder,
37223
37304
  showHeader,
37224
37305
  hideHeaderOnWelcome,
37225
- agentSelectorUrl,
37226
- baseAgentSelectorUrl,
37227
- onAgentChange: (agentId, agentType) => {
37228
- if (agentType === "base") {
37229
- localStorage.setItem(agentStorageKey, agentId);
37230
- localStorage.removeItem(deploymentStorageKey);
37231
- setActiveAgentId(agentId);
37232
- setDeploymentId(void 0);
37233
- } else {
37234
- localStorage.setItem(deploymentStorageKey, agentId);
37235
- setDeploymentId(agentId);
37306
+ renderHeaderTabs: ({ isFullscreen: fs }) => /* @__PURE__ */ jsx(
37307
+ AgentTabs,
37308
+ {
37309
+ tabs,
37310
+ activeTabId,
37311
+ onTabSelect: handleTabSelect,
37312
+ onTabClose: handleTabClose,
37313
+ onAddTab: handleAddTab,
37314
+ agentSelectorUrl,
37315
+ isFullscreen: fs,
37316
+ fallbackLogo: typeof logo === "string" ? logo : void 0,
37317
+ fallbackTitle: titleProp
37236
37318
  }
37237
- createNewThread();
37238
- onAgentChange?.(agentId, agentType);
37239
- },
37319
+ ),
37240
37320
  t
37241
37321
  }
37242
37322
  );
@@ -37271,7 +37351,6 @@ var DocyAssistant = ({
37271
37351
  renderInlineViewContent({
37272
37352
  isFullscreen: isInlineFullscreen,
37273
37353
  enableSidebar: isInlineFullscreen ? true : enableSidebar,
37274
- enableNavDropdown: isInlineFullscreen ? false : enableNavDropdown,
37275
37354
  className,
37276
37355
  onExpand: hideExpand ? void 0 : handleExpand,
37277
37356
  isOpen,
@@ -37328,7 +37407,6 @@ var DocyAssistant = ({
37328
37407
  children: renderInlineViewContent({
37329
37408
  isFullscreen: false,
37330
37409
  enableSidebar,
37331
- enableNavDropdown,
37332
37410
  className: cn("h-full w-full border-0 shadow-none", uiState.isExpanded || uiState.isDocked ? "rounded-none" : "rounded-xl"),
37333
37411
  onExpand: handleExpand,
37334
37412
  isOpen: true