1import{_ as M}from"./DnMM_Yjt.js";import{_ as A}from"./CnIo5AX8.js";import{d as F,u as R,s as I,q as N,a as O,e as l,f as _,g as s,B as v,h as t,t as x,i as n,M as y,E as j,r as D,p as T,l as W}from"./CFxGRstO.js";import{i as z}from"./Dhu0ts9N.js";import{c as G,a as $,d as H,u as J,b as E}from"./CgWzIhW9.js";import{_ as K}from"./CR0-Au_c.js";import"./DlAUqK2U.js";import"./Cpj98o6Y.js";import"./B2a-ywG8.js";import"./BWBHGvIx.js";import"./-vsEa_js.js";const L={class:"tw-text-h4 !tw-text-yellow tw-mb-2 tw-text-center password-form-header"},Q={class:"tw-grid tw-gap-2 tw-py-2 tw-mb-4"},X={class:"tw-text-h4 !tw-text-yellow !tw-mb-6 tw-text-center password-form-header"},Y={class:"tw-mb-2"},Z={class:"tw-mb-2"},ss={class:"tw-grid tw-gap-2 tw-py-2 tw-mb-4"},os=F({__name:"ChangePasswordForm",setup(S){const{t:a}=R(),c=I(),i=N(),m=O(),V=G({password:$().required(a("validation.common.information_required")).min(6,a("validation.password.too_short")).max(200),cpassword:$().required(a("validation.common.information_required")).oneOf([H("password")],a("validation.password.not_match")).min(6).max(200)}),{handleSubmit:k,isSubmitting:d,errors:C,meta:q,setFieldError:w}=J({validationSchema:V}),{value:p,errorMessage:B,setErrors:P}=E("password"),{value:u,errorMessage:U}=E("cpassword"),b=D(!1),f=k(async e=>{const{userErrors:o}=await c.changePassword(e.password,e.cpassword,m.query.hash);o?.password?P(o.password):b.value=!0});return(e,o)=>{const h=M,g=A;return l(),_("div",null,[s(b)?(l(),_(v,{key:0},[t("h1",L,x(e.$t("user.change_password_form.password_changed")),1),t("div",Q,[n(h,{label:e.$t("user.change_password_form.go_to_account"),class:"btn btn-md btn-primary btn-spinner ripple",onClick:o[0]||(o[0]=r=>s(i).push("/account"))},null,8,["label"])])],64)):(l(),_(v,{key:1},[t("h1",X,x(e.$t("user.change_password_form.set_new_password")),1),t("form",{onSubmit:o[5]||(o[5]=j((...r)=>s(f)&&s(f)(...r),["prevent"]))},[t("div",Y,[n(g,{modelValue:s(p),"onUpdate:modelValue":o[1]||(o[1]=r=>y(p)?p.value=r:null),label:e.$t("user.change_password_form.new_password_label"),"error-text":s(B),"is-disabled":s(d),onFocus:o[2]||(o[2]=()=>s(w)("password",""))},null,8,["modelValue","label","error-text","is-disabled"])]),t("div",Z,[n(g,{modelValue:s(u),"onUpdate:modelValue":o[3]||(o[3]=r=>y(u)?u.value=r:null),label:e.$t("user.change_password_form.confirm_password_label"),"error-text":s(U),"is-disabled":s(d),onFocus:o[4]||(o[4]=()=>s(w)("cpassword",""))},null,8,["modelValue","label","error-text","is-disabled"])]),t("div",ss,[n(h,{label:e.$t("user.change_password_form.change_password_button"),class:"btn btn-md btn-primary btn-spinner ripple",type:"submit",disabled:s(d)||!s(z)(s(C))&&s(q).touched,loading:s(d)},null,8,["label","disabled","loading"])])],32)],64))])}}}),es=Object.assign(os,{__name:"UserChangePasswordForm"}),cs=F({__name:"change-password",setup(S){return(a,c)=>{const i=es,m=K;return l(),T(m,null,{default:W(()=>[n(i,{class:"tw-mx-auto sign-in-block"})]),_:1})}}});
1export{cs 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.