import { Fragment as I, attr as t, aria as c, html as f, Empty as o, on as p, emitValue as i } from "@tempots/dom";
import { I as x } from "./input-container-BBWCDGTv.js";
const C = ({
  autocomplete: n,
  autofocus: a,
  classes: e,
  disabled: u,
  name: l,
  placeholder: r,
  id: m,
  required: d,
  tabIndex: b,
  hasError: s
}) => I(
  t.autocomplete(n),
  t.autofocus(a),
  t.class(e?.input),
  t.disabled(u),
  t.name(l ?? m),
  t.placeholder(r),
  t.id(m),
  c.required(d),
  t.tabindex(b),
  s != null ? c.invalid(
    s ?? !1
  ) : null
), v = (n) => {
  const { value: a, onBlur: e, onChange: u, onInput: l, type: r } = n;
  return x({
    ...n,
    input: f.input(
      t.type(r ?? "text"),
      C(n),
      t.value(a),
      t.class("bc-input"),
      e != null ? p.blur(i(e)) : o,
      u != null ? p.change(i(u)) : o,
      l != null ? p.input(i(l)) : o
    )
  });
};
export {
  C,
  v as T
};
