"use client";
import { j as e } from "../../../node_modules/.pnpm/react@19.1.0/node_modules/react/jsx-runtime.mjs";
import { Popover as o } from "@mantine/core";
import { useDisclosure as P } from "@mantine/hooks";
import t from "../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.mjs";
import "react";
import { ReactComponent as T } from "../../assets/images/InfoIcon.svg.mjs";
import y from "../AchievementProgress/index.mjs";
import M from "../AchievementProgress/components/ProgressKey/index.mjs";
import R from "../AchievementProgress/helpers/getProgress.mjs";
import { CardGeneric as B } from "../CardGeneric/index.mjs";
import s from "./AchievementCard.module.scss.mjs";
import D from "./components/StatusIcon/index.mjs";
function U({
  image: c,
  title: m,
  imageProps: d = {},
  ctaProps: r = {},
  mintedAchievementsCount: h,
  totalAchievementsCount: p,
  mintableAchievementsCount: f,
  isNewAchievement: u = !1,
  state: v = "default",
  i18n: n = {
    newAchievementLabel: "New Achievement",
    achievementInfoTitleLabel: "Achievement progress"
  },
  progressKeyProps: x,
  achievementProgressProps: j,
  showStatusIcon: N = !0,
  ...g
}) {
  const [b, { close: w, open: I }] = P(!1), { safeMintedCount: i, safeTotalCount: a, mintedProgress: A, mintableProgress: L } = R({
    mintedAchievementsCount: h,
    totalAchievementsCount: p,
    mintableAchievementsCount: f
  });
  let l = null;
  N && (l = /* @__PURE__ */ e.jsx(
    D,
    {
      ...r,
      state: v,
      className: t(r.className, s.addButton)
    }
  ));
  const C = /* @__PURE__ */ e.jsx("div", { className: s.icon, children: /* @__PURE__ */ e.jsxs(o, { width: 200, shadow: "md", opened: b, position: "top", children: [
    /* @__PURE__ */ e.jsx(o.Target, { children: /* @__PURE__ */ e.jsx(
      "button",
      {
        onMouseEnter: I,
        onMouseLeave: w,
        className: s.popoverButton,
        children: /* @__PURE__ */ e.jsx(
          T,
          {
            height: 16,
            width: 16,
            fill: "var(--color-neutral-400)"
          }
        )
      }
    ) }),
    /* @__PURE__ */ e.jsxs(o.Dropdown, { className: s.popover, children: [
      /* @__PURE__ */ e.jsx("div", { className: "text--sm color-neutral-400", children: n.achievementInfoTitleLabel }),
      /* @__PURE__ */ e.jsx("div", { className: s.popoverRow, children: /* @__PURE__ */ e.jsx(
        M,
        {
          safeMintedCount: i,
          safeTotalCount: a,
          direction: "column",
          ...x
        }
      ) })
    ] })
  ] }) });
  return /* @__PURE__ */ e.jsxs(
    B,
    {
      className: t(s.card, g.className),
      image: c,
      imageProps: d,
      i18n: { label: n.newAchievementLabel },
      statusIcon: l ?? void 0,
      showLabel: u,
      children: [
        /* @__PURE__ */ e.jsx("div", { className: t(s.title, "body"), children: m }),
        /* @__PURE__ */ e.jsx("div", { className: s.achievements, children: /* @__PURE__ */ e.jsx("div", { className: s.column, children: /* @__PURE__ */ e.jsx(
          y,
          {
            safeMintedCount: i,
            safeTotalCount: a,
            mintedProgress: A,
            mintableProgress: L,
            rightIcon: C,
            ...j
          }
        ) }) })
      ]
    }
  );
}
export {
  U as default
};
//# sourceMappingURL=index.mjs.map
