(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5405],{48312:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return s(14186)}])},1217:function(e,t,s){"use strict";s.d(t,{Z:function(){return C}});var n=s(85893),a=s(11163),i=s(67294),o=s(74346),r=function(e){let{verificationStatus:t,firstName:s,description:a}=e,[o,r]=(0,i.useState)();return(0,i.useEffect)(()=>{r(t?"Account verified":"Verify your account")},[t]),(0,n.jsx)("section",{className:"flex justify-between items-center w-full font-creato py-4 px-4 mb-3 rounded-2xl bg-white",children:(0,n.jsxs)("aside",{children:[(0,n.jsxs)("h1",{className:"text-[1rem] xs:text-[2.375rem] sm-text-[2.375rem] md-text-[2.375rem] lg:text-[2.375rem] xl:text-[2.375rem] font-semibold m-0",children:["Welcome, ",s]}),(0,n.jsx)("p",{className:"text-sm text-autotext-dark-gray font-normal m-0",children:a})]})})},l=s(39082),c=s(41476),d=s(36822),u=s(69397),m=s(25675),x=s.n(m),f=s(26692),h=s(60856),p=s(99487),w=s(10006);async function b(e,t,s,n){await p.hi.get(w.MZ,{headers:{Authorization:"".concat(e)},params:{brandId:t}}).then(e=>{s(e.data)}).catch(e=>{n(e)})}var g=s(30154),j=s.n(g),y=s(64666),N=s(51649),v=s(39332);function k(e){let{open:t,days:s}=e,a=(0,v.useRouter)(),[o,r]=(0,i.useState)(t);(0,i.useEffect)(()=>{r(t)},[t]);let l=()=>{r(!1)},c=()=>{a.push("/manage#subscription")};return(0,n.jsx)(y.Z,{open:o,PaperProps:{style:{backgroundColor:"transparent",boxShadow:"none",overflow:"hidden"}},children:(0,n.jsxs)("div",{className:"dialog-container flex flex-col justify-center bg-white items-center bg-transparent rounded-lg w-full max-w-lg h-auto shadow-none relative p-2 md:p-4",children:[(0,n.jsx)(N.QAE,{className:"absolute top-2 right-2 cursor-pointer text-gray-500 hover:text-red-500",size:24,onClick:l}),(0,n.jsxs)("div",{className:"text-center mb-4 md:mb-3",children:[(0,n.jsx)("p",{className:"font-creato text-black text-xl mb-0 font-extrabold",children:"You missed renewing your Basic Plan subscription"}),(0,n.jsx)("p",{className:"font-creato font-medium text-base m-0 mt-2 mb-1 text-[#151515]",children:"No worries, continue by renewing within your Grace Period"})]}),(0,n.jsx)("button",{className:"bg-[#002366] text-white mb-2 mt-4 px-8 py-3 md:px-12 md:py-4 text-base font-normal rounded-lg cursor-pointer",onClick:c,children:"Renew Now"})]})})}var S=s(70385);function E(e){let{open:t,days:s}=e,a=(0,v.useRouter)(),[o,r]=(0,i.useState)(t);(0,i.useEffect)(()=>{r(t)},[t]);let l=()=>{r(!1)},c=()=>{a.push("/manage#subscription")};return(0,n.jsx)(y.Z,{open:o,PaperProps:{style:{backgroundColor:"transparent",boxShadow:"none",overflow:"hidden"}},children:(0,n.jsxs)("div",{className:"dialog-container flex flex-col justify-center bg-white items-center bg-transparent rounded-lg w-96 max-w-md h-auto shadow-none relative p-4 md:p-8",children:[(0,n.jsx)(N.QAE,{className:"absolute top-2 right-2 cursor-pointer text-gray-500 hover:text-red-500",size:24,onClick:l}),(0,n.jsx)("div",{className:"w-full flex justify-center mb-1 md:mb-1",children:(0,n.jsx)("img",{src:"/expirelogo.svg",alt:"Reminder",className:"w-1/4 md:w-1/3 h-auto"})}),(0,n.jsxs)("div",{className:"text-center mb-4 md:mb-8",children:[(0,n.jsx)("p",{className:"font-creato text-black text-xl mb-0 font-extrabold",children:"Reminder!!!"}),(0,n.jsxs)("p",{className:"font-creato font-medium text-base m-0 mt-2 mb-2 text-[#151515]",children:["Your Basic Plan Free Trial ends in ",s," days"]}),(0,n.jsx)("p",{className:"font-creato font-medium text-sm m-0 mt-1 mb-0 text-[#151515]",children:"Please pay to continue using AutoText"})]}),(0,n.jsx)("button",{className:"bg-[#002366] text-white px-8 py-3 md:px-12 md:py-4 text-base font-normal rounded-lg cursor-pointer",onClick:c,children:"Pay Now"})]})})}function P(e){let{open:t,days:s}=e,a=(0,v.useRouter)(),[o,r]=(0,i.useState)(t);(0,i.useEffect)(()=>{console.log("BasicPlanReminder open prop:",t),r(t)},[t]);let l=()=>{r(!1)},c=()=>{a.push("/manage#subscription")};return(0,n.jsx)(y.Z,{open:o,PaperProps:{style:{backgroundColor:"transparent",boxShadow:"none",overflow:"hidden"}},children:(0,n.jsxs)("div",{className:"dialog-container flex flex-col  justify-center bg-white items-center bg-transparent rounded-lg w-96 max-w-md h-auto shadow-none relative p-2 md:p-4",children:[(0,n.jsx)(N.QAE,{className:"absolute top-2 right-2 cursor-pointer text-gray-500 hover:text-red-500",size:24,onClick:l}),(0,n.jsxs)("div",{className:"text-center mb-4 md:mb-3",children:[(0,n.jsx)("p",{className:"font-creato text-black text-xl mb-0 font-extrabold",children:"Don't let it go!"}),(0,n.jsxs)("p",{className:"font-creato font-medium text-base m-0 mt-2 text-[#151515]",children:["Your Basic Plan subscription ends in ",s," days"]})]}),(0,n.jsx)("button",{className:"bg-[#002366] text-white px-8 py-3 md:px-12 md:py-4 text-base font-normal rounded-lg cursor-pointer",onClick:c,children:"Renew Now"})]})})}function C(){let e=(0,o.aC)(),t=(0,l.DY)(),[s,m]=(0,i.useState)(!1),[p,w]=(0,i.useState)([]),[g,y]=(0,i.useState)([]),[N,v]=(0,i.useState)(0),[C,_]=(0,i.useState)(0),[T,R]=(0,i.useState)(window.innerWidth),[A,Z]=(0,i.useState)(!1),W=(0,i.useRef)(null);(0,i.useEffect)(()=>{e.token&&""!==e.token||z.push("/sign-in")},[e,t&&t.selectedBrandRole]);let z=(0,a.useRouter)();(0,i.useEffect)(()=>{e&&e.token&&""!==e.token&&t&&t.selectedBrandRole&&(m(!0),(0,f.r8)(e.token,t.selectedBrandRole,e=>{w(e);let t=e.map((e,t)=>{let s=(0,h.aZ)(e);return(0,n.jsx)(x(),{src:s.iconPath,width:20,height:20,className:"rounded-full",alt:s.label},e+t)});y(t),m(!1)},e=>{m(!1)}))},[e,t]),(0,i.useEffect)(()=>{if(e&&t){m(!0);let s=e.token,n=t.selectedBrandRole;b(s,n,e=>{v(e.totalFeatureCount),_(e.totalPublishedCount),m(!1)},e=>{console.error("Error:",e),m(!1)})}},[e,t]),(0,i.useEffect)(()=>{let e=()=>{R(window.innerWidth)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),(0,i.useEffect)(()=>{let e=t.brandSubscription.grace_period_status;!0===e&&t.brandSubscription.planType===S.PaymentType.ONE_TIME&&Z(!0)},[t]);let B=t.brandSubscription.days_left_to_expire,[M,q]=(0,i.useState)(!1),[D,Q]=(0,i.useState)(!1),[Y,F]=(0,i.useState)(0),[I,O]=(0,i.useState)(0);(0,i.useEffect)(()=>{(()=>{let{plan_id:e,end_date:s}=t.brandSubscription;if("TB001"===e){let n=new Date,a=new Date(s),i=a.getTime()-n.getTime(),o=Math.ceil(i/864e5);console.log("dayDiff",o),o>=0&&o<=3&&(F(o),q(!0))}})()},[t]),(0,i.useEffect)(()=>{(()=>{let{plan_id:e,end_date:s}=t.brandSubscription;if("M001"===e||"M101"===e&&t.brandSubscription.planType===S.PaymentType.ONE_TIME){let n=new Date,a=new Date(s),i=a.getTime()-n.getTime(),o=Math.ceil(i/864e5);o>=1&&o<=3&&(O(o),Q(!0))}})()},[t]);let V=[{title:"Quick Post",icon:(0,n.jsx)(x(),{src:"/navigator/aitools/copywriting.svg",width:window.innerWidth>=768?35:100,height:window.innerWidth>=768?35:60,className:"object-contain",alt:"quick-post"}),link:"/quick-post",action:"Create Content",dynamic:(0,n.jsx)("span",{className:"p-0 m-0 text-[#27A376] font-normal text-xs mt-1",children:N}),info:"Total posts created in last one month via “Quick Post”"},{title:"Analytics",icon:(0,n.jsx)(x(),{src:"/navigator/analytics.svg",width:window.innerWidth>=768?35:95,height:window.innerWidth>=768?35:60,className:"object-contain",alt:"quick-post"}),link:"/analytics",action:"View More",dynamic:(0,n.jsx)("span",{className:"p-0 m-0 text-[#27A376] font-normal text-xs mt-1",children:C}),info:"Total number of post published on all social platforms"},{title:"Socials",icon:(0,n.jsx)(x(),{src:"/navigator/socials.svg",width:window.innerWidth>=768?35:100,height:window.innerWidth>=768?35:55,className:"object-contain mx-auto",alt:"quick-post"}),link:"/socials",action:"Show Plaforms",info:"Connected social platforms",dynamic:g.length>0?g:""}];return(0,n.jsxs)(n.Fragment,{children:[M&&(0,n.jsx)(E,{open:M,days:Y}),D&&(0,n.jsx)(P,{open:D,days:I}),(0,n.jsx)(k,{open:A,days:B}),(0,n.jsxs)(d.Z,{className:"flex items-center flex-col gap-0 w-full h-full mx-0 overflow-auto",children:[(0,n.jsxs)("div",{className:"flex flex-col w-full gap-2 ",children:[e&&e.user&&(0,n.jsx)(r,{verificationStatus:e.user.is_verified,firstName:e.user.username||"User",description:"Ensure your socials are connected to quick start you posting journey with the 'Quick Post' feature on different platforms and analyze your posts performance. "}),window.innerWidth>=768?(0,n.jsx)("section",{className:"flex gap-4 pb-4",children:V.map((e,t)=>{let{title:s,icon:a,link:i,action:o,info:r,dynamic:l}=e,c=(100/V.length).toFixed(2)+"%";return(0,n.jsxs)("div",{style:{width:c},className:"bg-white flex flex-col py-2 px-3 items-center rounded-lg",children:[a,(0,n.jsx)("h2",{children:s}),(0,n.jsx)(u.Z,{variant:"contained",className:"normal-case rounded-lg",onClick:()=>z.push(i),children:o}),(0,n.jsxs)("span",{className:"font-normal flex text-xs text-gray-500 mt-5 mb-2 z-40",children:[l," ",(0,n.jsx)("div",{className:"ml-2 mt-1",children:r})]})]},s+t)})}):(0,n.jsx)("div",{className:"wrapper w-full overflow-hidden rounded-lg mb-6",ref:W,children:(0,n.jsx)(j(),{autoPlay:!0,interval:3e3,swipe:!0,duration:500,cycleNavigation:!0,animation:"slide",children:V.map((e,t)=>{let{title:s,icon:a,link:i,action:o,info:r,dynamic:l}=e;return(0,n.jsxs)("div",{className:"bg-white flex flex-row py-2 font-creato pr-3 gap-8 mx-auto items-center w-full h-32 rounded-lg",children:[(0,n.jsx)("div",{className:"flex items-center w-fit h-full",children:a}),(0,n.jsxs)("div",{className:"flex flex-col pr-4",children:[(0,n.jsxs)("div",{className:"flex flex-row justify-between gap-4 items-center h-fit",children:[(0,n.jsx)("h2",{className:"text-xl",children:s}),(0,n.jsx)(u.Z,{variant:"contained",className:"normal-case text-xs rounded-lg w-fit h-fit py-2",onClick:()=>z.push(i),size:"small",children:(0,n.jsx)("span",{className:"text-xs",children:o})})]}),(0,n.jsxs)("span",{className:"font-normal flex ".concat("Socials"===s&&"flex-col-reverse"," text-xs items-center text-gray-500 z-40 gap-2 mx-auto"),children:[(0,n.jsx)("div",{className:"".concat("Socials"===s?"flex flex-row gap-1 mx-auto":""," text-xs"),children:l}),(0,n.jsx)("div",{className:"".concat("Socials"===s?"":"ml-1"),children:r})]})]})]},s+t)})})})]}),(0,n.jsx)(c.h,{isViewMore:!0})]})]})}},14186:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return u}});var n=s(85893),a=s(1217),i=s(43685),o=s(11163),r=s(67294),l=s(91444),c=s(74346),d=s(314);function u(){let e=(0,c.aC)(),t=(0,o.useRouter)();return(0,r.useEffect)(()=>{let e=t.query;"success"===e.status?(0,l.Am)("Your purchase was Successful. You can continue using Autotext and it's services."):"failed"===e.status&&(0,l.Am)("We were unable to process your payment. Please try again in some time.")},[t.query]),(0,n.jsx)(n.Fragment,{children:e.isInit?(0,n.jsx)(i.Z,{child:(0,n.jsx)(a.Z,{})}):(0,n.jsx)(d.Z,{open:!0})})}}},function(e){e.O(0,[1228,3874,1827,5937,2678,4617,4090,4885,3777,7627,6319,1844,5675,8953,2715,1171,1023,385,6494,3562,869,3776,5743,5212,4210,3682,2054,3685,1476,9774,2888,179],function(){return e(e.s=48312)}),_N_E=e.O()}]);