1import{Q as V}from"./QToolbarTitle-D_rjp2yr.js";import{d as S,u as z,am as N,al as Q,a8 as R,ak as U,r as i,o as B,f3 as I,a9 as $,p as x,q as h,v as t,f as s,x as l,ab as _,y as D,D as b,G as T,H as q,ac as A,aD as K,B as P,ao as O,z as L,aa as M,bb as E}from"./index-DjfbnMER.js";import{_ as F}from"./word-logo-1F1Dt1qb.js";const G={class:"main_bg",style:{background:"linear-gradient(to right, #3772ff, #00e66d) !important"}},H={class:"flex flex-center",style:{height:"100vh"}},Y={style:{position:"relative","z-index":"2",background:"#fff"}},j={class:"row q-mt-md text-center"},J={style:{"font-size":"21px"},class:"row q-mt-lg text-grey-8"},W={style:{color:"#697a8d","font-size":"15px"},class:"text-caption q-mt-xs"},X={class:"text-weight-medium"},Z={key:0,style:{color:"#697a8d","font-size":"15px","border-radius":"5px"},class:"text-caption q-mt-md bg-secondary text-white q-pa-md"},ee={class:"q-px-sm"},te={class:"row q-px-sm q-my-md"},se={class:"q-mt-lg text-center text-grey-8"},le=S({__name:"ResetPassword",setup(ae){const k=z(),w=N(),o=Q(),r=R(),m=U(),d=i(null),y=i(!1),u=i(null),f=i(null),c=i(!1),p=i(!1);async function C(){await w.signOut(),r.push("/login")}async function g(){if(u.value!==f.value){o.notify({message:"Passwords do not match. Please try again.",type:"negative"});return}try{let a=await E(d.value,u.value),e=[{path:`users/${d.value.uid}/passwordSet`,data:!0}];await k.genericCUD(e,"user","update"),o.notify({message:"Password has been set successfully",type:"positive"}),m.query?.next?r.push({path:m.query.next.toString()}):r.push("/contacts/pipeline")}catch(a){switch(a.code){case"auth/weak-password":o.notify({message:"Password is too weak. Please try again.",type:"negative"});break;case"auth/requires-recent-login":o.notify({message:"Please login again to set a new password.",type:"negative"}),w.signOut(),r.push("/login");break;default:o.notify({message:"An error occurred. Please try again.",type:"negative"})}}}return B(async()=>{const a=await I();m.query?.initial&&a&&(y.value=!0,console.log("Current User:",a),d.value=a)}),(a,e)=>{const v=$("Icon");return h(),x("div",G,[t("div",H,[s(M,{bordered:"",class:"bg-white shadow_custom authentication-inner",style:O([{width:"70%"},L(o).screen.lt.sm?"max-width:70%;":"max-width:400px;"])},{default:l(()=>[t("div",Y,[s(_,{class:"q-px-lg"},{default:l(()=>[t("div",j,[s(V,{class:"cursor-pointer",style:{"text-align":"center"}},{default:l(()=>e[5]||(e[5]=[t("img",{style:{width:"100%","margin-left":"10px"},alt:"",src:F},null,-1)])),_:1,__:[5]})]),t("div",J,b(y.value?"Create a":"Reset Your")+" Password ð ",1),t("div",W,[e[6]||(e[6]=T(" for ")),t("span",X,b(d.value?.email),1)]),y.value?(h(),x("div",Z," It looks like this is your first time logging in. Please set your password now. ")):D("",!0)]),_:1}),s(_,{class:"q-pt-none"},{default:l(()=>[t("div",ee,[s(q,{dense:"",class:"q-pt-md",modelValue:u.value,"onUpdate:modelValue":e[1]||(e[1]=n=>u.value=n),type:c.value?"text":"password",outlined:"",label:"New Password"},{append:l(()=>[s(v,{onClick:e[0]||(e[0]=n=>c.value=!c.value),icon:c.value?"mdi-eye-off-outline":"mdi-eye-outline"},null,8,["icon"])]),_:1},8,["modelValue","type"]),s(q,{dense:"",class:"q-py-md",modelValue:f.value,"onUpdate:modelValue":e[3]||(e[3]=n=>f.value=n),onKeydown:A(K(g,["prevent"]),["enter"]),type:p.value?"text":"password",outlined:"",label:"Confirm Password"},{append:l(()=>[s(v,{onClick:e[2]||(e[2]=n=>p.value=!p.value),icon:p.value?"mdi-eye-off-outline":"mdi-eye-outline"},null,8,["icon"])]),_:1},8,["modelValue","onKeydown","type"])]),t("div",te,[s(P,{class:"full-width text-capitalize",label:"Set New Password",onClick:g,type:"button",color:"primary"})]),t("div",se,[s(P,{onClick:e[4]||(e[4]=n=>C()),flat:"",dense:"",class:"text-capitalize text-primary q-pr-md",icon:"mdi-chevron-left",label:"Not you? Sign out and return to Login"})])]),_:1})])]),_:1},8,["style"])])])}}});export{le 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.