var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
import { useStyle as useAntdStyle } from "@antdv/pro-provider";
const genProLayoutBaseMenuStyle = (token, mode) => {
  var _a, _b;
  const menuToken = mode.includes("horizontal") ? (_a = token.layout) == null ? void 0 : _a.header : (_b = token.layout) == null ? void 0 : _b.sider;
  return __spreadProps(__spreadValues({
    [`${token.componentCls}`]: {
      "background": "transparent",
      "color": menuToken == null ? void 0 : menuToken.colorTextMenu,
      "border": "none",
      [`${token.componentCls}-menu-item`]: {
        transition: "none !important"
      },
      [`${token.componentCls}-submenu-has-icon`]: {
        [`> ${token.antCls}-menu-sub`]: {
          paddingInlineStart: 10
        }
      },
      [`${token.antCls}-menu-title-content`]: {
        width: "100%",
        height: "100%",
        display: "inline-flex"
      },
      [`${token.antCls}-menu-title-content`]: {
        "&:first-child": {
          width: "100%"
        }
      },
      [`${token.componentCls}-item-icon`]: {
        display: "flex",
        alignItems: "center"
      },
      [`&&-collapsed`]: {
        [`${token.antCls}-menu-item,
        ${token.antCls}-menu-item-group > ${token.antCls}-menu-item-group-list > ${token.antCls}-menu-item,
        ${token.antCls}-menu-item-group > ${token.antCls}-menu-item-group-list > ${token.antCls}-menu-submenu > ${token.antCls}-menu-submenu-title,
        ${token.antCls}-menu-submenu > ${token.antCls}-menu-submenu-title`]: {
          paddingInline: "0 !important",
          marginBlock: "4px !important"
        },
        [`${token.antCls}-menu-item-group > ${token.antCls}-menu-item-group-list > ${token.antCls}-menu-submenu-selected > ${token.antCls}-menu-submenu-title,
        ${token.antCls}-menu-submenu-selected > ${token.antCls}-menu-submenu-title`]: {
          backgroundColor: menuToken == null ? void 0 : menuToken.colorBgMenuItemSelected,
          borderRadius: token.borderRadiusLG
        },
        [`${token.componentCls}-group`]: {
          [`${token.antCls}-menu-item-group-title`]: {
            paddingInline: 0
          }
        }
      },
      "&-item-title": {
        "display": "flex",
        "flexDirection": "row",
        "alignItems": "center",
        "gap": token.marginXS,
        [`${token.componentCls}-item-text`]: {
          maxWidth: "100%",
          textOverflow: "ellipsis",
          overflow: "hidden",
          wordBreak: "break-all",
          whiteSpace: "nowrap"
        },
        "&-collapsed": {
          minWidth: 40,
          height: 40,
          [`${token.componentCls}-item-icon`]: {
            "height": "16px",
            "width": "16px",
            "lineHeight": "16px !important",
            ".anticon": {
              lineHeight: "16px !important",
              height: "16px"
            }
          },
          [`${token.componentCls}-item-text-has-icon`]: {
            display: "none !important"
          }
        },
        "&-collapsed-level-0": {
          flexDirection: "column",
          justifyContent: "center"
        },
        [`&${token.componentCls}-group-item-title`]: {
          gap: token.marginXS,
          height: 18,
          overflow: "hidden"
        },
        [`&${token.componentCls}-item-collapsed-show-title`]: {
          lineHeight: "16px",
          gap: 0,
          [`&${token.componentCls}-item-title-collapsed`]: {
            display: "flex",
            [`${token.componentCls}-item-icon`]: {
              "height": "16px",
              "width": "16px",
              "lineHeight": "16px !important",
              ".anticon": {
                lineHeight: "16px!important",
                height: "16px"
              }
            },
            [`${token.componentCls}-item-text`]: {
              opacity: "1 !important",
              display: "inline !important",
              textAlign: "center",
              fontSize: 12,
              height: 12,
              lineHeight: "12px",
              overflow: "hidden",
              textOverflow: "ellipsis",
              whiteSpace: "nowrap",
              width: "100%",
              margin: 0,
              padding: 0,
              marginBlockStart: 4
            }
          }
        }
      },
      "&-group": {
        [`${token.antCls}-menu-item-group-title`]: {
          "fontSize": 12,
          "color": token.colorTextLabel,
          ".anticon": {
            marginInlineEnd: 8
          }
        }
      },
      "&-group-divider": {
        color: token.colorTextSecondary,
        fontSize: 12,
        lineHeight: 20
      }
    }
  }, mode.includes("horizontal") ? {} : {
    [`${token.antCls}-menu-submenu${token.antCls}-menu-submenu-popup`]: {
      [`${token.componentCls}-item-title`]: {
        alignItems: "flex-start"
      }
    }
  }), {
    [`${token.antCls}-menu-submenu-popup`]: {
      "backgroundColor": "rgba(255, 255, 255, 0.42)",
      "-webkit-backdrop-filter": "blur(8px)",
      "backdropFilter": "blur(8px)"
    }
  });
};
function useStyle(prefixCls) {
  return useAntdStyle(`ProLayoutBaseMenu`, (token) => {
    return [
      genProLayoutBaseMenuStyle(__spreadProps(__spreadValues({}, token), {
        componentCls: `.${prefixCls.value}-inline`
      }), "inline"),
      genProLayoutBaseMenuStyle(__spreadProps(__spreadValues({}, token), {
        componentCls: `.${prefixCls.value}-horizontal`
      }), "horizontal"),
      genProLayoutBaseMenuStyle(__spreadProps(__spreadValues({}, token), {
        componentCls: `.${prefixCls.value}-vertical`
      }), "vertical")
    ];
  });
}
export {
  useStyle
};
