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 n } 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 { genStyleHooks as m } from "../../theme/util/genComponentStyleHook.mjs";
import { merge as u } from "../../theme/util/statistic.mjs";
const p = (o) => {
  const {
    componentCls: i,
    lineHeightHeading3: r,
    iconCls: e,
    padding: l,
    paddingXL: c,
    paddingXS: g,
    paddingLG: t,
    marginXS: s,
    lineHeight: a
  } = o;
  return {
    // Result
    [i]: {
      padding: `${n(o.calc(t).mul(2).equal())} ${n(c)}`,
      // RTL
      "&-rtl": {
        direction: "rtl"
      }
    },
    // Exception Status image
    [`${i} ${i}-image`]: {
      width: o.imageWidth,
      height: o.imageHeight,
      margin: "auto"
    },
    [`${i} ${i}-icon`]: {
      marginBottom: t,
      textAlign: "center",
      [`& > ${e}`]: {
        fontSize: o.iconFontSize
      }
    },
    [`${i} ${i}-title`]: {
      color: o.colorTextHeading,
      fontSize: o.titleFontSize,
      lineHeight: r,
      marginBlock: s,
      textAlign: "center"
    },
    [`${i} ${i}-subtitle`]: {
      color: o.colorTextDescription,
      fontSize: o.subtitleFontSize,
      lineHeight: a,
      textAlign: "center"
    },
    [`${i} ${i}-content`]: {
      marginTop: t,
      padding: `${n(t)} ${n(o.calc(l).mul(2.5).equal())}`,
      backgroundColor: o.colorFillAlter
    },
    [`${i} ${i}-extra`]: {
      margin: o.extraMargin,
      textAlign: "center",
      "& > *": {
        marginInlineEnd: g,
        "&:last-child": {
          marginInlineEnd: 0
        }
      }
    }
  };
}, $ = (o) => {
  const {
    componentCls: i,
    iconCls: r
  } = o;
  return {
    [`${i}-success ${i}-icon > ${r}`]: {
      color: o.resultSuccessIconColor
    },
    [`${i}-error ${i}-icon > ${r}`]: {
      color: o.resultErrorIconColor
    },
    [`${i}-info ${i}-icon > ${r}`]: {
      color: o.resultInfoIconColor
    },
    [`${i}-warning ${i}-icon > ${r}`]: {
      color: o.resultWarningIconColor
    }
  };
}, d = (o) => [p(o), $(o)], S = (o) => d(o), f = (o) => ({
  titleFontSize: o.fontSizeHeading3,
  subtitleFontSize: o.fontSize,
  iconFontSize: o.fontSizeHeading3 * 3,
  extraMargin: `${o.paddingLG}px 0 0 0`
}), L = m("Result", (o) => {
  const i = o.colorInfo, r = o.colorError, e = o.colorSuccess, l = o.colorWarning, c = u(o, {
    resultInfoIconColor: i,
    resultErrorIconColor: r,
    resultSuccessIconColor: e,
    resultWarningIconColor: l,
    imageWidth: 250,
    imageHeight: 295
  });
  return [S(c)];
}, f);
export {
  L as default,
  f as prepareComponentToken
};
