import{u as c}from"./vue-i18n-90d534a9.js";import{u as f}from"./vue-router-7f882520.js";import{k as _,q as a,_ as P}from"./index-ae60edf9.js";import{F as b}from"./index-fc073ec7.js";import{b as g}from"./login-2739e1e5.js";import{_ as v}from"./index.vue_vue_type_script_setup_true_lang-1170722e.js";import{m}from"./md5-249b0917.js";import{d as h,l as V,o as $,c as k,$ as i,bj as I,a as d,aX as R,u as S}from"./@vue-cb50a1c4.js";import"./@intlify-1c0af683.js";import"./open-im-sdk-wasm-f19f04ec.js";import"./dayjs-4460abc8.js";import"./@amap-aca98dec.js";import"./pinia-de4079f2.js";import"./axios-7d5a0a64.js";import"./form-data-497f8b5e.js";import"./uuid-a960c1f4.js";import"./date-fns-f56f60e6.js";import"./@babel-7fd5df1e.js";import"./mitt-f7ef348c.js";import"./@vueuse-19adab01.js";import"./livekit-client-ca552de3.js";import"./@livekit-3058dbe8.js";import"./loglevel-e40a507a.js";import"./rxjs-2154ddb2.js";import"./tslib-8dbab242.js";import"./@vuemap-5ebdc63e.js";import"./lodash-es-91418b19.js";import"./use-id-22cfdfcf.js";import"./index-597402db.js";import"./arrows_left-f963ef62.js";import"./crypt-5ea4a8e1.js";import"./charenc-bfd911d6.js";import"./is-buffer-793dba8c.js";const T={class:"page_container"},x={class:"overflow-hidden rounded-md"},y={class:"bg-white"},D={class:"border-t bg-white"},U={class:"border-t bg-white"},q=h({__name:"index",setup(B){const l=/^(?=.*[0-9])(?=.*[a-zA-Z]).{6,20}$/,{t:e}=c(),p=f(),u=_(),s=V({oldPassword:"",newPassword:"",confirmPassword:""}),w=()=>{if(s.oldPassword.length<0){a({message:e("placeholder.inputPassword"),error:e("placeholder.inputPassword")});return}if(!l.test(s.newPassword)){a({message:e("passwordRequired"),error:e("passwordRequired")});return}if(s.newPassword!==s.confirmPassword){a({message:e("messageTip.rePassword"),error:e("messageTip.rePassword")});return}const r={userID:u.storeSelfInfo.userID,currentPassword:m(s.oldPassword),newPassword:m(s.newPassword)};g(r).then(()=>{a({message:e("messageTip.changePasswordSuccess")}),setTimeout(()=>p.back(),500)}).catch(o=>{a({message:o.errDlt,error:o})})};return(r,o)=>{const n=b;return $(),k("div",T,[i(v,{title:r.$t("changePassword")},{default:I(()=>[d("div",{class:"btn",onClick:w},R(S(e)("buttons.save")),1)]),_:1},8,["title"]),d("div",x,[d("div",y,[i(n,{modelValue:s.oldPassword,"onUpdate:modelValue":o[0]||(o[0]=t=>s.oldPassword=t),label:`${r.$t("oldPassword")}：`},null,8,["modelValue","label"])]),d("div",D,[i(n,{modelValue:s.newPassword,"onUpdate:modelValue":o[1]||(o[1]=t=>s.newPassword=t),label:`${r.$t("newPassword")}：`},null,8,["modelValue","label"])]),d("div",U,[i(n,{modelValue:s.confirmPassword,"onUpdate:modelValue":o[2]||(o[2]=t=>s.confirmPassword=t),label:`${r.$t("confirmPassword")}：`},null,8,["modelValue","label"])])])])}}});const cs=P(q,[["__scopeId","data-v-2e0afa77"]]);export{cs as default};
