1import"./chunk-CWWYXUO7.js";import{a as oe}from"./chunk-V6ZEDAN2.js";import{a as $}from"./chunk-BCD2KHGG.js";import"./chunk-XMQL2ZPB.js";import{a as X}from"./chunk-YQ2HBBL5.js";import{a as Z}from"./chunk-4M3H6OJK.js";import"./chunk-2NWUFIXC.js";import"./chunk-KADQP2XK.js";import{a as ee,b as te}from"./chunk-ECMF7CC2.js";import"./chunk-C4XHNRNH.js";import{a as Y}from"./chunk-LKIIPTIG.js";import{I as z,_ as K}from"./chunk-SRUBCUSW.js";import"./chunk-52TU3IL6.js";import"./chunk-TDIWFVPA.js";import"./chunk-MN2F2UI2.js";import"./chunk-LJV7ZYHU.js";import"./chunk-25QDB3SE.js";import"./chunk-KJ3PV2LN.js";import"./chunk-35M7AFQZ.js";import"./chunk-HCVRNL4G.js";import"./chunk-INMDLS22.js";import"./chunk-AJZMXFMA.js";import"./chunk-YE7HTOLI.js";import"./chunk-NZ4I6U2Z.js";import{b as J}from"./chunk-23N7CA4O.js";import"./chunk-YI7ZQONV.js";import"./chunk-54IZQ3MU.js";import"./chunk-QUO3WGUK.js";import"./chunk-GZLC4DDF.js";import"./chunk-74YMZKOK.js";import"./chunk-6IH4M65S.js";import"./chunk-NGAT3XSV.js";import"./chunk-6DMACB4X.js";import"./chunk-SXLHBEO2.js";import"./chunk-IUPWKUGB.js";import"./chunk-C5J3HTKX.js";import"./chunk-56FUNJ2L.js";import"./chunk-KORPXNVS.js";import"./chunk-W4BNGQYG.js";import{a as Q}from"./chunk-OSVOK6WL.js";import"./chunk-WXXKR7LF.js";import"./chunk-R2NO6V5K.js";import"./chunk-FV2Q4OA6.js";import"./chunk-QPZCEWML.js";import"./chunk-L44SDTPC.js";import{a as k,b as B}from"./chunk-CLQP3QCS.js";import"./chunk-TWVMK4TV.js";import"./chunk-EGNI2XJ3.js";import"./chunk-A3N634GV.js";import"./chunk-F457L6VT.js";import"./chunk-6BC3ZOBR.js";import"./chunk-4U4PLY73.js";import"./chunk-RQ4F2COW.js";import"./chunk-7RWCIHFI.js";import"./chunk-GP7G4HVV.js";import"./chunk-X5ROTD3U.js";import{a as j}from"./chunk-V4NS6LW3.js";import"./chunk-VFTYDXHH.js";import"./chunk-LJSWAOQY.js";import"./chunk-RFPVTC6I.js";import"./chunk-SPFBMSSO.js";import"./chunk-TZOYHBJT.js";import"./chunk-34KEMFZC.js";import"./chunk-4BUGZAA4.js";import"./chunk-3TCRHIAB.js";import"./chunk-76JNFTGE.js";import"./chunk-C7VFP4N4.js";import{c as G,d as q}from"./chunk-CYMQMRSQ.js";import{F as N,d as F,f as D,g as L,j as V,m as W,o as I,s as U,v as H}from"./chunk-SAPP7HDL.js";import"./chunk-YJOTM47P.js";import{g as A,i as M}from"./chunk-2PJAPLDY.js";import"./chunk-UQ5LDOFJ.js";import"./chunk-C2CO7BOS.js";import"./chunk-UVTXHEDZ.js";import"./chunk-3APTCJCW.js";import"./chunk-EMVJM2S7.js";import"./chunk-KDTKTPR2.js";import"./chunk-TPWGF6XO.js";import{$a as u,Cb as r,Dc as R,Ia as E,Ic as y,Ja as P,Jc as C,Tb as T,Xc as v,Yb as S,Zc as _,id as O,lc as d,pd as l,qd as p,sc as w,xa as s,xc as m,yc as a,zc as f}from"./chunk-MH4BPXDL.js";import{a as b,b as x,l as h}from"./chunk-CU44V7JF.js";var g=class o{constructor(t){this._value=t}static fromString(t){return new o(t)}get value(){return this._value}};var ie=()=>({confirmLabel:"AUTH.RESET_PASSWORD.CONFIRM_LABEL",confirmPlaceholder:"AUTH.RESET_PASSWORD.CONFIRM_PLACEHOLDER",mismatchError:"AUTH.RESET_PASSWORD.ERRORS.PASSWORD_MISMATCH"});function re(o,t){if(o&1){let c=R();m(0,"form",8),y("ngSubmit",function(){E(c);let i=C();return P(i.onSubmit())}),m(1,"div",9),f(2,"vds-create-password",10),l(3,"translate"),l(4,"translate"),a(),m(5,"div",11)(6,"vds-button",12),v(7),l(8,"translate"),a()()()}if(o&2){let c,e=C();d("formGroup",e.changePasswordForm),r(2),d("requireConfirmation",!0)("label",p(3,10,"AUTH.RESET_PASSWORD.PASSWORD_LABEL"))("placeholder",p(4,12,"AUTH.RESET_PASSWORD.PASSWORD_PLACEHOLDER"))("errorMessage",(c=e.passwordApiError())!==null&&c!==void 0?c:void 0)("i18n",O(16,ie)),r(4),d("fullWidth",!0)("loading",e.isSubmitting())("disabled",e.isSubmitting()),r(),_(" ",p(8,14,"AUTH.RESET_PASSWORD.SUBMIT_BUTTON")," ")}}function ne(o,t){o&1&&f(0,"vds-container-loading",7),o&2&&d("active",!0)}var Ae=(()=>{let t=class t{constructor(){this.route=s(A),this.router=s(M),this.authService=s(K),this.toastService=s(J),this.translation=s(j),this.oobCode=g.fromString(""),this.changePasswordForm=new V({password:new W("",{nonNullable:!0,validators:[F.required]})}),this.codeState=u("loading"),this.isSubmitting=u(!1),this.passwordApiError=u(null),this.passwordControl
1=this.changePasswordForm.controls.password}ngOnInit(){return h(this,null,function*(){let e=this.route.snapshot.queryParamMap.get("oobCode")?.trim()??"";if(!e){yield this.redirectToForgotPassword({linkInvalid:!0});return}if(this.oobCode=g.fromString(e),!this.oobCode.value){yield this.redirectToForgotPassword({linkInvalid:!0});return}try{yield this.authService.verifyPasswordResetCode({oobCode:this.oobCode}),this.codeState.set("valid")}catch(i){if(this.extractErrorCode(i)===k.ExpiredActionCode){yield this.redirectToForgotPassword({linkExpired:!0});return}yield this.redirectToForgotPassword({linkInvalid:!0})}})}onSubmit(){return h(this,null,function*(){if(!(this.codeState()!=="valid"||this.isSubmitting())){if(!this.changePasswordForm.valid){this.changePasswordForm.markAllAsTouched();return}this.isSubmitting.set(!0),this.passwordApiError.set(null);try{let e=z.fromString(this.passwordControl.value);yield this.authService.confirmPasswordReset({oobCode:this.oobCode,newPassword:e}),this.toastService.success(this.translation.get("AUTH.RESET_PASSWORD.SUCCESS_TITLE")),yield this.router.navigate(["/auth/login"])}catch(e){let i=this.translation.get("AUTH.RESET_PASSWORD.ERRORS.GENERIC"),n=e instanceof Error&&e.message?.trim().length?e.message:i;this.passwordApiError.set(n),this.toastService.error(this.translation.get("AUTH.RESET_PASSWORD.ERROR_TITLE"),n)}finally{this.isSubmitting.set(!1)}}})}redirectToForgotPassword(e){return h(this,null,function*(){yield this.router.navigate(["/auth/esqueci-minha-senha"],{state:x(b({},e),{email:this.getEmailFromQuery()})})})}getEmailFromQuery(){return this.route.snapshot.queryParamMap.get("email")?.trim()??""}extractErrorCode(e){return B.isFirebaseException(e)&&typeof e.code=="string"?e.code:!e||typeof e!="object"?null:"code"in e&&typeof e.code=="string"?e.code:!("error"in e)||!e.error||typeof e.error!="object"?null:"code"in e.error&&typeof e.error.code=="string"?e.error.code:null}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=T({type:t,selectors:[["app-auth-change-password"]],decls:11,vars:6,consts:[[1,"change-password-container"],[1,"change-password-header"],["type","full",3,"height"],["variant","elevated-flat",1,"change-password-card"],[1,"change-password-card__content"],["variant","heading-lg","color","default",1,"change-password-card__title"],[1,"change-password-form",3,"formGroup"],["size","md",3,"active"],[1,"change-password-form",3,"ngSubmit","formGroup"],[1,"form-field","form-field--password"],["formControlName","password",3,"requireConfirmation","label","placeholder","errorMessage","i18n"],[1,"change-password-form__buttons"],["type","submit","variant","primary",3,"fullWidth","loading","disabled"]],template:function(i,n){i&1&&(m(0,"vds-auth-layout")(1,"div",0)(2,"header",1),f(3,"vds-logo",2),a(),m(4,"vds-card",3)(5,"vds-card-content",4)(6,"vds-text",5),v(7),l(8,"translate"),a(),S(9,re,9,17,"form",6),a(),S(10,ne,1,1,"vds-container-loading",7),a()()()),i&2&&(r(3),d("height",32),r(4),_(" ",p(8,4,"AUTH.RESET_PASSWORD.TITLE")," "),r(2),w(n.codeState()==="valid"?9:-1),r(),w(n.codeState()==="loading"||n.isSubmitting()?10:-1))},dependencies:[N,I,D,L,U,H,q,G,oe,X,Y,ee,te,$,Q,Z],styles:['@charset "UTF-8";[_ngcontent-%COMP%]:root{--001: #fefefe;--002: #f1f3f5}.theme-dark[_ngcontent-%COMP%]{--001: #16191e;--002: #22262e}[_ngcontent-%COMP%]:root{--elevation-low-bottom: 0 8px 12px 0 rgba(0, 0, 0, .08);--elevation-low-above: 0 -8px 12px 0 rgba(0, 0, 0, .08);--elevation-low-left: -8px 0 12px 0 rgba(0, 0, 0, .08);--elevation-low-right: 8px 0 12px 0 rgba(0, 0, 0, .08);--elevation-high-bottom: 0 12px 40px 0 rgba(0, 0, 0, .12);--elevation-high-above: 0 -12px 40px 0 rgba(0, 0, 0, .12);--elevation-high-left: -12px 0 40px 0 rgba(0, 0, 0, .12);--elevation-high-right: 12px 0 40px 0 rgba(0, 0, 0, .12)}[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%}.change-password-container[_ngcontent-%COMP%]{box-sizing:border-box;display:flex;flex-direction:column;gap:1.5rem;width:100%;max-width:540px;margin:0 auto;padding-inline:1.25rem;padding-top:calc(1.5rem + env(safe-area-inset-top));padding-bottom:env(safe-area-inset-bottom,0px)}.change-password-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:100%;flex-shrink:0}.change-password-card[_ngcontent-%COMP%]{width:100%;position:relative}.change-password-card__content[_ngcontent-%COMP%]{padding:1.5rem 1.5rem 1.5rem 1.25rem}.change-password-card__title[_ngcontent-%COMP%]{display:block;margin-bottom:1.5rem}.change-password-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-field[_ngcontent-%COMP%]{display:flex;flex-direction:column}.change-password-form__buttons[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}@media (min-width: 46.5em){[_nghost-%COMP%]{flex:1;height:100%;min-height:100%}.change-password-container[_ngcontent-%COMP%]{flex:1;min-height:100%;justify-content:center;
1padding-bottom:calc(2rem + env(safe-area-inset-bottom))}.change-password-card[_ngcontent-%COMP%]{margin-top:0;margin-bottom:0}.change-password-card__content[_ngcontent-%COMP%]{padding:3rem 3rem 1.25rem}}@media (min-width: 46.5em) and (max-width: 59.99875em){.change-password-container[_ngcontent-%COMP%]{padding-inline:1.5rem}}@media (min-width: 60em){.change-password-container[_ngcontent-%COMP%]{padding-inline:0}}'],changeDetection:0});let o=t;return o})();export{Ae as ChangePasswordComponent};
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.