@copilotz/chat-ui 0.7.5 → 0.7.8

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
@@ -183,7 +183,7 @@ function mergeConfig(_baseConfig, userConfig) {
183
183
  }
184
184
 
185
185
  // src/components/chat/Message.tsx
186
- import React2, { useState as useState2, useMemo, useEffect, memo as memo2 } from "react";
186
+ import React3, { useState as useState2, useMemo, useEffect as useEffect2, memo as memo2 } from "react";
187
187
  import ReactMarkdown from "react-markdown";
188
188
  import remarkGfm from "remark-gfm";
189
189
  import rehypeHighlight from "rehype-highlight";
@@ -216,6 +216,29 @@ var createObjectUrlFromDataUrl = (dataUrl) => {
216
216
  return null;
217
217
  }
218
218
  };
219
+ var getAttachmentKindFromMimeType = (mimeType) => {
220
+ const normalized = (mimeType || "").toLowerCase();
221
+ if (normalized.startsWith("image/")) return "image";
222
+ if (normalized.startsWith("audio/")) return "audio";
223
+ if (normalized.startsWith("video/")) return "video";
224
+ return "file";
225
+ };
226
+ var getMimeTypeFromDataUrl = (dataUrl) => {
227
+ const match = dataUrl.match(/^data:([^;,]+)[;,]/);
228
+ return match?.[1] || null;
229
+ };
230
+ var formatFileSize = (bytes) => {
231
+ if (typeof bytes !== "number" || !Number.isFinite(bytes) || bytes < 0) return "";
232
+ if (bytes < 1024) return `${bytes} B`;
233
+ const units = ["KB", "MB", "GB", "TB"];
234
+ let value = bytes / 1024;
235
+ let unitIndex = 0;
236
+ while (value >= 1024 && unitIndex < units.length - 1) {
237
+ value /= 1024;
238
+ unitIndex += 1;
239
+ }
240
+ return `${value >= 10 ? value.toFixed(0) : value.toFixed(1)} ${units[unitIndex]}`;
241
+ };
219
242
 
220
243
  // src/components/ui/button.tsx
221
244
  import { jsx } from "react/jsx-runtime";
@@ -365,10 +388,155 @@ function TooltipContent({
365
388
  ) });
366
389
  }
367
390
 
391
+ // src/components/ui/dialog.tsx
392
+ import * as React from "react";
393
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
394
+ import { XIcon } from "lucide-react";
395
+ import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
396
+ function cleanupBodyStyles() {
397
+ if (typeof document !== "undefined" && document.body.style.pointerEvents === "none") {
398
+ document.body.style.pointerEvents = "";
399
+ }
400
+ }
401
+ function Dialog({
402
+ open,
403
+ onOpenChange,
404
+ ...props
405
+ }) {
406
+ const prevOpenRef = React.useRef(open);
407
+ React.useEffect(() => {
408
+ if (prevOpenRef.current === true && open === false) {
409
+ const timeout = setTimeout(cleanupBodyStyles, 250);
410
+ return () => clearTimeout(timeout);
411
+ }
412
+ prevOpenRef.current = open;
413
+ }, [open]);
414
+ React.useEffect(() => {
415
+ return () => {
416
+ cleanupBodyStyles();
417
+ };
418
+ }, []);
419
+ return /* @__PURE__ */ jsx5(DialogPrimitive.Root, { "data-slot": "dialog", open, onOpenChange, ...props });
420
+ }
421
+ function DialogTrigger({
422
+ ...props
423
+ }) {
424
+ return /* @__PURE__ */ jsx5(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
425
+ }
426
+ function DialogPortal({
427
+ ...props
428
+ }) {
429
+ return /* @__PURE__ */ jsx5(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
430
+ }
431
+ function DialogOverlay({
432
+ className,
433
+ ...props
434
+ }) {
435
+ return /* @__PURE__ */ jsx5(
436
+ DialogPrimitive.Overlay,
437
+ {
438
+ "data-slot": "dialog-overlay",
439
+ className: cn(
440
+ "fixed inset-0 z-50 bg-black/50",
441
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
442
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
443
+ "data-[state=closed]:pointer-events-none",
444
+ className
445
+ ),
446
+ ...props
447
+ }
448
+ );
449
+ }
450
+ function DialogContent({
451
+ className,
452
+ children,
453
+ showCloseButton = true,
454
+ ...props
455
+ }) {
456
+ return /* @__PURE__ */ jsxs2(DialogPortal, { "data-slot": "dialog-portal", children: [
457
+ /* @__PURE__ */ jsx5(DialogOverlay, {}),
458
+ /* @__PURE__ */ jsxs2(
459
+ DialogPrimitive.Content,
460
+ {
461
+ "data-slot": "dialog-content",
462
+ "aria-describedby": void 0,
463
+ className: cn(
464
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
465
+ className
466
+ ),
467
+ ...props,
468
+ children: [
469
+ children,
470
+ showCloseButton && /* @__PURE__ */ jsxs2(
471
+ DialogPrimitive.Close,
472
+ {
473
+ "data-slot": "dialog-close",
474
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
475
+ children: [
476
+ /* @__PURE__ */ jsx5(XIcon, {}),
477
+ /* @__PURE__ */ jsx5("span", { className: "sr-only", children: "Close" })
478
+ ]
479
+ }
480
+ )
481
+ ]
482
+ }
483
+ )
484
+ ] });
485
+ }
486
+ function DialogHeader({ className, ...props }) {
487
+ return /* @__PURE__ */ jsx5(
488
+ "div",
489
+ {
490
+ "data-slot": "dialog-header",
491
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
492
+ ...props
493
+ }
494
+ );
495
+ }
496
+ function DialogFooter({ className, ...props }) {
497
+ return /* @__PURE__ */ jsx5(
498
+ "div",
499
+ {
500
+ "data-slot": "dialog-footer",
501
+ className: cn(
502
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
503
+ className
504
+ ),
505
+ ...props
506
+ }
507
+ );
508
+ }
509
+ function DialogTitle({
510
+ className,
511
+ ...props
512
+ }) {
513
+ return /* @__PURE__ */ jsx5(
514
+ DialogPrimitive.Title,
515
+ {
516
+ "data-slot": "dialog-title",
517
+ className: cn("text-lg leading-none font-semibold", className),
518
+ ...props
519
+ }
520
+ );
521
+ }
522
+ function DialogDescription({
523
+ className,
524
+ ...props
525
+ }) {
526
+ return /* @__PURE__ */ jsx5(
527
+ DialogPrimitive.Description,
528
+ {
529
+ "data-slot": "dialog-description",
530
+ className: cn("text-muted-foreground text-sm", className),
531
+ ...props
532
+ }
533
+ );
534
+ }
535
+
368
536
  // src/components/chat/AssistantActivity.tsx
369
537
  import { memo, useState } from "react";
370
538
  import { CheckCircle2, ChevronDown, ChevronRight, CircleAlert, LoaderCircle, Wrench, Brain, Sparkles } from "lucide-react";
371
- import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
539
+ import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
372
540
  var ROOT_CLASS = "mb-4 w-full max-w-full min-w-0";
373
541
  var interpolate = (template, replacements) => Object.entries(replacements).reduce(
374
542
  (output, [key, value]) => output.replaceAll(`{{${key}}}`, String(value ?? "")),
@@ -393,33 +561,33 @@ var resolveActivityLabel = (item, labels) => {
393
561
  return item.status === "active" ? labels?.activityThinkingActive || "Thinking" : labels?.activityThinkingComplete || "Thought through request";
394
562
  };
395
563
  var ActivityIcon = ({ item }) => {
396
- if (item.status === "active") return /* @__PURE__ */ jsx5(LoaderCircle, { className: "h-4 w-4 animate-spin text-primary" });
397
- if (item.status === "failed") return /* @__PURE__ */ jsx5(CircleAlert, { className: "h-4 w-4 text-destructive" });
398
- if (item.status === "complete") return /* @__PURE__ */ jsx5(CheckCircle2, { className: "h-4 w-4 text-muted-foreground" });
399
- if (item.kind === "tool") return /* @__PURE__ */ jsx5(Wrench, { className: "h-4 w-4 text-muted-foreground" });
400
- if (item.kind === "answering") return /* @__PURE__ */ jsx5(Sparkles, { className: "h-4 w-4 text-muted-foreground" });
401
- if (item.kind === "thinking") return /* @__PURE__ */ jsx5(Brain, { className: "h-4 w-4 text-muted-foreground" });
402
- return /* @__PURE__ */ jsx5(CheckCircle2, { className: "h-4 w-4 text-muted-foreground" });
564
+ if (item.status === "active") return /* @__PURE__ */ jsx6(LoaderCircle, { className: "h-4 w-4 animate-spin text-primary" });
565
+ if (item.status === "failed") return /* @__PURE__ */ jsx6(CircleAlert, { className: "h-4 w-4 text-destructive" });
566
+ if (item.status === "complete") return /* @__PURE__ */ jsx6(CheckCircle2, { className: "h-4 w-4 text-muted-foreground" });
567
+ if (item.kind === "tool") return /* @__PURE__ */ jsx6(Wrench, { className: "h-4 w-4 text-muted-foreground" });
568
+ if (item.kind === "answering") return /* @__PURE__ */ jsx6(Sparkles, { className: "h-4 w-4 text-muted-foreground" });
569
+ if (item.kind === "thinking") return /* @__PURE__ */ jsx6(Brain, { className: "h-4 w-4 text-muted-foreground" });
570
+ return /* @__PURE__ */ jsx6(CheckCircle2, { className: "h-4 w-4 text-muted-foreground" });
403
571
  };
404
572
  var ActivityDetails = memo(function ActivityDetails2({
405
573
  item
406
574
  }) {
407
575
  const toolCall = item.details?.toolCall;
408
- return /* @__PURE__ */ jsxs2("div", { className: "space-y-3 pb-1 pl-7 pt-2 text-sm text-muted-foreground", children: [
409
- item.details?.reasoning && /* @__PURE__ */ jsx5("div", { className: "whitespace-pre-wrap break-words leading-6", children: item.details.reasoning }),
410
- item.details?.error && /* @__PURE__ */ jsx5("div", { className: "text-destructive", children: item.details.error }),
411
- toolCall && /* @__PURE__ */ jsx5("pre", { className: "overflow-x-auto rounded-md bg-muted/60 p-2 text-xs", children: JSON.stringify(toolCall.arguments, null, 2) }),
412
- item.details?.result !== void 0 && /* @__PURE__ */ jsx5("pre", { className: "overflow-x-auto rounded-md bg-muted/60 p-2 text-xs", children: JSON.stringify(item.details.result, null, 2) })
576
+ return /* @__PURE__ */ jsxs3("div", { className: "space-y-3 pb-1 pl-7 pt-2 text-sm text-muted-foreground", children: [
577
+ item.details?.reasoning && /* @__PURE__ */ jsx6("div", { className: "whitespace-pre-wrap break-words leading-6", children: item.details.reasoning }),
578
+ item.details?.error && /* @__PURE__ */ jsx6("div", { className: "text-destructive", children: item.details.error }),
579
+ toolCall && /* @__PURE__ */ jsx6("pre", { className: "overflow-x-auto rounded-md bg-muted/60 p-2 text-xs", children: JSON.stringify(toolCall.arguments, null, 2) }),
580
+ item.details?.result !== void 0 && /* @__PURE__ */ jsx6("pre", { className: "overflow-x-auto rounded-md bg-muted/60 p-2 text-xs", children: JSON.stringify(item.details.result, null, 2) })
413
581
  ] });
414
582
  });
415
583
  var ActivitySkeleton = memo(function ActivitySkeleton2() {
416
- return /* @__PURE__ */ jsx5("div", { className: ROOT_CLASS, children: /* @__PURE__ */ jsxs2("div", { className: "flex w-full min-w-0 items-center gap-3 rounded-md border border-border/50 bg-muted/20 px-3 py-2", children: [
417
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1.5", children: [
418
- /* @__PURE__ */ jsx5("span", { className: "inline-block h-2 w-2 animate-pulse rounded-full bg-primary/80" }),
419
- /* @__PURE__ */ jsx5("span", { className: "inline-block h-2 w-2 animate-pulse rounded-full bg-primary/60 [animation-delay:120ms]" }),
420
- /* @__PURE__ */ jsx5("span", { className: "inline-block h-2 w-2 animate-pulse rounded-full bg-primary/40 [animation-delay:240ms]" })
584
+ return /* @__PURE__ */ jsx6("div", { className: ROOT_CLASS, children: /* @__PURE__ */ jsxs3("div", { className: "flex w-full min-w-0 items-center gap-3 rounded-md border border-border/50 bg-muted/20 px-3 py-2", children: [
585
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-1.5", children: [
586
+ /* @__PURE__ */ jsx6("span", { className: "inline-block h-2 w-2 animate-pulse rounded-full bg-primary/80" }),
587
+ /* @__PURE__ */ jsx6("span", { className: "inline-block h-2 w-2 animate-pulse rounded-full bg-primary/60 [animation-delay:120ms]" }),
588
+ /* @__PURE__ */ jsx6("span", { className: "inline-block h-2 w-2 animate-pulse rounded-full bg-primary/40 [animation-delay:240ms]" })
421
589
  ] }),
422
- /* @__PURE__ */ jsx5("div", { className: "h-3 w-28 animate-pulse rounded-full bg-muted" })
590
+ /* @__PURE__ */ jsx6("div", { className: "h-3 w-28 animate-pulse rounded-full bg-muted" })
423
591
  ] }) });
424
592
  });
425
593
  var ActivityTimeline = memo(function ActivityTimeline2({
@@ -428,15 +596,15 @@ var ActivityTimeline = memo(function ActivityTimeline2({
428
596
  labels
429
597
  }) {
430
598
  const [openById, setOpenById] = useState({});
431
- return /* @__PURE__ */ jsx5("div", { className: ROOT_CLASS, children: /* @__PURE__ */ jsx5("div", { className: "space-y-1", children: activity.items.map((item, index) => {
599
+ return /* @__PURE__ */ jsx6("div", { className: ROOT_CLASS, children: /* @__PURE__ */ jsx6("div", { className: "space-y-1", children: activity.items.map((item, index) => {
432
600
  const detailsAvailable = showActivityDetails && hasDetails(item);
433
601
  const open = Boolean(openById[item.id]);
434
602
  const isLast = index === activity.items.length - 1;
435
- return /* @__PURE__ */ jsxs2("div", { className: "relative grid grid-cols-[1rem_minmax(0,1fr)] gap-3", children: [
436
- !isLast && /* @__PURE__ */ jsx5("div", { className: "absolute left-2 top-5 h-[calc(100%-0.25rem)] w-px bg-border" }),
437
- /* @__PURE__ */ jsx5("div", { className: "relative z-10 mt-1 flex h-4 w-4 items-center justify-center bg-background", children: /* @__PURE__ */ jsx5(ActivityIcon, { item }) }),
438
- /* @__PURE__ */ jsxs2("div", { className: "min-w-0", children: [
439
- /* @__PURE__ */ jsxs2(
603
+ return /* @__PURE__ */ jsxs3("div", { className: "relative grid grid-cols-[1rem_minmax(0,1fr)] gap-3", children: [
604
+ !isLast && /* @__PURE__ */ jsx6("div", { className: "absolute left-2 top-5 h-[calc(100%-0.25rem)] w-px bg-border" }),
605
+ /* @__PURE__ */ jsx6("div", { className: "relative z-10 mt-1 flex h-4 w-4 items-center justify-center bg-background", children: /* @__PURE__ */ jsx6(ActivityIcon, { item }) }),
606
+ /* @__PURE__ */ jsxs3("div", { className: "min-w-0", children: [
607
+ /* @__PURE__ */ jsxs3(
440
608
  Button,
441
609
  {
442
610
  type: "button",
@@ -449,12 +617,12 @@ var ActivityTimeline = memo(function ActivityTimeline2({
449
617
  !detailsAvailable && "pointer-events-none opacity-100"
450
618
  ),
451
619
  children: [
452
- /* @__PURE__ */ jsx5("span", { className: "min-w-0 truncate", children: resolveActivityLabel(item, labels) }),
453
- detailsAvailable && (open ? /* @__PURE__ */ jsx5(ChevronDown, { className: "h-3.5 w-3.5 shrink-0" }) : /* @__PURE__ */ jsx5(ChevronRight, { className: "h-3.5 w-3.5 shrink-0" }))
620
+ /* @__PURE__ */ jsx6("span", { className: "min-w-0 truncate", children: resolveActivityLabel(item, labels) }),
621
+ detailsAvailable && (open ? /* @__PURE__ */ jsx6(ChevronDown, { className: "h-3.5 w-3.5 shrink-0" }) : /* @__PURE__ */ jsx6(ChevronRight, { className: "h-3.5 w-3.5 shrink-0" }))
454
622
  ]
455
623
  }
456
624
  ),
457
- detailsAvailable && open && /* @__PURE__ */ jsx5(ActivityDetails, { item })
625
+ detailsAvailable && open && /* @__PURE__ */ jsx6(ActivityDetails, { item })
458
626
  ] })
459
627
  ] }, item.id);
460
628
  }) }) });
@@ -466,8 +634,8 @@ var AssistantActivity = memo(function AssistantActivity2({
466
634
  labels
467
635
  }) {
468
636
  if (!activity || activity.items.length === 0) return null;
469
- if (!showActivity) return hasActiveItem(activity) ? /* @__PURE__ */ jsx5(ActivitySkeleton, {}) : null;
470
- return /* @__PURE__ */ jsx5(
637
+ if (!showActivity) return hasActiveItem(activity) ? /* @__PURE__ */ jsx6(ActivitySkeleton, {}) : null;
638
+ return /* @__PURE__ */ jsx6(
471
639
  ActivityTimeline,
472
640
  {
473
641
  activity,
@@ -523,12 +691,12 @@ function assignAgentColors(agents) {
523
691
 
524
692
  // src/components/ui/avatar.tsx
525
693
  import * as AvatarPrimitive from "@radix-ui/react-avatar";
526
- import { jsx as jsx6 } from "react/jsx-runtime";
694
+ import { jsx as jsx7 } from "react/jsx-runtime";
527
695
  function Avatar({
528
696
  className,
529
697
  ...props
530
698
  }) {
531
- return /* @__PURE__ */ jsx6(
699
+ return /* @__PURE__ */ jsx7(
532
700
  AvatarPrimitive.Root,
533
701
  {
534
702
  "data-slot": "avatar",
@@ -544,7 +712,7 @@ function AvatarImage({
544
712
  className,
545
713
  ...props
546
714
  }) {
547
- return /* @__PURE__ */ jsx6(
715
+ return /* @__PURE__ */ jsx7(
548
716
  AvatarPrimitive.Image,
549
717
  {
550
718
  "data-slot": "avatar-image",
@@ -557,7 +725,7 @@ function AvatarFallback({
557
725
  className,
558
726
  ...props
559
727
  }) {
560
- return /* @__PURE__ */ jsx6(
728
+ return /* @__PURE__ */ jsx7(
561
729
  AvatarPrimitive.Fallback,
562
730
  {
563
731
  "data-slot": "avatar-fallback",
@@ -571,7 +739,7 @@ function AvatarFallback({
571
739
  }
572
740
 
573
741
  // src/components/chat/MessageSender.tsx
574
- import { Fragment, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
742
+ import { Fragment, jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
575
743
  var resolveMessageSenderDisplay = ({
576
744
  sender,
577
745
  fallbackName,
@@ -590,9 +758,9 @@ var resolveMessageSenderDisplay = ({
590
758
  return {
591
759
  name,
592
760
  color,
593
- avatar: /* @__PURE__ */ jsxs3(Fragment, { children: [
594
- sender?.avatarUrl || fallbackAvatarUrl ? /* @__PURE__ */ jsx7(AvatarImage, { src: sender?.avatarUrl || fallbackAvatarUrl, alt: name }) : null,
595
- shouldUseFallbackAvatar ? fallbackAvatar : /* @__PURE__ */ jsx7(
761
+ avatar: /* @__PURE__ */ jsxs4(Fragment, { children: [
762
+ sender?.avatarUrl || fallbackAvatarUrl ? /* @__PURE__ */ jsx8(AvatarImage, { src: sender?.avatarUrl || fallbackAvatarUrl, alt: name }) : null,
763
+ shouldUseFallbackAvatar ? fallbackAvatar : /* @__PURE__ */ jsx8(
596
764
  AvatarFallback,
597
765
  {
598
766
  className: fallbackClassName,
@@ -617,7 +785,7 @@ var MessageSenderAvatar = ({
617
785
  fallbackAvatarUrl,
618
786
  compactMode
619
787
  });
620
- return /* @__PURE__ */ jsx7(Avatar, { className: compactMode ? "h-6 w-6" : "h-8 w-8", children: display.avatar });
788
+ return /* @__PURE__ */ jsx8(Avatar, { className: compactMode ? "h-6 w-6" : "h-8 w-8", children: display.avatar });
621
789
  };
622
790
 
623
791
  // src/components/chat/Message.tsx
@@ -626,9 +794,16 @@ import {
626
794
  Edit,
627
795
  RotateCcw,
628
796
  Check,
629
- X
797
+ X,
798
+ Download,
799
+ File,
800
+ FileArchive,
801
+ FileAudio,
802
+ FileImage,
803
+ FileText,
804
+ FileVideo
630
805
  } from "lucide-react";
631
- import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
806
+ import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
632
807
  var hasRenderableAssistantBody = (message) => {
633
808
  if (message.role !== "assistant") return true;
634
809
  if (typeof message.content === "string" && message.content.trim().length > 0) return true;
@@ -639,7 +814,7 @@ var defaultMarkdownComponents = {
639
814
  code: ({ node, className, children, ...props }) => {
640
815
  const inline = props.inline;
641
816
  const match = /language-(\w+)/.exec(className || "");
642
- return !inline && match ? /* @__PURE__ */ jsx8("pre", { className: "relative", children: /* @__PURE__ */ jsx8("code", { className, ...props, children }) }) : /* @__PURE__ */ jsx8("code", { className: "bg-muted px-1 py-0.5 rounded text-sm", ...props, children });
817
+ return !inline && match ? /* @__PURE__ */ jsx9("pre", { className: "relative", children: /* @__PURE__ */ jsx9("code", { className, ...props, children }) }) : /* @__PURE__ */ jsx9("code", { className: "bg-muted px-1 py-0.5 rounded text-sm", ...props, children });
643
818
  }
644
819
  };
645
820
  var remarkPluginsDefault = [remarkGfm];
@@ -676,7 +851,7 @@ var getCollapsedPreview = (content, previewChars, previewOverride) => {
676
851
  return `${content.slice(0, previewChars).trimEnd()}...`;
677
852
  };
678
853
  var LongContentShell = memo2(function LongContentShell2({ children, className, style }) {
679
- return /* @__PURE__ */ jsx8("div", { className, style, children });
854
+ return /* @__PURE__ */ jsx9("div", { className, style, children });
680
855
  });
681
856
  var PlainTextContent = memo2(function PlainTextContent2({
682
857
  content,
@@ -685,12 +860,12 @@ var PlainTextContent = memo2(function PlainTextContent2({
685
860
  style
686
861
  }) {
687
862
  const chunks = useMemo(() => getPlainTextChunks(content, chunkSize), [content, chunkSize]);
688
- return /* @__PURE__ */ jsx8(
863
+ return /* @__PURE__ */ jsx9(
689
864
  LongContentShell,
690
865
  {
691
866
  className: `text-sm leading-6 whitespace-pre-wrap break-words ${className}`.trim(),
692
867
  style,
693
- children: chunks.map((chunk, index) => /* @__PURE__ */ jsx8(React2.Fragment, { children: chunk }, index))
868
+ children: chunks.map((chunk, index) => /* @__PURE__ */ jsx9(React3.Fragment, { children: chunk }, index))
694
869
  }
695
870
  );
696
871
  });
@@ -725,12 +900,12 @@ var StreamingText = memo2(function StreamingText2({
725
900
  ],
726
901
  [enableSyntaxHighlight, markdown?.rehypePlugins]
727
902
  );
728
- return /* @__PURE__ */ jsxs4(Fragment2, { children: [
729
- hasContent ? renderMarkdown ? /* @__PURE__ */ jsx8(
903
+ return /* @__PURE__ */ jsxs5(Fragment2, { children: [
904
+ hasContent ? renderMarkdown ? /* @__PURE__ */ jsx9(
730
905
  LongContentShell,
731
906
  {
732
907
  className: `prose prose-sm max-w-none dark:prose-invert break-words ${className}`.trim(),
733
- children: /* @__PURE__ */ jsx8(
908
+ children: /* @__PURE__ */ jsx9(
734
909
  ReactMarkdown,
735
910
  {
736
911
  remarkPlugins: mergedRemarkPlugins,
@@ -740,7 +915,7 @@ var StreamingText = memo2(function StreamingText2({
740
915
  }
741
916
  )
742
917
  }
743
- ) : /* @__PURE__ */ jsx8(
918
+ ) : /* @__PURE__ */ jsx9(
744
919
  PlainTextContent,
745
920
  {
746
921
  content,
@@ -748,12 +923,89 @@ var StreamingText = memo2(function StreamingText2({
748
923
  chunkSize: plainTextChunkChars
749
924
  }
750
925
  ) : null,
751
- isStreaming && hasContent && /* @__PURE__ */ jsx8("span", { className: "inline-block w-2 h-4 bg-primary animate-pulse ml-1" })
926
+ isStreaming && hasContent && /* @__PURE__ */ jsx9("span", { className: "inline-block w-2 h-4 bg-primary animate-pulse ml-1" })
752
927
  ] });
753
928
  });
929
+ var getAttachmentLabel = (attachment) => attachment.fileName || attachment.mimeType || "Attachment";
930
+ var getAttachmentIcon = (attachment) => {
931
+ if (attachment.kind === "image") return FileImage;
932
+ if (attachment.kind === "audio") return FileAudio;
933
+ if (attachment.kind === "video") return FileVideo;
934
+ const value = `${attachment.fileName || ""} ${attachment.mimeType || ""}`.toLowerCase();
935
+ if (value.includes("zip") || value.includes("gzip") || value.includes("tar") || value.includes("archive")) {
936
+ return FileArchive;
937
+ }
938
+ if (value.includes("json") || value.includes("text") || value.includes("markdown") || value.includes("csv")) {
939
+ return FileText;
940
+ }
941
+ return File;
942
+ };
943
+ var AttachmentDownloadButton = ({ attachment }) => /* @__PURE__ */ jsx9(Button, { asChild: true, size: "sm", children: /* @__PURE__ */ jsxs5("a", { href: attachment.dataUrl, download: attachment.fileName || "attachment", children: [
944
+ /* @__PURE__ */ jsx9(Download, { className: "h-4 w-4" }),
945
+ "Download"
946
+ ] }) });
947
+ var AttachmentMetadata = ({ attachment }) => /* @__PURE__ */ jsxs5("dl", { className: "grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-2 text-sm", children: [
948
+ /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground", children: "Type" }),
949
+ /* @__PURE__ */ jsx9("dd", { className: "min-w-0 truncate", children: attachment.mimeType || "application/octet-stream" }),
950
+ attachment.fileName && /* @__PURE__ */ jsxs5(Fragment2, { children: [
951
+ /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground", children: "Name" }),
952
+ /* @__PURE__ */ jsx9("dd", { className: "min-w-0 truncate", children: attachment.fileName })
953
+ ] }),
954
+ typeof attachment.size === "number" && /* @__PURE__ */ jsxs5(Fragment2, { children: [
955
+ /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground", children: "Size" }),
956
+ /* @__PURE__ */ jsx9("dd", { children: formatFileSize(attachment.size) })
957
+ ] })
958
+ ] });
959
+ var FileAttachmentCard = ({ attachment, compact = false }) => {
960
+ const Icon = getAttachmentIcon(attachment);
961
+ const size = formatFileSize(attachment.size);
962
+ return /* @__PURE__ */ jsxs5("div", { className: `flex w-full min-w-0 max-w-md items-center gap-3 rounded-lg border bg-muted/20 text-left ${compact ? "p-2" : "p-3"}`, children: [
963
+ /* @__PURE__ */ jsx9("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-muted", children: /* @__PURE__ */ jsx9(Icon, { className: "h-5 w-5 text-foreground" }) }),
964
+ /* @__PURE__ */ jsxs5("div", { className: "min-w-0 flex-1", children: [
965
+ /* @__PURE__ */ jsx9("p", { className: "truncate text-sm font-medium", children: getAttachmentLabel(attachment) }),
966
+ /* @__PURE__ */ jsx9("p", { className: "truncate text-xs text-muted-foreground", children: [attachment.mimeType || "File", size].filter(Boolean).join(" \xB7 ") })
967
+ ] })
968
+ ] });
969
+ };
970
+ var AttachmentDialog = ({ attachment, children }) => {
971
+ const label = getAttachmentLabel(attachment);
972
+ const Icon = getAttachmentIcon(attachment);
973
+ return /* @__PURE__ */ jsxs5(Dialog, { children: [
974
+ /* @__PURE__ */ jsx9(DialogTrigger, { asChild: true, children }),
975
+ /* @__PURE__ */ jsxs5(DialogContent, { className: "w-[min(calc(100vw-2rem),48rem)] max-w-[calc(100vw-2rem)] overflow-hidden", children: [
976
+ /* @__PURE__ */ jsxs5(DialogHeader, { className: "min-w-0 pr-8", children: [
977
+ /* @__PURE__ */ jsx9(DialogTitle, { className: "min-w-0 truncate", children: label }),
978
+ /* @__PURE__ */ jsx9(DialogDescription, { className: "min-w-0 truncate", children: "Attachment details and download options." })
979
+ ] }),
980
+ /* @__PURE__ */ jsxs5("div", { className: "min-w-0 max-w-full space-y-4 overflow-hidden", children: [
981
+ attachment.kind === "image" ? /* @__PURE__ */ jsx9("div", { className: "max-h-[65vh] min-w-0 overflow-auto rounded-lg border bg-muted/20", children: /* @__PURE__ */ jsx9(
982
+ "img",
983
+ {
984
+ src: attachment.dataUrl,
985
+ alt: label,
986
+ className: "mx-auto h-auto max-h-[65vh] w-auto max-w-full object-contain"
987
+ }
988
+ ) }) : attachment.kind === "video" ? /* @__PURE__ */ jsx9("div", { className: "min-w-0 rounded-lg border bg-muted/20", children: /* @__PURE__ */ jsx9(
989
+ "video",
990
+ {
991
+ src: attachment.dataUrl,
992
+ poster: attachment.poster,
993
+ controls: true,
994
+ className: "max-h-[65vh] w-full rounded-lg"
995
+ }
996
+ ) }) : attachment.kind === "audio" ? /* @__PURE__ */ jsx9("audio", { className: "w-full", preload: "metadata", controls: true, children: /* @__PURE__ */ jsx9("source", { src: attachment.dataUrl, type: attachment.mimeType }) }) : /* @__PURE__ */ jsxs5("div", { className: "flex min-w-0 flex-col items-center gap-3 rounded-lg border bg-muted/20 p-8 text-center", children: [
997
+ /* @__PURE__ */ jsx9("div", { className: "flex h-16 w-16 items-center justify-center rounded-lg bg-muted", children: /* @__PURE__ */ jsx9(Icon, { className: "h-8 w-8 text-foreground" }) }),
998
+ /* @__PURE__ */ jsx9("p", { className: "w-full min-w-0 truncate text-sm font-medium", children: label })
999
+ ] }),
1000
+ /* @__PURE__ */ jsx9(AttachmentMetadata, { attachment })
1001
+ ] }),
1002
+ /* @__PURE__ */ jsx9(DialogFooter, { className: "min-w-0", children: /* @__PURE__ */ jsx9(AttachmentDownloadButton, { attachment }) })
1003
+ ] })
1004
+ ] });
1005
+ };
754
1006
  var MediaRenderer = memo2(function MediaRenderer2({ attachment }) {
755
1007
  const [audioPlaybackSrc, setAudioPlaybackSrc] = useState2(attachment.dataUrl);
756
- useEffect(() => {
1008
+ useEffect2(() => {
757
1009
  if (attachment.kind !== "audio" || !attachment.dataUrl.startsWith("data:")) {
758
1010
  setAudioPlaybackSrc(attachment.dataUrl);
759
1011
  return;
@@ -776,41 +1028,48 @@ var MediaRenderer = memo2(function MediaRenderer2({ attachment }) {
776
1028
  };
777
1029
  switch (attachment.kind) {
778
1030
  case "image":
779
- return /* @__PURE__ */ jsxs4("div", { className: "relative rounded-lg overflow-hidden border bg-muted/20 max-w-md", children: [
780
- /* @__PURE__ */ jsx8(
1031
+ return /* @__PURE__ */ jsx9(AttachmentDialog, { attachment, children: /* @__PURE__ */ jsx9("button", { type: "button", className: "block max-w-md text-left", children: /* @__PURE__ */ jsxs5("div", { className: "relative overflow-hidden rounded-lg border bg-muted/20", children: [
1032
+ /* @__PURE__ */ jsx9(
781
1033
  "img",
782
1034
  {
783
1035
  src: attachment.dataUrl,
784
1036
  alt: attachment.fileName || "Attachment",
785
- className: "w-full h-auto object-cover",
1037
+ className: "h-auto w-full object-cover",
786
1038
  loading: "lazy"
787
1039
  }
788
1040
  ),
789
- attachment.fileName && /* @__PURE__ */ jsx8("div", { className: "absolute bottom-0 left-0 right-0 bg-black/50 text-white text-xs p-2", children: attachment.fileName })
790
- ] });
1041
+ attachment.fileName && /* @__PURE__ */ jsx9("div", { className: "absolute bottom-0 left-0 right-0 bg-black/50 p-2 text-xs text-white", children: attachment.fileName })
1042
+ ] }) }) });
791
1043
  case "audio":
792
- return /* @__PURE__ */ jsx8("div", { className: "flex w-full max-w-md py-0 min-w-64 items-center gap-3", children: /* @__PURE__ */ jsx8(
793
- "audio",
794
- {
795
- className: "w-full mt-2",
796
- preload: "metadata",
797
- controls: true,
798
- children: /* @__PURE__ */ jsx8("source", { src: audioPlaybackSrc, type: attachment.mimeType })
799
- }
800
- ) });
1044
+ return /* @__PURE__ */ jsxs5("div", { className: "flex w-full max-w-md min-w-64 items-center gap-2 py-0", children: [
1045
+ /* @__PURE__ */ jsx9(
1046
+ "audio",
1047
+ {
1048
+ className: "mt-2 w-full",
1049
+ preload: "metadata",
1050
+ controls: true,
1051
+ children: /* @__PURE__ */ jsx9("source", { src: audioPlaybackSrc, type: attachment.mimeType })
1052
+ }
1053
+ ),
1054
+ /* @__PURE__ */ jsx9(AttachmentDialog, { attachment, children: /* @__PURE__ */ jsx9(Button, { type: "button", variant: "outline", size: "icon", className: "mt-2 shrink-0", children: /* @__PURE__ */ jsx9(FileAudio, { className: "h-4 w-4" }) }) })
1055
+ ] });
801
1056
  case "video":
802
- return /* @__PURE__ */ jsxs4("div", { className: "relative rounded-lg overflow-hidden border bg-muted/20 max-w-lg", children: [
803
- /* @__PURE__ */ jsx8(
1057
+ return /* @__PURE__ */ jsx9(AttachmentDialog, { attachment, children: /* @__PURE__ */ jsx9("button", { type: "button", className: "block max-w-lg text-left", children: /* @__PURE__ */ jsxs5("div", { className: "relative overflow-hidden rounded-lg border bg-muted/20", children: [
1058
+ /* @__PURE__ */ jsx9(
804
1059
  "video",
805
1060
  {
806
1061
  src: attachment.dataUrl,
807
1062
  poster: attachment.poster,
808
- controls: true,
809
- className: "w-full h-auto"
1063
+ className: "h-auto w-full",
1064
+ muted: true,
1065
+ preload: "metadata"
810
1066
  }
811
1067
  ),
812
- attachment.fileName && /* @__PURE__ */ jsx8("div", { className: "absolute bottom-0 left-0 right-0 bg-black/50 text-white text-xs p-2", children: attachment.fileName })
813
- ] });
1068
+ /* @__PURE__ */ jsx9("div", { className: "absolute inset-0 flex items-center justify-center bg-black/10", children: /* @__PURE__ */ jsx9(FileVideo, { className: "h-8 w-8 rounded-full bg-black/50 p-1.5 text-white" }) }),
1069
+ attachment.fileName && /* @__PURE__ */ jsx9("div", { className: "absolute bottom-0 left-0 right-0 bg-black/50 p-2 text-xs text-white", children: attachment.fileName })
1070
+ ] }) }) });
1071
+ case "file":
1072
+ return /* @__PURE__ */ jsx9(AttachmentDialog, { attachment, children: /* @__PURE__ */ jsx9("button", { type: "button", className: "block w-full max-w-md text-left", children: /* @__PURE__ */ jsx9(FileAttachmentCard, { attachment }) }) });
814
1073
  default:
815
1074
  return null;
816
1075
  }
@@ -935,15 +1194,15 @@ var Message = memo2(({
935
1194
  minute: "2-digit"
936
1195
  });
937
1196
  };
938
- return /* @__PURE__ */ jsxs4(
1197
+ return /* @__PURE__ */ jsxs5(
939
1198
  "div",
940
1199
  {
941
1200
  className: `flex w-full flex-col ${className} max-w-[800px] mx-auto`,
942
1201
  onMouseEnter: () => setShowActions(true),
943
1202
  onMouseLeave: () => setShowActions(false),
944
1203
  children: [
945
- /* @__PURE__ */ jsxs4("div", { className: `flex gap-3 ${messageIsUser ? "flex-row-reverse" : "flex-row"} w-full mb-1`, children: [
946
- showAvatar && /* @__PURE__ */ jsx8("div", { className: `flex-shrink-0 ${compactMode ? "mt-1" : "mt-0"}`, children: /* @__PURE__ */ jsx8(
1204
+ /* @__PURE__ */ jsxs5("div", { className: `flex gap-3 ${messageIsUser ? "flex-row-reverse" : "flex-row"} w-full mb-1`, children: [
1205
+ showAvatar && /* @__PURE__ */ jsx9("div", { className: `flex-shrink-0 ${compactMode ? "mt-1" : "mt-0"}`, children: /* @__PURE__ */ jsx9(
947
1206
  MessageSenderAvatar,
948
1207
  {
949
1208
  sender: message.sender,
@@ -953,8 +1212,8 @@ var Message = memo2(({
953
1212
  compactMode
954
1213
  }
955
1214
  ) }),
956
- /* @__PURE__ */ jsxs4("div", { className: `flex items-center gap-2 mb-1 ${messageIsUser ? "flex-row-reverse" : "flex-row"}`, children: [
957
- /* @__PURE__ */ jsx8(
1215
+ /* @__PURE__ */ jsxs5("div", { className: `flex items-center gap-2 mb-1 ${messageIsUser ? "flex-row-reverse" : "flex-row"}`, children: [
1216
+ /* @__PURE__ */ jsx9(
958
1217
  "span",
959
1218
  {
960
1219
  className: `font-medium ${compactMode ? "text-sm" : "text-base"}`,
@@ -962,13 +1221,13 @@ var Message = memo2(({
962
1221
  children: senderDisplay.name
963
1222
  }
964
1223
  ),
965
- showTimestamp && /* @__PURE__ */ jsx8("span", { className: "text-xs text-muted-foreground", children: formatTime(message.timestamp) }),
966
- message.isEdited && /* @__PURE__ */ jsx8(Badge, { variant: "outline", className: "text-xs", children: "editado" })
1224
+ showTimestamp && /* @__PURE__ */ jsx9("span", { className: "text-xs text-muted-foreground", children: formatTime(message.timestamp) }),
1225
+ message.isEdited && /* @__PURE__ */ jsx9(Badge, { variant: "outline", className: "text-xs", children: "editado" })
967
1226
  ] })
968
1227
  ] }),
969
- /* @__PURE__ */ jsx8("div", { className: `flex-1 min-w-0 ${messageIsUser ? "text-right" : "text-left"} ${horizontalOffsetClass}`, children: /* @__PURE__ */ jsxs4("div", { className: `relative overflow-hidden text-left ${messageIsUser ? "ml-auto inline-flex max-w-[85%] flex-col rounded-lg bg-primary p-3 text-primary-foreground" : "flex w-full max-w-full flex-col"}`, children: [
970
- isEditing ? /* @__PURE__ */ jsxs4("div", { className: "space-y-2", children: [
971
- /* @__PURE__ */ jsx8(
1228
+ /* @__PURE__ */ jsx9("div", { className: `flex-1 min-w-0 ${messageIsUser ? "text-right" : "text-left"} ${horizontalOffsetClass}`, children: /* @__PURE__ */ jsxs5("div", { className: `relative overflow-hidden text-left ${messageIsUser ? "ml-auto inline-flex max-w-[85%] flex-col rounded-lg bg-primary p-3 text-primary-foreground" : "flex w-full max-w-full flex-col"}`, children: [
1229
+ isEditing ? /* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
1230
+ /* @__PURE__ */ jsx9(
972
1231
  Textarea,
973
1232
  {
974
1233
  value: editContent,
@@ -977,18 +1236,18 @@ var Message = memo2(({
977
1236
  autoFocus: true
978
1237
  }
979
1238
  ),
980
- /* @__PURE__ */ jsxs4("div", { className: "flex gap-2 justify-end", children: [
981
- /* @__PURE__ */ jsxs4(Button, { variant: "outline", size: "sm", onClick: handleCancelEdit, children: [
982
- /* @__PURE__ */ jsx8(X, { className: "h-4 w-4 mr-1" }),
1239
+ /* @__PURE__ */ jsxs5("div", { className: "flex gap-2 justify-end", children: [
1240
+ /* @__PURE__ */ jsxs5(Button, { variant: "outline", size: "sm", onClick: handleCancelEdit, children: [
1241
+ /* @__PURE__ */ jsx9(X, { className: "h-4 w-4 mr-1" }),
983
1242
  "Cancelar"
984
1243
  ] }),
985
- /* @__PURE__ */ jsxs4(Button, { size: "sm", onClick: handleEdit, children: [
986
- /* @__PURE__ */ jsx8(Check, { className: "h-4 w-4 mr-1" }),
1244
+ /* @__PURE__ */ jsxs5(Button, { size: "sm", onClick: handleEdit, children: [
1245
+ /* @__PURE__ */ jsx9(Check, { className: "h-4 w-4 mr-1" }),
987
1246
  "Salvar"
988
1247
  ] })
989
1248
  ] })
990
- ] }) : /* @__PURE__ */ jsxs4(Fragment2, { children: [
991
- !messageIsUser && /* @__PURE__ */ jsx8(
1249
+ ] }) : /* @__PURE__ */ jsxs5(Fragment2, { children: [
1250
+ !messageIsUser && /* @__PURE__ */ jsx9(
992
1251
  AssistantActivity,
993
1252
  {
994
1253
  activity: message.activity,
@@ -997,7 +1256,7 @@ var Message = memo2(({
997
1256
  labels
998
1257
  }
999
1258
  ),
1000
- /* @__PURE__ */ jsx8(
1259
+ /* @__PURE__ */ jsx9(
1001
1260
  StreamingText,
1002
1261
  {
1003
1262
  content: contentToRender,
@@ -1007,7 +1266,7 @@ var Message = memo2(({
1007
1266
  plainTextChunkChars: normalizedChunkChars
1008
1267
  }
1009
1268
  ),
1010
- canCollapseMessage && /* @__PURE__ */ jsx8("div", { className: "mt-3", children: /* @__PURE__ */ jsx8(
1269
+ canCollapseMessage && /* @__PURE__ */ jsx9("div", { className: "mt-3", children: /* @__PURE__ */ jsx9(
1011
1270
  Button,
1012
1271
  {
1013
1272
  type: "button",
@@ -1019,47 +1278,47 @@ var Message = memo2(({
1019
1278
  children: isCollapsed ? showMoreLabel : showLessLabel
1020
1279
  }
1021
1280
  ) }),
1022
- message.attachments && message.attachments.length > 0 && /* @__PURE__ */ jsx8("div", { className: "mt-3 space-y-2", children: message.attachments.map((attachment, index) => /* @__PURE__ */ jsx8(MediaRenderer, { attachment }, index)) })
1281
+ message.attachments && message.attachments.length > 0 && /* @__PURE__ */ jsx9("div", { className: "mt-3 space-y-2", children: message.attachments.map((attachment, index) => /* @__PURE__ */ jsx9(MediaRenderer, { attachment }, index)) })
1023
1282
  ] }),
1024
- !isEditing && (showActions || copied) && /* @__PURE__ */ jsxs4("div", { className: `absolute -top-2 flex gap-1 ${messageIsUser ? "-left-2" : "-right-2"}`, children: [
1025
- enableCopy && /* @__PURE__ */ jsxs4(Tooltip, { children: [
1026
- /* @__PURE__ */ jsx8(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx8(
1283
+ !isEditing && (showActions || copied) && /* @__PURE__ */ jsxs5("div", { className: `absolute -top-2 flex gap-1 ${messageIsUser ? "-left-2" : "-right-2"}`, children: [
1284
+ enableCopy && /* @__PURE__ */ jsxs5(Tooltip, { children: [
1285
+ /* @__PURE__ */ jsx9(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx9(
1027
1286
  Button,
1028
1287
  {
1029
1288
  variant: "secondary",
1030
1289
  size: "icon",
1031
1290
  className: "h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",
1032
1291
  onClick: handleCopy,
1033
- children: copied ? /* @__PURE__ */ jsx8(Check, { className: "h-3 w-3 text-green-500" }) : /* @__PURE__ */ jsx8(Copy, { className: "h-3 w-3" })
1292
+ children: copied ? /* @__PURE__ */ jsx9(Check, { className: "h-3 w-3 text-green-500" }) : /* @__PURE__ */ jsx9(Copy, { className: "h-3 w-3" })
1034
1293
  }
1035
1294
  ) }),
1036
- /* @__PURE__ */ jsx8(TooltipContent, { children: copied ? "Copiado!" : "Copiar" })
1295
+ /* @__PURE__ */ jsx9(TooltipContent, { children: copied ? "Copiado!" : "Copiar" })
1037
1296
  ] }),
1038
- canEdit && /* @__PURE__ */ jsxs4(Tooltip, { children: [
1039
- /* @__PURE__ */ jsx8(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx8(
1297
+ canEdit && /* @__PURE__ */ jsxs5(Tooltip, { children: [
1298
+ /* @__PURE__ */ jsx9(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx9(
1040
1299
  Button,
1041
1300
  {
1042
1301
  variant: "secondary",
1043
1302
  size: "icon",
1044
1303
  className: "h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",
1045
1304
  onClick: handleEdit,
1046
- children: /* @__PURE__ */ jsx8(Edit, { className: "h-3 w-3" })
1305
+ children: /* @__PURE__ */ jsx9(Edit, { className: "h-3 w-3" })
1047
1306
  }
1048
1307
  ) }),
1049
- /* @__PURE__ */ jsx8(TooltipContent, { children: "Editar" })
1308
+ /* @__PURE__ */ jsx9(TooltipContent, { children: "Editar" })
1050
1309
  ] }),
1051
- canRegenerate && /* @__PURE__ */ jsxs4(Tooltip, { children: [
1052
- /* @__PURE__ */ jsx8(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx8(
1310
+ canRegenerate && /* @__PURE__ */ jsxs5(Tooltip, { children: [
1311
+ /* @__PURE__ */ jsx9(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx9(
1053
1312
  Button,
1054
1313
  {
1055
1314
  variant: "secondary",
1056
1315
  size: "icon",
1057
1316
  className: "h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",
1058
1317
  onClick: handleRegenerate,
1059
- children: /* @__PURE__ */ jsx8(RotateCcw, { className: "h-3 w-3" })
1318
+ children: /* @__PURE__ */ jsx9(RotateCcw, { className: "h-3 w-3" })
1060
1319
  }
1061
1320
  ) }),
1062
- /* @__PURE__ */ jsx8(TooltipContent, { children: "Regenerar" })
1321
+ /* @__PURE__ */ jsx9(TooltipContent, { children: "Regenerar" })
1063
1322
  ] })
1064
1323
  ] })
1065
1324
  ] }) })
@@ -1072,9 +1331,9 @@ var Message = memo2(({
1072
1331
  import { useEffect as useEffect7, useRef as useRef4, useState as useState5 } from "react";
1073
1332
 
1074
1333
  // src/components/ui/input.tsx
1075
- import { jsx as jsx9 } from "react/jsx-runtime";
1334
+ import { jsx as jsx10 } from "react/jsx-runtime";
1076
1335
  function Input({ className, type, ...props }) {
1077
- return /* @__PURE__ */ jsx9(
1336
+ return /* @__PURE__ */ jsx10(
1078
1337
  "input",
1079
1338
  {
1080
1339
  type,
@@ -1091,17 +1350,17 @@ function Input({ className, type, ...props }) {
1091
1350
  }
1092
1351
 
1093
1352
  // src/components/ui/sidebar.tsx
1094
- import * as React5 from "react";
1353
+ import * as React6 from "react";
1095
1354
  import { Slot as Slot3 } from "@radix-ui/react-slot";
1096
1355
  import { cva as cva3 } from "class-variance-authority";
1097
1356
  import { PanelLeftIcon } from "lucide-react";
1098
1357
 
1099
1358
  // src/hooks/use-mobile.ts
1100
- import * as React3 from "react";
1359
+ import * as React4 from "react";
1101
1360
  var MOBILE_BREAKPOINT = 768;
1102
1361
  function useIsMobile() {
1103
- const [isMobile, setIsMobile] = React3.useState(void 0);
1104
- React3.useEffect(() => {
1362
+ const [isMobile, setIsMobile] = React4.useState(void 0);
1363
+ React4.useEffect(() => {
1105
1364
  const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
1106
1365
  const onChange = () => {
1107
1366
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
@@ -1115,14 +1374,14 @@ function useIsMobile() {
1115
1374
 
1116
1375
  // src/components/ui/separator.tsx
1117
1376
  import * as SeparatorPrimitive from "@radix-ui/react-separator";
1118
- import { jsx as jsx10 } from "react/jsx-runtime";
1377
+ import { jsx as jsx11 } from "react/jsx-runtime";
1119
1378
  function Separator({
1120
1379
  className,
1121
1380
  orientation = "horizontal",
1122
1381
  decorative = true,
1123
1382
  ...props
1124
1383
  }) {
1125
- return /* @__PURE__ */ jsx10(
1384
+ return /* @__PURE__ */ jsx11(
1126
1385
  SeparatorPrimitive.Root,
1127
1386
  {
1128
1387
  "data-slot": "separator",
@@ -1138,41 +1397,41 @@ function Separator({
1138
1397
  }
1139
1398
 
1140
1399
  // src/components/ui/sheet.tsx
1141
- import * as React4 from "react";
1400
+ import * as React5 from "react";
1142
1401
  import * as SheetPrimitive from "@radix-ui/react-dialog";
1143
- import { XIcon } from "lucide-react";
1144
- import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
1145
- function cleanupBodyStyles() {
1402
+ import { XIcon as XIcon2 } from "lucide-react";
1403
+ import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
1404
+ function cleanupBodyStyles2() {
1146
1405
  if (typeof document !== "undefined" && document.body.style.pointerEvents === "none") {
1147
1406
  document.body.style.pointerEvents = "";
1148
1407
  }
1149
1408
  }
1150
1409
  function Sheet({ open, onOpenChange, ...props }) {
1151
- const prevOpenRef = React4.useRef(open);
1152
- React4.useEffect(() => {
1410
+ const prevOpenRef = React5.useRef(open);
1411
+ React5.useEffect(() => {
1153
1412
  if (prevOpenRef.current === true && open === false) {
1154
- const timeout = setTimeout(cleanupBodyStyles, 350);
1413
+ const timeout = setTimeout(cleanupBodyStyles2, 350);
1155
1414
  return () => clearTimeout(timeout);
1156
1415
  }
1157
1416
  prevOpenRef.current = open;
1158
1417
  }, [open]);
1159
- React4.useEffect(() => {
1418
+ React5.useEffect(() => {
1160
1419
  return () => {
1161
- cleanupBodyStyles();
1420
+ cleanupBodyStyles2();
1162
1421
  };
1163
1422
  }, []);
1164
- return /* @__PURE__ */ jsx11(SheetPrimitive.Root, { "data-slot": "sheet", open, onOpenChange, ...props });
1423
+ return /* @__PURE__ */ jsx12(SheetPrimitive.Root, { "data-slot": "sheet", open, onOpenChange, ...props });
1165
1424
  }
1166
1425
  function SheetPortal({
1167
1426
  ...props
1168
1427
  }) {
1169
- return /* @__PURE__ */ jsx11(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
1428
+ return /* @__PURE__ */ jsx12(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
1170
1429
  }
1171
1430
  function SheetOverlay({
1172
1431
  className,
1173
1432
  ...props
1174
1433
  }) {
1175
- return /* @__PURE__ */ jsx11(
1434
+ return /* @__PURE__ */ jsx12(
1176
1435
  SheetPrimitive.Overlay,
1177
1436
  {
1178
1437
  "data-slot": "sheet-overlay",
@@ -1193,9 +1452,9 @@ function SheetContent({
1193
1452
  side = "right",
1194
1453
  ...props
1195
1454
  }) {
1196
- return /* @__PURE__ */ jsxs5(SheetPortal, { children: [
1197
- /* @__PURE__ */ jsx11(SheetOverlay, {}),
1198
- /* @__PURE__ */ jsxs5(
1455
+ return /* @__PURE__ */ jsxs6(SheetPortal, { children: [
1456
+ /* @__PURE__ */ jsx12(SheetOverlay, {}),
1457
+ /* @__PURE__ */ jsxs6(
1199
1458
  SheetPrimitive.Content,
1200
1459
  {
1201
1460
  "data-slot": "sheet-content",
@@ -1211,9 +1470,9 @@ function SheetContent({
1211
1470
  ...props,
1212
1471
  children: [
1213
1472
  children,
1214
- /* @__PURE__ */ jsxs5(SheetPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
1215
- /* @__PURE__ */ jsx11(XIcon, { className: "size-4" }),
1216
- /* @__PURE__ */ jsx11("span", { className: "sr-only", children: "Close" })
1473
+ /* @__PURE__ */ jsxs6(SheetPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
1474
+ /* @__PURE__ */ jsx12(XIcon2, { className: "size-4" }),
1475
+ /* @__PURE__ */ jsx12("span", { className: "sr-only", children: "Close" })
1217
1476
  ] })
1218
1477
  ]
1219
1478
  }
@@ -1221,7 +1480,7 @@ function SheetContent({
1221
1480
  ] });
1222
1481
  }
1223
1482
  function SheetHeader({ className, ...props }) {
1224
- return /* @__PURE__ */ jsx11(
1483
+ return /* @__PURE__ */ jsx12(
1225
1484
  "div",
1226
1485
  {
1227
1486
  "data-slot": "sheet-header",
@@ -1234,7 +1493,7 @@ function SheetTitle({
1234
1493
  className,
1235
1494
  ...props
1236
1495
  }) {
1237
- return /* @__PURE__ */ jsx11(
1496
+ return /* @__PURE__ */ jsx12(
1238
1497
  SheetPrimitive.Title,
1239
1498
  {
1240
1499
  "data-slot": "sheet-title",
@@ -1247,7 +1506,7 @@ function SheetDescription({
1247
1506
  className,
1248
1507
  ...props
1249
1508
  }) {
1250
- return /* @__PURE__ */ jsx11(
1509
+ return /* @__PURE__ */ jsx12(
1251
1510
  SheetPrimitive.Description,
1252
1511
  {
1253
1512
  "data-slot": "sheet-description",
@@ -1258,9 +1517,9 @@ function SheetDescription({
1258
1517
  }
1259
1518
 
1260
1519
  // src/components/ui/skeleton.tsx
1261
- import { jsx as jsx12 } from "react/jsx-runtime";
1520
+ import { jsx as jsx13 } from "react/jsx-runtime";
1262
1521
  function Skeleton({ className, ...props }) {
1263
- return /* @__PURE__ */ jsx12(
1522
+ return /* @__PURE__ */ jsx13(
1264
1523
  "div",
1265
1524
  {
1266
1525
  "data-slot": "skeleton",
@@ -1271,16 +1530,16 @@ function Skeleton({ className, ...props }) {
1271
1530
  }
1272
1531
 
1273
1532
  // src/components/ui/sidebar.tsx
1274
- import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
1533
+ import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
1275
1534
  var SIDEBAR_COOKIE_NAME = "sidebar_state";
1276
1535
  var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
1277
1536
  var SIDEBAR_WIDTH = "16rem";
1278
1537
  var SIDEBAR_WIDTH_MOBILE = "18rem";
1279
1538
  var SIDEBAR_WIDTH_ICON = "3rem";
1280
1539
  var SIDEBAR_KEYBOARD_SHORTCUT = "b";
1281
- var SidebarContext = React5.createContext(null);
1540
+ var SidebarContext = React6.createContext(null);
1282
1541
  function useSidebar() {
1283
- const context = React5.useContext(SidebarContext);
1542
+ const context = React6.useContext(SidebarContext);
1284
1543
  if (!context) {
1285
1544
  throw new Error("useSidebar must be used within a SidebarProvider.");
1286
1545
  }
@@ -1296,10 +1555,10 @@ function SidebarProvider({
1296
1555
  ...props
1297
1556
  }) {
1298
1557
  const isMobile = useIsMobile();
1299
- const [openMobile, setOpenMobile] = React5.useState(false);
1300
- const [_open, _setOpen] = React5.useState(defaultOpen);
1558
+ const [openMobile, setOpenMobile] = React6.useState(false);
1559
+ const [_open, _setOpen] = React6.useState(defaultOpen);
1301
1560
  const open = openProp ?? _open;
1302
- const setOpen = React5.useCallback(
1561
+ const setOpen = React6.useCallback(
1303
1562
  (value) => {
1304
1563
  const openState = typeof value === "function" ? value(open) : value;
1305
1564
  if (setOpenProp) {
@@ -1311,10 +1570,10 @@ function SidebarProvider({
1311
1570
  },
1312
1571
  [setOpenProp, open]
1313
1572
  );
1314
- const toggleSidebar = React5.useCallback(() => {
1573
+ const toggleSidebar = React6.useCallback(() => {
1315
1574
  return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
1316
1575
  }, [isMobile, setOpen, setOpenMobile]);
1317
- React5.useEffect(() => {
1576
+ React6.useEffect(() => {
1318
1577
  const handleKeyDown = (event) => {
1319
1578
  if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
1320
1579
  event.preventDefault();
@@ -1325,7 +1584,7 @@ function SidebarProvider({
1325
1584
  return () => window.removeEventListener("keydown", handleKeyDown);
1326
1585
  }, [toggleSidebar]);
1327
1586
  const state = open ? "expanded" : "collapsed";
1328
- const contextValue = React5.useMemo(
1587
+ const contextValue = React6.useMemo(
1329
1588
  () => ({
1330
1589
  state,
1331
1590
  open,
@@ -1337,7 +1596,7 @@ function SidebarProvider({
1337
1596
  }),
1338
1597
  [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
1339
1598
  );
1340
- return /* @__PURE__ */ jsx13(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx13(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx13(
1599
+ return /* @__PURE__ */ jsx14(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx14(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx14(
1341
1600
  "div",
1342
1601
  {
1343
1602
  "data-slot": "sidebar-wrapper",
@@ -1365,7 +1624,7 @@ function Sidebar({
1365
1624
  }) {
1366
1625
  const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
1367
1626
  if (collapsible === "none") {
1368
- return /* @__PURE__ */ jsx13(
1627
+ return /* @__PURE__ */ jsx14(
1369
1628
  "div",
1370
1629
  {
1371
1630
  "data-slot": "sidebar",
@@ -1379,7 +1638,7 @@ function Sidebar({
1379
1638
  );
1380
1639
  }
1381
1640
  if (isMobile) {
1382
- return /* @__PURE__ */ jsx13(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs6(
1641
+ return /* @__PURE__ */ jsx14(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs7(
1383
1642
  SheetContent,
1384
1643
  {
1385
1644
  "data-sidebar": "sidebar",
@@ -1391,16 +1650,16 @@ function Sidebar({
1391
1650
  },
1392
1651
  side,
1393
1652
  children: [
1394
- /* @__PURE__ */ jsxs6(SheetHeader, { className: "sr-only", children: [
1395
- /* @__PURE__ */ jsx13(SheetTitle, { children: "Sidebar" }),
1396
- /* @__PURE__ */ jsx13(SheetDescription, { children: "Displays the mobile sidebar." })
1653
+ /* @__PURE__ */ jsxs7(SheetHeader, { className: "sr-only", children: [
1654
+ /* @__PURE__ */ jsx14(SheetTitle, { children: "Sidebar" }),
1655
+ /* @__PURE__ */ jsx14(SheetDescription, { children: "Displays the mobile sidebar." })
1397
1656
  ] }),
1398
- /* @__PURE__ */ jsx13("div", { className: "flex h-full w-full flex-col", children })
1657
+ /* @__PURE__ */ jsx14("div", { className: "flex h-full w-full flex-col", children })
1399
1658
  ]
1400
1659
  }
1401
1660
  ) });
1402
1661
  }
1403
- return /* @__PURE__ */ jsxs6(
1662
+ return /* @__PURE__ */ jsxs7(
1404
1663
  "div",
1405
1664
  {
1406
1665
  className: "group peer text-sidebar-foreground hidden md:block",
@@ -1410,7 +1669,7 @@ function Sidebar({
1410
1669
  "data-side": side,
1411
1670
  "data-slot": "sidebar",
1412
1671
  children: [
1413
- /* @__PURE__ */ jsx13(
1672
+ /* @__PURE__ */ jsx14(
1414
1673
  "div",
1415
1674
  {
1416
1675
  "data-slot": "sidebar-gap",
@@ -1422,7 +1681,7 @@ function Sidebar({
1422
1681
  )
1423
1682
  }
1424
1683
  ),
1425
- /* @__PURE__ */ jsx13(
1684
+ /* @__PURE__ */ jsx14(
1426
1685
  "div",
1427
1686
  {
1428
1687
  "data-slot": "sidebar-container",
@@ -1434,7 +1693,7 @@ function Sidebar({
1434
1693
  className
1435
1694
  ),
1436
1695
  ...props,
1437
- children: /* @__PURE__ */ jsx13(
1696
+ children: /* @__PURE__ */ jsx14(
1438
1697
  "div",
1439
1698
  {
1440
1699
  "data-sidebar": "sidebar",
@@ -1455,7 +1714,7 @@ function SidebarTrigger({
1455
1714
  ...props
1456
1715
  }) {
1457
1716
  const { toggleSidebar } = useSidebar();
1458
- return /* @__PURE__ */ jsxs6(
1717
+ return /* @__PURE__ */ jsxs7(
1459
1718
  Button,
1460
1719
  {
1461
1720
  "data-sidebar": "trigger",
@@ -1469,15 +1728,15 @@ function SidebarTrigger({
1469
1728
  },
1470
1729
  ...props,
1471
1730
  children: [
1472
- /* @__PURE__ */ jsx13(PanelLeftIcon, {}),
1473
- /* @__PURE__ */ jsx13("span", { className: "sr-only", children: "Toggle Sidebar" })
1731
+ /* @__PURE__ */ jsx14(PanelLeftIcon, {}),
1732
+ /* @__PURE__ */ jsx14("span", { className: "sr-only", children: "Toggle Sidebar" })
1474
1733
  ]
1475
1734
  }
1476
1735
  );
1477
1736
  }
1478
1737
  function SidebarRail({ className, ...props }) {
1479
1738
  const { toggleSidebar } = useSidebar();
1480
- return /* @__PURE__ */ jsx13(
1739
+ return /* @__PURE__ */ jsx14(
1481
1740
  "button",
1482
1741
  {
1483
1742
  "data-sidebar": "rail",
@@ -1500,7 +1759,7 @@ function SidebarRail({ className, ...props }) {
1500
1759
  );
1501
1760
  }
1502
1761
  function SidebarInset({ className, ...props }) {
1503
- return /* @__PURE__ */ jsx13(
1762
+ return /* @__PURE__ */ jsx14(
1504
1763
  "main",
1505
1764
  {
1506
1765
  "data-slot": "sidebar-inset",
@@ -1514,7 +1773,7 @@ function SidebarInset({ className, ...props }) {
1514
1773
  );
1515
1774
  }
1516
1775
  function SidebarHeader({ className, ...props }) {
1517
- return /* @__PURE__ */ jsx13(
1776
+ return /* @__PURE__ */ jsx14(
1518
1777
  "div",
1519
1778
  {
1520
1779
  "data-slot": "sidebar-header",
@@ -1525,7 +1784,7 @@ function SidebarHeader({ className, ...props }) {
1525
1784
  );
1526
1785
  }
1527
1786
  function SidebarFooter({ className, ...props }) {
1528
- return /* @__PURE__ */ jsx13(
1787
+ return /* @__PURE__ */ jsx14(
1529
1788
  "div",
1530
1789
  {
1531
1790
  "data-slot": "sidebar-footer",
@@ -1536,7 +1795,7 @@ function SidebarFooter({ className, ...props }) {
1536
1795
  );
1537
1796
  }
1538
1797
  function SidebarContent({ className, ...props }) {
1539
- return /* @__PURE__ */ jsx13(
1798
+ return /* @__PURE__ */ jsx14(
1540
1799
  "div",
1541
1800
  {
1542
1801
  "data-slot": "sidebar-content",
@@ -1550,7 +1809,7 @@ function SidebarContent({ className, ...props }) {
1550
1809
  );
1551
1810
  }
1552
1811
  function SidebarGroup({ className, ...props }) {
1553
- return /* @__PURE__ */ jsx13(
1812
+ return /* @__PURE__ */ jsx14(
1554
1813
  "div",
1555
1814
  {
1556
1815
  "data-slot": "sidebar-group",
@@ -1566,7 +1825,7 @@ function SidebarGroupLabel({
1566
1825
  ...props
1567
1826
  }) {
1568
1827
  const Comp = asChild ? Slot3 : "div";
1569
- return /* @__PURE__ */ jsx13(
1828
+ return /* @__PURE__ */ jsx14(
1570
1829
  Comp,
1571
1830
  {
1572
1831
  "data-slot": "sidebar-group-label",
@@ -1584,7 +1843,7 @@ function SidebarGroupContent({
1584
1843
  className,
1585
1844
  ...props
1586
1845
  }) {
1587
- return /* @__PURE__ */ jsx13(
1846
+ return /* @__PURE__ */ jsx14(
1588
1847
  "div",
1589
1848
  {
1590
1849
  "data-slot": "sidebar-group-content",
@@ -1595,7 +1854,7 @@ function SidebarGroupContent({
1595
1854
  );
1596
1855
  }
1597
1856
  function SidebarMenu({ className, ...props }) {
1598
- return /* @__PURE__ */ jsx13(
1857
+ return /* @__PURE__ */ jsx14(
1599
1858
  "ul",
1600
1859
  {
1601
1860
  "data-slot": "sidebar-menu",
@@ -1606,7 +1865,7 @@ function SidebarMenu({ className, ...props }) {
1606
1865
  );
1607
1866
  }
1608
1867
  function SidebarMenuItem({ className, ...props }) {
1609
- return /* @__PURE__ */ jsx13(
1868
+ return /* @__PURE__ */ jsx14(
1610
1869
  "li",
1611
1870
  {
1612
1871
  "data-slot": "sidebar-menu-item",
@@ -1647,7 +1906,7 @@ function SidebarMenuButton({
1647
1906
  }) {
1648
1907
  const Comp = asChild ? Slot3 : "button";
1649
1908
  const { isMobile, state } = useSidebar();
1650
- const button = /* @__PURE__ */ jsx13(
1909
+ const button = /* @__PURE__ */ jsx14(
1651
1910
  Comp,
1652
1911
  {
1653
1912
  "data-slot": "sidebar-menu-button",
@@ -1666,9 +1925,9 @@ function SidebarMenuButton({
1666
1925
  children: tooltip
1667
1926
  };
1668
1927
  }
1669
- return /* @__PURE__ */ jsxs6(Tooltip, { children: [
1670
- /* @__PURE__ */ jsx13(TooltipTrigger, { asChild: true, children: button }),
1671
- /* @__PURE__ */ jsx13(
1928
+ return /* @__PURE__ */ jsxs7(Tooltip, { children: [
1929
+ /* @__PURE__ */ jsx14(TooltipTrigger, { asChild: true, children: button }),
1930
+ /* @__PURE__ */ jsx14(
1672
1931
  TooltipContent,
1673
1932
  {
1674
1933
  side: "right",
@@ -1686,7 +1945,7 @@ function SidebarMenuAction({
1686
1945
  ...props
1687
1946
  }) {
1688
1947
  const Comp = asChild ? Slot3 : "button";
1689
- return /* @__PURE__ */ jsx13(
1948
+ return /* @__PURE__ */ jsx14(
1690
1949
  Comp,
1691
1950
  {
1692
1951
  "data-slot": "sidebar-menu-action",
@@ -1707,151 +1966,6 @@ function SidebarMenuAction({
1707
1966
  );
1708
1967
  }
1709
1968
 
1710
- // src/components/ui/dialog.tsx
1711
- import * as React6 from "react";
1712
- import * as DialogPrimitive from "@radix-ui/react-dialog";
1713
- import { XIcon as XIcon2 } from "lucide-react";
1714
- import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
1715
- function cleanupBodyStyles2() {
1716
- if (typeof document !== "undefined" && document.body.style.pointerEvents === "none") {
1717
- document.body.style.pointerEvents = "";
1718
- }
1719
- }
1720
- function Dialog({
1721
- open,
1722
- onOpenChange,
1723
- ...props
1724
- }) {
1725
- const prevOpenRef = React6.useRef(open);
1726
- React6.useEffect(() => {
1727
- if (prevOpenRef.current === true && open === false) {
1728
- const timeout = setTimeout(cleanupBodyStyles2, 250);
1729
- return () => clearTimeout(timeout);
1730
- }
1731
- prevOpenRef.current = open;
1732
- }, [open]);
1733
- React6.useEffect(() => {
1734
- return () => {
1735
- cleanupBodyStyles2();
1736
- };
1737
- }, []);
1738
- return /* @__PURE__ */ jsx14(DialogPrimitive.Root, { "data-slot": "dialog", open, onOpenChange, ...props });
1739
- }
1740
- function DialogTrigger({
1741
- ...props
1742
- }) {
1743
- return /* @__PURE__ */ jsx14(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
1744
- }
1745
- function DialogPortal({
1746
- ...props
1747
- }) {
1748
- return /* @__PURE__ */ jsx14(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
1749
- }
1750
- function DialogOverlay({
1751
- className,
1752
- ...props
1753
- }) {
1754
- return /* @__PURE__ */ jsx14(
1755
- DialogPrimitive.Overlay,
1756
- {
1757
- "data-slot": "dialog-overlay",
1758
- className: cn(
1759
- "fixed inset-0 z-50 bg-black/50",
1760
- "data-[state=open]:animate-in data-[state=closed]:animate-out",
1761
- "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1762
- "data-[state=closed]:pointer-events-none",
1763
- className
1764
- ),
1765
- ...props
1766
- }
1767
- );
1768
- }
1769
- function DialogContent({
1770
- className,
1771
- children,
1772
- showCloseButton = true,
1773
- ...props
1774
- }) {
1775
- return /* @__PURE__ */ jsxs7(DialogPortal, { "data-slot": "dialog-portal", children: [
1776
- /* @__PURE__ */ jsx14(DialogOverlay, {}),
1777
- /* @__PURE__ */ jsxs7(
1778
- DialogPrimitive.Content,
1779
- {
1780
- "data-slot": "dialog-content",
1781
- "aria-describedby": void 0,
1782
- className: cn(
1783
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
1784
- className
1785
- ),
1786
- ...props,
1787
- children: [
1788
- children,
1789
- showCloseButton && /* @__PURE__ */ jsxs7(
1790
- DialogPrimitive.Close,
1791
- {
1792
- "data-slot": "dialog-close",
1793
- className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1794
- children: [
1795
- /* @__PURE__ */ jsx14(XIcon2, {}),
1796
- /* @__PURE__ */ jsx14("span", { className: "sr-only", children: "Close" })
1797
- ]
1798
- }
1799
- )
1800
- ]
1801
- }
1802
- )
1803
- ] });
1804
- }
1805
- function DialogHeader({ className, ...props }) {
1806
- return /* @__PURE__ */ jsx14(
1807
- "div",
1808
- {
1809
- "data-slot": "dialog-header",
1810
- className: cn("flex flex-col gap-2 text-center sm:text-left", className),
1811
- ...props
1812
- }
1813
- );
1814
- }
1815
- function DialogFooter({ className, ...props }) {
1816
- return /* @__PURE__ */ jsx14(
1817
- "div",
1818
- {
1819
- "data-slot": "dialog-footer",
1820
- className: cn(
1821
- "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
1822
- className
1823
- ),
1824
- ...props
1825
- }
1826
- );
1827
- }
1828
- function DialogTitle({
1829
- className,
1830
- ...props
1831
- }) {
1832
- return /* @__PURE__ */ jsx14(
1833
- DialogPrimitive.Title,
1834
- {
1835
- "data-slot": "dialog-title",
1836
- className: cn("text-lg leading-none font-semibold", className),
1837
- ...props
1838
- }
1839
- );
1840
- }
1841
- function DialogDescription({
1842
- className,
1843
- ...props
1844
- }) {
1845
- return /* @__PURE__ */ jsx14(
1846
- DialogPrimitive.Description,
1847
- {
1848
- "data-slot": "dialog-description",
1849
- className: cn("text-muted-foreground text-sm", className),
1850
- ...props
1851
- }
1852
- );
1853
- }
1854
-
1855
1969
  // src/components/ui/alert-dialog.tsx
1856
1970
  import * as React7 from "react";
1857
1971
  import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
@@ -2645,7 +2759,7 @@ function CardContent({ className, ...props }) {
2645
2759
  import {
2646
2760
  Bot as Bot2,
2647
2761
  MoreVertical,
2648
- Download,
2762
+ Download as Download2,
2649
2763
  Upload,
2650
2764
  Trash2 as Trash22,
2651
2765
  Plus as Plus2,
@@ -3045,7 +3159,7 @@ var ChatHeader = ({
3045
3159
  /* @__PURE__ */ jsx21(DropdownMenuSeparator, {})
3046
3160
  ] }),
3047
3161
  onExportData && /* @__PURE__ */ jsxs13(DropdownMenuItem, { onClick: onExportData, children: [
3048
- /* @__PURE__ */ jsx21(Download, { className: "h-4 w-4 mr-2" }),
3162
+ /* @__PURE__ */ jsx21(Download2, { className: "h-4 w-4 mr-2" }),
3049
3163
  config.labels?.exportData || "Export Data"
3050
3164
  ] }),
3051
3165
  onImportData && /* @__PURE__ */ jsxs13(DropdownMenuItem, { onClick: handleImportClick, children: [
@@ -3682,7 +3796,7 @@ import {
3682
3796
  Mic as Mic2,
3683
3797
  Image as Image2,
3684
3798
  Video,
3685
- FileText,
3799
+ FileText as FileText2,
3686
3800
  X as X4,
3687
3801
  Square as Square2,
3688
3802
  Play,
@@ -3744,9 +3858,9 @@ var FileUploadItem = memo4(function FileUploadItem2({ file, progress, onCancel }
3744
3858
  if (t.startsWith("image/")) return /* @__PURE__ */ jsx25(Image2, { className: "h-4 w-4" });
3745
3859
  if (t.startsWith("video/")) return /* @__PURE__ */ jsx25(Video, { className: "h-4 w-4" });
3746
3860
  if (t.startsWith("audio/")) return /* @__PURE__ */ jsx25(Mic2, { className: "h-4 w-4" });
3747
- return /* @__PURE__ */ jsx25(FileText, { className: "h-4 w-4" });
3861
+ return /* @__PURE__ */ jsx25(FileText2, { className: "h-4 w-4" });
3748
3862
  };
3749
- const formatFileSize = (bytes) => {
3863
+ const formatFileSize2 = (bytes) => {
3750
3864
  if (bytes === 0) return "0 Bytes";
3751
3865
  const k = 1024;
3752
3866
  const sizes = ["Bytes", "KB", "MB", "GB"];
@@ -3757,7 +3871,7 @@ var FileUploadItem = memo4(function FileUploadItem2({ file, progress, onCancel }
3757
3871
  getFileIcon(file.type, file.name),
3758
3872
  /* @__PURE__ */ jsxs15("div", { className: "flex-1 min-w-0", children: [
3759
3873
  /* @__PURE__ */ jsx25("p", { className: "text-sm font-medium truncate", children: file.name }),
3760
- /* @__PURE__ */ jsx25("p", { className: "text-xs text-muted-foreground", children: formatFileSize(file.size ?? 0) }),
3874
+ /* @__PURE__ */ jsx25("p", { className: "text-xs text-muted-foreground", children: formatFileSize2(file.size ?? 0) }),
3761
3875
  /* @__PURE__ */ jsx25(Progress, { value: progress, className: "h-1 mt-1" })
3762
3876
  ] }),
3763
3877
  /* @__PURE__ */ jsx25(
@@ -3887,7 +4001,24 @@ var AttachmentPreview = memo4(function AttachmentPreview2({ attachment, onRemove
3887
4001
  }
3888
4002
  )
3889
4003
  ] }),
3890
- attachment.fileName && attachment.kind !== "audio" && /* @__PURE__ */ jsx25("div", { className: "absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs p-1 rounded-b", children: /* @__PURE__ */ jsx25("p", { className: "truncate", children: attachment.fileName }) })
4004
+ attachment.kind === "file" && /* @__PURE__ */ jsxs15("div", { className: "flex min-w-48 items-center gap-2 p-2", children: [
4005
+ /* @__PURE__ */ jsx25("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded bg-muted", children: /* @__PURE__ */ jsx25(FileText2, { className: "h-4 w-4" }) }),
4006
+ /* @__PURE__ */ jsxs15("div", { className: "min-w-0 flex-1", children: [
4007
+ /* @__PURE__ */ jsx25("p", { className: "truncate text-xs font-medium", children: attachment.fileName || "File" }),
4008
+ /* @__PURE__ */ jsx25("p", { className: "truncate text-xs text-muted-foreground", children: [attachment.mimeType || "File", formatFileSize(attachment.size)].filter(Boolean).join(" \xB7 ") })
4009
+ ] }),
4010
+ /* @__PURE__ */ jsx25(
4011
+ Button,
4012
+ {
4013
+ variant: "ghost",
4014
+ size: "icon",
4015
+ className: "h-6 w-6 opacity-0 transition-opacity group-hover:opacity-100",
4016
+ onClick: onRemove,
4017
+ children: /* @__PURE__ */ jsx25(X4, { className: "h-3 w-3" })
4018
+ }
4019
+ )
4020
+ ] }),
4021
+ attachment.fileName && attachment.kind !== "audio" && attachment.kind !== "file" && /* @__PURE__ */ jsx25("div", { className: "absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs p-1 rounded-b", children: /* @__PURE__ */ jsx25("p", { className: "truncate", children: attachment.fileName }) })
3891
4022
  ] }) });
3892
4023
  });
3893
4024
  var resolveVoiceErrorMessage = (error, config) => {
@@ -3916,7 +4047,7 @@ var ChatInput = memo4(function ChatInput2({
3916
4047
  maxAttachments = 4,
3917
4048
  maxFileSize = 10 * 1024 * 1024,
3918
4049
  // 10MB
3919
- acceptedFileTypes = ["image/*", "video/*", "audio/*"],
4050
+ acceptedFileTypes = [],
3920
4051
  className = "",
3921
4052
  config,
3922
4053
  mentionAgents = [],
@@ -4091,9 +4222,9 @@ var ChatInput = memo4(function ChatInput2({
4091
4222
  return newMap;
4092
4223
  });
4093
4224
  const attachment = {
4094
- kind: file.type.startsWith("image/") ? "image" : file.type.startsWith("video/") ? "video" : file.type.startsWith("audio/") ? "audio" : "image",
4225
+ kind: getAttachmentKindFromMimeType(file.type),
4095
4226
  dataUrl,
4096
- mimeType: file.type,
4227
+ mimeType: file.type || "application/octet-stream",
4097
4228
  fileName: file.name,
4098
4229
  size: file.size
4099
4230
  };
@@ -4516,7 +4647,7 @@ var ChatInput = memo4(function ChatInput2({
4516
4647
  ref: fileInputRef,
4517
4648
  type: "file",
4518
4649
  multiple: true,
4519
- accept: acceptedFileTypes.join(","),
4650
+ accept: acceptedFileTypes.length > 0 ? acceptedFileTypes.join(",") : void 0,
4520
4651
  onChange: handleFileSelect,
4521
4652
  className: "hidden"
4522
4653
  }
@@ -4725,7 +4856,7 @@ import {
4725
4856
  UserPlus,
4726
4857
  Image as Image3,
4727
4858
  BadgeCheck,
4728
- FileText as FileText2,
4859
+ FileText as FileText3,
4729
4860
  Brain as Brain2,
4730
4861
  Plus as Plus3,
4731
4862
  Trash2 as Trash24,
@@ -4765,7 +4896,7 @@ var getFieldIcon = (type, key) => {
4765
4896
  if (lowerKey.includes("following")) return /* @__PURE__ */ jsx27(UserPlus, { className: iconClass });
4766
4897
  if (lowerKey.includes("post") || lowerKey.includes("publication")) return /* @__PURE__ */ jsx27(Image3, { className: iconClass });
4767
4898
  if (lowerKey.includes("verified") || lowerKey.includes("badge")) return /* @__PURE__ */ jsx27(BadgeCheck, { className: iconClass });
4768
- if (lowerKey.includes("bio")) return /* @__PURE__ */ jsx27(FileText2, { className: iconClass });
4899
+ if (lowerKey.includes("bio")) return /* @__PURE__ */ jsx27(FileText3, { className: iconClass });
4769
4900
  if (lowerKey.includes("email")) return /* @__PURE__ */ jsx27(Mail, { className: iconClass });
4770
4901
  if (lowerKey.includes("phone") || lowerKey.includes("tel")) return /* @__PURE__ */ jsx27(Phone, { className: iconClass });
4771
4902
  if (lowerKey.includes("location") || lowerKey.includes("address") || lowerKey.includes("city")) return /* @__PURE__ */ jsx27(MapPin, { className: iconClass });
@@ -5589,7 +5720,7 @@ var ChatUI = ({
5589
5720
  if (groupedMessages.length > 0 || !suggestions.length) return null;
5590
5721
  return /* @__PURE__ */ jsxs18("div", { className: "flex flex-col items-center justify-center min-h-[60vh] py-8 px-4", children: [
5591
5722
  /* @__PURE__ */ jsxs18("div", { className: "text-center mb-8", children: [
5592
- /* @__PURE__ */ jsx28("div", { className: "inline-flex items-center justify-center w-14 h-14 rounded-2xl bg-gradient-to-br from-primary/20 to-primary/5 mb-4 shadow-sm", children: /* @__PURE__ */ jsx28(Sparkles2, { className: "w-7 h-7 text-primary" }) }),
5723
+ /* @__PURE__ */ jsx28("div", { className: "inline-flex items-center justify-center w-14 h-14 rounded-2xl bg-gradient-to-br from-primary/20 to-primary/5 mb-4 shadow-sm", children: config.branding.avatar ?? /* @__PURE__ */ jsx28(Sparkles2, { className: "w-7 h-7 text-primary" }) }),
5593
5724
  /* @__PURE__ */ jsx28("h2", { className: "text-xl font-semibold mb-2", children: config.branding.title }),
5594
5725
  /* @__PURE__ */ jsx28("p", { className: "text-muted-foreground text-sm max-w-md", children: config.branding.subtitle })
5595
5726
  ] }),
@@ -5861,6 +5992,7 @@ var ChatUI = ({
5861
5992
  enableAudioRecording: config.features.enableAudioRecording,
5862
5993
  maxAttachments: config.features.maxAttachments,
5863
5994
  maxFileSize: config.features.maxFileSize,
5995
+ acceptedFileTypes: config.features.acceptedFileTypes,
5864
5996
  config,
5865
5997
  mentionAgents: participantIds && participantIds.length > 0 ? agentOptions.filter(
5866
5998
  (a) => participantIds.includes(a.id)
@@ -5938,6 +6070,8 @@ export {
5938
6070
  ChatUserContextProvider,
5939
6071
  MessageSenderAvatar,
5940
6072
  defaultChatConfig,
6073
+ getAttachmentKindFromMimeType,
6074
+ getMimeTypeFromDataUrl,
5941
6075
  mergeConfig,
5942
6076
  resolveMessageSenderDisplay,
5943
6077
  useChatUserContext