Your IP : 216.73.217.77


Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/
Upload File :
Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/Plan-10f88a34.js

import{_ as q}from"./App-26099fac.js";import{T as K,r as u,h as Q,f as W,o as l,a as t,t as e,c as n,d as y,n as k,u as p,b as a,F as C,k as $,O as X}from"./app-43851608.js";import"./Sidebar-13bbdf6e.js";import"./Menu-7a7609fd.js";import"./Modal-22a49fae.js";import"./ProfileModal-628e5b7c.js";import"./FormInput-4a309017.js";import"./LangToggle-8d05b0dc.js";import"./index-99011d5f.js";import"./MobileSidebar-64958b6d.js";/* empty css              */const Y={class:"bg-white md:bg-inherit pt-0 px-4 md:pt-8 md:p-8 rounded-[5px] text-[#000] overflow-y-scroll"},tt={class:"flex justify-between mt-8 md:mt-0"},st={class:"text-xl mb-1"},et={class:"mb-6 flex items-center text-sm leading-6 text-gray-600"},ot=t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 11v5m0 5a9 9 0 1 1 0-18a9 9 0 0 1 0 18Zm.05-13v.1h-.1V8h.1Z"})],-1),lt={class:"ml-1 mt-1"},nt={class:"md:flex gap-4"},at={class:"md:w-[65%]"},it={class:"grid grid-cols-2 gap-4"},rt=["onClick"],dt={class:"flex justify-between"},ct={class:""},ut={class:""},ht={for:"myCheckbox",class:"cursor-pointer"},pt={key:0,class:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},_t=t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1),vt=[_t],mt={class:"text-2xl"},wt={key:0,class:"text-sm mb-4"},bt={key:1,class:"text-sm mb-4"},ft={class:"mb-1"},gt={class:"flex justify-between text-sm"},xt={class:"flex space-x-1"},yt=t("span",null,[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16px",height:"16px",viewBox:"0 0 16 16"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},[t("path",{d:"M14.25 8.75c-.5 2.5-2.385 4.854-5.03 5.38A6.25 6.25 0 0 1 3.373 3.798C5.187 1.8 8.25 1.25 10.75 2.25"}),t("path",{d:"m5.75 7.75l2.5 2.5l6-6.5"})])])],-1),kt={class:"flex justify-between text-sm"},Ct={class:"flex space-x-1"},$t=t("span",null,[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16px",height:"16px",viewBox:"0 0 16 16"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},[t("path",{d:"M14.25 8.75c-.5 2.5-2.385 4.854-5.03 5.38A6.25 6.25 0 0 1 3.373 3.798C5.187 1.8 8.25 1.25 10.75 2.25"}),t("path",{d:"m5.75 7.75l2.5 2.5l6-6.5"})])])],-1),jt={class:"flex justify-between text-sm"},At={class:"flex space-x-1"},Bt=t("span",null,[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16px",height:"16px",viewBox:"0 0 16 16"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},[t("path",{d:"M14.25 8.75c-.5 2.5-2.385 4.854-5.03 5.38A6.25 6.25 0 0 1 3.373 3.798C5.187 1.8 8.25 1.25 10.75 2.25"}),t("path",{d:"m5.75 7.75l2.5 2.5l6-6.5"})])])],-1),Mt={class:"flex justify-between text-sm"},Dt={class:"flex space-x-1"},Pt=t("span",null,[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16px",height:"16px",viewBox:"0 0 16 16"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},[t("path",{d:"M14.25 8.75c-.5 2.5-2.385 4.854-5.03 5.38A6.25 6.25 0 0 1 3.373 3.798C5.187 1.8 8.25 1.25 10.75 2.25"}),t("path",{d:"m5.75 7.75l2.5 2.5l6-6.5"})])])],-1),Vt={class:"flex justify-between text-sm"},Zt={class:"flex space-x-1"},Ft=t("span",null,[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16px",height:"16px",viewBox:"0 0 16 16"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},[t("path",{d:"M14.25 8.75c-.5 2.5-2.385 4.854-5.03 5.38A6.25 6.25 0 0 1 3.373 3.798C5.187 1.8 8.25 1.25 10.75 2.25"}),t("path",{d:"m5.75 7.75l2.5 2.5l6-6.5"})])])],-1),St={class:"md:w-[35%]"},Ot={class:"bg-white rounded-md shadow-md p-5"},Ut={class:"text-xl mb-4"},Nt={key:0},Tt={class:"border border-dashed flex itens-center justify-center p-10 rounded-md"},Ht={key:1},Lt={class:"flex justify-between mb-4 text-sm"},Rt={class:"bg-slate-100 w-[fit-content] py-1 px-2 rounded-md capitalize text-xs"},zt=t("hr",null,null,-1),Et={class:"flex justify-between mt-4 text-sm"},Gt={key:0,class:"bg-slate-100 px-2 py-2 space-y-2 rounded-md mt-2 mb-2"},It={class:"text-sm border-b border-dashed"},Jt={class:""},qt={key:1,class:"bg-slate-100 px-2 py-2 space-y-2 rounded-md mt-2 mb-2"},Kt={class:"flex justify-between text-sm"},Qt=t("br",null,null,-1),Wt={class:"text-xs"},Xt={key:0,class:"text-red-500"},Yt={key:1,class:"text-red-500"},ts={key:2,class:"bg-slate-100 px-2 py-2 space-y-2 rounded-md mt-2 mb-2"},ss={class:"flex justify-between text-sm"},es=t("br",null,null,-1),os={class:"text-xs"},ls={class:"flex justify-between text-xl mt-4 mb-4"},ns=t("hr",null,null,-1),as={key:3,class:"text-[14px] mt-3 mb-2"},is={key:4,class:"flex grid grid-cols-2 gap-2"},rs={class:"flex items-center"},ds=["onClick"],cs={key:0,class:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},us=t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1),hs=[us],ps=["onClick"],_s={class:"mt-8"},vs=t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[t("path",{fill:"currentColor",d:"M12 13a1.49 1.49 0 0 0-1 2.61V17a1 1 0 0 0 2 0v-1.39A1.49 1.49 0 0 0 12 13m5-4V7A5 5 0 0 0 7 7v2a3 3 0 0 0-3 3v7a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-7a3 3 0 0 0-3-3M9 7a3 3 0 0 1 6 0v2H9Zm9 12a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1Z"})],-1),ms={key:1,class:"w-full flex justify-center items-center space-x-1 rounded-md bg-gray-300 px-3 py-2 text-sm text-gray-400 shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"},ws={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},bs=t("path",{fill:"currentColor",d:"M12 13a1.49 1.49 0 0 0-1 2.61V17a1 1 0 0 0 2 0v-1.39A1.49 1.49 0 0 0 12 13m5-4V7A5 5 0 0 0 7 7v2a3 3 0 0 0-3 3v7a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-7a3 3 0 0 0-3-3M9 7a3 3 0 0 1 6 0v2H9Zm9 12a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1Z"},null,-1),fs=[bs],gs={key:1},xs={key:2,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},ys=t("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:"0.5"},null,-1),ks=t("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z"},[t("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})],-1),Cs=[ys,ks],$s={key:3},Us={__name:"Plan",props:{plans:Object,methods:Object,subscription:Object,subscriptionDetails:Object},setup(E){var M,D,P,V,Z,F,S,O,U,N,T,H,L,R;const r=E,d=K({plan:(M=r.subscription)==null?void 0:M.plan_id,method:null}),_=u(!1),f=u({name:(P=(D=r.subscription)==null?void 0:D.plan)==null?void 0:P.name,period:(Z=(V=r.subscription)==null?void 0:V.plan)==null?void 0:Z.period,amount:(S=(F=r.subscription)==null?void 0:F.plan)==null?void 0:S.price}),j=u((O=r.subscriptionDetails)==null?void 0:O.grossAmount),b=u((U=r.subscriptionDetails)==null?void 0:U.netAmount),v=u((N=r.subscriptionDetails)==null?void 0:N.amountDue),g=u((T=r.subscriptionDetails)==null?void 0:T.taxRates),m=u((H=r.subscriptionDetails)==null?void 0:H.credit),x=u((L=r.subscriptionDetails)==null?void 0:L.debit),A=u((R=r.subscriptionDetails)==null?void 0:R.basePrice),G=(o,h,i,s)=>{d.plan=o,f.value={name:h,period:i,amount:s},I(o)},B=o=>{d.method=o},c=(o,h)=>{if(o){const i=JSON.parse(o);return(i==null?void 0:i[h])??null}else return null},I=o=>{X.visit("/subscription/"+o,{method:"get",preserveState:!0,onSuccess:h=>{d.plan=o;const i=h.props.response_data.data;j.value=i.grossAmount,g.value=i.taxRates,b.value=i.netAmount,m.value=i.credit,x.value=i.debit,A.value=i.basePrice,v.value=i.amountDue}})},J=async()=>{_.value=!0,d.post("/subscription",{preserveScroll:!0})};return(o,h)=>(l(),Q(q,null,{default:W(()=>{var i;return[t("div",Y,[t("div",tt,[t("div",null,[t("h2",st,e(o.$t("Billing and subscription")),1),t("p",et,[ot,t("span",lt,e(o.$t("Select the plan that you want to subscribe to")),1)])])]),t("div",nt,[t("div",at,[t("div",it,[(l(!0),n(C,null,y((i=r.plans)==null?void 0:i.data,(s,w)=>(l(),n("div",{key:w,onClick:z=>G(s.id,s.name,s.period,s.price),class:k(["rounded-[0.5rem] shadow-sm p-5 cursor-pointer border-2 col-span-2 md:col-span-1",p(d).plan===s.id?"border-gray-700 bg-slate-50":"border-slate-100 md:border-white bg-slate-20 md:bg-white"])},[t("div",dt,[t("div",ct,[t("h3",null,e(s.name),1)]),t("div",ut,[t("label",ht,[t("div",{class:k(["w-5 h-5 border border-gray-400 rounded-md flex items-center justify-center",p(d).plan===s.id?"bg-[#000]":""])},[p(d).plan===s.id?(l(),n("svg",pt,vt)):a("",!0)],2)])])]),t("h2",mt,e(s.price),1),s.period==="monthly"?(l(),n("h3",wt,e(o.$t("Per month")),1)):a("",!0),s.period==="yearly"?(l(),n("h3",bt,e(o.$t("Per year")),1)):a("",!0),t("h3",ft,e(o.$t("Features")),1),t("div",gt,[t("div",xt,[yt,t("h3",null,e(c(s==null?void 0:s.metadata,"campaign_limit")=="-1"?o.$t("Unlimited"):c(s==null?void 0:s.metadata,"campaign_limit"))+" "+e(o.$t("Campaigns")),1)])]),t("div",kt,[t("div",Ct,[$t,t("h3",null,e(c(s==null?void 0:s.metadata,"message_limit")=="-1"?o.$t("Unlimited"):c(s==null?void 0:s.metadata,"message_limit"))+" "+e(o.$t("Messages")),1)])]),t("div",jt,[t("div",At,[Bt,t("h3",null,e(c(s==null?void 0:s.metadata,"contacts_limit")=="-1"?o.$t("Unlimited"):c(s==null?void 0:s.metadata,"contacts_limit"))+" "+e(o.$t("Contacts")),1)])]),t("div",Mt,[t("div",Dt,[Pt,t("h3",null,e(c(s==null?void 0:s.metadata,"canned_replies_limit")=="-1"?o.$t("Unlimited"):c(s==null?void 0:s.metadata,"canned_replies_limit"))+" "+e(o.$t("Canned replies")),1)])]),t("div",Vt,[t("div",Zt,[Ft,t("h3",null,e(c(s==null?void 0:s.metadata,"team_limit")=="-1"?o.$t("Unlimited"):c(s==null?void 0:s.metadata,"team_limit"))+" "+e(o.$t("Users")),1)])])],10,rt))),128))])]),t("div",St,[t("div",Ot,[t("h3",Ut,e(o.$t("Summary")),1),p(d).plan?a("",!0):(l(),n("div",Nt,[t("div",Tt,[t("h3",null,e(o.$t("Select plan to continue")),1)])])),p(d).plan?(l(),n("div",Ht,[t("div",Lt,[t("div",null,[t("h3",null,e(f.value.name),1),t("h3",Rt,e(f.value.period),1)]),t("h3",null,e(A.value),1)]),zt,t("div",Et,[t("h3",null,e(o.$t("Gross total")),1),t("h3",null,e(j.value),1)]),g.value.length>0?(l(),n("div",Gt,[t("h3",It,e(o.$t("Tax")),1),(l(!0),n(C,null,y(g.value,(s,w)=>(l(),n("div",{key:w,class:"flex justify-between text-sm"},[t("h3",null,[$(e(s.name)+" ",1),t("span",Jt,"("+e(s.percentage)+"%)",1)]),t("h3",null,e(s.amount),1)]))),128))])):a("",!0),m.value.total>0?(l(),n("div",qt,[t("div",Kt,[t("div",null,[$(e(o.$t("Available credits"))+" ",1),Qt,t("span",Wt,"("+e(o.$t("Applicable credits for this invoice"))+")",1)]),parseFloat(-m.value.total)<=parseFloat(b.value)?(l(),n("h3",Xt,e(m.value.total),1)):a("",!0),parseFloat(-m.value.total)>parseFloat(b.value)?(l(),n("h3",Yt," ("+e(b.value)+") ",1)):a("",!0)])])):a("",!0),x.value.total>0?(l(),n("div",ts,[t("div",ss,[t("div",null,[$(e(o.$t("Available debits"))+" ",1),es,t("span",os,"("+e(o.$t("Applicable debits due"))+")",1)]),t("h3",null,e(x.value.total),1)])])):a("",!0),t("div",ls,[t("h3",null,e(o.$t("Total due")),1),t("h3",null,e(v.value),1)]),ns,parseInt(v.value)>0?(l(),n("h2",as,e(o.$t("Pay via")),1)):a("",!0),parseInt(v.value)>0?(l(),n("div",is,[(l(!0),n(C,null,y(r.methods,(s,w)=>(l(),n("div",{key:w,class:""},[t("div",rs,[t("label",{onClick:z=>B(s.name),for:"myCheckbox",class:"cursor-pointer"},[t("div",{class:k(["w-5 h-5 border border-gray-400 rounded-md flex items-center justify-center",p(d).method===s.name?"bg-[#000]":""])},[p(d).method===s.name?(l(),n("svg",cs,hs)):a("",!0)],2)],8,ds),t("span",{onClick:z=>B(s.name),class:"ml-2 text-sm cursor-pointer"},e(s.name),9,ps)])]))),128))])):a("",!0),t("div",_s,[_.value==!1&&p(d).method!=null||_.value==!1&&v.value<=0?(l(),n("button",{key:0,onClick:h[0]||(h[0]=s=>J()),type:"button",class:"w-full flex justify-center items-center space-x-1 rounded-md bg-primary px-3 py-2 text-sm text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"},[vs,t("span",null,e(o.$t("Continue")),1)])):(l(),n("div",ms,[_.value==!1?(l(),n("svg",ws,fs)):a("",!0),_.value==!1?(l(),n("span",gs,e(o.$t("Continue")),1)):a("",!0),_.value!=!1?(l(),n("svg",xs,Cs)):a("",!0),_.value!=!1?(l(),n("span",$s,e(o.$t("Redirecting you")),1)):a("",!0)]))])])):a("",!0)])])])])]}),_:1}))}};export{Us as default};