"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("../../types/analytics/analytics.cjs.js"),q=require("../../utils/cn/cn.cjs.js"),i=require("../../src/modules/IndividualProductCardV2/individualProductCardV2.module.css"),I=require("../../components/AdvancedGallery/AdvancedGallery.cjs.js"),D=require("../../components/ImageGallery/ImageGallery.cjs.js"),S=require("../../components/RatingPreview/RatingPreview.cjs.js"),u=require("../../components/Typography/Typography.cjs.js"),F=require("../../components/FeaturesList/FeaturesList.cjs.js"),V=require("../../components/PlainFeaturesGroup/PlainFeaturesGroup.cjs.js"),L=require("../../components/PriceDisplay/PriceDisplay.cjs.js"),k=require("../IndividualProductCard/components/PlanCard/PlanCard.cjs.js"),R=require("../../components/Button/Button.cjs.js"),B=require("../../components/Quote/Quote.cjs.js"),M=t=>{const{zenpatientId:y,signupUrl:c,name:f,description:A,label:m,images:G,advancedGallery:p,features:N,quote:v,featuresGroup:h,ratingPreview:g,view:r,button:a}=t,n=r==="plans_list"?t.plans:void 0,T=n&&n.length>0,x=r==="plans_list"?t.selectedPlanId:void 0,o=n==null?void 0:n.find(s=>s.id===x),_=o?`${(a==null?void 0:a.link)||c}?defaultDurationSelection=${o==null?void 0:o.durationAmount}`:(a==null?void 0:a.link)||c,j=r==="pricing_display"?t.priceDisplay:void 0,E={event:d.EAnalyticsEvent.ctaClicked,type:d.EAnalyticsEventType.interaction,component:"Pricing",payload:{ctaLabel:(a==null?void 0:a.text)||"GET STARTED",ctaLink:_||c,productId:y}},C=s=>{var P;if(r!=="plans_list"||!t.onSelectPlan)return;t.onSelectPlan(s);const l=n==null?void 0:n.find(w=>w.id===s),b={event:d.EAnalyticsEvent.userSelectedPlan,location:"IPCv2",type:d.EAnalyticsEventType.interaction,payload:{productId:y,planId:s,planPrice:l==null?void 0:l.price,planDuration:l==null?void 0:l.duration}};(P=window.eventBus)==null||P.emit("analytics",b)};return e.jsx("section",{className:i.root,children:e.jsxs("div",{className:i.mainContainer,children:[e.jsxs("div",{className:i.leftColumn,children:[p&&p.items.length>0?e.jsx(I.AdvancedGallery,{items:p.items,label:m}):e.jsx(D.ImageGallery,{images:G,label:m}),e.jsx("div",{className:q.cn(i.ratingContainer,i.mobileOnly),children:e.jsx(S.RatingPreview,{...g})}),v&&e.jsx("div",{className:i.quoteWrapper,children:e.jsx(B.Quote,{...v})})]}),e.jsxs("div",{className:i.rightColumn,children:[e.jsxs("div",{className:i.header,children:[e.jsx(u.Typography,{as:"h1",defaultVariant:"displayXs",mobileVariant:"headingLg",children:f}),e.jsx(u.Typography,{as:"p",defaultVariant:"bodyMd",mobileVariant:"bodySm",className:i.description,children:A})]}),e.jsx(F.FeaturesList,{features:N}),h&&e.jsx(V.PlainFeaturesGroup,{...h}),r==="pricing_display"&&j&&e.jsx(L.PriceDisplay,{items:j}),r==="plans_list"&&T&&e.jsx("div",{className:i.plansSection,children:e.jsxs("div",{className:i.plans,children:[e.jsx(u.Typography,{as:"h4",defaultVariant:"labelSm",emphasis:!0,weight:"regular",children:"Subscribe & Save"}),n.map(s=>e.jsx(k.PlanCard,{plan:s,onSelect:C,isActive:x===s.id},s.id))]})}),e.jsx("div",{className:q.cn(i.ratingContainer,i.desktopOnly),children:e.jsx(S.RatingPreview,{...g})}),e.jsxs("div",{className:i.actions,children:[e.jsx(R.Button,{as:"a",variant:"primary",size:"lg",href:_||c,analyticsProps:E,children:(a==null?void 0:a.text)||"Get started"}),e.jsx(u.Typography,{as:"p",defaultVariant:"labelMd",className:i.hsaFsaText,children:"HSA/FSA Eligible"})]})]})]})})};exports.IndividualProductCardV2=M;
