"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("../../utils/formatDate.cjs.js"),r=require("../../utils/cn/cn.cjs.js"),x=require("../../types/analytics/analytics.cjs.js"),a=require("../../src/components/StudyGridCard/studyGridCard.module.css"),n=require("../Typography/Typography.cjs.js"),c=require("../TextButton/TextButton.cjs.js"),o=require("../Icon/constants.cjs.js"),b=require("../Label/Label.cjs.js");function f(t){const l=()=>{var s;if(t.trackingEvent){const i={event:t.trackingEvent,location:t.trackingLocation||"",type:x.EAnalyticsEventType.interaction,payload:{scienceCardTitle:t.title}};(s=window.eventBus)==null||s.emit("analytics",i)}};if(t.compressed===!0){const{title:s,link:i,image:d}=t;return e.jsxs("div",{className:r.cn(a.study,a.studyCompressed),children:[e.jsx("div",{className:r.cn(a.imagePart,a.imagePartCompressed),style:{backgroundImage:`url(${d})`}}),e.jsxs("div",{className:r.cn(a.dataPart,a.dataPartCompressed),children:[e.jsx(n.Typography,{className:r.cn(a.title,a.titleCompressed),defaultVariant:"headingSm",mobileVariant:"bodySm",as:"h6",children:s}),e.jsxs("div",{className:a.button,children:[e.jsx(c.TextButton,{hideOn:"desktop",size:"sm",as:"a",href:i,suffixIcon:o.EIconName.ARROW_FORWARD,onClick:l,children:"READ MORE"}),e.jsx(c.TextButton,{hideOn:"mobile",size:"lg",as:"a",href:i,suffixIcon:o.EIconName.ARROW_FORWARD,onClick:l,children:"READ MORE"})]})]}),e.jsx("div",{className:a.borderLeft}),e.jsx("div",{className:a.borderRight})]})}else{const{title:s,link:i,image:d,inverted:y,date:m,label:u,readTime:g}=t;return e.jsxs("div",{className:a.study,"data-inverted":y,children:[e.jsx("div",{className:a.imagePart,style:{backgroundImage:`url(${d})`},children:u&&e.jsx(b.Label,{...u})}),e.jsxs("div",{className:a.dataPart,children:[e.jsxs("div",{className:a.info,children:[e.jsx(n.Typography,{className:a.date,defaultVariant:"labelSm",mobileVariant:"labelXs",emphasis:!0,weight:"medium",color:"color-neutral-500",children:h.formatDate(m)}),e.jsx(n.Typography,{className:a.mobileDate,defaultVariant:"labelSm",mobileVariant:"labelXs",emphasis:!0,weight:"medium",color:"color-neutral-500",children:h.formatDate(m,{year:"2-digit"}).replaceAll(" / ","/")}),e.jsxs(e.Fragment,{children:[e.jsx(n.Typography,{defaultVariant:"labelSm",mobileVariant:"labelXs",emphasis:!0,weight:"medium",color:"color-neutral-500",align:"center",children:"•"}),e.jsxs(n.Typography,{defaultVariant:"labelSm",mobileVariant:"labelXs",emphasis:!0,weight:"medium",color:"color-neutral-500",children:[g," MIN READ"]})]})]}),e.jsx(n.Typography,{className:a.title,defaultVariant:"headingSm",mobileVariant:"bodySm",as:"h6",children:s}),e.jsxs("div",{className:a.button,children:[e.jsx(c.TextButton,{hideOn:"desktop",size:"sm",as:"a",href:i,suffixIcon:o.EIconName.ARROW_FORWARD,onClick:l,children:"READ MORE"}),e.jsx(c.TextButton,{hideOn:"mobile",size:"lg",as:"a",href:i,suffixIcon:o.EIconName.ARROW_FORWARD,onClick:l,children:"READ MORE"})]})]})]})}}exports.StudyGridCard=f;
