import { jsxs as f, Fragment as j, jsx as y } from "react/jsx-runtime";
import { useMemo as w } from "react";
import { c as K, r as O, f as T, s as z, a as F } from "../tools/tools.js";
const M = function(h) {
  const {
    active: l,
    as: s = "button",
    btnClose: i,
    children: C,
    className: d,
    disabled: e,
    dropOldClass: c,
    endContent: u,
    isLoading: v,
    onRef: B,
    outline: t,
    rounded: n,
    show: m,
    size: a,
    startContent: o,
    style: b,
    type: x = "button",
    variables: p,
    variant: r,
    ...N
  } = h, g = w(() => {
    const L = K(
      !c && T(["btn-close", i], ["btn", !0]),
      l && "active",
      m && "show",
      r && `btn-${r}`,
      t && `btn-outline-${t}`,
      a && `btn-${a}`,
      s === "a" && e && "disabled",
      n && O(n),
      d
    ), R = z((V, $) => ({ tKey: F($) }), p, b);
    return {
      className: L,
      disabled: e && s === "button",
      style: R
    };
  }, [
    s,
    l,
    i,
    d,
    e,
    c,
    t,
    n,
    m,
    a,
    b,
    p,
    r
  ]);
  return /* @__PURE__ */ f(s, { type: x, ...N, ...g, ref: B, children: [
    v && !o && /* @__PURE__ */ f(j, { children: [
      /* @__PURE__ */ y("span", { "aria-hidden": "true", className: "spinner-border spinner-border-sm me-1" }),
      /* @__PURE__ */ y("span", { className: "visually-hidden", role: "status", children: "Loading..." })
    ] }),
    o && o,
    C,
    u && u
  ] });
};
M.displayName = "BRL.Button";
export {
  M as B
};
//# sourceMappingURL=button.js.map
