import { cn } from "../../lib/utils.js";
/* empty css                                      */
import rehypeKatex from "../../node_modules/rehype-katex/lib/index.js";
import remarkGfm from "../../node_modules/remark-gfm/lib/index.js";
import remarkMath from "../../node_modules/remark-math/lib/index.js";
import MermaidDiagram_default from "./MermaidDiagram.js";
/* empty css         */
import { c } from "react/compiler-runtime";
import React from "react";
import { jsx } from "react/jsx-runtime";
import Markdown from "react-markdown";
var MarkdownContent_default = (f) => {
	let p = c(10), { content: m, className: h } = f, g;
	p[0] === h ? g = p[1] : (g = cn("markdown-content", h), p[0] = h, p[1] = g);
	let _, v, y;
	p[2] === Symbol.for("react.memo_cache_sentinel") ? (_ = [remarkGfm, remarkMath], v = [rehypeKatex], y = {
		code: _temp,
		table: _temp2,
		div: _temp3,
		span: _temp4
	}, p[2] = _, p[3] = v, p[4] = y) : (_ = p[2], v = p[3], y = p[4]);
	let b;
	p[5] === m ? b = p[6] : (b = /* @__PURE__ */ jsx(Markdown, {
		remarkPlugins: _,
		rehypePlugins: v,
		components: y,
		children: m
	}), p[5] = m, p[6] = b);
	let x;
	return p[7] !== g || p[8] !== b ? (x = /* @__PURE__ */ jsx("div", {
		className: g,
		children: b
	}), p[7] = g, p[8] = b, p[9] = x) : x = p[9], x;
};
function _temp(e) {
	let { children: l, className: u } = e, d = !u;
	return (u?.replace("language-", "") || "") === "mermaid" && typeof l == "string" ? /* @__PURE__ */ jsx(MermaidDiagram_default, { chart: l }) : d ? /* @__PURE__ */ jsx("code", { children: l }) : /* @__PURE__ */ jsx("code", {
		className: u,
		children: l
	});
}
function _temp2(e) {
	let { children: l } = e;
	return /* @__PURE__ */ jsx("div", {
		className: "table-wrapper",
		children: /* @__PURE__ */ jsx("table", { children: l })
	});
}
function _temp3(l) {
	let { className: u, children: d, ...f } = l;
	return u === "math math-display" ? /* @__PURE__ */ jsx("div", {
		className: "math-display-wrapper",
		children: /* @__PURE__ */ jsx("div", {
			className: cn("math math-display", u),
			...f,
			children: d
		})
	}) : /* @__PURE__ */ jsx("div", {
		className: u,
		...f,
		children: d
	});
}
function _temp4(l) {
	let { className: u, children: d, ...f } = l;
	return u === "math math-inline" ? /* @__PURE__ */ jsx("span", {
		className: cn("math math-inline", u),
		...f,
		children: d
	}) : /* @__PURE__ */ jsx("span", {
		className: u,
		...f,
		children: d
	});
}
export { MarkdownContent_default as default };
