(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[227],{98710:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/administration/upgrade-subscription",function(){return n(88729)}])},88729:function(e,t,n){"use strict";n.r(t);var i=n(85893),o=n(67294),s=n(86886),a=n(99226),r=n(11057),c=n(11431),l=n(87066),d=n(87536),x=n(11163),p=n(81406);t.default=()=>{let[e,t]=(0,o.useState)([]),[n,u]=(0,o.useState)([]);console.log("subscriptionData",n);let[h,g]=(0,o.useState)("Monthly"),f=(0,x.useRouter)(),{organizationKeyId:y,token:b,email:j}=f.query,handleGetItNow=async e=>{let{organizationKeyId:t,token:n,email:i}=f.query,o={subscriptionKeyId:e.subscriptionKeyId,organizationKeyId:t};try{let s=await l.Z.post("".concat(p.Ao,"/api/subscriptions?subscriptionKeyId=").concat(null==e?void 0:e.subscriptionKeyId,"&organizationKeyId=").concat(t),o);console.log("response.",s.data),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:Z,setValue:S,handleSubmit:k,formState:{errors:F}}=(0,d.cI)({}),handleCheckboxChange=e=>{let t=e.target.value;g(e=>e===t?"":t)};(0,o.useEffect)(()=>{h&&getSubscription()},[h]);let getRadioButtonvalue=async()=>{try{let e=await l.Z.get("".concat(p.Ao,"/api/subscriptions/time-period"));t(e.data)}catch(e){console.error("Error fetching subscription data",e)}};(0,o.useEffect)(()=>{getRadioButtonvalue()},[h]);let getSubscription=async()=>{try{let e=await l.Z.get("".concat(p.Ao,"/api/subscriptions?timePeriod=").concat(h,"&token=").concat(b,"&emailId=").concat(j));u(e.data)}catch(e){console.error("Error fetching subscription data:",e)}};return(0,i.jsxs)(a.Z,{children:[(0,i.jsxs)(s.ZP,{container:!0,sx:{background:"#FAFBFC",padding:"15px",marginBottom:"15px"},children:[(0,i.jsx)(s.ZP,{item:!0,lg:6,sx:{display:"flex",justifyContent:"center"},children:(0,i.jsx)(a.Z,{children:"How often would you like to be billed ?"})}),(0,i.jsxs)(s.ZP,{item:!0,lg:6,sx:{display:"flex"},children:[e.map(e=>(0,i.jsxs)(a.Z,{children:[(0,i.jsx)("input",{type:"radio",value:e.label,checked:h===e.label,onChange:handleCheckboxChange}),"\xa0",(0,i.jsx)("label",{children:e.label}),"\xa0 \xa0 \xa0 \xa0"]},e.label)),"\xa0 \xa0 \xa0 \xa0"]})]}),(0,i.jsxs)(s.ZP,{container:!0,children:[(0,i.jsx)(s.ZP,{lg:1.5}),null==n?void 0:n.map(e=>(0,i.jsx)(s.ZP,{item:!0,lg:3,children:(0,i.jsxs)(a.Z,{sx:{background:"#ffff",border:"1px solid #DFE1E5"},children:[(0,i.jsx)("center",{style:{padding:"20px",fontSize:"20px",fontWeight:"bolder",background:"#FAFBFC",color:"black"},children:null==e?void 0:e.name}),(0,i.jsxs)(a.Z,{sx:{borderBottom:"1px solid #F8F8F9"},children:[" ",(0,i.jsxs)("center",{children:[(0,i.jsxs)(a.Z,{sx:{fontSize:"45px",margin:"10px",display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,i.jsx)(c.Z,{icon:"fa:inr",style:{fontSize:"40px"}})," \xa0",e.price]}),(0,i.jsx)(a.Z,{sx:{fontWeight:"bolder",color:"grey",fontSize:"13px"},children:null==e?void 0:e.description}),(0,i.jsx)(r.Z,{sx:{border:"1px solid #3172FF",margin:"25px",fontSize:"12px"},onClick:()=>handleGetItNow(e),children:"Get it now"})]})]}),(0,i.jsx)(s.ZP,{container:!0,sx:{marginBottom:"40px"},children:(0,i.jsx)(s.ZP,{item:!0,lg:12,children:(0,i.jsxs)(a.Z,{sx:{padding:"23px 20px"},children:[(0,i.jsx)(a.Z,{sx:{fontSize:"16px",fontWeight:"bolder",color:"black"},children:"Features"}),(0,i.jsxs)(a.Z,{sx:{paddingTop:"15px"},children:[(0,i.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center"},children:[" ",(0,i.jsx)(c.Z,{icon:"charm:tick",style:{color:"#3CA481"}}),"\xa0"," ",(0,i.jsxs)("span",{style:{color:"#79C6FF",fontWeight:"200",fontSize:"15px"},children:[null==e?void 0:e.maxStaff,"\xa0staffs"]})]}),(0,i.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",paddingTop:"5px"},children:[" ",(0,i.jsx)(c.Z,{icon:"charm:tick",style:{color:"#3CA481"}}),"\xa0",(0,i.jsxs)("span",{style:{color:"#79C6FF",fontWeight:"200",fontSize:"15px"},children:[null==e?void 0:e.maxProducts,"\xa0Products"]})]})," ",(0,i.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",paddingTop:"5px"},children:[" ",(0,i.jsx)(c.Z,{icon:"charm:tick",style:{color:"#3CA481"}}),"\xa0"," ",(0,i.jsxs)("span",{style:{color:"#79C6FF",fontWeight:"200",fontSize:"15px"},children:[null==e?void 0:e.maxStores,"\xa0Stores"]})]})]})]})})})]})},e.subscriptionKeyId)),(0,i.jsx)(s.ZP,{lg:1.5})]})]})}}},function(e){e.O(0,[7536,9774,2888,179],function(){return e(e.s=98710)}),_N_E=e.O()}]);