"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
require("react");
require("clsx");
const useProps = require("../../../core/MantineProvider/use-props/use-props.cjs");
const useStyles = require("../../../core/styles-api/use-styles/use-styles.cjs");
const Box = require("../../../core/Box/Box.cjs");
const factory = require("../../../core/factory/factory.cjs");
const InputWrapper_context = require("../../Input/InputWrapper.context.cjs");
const PillsInput_context = require("../PillsInput.context.cjs");
const PillsInput_module_css = require("../PillsInput.module.css.cjs");
const useMergedRef = require("../../../../../../../../@mantine_hooks@7.15.2_react@18.3.1/node_modules/@mantine/hooks/esm/use-merged-ref/use-merged-ref.cjs");
const defaultProps = {
  type: "visible"
};
const PillsInputField = factory.factory((_props, ref) => {
  const props = useProps.useProps("PillsInputField", defaultProps, _props);
  const {
    classNames,
    className,
    style,
    styles,
    unstyled,
    vars,
    type,
    disabled,
    id,
    pointer,
    mod,
    ...others
  } = props;
  const ctx = PillsInput_context.usePillsInputContext();
  const inputWrapperCtx = InputWrapper_context.useInputWrapperContext();
  const getStyles = useStyles.useStyles({
    name: "PillsInputField",
    classes: PillsInput_module_css.default,
    props,
    className,
    style,
    classNames,
    styles,
    unstyled,
    rootSelector: "field"
  });
  const _disabled = disabled || (ctx == null ? void 0 : ctx.disabled);
  return /* @__PURE__ */ jsxRuntime.jsx(
    Box.Box,
    {
      component: "input",
      ref: useMergedRef.useMergedRef(ref, ctx == null ? void 0 : ctx.fieldRef),
      "data-type": type,
      disabled: _disabled,
      mod: [{ disabled: _disabled, pointer }, mod],
      ...getStyles("field"),
      ...others,
      id: (inputWrapperCtx == null ? void 0 : inputWrapperCtx.inputId) || id,
      "aria-invalid": ctx == null ? void 0 : ctx.hasError,
      "aria-describedby": inputWrapperCtx == null ? void 0 : inputWrapperCtx.describedBy,
      type: "text",
      onMouseDown: (event) => !pointer && event.stopPropagation()
    }
  );
});
PillsInputField.classes = PillsInput_module_css.default;
PillsInputField.displayName = "@mantine/core/PillsInputField";
exports.PillsInputField = PillsInputField;
