import { jsx as e } from "react/jsx-runtime";
import { forwardRef as m } from "react";
import { IMaskMixin as p } from "react-imask";
import { Input as d } from "@headlessui/react";
import { cn as f } from "../utils/cn.js";
const n = m(({ state: t, className: o, rawValue: r, onFocus: s, ...u }, i) => /* @__PURE__ */ e(
  d,
  {
    ref: i,
    type: "text",
    autoComplete: "off",
    "data-lpignore": "true",
    disabled: t === "disabled",
    className: f(
      "font-suisse h-[36px] w-full font-medium text-sw-gray-50 data-focus:outline-none",
      { "text-sw-gray-400": t === "disabled" },
      { "text-sw-status-error": t === "error" },
      o
    ),
    style: {
      fontSize: r && r.length > 15 ? "24px" : "32px"
    },
    readOnly: typeof navigator < "u" && navigator.maxTouchPoints === 0,
    onFocus: (a) => {
      a.target.removeAttribute("readOnly"), s?.(a);
    },
    ...u
  }
));
n.displayName = "RawInputAmount";
const l = p(({ inputRef: t, ...o }) => /* @__PURE__ */ e(n, { ref: t, ...o })), A = ({
  value: t,
  setValue: o,
  ...r
}) => (
  // @ts-expect-error Use Number instead of MaskedNumber
  /* @__PURE__ */ e(
    l,
    {
      scale: 18,
      value: t,
      rawValue: t,
      mask: Number,
      onAccept: o,
      padFractionalZeros: !1,
      normalizeZeros: !0,
      thousandsSeparator: "",
      mapToRadix: [","],
      radix: ".",
      autofix: !0,
      unmask: !0,
      ...r
    }
  )
);
export {
  A as InputAmount,
  l as MaskedInputAmount
};
//# sourceMappingURL=InputAmount.js.map
