"use strict";var jsxRuntime=require("react/jsx-runtime"),ProductSubscriptionOptions=require("./ProductSubscriptionOptions.js"),SellingPlanLabel=require("./SellingPlanLabel.js"),SubscriptionRadio=require("./SubscriptionRadio.js"),index=require("../../../constants/index.js"),handleContainerKeyDown=require("../helpers/handleContainerKeyDown.js");const ProductSubscriptionContent=({data:e,setting:n,styles:i,builderProps:t})=>{let{visibility:s,productId:o,renderType:r,radioGroupName:l,direction:u,containerClasses:a,subscriptionStyles:d,selectedValue:c,sellingPlanOptions:p,handleSellingPlanChange:S,onSelectType:b}=e,x=r===index.SubscriptionEnum.SUBSCRIPTION&&(s.selectedType===index.SubscriptionEnum.ONE_TIME&&s.requiresSellingPlan||s.selectedType===r);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s.shouldShowRadio&&jsxRuntime.jsx(SubscriptionRadio.SubscriptionRadio,{id:`${t?.uid??""}-${o}-${r}-radio`,name:l,value:r,checked:s.selectedType===r,className:"!gp-items-start",onChange:e=>{e.target.checked&&b(r)}}),jsxRuntime.jsxs("div",{"data-component-container":!0,className:a,style:d,onClick:()=>b(r),onKeyDown:e=>handleContainerKeyDown.handleContainerKeyDown({event:e,type:r,shouldShowRadio:s.shouldShowRadio,selectedType:s.selectedType,onSelectType:b}),role:"button",tabIndex:0,children:[jsxRuntime.jsx(SellingPlanLabel.SellingPlanLabel,{setting:n,styles:i,id:`label-${t?.uid??""}-${o}-${r}-radio`}),x&&jsxRuntime.jsx(ProductSubscriptionOptions.ProductSubscriptionOptions,{direction:u,setting:n,styles:i,builderProps:t,productId:o,sellingPlanOptions:p,selectedValue:c,onSellingPlanChange:S})]})]})};exports.ProductSubscriptionContent=ProductSubscriptionContent;
