import { cn as e } from "../../lib/utils.js";
import { Card as t } from "../ui/card.js";
import "react";
import { jsx as n, jsxs as r } from "react/jsx-runtime";
//#region src/components/messages/CompletionMessagePaper.tsx
var i = ({ role: i, children: a, timestamp: o, metadata: s, fullWidth: c = !1, className: l }) => {
	let u = {
		system: {
			color: "#efb108",
			align: "left"
		},
		user: {
			color: "#0496d0",
			align: "right"
		},
		assistant: {
			color: "#004a98",
			align: "left"
		},
		document: {
			color: "#0e2135",
			align: "left"
		},
		tool: {
			color: "#efb108",
			align: "left"
		},
		error: {
			color: "#dc0d33",
			align: "left"
		}
	}, d = (i ? u[i] : void 0) ?? u.assistant, f = i === "user";
	return /* @__PURE__ */ n("div", {
		className: e("animate-in fade-in mb-1 flex flex-row items-start duration-300", f ? "justify-end" : "justify-start", l),
		children: /* @__PURE__ */ r("div", {
			className: e("flex min-w-50 flex-col", c ? "w-full max-w-full" : "w-auto max-w-[75%]", f ? "items-end" : "items-start"),
			children: [
				/* @__PURE__ */ r("div", {
					className: "mb-2 flex items-center gap-2 opacity-70",
					children: [i ? /* @__PURE__ */ n("span", {
						className: "text-xs font-semibold tracking-wider uppercase",
						style: { color: d.color },
						children: i
					}) : "", o && /* @__PURE__ */ n("span", {
						className: "text-muted-foreground font-mono text-xs",
						children: ((e) => e.toLocaleTimeString([], {
							hour: "2-digit",
							minute: "2-digit"
						}))(o)
					})]
				}),
				s && Object.keys(s).length > 0 && /* @__PURE__ */ n("div", {
					className: e("bg-muted mFax-w-full mb-2 rounded-md p-2", f ? "self-end" : "self-start"),
					children: Object.entries(s).map(([e, t]) => /* @__PURE__ */ r("div", {
						className: "text-muted-foreground font-mono text-xs",
						children: [
							/* @__PURE__ */ r("strong", { children: [e, ":"] }),
							" ",
							String(t)
						]
					}, e))
				}),
				/* @__PURE__ */ n(t, {
					className: e("relative max-w-full px-6 py-4 wrap-break-word shadow-none", c ? "w-full" : "w-auto"),
					children: /* @__PURE__ */ n("div", {
						className: e("leading-relaxed wrap-break-word whitespace-pre-wrap", f ? "user" : "text-foreground"),
						children: /* @__PURE__ */ n("div", {
							className: "message-content",
							children: a
						})
					})
				})
			]
		})
	});
};
//#endregion
export { i as default };
