import "../../../../@ant-design/cssinjs/es/extractStyle.mjs";
import "../../../../@ant-design/cssinjs/es/hooks/useCacheToken.mjs";
import "react";
import "../../../../@ant-design/cssinjs/es/StyleContext.mjs";
import { unit as r } from "../../../../@ant-design/cssinjs/es/util/index.mjs";
import "../../../../@ant-design/cssinjs/es/hooks/useCompatibleInsertionEffect.mjs";
import "../../../../@ant-design/cssinjs/es/hooks/useEffectCleanupRegister.mjs";
import "../../../../@ant-design/cssinjs/es/hooks/useHMR.mjs";
import "../../../../rc-util/es/warning.mjs";
import "../../../../@ant-design/cssinjs/es/theme/createTheme.mjs";
import "../../../../@ant-design/cssinjs/es/theme/ThemeCache.mjs";
import "../../../../@ant-design/cssinjs/es/transformers/legacyLogicalProperties.mjs";
import { resetComponent as h } from "../../style/index.mjs";
import { genStyleHooks as g } from "../../theme/util/genComponentStyleHook.mjs";
import { merge as c } from "../../theme/util/statistic.mjs";
const m = (i) => {
  const {
    componentCls: t,
    sizePaddingEdgeHorizontal: a,
    colorSplit: o,
    lineWidth: e,
    textPaddingInline: d,
    orientationMargin: n,
    verticalMarginInline: l
  } = i;
  return {
    [t]: Object.assign(Object.assign({}, h(i)), {
      borderBlockStart: `${r(e)} solid ${o}`,
      // vertical
      "&-vertical": {
        position: "relative",
        top: "-0.06em",
        display: "inline-block",
        height: "0.9em",
        marginInline: l,
        marginBlock: 0,
        verticalAlign: "middle",
        borderTop: 0,
        borderInlineStart: `${r(e)} solid ${o}`
      },
      "&-horizontal": {
        display: "flex",
        clear: "both",
        width: "100%",
        minWidth: "100%",
        // Fix https://github.com/ant-design/ant-design/issues/10914
        margin: `${r(i.dividerHorizontalGutterMargin)} 0`
      },
      [`&-horizontal${t}-with-text`]: {
        display: "flex",
        alignItems: "center",
        margin: `${r(i.dividerHorizontalWithTextGutterMargin)} 0`,
        color: i.colorTextHeading,
        fontWeight: 500,
        fontSize: i.fontSizeLG,
        whiteSpace: "nowrap",
        textAlign: "center",
        borderBlockStart: `0 ${o}`,
        "&::before, &::after": {
          position: "relative",
          width: "50%",
          borderBlockStart: `${r(e)} solid transparent`,
          // Chrome not accept `inherit` in `border-top`
          borderBlockStartColor: "inherit",
          borderBlockEnd: 0,
          transform: "translateY(50%)",
          content: "''"
        }
      },
      [`&-horizontal${t}-with-text-left`]: {
        "&::before": {
          width: `calc(${n} * 100%)`
        },
        "&::after": {
          width: `calc(100% - ${n} * 100%)`
        }
      },
      [`&-horizontal${t}-with-text-right`]: {
        "&::before": {
          width: `calc(100% - ${n} * 100%)`
        },
        "&::after": {
          width: `calc(${n} * 100%)`
        }
      },
      [`${t}-inner-text`]: {
        display: "inline-block",
        paddingBlock: 0,
        paddingInline: d
      },
      "&-dashed": {
        background: "none",
        borderColor: o,
        borderStyle: "dashed",
        borderWidth: `${r(e)} 0 0`
      },
      [`&-horizontal${t}-with-text${t}-dashed`]: {
        "&::before, &::after": {
          borderStyle: "dashed none none"
        }
      },
      [`&-vertical${t}-dashed`]: {
        borderInlineStartWidth: e,
        borderInlineEnd: 0,
        borderBlockStart: 0,
        borderBlockEnd: 0
      },
      [`&-plain${t}-with-text`]: {
        color: i.colorText,
        fontWeight: "normal",
        fontSize: i.fontSize
      },
      [`&-horizontal${t}-with-text-left${t}-no-default-orientation-margin-left`]: {
        "&::before": {
          width: 0
        },
        "&::after": {
          width: "100%"
        },
        [`${t}-inner-text`]: {
          paddingInlineStart: a
        }
      },
      [`&-horizontal${t}-with-text-right${t}-no-default-orientation-margin-right`]: {
        "&::before": {
          width: "100%"
        },
        "&::after": {
          width: 0
        },
        [`${t}-inner-text`]: {
          paddingInlineEnd: a
        }
      }
    })
  };
}, p = (i) => ({
  textPaddingInline: "1em",
  orientationMargin: 0.05,
  verticalMarginInline: i.marginXS
}), W = g("Divider", (i) => {
  const t = c(i, {
    dividerHorizontalWithTextGutterMargin: i.margin,
    dividerHorizontalGutterMargin: i.marginLG,
    sizePaddingEdgeHorizontal: 0
  });
  return [m(t)];
}, p, {
  unitless: {
    orientationMargin: !0
  }
});
export {
  W as default,
  p as prepareComponentToken
};
