import { jsx as u } from "react/jsx-runtime";
import { J as m, aG as d } from "./use-page-data.BYLN5MSa.js";
import { c as e, a as h } from "./twind.Cg2g8xBZ.js";
import { b as k } from "./use-section-style.CqWLdjop.js";
import { B as b } from "./BrickRoot.CQgjTuOI.js";
function x({ brick: r, editable: o }) {
  const s = k(r), { props: t } = r, i = Object.values(s), l = m(), a = (p) => {
    if (o) {
      p.preventDefault();
      return;
    }
    if (t.link)
      if (t.link.startsWith("http"))
        window.open(t.link, "_blank");
      else {
        const n = l.find((f) => f.id === t.link);
        n && (window.location.href = n.path);
      }
  }, c = t.fill === "outline" ? e({
    backgroundColor: "transparent",
    border: "2px solid currentColor",
    "&:hover": {
      backgroundColor: "currentColor",
      color: "light-dark(white, black)"
    }
  }) : e({
    "&:hover": {
      filter: "brightness(1.15)"
    }
  });
  return /* @__PURE__ */ u(
    b,
    {
      brick: r,
      manifest: d,
      editable: o,
      as: "button",
      type: "button",
      className: h(i, "btn", c, o && "pointer-events-none"),
      "data-prevented-by-editor": o ? "true" : "false",
      onClick: a,
      children: t.label
    }
  );
}
export {
  x as default
};
