PageSourceSearch

https://www.app.aisensy.com/static/js/696.80bb0157.chunk.js

js aisensy.com collected 2026-09-24 18:22:09 UTC 89,569 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwhatsapp_dashboard=self.webpackChunkwhatsapp_dashboard||[]).push([[696,5925,1529],{5770:(e,t,a)=>{a.d(t,{Z:()=>h});var s=a(47313),i=a(57009),n=a(20337),r=a(52376),o=a(44288),l=a(39352),d=a(56867),c=a(46417);const p={red:{background:"#FFF5F5",primary:"#B91C1C",hover:"#991B1B"},orange:{background:"#FFF7ED",primary:"#C2410C",hover:"#9A3412"},blue:{background:"#EFF6FF",primary:"#1D4ED8",hover:"#1E40AF"},teal:{background:"#F0FDFA",primary:"#0F766E",hover:"#115E59"},rose:{background:"#FFF1F2",primary:"#E11D48",hover:"#BE123C"}},h=(0,r.Z)((e=>({rootContainer:{boxSizing:"border-box",height:"96px",padding:"20px 24px",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",boxShadow:"none",[e.breakpoints.down(1200)]:{padding:"20px",minHeight:"84px",height:"100%"},[e.breakpoints.down(770)]:{flexDirection:"column",alignItems:"flex-start",gap:"12px"}},outerContentDiv:{display:"flex",alignItems:"center",gap:"12px",[e.breakpoints.down(770)]:{alignItems:"flex-start"}},contentDiv:{display:"flex",flexDirection:"column",gap:"4px"},headlineText:{fontWeight:700,fontFamily:"Inter",fontSize:"16px",lineHeight:"120%"},descriptionText:{fontFamily:"Inter",fontWeight:400,fontSize:"14px",lineHeight:"120%",color:"#6B7280"},upgradeBtn:{color:"white",borderRadius:"8px",fontFamily:"Inter",fontSize:"14px",lineHeight:"120%",fontWeight:600,letterSpacing:0,height:"36px",padding:"0 16px",textTransform:"none",boxShadow:"none",whiteSpace:"nowrap",[e.breakpoints.down(770)]:{marginLeft:"36px"}}})))((e=>{let{classes:t,variant:a="red"}=e;const[r,h]=(0,s.useState)(!1),g=p[a]||p.red;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:t.rootContainer,style:{background:g.background,borderLeft:"4px solid ".concat(g.primary)},children:[(0,c.jsxs)("div",{className:t.outerContentDiv,children:[(0,c.jsx)(o.Z,{size:24,color:g.primary}),(0,c.jsxs)("div",{className:t.contentDiv,children:[(0,c.jsx)(i.Z,{className:t.headlineText,style:{color:g.primary},children:"Automation Lite Plan (Mobile Only)"}),(0,c.jsx)(i.Z,{className:t.descriptionText,children:"This project is on Automation Lite Plan (Mobile Only) - Unlock unlimited broadcasting & advanced features"})]})]}),(0,c.jsx)(n.Z,{className:t.upgradeBtn,style:{backgroundColor:g.primary},disableElevation:!0,onClick:()=>h(!0),onMouseOver:e=>e.currentTarget.style.backgroundColor=g.hover,onMouseOut:e=>e.currentTarget.style.backgroundColor=g.primary,startIcon:(0,c.jsx)(l.Z,{size:16}),children:"Upgrade Now"})]}),(0,c.jsx)(d.default,{purchaseNew:!0,dialogOpen:r,toggleUpgradeDialog:()=>h(!1)})]})}))},91529:(e,t,a)=>{a.r(t),a.d(t,{default:()=>b});var s=a(47313),i=a(34882),n=a(54070),r=a(52376),o=a(83061),l=a(45788),d=a(63830),c=a(46417);let p=0;const h="M12 0C12 6.6 6.6 12 0 12C6.6 12 12 17.4 12 24C12 17.4 17.4 12 24 12C17.4 12 12 6.6 12 0Z",g=e=>{let{size:t=22,color:a="#1c9772",shine:i=!0,shineColor:n="#ffffff",...r}=e;const o=(0,s.useMemo)((()=>"ginger-assistant-".concat(p+=1)),[]),l="".concat(o,"-body"),d="".concat(o,"-shine");return(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",focusable:"false",...r,children:[(0,c.jsxs)("defs",{children:[(0,c.jsxs)("linearGradient",{id:l,x1:"0",y1:"0",x2:"1",y2:"1",children:[(0,c.jsx)("stop",{offset:"0%",stopColor:a,stopOpacity:"1"}),(0,c.jsx)("stop",{offset:"55%",stopColor:a,stopOpacity:"0.86"}),(0,c.jsx)("stop",{offset:"100%",stopColor:a,stopOpacity:"0.96"})]}),(0,c.jsxs)("linearGradient",{id:d,x1:"0",y1:"0",x2:"1",y2:"0",children:[(0,c.jsx)("stop",{offset:"30%",stopColor:n,stopOpacity:"0"}),(0,c.jsx)("stop",{offset:"50%",stopColor:n,stopOpacity:"0.9"}),(0,c.jsx)("stop",{offset:"70%",stopColor:n,stopOpacity:"0"}),i&&(0,c.jsx)("animateTransform",{attributeName:"gradientTransform",type:"translate",values:"-1 0; 1 0; 1 0",keyTimes:"0; 0.4; 1",dur:"3.4s",repeatCount:"indefinite"})]})]}),(0,c.jsx)("path",{d:h,fill:"url(#".concat(l,")")}),i&&(0,c.jsx)("path",{d:h,fill:"url(#".concat(d,")")})]})};var m=a(31030),u=a(57037),x=a(87815);const y="AI Assistant";const v=(0,l.connect)((e=>({agent:e.login.user,assistantDetails:e.assistantDetails.data})))((function(e){let{agent:t,assistantDetails:a,classes:s,location:r,match:l,size:d=18}=e;const p=(0,u.C5)();return(0,m.LL)(t,l.params.projectId,a)&&(0,x.f)(r.pathname)?(0,c.jsx)(i.ZP,{title:y,children:(0,c.jsx)(n.Z,{id:"gingerLauncher","aria-label":y,"aria-pressed":p,size:"small",className:(0,o.Z)(s.launcher,{[s.launcherOpen]:p}),onClick:u.qE,children:(0,c.jsx)(g,{size:d,className:s.icon,"aria-hidden":"true"})})}):null})),b=(0,r.Z)((e=>({launcher:{width:32,height:32,padding:0,flexShrink:0,borderRadius:10,backgroundColor:"transparent",transition:"background-color 160ms ease","&:hover":{backgroundColor:"transparent"}},launcherOpen:{backgroundColor:"#E8F4EF","&:hover":{backgroundColor:"#E8F4EF"}},"@keyframes gingerGlow":{"0%, 100%":{filter:"drop-shadow(0 0 2px rgba(28, 151, 114, 0.35))"},"50%":{filter:"drop-shadow(0 0 7px rgba(28, 151, 114, 0.75))"}},icon:{display:"block",animation:"$gingerGlow 2.8s ease-in-out infinite"}})))((0,d.withRouter)(v))},41365:(e,t,a)=>{a.d(t,{Z:()=>g});var s=a(47313),i=a(47856),n=a(21144),r=a(73908),o=a(57009),l=a(52376),d=a(47735),c=a(46417);const p=[{id:"av",color:"#F2C14E"},{id:"bv",color:"#BDBF00"},{id:"cv",color:"#F78154"},{id:"dv",color:"#5FAD56"},{id:"ev",color:"#F70054"},{id:"gv",color:"#a48ed2"},{id:"wv",color:"#4babda"},{id:"av1",color:"#F2C14E"},{id:"bv1",color:"#BDBF00"},{id:"cv1",color:"#F78154"},{id:"dv1",color:"#5FAD56"},{id:"ev1",color:"#F70054"},{id:"gv1",color:"#a48ed2"},{id:"wv1",color:"#4babda"},{id:"av2",color:"#F2C14E"},{id:"bv2",color:"#BDBF00"},{id:"cv2",color:"#F78154"},{id:"dv2",color:"#5FAD56"},{id:"ev2",color:"#F70054"},{id:"gv2",color:"#a48ed2"},{id:"wv2",color:"#4babda"}];class h extends s.PureComponent{constructor(e){super(e),this.measure=()=>{const e=this.rootRef.current;if(!e)return;const t=e.clientWidth;t!==this.state.containerWidth&&this.setState({containerWidth:t})},this.rootRef=(0,s.createRef)(null),this.state={containerWidth:0}}componentDidMount(){this.measure(),"undefined"!==typeof ResizeObserver&&this.rootRef.current?(this.resizeObserver=new ResizeObserver(this.measure),this.resizeObserver.observe(this.rootRef.current)):window.addEventListener("resize",this.measure)}componentWillUnmount(){this.resizeObserver?this.resizeObserver.disconnect():window.removeEventListener("resize",this.measure)}render(){const{data:e,keys:t,title:a,isLoading:l,Subheading:h,Options:g,fixed_strokes:m,type:u,maxHeight:x=300,dense:y=!1}=this.props,v=this.props.classes,b=m||p,{containerWidth:j}
1=this.state,f=Math.max(320,j-40),C=Math.min(x,Math.max(180,f/3));let D=[];if(1===e.length&&e[0].date){const t=e[0],a={};let s=new Date(t.date);s.setDate(s.getDate()-1),s=s.toDateString().split(" "),Object.keys(t).forEach((e=>{a[e]=0})),D=[{...a,date:"".concat(s[2]," ").concat(s[1])},t]}return(0,c.jsxs)("div",{ref:this.rootRef,className:v.root,style:{backgroundColor:"white",...y?{margin:0,paddingTop:0}:{}},children:[(0,c.jsxs)(n.Z,{container:!0,children:[a&&(0,c.jsx)(n.Z,{item:!0,xs:12,md:6,children:(0,c.jsxs)(r.Z,{m:"1em 0em",className:v.header,children:[(0,c.jsx)(o.Z,{variant:"h3",component:"span",children:a}),(0,c.jsxs)(o.Z,{variant:"body2",component:"span",children:[" ","(per day)"]})]})}),g&&(0,c.jsx)(n.Z,{item:!0,xs:12,md:6,children:(0,c.jsx)(r.Z,{m:"1em 0em",className:v.header,textAlign:{xs:"left",md:"right"},children:(0,c.jsx)(g,{})})})]}),h&&(0,c.jsx)(h,{}),l||!j?(0,c.jsx)(r.Z,{display:"flex",justifyContent:"center",width:"100%",children:(0,c.jsx)(d.Z,{width:"90%",height:x})}):(0,c.jsx)(s.Fragment,{children:e.length>0?(0,c.jsx)(r.Z,{p:"1em 1%",className:v.chartScroll,children:(0,c.jsxs)(i.cI,{width:f,height:C,margin:y?{top:8,right:12,left:-16,bottom:0}:void 0,data:1===e.length?D:e,children:[(0,c.jsx)("defs",{children:b.map((e=>(0,c.jsxs)("linearGradient",{id:e.id,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,c.jsx)("stop",{offset:"0%",stopColor:e.color,stopOpacity:.8}),(0,c.jsx)("stop",{offset:"95%",stopColor:e.color,stopOpacity:0})]},e.id)))}),(0,c.jsx)(i.q3,{strokeDasharray:"3 3"}),(0,c.jsx)(i.Kc,{dataKey:"date",axisLine:!1,scale:"point",tick:y?{fontSize:10}:void 0}),(0,c.jsx)(i.B2,{axisLine:!1,width:y?34:void 0,tick:y?{fontSize:10}:void 0,allowDecimals:!1,tickFormatter:e=>this.props.currency?e>1e9?"\u20b9"+(e/1e9).toFixed(0).toString()+"B":e>1e6?"\u20b9"+(e/1e6).toFixed(0).toString()+"M":e>1e3?"\u20b9"+(e/1e3).toFixed(0).toString()+"K":"\u20b9"+e.toString():e>1e9?(e/1e9).toFixed(0).toString()+"B":e>1e6?(e/1e6).toFixed(0).toString()+"M":e>1e3?(e/1e3).toFixed(0).toString()+"K":e.toString()}),(0,c.jsx)(i.u,{}),(0,c.jsx)(i.De,{wrapperStyle:y?{fontSize:11}:void 0}),t.map(((e,t)=>(0,c.jsx)(i.uN,{strokeWidth:2,type:"monotone",dataKey:e,stroke:b[t].color,isAnimationActive:!0,fillOpacity:1,fill:"url(#".concat(b[t].id,")")},e)))]})}):(0,c.jsx)(r.Z,{py:1,display:"flex",justifyContent:"center",width:"100%",height:300,alignItems:"center",children:"SCAN-QR"==u?(0,c.jsxs)(o.Z,{variant:"h6",color:"textSecondary",children:[" ","Start your QR Campaign and Analyse the analytics here."]}):(0,c.jsxs)(o.Z,{variant:"h6",color:"textSecondary",children:[" ","Nothing to show for now ;)"]})})})]})}}const g=(0,l.Z)((e=>({root:{display:"flex",margin:"3% 0em",paddingTop:"1em",width:"100%",justifyContent:"left",flexDirection:"column",alignItems:"start",backgroundColor:"white",borderRadius:"1em",boxSizing:"border-box",minWidth:0,maxWidth:"100%"},chartScroll:{width:"100%",maxWidth:"100%",boxSizing:"border-box",overflowX:"auto"},heading:{margin:"0.5em"},header:{[e.breakpoints.down("md")]:{padding:"0 20px"},[e.breakpoints.up("sm")]:{padding:"0 30px"}}})))(h)},58821:(e,t,a)=>{a.d(t,{Z:()=>p});a(47313);var s=a(73908),i=a(63830),n=a(45788),r=a(95604),o=a(49904),l=a(47864),d=a(30656),c=a(46417);const p=(0,i.withRouter)((e=>{var t,a,i,p;let{history:h,match:g,title:m="Quick Guide",description:u,section:x,includeSection:y,guideLinks:v,prospectId:b,showTutorial:j=!0,shortcuts:f,heading:C,...D}=e;const Z=null===g||void 0===g||null===(t=g.params)||void 0===t?void 0:t.projectId,w=!((0,n.useSelector)((e=>{var t,a;return null===(t=e.login)||void 0===t||null===(a=t.user)||void 0===a?void 0:a.power}))>=1),S=[...x&&(null===(a=o.g[x])||void 0===a?void 0:a.docLinks)||[],...y&&(null===(i=o.g[y])||void 0===i?void 0:i.docLinks)||[]],{guideLinks:k,onWatchTutorial:A}=(0,l.bt)(S,b),I=null===(p=o.g[x])||void 0===p?void 0:p.sectionDisplayName,T={eyebrow:I?"".concat(I," quick guide"):"Quick guide",title:m,description:u,showGuideLinks:j,onWatchTutorial:A,guideLinks:v||k},F=C||{title:"What would you like to launch?"},P=!j,N={history:h,projectId:Z},B=[(0,d.hN)(N),!P&&(0,d.me)(N),!P&&(0,d.nw)(N),(0,d.lM)({...N,disabled:w}
1)].filter(Boolean),O=P?[]:f||B;return(0,c.jsx)(s.Z,{mt:3,mb:3,width:"100%",...D,children:(0,c.jsx)(r.Z,{guide:T,heading:F,shortcuts:O})})}))},30656:(e,t,a)=>{a.d(t,{BE:()=>v,JD:()=>y,hN:()=>u,hT:()=>D,lM:()=>w,me:()=>x,nw:()=>b,rM:()=>S,y:()=>Z});a(47313);var s=a(73908),i=a(47903),n=a(73069),r=a(4761),o=a(12806),l=a(49647),d=a(40692),c=a(93372),p=a(6885),h=a(41790),g=a(46417);const m=(e,t)=>(0,g.jsx)(s.Z,{style:{width:"36px",height:"36px",borderRadius:"10px",backgroundColor:e,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t}),u=e=>{let{history:t,projectId:a}=e;return{key:"broadcast",icon:m("rgba(37, 211, 102, 0.12)",(0,g.jsx)(i.Z,{size:20,color:"#109d59"})),title:"Launch Broadcast Campaign",description:"Reach your WhatsApp audience with offers, updates and alerts.",onClick:()=>t.push("/projects/".concat(a,"/campaigns/create"))}},x=e=>{let{history:t,projectId:a}=e;return{key:"status-ad",icon:h.Z.whatsapp_status,title:"Launch WhatsApp Status Ad",tag:"NEW",tagVariant:"new",description:"Publish scroll-stopping offers directly to WhatsApp Status.",onClick:()=>t.push("/projects/".concat(a,"/advertisement/create?selectedAdType=whatsapp_status"))}},y=e=>{let{history:t,projectId:a}=e;return{key:"ads-agent",icon:m("rgba(10, 71, 76, 0.12)",(0,g.jsx)(n.Z,{size:20,color:"#0a474c"})),title:"Generate Ads with AI",tag:"AI",tagVariant:"ai",description:"Describe your business and Ads Agent writes, designs and targets the ads for you.",onClick:()=>t.push("/projects/".concat(a,"/advertisement/ads-agent"))}},v=()=>({key:"book-demo-call",icon:m("rgba(59, 130, 246, 0.12)",(0,g.jsx)(r.Z,{size:20,color:"#2563EB"})),title:"Book a Demo Call",description:"Talk to an ads expert to set up, launch and troubleshoot your campaigns.",onClick:()=>window.open("https://calendly.com/ads-aisensy/ads-troubleshoot","_blank","noopener,noreferrer")}),b=e=>{let{history:t,projectId:a}=e;return{key:"lead-form",icon:m("rgba(245, 158, 11, 0.14)",(0,g.jsx)(o.Z,{size:20,color:"#B45309"})),title:"Launch Lead Form Ads",description:"Capture high-intent leads and follow up instantly on WhatsApp.",onClick:()=>t.push("/projects/".concat(a,"/advertisement/create?selectedAdType=lead_form"))}},j={USD:{starter:100,growth:200,symbol:"$",Icon:l.Z},INR:{starter:5e3,growth:1e4,symbol:"\u20b9",Icon:d.Z}},f=e=>"USD"===e?j.USD:j.INR,C=(e,t)=>"USD"===e?"$".concat(t):"\u20b9".concat(t.toLocaleString("en-IN")),D=e=>{let{onSelect:t,currency:a}=e;const{starter:s,Icon:i}=f(a),n=C(a,s);return{key:"starter-pack",icon:m("rgba(37, 211, 102, 0.12)",(0,g.jsx)(i,{size:20,color:"#109d59"})),title:"".concat(n," Ads Starter Pack"),tag:"FREE SETUP",tagVariant:"new",description:"Get ".concat(n," ad balance plus free expert campaign setup."),onClick:()=>t(s)}},Z=e=>{let{onSelect:t,currency:a}=e;const{growth:s,Icon:i}=f(a),n=C(a,s);return{key:"growth-pack",icon:m("rgba(37, 211, 102, 0.12)",(0,g.jsx)(i,{size:20,color:"#109d59"})),title:"".concat(n," Ads Growth Pack"),tag:"RECOMMENDED",tagVariant:"new",description:"Get ".concat(n," ad balance, expert setup and 30-day optimisation support."),onClick:()=>t(s),highlighted:!0}},w=e=>{let{history:t,projectId:a,disabled:s=!1}=e;return{key:"ai-agent",icon:m("rgba(124, 58, 237, 0.12)",(0,g.jsx)(c.Z,{size:20,color:"#7C3AED"})),title:"Create AI Agent",tag:"AI",tagVariant:"ai",description:"Qualify leads, answer questions and close sales automatically.",onClick:()=>t.push("/projects/".concat(a,"/agent-studio")),disabled:s}},S=e=>{let{history:t,projectId:a}=e;return{key:"ai-template",icon:m("rgba(37, 211, 102, 0.12)",(0,g.jsx)(p.Z,{size:20,color:"#109d59"})),title:"Create AI Templates",tag:"AI",tagVariant:"ai",description:"Generate powerful WhatsApp templates in seconds with AI.",onClick:()=>t.push("/projects/".concat(a,"/manage/template-message/create"),{category:"MARKETING"})}}},3008:(e,t,a)=>{a.d(t,{Z:()=>u});var s=a(47313),i=a(83061),n=a(73908),r=a(57009),o=a(54070),l=a(52376),d=a(65681),c=a(60839),p=a(66396),h=a(19942),g=a(46417);class m extends s.Component{constructor(e){super(e),this.onSnackbarClose=()=>{this.setState({alertOpen:!1})},this.showSnackbar=e=>{this.setState(e)},this.closeOpenDialog=()=>{this.setState({openDialog:!1}),setTimeout((()=>{this.props.toggleBillingDetailsDialog()}),400)},this.state={openDialog:!1,alertOpen:!1,alertMsg:"",severity:""}}componentDidUpdate(e){!e.dialogOpen&&this.props.dialogOpen&&setTimeout((()=>{this.setState({openDialog:!0})}),0)}render(){const{classes:e,dialogOpen:t}=this.props,{openDialog:a}=this.state;return(0,g.jsxs)("div",{className:e.root,children:[t&&(0,g.jsx)(n.Z,{className:e.backdrop,children:(0,g.jsx)(n.Z,{className:(0,i.Z)(e.dialogContainer,{[e.dialogContainerSlider]:a}),children:(0,g.jsxs)(n.Z,{className:e.dialogWrapper,children:[(0,g.jsx)(n.Z,{className:e.dialogTitle,children:(0,g.jsxs)(n.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,g.jsx)(r.Z,{variant:"h3",children:"Update Billing Details"}),(0,g.jsx)(o.Z,{onClick:this.closeOpenDialog,children:(0,g.jsx)(d.Z,{})})]})}),(0,g.jsxs)(n.Z,{className:e.dialogContent,children:[(0,g.jsx)(c.Z,{showSnackbar:this.showSnackbar}),(0,g.jsx)(n.Z,{mt:2}),(0,g.jsx)(p.Z,{showSnackbar:this.showSnackbar})]})]})})}),(0,g.jsx)(h.A9,{open:this.state.alertOpen,anchorOrigin:{vertical:"top",horizontal:"center"},onClose:this.onSnackbarClose,severity:this.state.severity,message:this.state.alertMsg})]})}}const u=(0,l.Z)((e=>({root:{width:"100%"},snackbar:{zIndex:5e3},backdrop:{position:"fixed",width:"100%",top:0,left:0,height:"100vh",background:"#0000005e",dis
1play:"flex",flexDirection:"row-reverse",zIndex:1e3},dialogContainerSlider:{[e.breakpoints.down("md")]:{margin:"0 !important"},[e.breakpoints.up("md")]:{margin:"0 !important"}},dialogContainer:{padding:12,boxSizing:"border-box",transition:"margin 0.45s",maxWidth:600,[e.breakpoints.down("md")]:{width:"100%",margin:"0 -100% 0 0"},[e.breakpoints.up("md")]:{width:"50%",margin:"0 -50% 0 0"}},dialogWrapper:{height:"100%",borderRadius:"12px",background:"white",overflow:"hidden"},dialogTitle:{padding:"12px 12px 8px 32px",boxShadow:"0px 4px 8px #f3efef"},dialogContent:{padding:"24px 16px",background:"#f9f8f873",maxHeight:"calc(100vh - 140px)",overflowY:"auto"}})))(m)},18998:(e,t,a)=>{a.d(t,{Z:()=>u});var s=a(47313),i=a(83061),n=a(73908),r=a(57009),o=a(54070),l=a(52376),d=a(65681),c=a(24841),p=(a(56569),a(68914)),h=a(19942),g=a(46417);class m extends s.Component{constructor(e){super(e),this.onSnackbarClose=()=>{this.setState({alertOpen:!1})},this.showSnackbar=e=>{this.setState(e)},this.closeOpenDialog=()=>{this.setState({openDialog:!1}),setTimeout((()=>{this.props.toggleTemplateCreditDialog()}),400)},this.state={openDialog:!1,alertOpen:!1,alertMsg:"",severity:""}}componentDidUpdate(e){!e.dialogOpen&&this.props.dialogOpen&&setTimeout((()=>{this.setState({openDialog:!0})}),0)}render(){var e,t;const{classes:a,dialogOpen:s,assistantDetails:l}=this.props,{openDialog:m}=this.state;return(0,g.jsxs)("div",{className:a.root,children:[s&&(0,g.jsx)(n.Z,{className:a.backdrop,children:(0,g.jsx)(n.Z,{className:(0,i.Z)(a.dialogContainer,{[a.dialogContainerSlider]:m}),children:(0,g.jsxs)(n.Z,{className:a.dialogWrapper,children:[(0,g.jsx)(n.Z,{className:a.dialogTitle,children:(0,g.jsxs)(n.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,g.jsx)(r.Z,{variant:"h4",children:"Purchase WhatsApp Conversation Credits (WCC)"}),(0,g.jsx)(o.Z,{onClick:this.closeOpenDialog,children:(0,g.jsx)(d.Z,{})})]})}),(0,g.jsx)(n.Z,{className:a.dialogContent,children:(0,g.jsx)(c.Z,{showSnackbar:this.showSnackbar,closeDialog:this.closeOpenDialog})}),!(null!==l&&void 0!==l&&null!==(e=l.partner)&&void 0!==e&&e.isZohoEnabled)&&!(null!==l&&void 0!==l&&null!==(t=l.partner)&&void 0!==t&&t.partnerRazorpayEnabled)&&(0,g.jsx)(n.Z,{className:a.dialogContent,style:{paddingTop:0},children:(0,g.jsx)(p.Z,{showSnackbar:this.showSnackbar,closeDialog:this.closeOpenDialog})})]})})}),(0,g.jsx)(h.A9,{open:this.state.alertOpen,anchorOrigin:{vertical:"top",horizontal:"center"},onClose:this.onSnackbarClose,severity:this.state.severity,message:this.state.alertMsg})]})}}const u=(0,l.Z)((e=>({root:{width:"100%"},snackbar:{zIndex:5e3},backdrop:{position:"fixed",width:"100%",top:0,left:0,height:"100vh",background:"#0000005e",display:"flex",flexDirection:"row-reverse",zIndex:1e3},dialogContainerSlider:{[e.breakpoints.down("md")]:{margin:"0 !important"},[e.breakpoints.up("md")]:{margin:"0 !important"}},dialogContainer:{padding:12,boxSizing:"border-box",transition:"margin 0.45s",maxWidth:600,[e.breakpoints.down("md")]:{width:"100%",margin:"0 -100% 0 0"},[e.breakpoints.up("md")]:{width:"50%",margin:"0 -50% 0 0"}},dialogWrapper:{height:"100%",borderRadius:"12px",background:"white",overflow:"scroll"},dialogTitle:{padding:"12px 12px 8px 32px",boxShadow:"0px 4px 8px #f3efef"},dialogContent:{padding:"24px 16px",background:"#f9f8f873",maxHeight:"calc(100vh - 140px)",overflowY:"auto"}})))(m)},56867:(e,t,a)=>{a.r(t),a.d(t,{default:()=>f});a(47313);var s=a(45788),i=a(88894),n=a(31385),r=a(45282),o=a(61809),l=a(54070),d=a(78371),c=a(73908),p=a(57009),h=a(21144),g=a(97241),m=a(12599);const u=a.p+"static/media/rocket_launch.9b95e701e2b88078d57a.png";var x=a(48212),y=a(46417);const v=(0,g.Z)((e=>({dialogPaper:{width:"50%",maxWidth:"100%",borderRadius:"12px",padding:e=>{let{isMobile:t}=e;return t?"24px 16px":"40px 20px 32px 20px"},display:"flex",flexDirection:"column",gap:e=>{let{isMobile:t}=e;return t?"24px":"32px"},position:"relative",overflowY:e=>{let{isMobile:t}=e;return t?"auto":"hidden"},[e.breakpoints.down("sm")]:{width:"100%",height:"100%",margin:0,borderRadius:0}},closeButton:{position:"absolute",right:e=>{let{isMobile:t}=e;return t?"16px":"20px"},top:e=>{let{isMobile:t}=e;return t?"16px":"20px"},padding:0},closeIcon:{width:"22px",height:"22px"},dialogContent:{padding:0,display:"flex",flexDirection:"column",alignItems:"center",gap:e=>{let{isMobile:t}=e;return t?"24px":"32px"},overflowY:e=>{let{isMobile:t}=e;return t?"auto":"hidden"},maxHeight:e=>{let{isMobile:t}=e;return t?"100%":"none"}},rocketIconContainer:{width:e=>{let{isMobile:t}=e;
1return t?"80px":"100px"},height:e=>{let{isMobile:t}=e;return t?"80px":"100px"},borderRadius:"50%",backgroundColor:"#EBF1FF",display:"flex",alignItems:"center",justifyContent:"center"},rocketIcon:{width:e=>{let{isMobile:t}=e;return t?"60px":"80px"},height:e=>{let{isMobile:t}=e;return t?"60px":"80px"},objectFit:"contain"},titleContainer:{textAlign:"center",display:"flex",flexDirection:"column",gap:"8px",padding:e=>{let{isMobile:t}=e;return t?"0 16px":0}},title:{color:"#2F5EFF",fontFamily:"Inter",fontSize:e=>{let{isMobile:t}=e;return t?"18px":"20px"},fontWeight:600,lineHeight:"150%"},subtitle:{color:"#192839",fontFamily:"Inter",fontSize:"14px",fontWeight:400,lineHeight:"150%"},dividerContainer:{width:"100%",display:"flex",alignItems:"center",gap:"16px",padding:e=>{let{isMobile:t}=e;return t?"0 16px":0}},dividerLine:{flex:1,height:"1px",backgroundColor:"#E4E4E4"},dividerText:{color:"#8694A7",fontFamily:"Inter",fontSize:e=>{let{isMobile:t}=e;return t?"12px":"14px"},fontWeight:500,lineHeight:"20px",letterSpacing:"0.1px",whiteSpace:"nowrap"},featuresGrid:{width:"100%",padding:e=>{let{isMobile:t}=e;return t?"0 16px":0}},featureBox:{display:"flex",padding:e=>{let{isMobile:t}=e;return t?"8px":"12px"},alignItems:"center",gap:e=>{let{isMobile:t}=e;return t?"8px":"12px"},alignSelf:"stretch",borderRadius:"8px",border:"1px solid #F0F0F0"},iconContainer:{width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"#305EFF",display:"flex",alignItems:"center",justifyContent:"center",padding:"6px","& > svg":{color:"#FFFFFF",fontSize:"20px"}},featureTextContainer:{display:"flex",flexDirection:"column",gap:"4px"},featureTitle:{color:"#192839",fontFamily:"Inter",fontSize:e=>{let{isMobile:t}=e;return t?"14px":"16px"},fontWeight:500,lineHeight:"normal",fontFeatureSettings:'"liga" off, "clig" off'},featureDescription:{color:"#8694A7",fontFamily:"Inter",fontSize:e=>{let{isMobile:t}=e;return t?"11px":"12px"},fontWeight:400,lineHeight:"150%",letterSpacing:"0.066px"},upgradeContainer:{padding:e=>{let{isMobile:t}=e;return t?"12px":"16px"},display:"flex",justifyContent:"space-between",alignItems:"center",alignSelf:"stretch",borderRadius:"12px",backgroundColor:"#EBF1FF",margin:e=>{let{isMobile:t}=e;return t?"0 16px":0}},upgradeTextContent:{display:"flex",flexDirection:"column",gap:"4px"},upgradeTitle:{color:"#2F5EFF",fontFamily:"Inter",fontSize:e=>{let{isMobile:t}=e;return t?"16px":"18px"},fontWeight:600,lineHeight:"normal",fontFeatureSettings:'"liga" off, "clig" off',textAlign:"left"},emailContent:{color:"#192839",fontFamily:"Inter",fontSize:e=>{let{isMobile:t}=e;return t?"12px":"13px"},fontWeight:600,lineHeight:"normal",fontFeatureSettings:'"liga" off, "clig" off',textAlign:"left"},upgradeDescription:{color:"#192839",fontFamily:"Inter",fontSize:e=>{let{isMobile:t}=e;return t?"11px":"12px"},fontWeight:400,lineHeight:"150%",letterSpacing:"0.066px",textAlign:"left"},contactButton:{width:"116px",height:"36px",padding:"6px 16px",backgroundColor:"#2F5EFF",color:"#FFFFFF",borderRadius:"6px",fontFamily:"Inter",fontSize:"14px",fontWeight:600,lineHeight:"24px",textTransform:"none","&:hover":{backgroundColor:"#2F5EFF"}}}))),b=e=>{let{dialogOpen:t,toggleUpgradeDialog:a}=e;const s=v(),i=(0,n.Z)(),g=(0,r.Z)(i.breakpoints.down("sm")),b=((0,r.Z)(i.breakpoints.down("md")),[{icon:(0,x.p)(),title:"Campaign Automations",description:"Effortlessly schedule and retry failed sends"},{icon:(0,x.kB)(),title:"Chatbot Flows and Live Chat",description:"Automate support or connect instantly"},{icon:(0,x.Z0)(),title:"Click-to-WhatsApp Ads",description:"Convert ad clicks into conversations"},{icon:(0,x.yc)(),title:"and many more exciting features!",description:"Unlock additional powerful capabilities."}]);return(0,y.jsxs)(o.Z,{open:t,onClose:a,maxWidth:!1,classes:{paper:s.dialogPaper},children:[(0,y.jsx)(l.Z,{className:s.closeButton,onClick:a,children:(0,y.jsx)(m.Z,{className:s.closeIcon})}),(0,y.jsxs)(d.Z,{className:s.dialogContent,children:[(0,y.jsx)(c.Z,{className:s.rocketIconContainer,children:(0,y.jsx)("img",{src:u,alt:"Rocket Launch",className:s.rocketIcon,style:{width:g?"60px":"80px",height:g?"60px":"80px"}})}),(0,y.jsxs)(c.Z,{className:s.titleContainer,children:[(0,y.jsx)(p.Z,{variant:"h1",className:s.title,children:"Upgrade your plan to unlock this feature"}),(0,y.jsx)(p.Z,{variant:"subtitle1",className:s.subtitle,children:"Unlock premium features to take your marketing strategy to the next level."})]}),(0,y.jsxs)(c.Z,{className:s.dividerContainer,children:[(0,y.jsx)("div",{className:s.dividerLine}),(0,y.jsx)(p.Z,{variant:"body1",className:s.dividerText,children:"What's included in Advanced Plan?"}),(0,y.jsx)("div",{className:s.dividerLine})]}),(0,y.jsx)(h.Z,{container:!0,spacing:g?1:2,className:s.featuresGrid,children:b.map(((e,t)=>(0,y.jsx)(h.Z,{item:!0,xs:12,sm:6,children:(0,y.jsxs)(c.Z,{className:s.featureBox,children:[(0,y.jsx)(c.Z,{className:s.iconContainer,children:e.icon}),(0,y.jsxs)(c.Z,{className:s.featureTextContainer,children:[(0,y.jsx)(p.Z,{variant:"h6",className:s.featureTitle,children:e.title}),(0,y.jsx)(p.Z,{variant:"body2",className:s.featureDescription,children:e.description})]})]})},t)))}),(0,y.jsx)(c.Z,{className:s.upgradeContainer,children:(0,y.jsxs)(c.Z,{className:s.upgradeTextContent,children:[(0,y.jsx)(p.Z,{variant:"h5",className:s.upgradeTitle,children:"Upgrade your plan today! \u2728"}),(0,y.jsxs)(p.Z,{variant:"body2",className:s.upgradeDescription,children:["Write to us on"," ",(0,y.jsx)("span",{className:s.emailContent,children:"[email protected]"})," ","to upgrade your plan"]})]})})]})]})};var j=a(98677);const f=(0,s.connect)((e=>({assistantDetails:e.assistantDetails.data})))((e=>{const{assistantDetails:t}=e,{activePlan:a,partnerId:s}=t||{},{isAiSensy:n}=(0,j.K)();return s&&"FREE_FOREVER"===a?(0,y.jsx)(b,{dialogOpen:e.dialogOpen,toggleUpgradeDialog:e.toggleUpgradeDialog,purchaseNew:e.purchaseNew}):n?(0,y.jsx)(i.default,{purchaseNew:e.purchaseNew,dialogOpen:e.dialogOpen,toggleUpgradeDialog:e.toggleUpgradeDialog,toggleTrialActivation:e.toggleTrialActivation,confettiRun:e.confettiRun,fromUpgradePlan:e.fromUpgradePlan,minimumPlan:e.minimumPlan}):null}))},76775:(e,t,a)=>{a.r(t),a.d(t,{default:()=>Ce});var s=a(47313),i=a(21144),n=a(57009),r=a(73908),o=a(72728),l=a(20337),d=a(3873),c=a(34882),p=a(54070),h=a(52376),g=a(47735),m=a(26395),u=a(70089),x=a(83061),y=a(74227),v=a.n(y),b=a(1805),j=a(61809),f=a(95939),C=a(78371),D=a(35154),Z=a(97393),w=a(2824),S=a(46417);class k extends s.Component{constructor(){super(...arguments),this.state={address:"",state:"Goa",country:"India",status:"",statusMessage:""},this.setAddress=()=>{const{address:e,state:t,country:a}=this.state;a&&e&&("India"!==a||t)?this.props.saveBillingAddress({addressDetail:e,state:t||"",country:a}):this.setState({status:"error",statusMessage:"Invalid Address"})},this.onChange=e=>{this.setState({[e.target.name]:e.target.value})},this.onCountryChange=(e,t)=>
1{this.setState({country:t})},this.onStateChange=(e,t)=>{this.setState({state:t})}}render(){const{openBillingAddress:e,toggleBillingAddressPopup:t}=this.props,{address:a,state:d,country:c,status:p,statusMessage:h}=this.state;return(0,S.jsxs)(j.Z,{open:e,onClose:t,"aria-labelledby":"form-dialog-title",maxWidth:!0,children:[(0,S.jsx)(f.Z,{children:(0,S.jsx)(n.Z,{variant:"h4",gutterBottom:!0,children:"Billing Address"})}),(0,S.jsxs)(C.Z,{children:[(0,S.jsxs)(i.Z,{container:!0,direction:"row",children:[(0,S.jsxs)(i.Z,{item:!0,xs:12,children:[(0,S.jsx)(n.Z,{variant:"h5",paragraph:!0,children:"Full address"}),(0,S.jsx)(o.Z,{placeholder:"Enter full address",name:"Billing Address",fullWidth:!0,onChange:this.onChange,value:a.addressDetails})]}),(0,S.jsx)(r.Z,{my:1,width:"100%",children:(0,S.jsx)(m.ZP,{id:"country-select",options:w.Z,autoHighlight:!0,value:c,onChange:this.onCountryChange,freeSolo:!1,getOptionLabel:e=>e||"",renderOption:e=>(0,S.jsx)(s.Fragment,{children:e}),renderInput:e=>(0,S.jsx)(o.Z,{...e,label:"Country",variant:"outlined",inputProps:{...e.inputProps,autoComplete:"new-password"}})})}),"India"===c?(0,S.jsxs)(r.Z,{my:1,width:"100%",children:[(0,S.jsx)(m.ZP,{id:"country-select",options:Z.Z,autoHighlight:!0,value:d,onChange:this.onStateChange,freeSolo:!1,getOptionLabel:e=>e||"",renderOption:e=>(0,S.jsx)(s.Fragment,{children:e}),renderInput:e=>(0,S.jsx)(o.Z,{...e,label:"State",variant:"outlined",inputProps:{...e.inputProps,autoComplete:"new-password"}})})," "]}):""]}),(0,S.jsx)(n.Z,{variant:"body2",color:"error"===p?"error":"primary",children:h})]}),(0,S.jsxs)(D.Z,{children:[(0,S.jsx)(l.Z,{onClick:t,color:"primary",children:"Cancel"}),(0,S.jsx)(l.Z,{onClick:this.setAddress,color:"primary",children:"Subscribe"})]})]})}}const A=k;var I=a(81463),T=a(47495);class F extends s.Component{constructor(){super(...arguments),this.state={upgrade:!1},this.toggleUprade=()=>{this.setState({upgrade:!this.state.upgrade})}}render(){const{classes:e,setPlan:t,address:a,toggleBillingAddressPopup:o,isCreditLow:c}=this.props,{placeOrder:h,selectedPlan:g,remainingCredit:m,paymentStatus:u}=this.props,{upgrade:x}=this.state;return g?(0,S.jsxs)(i.Z,{container:!0,xs:12,spacing:1,children:[(0,S.jsxs)(i.Z,{item:!0,xs:12,container:!0,alignItems:"center",children:[(0,S.jsx)(i.Z,{item:!0,children:(0,S.jsx)(p.Z,{onClick:()=>t(null),children:(0,S.jsx)(I.Z,{})})}),(0,S.jsx)(i.Z,{item:!0,children:(0,S.jsx)(n.Z,{variant:"h5",children:"Plan selected"})})]}),(0,S.jsxs)(i.Z,{container:!0,spacing:1,children:[(0,S.jsxs)(i.Z,{item:!0,xs:10,md:3,className:e.selectedPlan,children:[(0,S.jsx)(n.Z,{variant:"h3",gutterBottom:!0,align:"center",style:{fontWeight:500,letterSpacing:1},children:g.name}),(0,S.jsxs)(n.Z,{variant:"body2",paragraph:!0,align:"center",children:[g.description,"Pro"==g.name?(0,S.jsxs)(n.Z,{variant:"body2",component:"span",children:[" ","(Recommended)"]}):""]}),(0,S.jsxs)(n.Z,{variant:"h2",paragraph:!0,align:"center",style:{fontWeight:600,letterSpacing:1},children:["Rs ",g.amount/100]}),(0,S.jsxs)(n.Z,{variant:"body1",gutterBottom:!0,align:"center",children:["Per session message -"," ",(0,S.jsxs)(n.Z,{variant:"body1",component:"span",style:{fontWeight:500},children:["Rs ",g.sessionPrice/100]})]}),(0,S.jsxs)(n.Z,{variant:"body1",gutterBottom:!0,align:"center",children:["Per template message -"," ",(0,S.jsxs)(n.Z,{variant:"body1",component:"span",style:{fontWeight:500},children:["Rs ",g.templatePrice/100]})]}),(0,S.jsxs)(n.Z,{variant:"body2",paragraph:!0,align:"center",children:["Upto ",g.maxAgent," live chat agents"]})]}),(0,S.jsx)(i.Z,{item:!0,xs:10,md:9,children:(0,S.jsxs)(r.Z,{px:4,children:[(0,S.jsx)(r.Z,{my:2,children:(0,S.jsxs)(i.Z,{item:!0,container:!0,justify:"space-between",xs:12,children:[(0,S.jsxs)(i.Z,{item:!0,children:[(0,S.jsx)(n.Z,{variant:"h4",gutterBottom:!0,style:{fontWeight:500},children:"Billing Address"}),(0,S.jsx)(n.Z,{variant:"body1",paragraph:!0,children:"".concat(a.addressDetail," ").concat(a.state," ").concat(a.country)})]}),(0,S.jsx)(i.Z,{item:!0,children:(0,S.jsx)(p.Z,{onClick:o,children:(0,S.jsx)(T.Z,{color:"primary"})})})]})}),"Ongoing"===u?(0,S.jsx)(d.Z,{}):"Success"===u?(0,S.jsxs)(r.Z,{width:"100%",children:[(0,S.jsx)(n.Z,{variant:"h4",align:"center",paragraph:!0,style:{color:"green"},children:"Payment Succesfull"}),(0,S.jsx)(n.Z,{variant:"body2",align:"center",children:"It may take 1-2 days for credit to reflect in your account."}),(0,S.jsx)(l.Z,{onClick:this.toggleUprade,children:"Continue"})]}):"Failure"===u?(0,S.jsx)(n.Z,{variant:"h4",align:"center",color:"error",children:"Payment Failed"}):(0,S.jsx)(i.Z,{container:!0,children:a.addressDetail?(0,S.jsxs)(s.Fragment,{children:[(0,S.jsxs)(i.Z,{item:!0,container:!0,justify:"space-between",xs:12,children:[(0,S.jsx)(i.Z,{item:!0,children:(0,S.jsx)(n.Z,{variant:"body1",gutterBottom:!0,children:"Sub Total"})}),(0,S.jsx)(i.Z,{item:!0,children:(0,S.jsxs)(n.Z,{variant:"body1",gutterBottom:!0,children:["Rs ",g.amount/100-m]})})]}),"India"===a.country&&(0,S.jsxs)(i.Z,{item:!0,container:!0,justify:"space-between",xs:12,children:[(0,S.jsx)(i.Z,{item:!0,children:(0,S.jsx)(n.Z,{variant:"body1",paragraph:!0,children:"CGST(9%) + SGST(9%)"})}),(0,S.jsx)(i.Z,{item:!0,children:(0,S.jsxs)(n.Z,{variant:"body1",paragraph:!0,children:["Rs"," ",(.18*(g.amount/100-m)).toFixed(2)]})})]}),(0,S.jsxs)(i.Z,{item:!0,container:!0,justify:"space-between",xs:12,children:[(0,S.jsx)(i.Z,{item:!0,children:(0,S.jsx)(n.Z,{variant:"body1",gutterBottom:!0,children:"Total"})}),(0,S.jsx)(i.Z,{item:!0,children:(0,S.jsxs)(n.Z,{variant:"body1",gutterBottom:!0,children:["Rs"," ",(1.18*(g.amount/100-m)).toFixed(2)]})})]}),(0,S.jsx)(i.Z,{item:!0,container:!0,justify:"flex-end",xs:12,children:(0,S.jsx)(i.Z,{item:!0,children:(0,S.jsx)(r.Z,{my:3,children:(0,S.jsx)(l.Z,{variant:"contained",color:"primary",onClick:h,children:"Confirm & Pay"})})})})]}):(0,S.jsx)(i.Z,{item:!0,xs:!0,children:"Please set your Billing Address"})})]})})]})]}):!x&&c?(0,S.jsxs)(i.Z,{container:!0,xs:12,alignItems:"center",children:[(0,S.jsx)(i.Z,{item:!0,container:!0,xs:12,md:10,children:(0,S.jsx)(n.Z,{variant:"h5",children:"You are running low on credit. Your credit is expected to exhaust soon."})}),(0,S.jsx)(i.Z,{item:!0,container:!0,xs:12,md:2,justify:"flex-end",children:(0,S.jsx)(l.Z,{variant:"contained",color:"primary",href:"https://wa.link/p3xgyw",target:"_blank",className:e.margin,children:"Upgrade Now"})})]}):""}}const P=F;class N extends s.Component{render(){const{usageData:e,title:t,classes:a,assistantType:s,planSectionType:o,creditDetails:l}=this.props;return(0,S.jsx)(r.Z,{my:4,p:"1em",bgcolor:"white",borderRadius:"8px",children:(0,S.jsxs)(i.Z,{container:!0,justify:"center",children:[t&&(0,S.jsx)(i.Z,{item:!0,xs:12,style:{marginBottom:"1em"},children:(0,S.jsx)(n.Z,{variant:"h3",color:"primary",children:t})}),(0,S.jsx)(i.Z,{item:!0,xs:12,md:4,children:(0,S.jsxs)("div",{className:a.countContainer,children:[(0,S.jsx)(n.Z,{variant:"h5",children:"Sessions Messages :"}),(0,S.jsx)(n.Z,{variant:"h4",children:e.sessionMessagesCount})]})}),(0,S.jsx)(i.Z,{item:!0,xs:12,md:4,children:(0,S.jsxs)("div",{className:a.countContainer,children:[(0,S.jsx)(n.Z,{variant:"h5",children:"Template Messages :"}),(0,S.jsx)(n.Z,{variant:"h4",children:e.templateMessagesCount})]})}),"v1"===s?(0,S.jsx)(i.Z,{item:!0,xs:12,md:4,children:(0,S.jsxs)("div",{className:a.countContainer,children:[(0,S.jsx)(n.Z,{variant:"h5",children:"Total Messages :"}),(0,S.jsx)(n.Z,{variant:"h4",children:e.sessionMessagesCount+e.templateMessagesCount})]})}):"","v2"===s?(0,S.jsx)(i.Z,{item:!0,xs:12,md:4,children:(0,S.jsxs)("div",{className:a.countContainer,children:[(0,S.jsx)(n.Z,{variant:"h5",children:"Mexico Sessions"}),(0,S.jsx)(n.Z,{variant:"h4",children:e.waSessionCount})]})}):"","enterprise"===o?(0,S.jsx)(i.Z,{item:!0,xs:12,md:4,children:(0,S.jsxs)("div",{className:a.countContainer,children:[(0,S.jsx)(n.Z,{variant:"h5",children:"User Engagements:"}),(0,S.jsx)(n.Z,{variant:"h4",children:e.enterpriseSessionCount})]})}):"","v3"===o?(0,S.jsx)(i.Z,{item:!0,xs:12,md:4,children:(0,S.jsxs)("div",{className:a.countContainer,children:[(0,S.jsx)(n.Z,{variant:"h5",children:"Excess MAU Usage:"}),(0,S.jsx)(n.Z,{variant:"h4",children:l.macUsage-l.macQuota>0?l.macUsage-l.macQuota:0})]})}):"","v3"!==s&&(0,S.jsx)(i.Z,{item:!0,xs:12,children:(0,S.jsx)(n.Z,{variant:"body2",style:{margin:"0.2em 0.7em"},color:"textSecondary",children:"* Media attachements sent with messages are charged separately according to the plan"})})]})})}}const B=(0,h.Z)((e=>({countContainer:{margin:"0.5em",display:"flex",justifyContent:"space-around",backgroundColor:e.palette.primary.light,borderRadius:"8px",padding:"0.5em 0.2em",boxSizing:"border-box"}})))(N);var O=a(45788),U=a(81766),E=a(41365),R=(a(64343),a(87255),a(81533),a(20176)),L=a(59411),M=a(59688),z=a(60839),W=a(66396),_=a(68146),Y=a(19942),G=a(70816),H=a.n(G),V=a(58889),Q=a(3008),K=a(88894),J=a(61801),q=a(81369),$=a(63830),X=a(91925);class ee extends s.Component{constructor(e){super(e),this.toggleBillingDetailsDialog=()=>{this.setState({billingdialogOpen:!this.state.billingdialogOpen})},this.toggleUpgradeDialog=()=>{this.setState({upgradeDialogOpen:!this.state.upgradeDialogOpen})},this.removeScheduledCancel=async()=>{try{const e={type:"plan-cancel-removal"};this.props.updateAssistantStore({ongoingBillingProcess:e});const t=this.props.match.params.projectId;await u.Z.post(b.URL+"/payment/cancel-scheduled-cancel",{assistantId:t,ongoingBillingProcess:e})}catch(e){this.props.updateAssistantStore({ongoingBillingProcess:null}),this.props.showSnackbar({alertOpen:!0,alertMsg:"Failed to remove scheduled cancel",severity:"error"})}},this.state={billingdialogOpen:!1,upgradeDialogOpen:!1}}render(){var e,t,a,s;const{classes:o,assistantDetails:p,power:h,isReloading:m}=this.props,{planDisplayName:u,frequency:x,totalContact:y,macUsage:v,cardAdded:j,planActivatedOn:f,activePlan:C,subscriptionStatus:D,ongoingBillingProcess:Z,subscriptionScheduled:w,macQuota:k,planRenewalOn:A,partnerId:I,chargebeePlan:T,type:F,planDuration:P,ongoingPlanBillingProcess:N}=p,{billingdialogOpen:B,upgradeDialogOpen:O}=this.state,U=new Date(A),E=Math.floor((U.getTime()-Date.now())/864e5),R=k<v,L=R?v-k:k-v,M=R?k/v*100:v/k*100,z="v3"===F?J.V3_PLANS[C]:"FREE_FOREVER"!==C&&X.V4_PLANS[C];return m?(0,S.jsx)(g.Z,{variant:"rect",height:z?200:100,style:{background:"#EBF5F3",borderRadius:8,margin:"32px 0",boxShadow:"0 0 11px rgb(220 220 220)"}}):(0,S.jsxs)("div",{className:o.root,children:[(0,S.jsx)(r.Z,{my:4,children:(0,S.jsxs)(i.Z,{container:!0,justify:"center",children:[(0,S.jsx)(i.Z,{item:!0,xs:12,md:2!==h||I&&!T||"v4"===F?12:6,children:(0,S.jsxs)(r.Z,{px:4,py:3,position:"relative",children:[(0,S.jsx)(n.Z,{variant:"body2",gutterBottom:!0,color:"textSecondary",children:"Current Plan"}),z&&A&&(0,S.jsx)(r.Z,{className:o.stats,style:{color:"#5a5a5a",fontSize:12},children:"two-weekly"===x?"".concat(E<0?0:E," Days left"):P<15?"trial ends on ".concat(H()(U).format("DD/MM/YY")):"cancelled"!==D?"renews on ".concat(H()(U).format("DD/MM/YY")):"ends on ".concat(H()(U).format("DD/MM/YY"))}),(0,S.jsxs)(n.Z,{variant:"h4",style:{maxWidth:"calc(100% - 150px)"},children:[P<18&&"PRO_MONTHLY"===C?"TRIAL ":u,"FREE FOREVER"!==u&&(0,S.jsx)(S.Fragment,{}),"FREE FOREVER"!==u&&P>
117&&(0,S.jsxs)("span",{style:{fontSize:10,color:"darkslategrey"},children:[" ","(",x,")"]})]}),"cancelled"===D&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(r.Z,{mt:1}),(0,S.jsx)(n.Z,{variant:"h3",color:"primary",children:D.toUpperCase()})]}),z&&"v4"!==F&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(r.Z,{mt:3}),(0,S.jsx)(r.Z,{className:o.stats,style:{color:R?"#FF0000":"black",fontWeight:"bold"},children:L===1/0?"UNLIMITED":L}),(0,S.jsx)(n.Z,{variant:"body2",style:{maxWidth:"calc(100% - 70px)"},children:R?"Excess Usage":"Monthly Active Users (MAU) Left"}),(0,S.jsx)(r.Z,{mt:4}),(0,S.jsx)(n.Z,{variant:"body2",children:"MAU Usage"}),(0,S.jsx)(r.Z,{mt:1}),(0,S.jsx)(r.Z,{position:"relative",height:24,children:(0,S.jsx)(r.Z,{className:o.usageBubble,style:{left:R?"100%":"".concat(M,"%")},children:(0,S.jsxs)("div",{className:o.arrowBottom,children:[" ",v]})})}),(0,S.jsx)(Y.ko,{variant:R?"buffer":"determinate",value:M,valueBuffer:R?100:void 0,status:R?"error":"default"}),(0,S.jsx)(r.Z,{position:"relative",children:(0,S.jsx)(n.Z,{variant:"body2",style:{position:"absolute",right:R?"".concat(100-M,"%"):0,bottom:R&&M<=10?"5px":"unset",transform:R?"translate(50%, 0%)":"unset"},children:k===1/0?"UNLIMITED":k})}),(0,S.jsx)(n.Z,{variant:"body2",children:0})]})]})}),(0,_.Sz)({agent:{power:h},assistantDetails:p})&&(!I||I!==b.AISENSY_PARTNER_ID&&(null===(e=this.props.assistantDetails)||void 0===e||null===(t=e.partner)||void 0===t?void 0:t.isZohoEnabled)&&"NONE"!==(null===(a=this.props.assistantDetails)||void 0===a?void 0:a.activePlan)||T)&&!C.includes("DIWALI")&&(0,S.jsx)(i.Z,{item:!0,xs:12,md:6,children:(0,S.jsxs)(r.Z,{px:4,py:3,children:[z?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(r.Z,{mt:3,textAlign:"center",children:[R?(0,S.jsx)(n.Z,{variant:"body2",children:"monthly"===x?"Upgrade Now to Avoid Surcharge":"Upgrade Now for uninterrupted service"}):(0,S.jsx)(n.Z,{variant:"body2",children:P<15?"Upgrade Now for uninterrupted service":"Upgrade Now for more savings!"}),(0,S.jsx)(c.ZP,{enterTouchDelay:0,title:"cancelled"===D?"Plan upgrade unavailable":(0,V.Ig)(Z),children:(0,S.jsx)("div",{children:(0,_.Sz)({agent:{power:h},assistantDetails:p})&&(0,S.jsx)(l.Z,{onClick:this.toggleUpgradeDialog,variant:"contained",color:"primary",style:"cancelled"===D||"plan-update"===(null===Z||void 0===Z?void 0:Z.type)||"trial-activation"===(null===Z||void 0===Z?void 0:Z.type)?{}:{background:R?"#FF0000":"#0a474c"},className:o.addCardButton,disabled:"cancelled"===D||"plan-update"===(null===Z||void 0===Z?void 0:Z.type)||"trial-activation"===(null===Z||void 0===Z?void 0:Z.type),children:"Upgrade"})})})]}),2===h&&"active"===D&&(P>15||j)?"":"active"===D&&2===h?(0,S.jsx)(r.Z,{mt:5,textAlign:"center",children:(0,S.jsx)(n.Z,{variant:"h4",color:"textPrimary",children:"Trial ends ".concat(E<0?"today":"in ".concat(E," days")," ")})}):"",2===h&&"cancelled"===D&&(0,S.jsxs)(r.Z,{mt:4,textAlign:"center",children:[(0,S.jsx)(n.Z,{variant:"body2",children:"To continue using services when ".concat(P<15?"trial":"term"," ends.")}),(0,S.jsx)(c.ZP,{enterTouchDelay:0,title:(0,V.Ig)(Z),children:(0,S.jsx)(r.Z,{children:(0,S.jsx)(l.Z,{variant:"outlined",className:o.removeCancelPlanButton,onClick:this.removeScheduledCancel,color:"primary",disabled:!!Z,endIcon:Z?(0,S.jsx)(d.Z,{size:20}):"",children:"Remove Scheduled Cancel"})})})]})]}):(0,S.jsxs)(r.Z,{textAlign:"center",children:[(0,S.jsx)(n.Z,{variant:"body2",children:"You don\u2019t have any active plan"}),(0,_.Sz)({agent:{power:h},assistantDetails:p})&&(0,S.jsx)(c.ZP,{enterTouchDelay:0,title:(0,V.Ig)(Z),children:(0,S.jsx)("div",{children:(0,S.jsx)(l.Z,{onClick:this.toggleUpgradeDialog,variant:"contained",color:"primary",className:o.addCardButton,disabled:"plan-update"===(null===Z||void 0===Z?void 0:Z.type),children:"Get a Plan"})})})]}),("plan-update"===(null===Z||void 0===Z?void 0:Z.type)||"trial-activation"===(null===Z||void 0===Z?void 0:Z.type))&&(!this.props.assistantDetails.partnerId||I&&(null===(s=this.props.assistantDetails.partner)||void 0===s?void 0:s.isZohoEnabled))&&N&&(0,S.jsxs)(r.Z,{display:"flex",alignItems:"center",mt:2,justifyContent:"center",children:[(0,S.jsx)(d.Z,{size:20}),(0,S.jsx)(n.Z,{variant:"body2",style:{marginLeft:8},children:"plan-update"===Z.type?"Upgrade in progress.":"Trial activation in progress."})]})]})})]})}),(0,S.jsx)(Q.Z,{dialogOpen:B,toggleBillingDetailsDialog:this.toggleBillingDetailsDialog}),(0,S.jsx)(K.default,{purchaseNew:!z,dialogOpen:O,toggleUpgradeDialog:this.toggleUpgradeDialog})]})}}const te=(0,h.Z)((e=>({root:{width:"100%",background:"white",borderRadius:"8px",boxShadow:"0 0 11px rgb(230,230,230)"},stats:{position:"absolute",right:0,paddingRight:30},usageBubble:{transform:"translate(-50%, 0%)",position:"absolute"},addCardButton:{marginTop:8,width:"100%",maxWidth:250,margin:"16px auto 0",height:"40px"},arrowBottom:{marginBottom:"10px",padding:"2px 8px",boxSizing:"border-box",background:"#edeaea",color:"#0000009c",borderRadius:"4px",textAlign:"center",position:"relative",fontSize:"10px","&:after":{content:'""',position:"absolute",right:"calc(50%  - 8px)",top:"15p
1x",borderBottom:"none",borderRight:"8px solid transparent",borderLeft:"8px solid transparent",borderTop:"8px solid #edeaea"}},removeCancelPlanButton:{width:"100%",maxWidth:250,margin:"16px auto 0",height:"40px"}})))((0,$.withRouter)(ee));var ae=a(26396);class se extends s.Component{render(){const{classes:e,promotionalCredits:t,currency:a,isReloading:s}=this.props;return s?(0,S.jsx)(g.Z,{variant:"rect",className:e.cardLookSkeleton}):(0,S.jsx)("div",{className:e.root,children:(0,S.jsxs)(r.Z,{className:e.cardLook,border:"1px solid lightgrey",px:4,py:3,borderRadius:8,boxShadow:"0 0 11px rgb(230 230 230)",children:[(0,S.jsx)(n.Z,{variant:"h4",children:"Promotional Credits"}),(0,S.jsxs)(n.Z,{variant:"h3",style:{marginTop:8},children:[(0,S.jsx)("span",{style:{fontFamily:"Roboto"},children:"USD"===a?"$":"\u20b9"})," ".concat(Number(t/100).toFixed(2))]})]})})}}const ie=(0,h.Z)((e=>({root:{width:"100%",height:"100%"},cardLook:{background:"white",border:"none",boxSizing:"border-box",[e.breakpoints.down("md")]:{margin:"24px 0 0 0",height:"unset"},[e.breakpoints.up("md")]:{margin:"24px 0 0 12px",height:"calc( 100% - 24px)"}},cardLookSkeleton:{borderRadius:"8px",boxSizing:"border-box",height:100,[e.breakpoints.down("md")]:{margin:"24px 0 0 0"},[e.breakpoints.up("md")]:{margin:"24px 0 0 12px"}}})))(se);var ne=a(67367),re=(a(59017),a(16031)),oe=a(58821),le=a(5770),de=a(87311),ce=a(91529);const pe=v()(),he={key:"rzp_test_MIJtOfg10iw9hI",amount:"5000",currency:"INR",name:"AiSensy",description:"Pro plan",image:"https://ai-jenny.s3.ap-south-1.amazonaws.com/iconaijenny.png",order_id:"order_FwR2pSeBf2Qzdz",handler:e=>{alert(e.razorpay_payment_id),alert(e.razorpay_order_id),alert(e.razorpay_signature)},prefill:{name:"Gaurav Kumar",email:"[email protected]",contact:"9999999999"},theme:{color:"#E8700D"}},ge={v1:[{name:"Current Plan",key:"currentPlan",value:"Free"},{name:"Remaining Credit",key:"remainingCredit",value:"--"},{name:"Activated On",key:"activatedOn",value:"--"}],v2:[{name:"Current Plan",key:"currentPlan",value:"Free"},{name:"Session Messages",key:"remainingSessionMessages",value:"--",bottomText:"( Remaining )"},{name:"Template Credit",key:"templateCredit",value:"--",bottomText:"( Remaining )"},{name:"Activated On",key:"activatedOn",value:"--"}],v3:[{name:"Current Plan",key:"currentPlan",value:"Free"},{name:"Remaining MAU",key:"macUsage",value:"--"},{name:"Template Credit",key:"templateCredit",value:"--",bottomText:"( Remaining )"},{name:"Activated On",key:"activatedOn",value:"--"}],enterprise:[{name:"Current Plan",key:"currentPlan",value:"Free"},{name:"User Engagements",key:"remainingEnterpriseSessions",value:"--",bottomText:"( Remaining )"},{name:"Conversation Credits",key:"templateCredit",value:"--",bottomText:"( Remaining )"},{name:"Activated On",key:"activatedOn",value:"--"}]},me=[{name:"Order Id",key:"orderId"},{name:"Plan",key:"plan"},{name:"Amount",key:"amount"},{name:"Date",key:"createdAt"},{name:"Status",key:"status"}],ue={Today:{fromDate:pe.clone().startOf("day"),toDate:pe},Yesterday:{fromDate:pe.clone().subtract(1,"days").startOf("day"),toDate:pe.clone().subtract(1,"days").endOf("day")},"Last 7 days":{fromDate:pe.clone().subtract(7,"days").startOf("day"),toDate:pe},"Last 30 days":{fromDate:pe.clone().subtract(30,"days").endOf("day"),toDate:pe}},xe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ye=Object.keys(ue);class ve extends s.Component{constructor(e){super(e),this.cancelTokenSource=null,this.cancelTokenBillingPeriods=null,this.onSnackbarClose=()=>{this.setState({alertOpen:!1})},this.onConfirmationDialogClose=()=>{this.setState({confirmTask:!1})},this.onAddonConfirmationDialogClose=()=>{this.setState({confirmAddonTask:!1})},this.onDowngradeConfirmationDialogClose=()=>{this.setState({confirmDowngradeTask:!1})},this.handleDowngradeToBasicFlow=async()=>{const{assistantDetails:e}=this.props,t=this.props.match.params.projectId,a=(0,de.Z)(e);this.setState({confirmDowngradeTask:!1});try{await(0,V.GW)({assistantId:t,planName:e.activePlan,assistantDetails:e,showSnackbar:this.showSnackbar,updateAssistantStore:this.props.updateAssistantStore,closeOpenDialog:()=>{},fetchAssistantDetails:(e,t,a)=>this.props.fetchAssistantDetails(e,t,a),purchaseNew:!1,isFlowAddON:!0,flowCount:a.flowCount||5,addonTier:"basic_flow",isAddonOnly:!0})}catch(i){var s;const e=(null===i||void 0===i||null===(s=i.response)||void 0===s?void 0:s.data)||"Failed to schedule downgrade";this.showSnackbar({alertOpen:!0,alertMsg:"string"===typeof e?e:"Failed to schedule downgrade",severity:"error"})}},this.showSnackbar=e=>{this.setState(e)},this.handleAutoComplete=(e,t,a)=>{if("select-option"==a){let a=ue[t].fromDate||this.state.fromDate,s=ue[t].toDate||this.state.toDate;new Date(a).getTime()<new Date("02/15/2022").getTime()&&(a=v()(new Date("02/15/2022"))),new Date(s).getTime()<new Date("02/15/2022").getTime()&&(a=v()(new Date)),this.setState({[e]:t,["interval"===e?"fromDate":"templateInterval"===e?"templateFromDate":"engagementFromDate"]:a,["interval"===e?"toDate":"templateInterval"===e?"templateToDate":"engagementToDate"]:s},(()=>{"interval"===e&&this.loadData(),"templateInterval"===e&&this.loadTemplateData(),"engagementInterval"===e&&this.loadEngagagementData()}))}},this.placeOrder=e=>{const t=this.props.match.params.projectId;u.Z.post(b.URL+"/api/create-order",{selectedPlan:this.state.selectedPlan,assistantId:t}).then((t=>{he.order_id=t.data.orderId,he.handler=e=>{this.setState({paymentStatus:"Success"})};const a=new window.Razorpay(he);a.on("payment.failed",(function(e){alert(e.error.code),alert(e.error.description),alert(e.error.source),alert(e.error.step),alert(e.error.reason),alert(e.error.metadata.order_id),alert(e.error.metadata.payment_id),this.setState({paymentStatus:"Failure"})})),a.open(),e.preventDefault(),this.setState({orderId:t.data.orderId,paymentStatus:"Ongoing"})})).catch((e=>{console.error(e)}))},this.setPlan=e=>{this.setState({selectedPlan:e||null})},this.toggleBillingAddressPopup=()=>{this.setState({openBillingAddress:!this.state.openBillingAddress})},this.togglePartnerBillingAddrs=()=>{this.setState({openPartnerBillingAddress:!this.state.openPartnerBillingAddress})},this.onChange=e=>{this.setState({[e.target.name]:e.target.value})},this.saveBillingAddress=e=>{let{addressDetail:t,state:a,country:s}=e;const i=this.props.match.params.projectId;u.Z.post(b.URL+"/api/set-billing-address",{assistantId:i,address:{addressDetail:t,state:a,country:s}}).then((e=>{this.setState({address:{addressDetail:t,state:a,country:s},openBillingAddress:!1})})).catch((e=>{console.error(e),this.setState({status:"error",statusMessage:"Billing address update request failed!"})}))},this.toggleSection=e=>{if(e!==this.state.analyticsSection){if("current"===e){const e=v()(new Date(this.props.assistantDetails.planActivatedOn)),{fromDate:t}=this.state;t.isBefore(e)&&this.setState({fromDate:e})}this.setState({analyticsSection:e},this.loadData)}},this.setFocus=e=>{const t=document.getElementsByClassName("DateInput");t[0]&&(t[0].style.border="startDate"===e?"1px solid grey":"1px solid lightgrey"),t[1]&&(t[1].style.border="endDate"===e?"1px solid grey":"1px solid lightgrey"),this.setState({focusedInput:e})},this.setDate=(e,t)=>
1{e&&t&&this.setState({fromDate:e.startOf("day"),toDate:t.endOf("day"),interval:"Custom Range",analyticsSection:"all"},(()=>this.loadData()))},this.setTemplateFocus=e=>{const t=document.getElementsByClassName("DateInput");("all"===this.state.analyticsSection?t[2]:t[0])&&(("all"===this.state.analyticsSection?t[2]:t[0]).style.border="startDate"===e?"1px solid grey":"1px solid lightgrey"),("all"===this.state.analyticsSection?t[3]:t[1])&&(("all"===this.state.analyticsSection?t[3]:t[1]).style.border="endDate"===e?"1px solid grey":"1px solid lightgrey"),this.setState({templateFocusedInput:e})},this.setTemplateDate=(e,t)=>{e&&t&&this.setState({templateFromDate:e.startOf("day"),templateToDate:t.endOf("day"),templateInterval:"Custom Range"},(()=>this.loadTemplateData()))},this.setEngagementFocus=e=>{const t=document.getElementsByClassName("DateInput");t[2]&&(t[2].style.border="startDate"===e?"1px solid grey":"1px solid lightgrey"),t[3]&&(t[3].style.border="endDate"===e?"1px solid grey":"1px solid lightgrey"),this.setState({engagementFocusedInput:e})},this.setEngagementDate=(e,t)=>{e&&t&&this.setState({engagementFromDate:e.startOf("day"),engagementToDate:t.endOf("day"),engagementInterval:"Custom Range"},(()=>this.loadEngagagementData()))},this.filterData=()=>{let{dailyMacAnalytics:e,analyticsSection:t}=this.state;const{assistantDetails:a}=this.props,{planActivatedOn:s,frequency:i}=a;let n=[];if("all"===t){const t={};(e||[]).forEach((e=>{t[e.dayDate]?t[e.dayDate].macUsageCount+=e.macUsageCount:t[e.dayDate]={...e}})),e=[...Object.values(t)]}n=[...(e||[]).map((e=>{const t=v()(e.dayDate).format("MM/DD/YYYY").split("/");return{date:t[1]+" "+xe[Number(t[0]-1)],"Total MAU usage":e.macUsageCount,"User created MAU":e.userCreatedMacCount,"Business created MAU":e.businessCreatedMacCount,dateObj:v()(new Date(e.dayDate))}}))],n=n.sort(((e,t)=>e.dateObj.diff(t.dateObj,"minutes"))),this.setState({macUsageData:n,isAnalyticsLoading:!1})},this.safeDivide=e=>{const t=parseFloat(e);return isNaN(t)?0:t/1e5},this.filterTemplateData=()=>{let{dailyTemplateAnalytics:e,wccAnalyticsCountry:t,dailyPaymentAnalytics:a}=this.state;const s=["ALL"];let i=[];i=[...e.map((e=>{var i,n,r,o,l,d,c,p,h,g,m,u,x,y;Object.entries(e.bicCreditUsageCountryWise||{}).forEach((e=>{e[1].count>0&&!s.includes(e[0])&&s.push(e[0])})),Object.entries(e.uicCreditUsageCountryWise||{}).forEach((e=>{e[1].count>0&&!s.includes(e[0])&&s.push(e[0])})),Object.entries(e.acCreditUsageCountryWise||{}).forEach((e=>{e[1].count>0&&!s.includes(e[0])&&s.push(e[0])})),Object.entries(e.ucCreditUsageCountryWise||{}).forEach((e=>{e[1].count>0&&!s.includes(e[0])&&s.push(e[0])})),Object.entries(e.mcCreditUsageCountryWise||{}).forEach((e=>{e[1].count>0&&!s.includes(e[0])&&s.push(e[0])})),Object.entries(e.scCreditUsageCountryWise||{}).forEach((e=>{e[1].count>0&&!s.includes(e[0])&&s.push(e[0])})),Object.entries(e.mlcCreditUsageCountryWise||{}).forEach((e=>{e[1].count>0&&!s.includes(e[0])&&s.push(e[0])}));const b=v()(e.dayDate).format("MM/DD/YYYY").split("/"),j=v()(e.dayDate).format("YYYY-MM-DD"),{waPayCreditUsage:f,waPayCount:C}=a[j]||{},D="ALL"===t?this.safeDivide(e.bicCreditUsage):this.safeDivide(null===(i=(e.bicCreditUsageCountryWise||{})[t])||void 0===i?void 0:i.amount),Z="ALL"===t?this.safeDivide(e.uicCreditUsage):this.safeDivide(null===(n=(e.uicCreditUsageCountryWise||{})[t])||void 0===n?void 0:n.amount),w="ALL"===t?this.safeDivide(e.scCreditUsage):this.safeDivide(null===(r=(e.scCreditUsageCountryWise||{})[t])||void 0===r?void 0:r.amount),S="ALL"===t?this.safeDivide(e.acCreditUsage):this.safeDivide(null===(o=(e.acCreditUsageCountryWise||{})[t])||void 0===o?void 0:o.amount),k="ALL"===t?this.safeDivide(e.mcCreditUsage):this.safeDivide(null===(l=(e.mcCreditUsageCountryWise||{})[t])||void 0===l?void 0:l.amount),A="ALL"===t?this.safeDivide(e.ucCreditUsage):this.safeDivide(null===(d=(e.ucCreditUsageCountryWise||{})[t])||void 0===d?void 0:d.amount),I="ALL"===t?this.safeDivide(e.mlcCreditUsage):this.safeDivide(null===(c=(e.mlcCreditUsageCountryWise||{})[t])||void 0===c?void 0:c.amount),T=Number((f||0)/1e5),F=w+S+k+A+D+Z+I+(T||0);return{date:b[1]+" "+xe[Number(b[0]-1)],"Total Credit Usage":F.toFixed(3),"BIC Count":"ALL"===t?e.bicCount||0:(null===(p=(e.bicCreditUsageCountryWise||{})[t])||void 0===p?void 0:p.count)||0,"BIC Credit Usage":D.toFixed(3),"
1UIC Count":"ALL"===t?e.uicCount||0:(null===(h=(e.uicCreditUsageCountryWise||{})[t])||void 0===h?void 0:h.count)||0,"UIC Credit Usage":Z.toFixed(3),"SC Count":"ALL"===t?e.scCount||0:(null===(g=(e.scCreditUsageCountryWise||{})[t])||void 0===g?void 0:g.count)||0,"SC Credit Usage":w.toFixed(3),"AC Count":"ALL"===t?e.acCount||0:(null===(m=(e.acCreditUsageCountryWise||{})[t])||void 0===m?void 0:m.count)||0,"AC Credit Usage":S.toFixed(3),"MC Count":"ALL"===t?e.mcCount||0:(null===(u=(e.mcCreditUsageCountryWise||{})[t])||void 0===u?void 0:u.count)||0,"MC Credit Usage":k.toFixed(3),"MLC Count":"ALL"===t?e.mlcCount||0:(null===(x=(e.mlcCreditUsageCountryWise||{})[t])||void 0===x?void 0:x.count)||0,"MLC Credit Usage":I.toFixed(3),"UC Count":"ALL"===t?e.ucCount||0:(null===(y=(e.ucCreditUsageCountryWise||{})[t])||void 0===y?void 0:y.count)||0,"UC Credit Usage":A.toFixed(3),"WA Pay Count":C?C.toFixed(3):0,"WA Pay Credit Usage":T?T.toFixed(3):0,dateObj:v()(new Date(e.dayDate))}}))],i=i.sort(((e,t)=>e.dateObj.diff(t.dateObj,"minutes")));const n={};i.forEach((e=>{const t=e.date;if(n[t]){const a=n[t];for(const t in e)if("date"!==t&&"dateObj"!==t&&!isNaN(parseFloat(e[t]))&&isFinite(e[t])){const s=parseFloat(a[t])||0,i=parseFloat(e[t])||0;a[t]=(s+i).toFixed(3)}}else n[t]={...e}})),i=Object.values(n),this.setState({templateCreditUsage:i,wccCountries:s,isTemplateAnalyticsLoading:!1})},this.filterEngagementData=()=>{let{dailyEngagementAnalytics:e}=this.state,t=[];t=[...e.map((e=>{const t=v()(e.dayDate).format("MM/DD/YYYY").split("/");return{date:t[1]+" "+xe[Number(t[0]-1)],"Enterprise Session":e.engagementCount,dateObj:v()(new Date(e.dayDate))}}))],t=t.sort(((e,t)=>e.dateObj.diff(t.dateObj,"minutes"))),this.setState({engagementUsage:t,isEnagagementAnalyticsLoading:!1})},this.loadData=()=>{this.setState({isAnalyticsLoading:!0});const{match:e,assistantDetails:t}=this.props,{timezone:a}=t,s=e.params.projectId,i=this.state.fromDate,n=this.state.toDate,r=this.state.selectedBillingPeriod,o=b.URL+("all"===this.state.analyticsSection?"/api/mac-analytics":"/api/mac-billing-analytics");u.Z.post(o,{fromDate:"all"===this.state.analyticsSection?this.getDayStartTimestamp(i,(null===a||void 0===a?void 0:a.split(" ")[0])||"Asia/Calcutta"):null===r||void 0===r?void 0:r.fromDate,toDate:this.getDayEndTimestamp(n,(null===a||void 0===a?void 0:a.split(" ")[0])||"Asia/Calcutta"),assistantId:s}).then((e=>{const{dailyMacAnalytics:t}=e.data;this.setState({dailyMacAnalytics:t},this.filterData)})).catch((e=>{console.error(e),this.setState({err:e,isAnalyticsLoading:!1})}))},this.getDayStartTimestamp=(e,t)=>v().tz(new Date(e),t).startOf("day"),this.getDayEndTimestamp=(e,t)=>v().tz(new Date(e),t).endOf("day"),this.loadTemplateData=()=>{this.setState({isTemplateAnalyticsLoading:!0,wccAnalyticsCountry:"ALL"}),this.cancelTokenSource=u.Z.CancelToken.source();const{match:e,assistantDetails:t}=this.props,{timezone:a}=t,s=e.params.projectId,i=this.state.templateFromDate,n=this.state.templateToDate;u.Z.post(b.URL+"/api/daily-chat-analytics",{fromDate:this.getDayStartTimestamp(i,(null===a||void 0===a?void 0:a.split(" ")[0])||"Asia/Calcutta"),toDate:this.getDayEndTimestamp(n,(null===a||void 0===a?void 0:a.split(" ")[0])||"Asia/Calcutta"),assistantId:s},{cancelToken:this.cancelTokenSource.token}).then((e=>{const{dailyChatAnalytics:t,dailyPaymentAnalytics:a}=e.data,s=(0,re.keyBy)(a,"_id");this.setState({dailyTemplateAnalytics:t,dailyPaymentAnalytics:s},this.filterTemplateData)})).catch((e=>{console.error(e),this.setState({err:e,isTemplateAnalyticsLoading:!1})}))},this.loadEngagagementData=()=>{this.setState({isEnagagementAnalyticsLoading:!0});const{match:e,assistantDetails:t}=this.props,{timezone:a}=t,s=e.params.projectId,i=this.state.engagementFromDate,n=this.state.engagementToDate;u.Z.post(b.URL+"/api/daily-engagement-analytics",{fromDate:this.getDayStartTimestamp(i,(null===a||void 0===a?void 0:a.split(" ")[0])||"Asia/Calcutta"),toDate:this.getDayEndTimestamp(n,(null===a||void 0===a?void 0:a.split(" ")[0])||"Asia/Calcutta"),assistantId:s}).then((e=>{const{dailyEngagementAnalytics:t}=e.data;this.setState({dailyEngagementAnalytics:t},this.filterEngagementData)})).catch((e=>{console.error(e),this.setState({err:e,isEnagagementAnalyticsLoading:!1})}
1))},this.loadBillingPeriods=()=>{this.cancelTokenBillingPeriods=u.Z.CancelToken.source();const e=this.props.match.params.projectId;u.Z.post(b.URL+"/api/get-billing-periods",{assistantId:e},{cancelToken:this.cancelTokenBillingPeriods.token}).then((e=>{const{billingPeriods:t}=e.data,a=t.sort(((e,t)=>new Date(e._id).getTime()<new Date(t._id).getTime()?-1:1)).map(((e,t,a)=>{const s={fromDate:e._id};return a[t+1]&&(s.toDate=a[t+1]._id),s}));this.setState({billingPeriods:a,selectedBillingPeriod:a[a.length-1]},this.loadData)})).catch((e=>{var t,a;const s=e.response,i=(null===s||void 0===s||null===(t=s.data)||void 0===t?void 0:t.errorMessage)||(null===s||void 0===s||null===(a=s.data)||void 0===a?void 0:a.message)||"Something went wrong! Check your network connection.";i&&this.setState({status:"error",statusMessage:i})}))},this.canclePlan=async()=>{try{this.setState({confirmTask:!1});const e={type:"plan-cancel"};this.props.updateAssistantStore({ongoingBillingProcess:e});const t=this.props.match.params.projectId;await u.Z.post(b.URL+"/payment/cancel-plan",{assistantId:t,ongoingBillingProcess:e})}catch(e){this.props.updateAssistantStore({ongoingBillingProcess:null}),this.showSnackbar({alertOpen:!0,alertMsg:"Failed to cancel plan",severity:"error"})}},this.cancelAddon=async()=>{try{const e={type:"addon-cancel"};this.props.updateAssistantStore({ongoingBillingProcess:e});let t=await(0,V.iV)({assistantId:this.props.match.params.projectId,isScheduledAddon:this.state.isScheduledAddon});if(!t)throw"failed";t&&(this.showSnackbar({alertOpen:!0,alertMsg:"success",severity:"success"}),this.props.fetchAssistantDetails(this.props.match.params.projectId,!0),this.props.updateAssistantStore({ongoingBillingProcess:null,flowConfiguration:{isEnabled:!1,flowCount:0,activeFlowCount:0,isTrialClaimed:!0},...this.state.isScheduledAddon?{subscriptionScheduledItems:this.props.assistantDetails.subscriptionScheduledItems.filter((e=>"addon"!==e.item_type))||this.props.assistantDetails.subscriptionScheduledItems.filter((e=>e.addon_code.includes("Flows")))||this.props.assistantDetails.subscriptionScheduledItems.filter((e=>"box"!==e.unit))}:{subscription:this.props.assistantDetails.subscription.filter((e=>"addon"!==e.item_type))||this.props.assistantDetails.subscription.filter((e=>"box"!==e.unit))}}),this.setState({confirmAddonTask:!1}))}catch(e){console.log(e),this.props.updateAssistantStore({ongoingBillingProcess:null}),this.showSnackbar({alertOpen:!0,alertMsg:"Failed to cancel",severity:"error"})}},this.getOrderItemColumn=(e,t,a)=>{const s=t.key;switch(s){case"orderId":return(0,S.jsx)(i.Z,{item:!0,container:!0,xs:4,className:e.orderItem,children:(0,S.jsx)(n.Z,{variant:"h5",children:a[s]})});case"status":return(0,S.jsx)(i.Z,{item:!0,container:!0,xs:2,className:e.orderItem,children:(0,S.jsx)(n.Z,{variant:"h5",style:{color:"green"},children:a[s].toUpperCase()})});case"amount":return(0,S.jsx)(i.Z,{item:!0,container:!0,xs:2,className:e.orderItem,children:(0,S.jsx)(n.Z,{variant:"h5",children:a[s]/100})});case"createdAt":return(0,S.jsx)(i.Z,{item:!0,container:!0,xs:2,className:e.orderItem,children:(0,S.jsx)(n.Z,{variant:"h5",children:new Date(a[s]).toLocaleDateString(["en-GB"],{hour:"numeric",minute:"numeric",hour12:!0})})});default:return(0,S.jsx)(i.Z,{item:!0,container:!0,xs:2,className:e.orderItem,children:(0,S.jsx)(n.Z,{variant:"h5",children:a[s]})})}},this.state={orderId:"",selectedPlan:null,openBillingAddress:!1,openPartnerBillingAddress:!1,address:{addressDetail:"",state:"",country:""},currentDetails:{},status:"",statusMessage:"",isLoading:!0,paymentStatus:"",alertOpen:!1,alertMsg:"",severity:"",analyticsSection:"current",isAnalyticsLoading:!1,fromDate:ue["Last 7 days"].fromDate,toDate:ue["Last 7 days"].toDate,startDate:null,endDate:null,focusedInput:null,macUsageData:[],isTemplateAnalyticsLoading:!1,templateFromDate:ue["Last 7 days"].fromDate,templateToDate:ue["Last 7 days"].toDate,engagementFromDate:ue["Last 7 days"].fromDate,engagementToDate:ue["Last 7 days"].toDate,templateCreditUsage:[],templateStartDate:null,templateEndDate:null,templateFocusedInput:null,engagementStartDate:null,engagementEndDate:null,engagementFocusedInput:null,confirmTask:!1,confirmAddonTask:!1,confirmDowngradeTask:!1,wccA
1nalyticsCountry:"ALL",wccCountries:["ALL"],interval:"Last 7 days",templateInterval:"Last 7 days",engagementInterval:"Last 7 days",billingPeriods:[],dailyPaymentAnalytics:[],selectedBillingPeriod:"",isScheduledAddon:!1}}componentDidMount(){const{match:e,assistantDetails:t}=this.props,{providerType:a,type:s,cbpType:i}=t,n=e.params.projectId;i&&(this.loadTemplateData(),this.loadBillingPeriods(),this.props.fetchAssistantDetails(n,!0)),"ENTERPRISE"===i&&this.loadEngagagementData(),i&&"MAC"!==i&&this.props.fetchAssistantDetails(n,!0)}componentWillUnmount(){this.cancelTokenSource&&this.cancelTokenSource.cancel("Operation canceled due to component unmounting."),this.cancelTokenBillingPeriods&&this.cancelTokenBillingPeriods.cancel("Operation canceled due to component unmounting.")}getPlanSectionType(){const{currentDetails:e}=this.state;return"v1"===e.assistantType?"v1":"v3"===e.assistantType?"v3":"v4"===e.assistantType?"v4":"normal"===e.planType?"v2":"enterprise"}render(){var e,t,a,p,h,u,y,j,f;const{classes:C,assistantDetails:D,power:Z,isReloading:w,match:k}=this.props,I=k.params.projectId,{providerType:T,type:F,frequency:N,planDisplayName:O,subscriptionStatus:U,planActivatedOn:R,ongoingBillingProcess:L,promotionalCredits:M,currency:_,activePlan:G,planRenewalOn:H,cardAdded:Q,cbpType:K,allowPurchase:J,partnerId:$,chargebeePlan:ee,planDuration:se,partner:re}=D,{currentDetails:pe,isLoading:he,selectedPlan:ue,currentMonthUsage:xe,analyticsSection:ve,isAnalyticsLoading:je,isTemplateAnalyticsLoading:fe,isEnagagementAnalyticsLoading:Ce,wccAnalyticsCountry:De,wccCountries:Ze}=this.state,we=new Date(H),Se=pe.orders||[],{assistantType:ke,templateCredit:Ae,remainingSessionMessages:Ie,remainingCredit:Te,macUsage:Fe,macQuota:Pe,remainingEnterpriseSessions:Ne}=pe,Be="v1"===ke&&Te<500||"v2"===ke&&(Ae<500||Ie<500)||"enterprise"===ke&&(Ae<500||Ne<500)||"v3"===ke&&(Ae<500||Pe-Fe<500)||"v4"===ke&&Ae<500,Oe=("v2"===T||"v3"===T)&&("v3"===F||"v4"===F),Ue=new Date(R||0),Ee=Date.now()-Ue.getTime()<864e5;return(0,S.jsxs)("div",{className:"".concat(C.root," ginger-page-root"),children:[(0,S.jsx)(i.Z,{container:!0,justify:"center",alignItems:"center",className:"".concat(C.pageTitleContainer," ").concat(C.fullWidth," ginger-page-header"),children:(0,S.jsx)(i.Z,{item:!0,xs:!0,children:(0,S.jsxs)(r.Z,{px:{xs:2,md:3},display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,S.jsx)(n.Z,{variant:"h3",children:"Billing & Usage"}),(0,S.jsx)(ce.default,{})]})})}),(0,S.jsx)(r.Z,{my:3}),(0,S.jsxs)(i.Z,{container:!0,justify:"center",children:[(null===D||void 0===D||null===(e=D.activePlan)||void 0===e?void 0:e.includes("AUTOMATION_LITE"))&&(0,S.jsx)(i.Z,{item:!0,xs:12,md:10,lg:10,children:(0,S.jsx)(r.Z,{px:{xs:1,md:0},mb:2,children:(0,S.jsx)(le.Z,{variant:"orange"})})}),(0,S.jsx)(i.Z,{item:!0,xs:12,md:10,lg:10,children:(0,S.jsxs)(r.Z,{px:{xs:1,md:0},children:[(0,S.jsx)(oe.Z,{title:"Quick Guide",description:"You can refer your billing cycle and plan details here.",section:"billingAndUsage",prospectId:null===D||void 0===D?void 0:D.prospectId,showTutorial:!$}),!Oe&&(0,S.jsx)(r.Z,{my:4,children:he?(0,S.jsx)(g.Z,{variant:"rect",height:120,style:{background:"#EBF5F3",borderRadius:8}}):(0,S.jsx)(i.Z,{container:!0,className:(0,x.Z)(C.container,C.primaryBackground,{[C.elevation]:"enterprise"===this.getPlanSectionType()}),children:ge[this.getPlanSectionType()].map(((e,t)=>(0,S.jsxs)(i.Z,{item:!0,container:!0,xs:11,md:!0,className:C.currentPlanItem,justify:"center",alignItems:"center",children:[(0,S.jsxs)(i.Z,{item:!0,xs:9,children:[(0,S.jsx)(n.Z,{variant:"h5",style:{color:"black",fontSize:13},children:e.name}),(0,S.jsx)(n.Z,{variant:"body2",color:"textSecondary",children:e.bottomText})]}),(0,S.jsx)(i.Z,{item:!0,xs:9,children:(0,S.jsx)(n.Z,{variant:"h5",className:(0,x.Z)(C.currentPlanItemMainText,{[C.bigText]:0==t}),children:pe[e.key]||0===pe[e.key]?"activatedOn"===e.key?new Date(pe[e.key]).toLocaleString([],{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"numeric"}):"macUsage"===e.key?String(Pe-Fe<0?0:Pe-Fe):String(pe[e.key]):"--"})})]})))})}),!K&&(he?(0,S.jsx)(g.Z,{variant:"rect",height:150,style:{borderRadius:8}}):(0,S.jsx)(B,{title:"Current Month Usage",usageData:xe,assistantType:pe.assistantType,creditDetails:pe,planSectionType:this.getPlanSectionType()})),(!!ue||Be)&&!K&&(0,S.jsx)(r.Z,{my:4,px:3,py:3,className:C.container,children:(0,S.jsx)(P,{classes:C,setPlan:this.setPlan,selectedPlan:ue,address:this.state.address,toggleBillingAddressPopup:this.toggleBillingAddressPopup,placeOrder:this.placeOrder,remainingCredit:pe.remainingCredit,paymentStatus:this.state.paymentStatus,isCreditLow:Be})}),!K&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(r.Z,{mt:4,mb:2,children:(0,S.jsx)(n.Z,{variant:"h4",children:"Last transactions"})}),(0,S.jsx)(r.Z,{className:C.scrollableContainer,children:(0,S.jsxs)(i.Z,{container:!0,className:C.container,children:[(0,S.jsx)(i.Z,{item:!0,container:!0,xs:12,style:{flexWrap:"nowrap"},children:me.map(((e,t)=>(0,S.jsx)(i.Z,{item:!0,container:!0,xs:0==t?4:2,className:C.orderItem,children:e.name})))}),Se.length?(0,S.jsx)(s.Fragment,{children:Se.map((e=>(0,S.jsx)(i.Z,{item:!0,container:!0,xs:12,style:{flexWrap:"nowrap"},children:me.map((t=>this.getOrderItemColumn(C,t,e)))})))}):(0,S.jsx)(i.Z,{item:!0,xs:12,container:!0,spacing:2,children:(0,S.jsx)(i.Z,{item:!0,style:{height:100},alignItems:"center",justify:"center",container:!0,xs:!0,children:(0,S.jsx)(i.Z,{item:!0,children:(0,S.jsx)(n.Z,{variant:"h5",color:"textSecondary",children:"No previous transactions"})})})})]})})]}),Oe&&(!$||$&&(null===(t=this.props.assistantDetails)||void 0===t||null===(a=t.partner)||void 0===a?void 0:a.isZohoEnabled)&&"NONE"!==(null===(p=this.props.assistantDetails)||void 0===p?void 0:p.activePlan))&&(0,S.jsx)(te,{assistantDetails:D,showSnackbar:this.showSnackbar,updateAssistantStore:this.props.updateAssistantStore,power:Z,isReloading:w}),(Oe||"ENTERPRISE"===K&&J)&&(0,S.jsxs)(i.Z,{container:!0,justify:"left",children:[(0,S.jsx)(i.Z,{item:!0,xs:12,md:6,lg:6,children:(0,S.jsx)(ae.Z,{assistantDetails:D,power:Z,assistantId:I,inBilling:!0,isReloading:w})}),(!$||ee||$&&((null===re||void 0===re?void 0:re.partnerRazorpayEnabled)||(null===(h=this.props.assistantDetails)||void 0===h||null===(u=h.partner)||void 0===u?void 0:u.isZohoEnabled)))&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(i.Z,{item:!0,xs:12,md:6,lg:6,children:(0,S.jsx)(W.Z,{showSnackbar:this.showSnackbar,inBilling:!0,isReloading:w,partnerRazorpayEnabled:null===re||void 0===re?void 0:re.partnerRazorpayEnabled})}),(0,S.jsx)(i.Z,{item:!0,xs:12,md:6,lg:6,children:(0,S.jsx)(z.Z,{showSnackbar:this.showSnackbar,inBilling:!0,isReloading:w,partnerRazorpayEnabled:null===re||void 0===re?void 0:re.partnerRazorpayEnabled,togglePartnerBillingAddrs:this.togglePartnerBillingAddrs,openPartnerBillingAddress:this.state.openPartnerBillingAddress})})]}),!!(M&&M>0)&&(0,S.jsx)(i.Z,{item:!0,xs:12,md:6,lg:6,children:(0,S.jsx)(ie,{promotionalCredits:M,currency:_,isReloading:w})})]}),K&&(0,S.jsxs)(r.Z,{className:C.planCancelBox,mt:4,children:[(0,S.jsx)(n.Z,{variant:"h4",color:"primary",style:{fontSize:18},children:"Conversation Credit Usage"}),(0,S.jsx)(r.Z,{mt:3}),(0,S.jsxs)(i.Z,{container:!0,alignItems:"center",justify:"space-between",spacing:1,children:[(0,S.jsxs)(i.Z,{item:!0,xs:12,md:9,container:!0,spacing:1,style:{maxWidth:534,minWidth:534},children:[(0,S.jsx)(i.Z,{item:!0,xs:12,md:6,style:{maxWidth:210},children:(0,S.jsx)(r.Z,{children:(0,S.jsx)(m.ZP,{disableClearable:!0,value:this.state.templateInterval,options:ye.map((e=>e)),onChange:(e,t,a)=>this.handleAutoComplete("templateInterval",t,a),renderInput:e=>(0,S.jsx)(o.Z,{...e,className:C.textField1,InputProps:{...e.InputProps},placeholder:"Select duration",name:"Duration"})})})}),(0,S.jsx)(i.Z,{item:!0,xs:12,md:6,children:(0,S.jsx)(r.Z,{children:(0,S.jsx)(be,{startDate:this.state.templateFromDate,endD
1ate:this.state.templateToDate,focusedInput:this.state.templateFocusedInput,setDate:this.setTemplateDate,setFocus:this.setTemplateFocus,classes:C,minDate:v()(new Date("02/15/2022"))})})})]}),(0,S.jsx)(i.Z,{item:!0,xs:12,md:3,style:{maxWidth:224},children:(0,S.jsx)(r.Z,{children:(0,S.jsx)(m.ZP,{disableClearable:!0,selectOnFocus:!1,options:Ze.map((e=>"ALL"===e||"OTHERS"===e?e:(ne.J0[e]||"").toUpperCase())),onChange:(e,t,a)=>this.setState({wccAnalyticsCountry:"ALL"===t||"OTHERS"===t?t:Object.entries(ne.J0).find((e=>e[1].toLowerCase()===t.toLowerCase()))[0]},this.filterTemplateData),value:"ALL"===De||"OTHERS"===De?De:(ne.J0[De]||"").toUpperCase(),renderInput:e=>(0,S.jsx)(o.Z,{...e,className:C.countryDropdown,InputProps:{...e.InputProps},placeholder:"Select Country"})})})}),(0,S.jsx)(i.Z,{item:!0,xs:12,container:!0,spacing:1,className:C.totalContainer,children:["BIC Count","BIC Credit Usage","UIC Count","UIC Credit Usage","SC Count","SC Credit Usage","AC Count","AC Credit Usage","MC Count","MC Credit Usage","MLC Count","MLC Credit Usage","UC Count","UC Credit Usage","WA Pay Count","WA Pay Credit Usage","Total Credit Usage"].map((e=>(0,S.jsxs)(i.Z,{item:!0,xs:6,md:2,children:[(0,S.jsx)(n.Z,{variant:"body2",gutterBottom:!0,children:e}),(0,S.jsxs)(n.Z,{variant:"body2",children:[e.includes("Credit")?"USD"===_?"$":"\u20b9":"",this.state.templateCreditUsage.reduce(((t,a)=>Number(a[e])+t),0).toFixed(3)]})]})))})]}),(0,S.jsx)(E.Z,{data:[...this.state.templateCreditUsage],keys:["Total Credit Usage","SC Count","SC Credit Usage","AC Count","AC Credit Usage","MC Count","MC Credit Usage","MLC Count","MLC Credit Usage","UC Count","UC Credit Usage","WA Pay Count","WA Pay Credit Usage"],isLoading:fe,color:"hsl(64deg 86% 47% / 57%)"})]}),"ENTERPRISE"===K&&(0,S.jsxs)(r.Z,{className:C.planCancelBox,mt:4,children:[(0,S.jsx)(n.Z,{variant:"h4",color:"primary",style:{fontSize:18},children:"Enterprise Session Usage"}),(0,S.jsx)(r.Z,{mt:3}),(0,S.jsxs)(i.Z,{container:!0,alignItems:"center",justify:"space-between",spacing:1,children:[(0,S.jsxs)(i.Z,{item:!0,xs:12,md:9,container:!0,spacing:1,style:{maxWidth:534,minWidth:534},children:[(0,S.jsx)(i.Z,{item:!0,xs:12,md:6,style:{maxWidth:210},children:(0,S.jsx)(r.Z,{children:(0,S.jsx)(m.ZP,{disableClearable:!0,value:this.state.engagementInterval,options:ye.map((e=>e)),onChange:(e,t,a)=>this.handleAutoComplete("engagementInterval",t,a),renderInput:e=>(0,S.jsx)(o.Z,{...e,className:C.textField1,InputProps:{...e.InputProps},placeholder:"Select duration",name:"Duration"})})})}),(0,S.jsx)(i.Z,{item:!0,xs:12,md:6,children:(0,S.jsx)(r.Z,{children:(0,S.jsx)(be,{startDate:this.state.engagementFromDate,endDate:this.state.engagementToDate,focusedInput:this.state.engagementFocusedInput,setDate:this.setEngagementDate,setFocus:this.setEngagementFocus,classes:C,minDate:v()(new Date("02/15/2022"))})})})]}),(0,S.jsx)(i.Z,{item:!0,xs:12,container:!0,spacing:1,className:C.totalContainer,children:(0,S.jsxs)(i.Z,{item:!0,xs:12,children:[(0,S.jsx)(n.Z,{variant:"body2",gutterBottom:!0,children:"Total Enterprise Session Usage"}),(0,S.jsx)(n.Z,{variant:"body2",children:(this.state.engagementUsage||[]).reduce(((e,t)=>e+t["Enterprise Session"]),0)})]})})]}),(0,S.jsx)(E.Z,{data:[...this.state.engagementUsage||[]],keys:["Enterprise Session"],isLoading:Ce,color:"hsl(64deg 86% 47% / 57%)"})]}),se>17&&"FREE_FOREVER"!==G&&Oe&&2===Z&&(!$||$!==b.AISENSY_PARTNER_ID&&(null===(y=this.props.assistantDetails)||void 0===y||null===(j=y.partner)||void 0===j?void 0:j.isZohoEnabled)||ee)&&"active"===U&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(n.Z,{style:{color:"red",margin:"32px 0 16px",fontSize:18,fontFamily:"Inter"},children:"Danger Zone"}),(0,S.jsxs)(r.Z,{className:C.planCancelBox,children:[(0,S.jsx)(n.Z,{variant:"h4",color:"primary",style:{fontSize:18},children:"Cancel Plan"}),(0,S.jsxs)(r.Z,{mt:2,textAlign:"center",children:[(()=>{const e=(0,de.Z)(D),{currentTier:t}=e;if(t===X.ADDON_TIERS.NONE)return null;const a=t===X.ADDON_TIERS.AI_MESSAGES,s=(null===D||void 0===D?void 0:D.planDuration)<15;return(0,S.jsxs)(S.Fragment,{children:[a&&(0,S.jsxs)("div",{style:{display:"flex",marginBottom:"20px",alignItems:"center",gap:"10px"},children:[(0,S.jsx)(n.Z,{variant:"h6",color:"primary",children:"Downgrade to Basic Flows"}),(0,S.jsx)(n.Z,{variant:"body2",color:"textSecondary",style:{flex:1},children:"Keep your flows, remove AI messages"}),(0,S.jsx)(l.Z,{variant:"outlined",size:"small",onClick:()=>this.setState({confirmDowngradeTask:!0}
1),style:{color:"#f57c00",borderColor:"#f57c00"},disabled:!!L,endIcon:L?(0,S.jsx)(d.Z,{size:20,style:{color:"#f57c00"}}):"",children:"Downgrade"})]}),(0,S.jsxs)("div",{style:{display:"flex",marginBottom:"40px",alignItems:"center",gap:"10px"},children:[(0,S.jsxs)(n.Z,{variant:"h6",color:"primary",children:["Cancel ",a?"AI Messages Addon":"Flow Addon"," ",s?"Trial":""]}),(0,S.jsx)(n.Z,{variant:"body2",color:"textSecondary",style:{flex:1},children:a?"Remove flows and AI messages":"Remove all flows"}),(0,S.jsxs)(l.Z,{variant:"outlined",size:"small",onClick:()=>this.setState({confirmAddonTask:!0}),style:{color:"red",borderColor:"red"},disabled:!!L,endIcon:L?(0,S.jsx)(d.Z,{size:20,style:{color:"red"}}):"",children:["Cancel Addon ",s?"Trial":""]})]})]})})(),(null!==(f=null===D||void 0===D?void 0:D.subscriptionScheduledItems)&&void 0!==f?f:[]).length>0&&!$&&(0,S.jsxs)("div",{style:{display:"flex",marginTop:"20px 0px",marginBottom:"40px",alignItems:"center",gap:"10px"},children:[(0,S.jsx)(n.Z,{variant:"h6",color:"primary",children:"Cancel Scheduled Addon"}),(0,S.jsx)(l.Z,{variant:"outlined",size:"small",onClick:()=>{this.setState({isScheduledAddon:!0,confirmAddonTask:!0})},style:{color:"red",borderColor:"red",margin:"0px"},disabled:!!L,endIcon:L?(0,S.jsx)(d.Z,{size:20,style:{color:"red"}}):"",children:"Cancel Scheduled Trial"})]}),(0,S.jsx)(n.Z,{variant:"body2",children:"To stop using services when ".concat(se<15?"trial":"term"," ends.")}),(0,S.jsx)(c.ZP,{enterTouchDelay:0,title:N&&se>15&&Ee?"You can cancel plan only after 24 hours of activation.":(0,V.Ig)(L),children:(0,S.jsx)(r.Z,{children:(0,S.jsx)(l.Z,{variant:"outlined",onClick:()=>{this.setState({confirmTask:!0})},className:C.cancelPlanButton,disabled:!!L||N&&se>15&&Ee,endIcon:L?(0,S.jsx)(d.Z,{size:20,style:{color:"red"}}):"",children:"Cancel Plan"})})})]})]})]})]})})]}),(0,S.jsx)(A,{openBillingAddress:this.state.openBillingAddress,toggleBillingAddressPopup:this.toggleBillingAddressPopup,saveBillingAddress:this.saveBillingAddress}),(0,S.jsx)(r.Z,{my:8}),(0,S.jsx)(Y.A9,{open:this.state.alertOpen,anchorOrigin:{vertical:"top",horizontal:"center"},onClose:this.onSnackbarClose,severity:this.state.severity,message:this.state.alertMsg}),(0,S.jsx)(q.Z,{open:!!this.state.confirmTask,taskMessage:"Cancel ".concat(se<15?"trial":N," plan"),onClose:this.onConfirmationDialogClose,onConfirm:this.canclePlan,body:(0,S.jsx)(r.Z,{children:"monthly"===N||"v4"===F?(0,S.jsxs)(n.Z,{variant:"body1",children:["\u2022 Plan will continue to work until term end ( ".concat(v()(we).format("DD/MM/YY")," )."),(0,S.jsx)("br",{}),"\u2022 Plan renewal will stop & all services will stop there after.","v4"!==F&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("br",{}),"\u2022 All additional charges will be invoiced at term end."]}),(0,S.jsx)("br",{}),"\u2022 This cancel is revertable before changes are applied\n                  when ".concat(se<15?"trial":"term"," ends.")]}):(0,S.jsxs)(n.Z,{variant:"body1",children:["\u2022 Plan will continue to work until term end ( ".concat(v()(we).format("DD/MM/YY")," ) or when MAU finishes."),(0,S.jsx)("br",{}),"\u2022 All services will stop immediately there after.",(0,S.jsx)("br",{}),"\u2022 This cancel is revertable before changes are applied\n                  when ".concat(se<15?"trial":"term"," ends.")]})})}),(0,S.jsx)(q.Z,{open:!!this.state.confirmAddonTask,taskMessage:"Cancel scheduled addon",onClose:this.onAddonConfirmationDialogClose,onConfirm:this.cancelAddon,body:(0,S.jsx)(r.Z,{children:(0,S.jsxs)(n.Z,{variant:"body1",children:["\u2022 Addon ".concat(this.state.isScheduledAddon?"trial":""," will terminate immediately"),(0,S.jsx)("br",{}),"\u2022 You can later purchase addon along with you plan",(0,S.jsx)("br",{}),"\u2022 This cancel is not revertable for this trial"]})})}),(0,S.jsx)(q.Z,{open:!!this.state.confirmDowngradeTask,taskMessage:"Downgrade to Basic Flows",onClose:this.onDowngradeConfirmationDialogClose,onConfirm:this.handleDowngradeToBasicFlow,body:(0,S.jsx)(r.Z,{children:(0,S.jsxs)(n.Z,{variant:"body1",children:["\u2022 AI Messages will be removed at next renewal",(0,S.jsx)("br",{}),"\u2022 Your flows will be kept as Basic Flows",(0,S.jsx)("br",{}),"\u2022 No refund will be issued for the current billing cycle"]})})})]})}}function be(e){const{startDate:t,endDate:a,focusedInput:s,classes:i,minDate:n}=e,{setFocus:r,setDate:o}=e;return(0,S.jsx)(R.DateRangePicker,{startDatePlaceholderText:"From",endDatePlaceholderText:"To",startDateId:"startDate",endDateId:"endDate",startDate:t,endDate:a,onDatesChange:e=>{let{startDate:t,endDate:a}=e;return o(t,a)},focusedInput:s,onFocusChange:e=>r(e),navPosition:"navPositionTop",numberOfMonths:1,minimumNights:0,navPrev:(0,S.jsx)(je,{classes:i,children:(0,S.jsx)(L.Z,{})}),navNext:(0,S.jsx)(je,{classes:i,children:(0,S.jsx)(M.Z,{})}),hideKeyboardShortcutsPanel:!0,customArrowIcon:null,screenReaderInputMessage:" ",small:!0,readOnly:!0,displayFormat:"DD/MM/YYYY",isOutsideRange:e=>n?e.isAfter(v()())||e.isBefore(n):e.isAfter(v()()),minDate:n,maxDate:v()(new Date)})}function je(e){const{classes:t}=e;return(0,S.jsx)("div",{className:t.navigationWrapper,children:(0,S.jsx)(p.Z,{size:"small",children:e.children})})}const fe=(0,O.connect)((e=>({assistantDetails:e.assistantDetails.data,power:e.login.user.power,isReloading:e.assistantDetails.isReloading})),{updateAssistantStore:U.sJ,fetchAssistantDetails:U.W9})(ve),Ce=(0,h.Z)((e=>({root:{width:"100%",height:"100%",background:"rgb(249,249,249)",boxSizing:"border-box",overflowX:"hidden",position:"relative"},container:{background:"white",borderRadius:"8px"},pageTitleContainer:{position:"sticky",zIndex:100,top:0,height:60,boxSizing:"border-box",boxShadow:"0 0 11px rgb(230 230 230)",[e.breakpoints.down("md")]:{},[e.breakpoints.down("sm")]:{}},fullWidth:{width:"100%",background:"white"},currentPlanItem:{height:130}
1,primaryBackground:{background:e.palette.primary.light},currentPlanItemMainText:{fontSize:18,color:"#251F21"},bigText:{fontWeight:500,fontSize:32,color:e.palette.primary.main},orderItem:{padding:e.spacing(2),paddingLeft:e.spacing(3),minWidth:160},selectedPlan:{borderRadius:8,background:e.palette.primary.main,color:"white",paddingTop:e.spacing(2),paddingBottom:e.spacing(2),padding:"16px !important"},margin:{[e.breakpoints.down("sm")]:{marginTop:e.spacing(2)}},scrollableContainer:{width:"100%",overflow:"auto",borderRadius:8,background:"white",minHeight:200},planCancelBox:{width:"100%",borderRadius:8,background:"white",padding:24,boxSizing:"border-box",boxShadow:"0 0 11px rgb(230 230 230)"},toggelBox:{overflow:"hidden",border:"1px solid lightgrey",borderRadius:"8px",marginTop:"12px",display:"flex",[e.breakpoints.down("md")]:{width:"100%",margin:"12px 0"},[e.breakpoints.up("md")]:{width:400,margin:"24px 12px"}},toggelOptions:{width:"50%",cursor:"pointer",display:"flex",padding:"8px 8px 10px",justifyContent:"center",alignItems:"center",textAlign:"center",fontWeight:"500",color:e.palette.primary.main,borderRadius:"8px",[e.breakpoints.down("md")]:{fontSize:"12px"},[e.breakpoints.up("md")]:{fontSize:"14px"}},toggelSelected:{zIndex:1,color:"white !important"},progress:{position:"fixed",top:"8em",right:"44.5vw"},navigationWrapper:{marginLeft:e.spacing(1),marginRight:e.spacing(1),paddingTop:18,paddingBottom:37,display:"inline-block"},cancelPlanButton:{color:"red",borderColor:"red",width:"100%",maxWidth:250,margin:"16px auto 0",height:"40px"},elevation:{boxShadow:"0 0 6px rgb(206 221 218)"},countryDropdown:{width:200,float:"right",marginRight:16,padding:"2px 16px"},textField1:{width:200,padding:"2px 16px"},textField:{width:200,padding:"2px 16px",marginBottom:"8px",[e.breakpoints.down("md")]:{marginLeft:"0"},[e.breakpoints.up("md")]:{marginLeft:"12px"}},totalContainer:{[e.breakpoints.down("md")]:{margin:"18px 0 0"},[e.breakpoints.up("md")]:{margin:"18px 0 0 18px"}},guideContainer:{background:"white",borderRadius:"8px"}})))(fe)},26396:(e,t,a)=>{a.d(t,{Z:()=>C});var s=a(47313),i=a(68146),n=a(21144),r=a(57009),o=a(73908),l=a(34882),d=a(96083),c=a(20337),p=a(52376),h=a(19942),g=a(18998),m=a(47735),u=(a(59017),a(1805)),x=a(60240),y=a(45788),v=(a(29618),a(31685)),b=a(46417);class j extends s.Component{constructor(e){super(e),this.toggleTemplateCreditDialog=()=>{this.setState({templatedialogOpen:!this.state.templatedialogOpen})},this.state={templatedialogOpen:!1}}componentDidMount(){const{assistantDetails:e}=this.props,{templateCredit:t}=e;t<500&&v.Z.trackCustomEvent("wcc_credits_low_triggered",{credit_balance:t})}render(){var e,t,a;const{classes:s,assistantDetails:p,assistantId:y,showSnackbar:j,power:f,inBilling:C,isReloading:D}=this.props,{templateCredit:Z,freeTierCoversationCount:w,currency:S,ongoingBillingProcess:k,cbpType:A,allowPurchase:I,pendingInvoices:T,providerType:F,autoWccRecharge:P,partner:N}=p,{partnerId:B}=this.props.assistantDetails;return D?(0,b.jsx)(m.Z,{variant:"rect",className:C?s.cardLookSkeleton:s.rootSkeleton}):(0,b.jsxs)("div",{className:C?s.cardLook:s.root,children:["v3"===F&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(n.Z,{container:!0,alignItems:"center",style:{justifyContent:"space-between"},children:[(0,b.jsx)(n.Z,{item:!0,children:(0,b.jsx)(r.Z,{variant:"h5",children:"Free Service Conversation"})}),(0,b.jsx)(n.Z,{item:!0,children:(0,b.jsx)(o.Z,{display:"flex",justifyContent:"space-between",alignItems:"center"})})]}),(0,b.jsx)(o.Z,{position:"relative",height:15,children:(0,b.jsx)(o.Z,{className:s.usageBubble,style:{left:"99%"},children:(0,b.jsxs)("div",{className:s.arrowBottom,children:[" ","\u221e"]})})}),(0,b.jsx)(h.ko,{variant:"buffer",value:99,valueBuffer:100}),(0,b.jsx)(o.Z,{position:"relative",children:(0,b.jsx)(r.Z,{variant:"body2",style:{position:"absolute",right:0,bottom:"-17px",transform:"unset"},children:"Unlimited"})}),(0,b.jsx)(r.Z,{variant:"body2",style:{marginBottom:16},children:0})," "]}),(0,b.jsxs)(r.Z,{variant:"h5",children:["WhatsApp Conversation Credits (WCC)"," ",Z<0&&A&&(0,b.jsx)(l.ZP,{title:"Clear excess usage to resume services",placement:"top",enterTouchDelay:0,children:(0,b.jsx)(d.Z,{color:"secondary",label:"!",className:s.dueChip})})]}),(0,b.jsxs)(o.Z,{display:"flex",justifyContent:"space-between",mt:1,alignItems:"center",children:[(0,b.jsxs)(r.Z,{variant:"h3",children:[(0,b.jsx)("span",{style:{fontFamily:"Roboto"},children:"USD"===S?"$":"\u20b9"})," ".concat(Number(Z).toFixed(2))]}),(0,i.Sz)({agent:{power:f},assistantDetails:this.props.assistantDetails})&&(!B||B!==u.AISENSY_PARTNER_ID&&(null===(e=this.props.assistantDetails)||void 0===e||null===(t=e.partner)||void 0===t?void 0:t.isZohoEnabled)&&"NONE"!==(null===(a=this.props.assistantDetails)||void 0===a?void 0:a.activePlan))&&("ENTERPRISE"!==A||I)&&(0,b.jsx)(c.Z,{onClick:()=>{this.toggleTemplateCreditDialog(),v.Z.trackCustomEvent("wcc_credits_purchased_clicked",{login_method:"dashboard",login_timestamp:(new Date).toISOString()})},variant:"contained",color:"primary",size:"small",children:Z>0?"Buy More":"Buy Now"}),(null===N||void 0===N?void 0:N.partnerRazorpayEnabled)&&(0,b.jsx)("span",{children:(0,b.jsx)(c.Z,{onClick:()=>{this.toggleTemplateCreditDialog()},variant:"contained",color:"primary",size:"small",children:Z>0?"Buy More":"Buy Now"})})]}),P&&P.enableAutoRecharge&&!B&&(0,b.jsxs)("span",{style:{display:"flex",alignItems:"center",marginTop:"24px",justifyContent:"center",cursor:"pointer"},onClick:()=>{2===f&&this.toggleTemplateCreditDialog()},children:[(0,b.jsx)(r.Z,{variant:"body2",color:"textSecondary",style:{marginRight:2},children:"WCC auto-recharge is enabled"}),(0,b.jsx)(x.Z,{fontSize:"small",style:{fontSize:"16px",color:"#828282"}})]}),(0,b.jsx)(g.Z,{dialogOpen:this.state.templatedialogOpen,toggleTemplateCreditDialog:this.toggleTemplateCreditDialog,assistantDetails:this.props.assistantDetails})]})}}const f=(0,y.connect)((e=>({assistantDetails:e.assistantDetails.data})))(j),C=(0,p.Z)((e=>({root:{background:"white",borderRadius:"8px",padding:"10px 20px"},cardLook:{background:"white",borderRadius:"8px",boxSizing:"border-box",padding:"24px 32px",boxShadow:"0 0 11px rgb(230,230,230)",height:"100%",[e.breakpoints.down("md")]:{margin:"0"},[e.breakpoints.up("md")]:{margin:"0px 12px 0 0"}},rootSkeleton:{borderRadius:"8px",height:100},cardLookSkeleton:{borderRadius:"8px",boxSizing:"border-box",height:100,[e.breakpoints.down("md")]:{margin:"0"},[e.breakpoints.up("md")]:{margin:"0px 12px 0 0"}},usageBubble:{transform:"translate(-50%, 0%)",position:"absolute"},arrowBottom:{marginBottom:"10px",padding:"2px 8px",boxSizing:"border-box",background:"#edeaea",color:"#0000009c",borderRadius:"4px",textAlign:"center",position:"relative",fontSize:"10px","&:after":{content:'""',position:"absolute",right:"calc(50%  - 8px)",top:"15p
1x",borderBottom:"none",borderRight:"8px solid transparent",borderLeft:"8px solid transparent",borderTop:"8px solid #edeaea"}},dueChip:{margin:"0 0 2px 8px",background:"red",color:"white",fontSize:12,height:16,padding:"0 3px 0 0",width:16}})))(f)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.