"use strict";(self.webpackChunk_bitwarden_web_vault=self.webpackChunk_bitwarden_web_vault||[]).push([[825],{33825:(e,t,n)=>{n.r(t),n.d(t,{AcceptEmergencyComponent:()=>w});var i=n(80885),c=n(25065),s=n(9413),r=n(80755),a=n(56111),o=n(89459),u=n(37115),d=n(50700),l=n(68455),p=n(52981),m=n(56898),h=n(58806),y=n(88016),g=function(e,t,n,i){return new(n||(n=Promise))((function(c,s){function r(e){try{o(i.next(e))}catch(t){s(t)}}function a(e){try{o(i.throw(e))}catch(t){s(t)}}function o(e){var t;e.done?c(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}o((i=i.apply(e,t||[])).next())}))};const f=e=>({email:e});function v(e,t){1&e&&(a.j41(0,"div",2)(1,"div")(2,"p",3),a.nrm(3,"i",4),a.nI1(4,"i18n"),a.j41(5,"span",5),a.EFF(6),a.nI1(7,"i18n"),a.k0s()()()()),2&e&&(a.R7$(3),a.FS9("title",a.bMT(4,2,"loading")),a.R7$(3),a.JRh(a.bMT(7,4,"loading")))}function b(e,t){if(1&e){const e=a.RV6();a.j41(0,"div")(1,"p",6),a.EFF(2),a.k0s(),a.j41(3,"p",7),a.EFF(4),a.nI1(5,"i18n"),a.k0s(),a.nrm(6,"hr"),a.j41(7,"div",8)(8,"a",9),a.EFF(9),a.nI1(10,"i18n"),a.k0s(),a.j41(11,"button",10),a.bIt("click",(function(){a.eBV(e);const t=a.XpG();return a.Njj(t.register())})),a.EFF(12),a.nI1(13,"i18n"),a.k0s()()()}if(2&e){const e=a.XpG();a.R7$(2),a.SpI(" ",e.name," "),a.R7$(2),a.JRh(a.bMT(5,7,"acceptEmergencyAccess")),a.R7$(4),a.Y8G("queryParams",a.eq3(13,f,e.email))("block",!0),a.R7$(),a.SpI(" ",a.bMT(10,9,"logIn")," "),a.R7$(2),a.Y8G("block",!0),a.R7$(),a.SpI(" ",a.bMT(13,11,"createAccount")," ")}}class w extends i.X{constructor(e,t,n,i,c,s){super(e,t,n,i,c),this.emergencyAccessService=s,this.requiredParameters=["id","name","email","token"],this.failedShortMessage="emergencyInviteAcceptFailedShort",this.failedMessage="emergencyInviteAcceptFailed"}authedHandler(e){return g(this,void 0,void 0,(function*(){this.actionPromise=this.emergencyAccessService.accept(e.id,e.token),yield this.actionPromise,this.platformUtilService.showToast("success",this.i18nService.t("inviteAccepted"),this.i18nService.t("emergencyInviteAcceptedDesc"),{timeout:1e4}),this.router.navigate(["/vault"])}))}unauthedHandler(e){return g(this,void 0,void 0,(function*(){this.name=e.name,null!=this.name&&(this.name=this.name.replace(/\+/g," ")),e.id&&(this.emergencyAccessId=e.id),e.token&&(this.acceptEmergencyAccessInviteToken=e.token)}))}register(){return g(this,void 0,void 0,(function*(){yield this.router.navigate(["/finish-signup"],{queryParams:{email:this.email,acceptEmergencyAccessInviteToken:this.acceptEmergencyAccessInviteToken,emergencyAccessId:this.emergencyAccessId}})}))}}w.ɵfac=function(e){return new(e||w)(a.rXU(o.Ix),a.rXU(u.y),a.rXU(d.W),a.rXU(o.nX),a.rXU(l.u),a.rXU(r.p))},w.ɵcmp=a.VBU({type:w,selectors:[["ng-component"]],standalone:!0,features:[a.Vt3,a.aNF],decls:2,vars:2,consts:[["class","tw-mt-5 tw-flex tw-justify-center",4,"ngIf"],[4,"ngIf"],[1,"tw-mt-5","tw-flex","tw-justify-center"],[1,"tw-text-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","tw-text-muted",3,"title"],[1,"tw-sr-only"],["bitTypography","body1",1,"tw-text-center"],["bitTypography","body1"],[1,"tw-flex","tw-gap-2"],["bitButton","","buttonType","primary","routerLink","/login",3,"queryParams","block"],["type","button","bitButton","","buttonType","primary",3,"click","block"]],template:function(e,t){1&e&&a.DNE(0,v,8,6,"div",0)(1,b,14,15,"div",1),2&e&&(a.Y8G("ngIf",t.loading),a.R7$(),a.Y8G("ngIf",!t.loading&&!t.authed))},dependencies:[c.G,p.bT,o.Wk,m.Q,h.r,y.$,s.S],encapsulation:2})}}]);
//# sourceMappingURL=825.276fa417780f8f6d159f.js.map