import{h as o}from"./moment-a9aaa855.js";import{_ as b}from"./NoDataFound-bc81d7fa.js";import{_ as M}from"./Paginate-f61b79b2.js";import{s as C,A as f,m as E,c as r,b as e,a as v,F as u,r as m,t,e as p,u as c,k as B,i as g,g as j,o as l,n as w}from"./app-13978987.js";import{_ as N}from"./PageHeader-8c638686.js";import{_ as z}from"./UserLayout-6a50516d.js";import"./dropdown-45d66330.js";const P={class:"container flex-grow p-4 sm:p-6"},$={class:"flex items-center justify-between"},S={class:"mb-4 flex items-center justify-between"},V={class:"card max-w-max p-1"},W=["onClick"],L={class:"capitalize"},T={key:0,class:"alert alert-danger text-base"},A={key:1,class:"alert alert-danger text-base"},F={key:2,class:"alert alert-warning text-base"},I={key:3,class:"mt-3 grid grid-cols-1 rounded-xl border border-primary-400 lg:grid-cols-12"},H={class:"col-span-1 flex flex-col justify-center gap-2 p-4 lg:col-span-7 lg:p-8"},O={class:"text-gray-400"},U={class:"col-span-1 flex gap-3 border-l border-primary-400 p-4 lg:col-span-5 lg:p-8"},q={class:"mt-3 whitespace-nowrap text-3xl text-primary-500 lg:text-5xl"},G={class:"px-2"},J={class:"text-primary-500"},K={class:"my-8 grid grid-cols-1 gap-14 lg:grid-cols-3"},Q={key:0,class:"absolute -left-1 top-9 max-w-max rounded-r-xl bg-primary-600 px-4 capitalize text-primary-50"},R={class:"text-center text-2xl text-gray-400"},X={class:"my-8 flex justify-center gap-2"},Z={class:"text-3xl"},ee={class:"text-4xl"},te={class:"flex flex-col gap-2"},se={class:"ml-2 text-sm"},ae={class:"ml-2 text-sm"},le=["href"],re={class:"mb-2"},ne={key:5,class:"table-responsive whitespace-nowrap rounded-primary"},ie={class:"ert-table table"},oe={class:"text-center"},ce={class:"border-0"},de={class:"text-center"},ue=j({layout:z}),be=Object.assign(ue,{__name:"Index",props:["user","plans","orders","segments","planByDays"],setup(n){const d=n,{formatCurrency:y}=C(),k=f(()=>d.user.will_expire?o(d.user.will_expire).diff(o(),"days")<7:!1),Y=f(()=>d.user.will_expire?o(d.user.will_expire).isBefore(o()):!1),h=E("monthly"),_=f(()=>d.plans.filter(a=>h.value==="monthly"?a.days===30:h.value==="yearly"?a.days===365:a.days>365));return(a,D)=>{var x;return l(),r("main",P,[e("div",$,[v(N,{title:"Subscription",buttons:[]}),e("div",S,[e("div",V,[(l(!0),r(u,null,m(n.planByDays,s=>(l(),r("button",{key:s.days,class:w(["btn w-full px-14 py-2 md:w-auto",{"btn-primary":h.value===s.duration}]),onClick:i=>h.value=s.duration},[e("span",L,t(s.duration),1)],10,W))),128))])])]),!n.user.will_expire||!n.user.plan||!n.user.plan_id?(l(),r("div",T,[e("p",null,t(a.trans("You haven't purchased any subscription plans yet.")),1)])):p("",!0),Y.value?(l(),r("div",A,[e("p",null,t(a.trans("Your subscription has already expired")),1)])):k.value?(l(),r("div",F,[e("p",null,t(a.trans("Your current subscription plan is about to expire in less than 7 days")),1)])):p("",!0),n.user.will_expire!=null?(l(),r("div",I,[e("div",H,[e("h4",null,t(a.trans("Current Plan"))+" ("+t(n.user.plan.title)+")",1),e("p",O,t(a.trans(`Unlimited access to our legal document library and online rental application tool,
          billed monthly.`)),1)]),e("div",U,[e("p",q,t(c(y)(n.user.plan.price)),1),e("div",G,[e("p",J,t(n.user.plan.days===30?"Monthly":n.user.plan.days===365?"Yearly":"Lifetime")+" "+t(a.trans("Plan")),1),e("span",null,[B(t(a.trans("Your subscription will expire"))+" ",1),e("span",null,t(c(o)(n.user.will_expire).format("MMM DD, YYYY")),1)])])])])):p("",!0),e("div",K,[(l(!0),r(u,null,m(_.value,s=>(l(),r("div",{key:s.id,class:w(["flex flex-col justify-between overflow-hidden rounded-xl px-12 py-8 shadow-md",{"card relative border-2 border-primary-500 ":s.is_recommended,"border border-gray-200 dark:border-gray-700":s.is_recommended===0}])},[s.is_recommended?(l(),r("div",Q,t(a.trans("popular")),1)):p("",!0),e("div",R,t(s.title),1),e("div",X,[e("span",Z,t(c(y)(s.price)[0]),1),e("span",ee,t(s.price),1),e("span",null,t(s.days===30?"Monthly":s.days===365?"Yearly":"Lifetime"),1)]),e("ul",te,[(l(!0),r(u,null,m(s.data,i=>(l(),r("li",{key:i.value,class:"text-capitalize flex items-center"},[e("span",se,t(i.overview),1)]))),128)),(l(!0),r(u,null,m(s.extra_data,i=>(l(),r("li",{key:i.value,class:"text-capitalize flex items-center"},[e("span",ae,t(i.value),1)]))),128))]),e("a",{href:a.route("user.subscription.payment",s.id),class:"btn btn-soft-primary mt-6 w-full"},t(a.trans("Choose Plan")),9,le)],2))),128))]),((x=_.value)==null?void 0:x.length)<1?(l(),g(b,{key:4})):p("",!0),e("h5",re,t(a.trans("Subscription History")),1),n.orders.total?(l(),r("div",ne,[e("table",ie,[e("thead",null,[e("tr",null,[e("th",null,t(a.trans("Invoice No")),1),e("th",null,t(a.trans("Plan")),1),e("th",null,t(a.trans("Amount")),1),e("th",null,t(a.trans("Tax")),1),e("th",null,t(a.trans("Status")),1),e("th",null,t(a.trans("Expire Date")),1),e("th",oe,t(a.trans("Created Date")),1)])]),e("tbody",ce,[(l(!0),r(u,null,m(n.orders.data,s=>{var i;return l(),r("tr",{key:s.id},[e("td",null,t(s.invoice_no),1),e("td",null,t((i=s.plan)==null?void 0:i.title),1),e("td",null,t(c(y)(s.amount)),1),e("td",null,t(c(y)(s.tax)),1),e("td",null,t(s.status),1),e("td",null,t(c(o)(s.will_expire).format("DD MMM, YYYY")),1),e("td",de,t(c(o)(s.created_at).format("DD MMM, YYYY")),1)])}),128))])])])):(l(),g(b,{key:6})),v(M,{links:n.orders.links},null,8,["links"])])}}});export{be as default};
