1import{d as K,e as O,f as n,r,u as Q,w as W,h as X,i as Z,V as ee,$ as v,o as _,j as V,k as t,l as f,t as s,n as A,p as te,q as se,s as m,x as ae,y as U,z as L,A as E,E as I,B as M,F as ce,C as oe,D as N,G as y,H as P,_ as le,I as ne}from"./entry.762aa7cb.js";import{_ as ie}from"./SystemLangSetting.vue.04645ee4.js";import{_ as re}from"./UpgradeButton.vue.359c43e5.js";import ue from"./CancelModal.d9de2fce.js";import"./check.6e01333b.js";import"./flag-en.c972f817.js";import"./index.4c79368c.js";import"./placements.cbcef426.js";import"./vnode.688253f0.js";import"./isObjectLike.46b91259.js";import"./isObject.32699ff3.js";import"./Feedback.e5e64d9a.js";import"./Reason.77edd410.js";import"./Confirm.ae4ba068.js";import"./Discount.d3ee9353.js";import"./BeforeCancel.7cec2c10.js";const pe={class:"account-page w-[100vw] h-[100vh] flex-col-hc"},de={class:"flex-vc w-full p-[48px]"},ve={class:"ml-[5px] mb-[5px] text-[32px] leading-[100%] font-[500]"},_e={class:"content p-[10px] w-full flex-grow flex-col-hc"},fe={class:"w-full max-w-[640px] flex-col-hc"},me={class:"avatar flex-c"},he=["src"],ge={class:"mt-[8px text-[24px] font-bold leading-[32px text-center break-all"},xe={class:"card w-full mt-[25px] flex-vc-sb"},ye={class:"flex-col-vc"},be={class:"label"},we={class:"w-full mt-[4px] flex-vc"},$e={class:"poppins-bold vip-name"},Ce={key:0,class:"status-tag flex-c"},Te={class:"card mt-[16px] w-full flex-vc-sb"},ke={class:"flex-color-vc"},De={class:"label"},Se={class:"w-full mt-4px des-text"},Be={class:"card mt-[16px] w-full flex-vc-sb"},Ve={class:"flex-color-vc"},Ae={class:"label"},Ue={class:"card cancel mt-5px w-full"},Le={class:"label"},Ee={class:"mt-[4px] des-text"},Ie={class:"terms flex-vc"},Me=K({__name:"index",setup(Ne){O();const h=n(()=>{var e;return((e=c.curUser)==null?void 0:e.isVip)||!1}),H=n(()=>{var e;return!(!o.value.length||((e=c.curUser)==null?void 0:e.vipType)==="gpt_4_year_vip")});function b(e){oe.emit("openTermsModal",e)}const u=r(!1);function q(){u.value||(u.value=!0,N.getBillingHistory().then(e=>{window.open(e,"_blank")}).catch(e=>{y.error(e.message)}).finally(()=>{u.value=!1}))}const c=Q(),w=n(()=>c.curUser),$=r(!0),o=r([]),i=r(null);async function C(){try{o.value=await N.getAllSubscriptions(),i.value=o.value.length?o.value[0]:null;const e=i.value?i.value.isAcceptDiscount:!1;c.setIsAcceptDiscount(e),$.value=!1}catch(e){y.error((e==null?void 0:e.message)||e)}}C();const g=r(!1),F=n(()=>o.value.length);function G(){var e;if(F.value){c.setCurCancelType(P.Subscription);const a=(e=i.value)==null?void 0:e.subscriptionType;if(a!=="stripe"){const l=a==="google"?"Google Play":"App Store";y.error(v("please_cancel_in_mobile",{platform:l}));return}}else c.setCurCancelType(P.Account);g.value=!0}const p=r(0);W(()=>{const e=o.value[0]||null;if(e){let{subscribeTime:a,usefulTime:l}=e;const d=(new Date().getTime()-new Date(a).getTime())/1e3/60/60/24;for(p.value=Math.floor(l-d);p.value<=0;)l+=l,p.value=Math.floor(l-d)}});const T=X(),k=Z();function R(){var e;T.push({path:((e=k.query)==null?void 0:e.redirect_url)||"/chatpdf"})}const j=n(()=>{var e;return((e=c.curUser)==null?void 0:e.vipType)||ee.Free}),z=n(()=>j.value.includes("gpt_3.5")||!1),Y=n(()=>h.value?z.value?v("chatpdf.chat_with_gpt3_5"):v("chatpdf.chat_with_gpt4"):v("account.free_plan"));function J(){T.push({path:"upgrade",query:{redirect_url:k.path}})}return(e,a)=>{var D,S,B;const l=le,d=ie;return _(),V(ce,null,[t("div",pe,[t("div",de,[t("div",{class:"iflex-c cursor-pointer p-[4px] rounded-[8px] hover:bg-[#f0f4f5]",onClick:R},[f(l,{name:"back",class:"text-[24px]"})]),t("span",ve,s(e.$t("account.account")),1)]),t("div",_e,[t("div",fe,[t("div",me,[t("img",{draggable:"false",class:"w-full",src:(D=w.value)==null?void 0:D.avatar},null,8,he)]),t("span",ge,s((S=w.value)==null?void 0:S.username),1),t("div",xe,[t("div",ye,[t("div",be,s(e.$t("account.subscription")),1),t("div",we,[t("span",$e,s(Y.value),1),o.value.length?(_(),V("div",Ce,s(e.$t("account.active")),1)):A("",!0)]),te(t("div",{class:"w-full mt-[4px] des-text"},s(o.value.length?e.$t("account.billing_in_days",{day:((B=i.value)==null?void 0:B.renewLeftTime)||p.value}):e.$t("account.billing_cycle_over",{time:m(ae)("Y/m/d",m(c).vipEnd)})),513),[[se,h.value&&!$.value]])]),h.value?H.value?(_(),U(I,{key:1,height:"32px",width:"107px",onClick:J},{default:L(()=>
1[E(s(e.$t("upgrade.edit_plan")),1)]),_:1})):A("",!0):(_(),U(re,{key:0,source:"account page"}))]),t("div",Te,[t("div",ke,[t("div",De,s(e.$t("account.invoices")),1),t("div",Se,s(e.$t("account.view_invoice")),1)]),f(I,{height:"32px",width:"177px",loading:u.value,onClick:q},{default:L(()=>[E(s(e.$t("account.view_billing_history")),1)]),_:1},8,["loading"])]),t("div",Be,[t("div",Ve,[t("div",Ae,s(e.$t("account.system_lang")),1)]),f(d,{"hide-icon":!0})]),t("div",Ue,[t("div",Le,s(e.$t("account.cancel_account")),1),t("div",Ee,s(e.$t("account.cancel_des")),1),t("div",{class:"mt-[12px] cancel-btn",onClick:G},s(e.$t("account.cancel_account")),1)])])]),t("div",Ie,[t("div",{class:"mr-[24px]",onClick:a[0]||(a[0]=x=>b(m(M).Terms))},s(e.$t("terms_service")),1),t("div",{onClick:a[1]||(a[1]=x=>b(m(M).Policy))},s(e.$t("privacy_policy")),1)])]),f(ue,{visible:g.value,"onUpdate:visible":a[2]||(a[2]=x=>g.value=x),subscription:i.value,onRefreshList:C},null,8,["visible","subscription"])],64)}}});const et=ne(Me,[["__scopeId","data-v-31c0750c"]]);export{et as default};
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.