"use strict";(self.webpackChunk_bitwarden_web_vault=self.webpackChunk_bitwarden_web_vault||[]).push([[825],{33825:(e,t,n)=>{n.d(t,{AcceptEmergencyComponent:()=>I});var i=n(80885),c=n(25065),s=n(9413),r=n(80755),a=n(74208),o=n(33812),u=n(23649),d=n(6056),l=n(37115),p=n(50700),m=n(68455),h=n(77468),y=n(56898),g=n(58806),f=n(88016),v=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 b=e=>({email:e});function w(e,t){1&e&&(o.j41(0,"div",2)(1,"div")(2,"p",3),o.nrm(3,"i",4),o.nI1(4,"i18n"),o.j41(5,"span",5),o.EFF(6),o.nI1(7,"i18n"),o.k0s()()()()),2&e&&(o.R7$(3),o.Y8G("title",o.mNQ(o.bMT(4,3,"loading"))),o.R7$(3),o.JRh(o.bMT(7,5,"loading")))}function k(e,t){if(1&e){const e=o.RV6();o.j41(0,"div")(1,"p",6),o.EFF(2),o.k0s(),o.j41(3,"p",7),o.EFF(4),o.nI1(5,"i18n"),o.k0s(),o.nrm(6,"hr"),o.j41(7,"div",8)(8,"a",9),o.EFF(9),o.nI1(10,"i18n"),o.k0s(),o.j41(11,"button",10),o.bIt("click",function(){a.eBV(e);const t=o.XpG();return a.Njj(t.register())}),o.EFF(12),o.nI1(13,"i18n"),o.k0s()()()}if(2&e){const e=o.XpG();o.R7$(2),o.SpI(" ",e.name," "),o.R7$(2),o.JRh(o.bMT(5,7,"acceptEmergencyAccess")),o.R7$(4),o.Y8G("queryParams",o.eq3(13,b,e.email))("block",!0),o.R7$(),o.SpI(" ",o.bMT(10,9,"logIn")," "),o.R7$(2),o.Y8G("block",!0),o.R7$(),o.SpI(" ",o.bMT(13,11,"createAccount")," ")}}class I 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 v(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 v(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 v(this,void 0,void 0,function*(){yield this.router.navigate(["/finish-signup"],{queryParams:{email:this.email,acceptEmergencyAccessInviteToken:this.acceptEmergencyAccessInviteToken,emergencyAccessId:this.emergencyAccessId}})})}}I.ɵfac=function(e){return new(e||I)(o.rXU(u.Ix),o.rXU(l.y),o.rXU(p.W),o.rXU(u.nX),o.rXU(m.u),o.rXU(r.p))},I.ɵcmp=o.VBU({type:I,selectors:[["ng-component"]],features:[o.Vt3],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&&o.DNE(0,w,8,7,"div",0)(1,k,14,15,"div",1),2&e&&(o.Y8G("ngIf",t.loading),o.R7$(),o.Y8G("ngIf",!t.loading&&!t.authed))},dependencies:[c.G,h.bT,d.Wk,y.Q,g.r,s.S,f.$],encapsulation:2})}}]);
//# sourceMappingURL=825.acb40a4bcb87700046f9.js.map