(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9620],{47163:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/register/subscriptionPage",function(){return n(14268)}])},14268:function(e,t,n){"use strict";n.r(t);var i=n(85893),a=n(67294),s=n(86886),o=n(99226),r=n(11057),l=n(11431),c=n(87066),d=n(87536),u=n(11163),x=n(81805);let Subscription=()=>{let[e,t]=(0,a.useState)([]),[n,x]=(0,a.useState)([]),[p,h]=(0,a.useState)("Monthly"),f=(0,u.useRouter)(),handleGetItNow=async e=>{let{organizationKeyId:t,token:n,email:i}=f.query,a={subscriptionKeyId:e.subscriptionKeyId,organizationKeyId:t};try{let s=await c.Z.post("".concat(dynamicBaseUrl,"/api/subscriptions?subscriptionKeyId=").concat(null==e?void 0:e.subscriptionKeyId,"&organizationKeyId=").concat(t),a);sessionStorage.setItem("organizationSubscriptionKeyId",JSON.stringify({value:s.data})),sessionStorage.setItem("paymentData",JSON.stringify({value:e})),f.push("/dashboards/paymentPage?organizationKeyId=".concat(t,"&token=").concat(n,"&email=").concat(i))}catch(e){console.error("Error fetching subscription data:",e)}},{reset:m,control:g,setValue:b,handleSubmit:y,formState:{errors:j}}=(0,d.cI)({}),handleCheckboxChange=e=>{let t=e.target.value;h(e=>e===t?"":t)};(0,a.useEffect)(()=>{p&&getSubscription()},[p]);let getRadioButtonvalue=async()=>{try{let e=await c.Z.get("".concat(dynamicBaseUrl,"/api/subscriptions/time-period"));t(e.data)}catch(e){console.error("Error fetching subscription data",e)}};(0,a.useEffect)(()=>{getRadioButtonvalue()},[p]);let getSubscription=async()=>{try{let e=window.location.href,t=new URL(e),n=t.searchParams.get("token"),i=t.searchParams.get("email"),a=await c.Z.get("".concat(dynamicBaseUrl,"/api/subscriptions?timePeriod=").concat(p,"&token=").concat(n,"&emailId=").concat(i));x(a.data)}catch(e){console.error("Error fetching subscription data:",e)}};return(0,i.jsx)(o.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",minHeight:"100vh",width:"100%",background:"white",padding:"20px"},children:(0,i.jsxs)(s.ZP,{container:!0,spacing:4,sx:{width:"100%",maxWidth:"1200px",mx:"auto"},children:[(0,i.jsx)(s.ZP,{item:!0,xs:12,children:(0,i.jsxs)(o.Z,{sx:{textAlign:"center",mb:10},children:[(0,i.jsx)(o.Z,{sx:{fontSize:"24px",fontWeight:"bold",mb:2},children:"How often would you like to be billed?"}),(0,i.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",flexWrap:"wrap"},children:e.map(e=>(0,i.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",mx:1},children:[(0,i.jsx)("input",{type:"radio",value:e.label,checked:p===e.label,onChange:handleCheckboxChange,style:{cursor:"pointer"}}),(0,i.jsx)("label",{style:{marginLeft:"8px"},children:e.label})]},e.label))})]})}),(0,i.jsx)(s.ZP,{container:!0,spacing:10,justifyContent:"center",children:null==n?void 0:n.map(e=>(0,i.jsx)(s.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,i.jsxs)(o.Z,{sx:{background:"#ffffff",borderRadius:"20px",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)",padding:"20px",textAlign:"center",display:"flex",flexDirection:"column",justifyContent:"space-between",height:"100%"},children:[(0,i.jsxs)(o.Z,{sx:{fontSize:"20px",fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:[(null==e?void 0:e.name)==="Free"||(null==e?void 0:e.name)==="Free-Yearly"?(0,i.jsx)(l.Z,{icon:"material-symbols:rocket-launch",style:{color:"#f4e022",marginRight:"10px"}}):(null==e?void 0:e.name)==="Enterprise  "||(null==e?void 0:e.name)==="Enterprise  -Yearly"?(0,i.jsx)(l.Z,{icon:"material-symbols:enterprise",style:{color:"#5a37c3",marginRight:"10px"}}):(0,i.jsx)(l.Z,{icon:"fluent:premium-12-filled",style:{color:"red",marginRight:"10px"}}),null==e?void 0:e.name]}),(0,i.jsxs)(o.Z,{sx:{fontSize:"45px",mb:2,display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,i.jsx)(l.Z,{icon:"fa:inr",style:{fontSize:"40px"}})," \xa0",e.price]}),(0,i.jsx)(o.Z,{sx:{fontWeight:"bold",color:"grey",fontSize:"13px",mb:8},children:null==e?void 0:e.description}),(0,i.jsxs)(o.Z,{sx:{mb:4},children:[(0,i.jsx)(o.Z,{sx:{fontSize:"16px",fontWeight:"bold",mb:8},children:"Features"}),(0,i.jsx)(o.Z,{children:[{label:"staffs",value:null==e?void 0:e.maxStaff},{label:"Products",value:null==e?void 0:e.maxProducts},{label:"Stores",value:null==e?void 0:e.maxStores}].map(e=>(0,i.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",mb:4},children:[(0,i.jsx)(l.Z,{icon:"charm:tick",style:{color:"#3CA481",marginRight:"8px"}}),(0,i.jsxs)("span",{style:{fontWeight:"500",fontSize:"15px"},children:[e.value,"\xa0",e.label]})]},e.label))})]}),(0,i.jsx)(r.Z,{variant:"contained",fullWidth:!0,sx:{background:"#ea5455",borderColor:"#ea5455",color:"white",borderRadius:"20px",mt:"auto",mb:8},onClick:()=>handleGetItNow(e),children:"Get it now"})]})},e.subscriptionKeyId))})]})})};Subscription.getLayout=e=>(0,i.jsx)(x.Z,{children:e}),Subscription.guestGuard=!0,t.default=Subscription}},function(e){e.O(0,[7536,9774,2888,179],function(){return e(e.s=47163)}),_N_E=e.O()}]);