import v from "./index-objectWithoutPropertiesLoose.js";
import m from "./index-extends.js";
import * as T from "react";
import e from "./index-_virtual16.js";
import { clsx as y } from "./index-clsx.js";
import z from "./index-formControlState.js";
import F from "./index-useFormControl.js";
import q from "./index-styled.js";
import f, { getFormHelperTextUtilityClasses as C } from "./index-formHelperTextClasses.js";
import { jsx as u } from "react/jsx-runtime";
import { useDefaultProps as H } from "./index-DefaultPropsProvider.js";
import g from "./index-capitalize.js";
import N from "./index-composeClasses.js";
var b;
const O = ["children", "className", "component", "disabled", "error", "filled", "focused", "margin", "required", "variant"], R = (o) => {
  const {
    classes: r,
    contained: s,
    size: i,
    disabled: a,
    error: l,
    filled: n,
    focused: d,
    required: c
  } = o, t = {
    root: ["root", a && "disabled", l && "error", i && `size${g(i)}`, s && "contained", d && "focused", n && "filled", c && "required"]
  };
  return N(t, C, r);
}, j = q("p", {
  name: "MuiFormHelperText",
  slot: "Root",
  overridesResolver: (o, r) => {
    const {
      ownerState: s
    } = o;
    return [r.root, s.size && r[`size${g(s.size)}`], s.contained && r.contained, s.filled && r.filled];
  }
})(({
  theme: o,
  ownerState: r
}) => m({
  color: (o.vars || o).palette.text.secondary
}, o.typography.caption, {
  textAlign: "left",
  marginTop: 3,
  marginRight: 0,
  marginBottom: 0,
  marginLeft: 0,
  [`&.${f.disabled}`]: {
    color: (o.vars || o).palette.text.disabled
  },
  [`&.${f.error}`]: {
    color: (o.vars || o).palette.error.main
  }
}, r.size === "small" && {
  marginTop: 4
}, r.contained && {
  marginLeft: 14,
  marginRight: 14
})), _ = /* @__PURE__ */ T.forwardRef(function(r, s) {
  const i = H({
    props: r,
    name: "MuiFormHelperText"
  }), {
    children: a,
    className: l,
    component: n = "p"
  } = i, d = v(i, O), c = F(), t = z({
    props: i,
    muiFormControl: c,
    states: ["variant", "size", "disabled", "error", "filled", "focused", "required"]
  }), p = m({}, i, {
    component: n,
    contained: t.variant === "filled" || t.variant === "outlined",
    variant: t.variant,
    size: t.size,
    disabled: t.disabled,
    error: t.error,
    filled: t.filled,
    focused: t.focused,
    required: t.required
  }), x = R(p);
  return /* @__PURE__ */ u(j, m({
    as: n,
    ownerState: p,
    className: y(x.root, l),
    ref: s
  }, d, {
    children: a === " " ? (
      // notranslate needed while Google Translate will not fix zero-width space issue
      b || (b = /* @__PURE__ */ u("span", {
        className: "notranslate",
        children: "​"
      }))
    ) : a
  }));
});
process.env.NODE_ENV !== "production" && (_.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.
   *
   * If `' '` is provided, the component reserves one line height for displaying a future message.
   */
  children: e.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: e.object,
  /**
   * @ignore
   */
  className: e.string,
  /**
   * The component used for the root node.
   * Either a string to use a HTML element or a component.
   */
  component: e.elementType,
  /**
   * If `true`, the helper text should be displayed in a disabled state.
   */
  disabled: e.bool,
  /**
   * If `true`, helper text should be displayed in an error state.
   */
  error: e.bool,
  /**
   * If `true`, the helper text should use filled classes key.
   */
  filled: e.bool,
  /**
   * If `true`, the helper text should use focused classes key.
   */
  focused: e.bool,
  /**
   * If `dense`, will adjust vertical spacing. This is normally obtained via context from
   * FormControl.
   */
  margin: e.oneOf(["dense"]),
  /**
   * If `true`, the helper text should use required classes key.
   */
  required: e.bool,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
  /**
   * The variant to use.
   */
  variant: e.oneOfType([e.oneOf(["filled", "outlined", "standard"]), e.string])
});
export {
  _ as default
};
