import { genStyleHooks } from "../../theme/genStyleUtils.js";
import { unit } from "@antdv-next/cssinjs";
import { mergeToken } from "@antdv-next/cssinjs/cssinjs-utils";
//#region components/mermaid/style/index.ts
var genMermaidStyle = (token) => {
	const { componentCls } = token;
	return { [componentCls]: {
		borderRadius: token.borderRadiusLG,
		overflow: "hidden",
		[`${componentCls}-header`]: {
			display: "flex",
			alignItems: "center",
			justifyContent: "space-between",
			gap: token.marginXS,
			background: token.colorBgTitle,
			color: token.colorTextTitle,
			paddingBlock: token.paddingXS,
			paddingInline: token.paddingSM,
			borderBottom: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorderGraph}`
		},
		[`${componentCls}-graph`]: {
			position: "relative",
			display: "flex",
			alignItems: "center",
			justifyContent: "center",
			background: token.colorBgContainer,
			borderInline: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorderGraph}`,
			borderBottom: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorderGraph}`,
			padding: token.paddingSM,
			overflow: "auto",
			height: unit(token.graphHeight ?? 400)
		},
		[`${componentCls}-graph-hidden`]: { display: "none" },
		[`${componentCls}-graph svg`]: {
			display: "block",
			maxWidth: "100%",
			maxHeight: "100%",
			width: "auto",
			height: "auto",
			transformOrigin: "center center"
		},
		[`${componentCls}-code`]: {
			background: token.colorBgContainer,
			borderInline: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorderCode}`,
			borderBottom: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorderCode}`,
			overflow: "auto",
			height: unit(token.graphHeight ?? 400)
		},
		[`&${componentCls}-rtl`]: { direction: "rtl" }
	} };
};
var prepareComponentToken = (token) => ({
	colorBgTitle: token.colorFillContent,
	colorTextTitle: token.colorText,
	colorBorderCode: token.colorBorderSecondary,
	colorBorderGraph: token.colorBorderSecondary,
	graphHeight: 400
});
var style_default = genStyleHooks("Mermaid", (token) => {
	return [genMermaidStyle(mergeToken(token, {}))];
}, prepareComponentToken);
//#endregion
export { style_default as default, prepareComponentToken };
