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));
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
import { jsx } from "react/jsx-runtime";
import styled, { css } from "styled-components";
import { media } from "@gympass/yoga-helpers";
import Menu from "./Menu";
import Switcher from "./Switcher";
import { Item, Subitem } from "./Item";
import { BottomItems, BottomItem } from "./BottomItems";
const DeskTopContainer = css`
  ${({
  theme: {
    yoga: {
      components: {
        navigationmenu: { backgroundColor, gap, padding }
      }
    }
  }
}) => css`
    position: relative;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: ${gap.medium}px;
    padding: ${padding.small}px ${padding.xsmall}px;
    background-color: ${backgroundColor.default};

    width: 280px;
    height: 100%;
    right: 0;

    transition: width 300ms ease-in-out;
  `}
`;
const StyledNavigationMenu = styled.div`
  ${({ isOpenOnMobile, isResponsive, $zIndex }) => css`
    ${DeskTopContainer};

    ${isResponsive && css`
      position: fixed;
      width: 100%;
      height: calc(100% - 56px);
      z-index: ${$zIndex != null ? $zIndex : 1};
      top: 0;
      right: ${isOpenOnMobile ? "0" : "-100%"};

      transition: right 300ms ease-in-out;

      ${media.lg`${DeskTopContainer}`}
    `}
  `}
`;
const StyledHeader = styled.header`
  ${({
  theme: {
    yoga: {
      components: {
        navigationmenu: { gap }
      }
    }
  }
}) => css`
      display: flex;
      flex-direction: column;
      gap: ${gap.xxxsmall}px;
    `}
`;
const StyledItems = styled.nav`
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow-y: auto;
`;
const StyledItemsGroup = styled.ul`
  ${({
  theme: {
    yoga: {
      components: {
        navigationmenu: { gap, padding }
      }
    }
  }
}) => css`
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0 0 ${padding.small}px 0;
    gap: ${gap.xxxsmall}px;
  `}
`;
const StyledFooter = styled.footer`
  ${({
  theme: {
    yoga: {
      components: {
        navigationmenu: { gap }
      }
    }
  }
}) => css`
    display: flex;
    flex-direction: column;
    gap: ${gap.xxxsmall}px;
  `}
`;
const NavigationMenu = (_a) => {
  var _b = _a, {
    children,
    openOnMobile = false,
    responsive = true,
    zIndex
  } = _b, htmlAttributes = __objRest(_b, [
    "children",
    "openOnMobile",
    "responsive",
    "zIndex"
  ]);
  return /* @__PURE__ */ jsx(
    StyledNavigationMenu,
    __spreadProps(__spreadValues({}, htmlAttributes), {
      isOpenOnMobile: openOnMobile,
      isResponsive: responsive,
      $zIndex: zIndex,
      children
    })
  );
};
NavigationMenu.Header = StyledHeader;
NavigationMenu.Menu = Menu;
NavigationMenu.Switcher = Switcher;
NavigationMenu.Items = StyledItems;
NavigationMenu.ItemsGroup = StyledItemsGroup;
NavigationMenu.Item = Item;
NavigationMenu.Subitem = Subitem;
NavigationMenu.BottomItems = BottomItems;
NavigationMenu.BottomItem = BottomItem;
NavigationMenu.Footer = StyledFooter;
var NavigationMenu_default = NavigationMenu;
export {
  NavigationMenu_default as default
};
