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 c } 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 { genFocusOutline as F } from "../../style/index.mjs";
const g = (e) => Object.assign({}, F(e)), R = (e, r) => {
  const {
    componentCls: o,
    itemColor: p,
    itemSelectedColor: i,
    groupTitleColor: v,
    itemBg: B,
    subMenuItemBg: C,
    itemSelectedBg: h,
    activeBarHeight: n,
    activeBarWidth: I,
    activeBarBorderWidth: l,
    motionDurationSlow: k,
    motionEaseInOut: a,
    motionEaseOut: d,
    itemPaddingInline: f,
    motionDurationMid: t,
    itemHoverColor: S,
    lineType: y,
    colorSplit: O,
    // Disabled
    itemDisabledColor: j,
    // Danger
    dangerItemColor: z,
    dangerItemHoverColor: E,
    dangerItemSelectedColor: s,
    dangerItemActiveBg: H,
    dangerItemSelectedBg: T,
    itemHoverBg: $,
    itemActiveBg: u,
    menuSubMenuBg: W,
    // Horizontal
    horizontalItemSelectedColor: m,
    horizontalItemSelectedBg: b,
    horizontalItemBorderRadius: D,
    horizontalItemHoverBg: M,
    popupBg: A
  } = e;
  return {
    [`${o}-${r}, ${o}-${r} > ${o}`]: {
      color: p,
      background: B,
      [`&${o}-root:focus-visible`]: Object.assign({}, g(e)),
      // ======================== Item ========================
      [`${o}-item-group-title`]: {
        color: v
      },
      [`${o}-submenu-selected`]: {
        [`> ${o}-submenu-title`]: {
          color: i
        }
      },
      // Disabled
      [`${o}-item-disabled, ${o}-submenu-disabled`]: {
        color: `${j} !important`
      },
      // Hover
      [`${o}-item:not(${o}-item-selected):not(${o}-submenu-selected)`]: {
        [`&:hover, > ${o}-submenu-title:hover`]: {
          color: S
        }
      },
      [`&:not(${o}-horizontal)`]: {
        [`${o}-item:not(${o}-item-selected)`]: {
          "&:hover": {
            backgroundColor: $
          },
          "&:active": {
            backgroundColor: u
          }
        },
        [`${o}-submenu-title`]: {
          "&:hover": {
            backgroundColor: $
          },
          "&:active": {
            backgroundColor: u
          }
        }
      },
      // Danger - only Item has
      [`${o}-item-danger`]: {
        color: z,
        [`&${o}-item:hover`]: {
          [`&:not(${o}-item-selected):not(${o}-submenu-selected)`]: {
            color: E
          }
        },
        [`&${o}-item:active`]: {
          background: H
        }
      },
      [`${o}-item a`]: {
        "&, &:hover": {
          color: "inherit"
        }
      },
      [`${o}-item-selected`]: {
        color: i,
        // Danger
        [`&${o}-item-danger`]: {
          color: s
        },
        "a, a:hover": {
          color: "inherit"
        }
      },
      [`& ${o}-item-selected`]: {
        backgroundColor: h,
        // Danger
        [`&${o}-item-danger`]: {
          backgroundColor: T
        }
      },
      [`${o}-item, ${o}-submenu-title`]: {
        [`&:not(${o}-item-disabled):focus-visible`]: Object.assign({}, g(e))
      },
      [`&${o}-submenu > ${o}`]: {
        backgroundColor: W
      },
      [`&${o}-popup > ${o}`]: {
        backgroundColor: A
      },
      // ====================== Horizontal ======================
      [`&${o}-horizontal`]: Object.assign(Object.assign({}, r === "dark" ? {
        borderBottom: 0
      } : {}), {
        [`> ${o}-item, > ${o}-submenu`]: {
          top: l,
          marginTop: e.calc(l).mul(-1).equal(),
          marginBottom: 0,
          borderRadius: D,
          "&::after": {
            position: "absolute",
            insetInline: f,
            bottom: 0,
            borderBottom: `${c(n)} solid transparent`,
            transition: `border-color ${k} ${a}`,
            content: '""'
          },
          "&:hover, &-active, &-open": {
            background: M,
            "&::after": {
              borderBottomWidth: n,
              borderBottomColor: m
            }
          },
          "&-selected": {
            color: m,
            backgroundColor: b,
            "&:hover": {
              backgroundColor: b
            },
            "&::after": {
              borderBottomWidth: n,
              borderBottomColor: m
            }
          }
        }
      }),
      // ================== Inline & Vertical ===================
      //
      [`&${o}-root`]: {
        [`&${o}-inline, &${o}-vertical`]: {
          borderInlineEnd: `${c(l)} ${y} ${O}`
        }
      },
      // ======================== Inline ========================
      [`&${o}-inline`]: {
        // Sub
        [`${o}-sub${o}-inline`]: {
          background: C
        },
        [`${o}-item`]: {
          position: "relative",
          "&::after": {
            position: "absolute",
            insetBlock: 0,
            insetInlineEnd: 0,
            borderInlineEnd: `${c(I)} solid ${i}`,
            transform: "scaleY(0.0001)",
            opacity: 0,
            transition: [`transform ${t} ${d}`, `opacity ${t} ${d}`].join(","),
            content: '""'
          },
          // Danger
          [`&${o}-item-danger`]: {
            "&::after": {
              borderInlineEndColor: s
            }
          }
        },
        [`${o}-selected, ${o}-item-selected`]: {
          "&::after": {
            transform: "scaleY(1)",
            opacity: 1,
            transition: [`transform ${t} ${a}`, `opacity ${t} ${a}`].join(",")
          }
        }
      }
    }
  };
}, Z = R;
export {
  Z as default
};
