1import{_ as x}from"./xp1hpdE5.js";import{d as z,K as D,w as H,c as M,i as E,s as K,y as I,z as L,E as Q}from"./BL_iwhbQ.js";import{d as g,X as w,K as k,m as e,Z as l,ad as U,ae as F,Y as N,u as o,_ as R,f,an as W,af as p,r as X}from"./BVpyO-BZ.js";import{H as Y,M as Z,U as G,p as J,q as ee}from"./C7PLhKXe.js";import{q as oe,H as ae}from"./DZZcRgM-.js";const se={class:"flex items-center"},te=g({__name:"FormActions",props:{submiting:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(c){return(r,i)=>{const d=z;return w(),k("div",se,[e(d,{loading:c.submiting,disabled:c.disabled,type:"submit",size:"lg"},{default:l(()=>[U(F(r.$t("button.save")),1)]),_:1},8,["loading","disabled"]),e(d,{variant:"link",to:r.$url.myProfile()},{default:l(()=>[U(F(r.$t("button.back.to.overview")),1)]),_:1},8,["to"])])}}}),le=Object.assign(te,{__name:"AccountProfileFormActions"}),re=H(Y),ne=g({__name:"FormAlert",props:{description:{}},setup(c,{expose:r}){const i=f(!1),{ready:d,start:m}=oe(6e3,{controls:!0});return r({showAlert:()=>{i.value=!0,m()}}),($,v)=>{const b=D,y=re;return w(),N(y,null,{default:l(()=>[o(i)&&!o(d)?(w(),N(b,{key:0,title:"De account informatie is opgeslagen.",description:c.description,icon:"i-heroicons-check-circle",color:"primary",variant:"soft"},null,8,["description"])):R("",!0)]),_:1})}}}),ie=Object.assign(ne,{__name:"AccountProfileFormAlert"}),de={class:"py-8"},me={class:"border-t pt-3 md:pt-4 border-gray-200"},ce=g({__name:"login",async setup(c){let r,i;const{createSchema:d}=Z(),m=G(),{customer:h,loaded:$,ensureCustomer:v,changePassword:b}=J(),{$url:y}=M(),S=E(),a=X({email:"",currentPassword:"",newPassword:"",confirmNewPassword:""}),B=d({email:m.email,currentPassword:m.currentPassword(),newPassword:m.newPassword,confirmNewPassword:m.confirmNewPassword}),A=f(),V=f(),P=f(!1);[r,i]=W(async()=>K(async()=>{await v(),a.email=h.value?.email??""},{server:!1},"$WxQfF0M6ge")),await r,i();const C=async()=>{await A.value.validate(),P.value=!0;const t=await b({currentPassword:a.currentPassword,newPassword:a.newPassword});P.value=!1,t.success&&(V.value?.showAlert(),await ae(1e3),S.push(y.myProfile()))};return(t,s)=>{const q=x,u=Q,_=L,O=le,T=I,j=ee;return w(),k("div",null,[e(q,{title:t.$t("myaccount.profileLogin")},null,8,["title"]),p("div",de,[e(j,{show:!o($)},{default:l(()=>[e(T,{ref_key:"form",ref:A,state:o(a),schema:o(B),class:"grid gap-y-3 md:gap-y-4",onSubmit:C},{default:l(()=>[s[4]||(s[4]=p("input",{class:"sr-only",type:"email",name:"username"},null,-1)),s[5]||(s[5]=p("input",{class:"sr-only",type:"password",name:"password"},null,-1)),e(_,{name:"email",label:t.$t("form.field_email_label"),required:""},{default:l(()=>[e(u,{modelValue:o(a).email,"onUpdate:modelValue":s[0]||(s[0]=n=>o(a).email=n),type:"email","aria-label":"email",disabled:"",placeholder:t.$t("form.field_email_placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),e(_,{name:"currentPassword",label:t.$t("form.field_old_password_label"),required:""},{default:l(()=>[e(u,{modelValue:o(a).currentPassword,"onUpdate:modelValue":s[1]||(s[1]=n=>o(a).currentPassword=n),type:"password","aria-label":"password",placeholder:t.$t("form.field_old_password_placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),e(_,{name:"newPassword",label:t.$t("form.field_new_password_label"),required:""},{default:l(()=>[e(u,{modelValue:o(a).newPassword,"onUpdate:modelValue":s[2]||(s[2]=n=>o(a).newPassword=n),type:"password","aria-label":"password",autocomplete:"new-password",placeholder:t.$t("form.field_new_password_placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),e(_,{name:"confirmNewPassword",label:t.$t("form.field_confirmPassword_label"),required:""},{default:l(()=>[e(u,{modelValue:o(a).confirmNewPassword,"onUpdate:modelValue":s[3]||(s[3]=n=>o(a).confirmNewPassword=n),type:"password","aria-label":"confirm password",placeholder:t.$t("form.field_confirmPassword_placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),e(o(ie),{ref_key:"formAlert",ref:V},null,512),p("div",me,[e(O,{submiting:o(P)},null,8,["submiting"])])]),_:1},8,["state","schema"])]),_:1},8,["show"])])])}}}),be=Object.freeze(Object.defineProperty({__proto__:null,default:ce},Symbol.toStringTag,{value:"Module"}));
1export{ie as A,le as _,be as l};
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.