"use strict";
const jsxRuntime = require("./jsx-runtime-B6vEU3CM.js");
const React = require("react");
const reactRouterDom = require("react-router-dom");
const appbar = require("./appbar-BjvK6O9Q.js");
const identifier = require("./identifier-B8P9ZGxG.js");
const useAuth = require("./useAuth-vPRkzGjO.js");
const material = require("@mui/material");
const images = require("./images-CY-_BlWh.js");
;/* empty css                  */
const useLangauge = require("./useLangauge-DXuEM0oW.js");
const notification = require("./notification-lAbbtOBF.js");
const tick = require("./tick-BSpZzKHb.js");
const apiConfig = require("./api-config-DXwDMFn-.js");
const pathname_rental = require("./pathname.rental-C9fm1WTq.js");
function _interopNamespaceDefault(e) {
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
  if (e) {
    for (const k in e) {
      if (k !== "default") {
        const d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: () => e[k]
        });
      }
    }
  }
  n.default = e;
  return Object.freeze(n);
}
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
const _excluded$3 = ["alignItems", "autoFocus", "component", "children", "dense", "disableGutters", "divider", "focusVisibleClassName", "selected", "className"];
const overridesResolver$1 = (props, styles) => {
  const {
    ownerState
  } = props;
  return [styles.root, ownerState.dense && styles.dense, ownerState.alignItems === "flex-start" && styles.alignItemsFlexStart, ownerState.divider && styles.divider, !ownerState.disableGutters && styles.gutters];
};
const useUtilityClasses$2 = (ownerState) => {
  const {
    alignItems,
    classes,
    dense,
    disabled,
    disableGutters,
    divider,
    selected
  } = ownerState;
  const slots = {
    root: ["root", dense && "dense", !disableGutters && "gutters", divider && "divider", disabled && "disabled", alignItems === "flex-start" && "alignItemsFlexStart", selected && "selected"]
  };
  const composedClasses = notification.composeClasses(slots, appbar.getListItemButtonUtilityClass, classes);
  return identifier._extends({}, classes, composedClasses);
};
const ListItemButtonRoot = notification.styled(appbar.ButtonBase, {
  shouldForwardProp: (prop) => notification.rootShouldForwardProp(prop) || prop === "classes",
  name: "MuiListItemButton",
  slot: "Root",
  overridesResolver: overridesResolver$1
})(({
  theme,
  ownerState
}) => identifier._extends({
  display: "flex",
  flexGrow: 1,
  justifyContent: "flex-start",
  alignItems: "center",
  position: "relative",
  textDecoration: "none",
  minWidth: 0,
  boxSizing: "border-box",
  textAlign: "left",
  paddingTop: 8,
  paddingBottom: 8,
  transition: theme.transitions.create("background-color", {
    duration: theme.transitions.duration.shortest
  }),
  "&:hover": {
    textDecoration: "none",
    backgroundColor: (theme.vars || theme).palette.action.hover,
    // Reset on touch devices, it doesn't add specificity
    "@media (hover: none)": {
      backgroundColor: "transparent"
    }
  },
  [`&.${appbar.listItemButtonClasses.selected}`]: {
    backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : identifier.alpha_1(theme.palette.primary.main, theme.palette.action.selectedOpacity),
    [`&.${appbar.listItemButtonClasses.focusVisible}`]: {
      backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / calc(${theme.vars.palette.action.selectedOpacity} + ${theme.vars.palette.action.focusOpacity}))` : identifier.alpha_1(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)
    }
  },
  [`&.${appbar.listItemButtonClasses.selected}:hover`]: {
    backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / calc(${theme.vars.palette.action.selectedOpacity} + ${theme.vars.palette.action.hoverOpacity}))` : identifier.alpha_1(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity),
    // Reset on touch devices, it doesn't add specificity
    "@media (hover: none)": {
      backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : identifier.alpha_1(theme.palette.primary.main, theme.palette.action.selectedOpacity)
    }
  },
  [`&.${appbar.listItemButtonClasses.focusVisible}`]: {
    backgroundColor: (theme.vars || theme).palette.action.focus
  },
  [`&.${appbar.listItemButtonClasses.disabled}`]: {
    opacity: (theme.vars || theme).palette.action.disabledOpacity
  }
}, ownerState.divider && {
  borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`,
  backgroundClip: "padding-box"
}, ownerState.alignItems === "flex-start" && {
  alignItems: "flex-start"
}, !ownerState.disableGutters && {
  paddingLeft: 16,
  paddingRight: 16
}, ownerState.dense && {
  paddingTop: 4,
  paddingBottom: 4
}));
const ListItemButton = /* @__PURE__ */ React__namespace.forwardRef(function ListItemButton2(inProps, ref) {
  const props = identifier.useDefaultProps({
    props: inProps,
    name: "MuiListItemButton"
  });
  const {
    alignItems = "center",
    autoFocus = false,
    component = "div",
    children,
    dense = false,
    disableGutters = false,
    divider = false,
    focusVisibleClassName,
    selected = false,
    className
  } = props, other = identifier._objectWithoutPropertiesLoose(props, _excluded$3);
  const context = React__namespace.useContext(appbar.ListContext);
  const childContext = React__namespace.useMemo(() => ({
    dense: dense || context.dense || false,
    alignItems,
    disableGutters
  }), [alignItems, context.dense, dense, disableGutters]);
  const listItemRef = React__namespace.useRef(null);
  useAuth.useEnhancedEffect(() => {
    if (autoFocus) {
      if (listItemRef.current) {
        listItemRef.current.focus();
      } else if (process.env.NODE_ENV !== "production") {
        console.error("MUI: Unable to set focus to a ListItemButton whose component has not been rendered.");
      }
    }
  }, [autoFocus]);
  const ownerState = identifier._extends({}, props, {
    alignItems,
    dense: childContext.dense,
    disableGutters,
    divider,
    selected
  });
  const classes = useUtilityClasses$2(ownerState);
  const handleRef = useAuth.useForkRef(listItemRef, ref);
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(appbar.ListContext.Provider, {
    value: childContext,
    children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(ListItemButtonRoot, identifier._extends({
      ref: handleRef,
      href: other.href || other.to,
      component: (other.href || other.to) && component === "div" ? "button" : component,
      focusVisibleClassName: notification.clsx(classes.focusVisible, focusVisibleClassName),
      ownerState,
      className: notification.clsx(classes.root, className)
    }, other, {
      classes,
      children
    }))
  });
});
process.env.NODE_ENV !== "production" ? ListItemButton.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * Defines the `align-items` style property.
   * @default 'center'
   */
  alignItems: identifier.PropTypes.oneOf(["center", "flex-start"]),
  /**
   * If `true`, the list item is focused during the first mount.
   * Focus will also be triggered if the value changes from false to true.
   * @default false
   */
  autoFocus: identifier.PropTypes.bool,
  /**
   * The content of the component if a `ListItemSecondaryAction` is used it must
   * be the last child.
   */
  children: identifier.PropTypes.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: identifier.PropTypes.object,
  /**
   * @ignore
   */
  className: identifier.PropTypes.string,
  /**
   * The component used for the root node.
   * Either a string to use a HTML element or a component.
   */
  component: identifier.PropTypes.elementType,
  /**
   * If `true`, compact vertical padding designed for keyboard and mouse input is used.
   * The prop defaults to the value inherited from the parent List component.
   * @default false
   */
  dense: identifier.PropTypes.bool,
  /**
   * If `true`, the component is disabled.
   * @default false
   */
  disabled: identifier.PropTypes.bool,
  /**
   * If `true`, the left and right padding is removed.
   * @default false
   */
  disableGutters: identifier.PropTypes.bool,
  /**
   * If `true`, a 1px light border is added to the bottom of the list item.
   * @default false
   */
  divider: identifier.PropTypes.bool,
  /**
   * This prop can help identify which element has keyboard focus.
   * The class name will be applied when the element gains the focus through keyboard interaction.
   * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
   * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
   * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
   * if needed.
   */
  focusVisibleClassName: identifier.PropTypes.string,
  /**
   * @ignore
   */
  href: identifier.PropTypes.string,
  /**
   * Use to apply selected styling.
   * @default false
   */
  selected: identifier.PropTypes.bool,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: identifier.PropTypes.oneOfType([identifier.PropTypes.arrayOf(identifier.PropTypes.oneOfType([identifier.PropTypes.func, identifier.PropTypes.object, identifier.PropTypes.bool])), identifier.PropTypes.func, identifier.PropTypes.object])
} : void 0;
function getCollapseUtilityClass(slot) {
  return identifier.generateUtilityClass("MuiCollapse", slot);
}
notification.generateUtilityClasses("MuiCollapse", ["root", "horizontal", "vertical", "entered", "hidden", "wrapper", "wrapperInner"]);
const _excluded$2 = ["addEndListener", "children", "className", "collapsedSize", "component", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "orientation", "style", "timeout", "TransitionComponent"];
const useUtilityClasses$1 = (ownerState) => {
  const {
    orientation,
    classes
  } = ownerState;
  const slots = {
    root: ["root", `${orientation}`],
    entered: ["entered"],
    hidden: ["hidden"],
    wrapper: ["wrapper", `${orientation}`],
    wrapperInner: ["wrapperInner", `${orientation}`]
  };
  return notification.composeClasses(slots, getCollapseUtilityClass, classes);
};
const CollapseRoot = notification.styled("div", {
  name: "MuiCollapse",
  slot: "Root",
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.root, styles[ownerState.orientation], ownerState.state === "entered" && styles.entered, ownerState.state === "exited" && !ownerState.in && ownerState.collapsedSize === "0px" && styles.hidden];
  }
})(({
  theme,
  ownerState
}) => identifier._extends({
  height: 0,
  overflow: "hidden",
  transition: theme.transitions.create("height")
}, ownerState.orientation === "horizontal" && {
  height: "auto",
  width: 0,
  transition: theme.transitions.create("width")
}, ownerState.state === "entered" && identifier._extends({
  height: "auto",
  overflow: "visible"
}, ownerState.orientation === "horizontal" && {
  width: "auto"
}), ownerState.state === "exited" && !ownerState.in && ownerState.collapsedSize === "0px" && {
  visibility: "hidden"
}));
const CollapseWrapper = notification.styled("div", {
  name: "MuiCollapse",
  slot: "Wrapper",
  overridesResolver: (props, styles) => styles.wrapper
})(({
  ownerState
}) => identifier._extends({
  // Hack to get children with a negative margin to not falsify the height computation.
  display: "flex",
  width: "100%"
}, ownerState.orientation === "horizontal" && {
  width: "auto",
  height: "100%"
}));
const CollapseWrapperInner = notification.styled("div", {
  name: "MuiCollapse",
  slot: "WrapperInner",
  overridesResolver: (props, styles) => styles.wrapperInner
})(({
  ownerState
}) => identifier._extends({
  width: "100%"
}, ownerState.orientation === "horizontal" && {
  width: "auto",
  height: "100%"
}));
const Collapse = /* @__PURE__ */ React__namespace.forwardRef(function Collapse2(inProps, ref) {
  const props = identifier.useDefaultProps({
    props: inProps,
    name: "MuiCollapse"
  });
  const {
    addEndListener,
    children,
    className,
    collapsedSize: collapsedSizeProp = "0px",
    component,
    easing,
    in: inProp,
    onEnter,
    onEntered,
    onEntering,
    onExit,
    onExited,
    onExiting,
    orientation = "vertical",
    style,
    timeout = identifier.duration.standard,
    // eslint-disable-next-line react/prop-types
    TransitionComponent = appbar.Transition
  } = props, other = identifier._objectWithoutPropertiesLoose(props, _excluded$2);
  const ownerState = identifier._extends({}, props, {
    orientation,
    collapsedSize: collapsedSizeProp
  });
  const classes = useUtilityClasses$1(ownerState);
  const theme = appbar.useTheme();
  const timer = useAuth.useTimeout();
  const wrapperRef = React__namespace.useRef(null);
  const autoTransitionDuration = React__namespace.useRef();
  const collapsedSize = typeof collapsedSizeProp === "number" ? `${collapsedSizeProp}px` : collapsedSizeProp;
  const isHorizontal2 = orientation === "horizontal";
  const size = isHorizontal2 ? "width" : "height";
  const nodeRef = React__namespace.useRef(null);
  const handleRef = useAuth.useForkRef(ref, nodeRef);
  const normalizedTransitionCallback = (callback) => (maybeIsAppearing) => {
    if (callback) {
      const node = nodeRef.current;
      if (maybeIsAppearing === void 0) {
        callback(node);
      } else {
        callback(node, maybeIsAppearing);
      }
    }
  };
  const getWrapperSize = () => wrapperRef.current ? wrapperRef.current[isHorizontal2 ? "clientWidth" : "clientHeight"] : 0;
  const handleEnter = normalizedTransitionCallback((node, isAppearing) => {
    if (wrapperRef.current && isHorizontal2) {
      wrapperRef.current.style.position = "absolute";
    }
    node.style[size] = collapsedSize;
    if (onEnter) {
      onEnter(node, isAppearing);
    }
  });
  const handleEntering = normalizedTransitionCallback((node, isAppearing) => {
    const wrapperSize = getWrapperSize();
    if (wrapperRef.current && isHorizontal2) {
      wrapperRef.current.style.position = "";
    }
    const {
      duration: transitionDuration,
      easing: transitionTimingFunction
    } = appbar.getTransitionProps({
      style,
      timeout,
      easing
    }, {
      mode: "enter"
    });
    if (timeout === "auto") {
      const duration2 = theme.transitions.getAutoHeightDuration(wrapperSize);
      node.style.transitionDuration = `${duration2}ms`;
      autoTransitionDuration.current = duration2;
    } else {
      node.style.transitionDuration = typeof transitionDuration === "string" ? transitionDuration : `${transitionDuration}ms`;
    }
    node.style[size] = `${wrapperSize}px`;
    node.style.transitionTimingFunction = transitionTimingFunction;
    if (onEntering) {
      onEntering(node, isAppearing);
    }
  });
  const handleEntered = normalizedTransitionCallback((node, isAppearing) => {
    node.style[size] = "auto";
    if (onEntered) {
      onEntered(node, isAppearing);
    }
  });
  const handleExit = normalizedTransitionCallback((node) => {
    node.style[size] = `${getWrapperSize()}px`;
    if (onExit) {
      onExit(node);
    }
  });
  const handleExited = normalizedTransitionCallback(onExited);
  const handleExiting = normalizedTransitionCallback((node) => {
    const wrapperSize = getWrapperSize();
    const {
      duration: transitionDuration,
      easing: transitionTimingFunction
    } = appbar.getTransitionProps({
      style,
      timeout,
      easing
    }, {
      mode: "exit"
    });
    if (timeout === "auto") {
      const duration2 = theme.transitions.getAutoHeightDuration(wrapperSize);
      node.style.transitionDuration = `${duration2}ms`;
      autoTransitionDuration.current = duration2;
    } else {
      node.style.transitionDuration = typeof transitionDuration === "string" ? transitionDuration : `${transitionDuration}ms`;
    }
    node.style[size] = collapsedSize;
    node.style.transitionTimingFunction = transitionTimingFunction;
    if (onExiting) {
      onExiting(node);
    }
  });
  const handleAddEndListener = (next) => {
    if (timeout === "auto") {
      timer.start(autoTransitionDuration.current || 0, next);
    }
    if (addEndListener) {
      addEndListener(nodeRef.current, next);
    }
  };
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(TransitionComponent, identifier._extends({
    in: inProp,
    onEnter: handleEnter,
    onEntered: handleEntered,
    onEntering: handleEntering,
    onExit: handleExit,
    onExited: handleExited,
    onExiting: handleExiting,
    addEndListener: handleAddEndListener,
    nodeRef,
    timeout: timeout === "auto" ? null : timeout
  }, other, {
    children: (state, childProps) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(CollapseRoot, identifier._extends({
      as: component,
      className: notification.clsx(classes.root, className, {
        "entered": classes.entered,
        "exited": !inProp && collapsedSize === "0px" && classes.hidden
      }[state]),
      style: identifier._extends({
        [isHorizontal2 ? "minWidth" : "minHeight"]: collapsedSize
      }, style),
      ref: handleRef
    }, childProps, {
      // `ownerState` is set after `childProps` to override any existing `ownerState` property in `childProps`
      // that might have been forwarded from the Transition component.
      ownerState: identifier._extends({}, ownerState, {
        state
      }),
      children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(CollapseWrapper, {
        ownerState: identifier._extends({}, ownerState, {
          state
        }),
        className: classes.wrapper,
        ref: wrapperRef,
        children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(CollapseWrapperInner, {
          ownerState: identifier._extends({}, ownerState, {
            state
          }),
          className: classes.wrapperInner,
          children
        })
      })
    }))
  }));
});
process.env.NODE_ENV !== "production" ? Collapse.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * Add a custom transition end trigger. Called with the transitioning DOM
   * node and a done callback. Allows for more fine grained transition end
   * logic. Note: Timeouts are still used as a fallback if provided.
   */
  addEndListener: identifier.PropTypes.func,
  /**
   * The content node to be collapsed.
   */
  children: identifier.PropTypes.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: identifier.PropTypes.object,
  /**
   * @ignore
   */
  className: identifier.PropTypes.string,
  /**
   * The width (horizontal) or height (vertical) of the container when collapsed.
   * @default '0px'
   */
  collapsedSize: identifier.PropTypes.oneOfType([identifier.PropTypes.number, identifier.PropTypes.string]),
  /**
   * The component used for the root node.
   * Either a string to use a HTML element or a component.
   */
  component: appbar.elementTypeAcceptingRef,
  /**
   * The transition timing function.
   * You may specify a single easing or a object containing enter and exit values.
   */
  easing: identifier.PropTypes.oneOfType([identifier.PropTypes.shape({
    enter: identifier.PropTypes.string,
    exit: identifier.PropTypes.string
  }), identifier.PropTypes.string]),
  /**
   * If `true`, the component will transition in.
   */
  in: identifier.PropTypes.bool,
  /**
   * @ignore
   */
  onEnter: identifier.PropTypes.func,
  /**
   * @ignore
   */
  onEntered: identifier.PropTypes.func,
  /**
   * @ignore
   */
  onEntering: identifier.PropTypes.func,
  /**
   * @ignore
   */
  onExit: identifier.PropTypes.func,
  /**
   * @ignore
   */
  onExited: identifier.PropTypes.func,
  /**
   * @ignore
   */
  onExiting: identifier.PropTypes.func,
  /**
   * The transition orientation.
   * @default 'vertical'
   */
  orientation: identifier.PropTypes.oneOf(["horizontal", "vertical"]),
  /**
   * @ignore
   */
  style: identifier.PropTypes.object,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: identifier.PropTypes.oneOfType([identifier.PropTypes.arrayOf(identifier.PropTypes.oneOfType([identifier.PropTypes.func, identifier.PropTypes.object, identifier.PropTypes.bool])), identifier.PropTypes.func, identifier.PropTypes.object]),
  /**
   * The duration for the transition, in milliseconds.
   * You may specify a single timeout for all transitions, or individually with an object.
   *
   * Set to 'auto' to automatically calculate transition time based on height.
   * @default duration.standard
   */
  timeout: identifier.PropTypes.oneOfType([identifier.PropTypes.oneOf(["auto"]), identifier.PropTypes.number, identifier.PropTypes.shape({
    appear: identifier.PropTypes.number,
    enter: identifier.PropTypes.number,
    exit: identifier.PropTypes.number
  })])
} : void 0;
Collapse.muiSupportAuto = true;
const _excluded$1 = ["addEndListener", "appear", "children", "container", "direction", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];
function getTranslateValue(direction, node, resolvedContainer) {
  const rect = node.getBoundingClientRect();
  const containerRect = resolvedContainer && resolvedContainer.getBoundingClientRect();
  const containerWindow = useAuth.ownerWindow(node);
  let transform;
  if (node.fakeTransform) {
    transform = node.fakeTransform;
  } else {
    const computedStyle = containerWindow.getComputedStyle(node);
    transform = computedStyle.getPropertyValue("-webkit-transform") || computedStyle.getPropertyValue("transform");
  }
  let offsetX = 0;
  let offsetY = 0;
  if (transform && transform !== "none" && typeof transform === "string") {
    const transformValues = transform.split("(")[1].split(")")[0].split(",");
    offsetX = parseInt(transformValues[4], 10);
    offsetY = parseInt(transformValues[5], 10);
  }
  if (direction === "left") {
    if (containerRect) {
      return `translateX(${containerRect.right + offsetX - rect.left}px)`;
    }
    return `translateX(${containerWindow.innerWidth + offsetX - rect.left}px)`;
  }
  if (direction === "right") {
    if (containerRect) {
      return `translateX(-${rect.right - containerRect.left - offsetX}px)`;
    }
    return `translateX(-${rect.left + rect.width - offsetX}px)`;
  }
  if (direction === "up") {
    if (containerRect) {
      return `translateY(${containerRect.bottom + offsetY - rect.top}px)`;
    }
    return `translateY(${containerWindow.innerHeight + offsetY - rect.top}px)`;
  }
  if (containerRect) {
    return `translateY(-${rect.top - containerRect.top + rect.height - offsetY}px)`;
  }
  return `translateY(-${rect.top + rect.height - offsetY}px)`;
}
function resolveContainer(containerPropProp) {
  return typeof containerPropProp === "function" ? containerPropProp() : containerPropProp;
}
function setTranslateValue(direction, node, containerProp) {
  const resolvedContainer = resolveContainer(containerProp);
  const transform = getTranslateValue(direction, node, resolvedContainer);
  if (transform) {
    node.style.webkitTransform = transform;
    node.style.transform = transform;
  }
}
const Slide = /* @__PURE__ */ React__namespace.forwardRef(function Slide2(props, ref) {
  const theme = appbar.useTheme();
  const defaultEasing = {
    enter: theme.transitions.easing.easeOut,
    exit: theme.transitions.easing.sharp
  };
  const defaultTimeout = {
    enter: theme.transitions.duration.enteringScreen,
    exit: theme.transitions.duration.leavingScreen
  };
  const {
    addEndListener,
    appear = true,
    children,
    container: containerProp,
    direction = "down",
    easing: easingProp = defaultEasing,
    in: inProp,
    onEnter,
    onEntered,
    onEntering,
    onExit,
    onExited,
    onExiting,
    style,
    timeout = defaultTimeout,
    // eslint-disable-next-line react/prop-types
    TransitionComponent = appbar.Transition
  } = props, other = identifier._objectWithoutPropertiesLoose(props, _excluded$1);
  const childrenRef = React__namespace.useRef(null);
  const handleRef = useAuth.useForkRef(appbar.getReactElementRef(children), childrenRef, ref);
  const normalizedTransitionCallback = (callback) => (isAppearing) => {
    if (callback) {
      if (isAppearing === void 0) {
        callback(childrenRef.current);
      } else {
        callback(childrenRef.current, isAppearing);
      }
    }
  };
  const handleEnter = normalizedTransitionCallback((node, isAppearing) => {
    setTranslateValue(direction, node, containerProp);
    appbar.reflow(node);
    if (onEnter) {
      onEnter(node, isAppearing);
    }
  });
  const handleEntering = normalizedTransitionCallback((node, isAppearing) => {
    const transitionProps = appbar.getTransitionProps({
      timeout,
      style,
      easing: easingProp
    }, {
      mode: "enter"
    });
    node.style.webkitTransition = theme.transitions.create("-webkit-transform", identifier._extends({}, transitionProps));
    node.style.transition = theme.transitions.create("transform", identifier._extends({}, transitionProps));
    node.style.webkitTransform = "none";
    node.style.transform = "none";
    if (onEntering) {
      onEntering(node, isAppearing);
    }
  });
  const handleEntered = normalizedTransitionCallback(onEntered);
  const handleExiting = normalizedTransitionCallback(onExiting);
  const handleExit = normalizedTransitionCallback((node) => {
    const transitionProps = appbar.getTransitionProps({
      timeout,
      style,
      easing: easingProp
    }, {
      mode: "exit"
    });
    node.style.webkitTransition = theme.transitions.create("-webkit-transform", transitionProps);
    node.style.transition = theme.transitions.create("transform", transitionProps);
    setTranslateValue(direction, node, containerProp);
    if (onExit) {
      onExit(node);
    }
  });
  const handleExited = normalizedTransitionCallback((node) => {
    node.style.webkitTransition = "";
    node.style.transition = "";
    if (onExited) {
      onExited(node);
    }
  });
  const handleAddEndListener = (next) => {
    if (addEndListener) {
      addEndListener(childrenRef.current, next);
    }
  };
  const updatePosition = React__namespace.useCallback(() => {
    if (childrenRef.current) {
      setTranslateValue(direction, childrenRef.current, containerProp);
    }
  }, [direction, containerProp]);
  React__namespace.useEffect(() => {
    if (inProp || direction === "down" || direction === "right") {
      return void 0;
    }
    const handleResize = useAuth.debounce(() => {
      if (childrenRef.current) {
        setTranslateValue(direction, childrenRef.current, containerProp);
      }
    });
    const containerWindow = useAuth.ownerWindow(childrenRef.current);
    containerWindow.addEventListener("resize", handleResize);
    return () => {
      handleResize.clear();
      containerWindow.removeEventListener("resize", handleResize);
    };
  }, [direction, inProp, containerProp]);
  React__namespace.useEffect(() => {
    if (!inProp) {
      updatePosition();
    }
  }, [inProp, updatePosition]);
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(TransitionComponent, identifier._extends({
    nodeRef: childrenRef,
    onEnter: handleEnter,
    onEntered: handleEntered,
    onEntering: handleEntering,
    onExit: handleExit,
    onExited: handleExited,
    onExiting: handleExiting,
    addEndListener: handleAddEndListener,
    appear,
    in: inProp,
    timeout
  }, other, {
    children: (state, childProps) => {
      return /* @__PURE__ */ React__namespace.cloneElement(children, identifier._extends({
        ref: handleRef,
        style: identifier._extends({
          visibility: state === "exited" && !inProp ? "hidden" : void 0
        }, style, children.props.style)
      }, childProps));
    }
  }));
});
process.env.NODE_ENV !== "production" ? Slide.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * Add a custom transition end trigger. Called with the transitioning DOM
   * node and a done callback. Allows for more fine grained transition end
   * logic. Note: Timeouts are still used as a fallback if provided.
   */
  addEndListener: identifier.PropTypes.func,
  /**
   * Perform the enter transition when it first mounts if `in` is also `true`.
   * Set this to `false` to disable this behavior.
   * @default true
   */
  appear: identifier.PropTypes.bool,
  /**
   * A single child content element.
   */
  children: appbar.elementAcceptingRef.isRequired,
  /**
   * An HTML element, or a function that returns one.
   * It's used to set the container the Slide is transitioning from.
   */
  container: appbar.chainPropTypes(identifier.PropTypes.oneOfType([appbar.HTMLElementType, identifier.PropTypes.func]), (props) => {
    if (props.open) {
      const resolvedContainer = resolveContainer(props.container);
      if (resolvedContainer && resolvedContainer.nodeType === 1) {
        const box = resolvedContainer.getBoundingClientRect();
        if (process.env.NODE_ENV !== "test" && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
          return new Error(["MUI: The `container` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join("\n"));
        }
      } else if (!resolvedContainer || typeof resolvedContainer.getBoundingClientRect !== "function" || resolvedContainer.contextElement != null && resolvedContainer.contextElement.nodeType !== 1) {
        return new Error(["MUI: The `container` prop provided to the component is invalid.", "It should be an HTML element instance."].join("\n"));
      }
    }
    return null;
  }),
  /**
   * Direction the child node will enter from.
   * @default 'down'
   */
  direction: identifier.PropTypes.oneOf(["down", "left", "right", "up"]),
  /**
   * The transition timing function.
   * You may specify a single easing or a object containing enter and exit values.
   * @default {
   *   enter: theme.transitions.easing.easeOut,
   *   exit: theme.transitions.easing.sharp,
   * }
   */
  easing: identifier.PropTypes.oneOfType([identifier.PropTypes.shape({
    enter: identifier.PropTypes.string,
    exit: identifier.PropTypes.string
  }), identifier.PropTypes.string]),
  /**
   * If `true`, the component will transition in.
   */
  in: identifier.PropTypes.bool,
  /**
   * @ignore
   */
  onEnter: identifier.PropTypes.func,
  /**
   * @ignore
   */
  onEntered: identifier.PropTypes.func,
  /**
   * @ignore
   */
  onEntering: identifier.PropTypes.func,
  /**
   * @ignore
   */
  onExit: identifier.PropTypes.func,
  /**
   * @ignore
   */
  onExited: identifier.PropTypes.func,
  /**
   * @ignore
   */
  onExiting: identifier.PropTypes.func,
  /**
   * @ignore
   */
  style: identifier.PropTypes.object,
  /**
   * The duration for the transition, in milliseconds.
   * You may specify a single timeout for all transitions, or individually with an object.
   * @default {
   *   enter: theme.transitions.duration.enteringScreen,
   *   exit: theme.transitions.duration.leavingScreen,
   * }
   */
  timeout: identifier.PropTypes.oneOfType([identifier.PropTypes.number, identifier.PropTypes.shape({
    appear: identifier.PropTypes.number,
    enter: identifier.PropTypes.number,
    exit: identifier.PropTypes.number
  })])
} : void 0;
function getDrawerUtilityClass(slot) {
  return identifier.generateUtilityClass("MuiDrawer", slot);
}
notification.generateUtilityClasses("MuiDrawer", ["root", "docked", "paper", "paperAnchorLeft", "paperAnchorRight", "paperAnchorTop", "paperAnchorBottom", "paperAnchorDockedLeft", "paperAnchorDockedRight", "paperAnchorDockedTop", "paperAnchorDockedBottom", "modal"]);
const _excluded = ["BackdropProps"], _excluded2 = ["anchor", "BackdropProps", "children", "className", "elevation", "hideBackdrop", "ModalProps", "onClose", "open", "PaperProps", "SlideProps", "TransitionComponent", "transitionDuration", "variant"];
const overridesResolver = (props, styles) => {
  const {
    ownerState
  } = props;
  return [styles.root, (ownerState.variant === "permanent" || ownerState.variant === "persistent") && styles.docked, styles.modal];
};
const useUtilityClasses = (ownerState) => {
  const {
    classes,
    anchor,
    variant
  } = ownerState;
  const slots = {
    root: ["root"],
    docked: [(variant === "permanent" || variant === "persistent") && "docked"],
    modal: ["modal"],
    paper: ["paper", `paperAnchor${identifier.capitalize(anchor)}`, variant !== "temporary" && `paperAnchorDocked${identifier.capitalize(anchor)}`]
  };
  return notification.composeClasses(slots, getDrawerUtilityClass, classes);
};
const DrawerRoot = notification.styled(appbar.Modal$1, {
  name: "MuiDrawer",
  slot: "Root",
  overridesResolver
})(({
  theme
}) => ({
  zIndex: (theme.vars || theme).zIndex.drawer
}));
const DrawerDockedRoot = notification.styled("div", {
  shouldForwardProp: notification.rootShouldForwardProp,
  name: "MuiDrawer",
  slot: "Docked",
  skipVariantsResolver: false,
  overridesResolver
})({
  flex: "0 0 auto"
});
const DrawerPaper = notification.styled(appbar.Paper, {
  name: "MuiDrawer",
  slot: "Paper",
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.paper, styles[`paperAnchor${identifier.capitalize(ownerState.anchor)}`], ownerState.variant !== "temporary" && styles[`paperAnchorDocked${identifier.capitalize(ownerState.anchor)}`]];
  }
})(({
  theme,
  ownerState
}) => identifier._extends({
  overflowY: "auto",
  display: "flex",
  flexDirection: "column",
  height: "100%",
  flex: "1 0 auto",
  zIndex: (theme.vars || theme).zIndex.drawer,
  // Add iOS momentum scrolling for iOS < 13.0
  WebkitOverflowScrolling: "touch",
  // temporary style
  position: "fixed",
  top: 0,
  // We disable the focus ring for mouse, touch and keyboard users.
  // At some point, it would be better to keep it for keyboard users.
  // :focus-ring CSS pseudo-class will help.
  outline: 0
}, ownerState.anchor === "left" && {
  left: 0
}, ownerState.anchor === "top" && {
  top: 0,
  left: 0,
  right: 0,
  height: "auto",
  maxHeight: "100%"
}, ownerState.anchor === "right" && {
  right: 0
}, ownerState.anchor === "bottom" && {
  top: "auto",
  left: 0,
  bottom: 0,
  right: 0,
  height: "auto",
  maxHeight: "100%"
}, ownerState.anchor === "left" && ownerState.variant !== "temporary" && {
  borderRight: `1px solid ${(theme.vars || theme).palette.divider}`
}, ownerState.anchor === "top" && ownerState.variant !== "temporary" && {
  borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
}, ownerState.anchor === "right" && ownerState.variant !== "temporary" && {
  borderLeft: `1px solid ${(theme.vars || theme).palette.divider}`
}, ownerState.anchor === "bottom" && ownerState.variant !== "temporary" && {
  borderTop: `1px solid ${(theme.vars || theme).palette.divider}`
}));
const oppositeDirection = {
  left: "right",
  right: "left",
  top: "down",
  bottom: "up"
};
function isHorizontal(anchor) {
  return ["left", "right"].indexOf(anchor) !== -1;
}
function getAnchor({
  direction
}, anchor) {
  return direction === "rtl" && isHorizontal(anchor) ? oppositeDirection[anchor] : anchor;
}
const Drawer$1 = /* @__PURE__ */ React__namespace.forwardRef(function Drawer(inProps, ref) {
  const props = identifier.useDefaultProps({
    props: inProps,
    name: "MuiDrawer"
  });
  const theme = appbar.useTheme();
  const isRtl = appbar.useRtl();
  const defaultTransitionDuration = {
    enter: theme.transitions.duration.enteringScreen,
    exit: theme.transitions.duration.leavingScreen
  };
  const {
    anchor: anchorProp = "left",
    BackdropProps,
    children,
    className,
    elevation = 16,
    hideBackdrop = false,
    ModalProps: {
      BackdropProps: BackdropPropsProp
    } = {},
    onClose,
    open = false,
    PaperProps = {},
    SlideProps,
    // eslint-disable-next-line react/prop-types
    TransitionComponent = Slide,
    transitionDuration = defaultTransitionDuration,
    variant = "temporary"
  } = props, ModalProps = identifier._objectWithoutPropertiesLoose(props.ModalProps, _excluded), other = identifier._objectWithoutPropertiesLoose(props, _excluded2);
  const mounted = React__namespace.useRef(false);
  React__namespace.useEffect(() => {
    mounted.current = true;
  }, []);
  const anchorInvariant = getAnchor({
    direction: isRtl ? "rtl" : "ltr"
  }, anchorProp);
  const anchor = anchorProp;
  const ownerState = identifier._extends({}, props, {
    anchor,
    elevation,
    open,
    variant
  }, other);
  const classes = useUtilityClasses(ownerState);
  const drawer = /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(DrawerPaper, identifier._extends({
    elevation: variant === "temporary" ? elevation : 0,
    square: true
  }, PaperProps, {
    className: notification.clsx(classes.paper, PaperProps.className),
    ownerState,
    children
  }));
  if (variant === "permanent") {
    return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(DrawerDockedRoot, identifier._extends({
      className: notification.clsx(classes.root, classes.docked, className),
      ownerState,
      ref
    }, other, {
      children: drawer
    }));
  }
  const slidingDrawer = /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(TransitionComponent, identifier._extends({
    in: open,
    direction: oppositeDirection[anchorInvariant],
    timeout: transitionDuration,
    appear: mounted.current
  }, SlideProps, {
    children: drawer
  }));
  if (variant === "persistent") {
    return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(DrawerDockedRoot, identifier._extends({
      className: notification.clsx(classes.root, classes.docked, className),
      ownerState,
      ref
    }, other, {
      children: slidingDrawer
    }));
  }
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(DrawerRoot, identifier._extends({
    BackdropProps: identifier._extends({}, BackdropProps, BackdropPropsProp, {
      transitionDuration
    }),
    className: notification.clsx(classes.root, classes.modal, className),
    open,
    ownerState,
    onClose,
    hideBackdrop,
    ref
  }, other, ModalProps, {
    children: slidingDrawer
  }));
});
process.env.NODE_ENV !== "production" ? Drawer$1.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * Side from which the drawer will appear.
   * @default 'left'
   */
  anchor: identifier.PropTypes.oneOf(["bottom", "left", "right", "top"]),
  /**
   * @ignore
   */
  BackdropProps: identifier.PropTypes.object,
  /**
   * The content of the component.
   */
  children: identifier.PropTypes.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: identifier.PropTypes.object,
  /**
   * @ignore
   */
  className: identifier.PropTypes.string,
  /**
   * The elevation of the drawer.
   * @default 16
   */
  elevation: appbar.integerPropType,
  /**
   * If `true`, the backdrop is not rendered.
   * @default false
   */
  hideBackdrop: identifier.PropTypes.bool,
  /**
   * Props applied to the [`Modal`](/material-ui/api/modal/) element.
   * @default {}
   */
  ModalProps: identifier.PropTypes.object,
  /**
   * Callback fired when the component requests to be closed.
   * The `reason` parameter can optionally be used to control the response to `onClose`.
   *
   * @param {object} event The event source of the callback.
   * @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`.
   */
  onClose: identifier.PropTypes.func,
  /**
   * If `true`, the component is shown.
   * @default false
   */
  open: identifier.PropTypes.bool,
  /**
   * Props applied to the [`Paper`](/material-ui/api/paper/) element.
   * @default {}
   */
  PaperProps: identifier.PropTypes.object,
  /**
   * Props applied to the [`Slide`](/material-ui/api/slide/) element.
   */
  SlideProps: identifier.PropTypes.object,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: identifier.PropTypes.oneOfType([identifier.PropTypes.arrayOf(identifier.PropTypes.oneOfType([identifier.PropTypes.func, identifier.PropTypes.object, identifier.PropTypes.bool])), identifier.PropTypes.func, identifier.PropTypes.object]),
  /**
   * The duration for the transition, in milliseconds.
   * You may specify a single timeout for all transitions, or individually with an object.
   * @default {
   *   enter: theme.transitions.duration.enteringScreen,
   *   exit: theme.transitions.duration.leavingScreen,
   * }
   */
  transitionDuration: identifier.PropTypes.oneOfType([identifier.PropTypes.number, identifier.PropTypes.shape({
    appear: identifier.PropTypes.number,
    enter: identifier.PropTypes.number,
    exit: identifier.PropTypes.number
  })]),
  /**
   * The variant to use.
   * @default 'temporary'
   */
  variant: identifier.PropTypes.oneOf(["permanent", "persistent", "temporary"])
} : void 0;
var ExpandLess = {};
var _interopRequireDefault = identifier.interopRequireDefaultExports;
Object.defineProperty(ExpandLess, "__esModule", {
  value: true
});
var default_1 = ExpandLess.default = void 0;
var _createSvgIcon = _interopRequireDefault(useAuth.requireCreateSvgIcon());
var _jsxRuntime = jsxRuntime.jsxRuntimeExports;
default_1 = ExpandLess.default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
  d: "m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"
}), "ExpandLess");
const DynamicSvgIcon = ({
  svgPath,
  sx = {},
  color = "inherit",
  fontSize = "medium",
  ...props
}) => {
  const [svgContent, setSvgContent] = React.useState(null);
  const [loading, setLoading] = React.useState(true);
  const [error, setError] = React.useState(false);
  const theme = material.useTheme();
  const getColorValue = (colorProp) => {
    if (colorProp === "inherit") return "currentColor";
    if (colorProp === "primary") return theme.palette.primary.main;
    if (colorProp === "secondary") return theme.palette.secondary.main;
    if (colorProp === "action") return theme.palette.action.active;
    if (colorProp === "disabled") return theme.palette.action.disabled;
    if (colorProp === "error") return theme.palette.error.main;
    if (colorProp === "info") return theme.palette.info.main;
    if (colorProp === "success") return theme.palette.success.main;
    if (colorProp === "warning") return theme.palette.warning.main;
    if (colorProp === "grey") return theme.palette.grey.main;
    return colorProp;
  };
  const actualColor = getColorValue(color);
  React.useEffect(() => {
    if (!svgPath) return;
    const fetchSvg = async () => {
      try {
        setLoading(true);
        setError(false);
        const response = await fetch(svgPath);
        if (!response.ok) throw new Error("Failed to fetch SVG");
        const svgText = await response.text();
        setSvgContent(svgText);
      } catch (err) {
        console.error("Error loading SVG:", err);
        setError(true);
      } finally {
        setLoading(false);
      }
    };
    fetchSvg();
  }, [svgPath]);
  const svgElements = React.useMemo(() => {
    if (!svgContent) return null;
    try {
      const parser = new DOMParser();
      const svgDoc = parser.parseFromString(svgContent, "image/svg+xml");
      const svgElement = svgDoc.querySelector("svg");
      if (!svgElement) return null;
      const convertToReactElement = (element, index = 0) => {
        const tagName = element.tagName.toLowerCase();
        const props2 = {};
        Array.from(element.attributes).forEach((attr) => {
          let propName = attr.name;
          if (propName === "class") propName = "className";
          if (propName.includes("-")) {
            propName = propName.replace(/-([a-z])/g, (match, letter) => letter.toUpperCase());
          }
          let propValue = attr.value;
          if (actualColor && actualColor !== "currentColor") {
            if (propName === "fill" && propValue !== "none") {
              propValue = actualColor;
            }
            if (propName === "stroke" && propValue !== "none") {
              propValue = actualColor;
            }
          }
          props2[propName] = propValue;
        });
        props2.key = index;
        const children = Array.from(element.children).map(
          (child, childIndex) => convertToReactElement(child, `${index}-${childIndex}`)
        );
        if (element.childNodes.length === 1 && element.childNodes[0].nodeType === 3) {
          children.push(element.textContent);
        }
        return React.createElement(tagName, props2, children.length > 0 ? children : null);
      };
      return Array.from(svgElement.children).map(
        (child, index) => convertToReactElement(child, index)
      );
    } catch (err) {
      console.error("Error parsing SVG:", err);
      return null;
    }
  }, [svgContent, actualColor]);
  if (loading) {
    return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
      notification.SvgIcon,
      {
        sx: {
          width: 24,
          height: 24,
          ...sx
        },
        color,
        fontSize,
        ...props,
        children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "8", fill: "currentColor", opacity: "0.3" })
      }
    );
  }
  if (error || !svgElements) {
    return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
      notification.SvgIcon,
      {
        sx: {
          width: 24,
          height: 24,
          ...sx
        },
        color,
        fontSize,
        ...props,
        children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" })
      }
    );
  }
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
    notification.SvgIcon,
    {
      sx: {
        color: actualColor,
        fill: "none",
        ...sx
      },
      fontSize,
      fontWeight: 500,
      viewBox: "0 0 16 16",
      ...props,
      children: svgElements
    }
  );
};
let drawerWidth;
const openedMixin = (theme) => {
  var _a, _b;
  return {
    width: drawerWidth,
    transition: theme.transitions.create("width", {
      easing: theme.transitions.easing.sharp,
      duration: theme.transitions.duration.enteringScreen
    }),
    overflowX: "hidden",
    display: "flex",
    flexDirection: "column",
    justifyContent: "space-between",
    borderRight: `1px solid ${(_a = theme.palette.theme) == null ? void 0 : _a.secondary[200]}`,
    backgroundColor: (_b = theme.palette.theme) == null ? void 0 : _b.secondary[100]
  };
};
const closedMixin = (theme) => {
  var _a, _b;
  return {
    transition: theme.transitions.create("width", {
      easing: theme.transitions.easing.sharp,
      duration: theme.transitions.duration.leavingScreen
    }),
    overflowX: "hidden",
    width: `calc(${theme.spacing(7)} + 1px)`,
    [theme.breakpoints.up("sm")]: {
      width: `calc(${theme.spacing(8)} + 1px)`
    },
    borderRight: `1px solid ${(_a = theme.palette.theme) == null ? void 0 : _a.secondary[200]}`,
    backgroundColor: (_b = theme.palette.theme) == null ? void 0 : _b.secondary[100]
  };
};
const Drawer2 = notification.styled(Drawer$1, {
  shouldForwardProp: (prop) => prop !== "open"
})(({ theme, open }) => {
  var _a, _b, _c;
  return {
    width: drawerWidth,
    flexShrink: 0,
    whiteSpace: "nowrap",
    boxSizing: "border-box",
    ".MuiDrawer-paper": {
      backgroundColor: (_c = (_b = (_a = theme == null ? void 0 : theme.palette) == null ? void 0 : _a.theme) == null ? void 0 : _b.secondary) == null ? void 0 : _c[100],
      overflow: "visible !important",
      zIndex: 1201
    },
    ...open && {
      ...openedMixin(theme),
      "& .MuiDrawer-paper": openedMixin(theme)
    },
    ...!open && {
      ...closedMixin(theme),
      "& .MuiDrawer-paper": closedMixin(theme)
    }
  };
});
const DrawerHeader = notification.styled("div")(({ theme }) => ({
  display: "flex",
  alignItems: "center",
  justifyContent: "center",
  padding: theme.spacing(0, 2),
  height: "60px"
}));
const SubmenuPopover = notification.styled(material.Paper)(({ theme }) => {
  var _a, _b, _c, _d;
  return {
    minWidth: 250,
    maxWidth: 350,
    maxHeight: "80vh",
    overflowY: "auto",
    backgroundColor: ((_b = (_a = theme.palette.theme) == null ? void 0 : _a.secondary) == null ? void 0 : _b[100]) || theme.palette.background.paper,
    borderRadius: 12,
    boxShadow: "0 8px 32px rgba(0, 0, 0, 0.12)",
    border: `1px solid ${((_d = (_c = theme.palette.theme) == null ? void 0 : _c.secondary) == null ? void 0 : _d[200]) || theme.palette.divider}`,
    "&.MuiPaper-root": {
      transformOrigin: "top left"
    },
    "&::-webkit-scrollbar": {
      width: 6
    },
    "&::-webkit-scrollbar-track": {
      backgroundColor: "transparent"
    },
    "&::-webkit-scrollbar-thumb": {
      backgroundColor: "rgba(0, 0, 0, 0.2)",
      borderRadius: 3
    }
  };
});
const BreadcrumbContainer = notification.styled(appbar.Box)(({ theme }) => {
  var _a, _b, _c, _d;
  return {
    padding: theme.spacing(1, 2),
    borderBottom: `1px solid ${((_b = (_a = theme.palette.theme) == null ? void 0 : _a.secondary) == null ? void 0 : _b[200]) || theme.palette.divider}`,
    backgroundColor: ((_d = (_c = theme.palette.theme) == null ? void 0 : _c.secondary) == null ? void 0 : _d[50]) || theme.palette.grey[50]
  };
});
const CollapsedSubmenu = ({
  menu,
  anchorEl,
  open,
  onClose,
  onItemClick,
  onSubmenuClick,
  getActiveClassIf,
  breadcrumb,
  onBreadcrumbClick
}) => {
  var _a;
  const renderBreadcrumb = () => {
    if (breadcrumb.length <= 1) return null;
    return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(BreadcrumbContainer, { children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(appbar.Box, { sx: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 0.5 }, children: breadcrumb.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(React.Fragment, { children: [
      index > 0 && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(appbar.default_1, { sx: { fontSize: 14, color: "theme.secondary.400" } }),
      /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
        appbar.Typography,
        {
          variant: "caption",
          onClick: () => onBreadcrumbClick(item, index),
          sx: {
            cursor: index < breadcrumb.length - 1 ? "pointer" : "default",
            color: index < breadcrumb.length - 1 ? "primary.main" : "theme.secondary.600",
            fontWeight: index === breadcrumb.length - 1 ? 600 : 400,
            fontSize: "0.75rem",
            "&:hover": index < breadcrumb.length - 1 ? {
              textDecoration: "underline"
            } : {}
          },
          children: item.label
        }
      )
    ] }, index)) }) });
  };
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.ClickAwayListener, { onClickAway: onClose, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
    material.Popover,
    {
      open,
      anchorEl,
      onClose,
      anchorOrigin: {
        vertical: "center",
        horizontal: "right"
      },
      transformOrigin: {
        vertical: "center",
        horizontal: "left"
      },
      PaperComponent: SubmenuPopover,
      elevation: 1,
      disableRestoreFocus: true,
      disableAutoFocus: true,
      disableEnforceFocus: true,
      sx: {
        ml: 0.5,
        "& .MuiPopover-paper": {
          // overflow: 'visible',
          marginTop: 0,
          pointerEvents: "auto"
          // border: '1px solid',
          // borderColor: 'theme.secondary.200',
        }
      },
      transitionDuration: 200,
      children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(appbar.Box, { children: [
        renderBreadcrumb(),
        /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(appbar.Box, { children: [
          /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
            appbar.Typography,
            {
              variant: "subtitle2",
              sx: {
                px: 2,
                py: 1,
                fontWeight: 600,
                color: "theme.secondary.1000",
                borderBottom: breadcrumb.length > 1 ? "none" : "1px solid",
                borderColor: "theme.secondary.200",
                mb: 0.5,
                fontSize: "0.875rem"
              },
              children: menu.label
            }
          ),
          /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(appbar.List, { component: "div", sx: { py: 0 }, children: (_a = menu.submenu) == null ? void 0 : _a.map((subItem, index) => {
            var _a2;
            const isActive = getActiveClassIf([...(subItem == null ? void 0 : subItem.connectedRoutes) || [], ...[subItem.link]]);
            return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(appbar.ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
              ListItemButton,
              {
                onClick: (e) => {
                  var _a3;
                  if ((_a3 = subItem.submenu) == null ? void 0 : _a3.length) {
                    onSubmenuClick(subItem, e);
                  } else {
                    onItemClick(subItem);
                    onClose();
                  }
                },
                selected: isActive,
                sx: (theme) => {
                  var _a3, _b;
                  return {
                    minHeight: 32,
                    // px: 2,
                    // py: 0.75,
                    borderRadius: 1.5,
                    // mx: 1,
                    mb: 0.25,
                    position: "relative",
                    "&.Mui-selected": {
                      backgroundColor: (_a3 = theme.palette.theme) == null ? void 0 : _a3.primary[100],
                      color: "primary.main",
                      "& .MuiListItemIcon-root": {
                        color: "primary.main"
                      }
                    },
                    "&.Mui-selected:hover": {
                      backgroundColor: (_b = theme.palette.theme) == null ? void 0 : _b.primary[200]
                    },
                    "&:hover": {
                      backgroundColor: "rgba(0, 0, 0, 0.04)"
                    }
                  };
                },
                children: [
                  subItem.icon && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(appbar.ListItemIcon, { sx: { minWidth: 32 }, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                    "img",
                    {
                      src: subItem.icon,
                      alt: subItem.label + " icon",
                      style: { opacity: 0.8 }
                    }
                  ) }),
                  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                    useAuth.Typography,
                    {
                      type: "s3",
                      weight: "normal",
                      color: "theme.secondary.1000",
                      sx: {
                        flexGrow: 1,
                        fontSize: "0.875rem",
                        lineHeight: 1.4
                      },
                      children: subItem.label
                    }
                  ),
                  ((_a2 = subItem.submenu) == null ? void 0 : _a2.length) > 0 && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                    appbar.default_1,
                    {
                      sx: {
                        fontSize: 18,
                        color: "theme.secondary.500",
                        ml: 1
                      }
                    }
                  )
                ]
              }
            ) }, index);
          }) })
        ] })
      ] })
    }
  ) });
};
const Sidebar = (props) => {
  const navigate = reactRouterDom.useNavigate();
  const currentLocation = reactRouterDom.useLocation();
  const { currentLanguage } = useLangauge.useLanguage();
  const isRtl = React.useMemo(() => (currentLanguage == null ? void 0 : currentLanguage.direction) === "rtl", [currentLanguage]);
  const [collapsedSubmenuState, setCollapsedSubmenuState] = React.useState({
    open: false,
    anchorEl: null,
    menu: null,
    breadcrumb: []
  });
  const [menus, setMenus] = React.useState([]);
  const [search, setSearch] = React.useState("");
  const [openSubmenuArray, setOpenSubmenuArray] = React.useState([]);
  const [isOpenSearchTooltop, setIsOpenSearchTooltop] = React.useState(false);
  const getActiveClassIf = React.useCallback(
    (paths) => {
      const shouldMatch = Array.isArray(paths) ? paths.map((path) => ({ path })) : [{ path: paths }];
      return Boolean(reactRouterDom.matchRoutes(shouldMatch, currentLocation));
    },
    [currentLocation]
  );
  const isSubmenuActive = React.useCallback(
    (menu) => {
      var _a;
      if (!((_a = menu.submenu) == null ? void 0 : _a.length)) return false;
      for (const subItem of menu.submenu) {
        const isActive = getActiveClassIf([...(subItem == null ? void 0 : subItem.connectedRoutes) || [], ...[subItem.link]]);
        if (isActive || isSubmenuActive(subItem)) {
          return true;
        }
      }
      return false;
    },
    [getActiveClassIf]
  );
  const getAllMenuPaths = React.useCallback((menu) => {
    var _a, _b;
    const paths = [];
    if (menu.link) {
      paths.push(menu.link);
    }
    if ((_a = menu.connectedRoutes) == null ? void 0 : _a.length) {
      paths.push(...menu.connectedRoutes);
    }
    if ((_b = menu.submenu) == null ? void 0 : _b.length) {
      menu.submenu.forEach((subItem) => {
        paths.push(...getAllMenuPaths(subItem));
      });
    }
    return paths;
  }, []);
  const handleCollapsedMenuClick = React.useCallback(
    (event, menu) => {
      var _a, _b;
      event.stopPropagation();
      if (!props.open && ((_a = menu.submenu) == null ? void 0 : _a.length) > 0) {
        if (collapsedSubmenuState.open && ((_b = collapsedSubmenuState.menu) == null ? void 0 : _b.label) === menu.label) {
          setCollapsedSubmenuState({
            open: false,
            anchorEl: null,
            menu: null,
            breadcrumb: []
          });
        } else {
          setCollapsedSubmenuState({
            open: true,
            anchorEl: event.currentTarget,
            menu,
            breadcrumb: [menu]
          });
        }
      }
    },
    [props.open, collapsedSubmenuState]
  );
  const handleCollapsedSubmenuClick = React.useCallback((item, event) => {
    var _a;
    if ((_a = item.submenu) == null ? void 0 : _a.length) {
      setCollapsedSubmenuState((prev) => ({
        ...prev,
        menu: item,
        breadcrumb: [...prev.breadcrumb, item]
      }));
    }
  }, []);
  const handleBreadcrumbClick = React.useCallback((item, index) => {
    setCollapsedSubmenuState((prev) => ({
      ...prev,
      menu: item,
      breadcrumb: prev.breadcrumb.slice(0, index + 1)
    }));
  }, []);
  const handleCollapsedSubmenuClose = React.useCallback(() => {
    setCollapsedSubmenuState({
      open: false,
      anchorEl: null,
      menu: null,
      breadcrumb: []
    });
  }, []);
  const handleSubmenuItemClick = React.useCallback(
    (item) => {
      navigate(item.link);
    },
    [navigate]
  );
  const handleMenuClick = React.useCallback(
    (menu, parent, index) => {
      var _a, _b, _c, _d;
      if (!props.open && ((_a = menu.submenu) == null ? void 0 : _a.length) > 0) {
        return;
      }
      if (!((_b = menu.submenu) == null ? void 0 : _b.length)) {
        navigate(menu.link);
        if (!parent) {
          setOpenSubmenuArray([]);
        }
      } else if (((_c = menu.submenu) == null ? void 0 : _c.length) && ((_d = menu.submenu[index]) == null ? void 0 : _d.link)) {
        navigate(`${menu.link}${menu.submenu[index].link}`);
      } else {
        const menuKey = `${(parent == null ? void 0 : parent.label) || ""}-${menu.label}`;
        if (openSubmenuArray.includes(menuKey)) {
          if (parent) {
            const newSubArray = openSubmenuArray.filter((f) => f !== menuKey);
            setOpenSubmenuArray([...newSubArray]);
          } else {
            setOpenSubmenuArray([]);
          }
        } else {
          if (parent) {
            setOpenSubmenuArray([...openSubmenuArray, menuKey]);
          } else {
            setOpenSubmenuArray([menuKey]);
          }
        }
      }
    },
    [props.open, navigate, openSubmenuArray]
  );
  const filterMenuOnSearch = React.useCallback((menu, search2) => {
    return menu.filter((m) => {
      var _a, _b, _c, _d;
      if ((_b = (_a = m == null ? void 0 : m.label) == null ? void 0 : _a.toLowerCase()) == null ? void 0 : _b.includes(search2)) {
        return m;
      } else if ((_c = m == null ? void 0 : m.submenu) == null ? void 0 : _c.length) {
        m.submenu = filterMenuOnSearch(m == null ? void 0 : m.submenu, search2);
        return ((_d = m.submenu) == null ? void 0 : _d.length) > 0 ? m : null;
      }
      return null;
    }).filter(Boolean);
  }, []);
  const handleSidebarSearch = React.useCallback(
    (search2) => {
      if (!search2) {
        setMenus(props.menu || []);
      } else {
        const searchTerm = search2.toLowerCase();
        const menuItems = (props == null ? void 0 : props.menu) ? JSON.parse(JSON.stringify(props.menu)) : [];
        const filteredMenu = filterMenuOnSearch(menuItems, searchTerm);
        setMenus(filteredMenu);
      }
    },
    [props.menu, filterMenuOnSearch]
  );
  const handleOpenSearchTooltip = React.useCallback(() => setIsOpenSearchTooltop(true), []);
  const handleCloseSearchTooltip = React.useCallback(() => setIsOpenSearchTooltop(false), []);
  const renderMenu = React.useCallback(
    (menus2, parent, level) => {
      return menus2 == null ? void 0 : menus2.map((menu, index) => {
        var _a, _b;
        const menuKey = `${(parent == null ? void 0 : parent.label) || ""}-${menu.label}`;
        const isMenuActive = getActiveClassIf([...(menu == null ? void 0 : menu.connectedRoutes) || [], ...[menu.link]]);
        const hasActiveSubmenu = !props.open && isSubmenuActive(menu);
        const shouldHighlightParent = isMenuActive || hasActiveSubmenu;
        return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
          appbar.Tooltip,
          {
            title: menu.label,
            placement: "right",
            arrow: true,
            disableHoverListener: props.open,
            disableFocusListener: props.open,
            disableTouchListener: props.open,
            children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
              appbar.ListItem,
              {
                disablePadding: true,
                sx: {
                  display: "block",
                  // mb: 0.5,
                  ...isRtl && {
                    padding: 0
                  }
                },
                children: [
                  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
                    ListItemButton,
                    {
                      onClick: (e) => {
                        var _a2;
                        if (!props.open && ((_a2 = menu.submenu) == null ? void 0 : _a2.length) > 0) {
                          handleCollapsedMenuClick(e, menu);
                        } else {
                          handleMenuClick(menu, parent, (menu == null ? void 0 : menu.submenu) ? -1 : index);
                        }
                      },
                      selected: shouldHighlightParent,
                      sx: (theme) => {
                        var _a2, _b2, _c, _d, _e, _f;
                        return {
                          minHeight: props.open ? 32 : 32,
                          justifyContent: props.open ? "initial" : "center",
                          display: "flex",
                          alignItems: "center",
                          borderRadius: 2,
                          gap: 1,
                          // mx: props.open ? 1 : 0.5,
                          // px: props.open ? 2 : 1,
                          // py: 1,
                          position: "relative",
                          transition: "all 0.2s ease-in-out",
                          "&.Mui-selected": {
                            backgroundColor: (_a2 = theme.palette.theme) == null ? void 0 : _a2.primary[100],
                            color: (_b2 = theme.palette.theme) == null ? void 0 : _b2.primary[800],
                            "& .MuiListItemIcon-root": {
                              color: (_c = theme.palette.theme) == null ? void 0 : _c.primary[800]
                            },
                            "& .MuiTypography-root": {
                              color: (_d = theme.palette.theme) == null ? void 0 : _d.primary[800],
                              fontWeight: 500
                            }
                          },
                          "&.Mui-selected:hover": {
                            backgroundColor: (_e = theme.palette.theme) == null ? void 0 : _e.primary[200]
                          },
                          "&:hover": {
                            backgroundColor: props.open ? "rgba(0, 0, 0, 0.04)" : "rgba(0, 0, 0, 0.08)",
                            transform: props.open ? "none" : "scale(1.02)"
                          },
                          ...!props.open && ((_f = menu.submenu) == null ? void 0 : _f.length) > 0 && {
                            cursor: "pointer",
                            "&::after": {
                              content: '""',
                              position: "absolute",
                              ...isRtl ? {
                                left: 8,
                                borderRight: "5px solid"
                              } : {
                                right: 8,
                                borderLeft: "5px solid"
                              },
                              top: "25%",
                              transform: "translateY(-50%)",
                              width: 0,
                              height: 0,
                              borderTop: "4px solid transparent",
                              borderBottom: "4px solid transparent",
                              borderColor: "currentColor transparent transparent transparent",
                              opacity: 0.7
                            }
                          }
                        };
                      },
                      children: [
                        /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                          appbar.ListItemIcon,
                          {
                            sx: {
                              minWidth: props.open ? "auto" : 0,
                              // mr: props.open ? 1 : 'auto',
                              ...isRtl ? { ml: 0 } : {},
                              justifyContent: "center",
                              display: "flex",
                              alignItems: "center",
                              transition: "all 0.2s ease-in-out"
                            },
                            children: menu.icon ? /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(DynamicSvgIcon, { svgPath: menu.icon, color: shouldHighlightParent ? "primary" : "grey", fontSize: props.open ? "small" : "medium" }) : /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                              appbar.default_1,
                              {
                                sx: {
                                  fontSize: props.open ? 24 : 28,
                                  transition: "all 0.2s ease-in-out"
                                }
                              }
                            )
                          }
                        ),
                        props.open && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
                          appbar.Box,
                          {
                            sx: {
                              display: "flex",
                              alignItems: "center",
                              flexGrow: 1,
                              position: "relative",
                              overflow: "hidden"
                            },
                            children: [
                              /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                                useAuth.Typography,
                                {
                                  type: "s3",
                                  weight: level === 0 ? "medium" : "normal",
                                  color: "theme.secondary.1000",
                                  sx: {
                                    flexGrow: 1,
                                    pl: level * 1.5,
                                    fontSize: level === 0 ? "0.875rem" : "0.8125rem",
                                    lineHeight: 1.4,
                                    whiteSpace: "nowrap",
                                    overflow: "hidden",
                                    textOverflow: "ellipsis"
                                  },
                                  children: menu.label
                                }
                              ),
                              ((_a = menu.submenu) == null ? void 0 : _a.length) > 0 && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                                appbar.Box,
                                {
                                  sx: {
                                    ml: 1,
                                    display: "flex",
                                    alignItems: "center",
                                    transition: "transform 0.2s ease-in-out"
                                  },
                                  children: openSubmenuArray.includes(menuKey) ? /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                                    default_1,
                                    {
                                      sx: {
                                        fontSize: 20,
                                        color: "theme.secondary.600"
                                      }
                                    }
                                  ) : /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                                    appbar.default_1$1,
                                    {
                                      sx: {
                                        fontSize: 20,
                                        color: "theme.secondary.600"
                                      }
                                    }
                                  )
                                }
                              )
                            ]
                          }
                        )
                      ]
                    }
                  ),
                  openSubmenuArray.includes(menuKey) && ((_b = menu.submenu) == null ? void 0 : _b.length) > 0 && props.open && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(Collapse, { in: openSubmenuArray.includes(menuKey), timeout: "auto", unmountOnExit: true, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(appbar.List, { component: "div", disablePadding: true, sx: { mt: 0.5 }, children: renderMenu(menu.submenu, menu, level + 1) }) })
                ]
              }
            )
          },
          `${menu.label}-${index}`
        );
      });
    },
    [props.open, openSubmenuArray, getActiveClassIf, handleCollapsedMenuClick, handleMenuClick, isSubmenuActive, isRtl]
  );
  React.useEffect(() => {
    var _a;
    handleSidebarSearch(search);
    if ((_a = props.menu) == null ? void 0 : _a.length) {
      const expandedMenus = [];
      const checkAndExpandMenu = (menuItems, parentLabel = "") => {
        menuItems.forEach((menu) => {
          var _a2;
          if ((_a2 = menu == null ? void 0 : menu.submenu) == null ? void 0 : _a2.length) {
            const menuKey = `${parentLabel}-${menu.label}`;
            const allPaths = getAllMenuPaths(menu);
            if (getActiveClassIf(allPaths)) {
              expandedMenus.push(menuKey);
              checkAndExpandMenu(menu.submenu, menu.label);
            }
          }
        });
      };
      checkAndExpandMenu(props.menu);
      setOpenSubmenuArray(expandedMenus);
    }
  }, [getActiveClassIf, handleSidebarSearch, props.menu, search, getAllMenuPaths]);
  React.useEffect(() => {
    if (props.open) {
      handleCollapsedSubmenuClose();
    }
  }, [props.open, handleCollapsedSubmenuClose]);
  drawerWidth = props.width;
  const appLogo = apiConfig.getApiConfig().appLogo || images.images.logo;
  const appFavicon = apiConfig.getApiConfig().appFavicon || images.images.favicon;
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [
    /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
      Drawer2,
      {
        variant: "permanent",
        open: props.open,
        anchor: document.body.dir === "rtl" ? "right" : "left",
        onMouseEnter: props.handleMouseEnter,
        onMouseLeave: props.handleMouseLeave,
        children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
          appbar.Box,
          {
            sx: {
              display: "flex",
              flexDirection: "column",
              height: "100%",
              backgroundColor: "grey.100"
            },
            children: [
              /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                appbar.Box,
                {
                  sx: (theme) => {
                    var _a, _b;
                    return {
                      borderBottom: `1px solid ${((_b = (_a = theme.palette.theme) == null ? void 0 : _a.secondary) == null ? void 0 : _b[200]) || theme.palette.divider}`
                    };
                  },
                  children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(DrawerHeader, { children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                    "img",
                    {
                      src: props.open ? appLogo : appFavicon,
                      alt: props.open ? "logo" : "favicon",
                      width: !props.open && 40,
                      height: 55,
                      style: {
                        transition: "all 0.3s ease-in-out",
                        filter: "brightness(1.1)",
                        cursor: "pointer"
                      },
                      onClick: () => navigate(props.dashboardPath || pathname_rental.Pathname.DASHBOARD)
                    }
                  ) })
                }
              ),
              props.open ? /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(appbar.Box, { sx: { px: 1.5, py: 1.5, borderBottom: "1px solid", borderColor: "theme.secondary.200" }, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(appbar.SearchBar, { className: "sidebar-search", handleSearch: setSearch, placeholder: "Search menu...", value: search, sx: { "&.MuiTextField-root": { backgroundColor: "grey.200", border: "1px solid", borderColor: "grey.200", borderRadius: 1 } } }) }) : /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.ClickAwayListener, { onClickAway: handleCloseSearchTooltip, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(appbar.Box, { sx: { p: 1, pb: 0, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                appbar.Tooltip,
                {
                  title: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                    appbar.SearchBar,
                    {
                      className: "sidebar-search",
                      handleSearch: setSearch,
                      placeholder: "Search menu...",
                      value: search,
                      sx: { "&.MuiTextField-root": { backgroundColor: "transparent" } }
                    }
                  ),
                  placement: "right",
                  arrow: true,
                  sx: {
                    p: 0,
                    backgroundColor: "grey.200",
                    border: "1px solid",
                    borderColor: "grey.300",
                    "& .MuiTooltip-arrow": {
                      color: "grey.300"
                    },
                    ml: "8px !important"
                  },
                  open: isOpenSearchTooltop,
                  children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.IconButton, { color: "inherit", sx: { borderRadius: 2, p: 1.5, backgroundColor: isOpenSearchTooltop ? "grey.200" : "inherit" }, onClick: handleOpenSearchTooltip, children: search.trim() ? /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(tick.SearchStatus, {}) : /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(tick.Search, {}) })
                }
              ) }) }),
              /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                appbar.Box,
                {
                  sx: {
                    flexGrow: 1,
                    overflowY: "auto",
                    py: 1,
                    "&::-webkit-scrollbar": {
                      width: 6
                    },
                    "&::-webkit-scrollbar-track": {
                      backgroundColor: "transparent"
                    },
                    "&::-webkit-scrollbar-thumb": {
                      backgroundColor: "rgba(0, 0, 0, 0.2)",
                      borderRadius: 3
                    }
                  },
                  children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(appbar.List, { className: "sidebar-list", sx: { p: 0 }, children: renderMenu(menus, null, 0) })
                }
              ),
              props.open && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                appbar.Box,
                {
                  sx: {
                    borderTop: "1px solid",
                    borderColor: "theme.secondary.200",
                    backgroundColor: "rgba(255, 255, 255, 0.5)"
                  },
                  children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
                    appbar.Box,
                    {
                      sx: {
                        padding: ".75rem 1.5rem",
                        display: "flex",
                        alignItems: "self-start",
                        gap: 0.5,
                        justifyContent: "center"
                      },
                      children: [
                        /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                          appbar.Typography,
                          {
                            sx: {
                              color: "theme.secondary.600",
                              fontSize: ".85rem",
                              fontWeight: 500
                            },
                            children: "Crafted with"
                          }
                        ),
                        /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                          material.Icon,
                          {
                            sx: {
                              color: "theme.error.500",
                              width: "1rem",
                              height: "1rem",
                              fontSize: ".75rem"
                            },
                            children: "❤️"
                          }
                        ),
                        /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
                          appbar.Typography,
                          {
                            sx: {
                              color: "theme.secondary.600",
                              fontSize: ".75rem",
                              fontWeight: 500
                            },
                            children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("img", { src: images.images.erp_logo })
                          }
                        )
                      ]
                    }
                  )
                }
              )
            ]
          }
        )
      }
    ),
    /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
      material.IconButton,
      {
        size: "small",
        onClick: () => props.forcedOpen ? props.handleDrawerClose() : props.handleDrawerOpen(),
        className: isRtl ? "drawer-expand-btn_rtl" : "drawer-expand-btn",
        sx: {
          ml: "auto",
          backgroundColor: "rgba(0, 0, 0, 0.04)",
          "&:hover": {
            backgroundColor: "grey.100"
          },
          // transition: 'all 0.2s ease-in-out',
          width: "30px",
          height: "30px",
          borderRadius: `8px`,
          borderTopLeftRadius: 0,
          borderBottomLeftRadius: 0,
          borderColor: "grey.500",
          ...isRtl ? !props.forcedOpen ? { right: "63px !important", left: "auto" } : { right: "299px", left: "auto" } : !props.forcedOpen ? { left: "63px !important", right: "auto" } : { left: "299px", right: "auto" },
          transition: "all 0.3s ease-in-out"
        },
        children: props.theme.direction === "rtl" ? props.forcedOpen ? /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(appbar.default_1, { fontSize: "small" }) : /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(appbar.default_1$2, { fontSize: "small" }) : props.forcedOpen ? /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(appbar.default_1$2, { fontSize: "small" }) : /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(appbar.default_1, { fontSize: "small" })
      }
    ),
    collapsedSubmenuState.menu && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
      CollapsedSubmenu,
      {
        menu: collapsedSubmenuState.menu,
        anchorEl: collapsedSubmenuState.anchorEl,
        open: collapsedSubmenuState.open,
        onClose: handleCollapsedSubmenuClose,
        onItemClick: handleSubmenuItemClick,
        onSubmenuClick: handleCollapsedSubmenuClick,
        getActiveClassIf,
        breadcrumb: collapsedSubmenuState.breadcrumb,
        onBreadcrumbClick: handleBreadcrumbClick
      }
    )
  ] });
};
exports.Collapse = Collapse;
exports.Sidebar = Sidebar;
//# sourceMappingURL=sidebar-D1jgDNK3.js.map
