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 b } 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 H } from "../../theme/util/genComponentStyleHook.mjs";
import y from "./light.mjs";
const T = (o) => {
  const {
    antCls: e,
    // .ant
    componentCls: r,
    // .ant-layout
    colorText: t,
    triggerColor: i,
    footerBg: l,
    triggerBg: c,
    headerHeight: n,
    headerPadding: g,
    headerColor: d,
    footerPadding: B,
    triggerHeight: s,
    zeroTriggerHeight: f,
    zeroTriggerWidth: h,
    motionDurationMid: u,
    motionDurationSlow: p,
    fontSize: S,
    borderRadius: a,
    bodyBg: x,
    headerBg: $,
    siderBg: m
  } = o;
  return {
    [r]: Object.assign(Object.assign({
      display: "flex",
      flex: "auto",
      flexDirection: "column",
      /* fix firefox can't set height smaller than content on flex item */
      minHeight: 0,
      background: x,
      "&, *": {
        boxSizing: "border-box"
      },
      [`&${r}-has-sider`]: {
        flexDirection: "row",
        [`> ${r}, > ${r}-content`]: {
          // https://segmentfault.com/a/1190000019498300
          width: 0
        }
      },
      [`${r}-header, &${r}-footer`]: {
        flex: "0 0 auto"
      },
      [`${r}-sider`]: {
        position: "relative",
        // fix firefox can't set width smaller than content on flex item
        minWidth: 0,
        background: m,
        transition: `all ${u}, background 0s`,
        "&-children": {
          height: "100%",
          // Hack for fixing margin collapse bug
          // https://github.com/ant-design/ant-design/issues/7967
          // solution from https://stackoverflow.com/a/33132624/3040605
          marginTop: -0.1,
          paddingTop: 0.1,
          [`${e}-menu${e}-menu-inline-collapsed`]: {
            width: "auto"
          }
        },
        "&-has-trigger": {
          paddingBottom: s
        },
        "&-right": {
          order: 1
        },
        "&-trigger": {
          position: "fixed",
          bottom: 0,
          zIndex: 1,
          height: s,
          color: i,
          lineHeight: b(s),
          textAlign: "center",
          background: c,
          cursor: "pointer",
          transition: `all ${u}`
        },
        "&-zero-width": {
          "> *": {
            overflow: "hidden"
          },
          "&-trigger": {
            position: "absolute",
            top: n,
            insetInlineEnd: o.calc(h).mul(-1).equal(),
            zIndex: 1,
            width: h,
            height: f,
            color: i,
            fontSize: o.fontSizeXL,
            display: "flex",
            alignItems: "center",
            justifyContent: "center",
            background: m,
            borderStartStartRadius: 0,
            borderStartEndRadius: a,
            borderEndEndRadius: a,
            borderEndStartRadius: 0,
            cursor: "pointer",
            transition: `background ${p} ease`,
            "&::after": {
              position: "absolute",
              inset: 0,
              background: "transparent",
              transition: `all ${p}`,
              content: '""'
            },
            "&:hover::after": {
              background: "rgba(255, 255, 255, 0.2)"
            },
            "&-right": {
              insetInlineStart: o.calc(h).mul(-1).equal(),
              borderStartStartRadius: a,
              borderStartEndRadius: 0,
              borderEndEndRadius: 0,
              borderEndStartRadius: a
            }
          }
        }
      }
    }, y(o)), {
      // RTL
      "&-rtl": {
        direction: "rtl"
      }
    }),
    // ==================== Header ====================
    [`${r}-header`]: {
      height: n,
      padding: g,
      color: d,
      lineHeight: b(n),
      background: $,
      // Other components/menu/style/index.less line:686
      // Integration with header element so menu items have the same height
      [`${e}-menu`]: {
        lineHeight: "inherit"
      }
    },
    // ==================== Footer ====================
    [`${r}-footer`]: {
      padding: B,
      color: t,
      fontSize: S,
      background: l
    },
    // =================== Content ====================
    [`${r}-content`]: {
      flex: "auto",
      // fix firefox can't set height smaller than content on flex item
      minHeight: 0
    }
  };
}, z = (o) => {
  const {
    colorBgLayout: e,
    controlHeight: r,
    controlHeightLG: t,
    colorText: i,
    controlHeightSM: l,
    marginXXS: c,
    colorTextLightSolid: n,
    colorBgContainer: g
  } = o, d = t * 1.25;
  return {
    // Deprecated
    colorBgHeader: "#001529",
    colorBgBody: e,
    colorBgTrigger: "#002140",
    bodyBg: e,
    headerBg: "#001529",
    headerHeight: r * 2,
    headerPadding: `0 ${d}px`,
    headerColor: i,
    footerPadding: `${l}px ${d}px`,
    footerBg: e,
    siderBg: "#001529",
    triggerHeight: t + c * 2,
    triggerBg: "#002140",
    triggerColor: n,
    zeroTriggerWidth: t,
    zeroTriggerHeight: t,
    lightSiderBg: g,
    lightTriggerBg: g,
    lightTriggerColor: i
  };
}, M = H("Layout", (o) => [T(o)], z, {
  deprecatedTokens: [["colorBgBody", "bodyBg"], ["colorBgHeader", "headerBg"], ["colorBgTrigger", "triggerBg"]]
});
export {
  M as default,
  z as prepareComponentToken
};
