import j from "./index-objectWithoutPropertiesLoose.js";
import l from "./index-extends.js";
import * as I from "react";
import o from "./index-_virtual16.js";
import A from "./index-NotchedOutline.js";
import N from "./index-useFormControl.js";
import w from "./index-formControlState.js";
import u from "./index-styled.js";
import n, { getOutlinedInputUtilityClass as L } from "./index-outlinedInputClasses.js";
import P, { InputBaseRoot as z, rootOverridesResolver as M, InputBaseComponent as S, inputOverridesResolver as q } from "./index-InputBase2.js";
import { jsx as T, jsxs as D } from "react/jsx-runtime";
import { useDefaultProps as E } from "./index-DefaultPropsProvider.js";
import U from "./index-composeClasses.js";
import V from "./index-rootShouldForwardProp.js";
import G from "./index-refType.js";
const H = ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "slots", "type"], J = (e) => {
  const {
    classes: t
  } = e, d = U({
    root: ["root"],
    notchedOutline: ["notchedOutline"],
    input: ["input"]
  }, L, t);
  return l({}, t, d);
}, K = u(z, {
  shouldForwardProp: (e) => V(e) || e === "classes",
  name: "MuiOutlinedInput",
  slot: "Root",
  overridesResolver: M
})(({
  theme: e,
  ownerState: t
}) => {
  const i = e.palette.mode === "light" ? "rgba(0, 0, 0, 0.23)" : "rgba(255, 255, 255, 0.23)";
  return l({
    position: "relative",
    borderRadius: (e.vars || e).shape.borderRadius,
    [`&:hover .${n.notchedOutline}`]: {
      borderColor: (e.vars || e).palette.text.primary
    },
    // Reset on touch devices, it doesn't add specificity
    "@media (hover: none)": {
      [`&:hover .${n.notchedOutline}`]: {
        borderColor: e.vars ? `rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)` : i
      }
    },
    [`&.${n.focused} .${n.notchedOutline}`]: {
      borderColor: (e.vars || e).palette[t.color].main,
      borderWidth: 2
    },
    [`&.${n.error} .${n.notchedOutline}`]: {
      borderColor: (e.vars || e).palette.error.main
    },
    [`&.${n.disabled} .${n.notchedOutline}`]: {
      borderColor: (e.vars || e).palette.action.disabled
    }
  }, t.startAdornment && {
    paddingLeft: 14
  }, t.endAdornment && {
    paddingRight: 14
  }, t.multiline && l({
    padding: "16.5px 14px"
  }, t.size === "small" && {
    padding: "8.5px 14px"
  }));
}), Q = u(A, {
  name: "MuiOutlinedInput",
  slot: "NotchedOutline",
  overridesResolver: (e, t) => t.notchedOutline
})(({
  theme: e
}) => {
  const t = e.palette.mode === "light" ? "rgba(0, 0, 0, 0.23)" : "rgba(255, 255, 255, 0.23)";
  return {
    borderColor: e.vars ? `rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)` : t
  };
}), X = u(S, {
  name: "MuiOutlinedInput",
  slot: "Input",
  overridesResolver: q
})(({
  theme: e,
  ownerState: t
}) => l({
  padding: "16.5px 14px"
}, !e.vars && {
  "&:-webkit-autofill": {
    WebkitBoxShadow: e.palette.mode === "light" ? null : "0 0 0 100px #266798 inset",
    WebkitTextFillColor: e.palette.mode === "light" ? null : "#fff",
    caretColor: e.palette.mode === "light" ? null : "#fff",
    borderRadius: "inherit"
  }
}, e.vars && {
  "&:-webkit-autofill": {
    borderRadius: "inherit"
  },
  [e.getColorSchemeSelector("dark")]: {
    "&:-webkit-autofill": {
      WebkitBoxShadow: "0 0 0 100px #266798 inset",
      WebkitTextFillColor: "#fff",
      caretColor: "#fff"
    }
  }
}, t.size === "small" && {
  padding: "8.5px 14px"
}, t.multiline && {
  padding: 0
}, t.startAdornment && {
  paddingLeft: 0
}, t.endAdornment && {
  paddingRight: 0
})), $ = /* @__PURE__ */ I.forwardRef(function(t, i) {
  var d, c, m, f, b;
  const s = E({
    props: t,
    name: "MuiOutlinedInput"
  }), {
    components: g = {},
    fullWidth: O = !1,
    inputComponent: k = "input",
    label: p,
    multiline: h = !1,
    notched: C,
    slots: y = {},
    type: v = "text"
  } = s, W = j(s, H), x = J(s), R = N(), r = w({
    props: s,
    muiFormControl: R,
    states: ["color", "disabled", "error", "focused", "hiddenLabel", "size", "required"]
  }), F = l({}, s, {
    color: r.color || "primary",
    disabled: r.disabled,
    error: r.error,
    focused: r.focused,
    formControl: R,
    fullWidth: O,
    hiddenLabel: r.hiddenLabel,
    multiline: h,
    size: r.size,
    type: v
  }), _ = (d = (c = y.root) != null ? c : g.Root) != null ? d : K, B = (m = (f = y.input) != null ? f : g.Input) != null ? m : X;
  return /* @__PURE__ */ T(P, l({
    slots: {
      root: _,
      input: B
    },
    renderSuffix: (a) => /* @__PURE__ */ T(Q, {
      ownerState: F,
      className: x.notchedOutline,
      label: p != null && p !== "" && r.required ? b || (b = /* @__PURE__ */ D(I.Fragment, {
        children: [p, " ", "*"]
      })) : p,
      notched: typeof C < "u" ? C : !!(a.startAdornment || a.filled || a.focused)
    }),
    fullWidth: O,
    inputComponent: k,
    multiline: h,
    ref: i,
    type: v
  }, W, {
    classes: l({}, x, {
      notchedOutline: null
    })
  }));
});
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`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * This prop helps users to fill forms faster, especially on mobile devices.
   * The name can be confusing, as it's more like an autofill.
   * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
   */
  autoComplete: o.string,
  /**
   * If `true`, the `input` element is focused during the first mount.
   */
  autoFocus: o.bool,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: o.object,
  /**
   * 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).
   * The prop defaults to the value (`'primary'`) inherited from the parent FormControl component.
   */
  color: o.oneOfType([o.oneOf(["primary", "secondary"]), o.string]),
  /**
   * 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({
    Input: o.elementType,
    Root: o.elementType
  }),
  /**
   * The default value. Use when the component is not controlled.
   */
  defaultValue: o.any,
  /**
   * If `true`, the component is disabled.
   * The prop defaults to the value (`false`) inherited from the parent FormControl component.
   */
  disabled: o.bool,
  /**
   * End `InputAdornment` for this component.
   */
  endAdornment: o.node,
  /**
   * If `true`, the `input` will indicate an error.
   * The prop defaults to the value (`false`) inherited from the parent FormControl component.
   */
  error: o.bool,
  /**
   * If `true`, the `input` will take up the full width of its container.
   * @default false
   */
  fullWidth: o.bool,
  /**
   * The id of the `input` element.
   */
  id: o.string,
  /**
   * The component used for the `input` element.
   * Either a string to use a HTML element or a component.
   * @default 'input'
   */
  inputComponent: o.elementType,
  /**
   * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
   * @default {}
   */
  inputProps: o.object,
  /**
   * Pass a ref to the `input` element.
   */
  inputRef: G,
  /**
   * The label of the `input`. It is only used for layout. The actual labelling
   * is handled by `InputLabel`.
   */
  label: o.node,
  /**
   * If `dense`, will adjust vertical spacing. This is normally obtained via context from
   * FormControl.
   * The prop defaults to the value (`'none'`) inherited from the parent FormControl component.
   */
  margin: o.oneOf(["dense", "none"]),
  /**
   * Maximum number of rows to display when multiline option is set to true.
   */
  maxRows: o.oneOfType([o.number, o.string]),
  /**
   * Minimum number of rows to display when multiline option is set to true.
   */
  minRows: o.oneOfType([o.number, o.string]),
  /**
   * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.
   * @default false
   */
  multiline: o.bool,
  /**
   * Name attribute of the `input` element.
   */
  name: o.string,
  /**
   * If `true`, the outline is notched to accommodate the label.
   */
  notched: o.bool,
  /**
   * Callback fired when the value is changed.
   *
   * @param {React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>} event The event source of the callback.
   * You can pull out the new value by accessing `event.target.value` (string).
   */
  onChange: o.func,
  /**
   * The short hint displayed in the `input` before the user enters a value.
   */
  placeholder: o.string,
  /**
   * It prevents the user from changing the value of the field
   * (not from interacting with the field).
   */
  readOnly: o.bool,
  /**
   * If `true`, the `input` element is required.
   * The prop defaults to the value (`false`) inherited from the parent FormControl component.
   */
  required: o.bool,
  /**
   * Number of rows to display when multiline option is set to true.
   */
  rows: o.oneOfType([o.number, o.string]),
  /**
   * 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({
    input: o.elementType,
    root: o.elementType
  }),
  /**
   * Start `InputAdornment` for this component.
   */
  startAdornment: o.node,
  /**
   * 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]),
  /**
   * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
   * @default 'text'
   */
  type: o.string,
  /**
   * The value of the `input` element, required for a controlled component.
   */
  value: o.any
});
$.muiName = "Input";
export {
  $ as default
};
