import { jsx as x } from "react/jsx-runtime";
import b from "react";
import { d as D } from "./icon-utils-CmjSEuTl.js";
function M(...c) {
  return c.filter(Boolean).join(" ");
}
const P = "_icon_yamd4_2", L = "_iconXs_yamd4_20", T = "_iconSm_yamd4_25", $ = "_iconMd_yamd4_30", k = "_iconLg_yamd4_35", N = "_iconXl_yamd4_40", j = "_iconPrimary_yamd4_46", w = "_iconSecondary_yamd4_50", B = "_iconTertiary_yamd4_54", R = "_iconInverted_yamd4_58", U = "_iconInteractive_yamd4_63", E = "_iconDisabled_yamd4_76", o = {
  icon: P,
  iconXs: L,
  iconSm: T,
  iconMd: $,
  iconLg: k,
  iconXl: N,
  iconPrimary: j,
  iconSecondary: w,
  iconTertiary: B,
  iconInverted: R,
  iconInteractive: U,
  iconDisabled: E
}, H = b.forwardRef(({
  name: c,
  size: n = "md",
  tone: m = "primary",
  className: _,
  style: y,
  interactive: l = !1,
  disabled: i = !1,
  "aria-label": e,
  "aria-hidden": p,
  onClick: a,
  ...v
}, I) => {
  const r = D(c), s = e !== void 0, f = p ?? !s, S = (t) => {
    if (i) {
      t.preventDefault(), t.stopPropagation();
      return;
    }
    a == null || a(t);
  }, d = typeof n == "number", g = d ? { width: `${n}px`, height: `${n}px` } : void 0, u = d ? void 0 : {
    xs: o.iconXs,
    sm: o.iconSm,
    md: o.iconMd,
    lg: o.iconLg,
    xl: o.iconXl
  }[n], h = {
    primary: o.iconPrimary,
    secondary: o.iconSecondary,
    tertiary: o.iconTertiary,
    inverted: o.iconInverted
  }[m], X = {
    ...{
      WebkitMaskImage: `url(${r})`,
      maskImage: `url(${r})`
    },
    ...g,
    ...y
  };
  return /* @__PURE__ */ x(
    "span",
    {
      ref: I,
      role: s ? "img" : void 0,
      "aria-label": e,
      "aria-hidden": f || void 0,
      "aria-disabled": i || void 0,
      className: M(
        o.icon,
        u,
        h,
        l && !i && o.iconInteractive,
        i && o.iconDisabled,
        _
      ),
      style: X,
      onClick: S,
      ...v
    }
  );
});
H.displayName = "Icon";
export {
  H as I,
  M as c
};
