import { cx as e } from "../../../theme/tools.js";
import { MarkdownCodeCopyButton as t } from "../markdown/components/MarkdownCodeCopyButton.js";
import { badge as n, container as r, content as i, fallbackCode as a, placeholder as o, shikiPre as s, shikiWrapper as c, toolbar as l } from "./HighlightCode.css.js";
import { cloneElement as u, isValidElement as d } from "react";
import { jsx as f, jsxs as p } from "react/jsx-runtime";
//#region src/atomic/molecules/highlight/HighlightCode.tsx
var m = (t) => {
	if (!d(t) || typeof t.type != "string" || t.type !== "pre") return t;
	let n = t.props.className;
	return u(t, { className: e(s, n) });
}, h = ({ badgeLabel: e, copyCode: s, highlighted: u, fallbackCodeText: d, placeholderText: h }) => {
	let g;
	g = h == null ? u == null ? /* @__PURE__ */ f("pre", {
		className: a,
		children: d ?? ""
	}) : typeof u == "string" ? /* @__PURE__ */ f("pre", {
		className: a,
		dangerouslySetInnerHTML: { __html: u }
	}) : /* @__PURE__ */ f("div", {
		className: c,
		children: m(u)
	}) : /* @__PURE__ */ f("span", {
		className: o,
		children: h
	});
	let _ = null;
	return typeof s == "string" && s !== "" && (_ = /* @__PURE__ */ f(t, { code: s })), /* @__PURE__ */ p("div", {
		className: r,
		children: [/* @__PURE__ */ p("div", {
			className: l,
			children: [/* @__PURE__ */ f("span", {
				className: n,
				children: e
			}), _]
		}), /* @__PURE__ */ f("div", {
			className: i,
			children: g
		})]
	});
};
//#endregion
export { h as HighlightCode, h as default };

//# sourceMappingURL=HighlightCode.js.map