1import{U as T,L as M}from"./main-BMg1Vvng.js";import{_ as I,j as O,i as N,f as _,a8 as B,G as L,ai as k,p as F,h as p,o as l,b as e,g as V,c as n,F as x,r as w,I as j,t as o,e as d,w as E,v as C,a as m,d as P,T as R,N as U,O as A}from"./index-6P0cCGxP.js";import{C as D}from"./CancelBanner-B3v1_LWc.js";import{w as q,E as z,r as W}from"./extra_time_preference-CnpIe-tt.js";import{p as Y,l as G}from"./cancel_flow-ZBJl8XMR.js";import"./SiteLogo-CJUXy43L.js";function H(t){return!!t&&["1","true",""].includes(String(t.keep??"no"))}function J(t,r,{tries:y=25,interval:u=200,schedule:s=setTimeout}={}){return new Promise(i=>{let f=0;const h=()=>{const b=t();if(b){b.scrollIntoView({behavior:"smooth",block:"center"}),i("banner");return}if(f+=1,f>=y){const g=r();g&&g.scrollIntoView({behavior:"smooth",block:"start"}),i(g?"fallback":"none");return}s(h,u)};h()})}const K={components:{Layout:M,UpgradeButton:T,Loader:O,CancelBanner:D},data(){return{satellite:"fintest",fullName:"",email:"",submitting:!1,showSuccessMessage:!1,errorMessage:null,cancellingInProgress:!1,cancelledMessage:null,resuming:!1,resumeError:null,signingOutEverywhere:!1,signOutEverywhereError:null,extraTimeOptions:z,extraTime:W(k()),extraTimeSaved:!1,longDate:G}},computed:{...F({userFullName:"user/fullName",userEmail:"user/email",userCurrentProducts:"user/currentProducts",manageableSubscriptions:"user/manageableSubscriptions",bankPackages:"bankPackages/bankPackages",plansLocale:"plans/locale"}),products(){const t=this.userCurrentProducts.find(u=>u.product==="all"),r=this.userCurrentProducts.filter(u=>u.product==="one"),y=r.map(u=>this.bankPackages.find(i=>i.slug===u.package).name);if(t)return["Complete Package"];if(r)return y}},created(){this.fillForm()},mounted(){var t;H((t=this.$route)==null?void 0:t.query)&&J(()=>this.$el.querySelector(".cancel-banner-slot .kb"),()=>this.$el.querySelector('[data-test="membership"]'))},methods:{setExtraTime(t){this.extraTime=q(k(),t),this.extraTimeSaved=!0},fillForm(){this.fullName=this.userFullName,this.email=this.userEmail},isRetrying(t){return["past_due","unpaid"].includes(t.status)},renewalAmount(t){const r=["JPY"].includes(String(t.currency||"").toUpperCase());return L(t.amount,this.plansLocale||void 0,t.currency,r)||""},planLine(t){return Y(B(),t.interval)},startCancel(t){if(this.cancelledMessage=null,this.isRetrying(t)){this.cancelSubscription(t.id);return}this.$router.push({name:"cancel-membership",query:{subscription:t.id}})},cancelSubscription(t){this.cancellingInProgress||(this.cancellingInProgress=!0,this.$store.dispatch("user/cancelSubscription",{subscriptionId:t}).then(r=>{this.cancellingInProgress=!1,this.cancelledMessage=r?"Cancelled. Weâve stopped trying your card and thereâs nothing left to pay.":null}).catch(r=>{console.error("Could not cancel a subscription",{subscriptionId:t,error:r}),this.cancellingInProgress=!1,this.cancelledMessage=null}))},resumeSubscription(t){this.resuming||(this.resuming=!0,this.resumeError=null,this.$store.dispatch("user/resumeSubscription",{subscriptionId:t.id}).catch(r=>{console.error("Could not resume a subscription",{subscription:t,error:r}),this.resumeError="Sorry, we couldnât resume that just now. Please try again."}).finally(()=>{this.resuming=!1}))},async signOutEverywhere(){if(!this.signingOutEverywhere){this.signingOutEverywhere=!0,this.signOutEverywhereError=null;try{await this.$store.dispatch("user/userSignOutEverywhere"),this.$router.push({name:"sign-in"})}catch(t){console.error("Could not sign out everywhere",t),this.signOutEverywhereError="We could not sign you out of your other devices. Please check your connection and try again."}finally{this.signingOutEverywhere=!1}}},submitChanges(){this.submitting||(this.showSuccessMessage=!1,this.submitting=!0,this.errorMessage=null,this.$store.dispatch("user/update",{fullName:this.fullName,email:this.email}).then(()=>{this.submitting=!1,this.showSuccessMessage=!0,this.fillForm()}).catch(t=>{this.submitting=!1,t.response&&t.response.data.message&&(this.errorMessage=t.response.data.message)}))}}},c=t=>(U("data-v-697acee4"),t=t(),A(),t),X={class:"flex-grow"},Q=c(()=>e("div",{class:"pb-16 bg-block"},[e("div",{class:"w-full max-w-screen-lg relative mx-auto px-6 py-12"},[e("h1",{class:"text-4xl text-primary font-bold leading-tight"}," Settings ")])],-1)),Z=c(()=>e("div",{class:"text-gray-200 block overflow-hidden absolute transform -translate-y-1/2 w-full","aria-hidden":"true"},[e("svg",{viewBox:"0 0 1440 76",class:"fill-current"},[e("path",{d:"M1440-.007V76H0V-.007C226.68 23.998 466.68 36 720 36s493.32-12.002 720-36.00
17z"})])],-1)),$={class:"relative pt-8",style:{top:"-100px"}},ee={class:"w-full max-w-screen-lg relative mx-auto"},te={class:"px-6"},se={class:"shadow rounded-lg bg-white p-6"},ae={class:"lg:flex justify-between border-b mb-8 pb-8","data-test":"extra-time"},re=c(()=>e("h3",{class:"lg:w-1/3 text-lg font-medium mb-6 lg:mb-0"}," Extra time ",-1)),le={class:"lg:w-2/3"},ne=c(()=>e("p",{class:"mb-4 text-sm text-gray-600"}," If you are granted extra time in real assessments, set the same allowance here. It applies to every timed test you sit from now on; your first sitting ran at standard time. ",-1)),ie={role:"radiogroup","aria-label":"Extra time allowance",class:"grid gap-3 sm:grid-cols-3"},oe=["aria-checked","data-test","onClick"],ce={key:0,role:"status",class:"mt-3 text-sm text-standout"},de={class:"lg:flex justify-between border-b mb-8 pb-8"},ue=c(()=>e("h3",{class:"lg:w-1/3 text-lg font-medium mb-6 lg:mb-0"}," Account details ",-1)),me={class:"lg:w-2/3"},he={class:"block mb-6"},ge=c(()=>e("span",{class:"text-gray-600"},"Full name",-1)),_e=["disabled"],pe={class:"block"},ye=c(()=>e("span",{class:"text-gray-600"},"Email",-1)),fe=["disabled"],be={key:0,class:"text-red-500 my-4"},ve={class:"md:flex items-center mt-4"},xe={key:0,class:"text-standout text-sm mt-4 md:mt-0 md:ml-4"},we={key:0,class:"lg:flex justify-between items-center border-b mb-8 pb-8"},ke=c(()=>e("h3",{class:"lg:w-1/3 text-lg font-medium mb-6 lg:mb-0"}," Products ",-1)),Ee={class:"lg:w-2/3"},Ce={class:"font-medium"},Pe={class:"lg:flex justify-between border-b mb-8 pb-8"},Se=c(()=>e("h3",{class:"lg:w-1/3 text-lg font-medium mb-6 lg:mb-0"}," Sessions ",-1)),Te={class:"lg:w-2/3"},Me=c(()=>e("p",{class:"text-sm text-gray-600 mb-4"}," Signed in on a shared or lost device? This signs you out everywhere, including here. ",-1)),Ie={key:0,role:"status","aria-live":"polite",class:"text-sm text-red-500 mt-4","data-test":"sign-out-everywhere-error"},Oe={class:"pb-8","data-test":"membership"},Ne={class:"lg:flex justify-between"},Be=c(()=>e("h3",{class:"lg:w-1/3 text-lg font-medium mb-6 lg:mb-0"}," Membership ",-1)),Le={key:0,class:"lg:w-2/3"},Fe={class:"cancel-banner-slot"},Ve={key:0,class:"text-sm mb-4","data-test":"cancelled-message"},je={class:"font-medium","data-test":"plan-line"},Re={key:0,class:"text-sm text-red-500","data-test":"retry-explainer"},Ue={key:1,class:"text-sm","data-test":"renewal-terms"},Ae={key:2,class:"mt-2"},De={key:0,class:"flex"},qe=c(()=>e("span",{class:"text-red-500"},"Cancelling...",-1)),ze=[qe],We=["onClick"],Ye={key:3,class:"mt-2","data-test":"cancel-done"},Ge=c(()=>e("p",{class:"text-sm font-medium"},"Membership cancelled",-1)),He={class:"text-sm text-gray-600 mb-2"},Je=["onClick"],Ke={key:0,role:"status",class:"text-sm text-red-500 mt-2"},Xe={key:1,class:"lg:w-2/3"},Qe={key:0,class:"text-sm mb-4","data-test":"cancelled-message"},Ze=c(()=>e("div",{class:"font-medium"}," Basic ",-1));function $e(t,r,y,u,s,i){const f=p("Loader"),h=p("BaseButton"),b=p("CancelBanner"),g=p("UpgradeButton"),S=p("Layout");return l(),N(S,{class:"h-full w-full bg-primary-200","inverse-style":""},{default:_(()=>[e("main",X,[Q,Z,e("div",$,[e("div",ee,[e("div",te,[e("div",se,[e("form",{novalidate:"",onSubmit:r[4]||(r[4]=V(()=>{},["prevent"]))},[e("ul",null,[e("li",ae,[re,e("div",le,[ne,e("div",ie,[(l(!0),n(x,null,w(s.extraTimeOptions,a=>(l(),n("button",{key:a,type:"button",role:"radio","aria-checked":s.extraTime===a?"true":"false",class:j(["px-4 font-medium border-2 rounded",s.extraTime===a?"border-secondary text-secondary bg-gray-50":"border-gray-300 text-gray-700"]),style:{"min-height":"44px"},"data-test":`extra-time-${a}`,onClick:v=>i.setExtraTime(a)},o(a===0?"Standard time":`+${a}%`),11,oe))),128))]),s.extraTimeSaved?(l(),n("p",ce,"Saved. Your next timed test runs with "+o(s.extraTime===0?"standard time":`+${s.extraTime}% time`)+".",1)):d("",!0)])]),e("li",de,[ue,e("div",me,[e("label",he,[ge,E(e("input",{"onUpdate:modelValue":r[0]||(r[0]=a=>s.fullName=a),class:"form-input bg-gray-100 w-full mt-1 text-gray-600",type:"text",disabled:s.submitting,placeholder:"Full name",onFocus:r[1]||(r[1]=a=>a.target.select())},null,40,_e),[[C,s.fullName]])]),e("label",pe,[ye,E(e("input",{"onUpdate:modelValue":r[2]||(r[2]=a=>s.email=a),class:"form-input bg-gray-100 w-full mt-1 text-gray-600",type:"email",disabled:s.submitting,placeholder:"Email",onFocus:r[3]||(r[3]=a=>a.target.select())},null,40,fe),[[C,s.email]])]),s.errorMessage?(l(),n("div",be,o(s.errorMessage),1)):d("",!0),e("div",ve,[m(h,{loading:s.submitting,variant:"accent",size:"large",class:"w-full sm:w-auto
1sm:h-10",onClick:i.submitChanges},{loading:_(()=>[m(f,{width:"w-10",height:"h-10"})]),default:_(()=>[P(" Save changes ")]),_:1},8,["loading","onClick"]),m(R,{"enter-active-class":"transition-all duration-200 ease-out-quad","leave-active-class":"transition-all duration-200 ease-in-quad","enter-class":"opacity-0","enter-to-class":"opacity-100","leave-class":"opacity-100","leave-to-class":"opacity-0"},{default:_(()=>[s.showSuccessMessage?(l(),n("p",xe," Changes Saved ")):d("",!0)]),_:1})])])]),i.products.length>0?(l(),n("li",we,[ke,e("div",Ee,[e("div",Ce,[(l(!0),n(x,null,w(i.products,(a,v)=>(l(),n("span",{key:v,class:"block leading-loose"},o(a),1))),128))])])])):d("",!0),e("li",Pe,[Se,e("div",Te,[Me,m(h,{type:"button",variant:"outline",loading:s.signingOutEverywhere,disabled:s.signingOutEverywhere,class:"w-full sm:w-auto","data-test":"sign-out-everywhere",onClick:i.signOutEverywhere},{default:_(()=>[P(" Sign out of all devices ")]),_:1},8,["loading","disabled","onClick"]),s.signOutEverywhereError?(l(),n("p",Ie,o(s.signOutEverywhereError),1)):d("",!0)])]),e("li",Oe,[e("div",Ne,[Be,t.manageableSubscriptions.length?(l(),n("div",Le,[e("div",Fe,[m(b)]),s.cancelledMessage?(l(),n("div",Ve,o(s.cancelledMessage),1)):d("",!0),(l(!0),n(x,null,w(t.manageableSubscriptions,a=>(l(),n("div",{key:a.id,"data-test":"subscription-panel"},[e("p",je,o(i.planLine(a)),1),i.isRetrying(a)?(l(),n("p",Re," We couldnât take your last payment of "+o(i.renewalAmount(a))+", so weâre trying your card again over the next few days. If youâd rather stop, cancel below and we wonât try again. ",1)):a.cancelAtPeriodEnd?d("",!0):(l(),n("p",Ue," Your membership renews automatically at "+o(i.renewalAmount(a))+" on "+o(s.longDate(a.currentPeriodEnd))+". Cancel any time and you keep access until the renewal date. ",1)),!a.cancelAtPeriodEnd||i.isRetrying(a)?(l(),n("div",Ae,[s.cancellingInProgress?(l(),n("div",De,ze)):(l(),n("a",{key:1,href:"javascript:;",class:"text-sm text-red-500 hover:text-red-600","data-test":"cancel-subscription",onClick:v=>i.startCancel(a)},o(i.isRetrying(a)?"Cancel and stop payment attempts":"Cancel membership"),9,We))])):(l(),n("div",Ye,[Ge,e("p",He," You have full access until "+o(s.longDate(a.currentPeriodEnd))+". No further payments will be taken. ",1),e("a",{href:"javascript:;",class:"text-sm text-secondary","data-test":"undo-cancel",onClick:v=>i.resumeSubscription(a)},o(s.resuming?"Resumingâ¦":"Resume my membership"),9,Je),s.resumeError?(l(),n("p",Ke,o(s.resumeError),1)):d("",!0)]))]))),128))])):(l(),n("div",Xe,[s.cancelledMessage?(l(),n("div",Qe,o(s.cancelledMessage),1)):d("",!0),Ze,m(g,{class:"mt-4"})]))])])])],32)])])])])])]),_:1})}const nt=I(K,[["render",$e],["__scopeId","data-v-697acee4"]]);export{nt 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.