import g from "./index-objectWithoutPropertiesLoose.js";
import p from "./index-extends.js";
import * as k from "react";
import a from "./index-_virtual16.js";
import { clsx as x } from "./index-clsx.js";
import v from "./index-styled.js";
import { getAppBarUtilityClass as B } from "./index-appBarClasses.js";
import { jsx as m } from "react/jsx-runtime";
import { useDefaultProps as C } from "./index-DefaultPropsProvider.js";
import s from "./index-capitalize.js";
import y from "./index-composeClasses.js";
import A from "./index-Paper.js";
const O = ["className", "color", "enableColorOnDark", "position"], D = (r) => {
  const {
    color: o,
    position: l,
    classes: i
  } = r, n = {
    root: ["root", `color${s(o)}`, `position${s(l)}`]
  };
  return y(n, B, i);
}, t = (r, o) => r ? `${r == null ? void 0 : r.replace(")", "")}, ${o})` : o, T = v(A, {
  name: "MuiAppBar",
  slot: "Root",
  overridesResolver: (r, o) => {
    const {
      ownerState: l
    } = r;
    return [o.root, o[`position${s(l.position)}`], o[`color${s(l.color)}`]];
  }
})(({
  theme: r,
  ownerState: o
}) => {
  const l = r.palette.mode === "light" ? r.palette.grey[100] : r.palette.grey[900];
  return p({
    display: "flex",
    flexDirection: "column",
    width: "100%",
    boxSizing: "border-box",
    // Prevent padding issue with the Modal and fixed positioned AppBar.
    flexShrink: 0
  }, o.position === "fixed" && {
    position: "fixed",
    zIndex: (r.vars || r).zIndex.appBar,
    top: 0,
    left: "auto",
    right: 0,
    "@media print": {
      // Prevent the app bar to be visible on each printed page.
      position: "absolute"
    }
  }, o.position === "absolute" && {
    position: "absolute",
    zIndex: (r.vars || r).zIndex.appBar,
    top: 0,
    left: "auto",
    right: 0
  }, o.position === "sticky" && {
    // ⚠️ sticky is not supported by IE11.
    position: "sticky",
    zIndex: (r.vars || r).zIndex.appBar,
    top: 0,
    left: "auto",
    right: 0
  }, o.position === "static" && {
    position: "static"
  }, o.position === "relative" && {
    position: "relative"
  }, !r.vars && p({}, o.color === "default" && {
    backgroundColor: l,
    color: r.palette.getContrastText(l)
  }, o.color && o.color !== "default" && o.color !== "inherit" && o.color !== "transparent" && {
    backgroundColor: r.palette[o.color].main,
    color: r.palette[o.color].contrastText
  }, o.color === "inherit" && {
    color: "inherit"
  }, r.palette.mode === "dark" && !o.enableColorOnDark && {
    backgroundColor: null,
    color: null
  }, o.color === "transparent" && p({
    backgroundColor: "transparent",
    color: "inherit"
  }, r.palette.mode === "dark" && {
    backgroundImage: "none"
  })), r.vars && p({}, o.color === "default" && {
    "--AppBar-background": o.enableColorOnDark ? r.vars.palette.AppBar.defaultBg : t(r.vars.palette.AppBar.darkBg, r.vars.palette.AppBar.defaultBg),
    "--AppBar-color": o.enableColorOnDark ? r.vars.palette.text.primary : t(r.vars.palette.AppBar.darkColor, r.vars.palette.text.primary)
  }, o.color && !o.color.match(/^(default|inherit|transparent)$/) && {
    "--AppBar-background": o.enableColorOnDark ? r.vars.palette[o.color].main : t(r.vars.palette.AppBar.darkBg, r.vars.palette[o.color].main),
    "--AppBar-color": o.enableColorOnDark ? r.vars.palette[o.color].contrastText : t(r.vars.palette.AppBar.darkColor, r.vars.palette[o.color].contrastText)
  }, !["inherit", "transparent"].includes(o.color) && {
    backgroundColor: "var(--AppBar-background)"
  }, {
    color: o.color === "inherit" ? "inherit" : "var(--AppBar-color)"
  }, o.color === "transparent" && {
    backgroundImage: "none",
    backgroundColor: "transparent",
    color: "inherit"
  }));
}), z = /* @__PURE__ */ k.forwardRef(function(o, l) {
  const i = C({
    props: o,
    name: "MuiAppBar"
  }), {
    className: n,
    color: d = "primary",
    enableColorOnDark: u = !1,
    position: c = "fixed"
  } = i, f = g(i, O), e = p({}, i, {
    color: d,
    position: c,
    enableColorOnDark: u
  }), b = D(e);
  return /* @__PURE__ */ m(T, p({
    square: !0,
    component: "header",
    ownerState: e,
    elevation: 4,
    className: x(b.root, n, c === "fixed" && "mui-fixed"),
    ref: l
  }, f));
});
process.env.NODE_ENV !== "production" && (z.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * The content of the component.
   */
  children: a.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: a.object,
  /**
   * @ignore
   */
  className: a.string,
  /**
   * The color of the component.
   * It supports both default and custom theme colors, which can be added as shown in the
   * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
   * @default 'primary'
   */
  color: a.oneOfType([a.oneOf(["default", "inherit", "primary", "secondary", "transparent", "error", "info", "success", "warning"]), a.string]),
  /**
   * If true, the `color` prop is applied in dark mode.
   * @default false
   */
  enableColorOnDark: a.bool,
  /**
   * The positioning type. The behavior of the different options is described
   * [in the MDN web docs](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Positioning).
   * Note: `sticky` is not universally supported and will fall back to `static` when unavailable.
   * @default 'fixed'
   */
  position: a.oneOf(["absolute", "fixed", "relative", "static", "sticky"]),
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object])
});
export {
  z as default
};
