"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("../../utils/cn/cn.cjs.js"),c=require("../../types/analytics/analytics.cjs.js"),a=require("../../src/modules/IndividualProductCard/individualProductCard.module.css"),k=require("../../components/PlainFeaturesGroup/PlainFeaturesGroup.cjs.js"),F=require("../../components/ImageGallery/ImageGallery.cjs.js"),x=require("../../components/RatingPreview/RatingPreview.cjs.js"),I=require("../../components/Quote/Quote.cjs.js"),m=require("../../components/Typography/Typography.cjs.js"),C=require("../../components/Button/Button.cjs.js"),G=require("../../components/TextButton/TextButton.cjs.js"),L=require("../../components/FeaturesList/FeaturesList.cjs.js"),R=require("./components/PlanCard/PlanCard.cjs.js"),B=require("../../components/SmartCallout/SmartCallout.cjs.js"),V=({zenpatientId:b,name:o,description:y,features:N,featuresGroup:p,images:q,quote:h,label:E,rating:v,ratingText:j,plans:s,button:r,textButton:t,selectedPlanId:g,onSelectPlan:l,trackingEvent:T,trackingLocation:_,signupUrl:w})=>{const d=s&&s.length>0&&l,f=i=>{if(l==null||l(i),T){const n=s==null?void 0:s.find(A=>A.id===i);c.EAnalyticsEventType.interaction,n==null||n.price,n==null||n.duration}},P=()=>{var n;const i={event:c.EAnalyticsEvent.ctaClicked,location:_||"not_set",type:c.EAnalyticsEventType.interaction,component:"IndividualProductCard",element:"primary_button",payload:{productId:b,ctaLabel:r.label,productName:o,selectedPlanId:g||"none"}};(n=window.eventBus)==null||n.emit("analytics",i)},S=()=>{var i;(i=window.eventBus)==null||i.emit("analytics",{event:c.EAnalyticsEvent.ctaClicked,location:_||"not_set",type:c.EAnalyticsEventType.interaction,component:"IndividualProductCard",element:"secondary_button",payload:{ctaLabel:t==null?void 0:t.label,productName:o}})};return e.jsx("section",{className:a.root,children:e.jsxs("div",{className:u.cn(a.container,!d&&a.noPlans),children:[e.jsxs("div",{className:a.gallery,children:[e.jsx(F.ImageGallery,{images:q,label:E}),e.jsx("div",{className:u.cn(a.ratingContainer,a.mobileOnly),children:e.jsx(x.RatingPreview,{rating:v,text:j})}),h&&e.jsx("div",{className:a.quoteWrapper,children:e.jsx(I.Quote,{...h})})]}),e.jsxs("div",{className:a.info,children:[e.jsxs("div",{className:a.infoHeader,children:[e.jsx(m.Typography,{as:"h3",defaultVariant:"displayXs",mobileVariant:"headingLg",weight:"regular",children:o}),!!y&&e.jsx(m.Typography,{as:"p",defaultVariant:"bodySm",className:a.infoDescription,weight:"regular",children:y})]}),!d&&e.jsxs("div",{className:a.actions,children:[e.jsx(C.Button,{variant:"primary",size:"lg",...r,onClick:P,children:r.label}),t&&e.jsx(G.TextButton,{...t,onClick:S,children:t.label})]}),e.jsx(L.FeaturesList,{features:N}),p&&e.jsx(k.PlainFeaturesGroup,{...p})]}),d&&e.jsxs("div",{className:a.plansSection,children:[e.jsxs("div",{className:a.plans,children:[e.jsx(m.Typography,{as:"h4",defaultVariant:"labelSm",emphasis:!0,weight:"regular",children:"Subscribe & Save"}),s.map(i=>e.jsx(R.PlanCard,{plan:i,onSelect:f,isActive:g===i.id},i.id))]}),e.jsx("div",{className:u.cn(a.ratingContainer,a.desktopOnly),children:e.jsx(x.RatingPreview,{rating:v,text:j})}),e.jsxs("div",{className:a.actions,children:[e.jsx(C.Button,{variant:"primary",size:"lg",as:"a",href:w||"#0",...r,children:r.label}),e.jsx(B.SmartCallout,{label:"HSA/FSA Eligible",type:"plain"})]})]})]})})};exports.IndividualProductCard=V;
