import { jsxs as t, jsx as a, Fragment as f } from "react/jsx-runtime";
import { formatDate as u } from "../../../../utils/formatDate.es.js";
import { EAnalyticsEventType as y } from "../../../../types/analytics/analytics.es.js";
import e from "../../../../modules/ResearchFeatured/components/FeaturedArticle/featuredArticle.module.css";
import { Typography as o } from "../../../../components/Typography/Typography.es.js";
const x = ({
  image: n,
  date: s,
  readTime: i,
  title: c,
  link: m,
  trackingEvent: l,
  trackingLocation: d
}) => {
  const p = () => {
    var r;
    if (l) {
      const h = {
        event: l,
        location: d || "",
        type: y.interaction,
        payload: {
          articleTitle: document.title
        }
      };
      (r = window.eventBus) == null || r.emit("analytics", h);
    }
  };
  return /* @__PURE__ */ t("a", { href: m, className: e.root, onClick: p, children: [
    /* @__PURE__ */ a("img", { src: n, alt: "article image", className: e.image }),
    /* @__PURE__ */ t("div", { className: e.content, children: [
      /* @__PURE__ */ t(
        o,
        {
          as: "p",
          defaultVariant: "labelSm",
          mobileVariant: "labelXs",
          emphasis: !0,
          weight: "medium",
          color: "color-neutral-500",
          className: e.info,
          children: [
            /* @__PURE__ */ a("span", { children: u(s) }),
            !!i && /* @__PURE__ */ t(f, { children: [
              /* @__PURE__ */ a("span", { children: "•" }),
              /* @__PURE__ */ t("span", { children: [
                i,
                " MIN READ"
              ] })
            ] })
          ]
        }
      ),
      /* @__PURE__ */ a(o, { defaultVariant: "bodySm", className: e.title, children: c })
    ] }),
    /* @__PURE__ */ a("div", { className: e.borderLeft }),
    /* @__PURE__ */ a("div", { className: e.borderRight })
  ] });
};
export {
  x as FeaturedArticle
};
