import j from "./index-objectWithoutPropertiesLoose.js";
import n from "./index-extends.js";
import * as R from "react";
import o from "./index-_virtual16.js";
import { clsx as N } from "./index-clsx.js";
import _ from "./index-styled.js";
import { getBackdropUtilityClass as B } from "./index-backdropClasses.js";
import { jsx as u } from "react/jsx-runtime";
import { useDefaultProps as w } from "./index-DefaultPropsProvider.js";
import D from "./index-Fade.js";
import O from "./index-composeClasses.js";
const S = ["children", "className", "component", "components", "componentsProps", "invisible", "open", "slotProps", "slots", "TransitionComponent", "transitionDuration"], E = (e) => {
  const {
    classes: t,
    invisible: s
  } = e;
  return O({
    root: ["root", s && "invisible"]
  }, B, t);
}, M = _("div", {
  name: "MuiBackdrop",
  slot: "Root",
  overridesResolver: (e, t) => {
    const {
      ownerState: s
    } = e;
    return [t.root, s.invisible && t.invisible];
  }
})(({
  ownerState: e
}) => n({
  position: "fixed",
  display: "flex",
  alignItems: "center",
  justifyContent: "center",
  right: 0,
  bottom: 0,
  top: 0,
  left: 0,
  backgroundColor: "rgba(0, 0, 0, 0.5)",
  WebkitTapHighlightColor: "transparent"
}, e.invisible && {
  backgroundColor: "transparent"
})), U = /* @__PURE__ */ R.forwardRef(function(t, s) {
  var i, l, a;
  const p = w({
    props: t,
    name: "MuiBackdrop"
  }), {
    children: f,
    className: b,
    component: c = "div",
    components: v = {},
    componentsProps: h = {},
    invisible: y = !1,
    open: T,
    slotProps: P = {},
    slots: C = {},
    TransitionComponent: g = D,
    transitionDuration: k
  } = p, x = j(p, S), m = n({}, p, {
    component: c,
    invisible: y
  }), d = E(m), r = (i = P.root) != null ? i : h.root;
  return /* @__PURE__ */ u(g, n({
    in: T,
    timeout: k
  }, x, {
    children: /* @__PURE__ */ u(M, n({
      "aria-hidden": !0
    }, r, {
      as: (l = (a = C.root) != null ? a : v.Root) != null ? l : c,
      className: N(d.root, b, r == null ? void 0 : r.className),
      ownerState: n({}, m, r == null ? void 0 : r.ownerState),
      classes: d,
      ref: s,
      children: f
    }))
  }));
});
process.env.NODE_ENV !== "production" && (U.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: o.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: o.object,
  /**
   * @ignore
   */
  className: o.string,
  /**
   * The component used for the root node.
   * Either a string to use a HTML element or a component.
   */
  component: o.elementType,
  /**
   * The components used for each slot inside.
   *
   * This prop is an alias for the `slots` prop.
   * It's recommended to use the `slots` prop instead.
   *
   * @default {}
   */
  components: o.shape({
    Root: o.elementType
  }),
  /**
   * The extra props for the slot components.
   * You can override the existing props or add new ones.
   *
   * This prop is an alias for the `slotProps` prop.
   * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
   *
   * @default {}
   */
  componentsProps: o.shape({
    root: o.object
  }),
  /**
   * If `true`, the backdrop is invisible.
   * It can be used when rendering a popover or a custom select component.
   * @default false
   */
  invisible: o.bool,
  /**
   * If `true`, the component is shown.
   */
  open: o.bool.isRequired,
  /**
   * The extra props for the slot components.
   * You can override the existing props or add new ones.
   *
   * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
   *
   * @default {}
   */
  slotProps: o.shape({
    root: o.object
  }),
  /**
   * The components used for each slot inside.
   *
   * This prop is an alias for the `components` prop, which will be deprecated in the future.
   *
   * @default {}
   */
  slots: o.shape({
    root: o.elementType
  }),
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
  /**
   * The component used for the transition.
   * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
   * @default Fade
   */
  TransitionComponent: o.elementType,
  /**
   * The duration for the transition, in milliseconds.
   * You may specify a single timeout for all transitions, or individually with an object.
   */
  transitionDuration: o.oneOfType([o.number, o.shape({
    appear: o.number,
    enter: o.number,
    exit: o.number
  })])
});
export {
  U as default
};
