diff --git a/404.html b/404.html index eba36375..6cf5e363 100644 --- a/404.html +++ b/404.html @@ -1,50 +1,52 @@ -
- - - + + + + - - - + + - - - - - + + + + + -Sorry, but the page you were looking for could not be found.
-
-
-
-
-
You can return to the web vault, check our status page - or contact us.
-Sorry, but the page you were looking for could not be found.
+
+
+
+
+
+ You can return to the web vault, check our + status page or + contact us. +
+"+this.i18nService.t("encExportKeyWarningDesc")+"
"+this.i18nService.t("encExportAccountWarningDesc"),this.i18nService.t("confirmVaultExport"),this.i18nService.t("exportVault"),this.i18nService.t("cancel"),"warning",!0):yield this.platformUtilsService.showDialog(this.i18nService.t("exportWarningDesc"),this.i18nService.t("confirmVaultExport"),this.i18nService.t("exportVault"),this.i18nService.t("cancel"),"warning")}))}saved(){this.onSaved.emit()}getExportData(){return this.exportService.getExport(this.format)}getFileName(e){let t=this.format;return"encrypted_json"===this.format&&(e=null==e?"encrypted":"encrypted_"+e,t="json"),this.exportService.getFileName(e,t)}collectEvent(){return i(this,void 0,void 0,(function*(){yield this.eventService.collect(o.EventType.User_ClientExportedVault)}))}get format(){return this.exportForm.get("format").value}downloadFile(e){const t=this.getFileName();this.platformUtilsService.saveFile(this.win,e,{type:"text/plain"},t)}}t.ExportComponent=g,g.ɵfac=function(e){return new(e||g)(s.ɵɵdirectiveInject(l.CryptoService),s.ɵɵdirectiveInject(c.I18nService),s.ɵɵdirectiveInject(d.PlatformUtilsService),s.ɵɵdirectiveInject(p.ExportService),s.ɵɵdirectiveInject(u.EventService),s.ɵɵdirectiveInject(m.PolicyService),s.ɵɵdirectiveInject(Window),s.ɵɵdirectiveInject(h.LogService),s.ɵɵdirectiveInject(v.UserVerificationService),s.ɵɵdirectiveInject(f.FormBuilder))},g.ɵdir=s.ɵɵdefineDirective({type:g,outputs:{onSaved:"onSaved"}})},64970:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.FolderAddEditComponent=void 0;const r=n(32621),o=(n(4349),n(40349),n(70143),n(99954),n(50044)),a=n(32621),s=n(4349),l=n(40349),c=n(99954),d=n(70143);class p{constructor(e,t,n,i){this.folderService=e,this.i18nService=t,this.platformUtilsService=n,this.logService=i,this.onSavedFolder=new r.EventEmitter,this.onDeletedFolder=new r.EventEmitter,this.editMode=!1,this.folder=new o.FolderView}ngOnInit(){return i(this,void 0,void 0,(function*(){yield this.init()}))}submit(){return i(this,void 0,void 0,(function*(){if(null==this.folder.name||""===this.folder.name)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nameRequired")),!1;try{const e=yield this.folderService.encrypt(this.folder);return this.formPromise=this.folderService.saveWithServer(e),yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t(this.editMode?"editedFolder":"addedFolder")),this.onSavedFolder.emit(this.folder),!0}catch(e){this.logService.error(e)}return!1}))}delete(){return i(this,void 0,void 0,(function*(){if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("deleteFolderConfirmation"),this.i18nService.t("deleteFolder"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return!1;try{this.deletePromise=this.folderService.deleteWithServer(this.folder.id),yield this.deletePromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedFolder")),this.onDeletedFolder.emit(this.folder)}catch(e){this.logService.error(e)}return!0}))}init(){return i(this,void 0,void 0,(function*(){if(this.editMode=null!=this.folderId,this.editMode){this.editMode=!0,this.title=this.i18nService.t("editFolder");const e=yield this.folderService.get(this.folderId);this.folder=yield e.decrypt()}else this.title=this.i18nService.t("addFolder")}))}}t.FolderAddEditComponent=p,p.ɵfac=function(e){return new(e||p)(a.ɵɵdirectiveInject(s.FolderService),a.ɵɵdirectiveInject(l.I18nService),a.ɵɵdirectiveInject(c.PlatformUtilsService),a.ɵɵdirectiveInject(d.LogService))},p.ɵdir=a.ɵɵdefineDirective({type:p,inputs:{folderId:"folderId"},outputs:{onSavedFolder:"onSavedFolder",onDeletedFolder:"onDeletedFolder"}})},43556:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.GroupingsComponent=void 0;const r=n(32621),o=n(23635),a=(n(69050),n(4349),n(77243),n(32621)),s=n(69050),l=n(4349),c=n(77243);class d{constructor(e,t,n){this.collectionService=e,this.folderService=t,this.stateService=n,this.showFolders=!0,this.showCollections=!0,this.showFavorites=!0,this.showTrash=!0,this.onAllClicked=new r.EventEmitter,this.onFavoritesClicked=new r.EventEmitter,this.onTrashClicked=new r.EventEmitter,this.onCipherTypeClicked=new r.EventEmitter,this.onFolderClicked=new r.EventEmitter,this.onAddFolder=new r.EventEmitter,this.onEditFolder=new r.EventEmitter,this.onCollectionClicked=new r.EventEmitter,this.loaded=!1,this.cipherType=o.CipherType,this.selectedAll=!1,this.selectedFavorites=!1,this.selectedTrash=!1,this.selectedType=null,this.selectedFolder=!1,this.selectedFolderId=null,this.selectedCollectionId=null}load(e=!0){return i(this,void 0,void 0,(function*(){const t=yield this.stateService.getCollapsedGroupings();this.collapsedGroupings=null==t?new Set:new Set(t),yield this.loadFolders(),yield this.loadCollections(),e&&(this.loaded=!0)}))}loadCollections(e){return i(this,void 0,void 0,(function*(){if(!this.showCollections)return;const t=yield this.collectionService.getAllDecrypted();this.collections=null!=e?t.filter((t=>t.organizationId===e)):t,this.nestedCollections=yield this.collectionService.getAllNested(this.collections)}))}loadFolders(){return i(this,void 0,void 0,(function*(){this.showFolders&&(this.folders=yield this.folderService.getAllDecrypted(),this.nestedFolders=yield this.folderService.getAllNested())}))}selectAll(){this.clearSelections(),this.selectedAll=!0,this.onAllClicked.emit()}selectFavorites(){this.clearSelections(),this.selectedFavorites=!0,this.onFavoritesClicked.emit()}selectTrash(){this.clearSelections(),this.selectedTrash=!0,this.onTrashClicked.emit()}selectType(e){this.clearSelections(),this.selectedType=e,this.onCipherTypeClicked.emit(e)}selectFolder(e){this.clearSelections(),this.selectedFolder=!0,this.selectedFolderId=e.id,this.onFolderClicked.emit(e)}addFolder(){this.onAddFolder.emit()}editFolder(e){this.onEditFolder.emit(e)}selectCollection(e){this.clearSelections(),this.selectedCollectionId=e.id,this.onCollectionClicked.emit(e)}clearSelections(){this.selectedAll=!1,this.selectedFavorites=!1,this.selectedTrash=!1,this.selectedType=null,this.selectedFolder=!1,this.selectedFolderId=null,this.selectedCollectionId=null}collapse(e,t=""){return i(this,void 0,void 0,(function*(){if(null==e.id)return;const n=t+e.id;this.isCollapsed(e,t)?this.collapsedGroupings.delete(n):this.collapsedGroupings.add(n),yield this.stateService.setCollapsedGroupings(this.collapsedGroupings)}))}isCollapsed(e,t=""){return this.collapsedGroupings.has(t+e.id)}}t.GroupingsComponent=d,d.ɵfac=function(e){return new(e||d)(a.ɵɵdirectiveInject(s.CollectionService),a.ɵɵdirectiveInject(l.FolderService),a.ɵɵdirectiveInject(c.StateService))},d.ɵdir=a.ɵɵdefineDirective({type:d,inputs:{showFolders:"showFolders",showCollections:"showCollections",showFavorites:"showFavorites",showTrash:"showTrash"},outputs:{onAllClicked:"onAllClicked",onFavoritesClicked:"onFavoritesClicked",onTrashClicked:"onTrashClicked",onCipherTypeClicked:"onCipherTypeClicked",onFolderClicked:"onFolderClicked",onAddFolder:"onAddFolder",onEditFolder:"onEditFolder",onCollectionClicked:"onCollectionClicked"}})},38830:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.HintComponent=void 0;const r=n(68591);t.HintComponent=class{constructor(e,t,n,i,r){this.router=e,this.i18nService=t,this.apiService=n,this.platformUtilsService=i,this.logService=r,this.email="",this.successRoute="login"}submit(){return i(this,void 0,void 0,(function*(){if(null!=this.email&&""!==this.email)if(-1!==this.email.indexOf("@"))try{this.formPromise=this.apiService.postPasswordHint(new r.PasswordHintRequest(this.email)),yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("masterPassSent")),null!=this.onSuccessfulSubmit?this.onSuccessfulSubmit():null!=this.router&&this.router.navigate([this.successRoute])}catch(e){this.logService.error(e)}else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidEmail"));else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("emailRequired"))}))}}},52665:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.IconComponent=void 0;const r=n(23635),o=(n(52556),n(57997),n(77243),n(70829)),a=n(32621),s=n(57997),l=n(77243),c=n(57490),d=n(50601);function p(e,t){if(1&e&&a.ɵɵelement(0,"img",3),2&e){const e=a.ɵɵnextContext();a.ɵɵpropertyInterpolate("appFallbackSrc",e.fallbackImage),a.ɵɵproperty("src",e.image,a.ɵɵsanitizeUrl)}}function u(e,t){if(1&e&&a.ɵɵelement(0,"i"),2&e){const e=a.ɵɵnextContext();a.ɵɵclassMapInterpolate1("bwi bwi-fw bwi-lg ",e.icon,"")}}const m={Visa:"card-visa",Mastercard:"card-mastercard",Amex:"card-amex",Discover:"card-discover","Diners Club":"card-diners-club",JCB:"card-jcb",Maestro:"card-maestro",UnionPay:"card-union-pay"};class h{constructor(e,t){this.stateService=t,this.iconsUrl=e.getIconsUrl()}ngOnChanges(){return i(this,void 0,void 0,(function*(){this.image=null,this.fallbackImage=null,this.imageEnabled=!(yield this.stateService.getDisableFavicon()),this.load()}))}load(){switch(this.cipher.type){case r.CipherType.Login:this.icon="bwi-globe",this.setLoginIcon();break;case r.CipherType.SecureNote:this.icon="bwi-sticky-note";break;case r.CipherType.Card:this.icon="bwi-credit-card",this.setCardIcon();break;case r.CipherType.Identity:this.icon="bwi-id-card"}}setLoginIcon(){if(this.cipher.login.uri){let t=this.cipher.login.uri,n=!1;if(0===t.indexOf("androidapp://")?(this.icon="bwi-android",this.image=null):0===t.indexOf("iosapp://")?(this.icon="bwi-apple",this.image=null):this.imageEnabled&&-1===t.indexOf("://")&&t.indexOf(".")>-1?(t="http://"+t,n=!0):this.imageEnabled&&(n=0===t.indexOf("http")&&t.indexOf(".")>-1),this.imageEnabled&&n)try{this.image=this.iconsUrl+"/"+o.Utils.getHostname(t)+"/icon.png",this.fallbackImage="images/bwi-globe.png"}catch(e){}}else this.image=null}setCardIcon(){const e=this.cipher.card.brand;this.imageEnabled&&e in m&&(this.icon="credit-card-icon "+m[e])}}t.IconComponent=h,h.ɵfac=function(e){return new(e||h)(a.ɵɵdirectiveInject(s.EnvironmentService),a.ɵɵdirectiveInject(l.StateService))},h.ɵcmp=a.ɵɵdefineComponent({type:h,selectors:[["app-vault-icon"]],inputs:{cipher:"cipher"},features:[a.ɵɵNgOnChangesFeature],decls:7,vars:2,consts:[["aria-hidden","true",1,"icon"],["alt","",3,"src","appFallbackSrc",4,"ngIf"],[3,"class",4,"ngIf"],["alt","",3,"src","appFallbackSrc"]],template:function(e,t){1&e&&(a.ɵɵelementStart(0,"div",0),a.ɵɵtext(1,"\n "),a.ɵɵtemplate(2,p,1,2,"img",1),a.ɵɵtext(3,"\n "),a.ɵɵtemplate(4,u,1,3,"i",2),a.ɵɵtext(5,"\n"),a.ɵɵelementEnd(),a.ɵɵtext(6,"\n")),2&e&&(a.ɵɵadvance(2),a.ɵɵproperty("ngIf",t.imageEnabled&&t.image),a.ɵɵadvance(2),a.ɵɵproperty("ngIf",!t.imageEnabled||!t.image))},directives:[c.NgIf,d.FallbackSrcDirective],encapsulation:2})},10940:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.LockComponent=void 0;n(32621),n(68012);const r=n(53232),o=(n(91092),n(82058),n(57997),n(40349),n(34445),n(70143),n(36424),n(99954),n(77243),n(88332),n(66607)),a=n(44980),s=n(70829),l=n(6317),c=n(65845),d=n(32621),p=n(68012),u=n(40349),m=n(99954),h=n(36424),v=n(82058),f=n(88332),g=n(57997),y=n(77243),x=n(91092),S=n(70143),b=n(34445);class w{constructor(e,t,n,i,r,o,a,s,l,c,d,p){this.router=e,this.i18nService=t,this.platformUtilsService=n,this.messagingService=i,this.cryptoService=r,this.vaultTimeoutService=o,this.environmentService=a,this.stateService=s,this.apiService=l,this.logService=c,this.keyConnectorService=d,this.ngZone=p,this.masterPassword="",this.pin="",this.showPassword=!1,this.pinLock=!1,this.webVaultHostname="",this.successRoute="vault",this.invalidPinAttempts=0}ngOnInit(){return i(this,void 0,void 0,(function*(){this.stateService.activeAccount.subscribe((e=>i(this,void 0,void 0,(function*(){yield this.load()}))))}))}submit(){return i(this,void 0,void 0,(function*(){if(this.pinLock&&(null==this.pin||""===this.pin))return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("pinRequired"));if(!this.pinLock&&(null==this.masterPassword||""===this.masterPassword))return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPassRequired"));const e=yield this.stateService.getKdfType(),t=yield this.stateService.getKdfIterations();if(this.pinLock){let i=!0;try{if(this.pinSet[0]){const n=yield this.cryptoService.makeKeyFromPin(this.pin,this.email,e,t,yield this.stateService.getDecryptedPinProtected()),r=yield this.cryptoService.getEncKey(n),a=yield this.stateService.getProtectedPin();i=(yield this.cryptoService.decryptToUtf8(new o.EncString(a),r))!==this.pin,i||(yield this.setKeyAndContinue(n))}else{const n=yield this.cryptoService.makeKeyFromPin(this.pin,this.email,e,t);i=!1,yield this.setKeyAndContinue(n)}}catch(n){i=!0}if(i){if(this.invalidPinAttempts++,this.invalidPinAttempts>=5)return void this.messagingService.send("logout");this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidPin"))}}else{const n=yield this.cryptoService.makeKey(this.masterPassword,this.email,e,t);let r=!1;if(null!=(yield this.cryptoService.getKeyHash()))r=yield this.cryptoService.compareAndUpdateKeyHash(this.masterPassword,n);else{const e=new a.SecretVerificationRequest,t=yield this.cryptoService.hashPassword(this.masterPassword,n,l.HashPurpose.ServerAuthorization);e.masterPasswordHash=t;try{this.formPromise=this.apiService.postAccountVerifyPassword(e),yield this.formPromise,r=!0;const t=yield this.cryptoService.hashPassword(this.masterPassword,n,l.HashPurpose.LocalAuthorization);yield this.cryptoService.setKeyHash(t)}catch(i){this.logService.error(i)}}if(r){if(this.pinSet[0]){const i=yield this.stateService.getProtectedPin(),r=yield this.cryptoService.getEncKey(n),a=yield this.cryptoService.decryptToUtf8(new o.EncString(i),r),s=yield this.cryptoService.makePinKey(a,this.email,e,t);yield this.stateService.setDecryptedPinProtected(yield this.cryptoService.encrypt(n.key,s))}yield this.setKeyAndContinue(n)}else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidMasterPassword"))}}))}logOut(){return i(this,void 0,void 0,(function*(){(yield this.platformUtilsService.showDialog(this.i18nService.t("logOutConfirmation"),this.i18nService.t("logOut"),this.i18nService.t("logOut"),this.i18nService.t("cancel")))&&this.messagingService.send("logout")}))}unlockBiometric(){return i(this,void 0,void 0,(function*(){if(!this.biometricLock)return;const e=null!=(yield this.cryptoService.getKey(c.KeySuffixOptions.Biometric));return e&&(yield this.doContinue()),e}))}togglePassword(){this.showPassword=!this.showPassword;const e=document.getElementById(this.pinLock?"pin":"masterPassword");this.ngZone.isStable?e.focus():this.ngZone.onStable.pipe(r.take(1)).subscribe((()=>e.focus()))}setKeyAndContinue(e){return i(this,void 0,void 0,(function*(){yield this.cryptoService.setKey(e),yield this.doContinue()}))}doContinue(){return i(this,void 0,void 0,(function*(){yield this.stateService.setBiometricLocked(!1),yield this.stateService.setEverBeenUnlocked(!0);const e=yield this.stateService.getDisableFavicon();yield this.stateService.setDisableFavicon(!!e),this.messagingService.send("unlocked"),null!=this.onSuccessfulSubmit?yield this.onSuccessfulSubmit():null!=this.router&&this.router.navigate([this.successRoute])}))}load(){return i(this,void 0,void 0,(function*(){this.pinSet=yield this.vaultTimeoutService.isPinLockSet(),this.pinLock=this.pinSet[0]&&null!=(yield this.stateService.getDecryptedPinProtected())||this.pinSet[1],this.supportsBiometric=yield this.platformUtilsService.supportsBiometric(),this.biometricLock=(yield this.vaultTimeoutService.isBiometricLockSet())&&((yield this.cryptoService.hasKeyStored(c.KeySuffixOptions.Biometric))||!this.platformUtilsService.supportsSecureStorage()),this.biometricText=yield this.stateService.getBiometricText(),this.email=yield this.stateService.getEmail();const e=yield this.keyConnectorService.getUsesKeyConnector();this.hideInput=e&&!this.pinLock,!e||this.biometricLock||this.pinLock||(yield this.vaultTimeoutService.logOut());const t=this.environmentService.getWebVaultUrl(),n="https://vault.bitwarden.com"===t?"https://bitwarden.com":t;this.webVaultHostname=s.Utils.getHostname(n)}))}}t.LockComponent=w,w.ɵfac=function(e){return new(e||w)(d.ɵɵdirectiveInject(p.Router),d.ɵɵdirectiveInject(u.I18nService),d.ɵɵdirectiveInject(m.PlatformUtilsService),d.ɵɵdirectiveInject(h.MessagingService),d.ɵɵdirectiveInject(v.CryptoService),d.ɵɵdirectiveInject(f.VaultTimeoutService),d.ɵɵdirectiveInject(g.EnvironmentService),d.ɵɵdirectiveInject(y.StateService),d.ɵɵdirectiveInject(x.ApiService),d.ɵɵdirectiveInject(S.LogService),d.ɵɵdirectiveInject(b.KeyConnectorService),d.ɵɵdirectiveInject(d.NgZone))},w.ɵdir=d.ɵɵdefineDirective({type:w})},78490:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.LoginComponent=void 0;n(32621),n(68012);const r=n(53232),o=(n(26451),n(39229),n(57997),n(40349),n(70143),n(86193),n(99954),n(77243),n(70829)),a=n(33421),s=n(32621),l=n(26451),c=n(68012),d=n(99954),p=n(40349),u=n(77243),m=n(57997),h=n(86193),v=n(39229),f=n(70143);class g extends a.CaptchaProtectedComponent{constructor(e,t,n,i,r,o,a,s,l,c){super(o,i,n),this.authService=e,this.router=t,this.stateService=r,this.passwordGenerationService=a,this.cryptoFunctionService=s,this.logService=l,this.ngZone=c,this.email="",this.rememberEmail=!0,this.masterPassword="",this.showPassword=!1,this.twoFactorRoute="2fa",this.successRoute="vault",this.forcePasswordResetRoute="update-temp-password",this.alwaysRememberEmail=!1}ngOnInit(){return i(this,void 0,void 0,(function*(){null!=this.email&&""!==this.email||(this.email=yield this.stateService.getRememberedEmail(),null==this.email&&(this.email="")),this.alwaysRememberEmail||(this.rememberEmail=null!=(yield this.stateService.getRememberedEmail())),o.Utils.isBrowser&&!o.Utils.isNode&&this.focusInput()}))}submit(){return i(this,void 0,void 0,(function*(){if(yield this.setupCaptcha(),null!=this.email&&""!==this.email)if(-1!==this.email.indexOf("@"))if(null!=this.masterPassword&&""!==this.masterPassword)try{this.formPromise=this.authService.logIn(this.email,this.masterPassword,this.captchaToken);const e=yield this.formPromise;if(this.rememberEmail||this.alwaysRememberEmail?yield this.stateService.setRememberedEmail(this.email):yield this.stateService.setRememberedEmail(null),this.handleCaptchaRequired(e))return;if(e.twoFactor)null!=this.onSuccessfulLoginTwoFactorNavigate?this.onSuccessfulLoginTwoFactorNavigate():this.router.navigate([this.twoFactorRoute]);else if(e.forcePasswordReset)null!=this.onSuccessfulLoginForceResetNavigate?this.onSuccessfulLoginForceResetNavigate():this.router.navigate([this.forcePasswordResetRoute]);else{const e=yield this.stateService.getDisableFavicon();yield this.stateService.setDisableFavicon(!!e),null!=this.onSuccessfulLogin&&this.onSuccessfulLogin(),null!=this.onSuccessfulLoginNavigate?this.onSuccessfulLoginNavigate():this.router.navigate([this.successRoute])}}catch(e){this.logService.error(e)}else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPassRequired"));else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidEmail"));else this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("emailRequired"))}))}togglePassword(){this.showPassword=!this.showPassword,this.ngZone.isStable?document.getElementById("masterPassword").focus():this.ngZone.onStable.pipe(r.take(1)).subscribe((()=>document.getElementById("masterPassword").focus()))}launchSsoBrowser(e,t){return i(this,void 0,void 0,(function*(){const n={type:"password",length:64,uppercase:!0,lowercase:!0,numbers:!0,special:!1},i=yield this.passwordGenerationService.generatePassword(n),r=yield this.passwordGenerationService.generatePassword(n),a=yield this.cryptoFunctionService.hash(r,"sha256"),s=o.Utils.fromBufferToUrlB64(a);yield this.stateService.setSsoState(i),yield this.stateService.setSsoCodeVerifier(r);const l=this.environmentService.getWebVaultUrl();this.platformUtilsService.launchUri(l+"/#/sso?clientId="+e+"&redirectUri="+encodeURIComponent(t)+"&state="+i+"&codeChallenge="+s)}))}focusInput(){document.getElementById(null==this.email||""===this.email?"email":"masterPassword").focus()}}t.LoginComponent=g,g.ɵfac=function(e){return new(e||g)(s.ɵɵdirectiveInject(l.AuthService),s.ɵɵdirectiveInject(c.Router),s.ɵɵdirectiveInject(d.PlatformUtilsService),s.ɵɵdirectiveInject(p.I18nService),s.ɵɵdirectiveInject(u.StateService),s.ɵɵdirectiveInject(m.EnvironmentService),s.ɵɵdirectiveInject(h.PasswordGenerationService),s.ɵɵdirectiveInject(v.CryptoFunctionService),s.ɵɵdirectiveInject(f.LogService),s.ɵɵdirectiveInject(s.NgZone))},g.ɵdir=s.ɵɵdefineDirective({type:g,inputs:{email:"email",rememberEmail:"rememberEmail"},features:[s.ɵɵInheritDefinitionFeature]})},20443:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DynamicModalComponent=void 0;const i=n(32621),r=(n(46915),n(29546),n(99806),n(32621)),o=n(29546),a=n(46915),s=n(99806),l=["modalContent"];function c(e,t){}class d{constructor(e,t,n,i,r){this.modalService=e,this.cd=t,this.el=n,this.focusTrapFactory=i,this.modalRef=r}ngAfterViewInit(){this.loadChildComponent(this.childComponentType),null!=this.setComponentParameters&&this.setComponentParameters(this.componentRef.instance),this.cd.detectChanges(),this.modalRef.created(this.el.nativeElement),this.focusTrap=this.focusTrapFactory.create(this.el.nativeElement.querySelector(".modal-dialog")),null==this.el.nativeElement.querySelector("[appAutoFocus]")&&this.focusTrap.focusFirstTabbableElementWhenReady()}loadChildComponent(e){const t=this.modalService.resolveComponentFactory(e);this.modalContentRef.clear(),this.componentRef=this.modalContentRef.createComponent(t)}ngOnDestroy(){this.componentRef&&this.componentRef.destroy(),this.focusTrap.destroy()}close(){this.modalRef.close()}getFocus(){const e=this.el.nativeElement.querySelector("[appAutoFocus]");null==e||e.focus()}}t.DynamicModalComponent=d,d.ɵfac=function(e){return new(e||d)(r.ɵɵdirectiveInject(o.ModalService),r.ɵɵdirectiveInject(r.ChangeDetectorRef),r.ɵɵdirectiveInject(r.ElementRef),r.ɵɵdirectiveInject(a.ConfigurableFocusTrapFactory),r.ɵɵdirectiveInject(s.ModalRef))},d.ɵcmp=r.ɵɵdefineComponent({type:d,selectors:[["app-modal"]],viewQuery:function(e,t){if(1&e&&r.ɵɵviewQuery(l,7,i.ViewContainerRef),2&e){let e;r.ɵɵqueryRefresh(e=r.ɵɵloadQuery())&&(t.modalContentRef=e.first)}},decls:2,vars:0,consts:[["modalContent",""]],template:function(e,t){1&e&&r.ɵɵtemplate(0,c,0,0,"ng-template",null,0,r.ɵɵtemplateRefExtractor)},encapsulation:2})},28129:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModalInjector=void 0;t.ModalInjector=class{constructor(e,t){this._parentInjector=e,this._additionalTokens=t}get(e,t,n){var i;return null!==(i=this._additionalTokens.get(e))&&void 0!==i?i:this._parentInjector.get(e,t)}}},99806:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModalRef=void 0;const i=n(59666),r=n(53232);t.ModalRef=class{constructor(){this._onCreated=new i.Subject,this._onClose=new i.Subject,this._onClosed=new i.Subject,this._onShow=new i.Subject,this._onShown=new i.Subject,this.onCreated=this._onCreated.asObservable(),this.onClose=this._onClose.asObservable(),this.onClosed=this._onClosed.asObservable(),this.onShow=this._onShow.asObservable(),this.onShown=this._onShow.asObservable()}show(){this._onShow.next()}shown(){this._onShown.next()}close(e){this.lastResult=e,this._onClose.next(e)}closed(){this._onClosed.next(this.lastResult)}created(e){this._onCreated.next(e)}onClosedPromise(){return this.onClosed.pipe(r.first()).toPromise()}}},33045:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordGeneratorHistoryComponent=void 0;n(40349),n(86193),n(99954);const r=n(32621),o=n(86193),a=n(99954),s=n(40349);class l{constructor(e,t,n,i){this.passwordGenerationService=e,this.platformUtilsService=t,this.i18nService=n,this.win=i,this.history=[]}ngOnInit(){return i(this,void 0,void 0,(function*(){this.history=yield this.passwordGenerationService.getHistory()}))}clear(){this.history=[],this.passwordGenerationService.clear()}copy(e){const t=null!=this.win?{window:this.win}:null;this.platformUtilsService.copyToClipboard(e,t),this.platformUtilsService.showToast("info",null,this.i18nService.t("valueCopied",this.i18nService.t("password")))}}t.PasswordGeneratorHistoryComponent=l,l.ɵfac=function(e){return new(e||l)(r.ɵɵdirectiveInject(o.PasswordGenerationService),r.ɵɵdirectiveInject(a.PlatformUtilsService),r.ɵɵdirectiveInject(s.I18nService),r.ɵɵdirectiveInject(Window))},l.ɵdir=r.ɵɵdefineDirective({type:l})},66326:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordGeneratorComponent=void 0;const r=n(32621),o=(n(40349),n(86193),n(99954),n(32621)),a=n(86193),s=n(99954),l=n(40349);class c{constructor(e,t,n,i){this.passwordGenerationService=e,this.platformUtilsService=t,this.i18nService=n,this.win=i,this.showSelect=!1,this.onSelected=new r.EventEmitter,this.options={},this.password="-",this.showOptions=!1,this.avoidAmbiguous=!1,this.passTypeOptions=[{name:n.t("password"),value:"password"},{name:n.t("passphrase"),value:"passphrase"}]}ngOnInit(){return i(this,void 0,void 0,(function*(){const e=yield this.passwordGenerationService.getOptions();this.options=e[0],this.enforcedPolicyOptions=e[1],this.avoidAmbiguous=!this.options.ambiguous,this.options.type="passphrase"===this.options.type?"passphrase":"password",this.password=yield this.passwordGenerationService.generatePassword(this.options),yield this.passwordGenerationService.addHistory(this.password)}))}sliderChanged(){return i(this,void 0,void 0,(function*(){this.saveOptions(!1),yield this.passwordGenerationService.addHistory(this.password)}))}sliderInput(){return i(this,void 0,void 0,(function*(){this.normalizeOptions(),this.password=yield this.passwordGenerationService.generatePassword(this.options)}))}saveOptions(e=!0){return i(this,void 0,void 0,(function*(){this.normalizeOptions(),yield this.passwordGenerationService.saveOptions(this.options),e&&(yield this.regenerate())}))}regenerate(){return i(this,void 0,void 0,(function*(){this.password=yield this.passwordGenerationService.generatePassword(this.options),yield this.passwordGenerationService.addHistory(this.password)}))}copy(){const e=null!=this.win?{window:this.win}:null;this.platformUtilsService.copyToClipboard(this.password,e),this.platformUtilsService.showToast("info",null,this.i18nService.t("valueCopied",this.i18nService.t("password")))}select(){this.onSelected.emit(this.password)}toggleOptions(){this.showOptions=!this.showOptions}normalizeOptions(){if(this.options.ambiguous=!this.avoidAmbiguous,!(this.options.uppercase||this.options.lowercase||this.options.number||this.options.special)&&(this.options.lowercase=!0,null!=this.win)){const e=this.win.document.querySelector("#lowercase");e&&(e.checked=!0)}this.passwordGenerationService.normalizeOptions(this.options,this.enforcedPolicyOptions)}}t.PasswordGeneratorComponent=c,c.ɵfac=function(e){return new(e||c)(o.ɵɵdirectiveInject(a.PasswordGenerationService),o.ɵɵdirectiveInject(s.PlatformUtilsService),o.ɵɵdirectiveInject(l.I18nService),o.ɵɵdirectiveInject(Window))},c.ɵdir=o.ɵɵdefineDirective({type:c,inputs:{showSelect:"showSelect"},outputs:{onSelected:"onSelected"}})},39200:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordRepromptComponent=void 0;n(82058),n(40349),n(99954),n(99806);const r=n(32621),o=n(99806),a=n(82058),s=n(99954),l=n(40349);class c{constructor(e,t,n,i){this.modalRef=e,this.cryptoService=t,this.platformUtilsService=n,this.i18nService=i,this.showPassword=!1,this.masterPassword=""}togglePassword(){this.showPassword=!this.showPassword}submit(){return i(this,void 0,void 0,(function*(){(yield this.cryptoService.compareAndUpdateKeyHash(this.masterPassword,null))?this.modalRef.close(!0):this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidMasterPassword"))}))}}t.PasswordRepromptComponent=c,c.ɵfac=function(e){return new(e||c)(r.ɵɵdirectiveInject(o.ModalRef),r.ɵɵdirectiveInject(a.CryptoService),r.ɵɵdirectiveInject(s.PlatformUtilsService),r.ɵɵdirectiveInject(l.I18nService))},c.ɵdir=r.ɵɵdefineDirective({type:c})},4748:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RegisterComponent=void 0;n(68012);const r=n(82822),o=n(94401),a=(n(91092),n(26451),n(82058),n(57997),n(40349),n(70143),n(86193),n(99954),n(77243),n(25847)),s=n(33421),l=n(32621),c=n(26451),d=n(68012),p=n(40349),u=n(82058),m=n(91092),h=n(77243),v=n(99954),f=n(86193),g=n(57997),y=n(70143);class x extends s.CaptchaProtectedComponent{constructor(e,t,n,i,r,o,a,s,l,c){super(l,n,a),this.authService=e,this.router=t,this.cryptoService=i,this.apiService=r,this.stateService=o,this.passwordGenerationService=s,this.logService=c,this.name="",this.email="",this.masterPassword="",this.confirmMasterPassword="",this.hint="",this.showPassword=!1,this.showTerms=!0,this.acceptPolicies=!1,this.successRoute="login",this.showTerms=!a.isSelfHost()}ngOnInit(){return i(this,void 0,void 0,(function*(){this.setupCaptcha()}))}get masterPasswordScoreWidth(){return null==this.masterPasswordScore?0:20*(this.masterPasswordScore+1)}get masterPasswordScoreColor(){switch(this.masterPasswordScore){case 4:return"success";case 3:return"primary";case 2:return"warning";default:return"danger"}}get masterPasswordScoreText(){switch(this.masterPasswordScore){case 4:return this.i18nService.t("strong");case 3:return this.i18nService.t("good");case 2:return this.i18nService.t("weak");default:return null!=this.masterPasswordScore?this.i18nService.t("weak"):null}}submit(){return i(this,void 0,void 0,(function*(){if(!this.acceptPolicies&&this.showTerms)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("acceptPoliciesError"));if(null==this.email||""===this.email)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("emailRequired"));if(-1===this.email.indexOf("@"))return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidEmail"));if(null==this.masterPassword||""===this.masterPassword)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPassRequired"));if(this.masterPassword.length<8)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPassLength"));if(this.masterPassword!==this.confirmMasterPassword)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPassDoesntMatch"));const e=this.passwordGenerationService.passwordStrength(this.masterPassword,this.getPasswordStrengthUserInput());if(null!=e&&e.score<3){if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("weakMasterPasswordDesc"),this.i18nService.t("weakMasterPassword"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return}if(this.hint===this.masterPassword)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("hintEqualsPassword"));this.name=""===this.name?null:this.name,this.email=this.email.trim().toLowerCase();const t=a.KdfType.PBKDF2_SHA256,n=this.platformUtilsService.isIE()?1e4:1e5,i=yield this.cryptoService.makeKey(this.masterPassword,this.email,t,n),s=yield this.cryptoService.makeEncKey(i),l=yield this.cryptoService.hashPassword(this.masterPassword,i),c=yield this.cryptoService.makeKeyPair(s[0]),d=new o.RegisterRequest(this.email,this.name,l,this.hint,s[1].encryptedString,t,n,this.referenceData,this.captchaToken);d.keys=new r.KeysRequest(c[0],c[1].encryptedString);const p=yield this.stateService.getOrganizationInvitation();null!=p&&null!=p.token&&null!=p.organizationUserId&&(d.token=p.token,d.organizationUserId=p.organizationUserId);try{this.formPromise=this.apiService.postRegister(d);try{yield this.formPromise}catch(u){if(this.handleCaptchaRequired(u))return;throw u}this.platformUtilsService.showToast("success",null,this.i18nService.t("newAccountCreated")),this.router.navigate([this.successRoute],{queryParams:{email:this.email}})}catch(u){this.logService.error(u)}}))}togglePassword(e){this.showPassword=!this.showPassword,document.getElementById(e?"masterPasswordRetype":"masterPassword").focus()}updatePasswordStrength(){null!=this.masterPasswordStrengthTimeout&&clearTimeout(this.masterPasswordStrengthTimeout),this.masterPasswordStrengthTimeout=setTimeout((()=>{const e=this.passwordGenerationService.passwordStrength(this.masterPassword,this.getPasswordStrengthUserInput());this.masterPasswordScore=null==e?null:e.score}),300)}getPasswordStrengthUserInput(){let e=[];const t=this.email.indexOf("@");return t>-1&&(e=e.concat(this.email.substr(0,t).trim().toLowerCase().split(/[^A-Za-z0-9]/))),null!=this.name&&""!==this.name&&(e=e.concat(this.name.trim().toLowerCase().split(" "))),e}}t.RegisterComponent=x,x.ɵfac=function(e){return new(e||x)(l.ɵɵdirectiveInject(c.AuthService),l.ɵɵdirectiveInject(d.Router),l.ɵɵdirectiveInject(p.I18nService),l.ɵɵdirectiveInject(u.CryptoService),l.ɵɵdirectiveInject(m.ApiService),l.ɵɵdirectiveInject(h.StateService),l.ɵɵdirectiveInject(v.PlatformUtilsService),l.ɵɵdirectiveInject(f.PasswordGenerationService),l.ɵɵdirectiveInject(g.EnvironmentService),l.ɵɵdirectiveInject(y.LogService))},x.ɵdir=l.ɵɵdefineDirective({type:x,features:[l.ɵɵInheritDefinitionFeature]})},44911:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RemovePasswordComponent=void 0;n(68012),n(91092),n(40349),n(34445),n(99954),n(77243),n(2173);const r=n(32621),o=n(68012),a=n(77243),s=n(91092),l=n(2173),c=n(99954),d=n(40349),p=n(34445);class u{constructor(e,t,n,i,r,o,a){this.router=e,this.stateService=t,this.apiService=n,this.syncService=i,this.platformUtilsService=r,this.i18nService=o,this.keyConnectorService=a,this.continuing=!1,this.leaving=!1,this.loading=!0}ngOnInit(){return i(this,void 0,void 0,(function*(){this.organization=yield this.keyConnectorService.getManagingOrganization(),this.email=yield this.stateService.getEmail(),yield this.syncService.fullSync(!1),this.loading=!1}))}convert(){return i(this,void 0,void 0,(function*(){this.continuing=!0,this.actionPromise=this.keyConnectorService.migrateUser();try{yield this.actionPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("removedMasterPassword")),yield this.keyConnectorService.removeConvertAccountRequired(),this.router.navigate([""])}catch(e){this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),e.message)}}))}leave(){return i(this,void 0,void 0,(function*(){if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("leaveOrganizationConfirmation"),this.organization.name,this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return!1;try{this.leaving=!0,this.actionPromise=this.apiService.postLeaveOrganization(this.organization.id).then((()=>this.syncService.fullSync(!0))),yield this.actionPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("leftOrganization")),yield this.keyConnectorService.removeConvertAccountRequired(),this.router.navigate([""])}catch(e){this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),e)}}))}}t.RemovePasswordComponent=u,u.ɵfac=function(e){return new(e||u)(r.ɵɵdirectiveInject(o.Router),r.ɵɵdirectiveInject(a.StateService),r.ɵɵdirectiveInject(s.ApiService),r.ɵɵdirectiveInject(l.SyncService),r.ɵɵdirectiveInject(c.PlatformUtilsService),r.ɵɵdirectiveInject(d.I18nService),r.ɵɵdirectiveInject(p.KeyConnectorService))},u.ɵdir=r.ɵɵdefineDirective({type:u})},54484:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AddEditComponent=void 0;n(57490);const r=n(32621),o=n(40251),a=n(49538),s=(n(57997),n(40349),n(70143),n(36424),n(99954),n(10685),n(94129),n(77243),n(26425)),l=n(24018),c=n(21801),d=n(32621),p=n(40349),u=n(99954),m=n(57997),h=n(57490),v=n(94129),f=n(36424),g=n(10685),y=n(70143),x=n(77243);class S{constructor(e,t,n,i,o,s,l,c,d){this.i18nService=e,this.platformUtilsService=t,this.environmentService=n,this.datePipe=i,this.sendService=o,this.messagingService=s,this.policyService=l,this.logService=c,this.stateService=d,this.onSavedSend=new r.EventEmitter,this.onDeletedSend=new r.EventEmitter,this.onCancelled=new r.EventEmitter,this.copyLink=!1,this.disableSend=!1,this.disableHideEmail=!1,this.showPassword=!1,this.sendType=a.SendType,this.canAccessPremium=!0,this.emailVerified=!0,this.alertShown=!1,this.showOptions=!1,this.typeOptions=[{name:e.t("sendTypeFile"),value:a.SendType.File},{name:e.t("sendTypeText"),value:a.SendType.Text}],this.sendLinkBaseUrl=this.environmentService.getSendUrl()}get link(){return null!=this.send.id&&null!=this.send.accessId?this.sendLinkBaseUrl+this.send.accessId+"/"+this.send.urlB64Key:null}get isSafari(){return this.platformUtilsService.isSafari()}get isDateTimeLocalSupported(){return!(this.platformUtilsService.isFirefox()||this.platformUtilsService.isSafari())}ngOnInit(){return i(this,void 0,void 0,(function*(){yield this.load()}))}get editMode(){return null!=this.sendId}get title(){return this.i18nService.t(this.editMode?"editSend":"createSend")}setDates(e){this.deletionDate=e.deletionDate,this.expirationDate=e.expirationDate}load(){return i(this,void 0,void 0,(function*(){if(this.disableSend=yield this.policyService.policyAppliesToUser(o.PolicyType.DisableSend),this.disableHideEmail=yield this.policyService.policyAppliesToUser(o.PolicyType.SendOptions,(e=>e.data.disableHideEmail)),this.canAccessPremium=yield this.stateService.getCanAccessPremium(),this.emailVerified=yield this.stateService.getEmailVerified(),this.canAccessPremium&&this.emailVerified||(this.type=a.SendType.Text),null==this.send)if(this.editMode){const e=yield this.loadSend();this.send=yield e.decrypt()}else this.send=new c.SendView,this.send.type=null==this.type?a.SendType.File:this.type,this.send.file=new s.SendFileView,this.send.text=new l.SendTextView,this.send.deletionDate=new Date,this.send.deletionDate.setDate(this.send.deletionDate.getDate()+7);this.hasPassword=null!=this.send.password&&""!==this.send.password.trim()}))}submit(){return i(this,void 0,void 0,(function*(){if(this.disableSend)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("sendDisabledWarning")),!1;if(null==this.send.name||""===this.send.name)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nameRequired")),!1;let e=null;if(this.send.type===a.SendType.File&&!this.editMode){const t=document.getElementById("file").files;if(null==t||0===t.length)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("selectFile"));if(e=t[0],t[0].size>524288e3)return void this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("maxFileSize"))}null!=this.password&&""===this.password.trim()&&(this.password=null),this.formPromise=this.encryptSend(e).then((e=>i(this,void 0,void 0,(function*(){const t=this.sendService.saveWithServer(e);if(yield t,null==this.send.id&&(this.send.id=e[0].id),null==this.send.accessId&&(this.send.accessId=e[0].accessId),this.onSavedSend.emit(this.send),this.copyLink&&null!=this.link){const e=yield this.copyLinkToClipboard(this.link);null==e||e?this.platformUtilsService.showToast("success",null,this.i18nService.t(this.editMode?"editedSend":"createdSend")):(yield this.platformUtilsService.showDialog(this.i18nService.t(this.editMode?"editedSend":"createdSend"),null,this.i18nService.t("ok"),null,"success",null),yield this.copyLinkToClipboard(this.link))}}))));try{return yield this.formPromise,!0}catch(t){this.logService.error(t)}return!1}))}copyLinkToClipboard(e){return i(this,void 0,void 0,(function*(){return Promise.resolve(this.platformUtilsService.copyToClipboard(e))}))}delete(){return i(this,void 0,void 0,(function*(){if(null!=this.deletePromise)return!1;if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("deleteSendConfirmation"),this.i18nService.t("deleteSend"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return!1;try{return this.deletePromise=this.sendService.deleteWithServer(this.send.id),yield this.deletePromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedSend")),yield this.load(),this.onDeletedSend.emit(this.send),!0}catch(e){this.logService.error(e)}return!1}))}typeChanged(){this.send.type!==a.SendType.File||this.alertShown||(this.canAccessPremium?this.emailVerified||(this.alertShown=!0,this.messagingService.send("emailVerificationRequired")):(this.alertShown=!0,this.messagingService.send("premiumRequired")))}toggleOptions(){this.showOptions=!this.showOptions}loadSend(){return i(this,void 0,void 0,(function*(){return this.sendService.get(this.sendId)}))}encryptSend(e){return i(this,void 0,void 0,(function*(){const t=yield this.sendService.encrypt(this.send,e,this.password,null);try{t[0].deletionDate=null==this.deletionDate?null:new Date(this.deletionDate)}catch(n){t[0].deletionDate=null}try{t[0].expirationDate=null==this.expirationDate?null:new Date(this.expirationDate)}catch(i){t[0].expirationDate=null}return t}))}togglePasswordVisible(){this.showPassword=!this.showPassword,document.getElementById("password").focus()}}t.AddEditComponent=S,S.ɵfac=function(e){return new(e||S)(d.ɵɵdirectiveInject(p.I18nService),d.ɵɵdirectiveInject(u.PlatformUtilsService),d.ɵɵdirectiveInject(m.EnvironmentService),d.ɵɵdirectiveInject(h.DatePipe),d.ɵɵdirectiveInject(v.SendService),d.ɵɵdirectiveInject(f.MessagingService),d.ɵɵdirectiveInject(g.PolicyService),d.ɵɵdirectiveInject(y.LogService),d.ɵɵdirectiveInject(x.StateService))},S.ɵdir=d.ɵɵdefineDirective({type:S,inputs:{sendId:"sendId",type:"type"},outputs:{onSavedSend:"onSavedSend",onDeletedSend:"onDeletedSend",onCancelled:"onCancelled"}})},46215:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EffluxDatesComponent=void 0;n(57490);const i=n(32621),r=n(96832),o=(n(40349),n(99954),n(32621)),a=n(40349),s=n(99954),l=n(57490);var c,d,p;!function(e){e.Default="default",e.Firefox="firefox",e.Safari="safari"}(c||(c={})),function(e){e.DeletionDate="deletion",e.ExpriationDate="expiration"}(d||(d={})),function(e){e[e.OneHour=1]="OneHour",e[e.OneDay=24]="OneDay",e[e.TwoDays=48]="TwoDays",e[e.ThreeDays=72]="ThreeDays",e[e.SevenDays=168]="SevenDays",e[e.ThirtyDays=720]="ThirtyDays",e[e.Custom=0]="Custom",e[e.Never=null]="Never"}(p||(p={}));class u{constructor(e,t,n){this.i18nService=e,this.platformUtilsService=t,this.datePipe=n,this.datesChanged=new i.EventEmitter,this.datesForm=new r.FormGroup({selectedDeletionDatePreset:new r.FormControl,selectedExpirationDatePreset:new r.FormControl,defaultDeletionDateTime:new r.FormControl,defaultExpirationDateTime:new r.FormControl,fallbackDeletionDate:new r.FormControl,fallbackDeletionTime:new r.FormControl,fallbackExpirationDate:new r.FormControl,fallbackExpirationTime:new r.FormControl}),this.deletionDatePresets=[{name:this.i18nService.t("oneHour"),value:p.OneHour},{name:this.i18nService.t("oneDay"),value:p.OneDay},{name:this.i18nService.t("days","2"),value:p.TwoDays},{name:this.i18nService.t("days","3"),value:p.ThreeDays},{name:this.i18nService.t("days","7"),value:p.SevenDays},{name:this.i18nService.t("days","30"),value:p.ThirtyDays},{name:this.i18nService.t("custom"),value:p.Custom}],this.expirationDatePresets=[{name:this.i18nService.t("never"),value:p.Never}].concat([...this.deletionDatePresets])}get browserPath(){return this.platformUtilsService.isFirefox()?c.Firefox:this.platformUtilsService.isSafari()?c.Safari:c.Default}get selectedDeletionDatePreset(){return this.datesForm.get("selectedDeletionDatePreset")}get selectedExpirationDatePreset(){return this.datesForm.get("selectedExpirationDatePreset")}get defaultDeletionDateTime(){return this.datesForm.get("defaultDeletionDateTime")}get defaultExpirationDateTime(){return this.datesForm.get("defaultExpirationDateTime")}get fallbackDeletionDate(){return this.datesForm.get("fallbackDeletionDate")}get fallbackDeletionTime(){return this.datesForm.get("fallbackDeletionTime")}get fallbackExpirationDate(){return this.datesForm.get("fallbackExpirationDate")}get fallbackExpirationTime(){return this.datesForm.get("fallbackExpirationTime")}get formattedDeletionDate(){switch(this.selectedDeletionDatePreset.value){case p.Never:return this.selectedDeletionDatePreset.setValue(p.SevenDays),this.formattedDeletionDate;case p.Custom:switch(this.browserPath){case c.Safari:case c.Firefox:return this.fallbackDeletionDate.value+"T"+this.fallbackDeletionTime.value;default:return this.defaultDeletionDateTime.value}default:const e=new Date,t=e.setTime(e.getTime()+60*this.selectedDeletionDatePreset.value*60*1e3);return new Date(t).toString()}}get formattedExpirationDate(){switch(this.selectedExpirationDatePreset.value){case p.Never:return null;case p.Custom:switch(this.browserPath){case c.Safari:case c.Firefox:return this.fallbackExpirationDate.value&&this.fallbackExpirationTime.value||!this.editMode?this.fallbackExpirationDate.value+"T"+this.fallbackExpirationTime.value:null;default:return this.defaultExpirationDateTime.value?this.defaultExpirationDateTime.value:null}default:const e=new Date,t=e.setTime(e.getTime()+60*this.selectedExpirationDatePreset.value*60*1e3);return new Date(t).toString()}}get safariDeletionTimePresetOptions(){return this.safariTimePresetOptions(d.DeletionDate)}get safariExpirationTimePresetOptions(){return this.safariTimePresetOptions(d.ExpriationDate)}get nextWeek(){const e=new Date;return e.setDate(e.getDate()+7),e}ngOnInit(){this.setInitialFormValues(),this.emitDates(),this.datesForm.valueChanges.subscribe((()=>{this.emitDates()}))}onDeletionDatePresetSelect(e){this.selectedDeletionDatePreset.setValue(e)}clearExpiration(){switch(this.browserPath){case c.Safari:case c.Firefox:this.fallbackExpirationDate.setValue(null),this.fallbackExpirationTime.setValue(null);break;case c.Default:this.defaultExpirationDateTime.setValue(null)}}emitDates(){this.datesChanged.emit({deletionDate:this.formattedDeletionDate,expirationDate:this.formattedExpirationDate})}setInitialFormValues(){if(this.editMode)switch(this.selectedDeletionDatePreset.setValue(p.Custom),this.selectedExpirationDatePreset.setValue(p.Custom),this.browserPath){case c.Safari:case c.Firefox:this.fallbackDeletionDate.setValue(this.initialDeletionDate.toISOString().slice(0,10)),this.fallbackDeletionTime.setValue(this.initialDeletionDate.toTimeString().slice(0,5)),null!=this.initialExpirationDate&&(this.fallbackExpirationDate.setValue(this.initialExpirationDate.toISOString().slice(0,10)),this.fallbackExpirationTime.setValue(this.initialExpirationDate.toTimeString().slice(0,5)));break;case c.Default:this.initialExpirationDate&&this.defaultExpirationDateTime.setValue(this.datePipe.transform(new Date(this.initialExpirationDate),"yyyy-MM-ddTHH:mm")),this.defaultDeletionDateTime.setValue(this.datePipe.transform(new Date(this.initialDeletionDate),"yyyy-MM-ddTHH:mm"))}else if(this.selectedDeletionDatePreset.setValue(p.SevenDays),this.selectedExpirationDatePreset.setValue(p.Never),this.browserPath===c.Safari)this.fallbackDeletionDate.setValue(this.nextWeek.toISOString().slice(0,10)),this.fallbackDeletionTime.setValue(this.safariTimePresetOptions(d.DeletionDate)[1].twentyFourHour)}safariTimePresetOptions(e){const t=[],n=[],i=[],r=[];for(let a=1;a<=12;a++)for(let e=0;e<60;e+=15){let o=a.toString(),s=e.toString();if(a<10&&(o="0"+o),e<10&&(s="0"+s),12===a){const e={twelveHour:`${o}:${s} AM`,twentyFourHour:`00:${s}`};n.push(e);const i={twelveHour:`${o}:${s} PM`,twentyFourHour:`${o}:${s}`};t.push(i)}else{const e={twelveHour:`${o}:${s} AM`,twentyFourHour:`${o}:${s}`};i.push(e);const t={twelveHour:`${o}:${s} PM`,twentyFourHour:`${a+12}:${s}`};r.push(t)}}const o=[...n,...i,...t,...r];if(e===d.ExpriationDate&&null!=this.initialExpirationDate&&this.editMode){return[{twelveHour:this.datePipe.transform(this.initialExpirationDate,"hh:mm a"),twentyFourHour:this.datePipe.transform(this.initialExpirationDate,"HH:mm")},{twelveHour:null,twentyFourHour:null},...o]}if(e===d.DeletionDate&&null!=this.initialDeletionDate&&this.editMode){return[{twelveHour:this.datePipe.transform(this.initialDeletionDate,"hh:mm a"),twentyFourHour:this.datePipe.transform(this.initialDeletionDate,"HH:mm")},...o]}return[{twelveHour:null,twentyFourHour:null},...o]}}t.EffluxDatesComponent=u,u.ɵfac=function(e){return new(e||u)(o.ɵɵdirectiveInject(a.I18nService),o.ɵɵdirectiveInject(s.PlatformUtilsService),o.ɵɵdirectiveInject(l.DatePipe))},u.ɵdir=o.ɵɵdefineDirective({type:u,inputs:{initialDeletionDate:"initialDeletionDate",initialExpirationDate:"initialExpirationDate",editMode:"editMode",disabled:"disabled"},outputs:{datesChanged:"datesChanged"}})},88154:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SendComponent=void 0;n(32621);const r=n(40251),o=n(49538),a=(n(57997),n(40349),n(70143),n(99954),n(10685),n(14170),n(94129),n(32621)),s=n(94129),l=n(40349),c=n(99954),d=n(57997),p=n(14170),u=n(10685),m=n(70143);class h{constructor(e,t,n,i,r,a,s,l){this.sendService=e,this.i18nService=t,this.platformUtilsService=n,this.environmentService=i,this.ngZone=r,this.searchService=a,this.policyService=s,this.logService=l,this.disableSend=!1,this.sendType=o.SendType,this.loaded=!1,this.loading=!0,this.refreshing=!1,this.expired=!1,this.type=null,this.sends=[],this.filteredSends=[],this.searchPending=!1,this.hasSearched=!1}ngOnInit(){return i(this,void 0,void 0,(function*(){this.disableSend=yield this.policyService.policyAppliesToUser(r.PolicyType.DisableSend)}))}load(e=null){return i(this,void 0,void 0,(function*(){this.loading=!0;const e=yield this.sendService.getAllDecrypted();this.sends=e,null!=this.onSuccessfulLoad?yield this.onSuccessfulLoad():this.selectAll(),this.loading=!1,this.loaded=!0}))}reload(e=null){return i(this,void 0,void 0,(function*(){this.loaded=!1,this.sends=[],yield this.load(e)}))}refresh(){return i(this,void 0,void 0,(function*(){try{this.refreshing=!0,yield this.reload(this.filter)}finally{this.refreshing=!1}}))}applyFilter(e=null){return i(this,void 0,void 0,(function*(){this.filter=e,yield this.search(null)}))}search(e=null){return i(this,void 0,void 0,(function*(){if(this.searchPending=!1,null!=this.searchTimeout&&clearTimeout(this.searchTimeout),null==e)return this.hasSearched=this.searchService.isSearchable(this.searchText),this.filteredSends=this.sends.filter((e=>null==this.filter||this.filter(e))),void this.applyTextSearch();this.searchPending=!0,this.searchTimeout=setTimeout((()=>i(this,void 0,void 0,(function*(){this.hasSearched=this.searchService.isSearchable(this.searchText),this.filteredSends=this.sends.filter((e=>null==this.filter||this.filter(e))),this.applyTextSearch(),this.searchPending=!1}))),e)}))}removePassword(e){return i(this,void 0,void 0,(function*(){if(null!=this.actionPromise||null==e.password)return;if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("removePasswordConfirmation"),this.i18nService.t("removePassword"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return!1;try{this.actionPromise=this.sendService.removePasswordWithServer(e.id),yield this.actionPromise,null!=this.onSuccessfulRemovePassword?this.onSuccessfulRemovePassword():(this.platformUtilsService.showToast("success",null,this.i18nService.t("removedPassword")),yield this.load())}catch(t){this.logService.error(t)}this.actionPromise=null}))}delete(e){return i(this,void 0,void 0,(function*(){if(null!=this.actionPromise)return!1;if(!(yield this.platformUtilsService.showDialog(this.i18nService.t("deleteSendConfirmation"),this.i18nService.t("deleteSend"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")))return!1;try{this.actionPromise=this.sendService.deleteWithServer(e.id),yield this.actionPromise,null!=this.onSuccessfulDelete?this.onSuccessfulDelete():(this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedSend")),yield this.refresh())}catch(t){this.logService.error(t)}return this.actionPromise=null,!0}))}copy(e){const t=this.environmentService.getSendUrl()+e.accessId+"/"+e.urlB64Key;this.platformUtilsService.copyToClipboard(t),this.platformUtilsService.showToast("success",null,this.i18nService.t("valueCopied",this.i18nService.t("sendLink")))}searchTextChanged(){this.search(200)}selectAll(){this.clearSelections(),this.selectedAll=!0,this.applyFilter(null)}selectType(e){this.clearSelections(),this.selectedType=e,this.applyFilter((t=>t.type===e))}clearSelections(){this.selectedAll=!1,this.selectedType=null}applyTextSearch(){null!=this.searchText&&(this.filteredSends=this.searchService.searchSends(this.filteredSends,this.searchText))}}t.SendComponent=h,h.ɵfac=function(e){return new(e||h)(a.ɵɵdirectiveInject(s.SendService),a.ɵɵdirectiveInject(l.I18nService),a.ɵɵdirectiveInject(c.PlatformUtilsService),a.ɵɵdirectiveInject(d.EnvironmentService),a.ɵɵdirectiveInject(a.NgZone),a.ɵɵdirectiveInject(p.SearchService),a.ɵɵdirectiveInject(u.PolicyService),a.ɵɵdirectiveInject(m.LogService))},h.ɵdir=a.ɵɵdefineDirective({type:h})},89487:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SetPasswordComponent=void 0;n(68012);const r=n(53232),o=(n(91092),n(82058),n(40349),n(36424),n(86193),n(99954),n(10685),n(77243),n(2173),n(82822)),a=n(63750),s=n(8696),l=n(48921),c=n(6317),d=n(25847),p=n(70829),u=n(32621),m=n(40349),h=n(82058),v=n(36424),f=n(86193),g=n(99954),y=n(10685),x=n(68012),S=n(91092),b=n(2173),w=n(77243);class I extends l.ChangePasswordComponent{constructor(e,t,n,i,r,o,a,s,l,c,d){super(e,t,n,i,r,o,d),this.router=a,this.apiService=s,this.syncService=l,this.route=c,this.syncLoading=!0,this.showPassword=!1,this.hint="",this.identifier=null,this.resetPasswordAutoEnroll=!1,this.successRoute="vault"}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return i(this,void 0,void 0,(function*(){if(yield this.syncService.fullSync(!0),this.syncLoading=!1,this.route.queryParams.pipe(r.first()).subscribe((e=>i(this,void 0,void 0,(function*(){null!=e.identifier&&(this.identifier=e.identifier)})))),null!=this.identifier)try{const e=yield this.apiService.getOrganizationAutoEnrollStatus(this.identifier);this.orgId=e.id,this.resetPasswordAutoEnroll=e.resetPasswordEnabled,this.enforcedPolicyOptions=yield this.policyService.getMasterPasswordPoliciesForInvitedUsers(this.orgId)}catch(t){this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred"))}e.ngOnInit.call(this)}))}setupSubmitActions(){return i(this,void 0,void 0,(function*(){this.kdf=d.KdfType.PBKDF2_SHA256;const e=this.platformUtilsService.isIE();return this.kdfIterations=e?1e4:1e5,!0}))}performSubmitActions(e,t,n){return i(this,void 0,void 0,(function*(){const r=yield this.cryptoService.makeKeyPair(n[0]),l=new s.SetPasswordRequest(e,n[1].encryptedString,this.hint,this.kdf,this.kdfIterations,this.identifier,new o.KeysRequest(r[0],r[1].encryptedString));try{this.resetPasswordAutoEnroll?this.formPromise=this.apiService.setPassword(l).then((()=>i(this,void 0,void 0,(function*(){return yield this.onSetPasswordSuccess(t,n,r),this.apiService.getOrganizationKeys(this.orgId)})))).then((e=>i(this,void 0,void 0,(function*(){if(null==e)throw new Error(this.i18nService.t("resetPasswordOrgKeysError"));const t=yield this.stateService.getUserId(),n=p.Utils.fromB64ToArray(e.publicKey),i=yield this.cryptoService.getEncKey(),r=yield this.cryptoService.rsaEncrypt(i.key,n.buffer),o=new a.OrganizationUserResetPasswordEnrollmentRequest;return o.resetPasswordKey=r.encryptedString,this.apiService.putOrganizationUserResetPasswordEnrollment(this.orgId,t,o)})))):this.formPromise=this.apiService.setPassword(l).then((()=>i(this,void 0,void 0,(function*(){yield this.onSetPasswordSuccess(t,n,r)})))),yield this.formPromise,null!=this.onSuccessfulChangePassword?this.onSuccessfulChangePassword():this.router.navigate([this.successRoute])}catch(c){this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred"))}}))}togglePassword(e){this.showPassword=!this.showPassword,document.getElementById(e?"masterPasswordRetype":"masterPassword").focus()}onSetPasswordSuccess(e,t,n){return i(this,void 0,void 0,(function*(){yield this.stateService.setKdfType(this.kdf),yield this.stateService.setKdfIterations(this.kdfIterations),yield this.cryptoService.setKey(e),yield this.cryptoService.setEncKey(t[1].encryptedString),yield this.cryptoService.setEncPrivateKey(n[1].encryptedString);const i=yield this.cryptoService.hashPassword(this.masterPassword,e,c.HashPurpose.LocalAuthorization);yield this.cryptoService.setKeyHash(i)}))}}t.SetPasswordComponent=I,I.ɵfac=function(e){return new(e||I)(u.ɵɵdirectiveInject(m.I18nService),u.ɵɵdirectiveInject(h.CryptoService),u.ɵɵdirectiveInject(v.MessagingService),u.ɵɵdirectiveInject(f.PasswordGenerationService),u.ɵɵdirectiveInject(g.PlatformUtilsService),u.ɵɵdirectiveInject(y.PolicyService),u.ɵɵdirectiveInject(x.Router),u.ɵɵdirectiveInject(S.ApiService),u.ɵɵdirectiveInject(b.SyncService),u.ɵɵdirectiveInject(x.ActivatedRoute),u.ɵɵdirectiveInject(w.StateService))},I.ɵdir=u.ɵɵdefineDirective({type:I,features:[u.ɵɵInheritDefinitionFeature]})},48701:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.VaultTimeoutInputComponent=void 0;n(96832),n(40349),n(10685);const r=n(40251),o=n(32621),a=n(96832),s=n(10685),l=n(40349);class c{constructor(e,t,n){this.formBuilder=e,this.policyService=t,this.i18nService=n,this.form=this.formBuilder.group({vaultTimeout:[null],custom:this.formBuilder.group({hours:[null],minutes:[null]})})}get showCustom(){return this.form.get("vaultTimeout").value===c.CUSTOM_VALUE}ngOnInit(){return i(this,void 0,void 0,(function*(){if(yield this.policyService.policyAppliesToUser(r.PolicyType.MaximumVaultTimeout)){const e=yield this.policyService.getAll(r.PolicyType.MaximumVaultTimeout);this.vaultTimeoutPolicy=e[0],this.vaultTimeoutPolicyHours=Math.floor(this.vaultTimeoutPolicy.data.minutes/60),this.vaultTimeoutPolicyMinutes=this.vaultTimeoutPolicy.data.minutes%60,this.vaultTimeouts=this.vaultTimeouts.filter((e=>e.value<=this.vaultTimeoutPolicy.data.minutes&&(e.value>0||e.value===c.CUSTOM_VALUE)&&null!=e.value)),this.validatorChange()}this.form.valueChanges.subscribe((e=>i(this,void 0,void 0,(function*(){this.onChange(this.getVaultTimeout(e))})))),this.form.get("vaultTimeout").valueChanges.subscribe((e=>{if(e!==c.CUSTOM_VALUE)return;const t=Math.max(this.form.value.vaultTimeout,0);this.form.patchValue({custom:{hours:Math.floor(t/60),minutes:t%60}})}))}))}ngOnChanges(){this.vaultTimeouts.push({name:this.i18nService.t("custom"),value:c.CUSTOM_VALUE})}getVaultTimeout(e){return e.vaultTimeout!==c.CUSTOM_VALUE?e.vaultTimeout:60*e.custom.hours+e.custom.minutes}writeValue(e){null!=e&&(this.vaultTimeouts.every((t=>t.value!==e))?this.form.setValue({vaultTimeout:c.CUSTOM_VALUE,custom:{hours:Math.floor(e/60),minutes:e%60}}):this.form.patchValue({vaultTimeout:e}))}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}validate(e){var t,n;return this.vaultTimeoutPolicy&&(null===(n=null===(t=this.vaultTimeoutPolicy)||void 0===t?void 0:t.data)||void 0===n?void 0:n.minutes) "+this.sanitizer.sanitize(r.SecurityContext.HTML,e)+" '+this.i18nService.t("twoFactorRecoveryYourCode")+": '+new Date+" {{ \"noClientsInList\" | i18n }} {{ \"newClientOrganizationDesc\" | i18n }} \n \n {{ \"loading\" | i18n }}\n {{ \"joinProvider\" | i18n }} \n {{ providerName }}\n {{ email }}\n {{ \"joinProviderDesc\" | i18n }} \n {{ \"fingerprintEnsureIntegrityVerify\" | i18n }}\n \n {{ \"learnMore\" | i18n }}\n {{ \"noEventsInList\" | i18n }} {{ \"noUsersInList\" | i18n }} \n \n {{ \"loading\" | i18n }}\n {{ \"setupProvider\" | i18n }} {{ \"setupProviderDesc\" | i18n }} \" +\n this.i18nService.t(\"encExportKeyWarningDesc\") +\n \" \" +\n this.i18nService.t(\"encExportAccountWarningDesc\"),\n this.i18nService.t(\"confirmVaultExport\"),\n this.i18nService.t(\"exportVault\"),\n this.i18nService.t(\"cancel\"),\n \"warning\",\n true\n );\n } else {\n return await this.platformUtilsService.showDialog(\n this.i18nService.t(\"exportWarningDesc\"),\n this.i18nService.t(\"confirmVaultExport\"),\n this.i18nService.t(\"exportVault\"),\n this.i18nService.t(\"cancel\"),\n \"warning\"\n );\n }\n }\n\n protected saved() {\n this.onSaved.emit();\n }\n\n protected getExportData() {\n return this.exportService.getExport(this.format);\n }\n\n protected getFileName(prefix?: string) {\n let extension = this.format;\n if (this.format === \"encrypted_json\") {\n if (prefix == null) {\n prefix = \"encrypted\";\n } else {\n prefix = \"encrypted_\" + prefix;\n }\n extension = \"json\";\n }\n return this.exportService.getFileName(prefix, extension);\n }\n\n protected async collectEvent(): Promise{t+=`"+n+"";const i=this.makeAnchor(n);return i.setAttribute("href","#/organizations/"+e.organizationId+"/vault?search="+n+"&viewEvents="+e.cipherId),i.outerHTML}formatGroupId(e){const t=this.getShortId(e.groupId),n=this.makeAnchor(t);return n.setAttribute("href","#/organizations/"+e.organizationId+"/manage/groups?search="+t),n.outerHTML}formatCollectionId(e){const t=this.getShortId(e.collectionId),n=this.makeAnchor(t);return n.setAttribute("href","#/organizations/"+e.organizationId+"/manage/collections?search="+t),n.outerHTML}formatOrgUserId(e){const t=this.getShortId(e.organizationUserId),n=this.makeAnchor(t);return n.setAttribute("href","#/organizations/"+e.organizationId+"/manage/people?search="+t+"&viewEvents="+e.organizationUserId),n.outerHTML}formatProviderUserId(e){const t=this.getShortId(e.providerUserId),n=this.makeAnchor(t);return n.setAttribute("href","#/providers/"+e.providerId+"/manage/people?search="+t+"&viewEvents="+e.providerUserId),n.outerHTML}formatProviderOrganizationId(e){const t=this.getShortId(e.providerOrganizationId),n=this.makeAnchor(t);return n.setAttribute("href","#/providers/"+e.providerId+"/clients?search="+t),n.outerHTML}formatPolicyId(e){const t=this.getShortId(e.policyId),n=this.makeAnchor(t);return n.setAttribute("href","#/organizations/"+e.organizationId+"/manage/policies?policyId="+e.policyId),n.outerHTML}makeAnchor(e){const t=document.createElement("a");return t.title=this.i18nService.t("view"),t.innerHTML=""+e+"",t}getShortId(e){return null==e?void 0:e.substring(0,8)}toDateTimeLocalString(e){return e.getFullYear()+"-"+this.pad(e.getMonth()+1)+"-"+this.pad(e.getDate())+"T"+this.pad(e.getHours())+":"+this.pad(e.getMinutes())}pad(e){const t=Math.floor(Math.abs(e));return(t<10?"0":"")+t}}t.EventService=d,d.ɵfac=function(e){return new(e||d)(s.ɵɵinject(l.I18nService),s.ɵɵinject(c.PolicyService))},d.ɵprov=s.ɵɵdefineInjectable({token:d,factory:d.ɵfac});t.EventInfo=class{};class p{constructor(){this.cipherInfo=!0}}t.EventOptions=p},78893:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModalService=void 0;n(32621);const i=n(19755),r=n(53232),o=(n(36424),n(29546)),a=n(70829),s=n(32621),l=n(36424);class c extends o.ModalService{constructor(e,t,n,i){super(e,t,n),this.messagingService=i,this.el=null,this.modalOpen=!1}setupHandlers(e){e.onCreated.pipe(r.first()).subscribe((()=>{const t=Array.from(document.querySelectorAll(".modal"));t.length>0&&(this.el=i(t[0]),this.el.modal("show"),this.el.on("show.bs.modal",(()=>{e.show(),this.messagingService.send("modalShow")})),this.el.on("shown.bs.modal",(()=>{e.shown(),this.messagingService.send("modalShown"),a.Utils.isMobileBrowser||this.el.find("*[appAutoFocus]").focus()})),this.el.on("hide.bs.modal",(()=>{this.messagingService.send("modalClose")})),this.el.on("hidden.bs.modal",(()=>{e.closed(),this.messagingService.send("modalClosed")})))})),e.onClose.pipe(r.first()).subscribe((()=>{null!=this.el&&this.el.modal("hide")}))}}t.ModalService=c,c.ɵfac=function(e){return new(e||c)(s.ɵɵinject(s.ComponentFactoryResolver),s.ɵɵinject(s.ApplicationRef),s.ɵɵinject(s.Injector),s.ɵɵinject(l.MessagingService))},c.ɵprov=s.ɵɵdefineInjectable({token:c,factory:c.ɵfac})},86950:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationGuardService=void 0;n(68012),n(40349),n(94308),n(99954);const r=n(32621),o=n(68012),a=n(99954),s=n(40349),l=n(94308);class c{constructor(e,t,n,i){this.router=e,this.platformUtilsService=t,this.i18nService=n,this.organizationService=i}canActivate(e){return i(this,void 0,void 0,(function*(){const t=yield this.organizationService.get(e.params.organizationId);return null==t?(this.router.navigate(["/"]),!1):!(!t.isOwner&&!t.enabled)||(this.platformUtilsService.showToast("error",null,this.i18nService.t("organizationIsDisabled")),this.router.navigate(["/"]),!1)}))}}t.OrganizationGuardService=c,c.ɵfac=function(e){return new(e||c)(r.ɵɵinject(o.Router),r.ɵɵinject(a.PlatformUtilsService),r.ɵɵinject(s.I18nService),r.ɵɵinject(l.OrganizationService))},c.ɵprov=r.ɵɵdefineInjectable({token:c,factory:c.ɵfac})},81616:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationTypeGuardService=void 0;n(68012),n(94308);const r=n(49618),o=n(32621),a=n(94308),s=n(68012);class l{constructor(e,t){this.organizationService=e,this.router=t}canActivate(e){return i(this,void 0,void 0,(function*(){const t=yield this.organizationService.get(e.params.organizationId),n=null==e.data?null:e.data.permissions;return!!(-1!==n.indexOf(r.Permissions.AccessEventLogs)&&t.canAccessEventLogs||-1!==n.indexOf(r.Permissions.AccessImportExport)&&t.canAccessImportExport||-1!==n.indexOf(r.Permissions.AccessReports)&&t.canAccessReports||-1!==n.indexOf(r.Permissions.CreateNewCollections)&&t.canCreateNewCollections||-1!==n.indexOf(r.Permissions.EditAnyCollection)&&t.canEditAnyCollection||-1!==n.indexOf(r.Permissions.DeleteAnyCollection)&&t.canDeleteAnyCollection||-1!==n.indexOf(r.Permissions.EditAssignedCollections)&&t.canEditAssignedCollections||-1!==n.indexOf(r.Permissions.DeleteAssignedCollections)&&t.canDeleteAssignedCollections||-1!==n.indexOf(r.Permissions.ManageGroups)&&t.canManageGroups||-1!==n.indexOf(r.Permissions.ManageOrganization)&&t.isOwner||-1!==n.indexOf(r.Permissions.ManagePolicies)&&t.canManagePolicies||-1!==n.indexOf(r.Permissions.ManageUsers)&&t.canManageUsers||-1!==n.indexOf(r.Permissions.ManageUsersPassword)&&t.canManageUsersPassword||-1!==n.indexOf(r.Permissions.ManageSso)&&t.canManageSso)||(this.router.navigate(["/organizations",t.id]),!1)}))}}t.OrganizationTypeGuardService=l,l.ɵfac=function(e){return new(e||l)(o.ɵɵinject(a.OrganizationService),o.ɵɵinject(s.Router))},l.ɵprov=o.ɵɵdefineInjectable({token:l,factory:l.ɵfac})},15524:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PolicyListService=void 0;t.PolicyListService=class{constructor(){this.policies=[]}addPolicies(e){this.policies.push(...e)}getPolicies(){return this.policies}}},16689:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RouterService=void 0;n(61248);const i=n(68012),r=(n(40349),n(32621)),o=n(68012),a=n(61248),s=n(40349);class l{constructor(e,t,n,r){this.router=e,this.activatedRoute=t,this.titleService=n,this.previousUrl=void 0,this.currentUrl=void 0,this.currentUrl=this.router.url,e.events.subscribe((e=>{if(e instanceof i.NavigationEnd){this.previousUrl=this.currentUrl,this.currentUrl=e.url;let t=r.t("pageTitle","Bitwarden"),n=null,i=null,o=this.activatedRoute.firstChild;for(;null!=o;){if(null==o.firstChild){if(null!=o.snapshot.data&&null!=o.snapshot.data.title){i=o.snapshot.data.title;break}if(null!=o.snapshot.data&&null!=o.snapshot.data.titleId){n=o.snapshot.data.titleId;break}n=null,i=null;break}o=o.firstChild}if(null!=n||null!=i){const e=null!=i?i:r.t(n);null!=e&&""!==e&&(t=e+" | "+t)}this.titleService.setTitle(t)}}))}getPreviousUrl(){return this.previousUrl}setPreviousUrl(e){this.previousUrl=e}}t.RouterService=l,l.ɵfac=function(e){return new(e||l)(r.ɵɵinject(o.Router),r.ɵɵinject(o.ActivatedRoute),r.ɵɵinject(a.Title),r.ɵɵinject(s.I18nService))},l.ɵprov=r.ɵɵdefineInjectable({token:l,factory:l.ɵfac})},83681:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ServicesModule=t.initFactory=void 0;const r=n(32621),o=n(68290),a=n(40340),s=n(7540),l=n(15392),c=n(76885),d=n(20174),p=n(54234),u=n(79863),m=n(83208),h=n(62858),v=n(78893),f=n(86950),g=n(81616),y=n(15524),x=n(16689),S=n(1273),b=n(29546),w=n(98274),I=n(68166),C=n(80321),E=n(91092),P=n(26451),k=n(68062),A=n(69050),O=n(82058),T=n(39229),M=n(57997),D=n(98573),B=n(4349),R=n(40349),U=n(58004),V=n(70143),F=n(36424),N=n(90181),_=n(14293),j=n(99954),z=n(77243),L=n(25331),K=n(43081),q=n(88332),G=n(53387),W=n(56788),H=n(19261),$=n(36907),Q=n(85570),Y=n(32621);function J(e,t,n,r,o,a,s,l,c,d){return()=>i(this,void 0,void 0,(function*(){var p;yield l.init();const u={icons:"https://icons.bitwarden.net",notifications:"https://notifications.bitwarden.com"};null!==(p=u.base)&&void 0!==p||(u.base=e.location.origin),t.setUrls(u),setTimeout((()=>n.init()),3e3),r.init(!0);const m=yield l.getLocale();yield o.init(m),a.init(!0),s.init();const h=e.document.documentElement;h.classList.add("locale_"+o.translationLocale),c.onDefaultSystemThemeChange((e=>i(this,void 0,void 0,(function*(){(yield l.getTheme())===G.ThemeType.System&&(h.classList.remove("theme_"+G.ThemeType.Light,"theme_"+G.ThemeType.Dark),h.classList.add("theme_"+e))}))));new w.ContainerService(d).attachToWindow(e)}))}t.initFactory=J;class X{}t.ServicesModule=X,X.ɵfac=function(e){return new(e||X)},X.ɵmod=Y.ɵɵdefineNgModule({type:X}),X.ɵinj=Y.ɵɵdefineInjector({providers:[{provide:r.APP_INITIALIZER,useFactory:J,deps:["WINDOW",M.EnvironmentService,N.NotificationsService,q.VaultTimeoutService,R.I18nService,D.EventService,P.AuthService,Q.StateService,j.PlatformUtilsService,O.CryptoService],multi:!0},f.OrganizationGuardService,g.OrganizationTypeGuardService,x.RouterService,h.EventService,y.PolicyListService,{provide:R.I18nService,useFactory:e=>new l.I18nService(e.navigator.language,"locales"),deps:["WINDOW"]},{provide:K.StorageService,useClass:s.HtmlStorageService},{provide:"SECURE_STORAGE",useClass:c.MemoryStorageService},{provide:j.PlatformUtilsService,useFactory:(e,t,n,i)=>new m.WebPlatformUtilsService(e,t,n,i),deps:[R.I18nService,F.MessagingService,V.LogService,Q.StateService]},{provide:F.MessagingService,useClass:a.BroadcasterMessagingService},{provide:b.ModalService,useClass:v.ModalService},{provide:U.ImportService,useClass:C.ImportService,deps:[k.CipherService,B.FolderService,E.ApiService,R.I18nService,A.CollectionService,j.PlatformUtilsService,O.CryptoService]},{provide:O.CryptoService,useClass:I.CryptoService,deps:[T.CryptoFunctionService,j.PlatformUtilsService,V.LogService,Q.StateService]},{provide:L.StateMigrationService,useFactory:(e,t)=>new u.StateMigrationService(e,t,new $.StateFactory(H.GlobalState,W.Account)),deps:[K.StorageService,"SECURE_STORAGE"]},{provide:Q.StateService,useFactory:(e,t,n,i)=>new p.StateService(e,t,n,i,new $.StateFactory(H.GlobalState,W.Account)),deps:[K.StorageService,"SECURE_STORAGE",V.LogService,L.StateMigrationService]},{provide:z.StateService,useExisting:Q.StateService},{provide:_.PasswordRepromptService,useClass:d.PasswordRepromptService}],imports:[[o.ToastrModule,S.JslibServicesModule]]})},52055:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AccountComponent=void 0;const r=n(32621),o=n(24406),a=n(54768),s=n(10673),l=n(99422),c=(n(91092),n(34445),n(77243),n(29546),n(32621)),d=n(29546),p=n(91092),u=n(34445),m=n(77243),h=n(96189),v=n(57490),f=n(5286),g=n(43450),y=n(57608),x=n(72596),S=["deauthorizeSessionsTemplate"],b=["purgeVaultTemplate"],w=["deleteAccountTemplate"],I=["viewUserApiKeyTemplate"],C=["rotateUserApiKeyTemplate"];function E(e,t){1&e&&(c.ɵɵelementContainerStart(0),c.ɵɵtext(1,"\n "),c.ɵɵelementStart(2,"div",13),c.ɵɵtext(3,"\n "),c.ɵɵelementStart(4,"h1"),c.ɵɵtext(5),c.ɵɵpipe(6,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(7,"\n "),c.ɵɵelementEnd(),c.ɵɵtext(8,"\n "),c.ɵɵelement(9,"app-change-email"),c.ɵɵtext(10,"\n"),c.ɵɵelementContainerEnd()),2&e&&(c.ɵɵadvance(5),c.ɵɵtextInterpolate(c.ɵɵpipeBind1(6,1,"changeEmail")))}function P(e,t){1&e&&(c.ɵɵelementContainerStart(0),c.ɵɵtext(1,"\n "),c.ɵɵelementStart(2,"div",13),c.ɵɵtext(3,"\n "),c.ɵɵelementStart(4,"h1"),c.ɵɵtext(5),c.ɵɵpipe(6,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(7,"\n "),c.ɵɵelementEnd(),c.ɵɵtext(8,"\n "),c.ɵɵelement(9,"app-change-password"),c.ɵɵtext(10,"\n"),c.ɵɵelementContainerEnd()),2&e&&(c.ɵɵadvance(5),c.ɵɵtextInterpolate(c.ɵɵpipeBind1(6,1,"changeMasterPassword")))}function k(e,t){1&e&&(c.ɵɵelementContainerStart(0),c.ɵɵtext(1,"\n "),c.ɵɵelementStart(2,"div",13),c.ɵɵtext(3,"\n "),c.ɵɵelementStart(4,"h1"),c.ɵɵtext(5),c.ɵɵpipe(6,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(7,"\n "),c.ɵɵelementEnd(),c.ɵɵtext(8,"\n "),c.ɵɵelement(9,"app-change-kdf"),c.ɵɵtext(10,"\n"),c.ɵɵelementContainerEnd()),2&e&&(c.ɵɵadvance(5),c.ɵɵtextInterpolate(c.ɵɵpipeBind1(6,1,"encKeySettings")))}function A(e,t){}function O(e,t){}function T(e,t){}function M(e,t){}function D(e,t){}class B{constructor(e,t,n,i){this.modalService=e,this.apiService=t,this.keyConnectorService=n,this.stateService=i,this.showChangePassword=!0,this.showChangeKdf=!0,this.showChangeEmail=!0}ngOnInit(){return i(this,void 0,void 0,(function*(){this.showChangeEmail=this.showChangeKdf=this.showChangePassword=!(yield this.keyConnectorService.getUsesKeyConnector())}))}deauthorizeSessions(){return i(this,void 0,void 0,(function*(){yield this.modalService.openViewRef(a.DeauthorizeSessionsComponent,this.deauthModalRef)}))}purgeVault(){return i(this,void 0,void 0,(function*(){yield this.modalService.openViewRef(l.PurgeVaultComponent,this.purgeModalRef)}))}deleteAccount(){return i(this,void 0,void 0,(function*(){yield this.modalService.openViewRef(s.DeleteAccountComponent,this.deleteModalRef)}))}viewUserApiKey(){return i(this,void 0,void 0,(function*(){const e=yield this.stateService.getUserId();yield this.modalService.openViewRef(o.ApiKeyComponent,this.viewUserApiKeyModalRef,(t=>{t.keyType="user",t.entityId=e,t.postKey=this.apiService.postUserApiKey.bind(this.apiService),t.scope="api",t.grantType="client_credentials",t.apiKeyTitle="apiKey",t.apiKeyWarning="userApiKeyWarning",t.apiKeyDescription="userApiKeyDesc"}))}))}rotateUserApiKey(){return i(this,void 0,void 0,(function*(){const e=yield this.stateService.getUserId();yield this.modalService.openViewRef(o.ApiKeyComponent,this.rotateUserApiKeyModalRef,(t=>{t.keyType="user",t.isRotation=!0,t.entityId=e,t.postKey=this.apiService.postUserRotateApiKey.bind(this.apiService),t.scope="api",t.grantType="client_credentials",t.apiKeyTitle="apiKey",t.apiKeyWarning="userApiKeyWarning",t.apiKeyDescription="apiKeyRotateDesc"}))}))}}t.AccountComponent=B,B.ɵfac=function(e){return new(e||B)(c.ɵɵdirectiveInject(d.ModalService),c.ɵɵdirectiveInject(p.ApiService),c.ɵɵdirectiveInject(u.KeyConnectorService),c.ɵɵdirectiveInject(m.StateService))},B.ɵcmp=c.ɵɵdefineComponent({type:B,selectors:[["app-account"]],viewQuery:function(e,t){if(1&e&&(c.ɵɵviewQuery(S,7,r.ViewContainerRef),c.ɵɵviewQuery(b,7,r.ViewContainerRef),c.ɵɵviewQuery(w,7,r.ViewContainerRef),c.ɵɵviewQuery(I,7,r.ViewContainerRef),c.ɵɵviewQuery(C,7,r.ViewContainerRef)),2&e){let e;c.ɵɵqueryRefresh(e=c.ɵɵloadQuery())&&(t.deauthModalRef=e.first),c.ɵɵqueryRefresh(e=c.ɵɵloadQuery())&&(t.purgeModalRef=e.first),c.ɵɵqueryRefresh(e=c.ɵɵloadQuery())&&(t.deleteModalRef=e.first),c.ɵɵqueryRefresh(e=c.ɵɵloadQuery())&&(t.viewUserApiKeyModalRef=e.first),c.ɵɵqueryRefresh(e=c.ɵɵloadQuery())&&(t.rotateUserApiKeyModalRef=e.first)}},decls:78,vars:33,consts:[[1,"page-header"],[4,"ngIf"],[1,"secondary-header","border-0","mb-0"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"secondary-header","text-danger","border-0","mb-0"],[1,"card","border-danger"],[1,"card-body"],["type","button",1,"btn","btn-outline-danger",3,"click"],["deauthorizeSessionsTemplate",""],["purgeVaultTemplate",""],["deleteAccountTemplate",""],["viewUserApiKeyTemplate",""],["rotateUserApiKeyTemplate",""],[1,"secondary-header"]],template:function(e,t){1&e&&(c.ɵɵelementStart(0,"div",0),c.ɵɵtext(1,"\n "),c.ɵɵelementStart(2,"h1"),c.ɵɵtext(3),c.ɵɵpipe(4,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(5,"\n"),c.ɵɵelementEnd(),c.ɵɵtext(6,"\n"),c.ɵɵelement(7,"app-profile"),c.ɵɵtext(8,"\n"),c.ɵɵtemplate(9,E,11,3,"ng-container",1),c.ɵɵtext(10,"\n"),c.ɵɵtemplate(11,P,11,3,"ng-container",1),c.ɵɵtext(12,"\n"),c.ɵɵtemplate(13,k,11,3,"ng-container",1),c.ɵɵtext(14,"\n"),c.ɵɵelementStart(15,"div",2),c.ɵɵtext(16,"\n "),c.ɵɵelementStart(17,"h1"),c.ɵɵtext(18),c.ɵɵpipe(19,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(20,"\n"),c.ɵɵelementEnd(),c.ɵɵtext(21,"\n"),c.ɵɵelementStart(22,"p"),c.ɵɵtext(23),c.ɵɵpipe(24,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(25,"\n"),c.ɵɵelementStart(26,"button",3),c.ɵɵlistener("click",(function(){return t.viewUserApiKey()})),c.ɵɵtext(27),c.ɵɵpipe(28,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(29,"\n"),c.ɵɵelementStart(30,"button",3),c.ɵɵlistener("click",(function(){return t.rotateUserApiKey()})),c.ɵɵtext(31),c.ɵɵpipe(32,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(33,"\n"),c.ɵɵelementStart(34,"div",4),c.ɵɵtext(35,"\n "),c.ɵɵelementStart(36,"h1"),c.ɵɵtext(37),c.ɵɵpipe(38,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(39,"\n"),c.ɵɵelementEnd(),c.ɵɵtext(40,"\n"),c.ɵɵelementStart(41,"div",5),c.ɵɵtext(42,"\n "),c.ɵɵelementStart(43,"div",6),c.ɵɵtext(44,"\n "),c.ɵɵelementStart(45,"p"),c.ɵɵtext(46),c.ɵɵpipe(47,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(48,"\n "),c.ɵɵelementStart(49,"button",7),c.ɵɵlistener("click",(function(){return t.deauthorizeSessions()})),c.ɵɵtext(50),c.ɵɵpipe(51,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(52,"\n "),c.ɵɵelementStart(53,"button",7),c.ɵɵlistener("click",(function(){return t.purgeVault()})),c.ɵɵtext(54),c.ɵɵpipe(55,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(56,"\n "),c.ɵɵelementStart(57,"button",7),c.ɵɵlistener("click",(function(){return t.deleteAccount()})),c.ɵɵtext(58),c.ɵɵpipe(59,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(60,"\n "),c.ɵɵelementEnd(),c.ɵɵtext(61,"\n"),c.ɵɵelementEnd(),c.ɵɵtext(62,"\n"),c.ɵɵtemplate(63,A,0,0,"ng-template",null,8,c.ɵɵtemplateRefExtractor),c.ɵɵtext(65,"\n"),c.ɵɵtemplate(66,O,0,0,"ng-template",null,9,c.ɵɵtemplateRefExtractor),c.ɵɵtext(68,"\n"),c.ɵɵtemplate(69,T,0,0,"ng-template",null,10,c.ɵɵtemplateRefExtractor),c.ɵɵtext(71,"\n"),c.ɵɵtemplate(72,M,0,0,"ng-template",null,11,c.ɵɵtemplateRefExtractor),c.ɵɵtext(74,"\n"),c.ɵɵtemplate(75,D,0,0,"ng-template",null,12,c.ɵɵtemplateRefExtractor),c.ɵɵtext(77,"\n")),2&e&&(c.ɵɵadvance(3),c.ɵɵtextInterpolate(c.ɵɵpipeBind1(4,13,"myAccount")),c.ɵɵadvance(6),c.ɵɵproperty("ngIf",t.showChangeEmail),c.ɵɵadvance(2),c.ɵɵproperty("ngIf",t.showChangePassword),c.ɵɵadvance(2),c.ɵɵproperty("ngIf",t.showChangeKdf),c.ɵɵadvance(5),c.ɵɵtextInterpolate(c.ɵɵpipeBind1(19,15,"apiKey")),c.ɵɵadvance(5),c.ɵɵtextInterpolate1("\n ",c.ɵɵpipeBind1(24,17,"userApiKeyDesc"),"\n"),c.ɵɵadvance(4),c.ɵɵtextInterpolate1("\n ",c.ɵɵpipeBind1(28,19,"viewApiKey"),"\n"),c.ɵɵadvance(4),c.ɵɵtextInterpolate1("\n ",c.ɵɵpipeBind1(32,21,"rotateApiKey"),"\n"),c.ɵɵadvance(6),c.ɵɵtextInterpolate(c.ɵɵpipeBind1(38,23,"dangerZone")),c.ɵɵadvance(9),c.ɵɵtextInterpolate(c.ɵɵpipeBind1(47,25,"dangerZoneDesc")),c.ɵɵadvance(4),c.ɵɵtextInterpolate1("\n ",c.ɵɵpipeBind1(51,27,"deauthorizeSessions"),"\n "),c.ɵɵadvance(4),c.ɵɵtextInterpolate1("\n ",c.ɵɵpipeBind1(55,29,"purgeVault"),"\n "),c.ɵɵadvance(4),c.ɵɵtextInterpolate1("\n ",c.ɵɵpipeBind1(59,31,"deleteAccount"),"\n "))},directives:[h.ProfileComponent,v.NgIf,f.ChangeEmailComponent,g.ChangePasswordComponent,y.ChangeKdfComponent],pipes:[x.I18nPipe],encapsulation:2})},76187:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AddCreditComponent=void 0;const r=n(32621),o=(n(91092),n(70143),n(94308),n(99954),n(77243),n(6127)),a=n(15906),s=n(32621),l=n(77243),c=n(91092),d=n(99954),p=n(94308),u=n(70143),m=n(96832),h=n(637),v=n(50553),f=n(57490),g=n(72596),y=["ppButtonForm"];function x(e,t){if(1&e){const e=s.ɵɵgetCurrentView();s.ɵɵelementStart(0,"div",36),s.ɵɵtext(1,"\n "),s.ɵɵelementStart(2,"div",37),s.ɵɵtext(3,"\n "),s.ɵɵelementStart(4,"input",38),s.ɵɵlistener("ngModelChange",(function(t){s.ɵɵrestoreView(e);return s.ɵɵnextContext().method=t})),s.ɵɵelementEnd(),s.ɵɵtext(5,"\n "),s.ɵɵelementStart(6,"label",39),s.ɵɵtext(7,"\n "),s.ɵɵelement(8,"i",40),s.ɵɵtext(9," PayPal"),s.ɵɵelementEnd(),s.ɵɵtext(10,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(11,"\n "),s.ɵɵelementStart(12,"div",37),s.ɵɵtext(13,"\n "),s.ɵɵelementStart(14,"input",41),s.ɵɵlistener("ngModelChange",(function(t){s.ɵɵrestoreView(e);return s.ɵɵnextContext().method=t})),s.ɵɵelementEnd(),s.ɵɵtext(15,"\n "),s.ɵɵelementStart(16,"label",42),s.ɵɵtext(17,"\n "),s.ɵɵelement(18,"i",43),s.ɵɵtext(19," Bitcoin"),s.ɵɵelementEnd(),s.ɵɵtext(20,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(21,"\n "),s.ɵɵelementEnd()}if(2&e){const e=s.ɵɵnextContext();s.ɵɵadvance(4),s.ɵɵproperty("value",e.paymentMethodType.PayPal)("ngModel",e.method),s.ɵɵadvance(10),s.ɵɵproperty("value",e.paymentMethodType.BitPay)("ngModel",e.method)}}class S{constructor(e,t,n,i,a){this.stateService=e,this.apiService=t,this.platformUtilsService=n,this.organizationService=i,this.logService=a,this.showOptions=!0,this.method=o.PaymentMethodType.PayPal,this.onAdded=new r.EventEmitter,this.onCanceled=new r.EventEmitter,this.paymentMethodType=o.PaymentMethodType,this.ppLoading=!1;const s="4ZDA7DLUUJGMN",l="https://www.paypal.com/cgi-bin/webscr";this.ppButtonFormAction=l,this.ppButtonBusinessId=s}ngOnInit(){return i(this,void 0,void 0,(function*(){if(null!=this.organizationId){null==this.creditAmount&&(this.creditAmount="20.00"),this.ppButtonCustomField="organization_id:"+this.organizationId;const e=yield this.organizationService.get(this.organizationId);null!=e&&(this.subject=e.name,this.name=e.name)}else null==this.creditAmount&&(this.creditAmount="10.00"),this.userId=yield this.stateService.getUserId(),this.subject=yield this.stateService.getEmail(),this.email=this.subject,this.ppButtonCustomField="user_id:"+this.userId;this.ppButtonCustomField+=",account_credit:1",this.returnUrl=window.location.href}))}submit(){return i(this,void 0,void 0,(function*(){if(null!=this.creditAmount&&""!==this.creditAmount){if(this.method===o.PaymentMethodType.PayPal)return this.ppButtonFormRef.nativeElement.submit(),void(this.ppLoading=!0);if(this.method!==o.PaymentMethodType.BitPay)try{this.onAdded.emit()}catch(e){this.logService.error(e)}else try{const e=new a.BitPayInvoiceRequest;e.email=this.email,e.name=this.name,e.credit=!0,e.amount=this.creditAmountNumber,e.organizationId=this.organizationId,e.userId=this.userId,e.returnUrl=this.returnUrl,this.formPromise=this.apiService.postBitPayInvoice(e);const t=yield this.formPromise;this.platformUtilsService.launchUri(t)}catch(e){this.logService.error(e)}}}))}cancel(){this.onCanceled.emit()}formatAmount(){try{if(null!=this.creditAmount&&""!==this.creditAmount){const e=Math.abs(parseFloat(this.creditAmount));if(e>0)return void(this.creditAmount=parseFloat((Math.round(100*e)/100).toString()).toFixed(2).toString())}}catch(e){this.logService.error(e)}this.creditAmount=""}get creditAmountNumber(){if(null!=this.creditAmount&&""!==this.creditAmount)try{return parseFloat(this.creditAmount)}catch(e){this.logService.error(e)}return null}}t.AddCreditComponent=S,S.ɵfac=function(e){return new(e||S)(s.ɵɵdirectiveInject(l.StateService),s.ɵɵdirectiveInject(c.ApiService),s.ɵɵdirectiveInject(d.PlatformUtilsService),s.ɵɵdirectiveInject(p.OrganizationService),s.ɵɵdirectiveInject(u.LogService))},S.ɵcmp=s.ɵɵdefineComponent({type:S,selectors:[["app-add-credit"]],viewQuery:function(e,t){if(1&e&&s.ɵɵviewQuery(y,7,r.ElementRef),2&e){let e;s.ɵɵqueryRefresh(e=s.ɵɵloadQuery())&&(t.ppButtonFormRef=e.first)}},inputs:{creditAmount:"creditAmount",showOptions:"showOptions",method:"method",organizationId:"organizationId"},outputs:{onAdded:"onAdded",onCanceled:"onCanceled"},decls:94,vars:32,consts:[["ngNativeValidate","",1,"card",3,"appApiAction","ngSubmit"],["form",""],[1,"card-body"],["type","button",1,"close",3,"appA11yTitle","click"],["aria-hidden","true"],[1,"card-body-header"],["class","mb-4 text-lg",4,"ngIf"],[1,"form-group"],[1,"row"],[1,"col-4"],["for","creditAmount"],[1,"input-group"],[1,"input-group-prepend"],[1,"input-group-text"],["id","creditAmount","type","text","name","CreditAmount","required","",1,"form-control",3,"ngModel","ngModelChange","blur"],[1,"form-text","text-muted"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["method","post","target","_top",3,"action"],["ppButtonForm",""],["type","hidden","name","cmd","value","_xclick"],["type","hidden","name","business",3,"value"],["type","hidden","name","button_subtype","value","services"],["type","hidden","name","no_note","value","1"],["type","hidden","name","no_shipping","value","1"],["type","hidden","name","rm","value","1"],["type","hidden","name","return",3,"value"],["type","hidden","name","cancel_return",3,"value"],["type","hidden","name","currency_code","value","USD"],["type","hidden","name","image_url","value","https://bitwarden.com/images/paypal-banner.png"],["type","hidden","name","bn","value","PP-BuyNowBF:btn_buynow_LG.gif:NonHosted"],["type","hidden","name","amount",3,"value"],["type","hidden","name","custom",3,"value"],["type","hidden","name","item_name","value","Bitwarden Account Credit"],["type","hidden","name","item_number",3,"value"],[1,"mb-4","text-lg"],[1,"form-check","form-check-inline"],["type","radio","name","Method","id","credit-method-paypal",1,"form-check-input",3,"value","ngModel","ngModelChange"],["for","credit-method-paypal",1,"form-check-label"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-paypal"],["type","radio","name","Method","id","credit-method-bitcoin",1,"form-check-input",3,"value","ngModel","ngModelChange"],["for","credit-method-bitcoin",1,"form-check-label"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-bitcoin"]],template:function(e,t){if(1&e&&(s.ɵɵelementStart(0,"form",0,1),s.ɵɵlistener("ngSubmit",(function(){return t.submit()})),s.ɵɵtext(2,"\n "),s.ɵɵelementStart(3,"div",2),s.ɵɵtext(4,"\n "),s.ɵɵelementStart(5,"button",3),s.ɵɵlistener("click",(function(){return t.cancel()})),s.ɵɵpipe(6,"i18n"),s.ɵɵtext(7,"\n "),s.ɵɵelementStart(8,"span",4),s.ɵɵtext(9,"×"),s.ɵɵelementEnd(),s.ɵɵtext(10,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(11,"\n "),s.ɵɵelementStart(12,"h3",5),s.ɵɵtext(13),s.ɵɵpipe(14,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(15,"\n "),s.ɵɵtemplate(16,x,22,4,"div",6),s.ɵɵtext(17,"\n "),s.ɵɵelementStart(18,"div",7),s.ɵɵtext(19,"\n "),s.ɵɵelementStart(20,"div",8),s.ɵɵtext(21,"\n "),s.ɵɵelementStart(22,"div",9),s.ɵɵtext(23,"\n "),s.ɵɵelementStart(24,"label",10),s.ɵɵtext(25),s.ɵɵpipe(26,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(27,"\n "),s.ɵɵelementStart(28,"div",11),s.ɵɵtext(29,"\n "),s.ɵɵelementStart(30,"div",12),s.ɵɵelementStart(31,"span",13),s.ɵɵtext(32,"$USD"),s.ɵɵelementEnd(),s.ɵɵelementEnd(),s.ɵɵtext(33,"\n "),s.ɵɵelementStart(34,"input",14),s.ɵɵlistener("ngModelChange",(function(e){return t.creditAmount=e}))("blur",(function(){return t.formatAmount()})),s.ɵɵelementEnd(),s.ɵɵtext(35,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(36,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(37,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(38,"\n "),s.ɵɵelementStart(39,"small",15),s.ɵɵtext(40),s.ɵɵpipe(41,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(42,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(43,"\n "),s.ɵɵelementStart(44,"button",16),s.ɵɵtext(45,"\n "),s.ɵɵelement(46,"i",17),s.ɵɵpipe(47,"i18n"),s.ɵɵtext(48,"\n "),s.ɵɵelementStart(49,"span"),s.ɵɵtext(50),s.ɵɵpipe(51,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(52,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(53,"\n "),s.ɵɵelementStart(54,"button",18),s.ɵɵlistener("click",(function(){return t.cancel()})),s.ɵɵtext(55),s.ɵɵpipe(56,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(57,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(58,"\n"),s.ɵɵelementEnd(),s.ɵɵtext(59,"\n"),s.ɵɵelementStart(60,"form",19,20),s.ɵɵtext(62,"\n "),s.ɵɵelement(63,"input",21),s.ɵɵtext(64,"\n "),s.ɵɵelement(65,"input",22),s.ɵɵtext(66,"\n "),s.ɵɵelement(67,"input",23),s.ɵɵtext(68,"\n "),s.ɵɵelement(69,"input",24),s.ɵɵtext(70,"\n "),s.ɵɵelement(71,"input",25),s.ɵɵtext(72,"\n "),s.ɵɵelement(73,"input",26),s.ɵɵtext(74,"\n "),s.ɵɵelement(75,"input",27),s.ɵɵtext(76,"\n "),s.ɵɵelement(77,"input",28),s.ɵɵtext(78,"\n "),s.ɵɵelement(79,"input",29),s.ɵɵtext(80,"\n "),s.ɵɵelement(81,"input",30),s.ɵɵtext(82,"\n "),s.ɵɵelement(83,"input",31),s.ɵɵtext(84,"\n "),s.ɵɵelement(85,"input",32),s.ɵɵtext(86,"\n "),s.ɵɵelement(87,"input",33),s.ɵɵtext(88,"\n "),s.ɵɵelement(89,"input",34),s.ɵɵtext(90,"\n "),s.ɵɵelement(91,"input",35),s.ɵɵtext(92,"\n"),s.ɵɵelementEnd(),s.ɵɵtext(93,"\n")),2&e){const e=s.ɵɵreference(1);s.ɵɵproperty("appApiAction",t.formPromise),s.ɵɵadvance(5),s.ɵɵpropertyInterpolate("appA11yTitle",s.ɵɵpipeBind1(6,18,"cancel")),s.ɵɵadvance(8),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(14,20,"addCredit")),s.ɵɵadvance(3),s.ɵɵproperty("ngIf",t.showOptions),s.ɵɵadvance(9),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(26,22,"amount")),s.ɵɵadvance(9),s.ɵɵproperty("ngModel",t.creditAmount),s.ɵɵadvance(6),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(41,24,"creditDelayed")),s.ɵɵadvance(4),s.ɵɵproperty("disabled",e.loading||t.ppLoading),s.ɵɵadvance(2),s.ɵɵpropertyInterpolate("title",s.ɵɵpipeBind1(47,26,"loading")),s.ɵɵadvance(4),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(51,28,"submit")),s.ɵɵadvance(5),s.ɵɵtextInterpolate1("\n ",s.ɵɵpipeBind1(56,30,"cancel"),"\n "),s.ɵɵadvance(5),s.ɵɵpropertyInterpolate("action",t.ppButtonFormAction,s.ɵɵsanitizeUrl),s.ɵɵadvance(5),s.ɵɵpropertyInterpolate("value",t.ppButtonBusinessId),s.ɵɵadvance(10),s.ɵɵpropertyInterpolate("value",t.returnUrl),s.ɵɵadvance(2),s.ɵɵpropertyInterpolate("value",t.returnUrl),s.ɵɵadvance(8),s.ɵɵpropertyInterpolate("value",t.creditAmount),s.ɵɵadvance(2),s.ɵɵpropertyInterpolate("value",t.ppButtonCustomField),s.ɵɵadvance(4),s.ɵɵpropertyInterpolate("value",t.subject)}},directives:[m.NgControlStatusGroup,m.NgForm,h.ApiActionDirective,v.A11yTitleDirective,f.NgIf,m.DefaultValueAccessor,m.RequiredValidator,m.NgControlStatus,m.NgModel,m.ɵNgNoValidate,m.RadioControlValueAccessor],pipes:[g.I18nPipe],encapsulation:2})},3068:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AdjustPaymentComponent=void 0;const r=n(32621),o=(n(91092),n(40349),n(70143),n(99954),n(19582)),a=n(6127),s=n(63410),l=n(28047),c=n(32621),d=n(91092),p=n(40349),u=n(99954),m=n(70143),h=n(96832),v=n(637),f=n(50553),g=n(63410),y=n(28047),x=n(72596);class S{constructor(e,t,n,i){this.apiService=e,this.i18nService=t,this.platformUtilsService=n,this.logService=i,this.onAdjusted=new r.EventEmitter,this.onCanceled=new r.EventEmitter,this.paymentMethodType=a.PaymentMethodType}submit(){return i(this,void 0,void 0,(function*(){try{const e=new o.PaymentRequest;this.formPromise=this.paymentComponent.createPaymentToken().then((t=>(e.paymentToken=t[0],e.paymentMethodType=t[1],e.postalCode=this.taxInfoComponent.taxInfo.postalCode,e.country=this.taxInfoComponent.taxInfo.country,null==this.organizationId?this.apiService.postAccountPayment(e):(e.taxId=this.taxInfoComponent.taxInfo.taxId,e.state=this.taxInfoComponent.taxInfo.state,e.line1=this.taxInfoComponent.taxInfo.line1,e.line2=this.taxInfoComponent.taxInfo.line2,e.city=this.taxInfoComponent.taxInfo.city,e.state=this.taxInfoComponent.taxInfo.state,this.apiService.postOrganizationPayment(this.organizationId,e))))),yield this.formPromise,this.platformUtilsService.showToast("success",null,this.i18nService.t("updatedPaymentMethod")),this.onAdjusted.emit()}catch(e){this.logService.error(e)}}))}cancel(){this.onCanceled.emit()}changeCountry(){"US"===this.taxInfoComponent.taxInfo.country?this.paymentComponent.hideBank=!this.organizationId:(this.paymentComponent.hideBank=!0,this.paymentComponent.method===a.PaymentMethodType.BankAccount&&(this.paymentComponent.method=a.PaymentMethodType.Card,this.paymentComponent.changeMethod()))}}t.AdjustPaymentComponent=S,S.ɵfac=function(e){return new(e||S)(c.ɵɵdirectiveInject(d.ApiService),c.ɵɵdirectiveInject(p.I18nService),c.ɵɵdirectiveInject(u.PlatformUtilsService),c.ɵɵdirectiveInject(m.LogService))},S.ɵcmp=c.ɵɵdefineComponent({type:S,selectors:[["app-adjust-payment"]],viewQuery:function(e,t){if(1&e&&(c.ɵɵviewQuery(s.PaymentComponent,7),c.ɵɵviewQuery(l.TaxInfoComponent,7)),2&e){let e;c.ɵɵqueryRefresh(e=c.ɵɵloadQuery())&&(t.paymentComponent=e.first),c.ɵɵqueryRefresh(e=c.ɵɵloadQuery())&&(t.taxInfoComponent=e.first)}},inputs:{currentType:"currentType",organizationId:"organizationId"},outputs:{onAdjusted:"onAdjusted",onCanceled:"onCanceled"},decls:36,vars:19,consts:[["ngNativeValidate","",1,"card",3,"appApiAction","ngSubmit"],["form",""],[1,"card-body"],["type","button",1,"close",3,"appA11yTitle","click"],["aria-hidden","true"],[1,"card-body-header"],[3,"hideBank","hideCredit"],[3,"onCountryChanged"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button",1,"btn","btn-outline-secondary",3,"click"]],template:function(e,t){if(1&e&&(c.ɵɵelementStart(0,"form",0,1),c.ɵɵlistener("ngSubmit",(function(){return t.submit()})),c.ɵɵtext(2,"\n "),c.ɵɵelementStart(3,"div",2),c.ɵɵtext(4,"\n "),c.ɵɵelementStart(5,"button",3),c.ɵɵlistener("click",(function(){return t.cancel()})),c.ɵɵpipe(6,"i18n"),c.ɵɵtext(7,"\n "),c.ɵɵelementStart(8,"span",4),c.ɵɵtext(9,"×"),c.ɵɵelementEnd(),c.ɵɵtext(10,"\n "),c.ɵɵelementEnd(),c.ɵɵtext(11,"\n "),c.ɵɵelementStart(12,"h3",5),c.ɵɵtext(13),c.ɵɵpipe(14,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(15,"\n "),c.ɵɵelement(16,"app-payment",6),c.ɵɵtext(17,"\n "),c.ɵɵelementStart(18,"app-tax-info",7),c.ɵɵlistener("onCountryChanged",(function(){return t.changeCountry()})),c.ɵɵelementEnd(),c.ɵɵtext(19,"\n "),c.ɵɵelementStart(20,"button",8),c.ɵɵtext(21,"\n "),c.ɵɵelement(22,"i",9),c.ɵɵpipe(23,"i18n"),c.ɵɵtext(24,"\n "),c.ɵɵelementStart(25,"span"),c.ɵɵtext(26),c.ɵɵpipe(27,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(28,"\n "),c.ɵɵelementEnd(),c.ɵɵtext(29,"\n "),c.ɵɵelementStart(30,"button",10),c.ɵɵlistener("click",(function(){return t.cancel()})),c.ɵɵtext(31),c.ɵɵpipe(32,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(33,"\n "),c.ɵɵelementEnd(),c.ɵɵtext(34,"\n"),c.ɵɵelementEnd(),c.ɵɵtext(35,"\n")),2&e){const e=c.ɵɵreference(1);c.ɵɵproperty("appApiAction",t.formPromise),c.ɵɵadvance(5),c.ɵɵpropertyInterpolate("appA11yTitle",c.ɵɵpipeBind1(6,9,"cancel")),c.ɵɵadvance(8),c.ɵɵtextInterpolate1("\n ",c.ɵɵpipeBind1(14,11,null!=t.currentType?"changePaymentMethod":"addPaymentMethod"),"\n "),c.ɵɵadvance(3),c.ɵɵproperty("hideBank",!t.organizationId)("hideCredit",!0),c.ɵɵadvance(4),c.ɵɵproperty("disabled",e.loading),c.ɵɵadvance(2),c.ɵɵpropertyInterpolate("title",c.ɵɵpipeBind1(23,13,"loading")),c.ɵɵadvance(4),c.ɵɵtextInterpolate(c.ɵɵpipeBind1(27,15,"submit")),c.ɵɵadvance(5),c.ɵɵtextInterpolate1("\n ",c.ɵɵpipeBind1(32,17,"cancel"),"\n ")}},directives:[h.NgControlStatusGroup,h.NgForm,v.ApiActionDirective,f.A11yTitleDirective,g.PaymentComponent,y.TaxInfoComponent],pipes:[x.I18nPipe],encapsulation:2})},96413:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AdjustStorageComponent=void 0;const r=n(32621),o=(n(68012),n(91092),n(40349),n(70143),n(99954),n(13420)),a=n(63410),s=n(32621),l=n(91092),c=n(40349),d=n(99954),p=n(68012),u=n(70143),m=n(96832),h=n(637),v=n(50553),f=n(57490),g=n(63410),y=n(72596);function x(e,t){if(1&e&&(s.ɵɵelementStart(0,"div",16),s.ɵɵtext(1,"\n "),s.ɵɵelementStart(2,"strong"),s.ɵɵtext(3),s.ɵɵpipe(4,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(5),s.ɵɵpipe(6,"currency"),s.ɵɵpipe(7,"currency"),s.ɵɵpipe(8,"i18n"),s.ɵɵelementEnd()),2&e){const e=s.ɵɵnextContext();s.ɵɵadvance(3),s.ɵɵtextInterpolate1("",s.ɵɵpipeBind1(4,5,"total"),":"),s.ɵɵadvance(2),s.ɵɵtextInterpolate4(" ",e.storageAdjustment||0," GB ×\n ",s.ɵɵpipeBind2(6,7,e.storageGbPrice,"$")," = ",s.ɵɵpipeBind2(7,10,e.adjustedStorageTotal,"$")," /",s.ɵɵpipeBind1(8,13,e.interval),"\n ")}}class S{constructor(e,t,n,i,o,a){this.apiService=e,this.i18nService=t,this.platformUtilsService=n,this.router=i,this.activatedRoute=o,this.logService=a,this.storageGbPrice=0,this.add=!0,this.interval="year",this.onAdjusted=new r.EventEmitter,this.onCanceled=new r.EventEmitter,this.storageAdjustment=0}submit(){return i(this,void 0,void 0,(function*(){try{const e=new o.StorageRequest;e.storageGbAdjustment=this.storageAdjustment,this.add||(e.storageGbAdjustment*=-1);let t=!1;const n=()=>i(this,void 0,void 0,(function*(){let n;n=null==this.organizationId?this.formPromise=this.apiService.postAccountStorage(e):this.formPromise=this.apiService.postOrganizationStorage(this.organizationId,e);const i=yield n;if(null!=i&&null!=i.paymentIntentClientSecret)try{yield this.paymentComponent.handleStripeCardPayment(i.paymentIntentClientSecret,null)}catch(r){t=!0}}));this.formPromise=n(),yield this.formPromise,this.onAdjusted.emit(this.storageAdjustment),t?(this.platformUtilsService.showToast("warning",null,this.i18nService.t("couldNotChargeCardPayInvoice"),{timeout:1e4}),this.router.navigate(["../billing"],{relativeTo:this.activatedRoute})):this.platformUtilsService.showToast("success",null,this.i18nService.t("adjustedStorage",e.storageGbAdjustment.toString()))}catch(e){this.logService.error(e)}}))}cancel(){this.onCanceled.emit()}get adjustedStorageTotal(){return this.storageGbPrice*this.storageAdjustment}}t.AdjustStorageComponent=S,S.ɵfac=function(e){return new(e||S)(s.ɵɵdirectiveInject(l.ApiService),s.ɵɵdirectiveInject(c.I18nService),s.ɵɵdirectiveInject(d.PlatformUtilsService),s.ɵɵdirectiveInject(p.Router),s.ɵɵdirectiveInject(p.ActivatedRoute),s.ɵɵdirectiveInject(u.LogService))},S.ɵcmp=s.ɵɵdefineComponent({type:S,selectors:[["app-adjust-storage"]],viewQuery:function(e,t){if(1&e&&s.ɵɵviewQuery(a.PaymentComponent,7),2&e){let e;s.ɵɵqueryRefresh(e=s.ɵɵloadQuery())&&(t.paymentComponent=e.first)}},inputs:{storageGbPrice:"storageGbPrice",add:"add",organizationId:"organizationId",interval:"interval"},outputs:{onAdjusted:"onAdjusted",onCanceled:"onCanceled"},decls:52,vars:26,consts:[["ngNativeValidate","",1,"card",3,"appApiAction","ngSubmit"],["form",""],[1,"card-body"],["type","button",1,"close",3,"appA11yTitle","click"],["aria-hidden","true"],[1,"card-body-header"],[1,"row"],[1,"form-group","col-6"],["for","storageAdjustment"],["id","storageAdjustment","type","number","name","StroageGbAdjustment","min","0","max","99","step","1","required","",1,"form-control",3,"ngModel","ngModelChange"],["class","mb-3",4,"ngIf"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"d-block","text-muted","mt-3"],[3,"showMethods"],[1,"mb-3"]],template:function(e,t){if(1&e&&(s.ɵɵelementStart(0,"form",0,1),s.ɵɵlistener("ngSubmit",(function(){return t.submit()})),s.ɵɵtext(2,"\n "),s.ɵɵelementStart(3,"div",2),s.ɵɵtext(4,"\n "),s.ɵɵelementStart(5,"button",3),s.ɵɵlistener("click",(function(){return t.cancel()})),s.ɵɵpipe(6,"i18n"),s.ɵɵtext(7,"\n "),s.ɵɵelementStart(8,"span",4),s.ɵɵtext(9,"×"),s.ɵɵelementEnd(),s.ɵɵtext(10,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(11,"\n "),s.ɵɵelementStart(12,"h3",5),s.ɵɵtext(13),s.ɵɵpipe(14,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(15,"\n "),s.ɵɵelementStart(16,"div",6),s.ɵɵtext(17,"\n "),s.ɵɵelementStart(18,"div",7),s.ɵɵtext(19,"\n "),s.ɵɵelementStart(20,"label",8),s.ɵɵtext(21),s.ɵɵpipe(22,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(23,"\n "),s.ɵɵelementStart(24,"input",9),s.ɵɵlistener("ngModelChange",(function(e){return t.storageAdjustment=e})),s.ɵɵelementEnd(),s.ɵɵtext(25,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(26,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(27,"\n "),s.ɵɵtemplate(28,x,9,15,"div",10),s.ɵɵtext(29,"\n "),s.ɵɵelementStart(30,"button",11),s.ɵɵtext(31,"\n "),s.ɵɵelement(32,"i",12),s.ɵɵpipe(33,"i18n"),s.ɵɵtext(34,"\n "),s.ɵɵelementStart(35,"span"),s.ɵɵtext(36),s.ɵɵpipe(37,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(38,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(39,"\n "),s.ɵɵelementStart(40,"button",13),s.ɵɵlistener("click",(function(){return t.cancel()})),s.ɵɵtext(41),s.ɵɵpipe(42,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(43,"\n "),s.ɵɵelementStart(44,"small",14),s.ɵɵtext(45),s.ɵɵpipe(46,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(47,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(48,"\n"),s.ɵɵelementEnd(),s.ɵɵtext(49,"\n"),s.ɵɵelement(50,"app-payment",15),s.ɵɵtext(51,"\n")),2&e){const e=s.ɵɵreference(1);s.ɵɵproperty("appApiAction",t.formPromise),s.ɵɵadvance(5),s.ɵɵpropertyInterpolate("appA11yTitle",s.ɵɵpipeBind1(6,12,"cancel")),s.ɵɵadvance(8),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(14,14,t.add?"addStorage":"removeStorage")),s.ɵɵadvance(8),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(22,16,t.add?"gbStorageAdd":"gbStorageRemove")),s.ɵɵadvance(3),s.ɵɵproperty("ngModel",t.storageAdjustment),s.ɵɵadvance(4),s.ɵɵproperty("ngIf",t.add),s.ɵɵadvance(2),s.ɵɵproperty("disabled",e.loading),s.ɵɵadvance(2),s.ɵɵpropertyInterpolate("title",s.ɵɵpipeBind1(33,18,"loading")),s.ɵɵadvance(4),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(37,20,"submit")),s.ɵɵadvance(5),s.ɵɵtextInterpolate1("\n ",s.ɵɵpipeBind1(42,22,"cancel"),"\n "),s.ɵɵadvance(4),s.ɵɵtextInterpolate1("\n ",s.ɵɵpipeBind1(46,24,t.add?"storageAddNote":"storageRemoveNote"),"\n "),s.ɵɵadvance(5),s.ɵɵproperty("showMethods",!1)}},directives:[m.NgControlStatusGroup,m.NgForm,h.ApiActionDirective,v.A11yTitleDirective,m.MinValidator,m.MaxValidator,m.NumberValueAccessor,m.DefaultValueAccessor,m.RequiredValidator,m.NgControlStatus,m.NgModel,f.NgIf,g.PaymentComponent],pipes:[y.I18nPipe,f.CurrencyPipe],encapsulation:2})},24406:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ApiKeyComponent=void 0;n(70143),n(61554);const r=n(32621),o=n(61554),a=n(70143),s=n(96832),l=n(637),c=n(50553),d=n(57490),p=n(38287),u=n(52900),m=n(72596);function h(e,t){if(1&e){const e=r.ɵɵgetCurrentView();r.ɵɵelementStart(0,"app-verify-master-password",15),r.ɵɵlistener("ngModelChange",(function(t){r.ɵɵrestoreView(e);return r.ɵɵnextContext().masterPassword=t})),r.ɵɵtext(1,"\n "),r.ɵɵelementEnd()}if(2&e){const e=r.ɵɵnextContext();r.ɵɵproperty("ngModel",e.masterPassword)}}function v(e,t){if(1&e&&(r.ɵɵelementStart(0,"app-callout",16),r.ɵɵtext(1),r.ɵɵpipe(2,"i18n"),r.ɵɵelementEnd()),2&e){const e=r.ɵɵnextContext();r.ɵɵadvance(1),r.ɵɵtextInterpolate(r.ɵɵpipeBind1(2,1,e.apiKeyWarning))}}function f(e,t){if(1&e&&(r.ɵɵelementStart(0,"app-callout",17),r.ɵɵpipe(1,"i18n"),r.ɵɵtext(2,"\n "),r.ɵɵelementStart(3,"p",18),r.ɵɵtext(4,"\n "),r.ɵɵelementStart(5,"strong"),r.ɵɵtext(6,"client_id:"),r.ɵɵelementEnd(),r.ɵɵelement(7,"br"),r.ɵɵtext(8,"\n "),r.ɵɵelementStart(9,"code"),r.ɵɵtext(10),r.ɵɵelementEnd(),r.ɵɵtext(11,"\n "),r.ɵɵelementEnd(),r.ɵɵtext(12,"\n "),r.ɵɵelementStart(13,"p",18),r.ɵɵtext(14,"\n "),r.ɵɵelementStart(15,"strong"),r.ɵɵtext(16,"client_secret:"),r.ɵɵelementEnd(),r.ɵɵelement(17,"br"),r.ɵɵtext(18,"\n "),r.ɵɵelementStart(19,"code"),r.ɵɵtext(20),r.ɵɵelementEnd(),r.ɵɵtext(21,"\n "),r.ɵɵelementEnd(),r.ɵɵtext(22,"\n "),r.ɵɵelementStart(23,"p",18),r.ɵɵtext(24,"\n "),r.ɵɵelementStart(25,"strong"),r.ɵɵtext(26,"scope:"),r.ɵɵelementEnd(),r.ɵɵelement(27,"br"),r.ɵɵtext(28,"\n "),r.ɵɵelementStart(29,"code"),r.ɵɵtext(30),r.ɵɵelementEnd(),r.ɵɵtext(31,"\n "),r.ɵɵelementEnd(),r.ɵɵtext(32,"\n "),r.ɵɵelementStart(33,"p",19),r.ɵɵtext(34,"\n "),r.ɵɵelementStart(35,"strong"),r.ɵɵtext(36,"grant_type:"),r.ɵɵelementEnd(),r.ɵɵelement(37,"br"),r.ɵɵtext(38,"\n "),r.ɵɵelementStart(39,"code"),r.ɵɵtext(40),r.ɵɵelementEnd(),r.ɵɵtext(41,"\n "),r.ɵɵelementEnd(),r.ɵɵtext(42,"\n "),r.ɵɵelementEnd()),2&e){const e=r.ɵɵnextContext();r.ɵɵpropertyInterpolate("title",r.ɵɵpipeBind1(1,5,"oauth2ClientCredentials")),r.ɵɵadvance(10),r.ɵɵtextInterpolate(e.clientId),r.ɵɵadvance(10),r.ɵɵtextInterpolate(e.clientSecret),r.ɵɵadvance(10),r.ɵɵtextInterpolate(e.scope),r.ɵɵadvance(10),r.ɵɵtextInterpolate(e.grantType)}}function g(e,t){if(1&e&&(r.ɵɵelementStart(0,"button",20),r.ɵɵtext(1,"\n "),r.ɵɵelement(2,"i",21),r.ɵɵpipe(3,"i18n"),r.ɵɵtext(4,"\n "),r.ɵɵelementStart(5,"span"),r.ɵɵtext(6),r.ɵɵpipe(7,"i18n"),r.ɵɵelementEnd(),r.ɵɵtext(8,"\n "),r.ɵɵelementEnd()),2&e){const e=r.ɵɵnextContext(),t=r.ɵɵreference(5);r.ɵɵproperty("disabled",t.loading),r.ɵɵadvance(2),r.ɵɵpropertyInterpolate("title",r.ɵɵpipeBind1(3,3,"loading")),r.ɵɵadvance(4),r.ɵɵtextInterpolate(r.ɵɵpipeBind1(7,5,e.isRotation?"rotateApiKey":"viewApiKey"))}}class y{constructor(e,t){this.userVerificationService=e,this.logService=t}submit(){return i(this,void 0,void 0,(function*(){try{this.formPromise=this.userVerificationService.buildRequest(this.masterPassword).then((e=>this.postKey(this.entityId,e)));const e=yield this.formPromise;this.clientSecret=e.apiKey,this.clientId=`${this.keyType}.${this.entityId}`}catch(e){this.logService.error(e)}}))}}t.ApiKeyComponent=y,y.ɵfac=function(e){return new(e||y)(r.ɵɵdirectiveInject(o.UserVerificationService),r.ɵɵdirectiveInject(a.LogService))},y.ɵcmp=r.ɵɵdefineComponent({type:y,selectors:[["app-api-key"]],decls:46,vars:17,consts:[["role","dialog","aria-modal","true","aria-labelledby","apiKeyTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable"],["ngNativeValidate","",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","apiKeyTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[1,"modal-body"],["ngDefaultControl","","name","secret",3,"ngModel","ngModelChange",4,"ngIf"],["type","warning",4,"ngIf"],["type","info","icon","bwi bwi-key",3,"title",4,"ngIf"],[1,"modal-footer"],["type","submit","class","btn btn-primary btn-submit",3,"disabled",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["ngDefaultControl","","name","secret",3,"ngModel","ngModelChange"],["type","warning"],["type","info","icon","bwi bwi-key",3,"title"],[1,"mb-1"],[1,"mb-0"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"]],template:function(e,t){1&e&&(r.ɵɵelementStart(0,"div",0),r.ɵɵtext(1,"\n "),r.ɵɵelementStart(2,"div",1),r.ɵɵtext(3,"\n "),r.ɵɵelementStart(4,"form",2,3),r.ɵɵlistener("ngSubmit",(function(){return t.submit()})),r.ɵɵtext(6,"\n "),r.ɵɵelementStart(7,"div",4),r.ɵɵtext(8,"\n "),r.ɵɵelementStart(9,"h2",5),r.ɵɵtext(10),r.ɵɵpipe(11,"i18n"),r.ɵɵelementEnd(),r.ɵɵtext(12,"\n "),r.ɵɵelementStart(13,"button",6),r.ɵɵpipe(14,"i18n"),r.ɵɵtext(15,"\n "),r.ɵɵelementStart(16,"span",7),r.ɵɵtext(17,"×"),r.ɵɵelementEnd(),r.ɵɵtext(18,"\n "),r.ɵɵelementEnd(),r.ɵɵtext(19,"\n "),r.ɵɵelementEnd(),r.ɵɵtext(20,"\n "),r.ɵɵelementStart(21,"div",8),r.ɵɵtext(22,"\n "),r.ɵɵelementStart(23,"p"),r.ɵɵtext(24),r.ɵɵpipe(25,"i18n"),r.ɵɵelementEnd(),r.ɵɵtext(26,"\n "),r.ɵɵtemplate(27,h,2,1,"app-verify-master-password",9),r.ɵɵtext(28,"\n\n "),r.ɵɵtemplate(29,v,3,3,"app-callout",10),r.ɵɵtext(30,"\n "),r.ɵɵtemplate(31,f,43,7,"app-callout",11),r.ɵɵtext(32,"\n "),r.ɵɵelementEnd(),r.ɵɵtext(33,"\n "),r.ɵɵelementStart(34,"div",12),r.ɵɵtext(35,"\n "),r.ɵɵtemplate(36,g,9,7,"button",13),r.ɵɵtext(37,"\n "),r.ɵɵelementStart(38,"button",14),r.ɵɵtext(39),r.ɵɵpipe(40,"i18n"),r.ɵɵelementEnd(),r.ɵɵtext(41,"\n "),r.ɵɵelementEnd(),r.ɵɵtext(42,"\n "),r.ɵɵelementEnd(),r.ɵɵtext(43,"\n "),r.ɵɵelementEnd(),r.ɵɵtext(44,"\n"),r.ɵɵelementEnd(),r.ɵɵtext(45,"\n")),2&e&&(r.ɵɵadvance(4),r.ɵɵproperty("appApiAction",t.formPromise),r.ɵɵadvance(6),r.ɵɵtextInterpolate(r.ɵɵpipeBind1(11,9,t.apiKeyTitle)),r.ɵɵadvance(3),r.ɵɵpropertyInterpolate("appA11yTitle",r.ɵɵpipeBind1(14,11,"close")),r.ɵɵadvance(11),r.ɵɵtextInterpolate(r.ɵɵpipeBind1(25,13,t.apiKeyDescription)),r.ɵɵadvance(3),r.ɵɵproperty("ngIf",!t.clientSecret),r.ɵɵadvance(2),r.ɵɵproperty("ngIf",t.clientSecret),r.ɵɵadvance(2),r.ɵɵproperty("ngIf",t.clientSecret),r.ɵɵadvance(5),r.ɵɵproperty("ngIf",!t.clientSecret),r.ɵɵadvance(3),r.ɵɵtextInterpolate1("\n ",r.ɵɵpipeBind1(40,15,"close"),"\n "))},directives:[s.NgControlStatusGroup,s.NgForm,l.ApiActionDirective,c.A11yTitleDirective,d.NgIf,p.VerifyMasterPasswordComponent,s.DefaultValueAccessor,s.NgControlStatus,s.NgModel,u.CalloutComponent],pipes:[m.I18nPipe],encapsulation:2})},5286:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeEmailComponent=void 0;n(91092),n(82058),n(40349),n(70143),n(36424),n(99954),n(77243);const r=n(96103),o=n(29565),a=n(57976),s=n(32621),l=n(91092),c=n(40349),d=n(99954),p=n(82058),u=n(36424),m=n(70143),h=n(77243),v=n(96832),f=n(637),g=n(57490),y=n(966),x=n(52900),S=n(72596);function b(e,t){1&e&&(s.ɵɵelementStart(0,"app-callout",14),s.ɵɵtext(1),s.ɵɵpipe(2,"i18n"),s.ɵɵelementEnd()),2&e&&(s.ɵɵadvance(1),s.ɵɵtextInterpolate1("\n ",s.ɵɵpipeBind1(2,1,"changeEmailTwoFactorWarning"),"\n "))}function w(e,t){if(1&e){const e=s.ɵɵgetCurrentView();s.ɵɵelementContainerStart(0),s.ɵɵtext(1,"\n "),s.ɵɵelement(2,"hr"),s.ɵɵtext(3,"\n "),s.ɵɵelementStart(4,"p"),s.ɵɵtext(5),s.ɵɵpipe(6,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(7,"\n "),s.ɵɵelementStart(8,"app-callout",14),s.ɵɵtext(9),s.ɵɵpipe(10,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(11,"\n "),s.ɵɵelementStart(12,"div",3),s.ɵɵtext(13,"\n "),s.ɵɵelementStart(14,"div",4),s.ɵɵtext(15,"\n "),s.ɵɵelementStart(16,"div",5),s.ɵɵtext(17,"\n "),s.ɵɵelementStart(18,"label",15),s.ɵɵtext(19),s.ɵɵpipe(20,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(21,"\n "),s.ɵɵelementStart(22,"input",16),s.ɵɵlistener("ngModelChange",(function(t){s.ɵɵrestoreView(e);return s.ɵɵnextContext().token=t})),s.ɵɵelementEnd(),s.ɵɵtext(23,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(24,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(25,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(26,"\n "),s.ɵɵelementContainerEnd()}if(2&e){const e=s.ɵɵnextContext();s.ɵɵadvance(5),s.ɵɵtextInterpolate(s.ɵɵpipeBind2(6,4,"changeEmailDesc",e.newEmail)),s.ɵɵadvance(4),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(10,7,"loggedOutWarning")),s.ɵɵadvance(10),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(20,9,"code")),s.ɵɵadvance(3),s.ɵɵproperty("ngModel",e.token)}}function I(e,t){1&e&&(s.ɵɵelementStart(0,"span"),s.ɵɵtext(1),s.ɵɵpipe(2,"i18n"),s.ɵɵelementEnd()),2&e&&(s.ɵɵadvance(1),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(2,1,"continue")))}function C(e,t){1&e&&(s.ɵɵelementStart(0,"span"),s.ɵɵtext(1),s.ɵɵpipe(2,"i18n"),s.ɵɵelementEnd()),2&e&&(s.ɵɵadvance(1),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(2,1,"changeEmail")))}function E(e,t){if(1&e){const e=s.ɵɵgetCurrentView();s.ɵɵelementStart(0,"button",17),s.ɵɵlistener("click",(function(){s.ɵɵrestoreView(e);return s.ɵɵnextContext().reset()})),s.ɵɵtext(1),s.ɵɵpipe(2,"i18n"),s.ɵɵelementEnd()}2&e&&(s.ɵɵadvance(1),s.ɵɵtextInterpolate1("\n ",s.ɵɵpipeBind1(2,1,"cancel"),"\n "))}class P{constructor(e,t,n,i,r,o,a){this.apiService=e,this.i18nService=t,this.platformUtilsService=n,this.cryptoService=i,this.messagingService=r,this.logService=o,this.stateService=a,this.tokenSent=!1,this.showTwoFactorEmailWarning=!1}ngOnInit(){return i(this,void 0,void 0,(function*(){const e=yield this.apiService.getTwoFactorProviders();this.showTwoFactorEmailWarning=e.data.some((e=>e.type===a.TwoFactorProviderType.Email&&e.enabled))}))}submit(){return i(this,void 0,void 0,(function*(){if(yield this.cryptoService.hasEncKey())if(this.newEmail=this.newEmail.trim().toLowerCase(),this.tokenSent){const t=new r.EmailRequest;t.token=this.token,t.newEmail=this.newEmail,t.masterPasswordHash=yield this.cryptoService.hashPassword(this.masterPassword,null);const n=yield this.stateService.getKdfType(),i=yield this.stateService.getKdfIterations(),o=yield this.cryptoService.makeKey(this.masterPassword,this.newEmail,n,i);t.newMasterPasswordHash=yield this.cryptoService.hashPassword(this.masterPassword,o);const a=yield this.cryptoService.remakeEncKey(o);t.key=a[1].encryptedString;try{this.formPromise=this.apiService.postEmail(t),yield this.formPromise,this.reset(),this.platformUtilsService.showToast("success",this.i18nService.t("emailChanged"),this.i18nService.t("logBackIn")),this.messagingService.send("logout")}catch(e){this.logService.error(e)}}else{const t=new o.EmailTokenRequest;t.newEmail=this.newEmail,t.masterPasswordHash=yield this.cryptoService.hashPassword(this.masterPassword,null);try{this.formPromise=this.apiService.postEmailToken(t),yield this.formPromise,this.tokenSent=!0}catch(e){this.logService.error(e)}}else this.platformUtilsService.showToast("error",null,this.i18nService.t("updateKey"))}))}reset(){this.token=this.newEmail=this.masterPassword=null,this.tokenSent=!1}}t.ChangeEmailComponent=P,P.ɵfac=function(e){return new(e||P)(s.ɵɵdirectiveInject(l.ApiService),s.ɵɵdirectiveInject(c.I18nService),s.ɵɵdirectiveInject(d.PlatformUtilsService),s.ɵɵdirectiveInject(p.CryptoService),s.ɵɵdirectiveInject(u.MessagingService),s.ɵɵdirectiveInject(m.LogService),s.ɵɵdirectiveInject(h.StateService))},P.ɵcmp=s.ɵɵdefineComponent({type:P,selectors:[["app-change-email"]],decls:44,vars:20,consts:[["ngNativeValidate","",3,"appApiAction","ngSubmit"],["form",""],["type","warning",4,"ngIf"],[1,"row"],[1,"col-6"],[1,"form-group"],["for","masterPassword"],["id","masterPassword","type","password","name","MasterPasswordHash","required","","appInputVerbatim","",1,"form-control",3,"ngModel","readonly","ngModelChange"],["for","newEmail"],["id","newEmail","type","text","name","NewEmail","required","","inputmode","email","appInputVerbatim","false",1,"form-control",3,"ngModel","readonly","ngModelChange"],[4,"ngIf"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","button","class","btn btn-outline-secondary",3,"click",4,"ngIf"],["type","warning"],["for","token"],["id","token","type","text","name","Token","required","","appInputVerbatim","",1,"form-control",3,"ngModel","ngModelChange"],["type","button",1,"btn","btn-outline-secondary",3,"click"]],template:function(e,t){if(1&e&&(s.ɵɵelementStart(0,"form",0,1),s.ɵɵlistener("ngSubmit",(function(){return t.submit()})),s.ɵɵtext(2,"\n "),s.ɵɵtemplate(3,b,3,3,"app-callout",2),s.ɵɵtext(4,"\n "),s.ɵɵelementStart(5,"div",3),s.ɵɵtext(6,"\n "),s.ɵɵelementStart(7,"div",4),s.ɵɵtext(8,"\n "),s.ɵɵelementStart(9,"div",5),s.ɵɵtext(10,"\n "),s.ɵɵelementStart(11,"label",6),s.ɵɵtext(12),s.ɵɵpipe(13,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(14,"\n "),s.ɵɵelementStart(15,"input",7),s.ɵɵlistener("ngModelChange",(function(e){return t.masterPassword=e})),s.ɵɵelementEnd(),s.ɵɵtext(16,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(17,"\n "),s.ɵɵelementStart(18,"div",5),s.ɵɵtext(19,"\n "),s.ɵɵelementStart(20,"label",8),s.ɵɵtext(21),s.ɵɵpipe(22,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(23,"\n "),s.ɵɵelementStart(24,"input",9),s.ɵɵlistener("ngModelChange",(function(e){return t.newEmail=e})),s.ɵɵelementEnd(),s.ɵɵtext(25,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(26,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(27,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(28,"\n "),s.ɵɵtemplate(29,w,27,11,"ng-container",10),s.ɵɵtext(30,"\n "),s.ɵɵelementStart(31,"button",11),s.ɵɵtext(32,"\n "),s.ɵɵelement(33,"i",12),s.ɵɵpipe(34,"i18n"),s.ɵɵtext(35,"\n "),s.ɵɵtemplate(36,I,3,3,"span",10),s.ɵɵtext(37,"\n "),s.ɵɵtemplate(38,C,3,3,"span",10),s.ɵɵtext(39,"\n "),s.ɵɵelementEnd(),s.ɵɵtext(40,"\n "),s.ɵɵtemplate(41,E,3,3,"button",13),s.ɵɵtext(42,"\n"),s.ɵɵelementEnd(),s.ɵɵtext(43,"\n")),2&e){const e=s.ɵɵreference(1);s.ɵɵproperty("appApiAction",t.formPromise),s.ɵɵadvance(3),s.ɵɵproperty("ngIf",t.showTwoFactorEmailWarning),s.ɵɵadvance(9),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(13,14,"masterPass")),s.ɵɵadvance(3),s.ɵɵproperty("ngModel",t.masterPassword)("readonly",t.tokenSent),s.ɵɵadvance(6),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(22,16,"newEmail")),s.ɵɵadvance(3),s.ɵɵproperty("ngModel",t.newEmail)("readonly",t.tokenSent),s.ɵɵadvance(5),s.ɵɵproperty("ngIf",t.tokenSent),s.ɵɵadvance(2),s.ɵɵproperty("disabled",e.loading),s.ɵɵadvance(2),s.ɵɵpropertyInterpolate("title",s.ɵɵpipeBind1(34,18,"loading")),s.ɵɵadvance(3),s.ɵɵproperty("ngIf",!t.tokenSent),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",t.tokenSent),s.ɵɵadvance(3),s.ɵɵproperty("ngIf",t.tokenSent)}},directives:[v.NgControlStatusGroup,v.NgForm,f.ApiActionDirective,g.NgIf,v.DefaultValueAccessor,v.RequiredValidator,y.InputVerbatimDirective,v.NgControlStatus,v.NgModel,x.CalloutComponent],pipes:[S.I18nPipe],encapsulation:2})},57608:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeKdfComponent=void 0;n(91092),n(82058),n(40349),n(70143),n(36424),n(99954),n(77243);const r=n(9974),o=n(25847),a=n(32621),s=n(91092),l=n(40349),c=n(99954),d=n(82058),p=n(36424),u=n(70143),m=n(77243),h=n(52900),v=n(96832),f=n(637),g=n(966),y=n(50553),x=n(57490),S=n(72596);function b(e,t){if(1&e&&(a.ɵɵelementStart(0,"option",21),a.ɵɵtext(1),a.ɵɵelementEnd()),2&e){const e=t.$implicit;a.ɵɵproperty("ngValue",e.value),a.ɵɵadvance(1),a.ɵɵtextInterpolate(e.name)}}class w{constructor(e,t,n,i,r,a,s){this.apiService=e,this.i18nService=t,this.platformUtilsService=n,this.cryptoService=i,this.messagingService=r,this.logService=a,this.stateService=s,this.kdf=o.KdfType.PBKDF2_SHA256,this.kdfOptions=[],this.kdfOptions=[{name:"PBKDF2 SHA-256",value:o.KdfType.PBKDF2_SHA256}]}ngOnInit(){return i(this,void 0,void 0,(function*(){this.kdf=yield this.stateService.getKdfType(),this.kdfIterations=yield this.stateService.getKdfIterations()}))}submit(){return i(this,void 0,void 0,(function*(){if(!(yield this.cryptoService.hasEncKey()))return void this.platformUtilsService.showToast("error",null,this.i18nService.t("updateKey"));const e=new r.KdfRequest;e.kdf=this.kdf,e.kdfIterations=this.kdfIterations,e.masterPasswordHash=yield this.cryptoService.hashPassword(this.masterPassword,null);const t=yield this.stateService.getEmail(),n=yield this.cryptoService.makeKey(this.masterPassword,t,this.kdf,this.kdfIterations);e.newMasterPasswordHash=yield this.cryptoService.hashPassword(this.masterPassword,n);const i=yield this.cryptoService.remakeEncKey(n);e.key=i[1].encryptedString;try{this.formPromise=this.apiService.postAccountKdf(e),yield this.formPromise,this.platformUtilsService.showToast("success",this.i18nService.t("encKeySettingsChanged"),this.i18nService.t("logBackIn")),this.messagingService.send("logout")}catch(o){this.logService.error(o)}}))}}t.ChangeKdfComponent=w,w.ɵfac=function(e){return new(e||w)(a.ɵɵdirectiveInject(s.ApiService),a.ɵɵdirectiveInject(l.I18nService),a.ɵɵdirectiveInject(c.PlatformUtilsService),a.ɵɵdirectiveInject(d.CryptoService),a.ɵɵdirectiveInject(p.MessagingService),a.ɵɵdirectiveInject(u.LogService),a.ɵɵdirectiveInject(m.StateService))},w.ɵcmp=a.ɵɵdefineComponent({type:w,selectors:[["app-change-kdf"]],decls:95,vars:45,consts:[["type","warning"],["ngNativeValidate","","autocomplete","off",3,"appApiAction","ngSubmit"],["form",""],[1,"row"],[1,"col-6"],[1,"form-group"],["for","kdfMasterPassword"],["id","kdfMasterPassword","type","password","name","MasterPasswordHash","required","","appInputVerbatim","",1,"form-control",3,"ngModel","ngModelChange"],[1,"form-group","mb-0"],["for","kdf"],["href","https://en.wikipedia.org/wiki/Key_derivation_function","target","_blank","rel","noopener",1,"ml-auto",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["id","kdf","name","Kdf","required","",1,"form-control",3,"ngModel","ngModelChange"],[3,"ngValue",4,"ngFor","ngForOf"],["for","kdfIterations"],["href","https://bitwarden.com/help/what-encryption-is-used/#pbkdf2","target","_blank","rel","noopener",1,"ml-auto",3,"appA11yTitle"],["id","kdfIterations","type","number","min","5000","max","2000000","name","KdfIterations","required","",1,"form-control",3,"ngModel","ngModelChange"],[1,"col-12"],[1,"small","form-text","text-muted"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],[3,"ngValue"]],template:function(e,t){if(1&e&&(a.ɵɵelementStart(0,"app-callout",0),a.ɵɵtext(1),a.ɵɵpipe(2,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(3,"\n"),a.ɵɵelementStart(4,"form",1,2),a.ɵɵlistener("ngSubmit",(function(){return t.submit()})),a.ɵɵtext(6,"\n "),a.ɵɵelementStart(7,"div",3),a.ɵɵtext(8,"\n "),a.ɵɵelementStart(9,"div",4),a.ɵɵtext(10,"\n "),a.ɵɵelementStart(11,"div",5),a.ɵɵtext(12,"\n "),a.ɵɵelementStart(13,"label",6),a.ɵɵtext(14),a.ɵɵpipe(15,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(16,"\n "),a.ɵɵelementStart(17,"input",7),a.ɵɵlistener("ngModelChange",(function(e){return t.masterPassword=e})),a.ɵɵelementEnd(),a.ɵɵtext(18,"\n "),a.ɵɵelementEnd(),a.ɵɵtext(19,"\n "),a.ɵɵelementEnd(),a.ɵɵtext(20,"\n "),a.ɵɵelementEnd(),a.ɵɵtext(21,"\n "),a.ɵɵelementStart(22,"div",3),a.ɵɵtext(23,"\n "),a.ɵɵelementStart(24,"div",4),a.ɵɵtext(25,"\n "),a.ɵɵelementStart(26,"div",8),a.ɵɵtext(27,"\n "),a.ɵɵelementStart(28,"label",9),a.ɵɵtext(29),a.ɵɵpipe(30,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(31,"\n "),a.ɵɵelementStart(32,"a",10),a.ɵɵpipe(33,"i18n"),a.ɵɵtext(34,"\n "),a.ɵɵelement(35,"i",11),a.ɵɵtext(36,"\n "),a.ɵɵelementEnd(),a.ɵɵtext(37,"\n "),a.ɵɵelementStart(38,"select",12),a.ɵɵlistener("ngModelChange",(function(e){return t.kdf=e})),a.ɵɵtext(39,"\n "),a.ɵɵtemplate(40,b,2,2,"option",13),a.ɵɵtext(41,"\n "),a.ɵɵelementEnd(),a.ɵɵtext(42,"\n "),a.ɵɵelementEnd(),a.ɵɵtext(43,"\n "),a.ɵɵelementEnd(),a.ɵɵtext(44,"\n "),a.ɵɵelementStart(45,"div",4),a.ɵɵtext(46,"\n "),a.ɵɵelementStart(47,"div",8),a.ɵɵtext(48,"\n "),a.ɵɵelementStart(49,"label",14),a.ɵɵtext(50),a.ɵɵpipe(51,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(52,"\n "),a.ɵɵelementStart(53,"a",15),a.ɵɵpipe(54,"i18n"),a.ɵɵtext(55,"\n "),a.ɵɵelement(56,"i",11),a.ɵɵtext(57,"\n "),a.ɵɵelementEnd(),a.ɵɵtext(58,"\n "),a.ɵɵelementStart(59,"input",16),a.ɵɵlistener("ngModelChange",(function(e){return t.kdfIterations=e})),a.ɵɵelementEnd(),a.ɵɵtext(60,"\n "),a.ɵɵelementEnd(),a.ɵɵtext(61,"\n "),a.ɵɵelementEnd(),a.ɵɵtext(62,"\n "),a.ɵɵelementStart(63,"div",17),a.ɵɵtext(64,"\n "),a.ɵɵelementStart(65,"div",5),a.ɵɵtext(66,"\n "),a.ɵɵelementStart(67,"div",18),a.ɵɵtext(68,"\n "),a.ɵɵelementStart(69,"p"),a.ɵɵtext(70),a.ɵɵpipe(71,"i18n"),a.ɵɵpipe(72,"number"),a.ɵɵelementEnd(),a.ɵɵtext(73,"\n "),a.ɵɵelementStart(74,"strong"),a.ɵɵtext(75),a.ɵɵpipe(76,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(77),a.ɵɵpipe(78,"i18n"),a.ɵɵpipe(79,"number"),a.ɵɵelementEnd(),a.ɵɵtext(80,"\n "),a.ɵɵelementEnd(),a.ɵɵtext(81,"\n "),a.ɵɵelementEnd(),a.ɵɵtext(82,"\n "),a.ɵɵelementEnd(),a.ɵɵtext(83,"\n "),a.ɵɵelementStart(84,"button",19),a.ɵɵtext(85,"\n "),a.ɵɵelement(86,"i",20),a.ɵɵpipe(87,"i18n"),a.ɵɵtext(88,"\n "),a.ɵɵelementStart(89,"span"),a.ɵɵtext(90),a.ɵɵpipe(91,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(92,"\n "),a.ɵɵelementEnd(),a.ɵɵtext(93,"\n"),a.ɵɵelementEnd(),a.ɵɵtext(94,"\n")),2&e){const e=a.ɵɵreference(5);a.ɵɵadvance(1),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(2,17,"loggedOutWarning")),a.ɵɵadvance(3),a.ɵɵproperty("appApiAction",t.formPromise),a.ɵɵadvance(10),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(15,19,"masterPass")),a.ɵɵadvance(3),a.ɵɵproperty("ngModel",t.masterPassword),a.ɵɵadvance(12),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(30,21,"kdfAlgorithm")),a.ɵɵadvance(3),a.ɵɵpropertyInterpolate("appA11yTitle",a.ɵɵpipeBind1(33,23,"learnMore")),a.ɵɵadvance(6),a.ɵɵproperty("ngModel",t.kdf),a.ɵɵadvance(2),a.ɵɵproperty("ngForOf",t.kdfOptions),a.ɵɵadvance(10),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(51,25,"kdfIterations")),a.ɵɵadvance(3),a.ɵɵpropertyInterpolate("appA11yTitle",a.ɵɵpipeBind1(54,27,"learnMore")),a.ɵɵadvance(6),a.ɵɵproperty("ngModel",t.kdfIterations),a.ɵɵadvance(11),a.ɵɵtextInterpolate(a.ɵɵpipeBind2(71,29,"kdfIterationsDesc",a.ɵɵpipeBind1(72,32,1e5))),a.ɵɵadvance(5),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(76,34,"warning")),a.ɵɵadvance(2),a.ɵɵtextInterpolate1(": ",a.ɵɵpipeBind2(78,36,"kdfIterationsWarning",a.ɵɵpipeBind1(79,39,5e4)),"\n "),a.ɵɵadvance(7),a.ɵɵproperty("disabled",e.loading),a.ɵɵadvance(2),a.ɵɵpropertyInterpolate("title",a.ɵɵpipeBind1(87,41,"loading")),a.ɵɵadvance(4),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(91,43,"changeKdf"))}},directives:[h.CalloutComponent,v.NgControlStatusGroup,v.NgForm,f.ApiActionDirective,v.DefaultValueAccessor,v.RequiredValidator,g.InputVerbatimDirective,v.NgControlStatus,v.NgModel,y.A11yTitleDirective,v.SelectControlValueAccessor,x.NgForOf,v.MinValidator,v.MaxValidator,v.NumberValueAccessor,v.NgSelectOption,v.ɵNgSelectMultipleOption],pipes:[S.I18nPipe,x.DecimalPipe],encapsulation:2})},43450:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function s(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ChangePasswordComponent=void 0;n(91092),n(68062),n(82058),n(4349),n(40349),n(36424),n(94308),n(86193),n(99954),n(10685),n(94129),n(77243),n(2173);const r=n(48921),o=n(26515),a=n(70829),s=n(57509),l=n(62632),c=n(82041),d=n(63750),p=n(25122),u=n(76171),m=n(45022),h=n(32621),v=n(40349),f=n(82058),g=n(36424),y=n(77243),x=n(86193),S=n(99954),b=n(10685),w=n(4349),I=n(68062),C=n(2173),E=n(91092),P=n(94129),k=n(94308),A=n(52900),O=n(57490),T=n(96832),M=n(637),D=n(966),B=n(14296),R=n(50553),U=n(72596);function V(e,t){if(1&e&&(h.ɵɵelementStart(0,"app-callout",21),h.ɵɵtext(1,"\n"),h.ɵɵelementEnd()),2&e){const e=h.ɵɵnextContext();h.ɵɵproperty("enforcedPolicyOptions",e.enforcedPolicyOptions)}}class F extends r.ChangePasswordComponent{constructor(e,t,n,i,r,o,a,s,l,c,d,p,u){super(e,t,n,r,o,a,i),this.folderService=s,this.cipherService=l,this.syncService=c,this.apiService=d,this.sendService=p,this.organizationService=u,this.rotateEncKey=!1}rotateEncKeyClicked(){return i(this,void 0,void 0,(function*(){if(this.rotateEncKey){const e=yield this.cipherService.getAllDecrypted();let t=!1;if(null!=e)for(let n=0;n"+this.code+'{{ \"singleSignOn\" | i18n }}
\n\n {{ \"addExistingOrganization\" | i18n }}\n
\n \n \n
\n \n \n \n \n \n {{ o.name }}\n \n \n \n \n {{ \"clients\" | i18n }}
\n\n \n \n
\n \n \n \n \n \n \n {{ o.organizationName }}\n \n \n \n {{ \"newClientOrganization\" | i18n }}
\n\n
\n \n \n {{ \"confirmUsers\" | i18n }}\n
\n \n \n \n
\n \n \n \n {{ \"user\" | i18n }} \n {{ \"fingerprint\" | i18n }} \n \n \n \n \n \n {{ user.email }}\n {{ user.name }}\n \n \n {{ fingerprints.get(user.id) }}\n \n \n \n \n \n \n {{ user.email }}\n {{ user.name }}\n \n \n {{ \"bulkFilteredMessage\" | i18n }}\n \n \n \n
\n \n \n \n {{ \"user\" | i18n }} \n {{ \"status\" | i18n }} \n \n \n \n \n \n {{ user.email }}\n {{ user.name }}\n \n \n {{ statuses.get(user.id) }}\n \n \n {{ \"bulkFilteredMessage\" | i18n }}\n \n \n {{ \"removeUsers\" | i18n }}\n
\n \n \n \n
\n \n \n \n {{ \"user\" | i18n }} \n \n \n \n \n \n {{ user.email }}\n {{ user.name }}\n \n \n \n
\n \n \n \n {{ \"user\" | i18n }} \n {{ \"status\" | i18n }} \n \n \n \n \n \n {{ user.email }}\n {{ user.name }}\n \n \n {{ statuses.get(user.id) }}\n \n \n {{ \"bulkFilteredMessage\" | i18n }}\n \n {{ \"eventLogs\" | i18n }}
\n \n \n
\n \n\n \n \n \n {{ \"timestamp\" | i18n }} \n \n {{ \"device\" | i18n }}\n \n {{ \"user\" | i18n }} \n {{ \"event\" | i18n }} \n \n \n \n {{ e.date | date: \"medium\" }} \n \n \n {{ e.appName }}, {{ e.ip }}\n \n \n {{ e.userName }}\n \n \n {{ \"people\" | i18n }}
\n \n \n
\n \n \n \n \n \n \n \n \n \n {{ u.email }}\n {{\n \"invited\" | i18n\n }}\n {{\n \"accepted\" | i18n\n }}\n {{ u.name }}\n \n \n \n \n {{ \"providerAdmin\" | i18n }}\n {{ \"serviceUser\" | i18n }}\n {{ \"custom\" | i18n }}\n \n \n \n \n \n
\n {{ \"myProvider\" | i18n }}
\n\n
{{ \"setupProvider\" | i18n }}
\n \",\n})\nexport class AvatarComponent implements OnChanges, OnInit {\n @Input() data: string;\n @Input() email: string;\n @Input() size = 45;\n @Input() charCount = 2;\n @Input() textColor = \"#ffffff\";\n @Input() fontSize = 20;\n @Input() fontWeight = 300;\n @Input() dynamic = false;\n @Input() circle = false;\n\n src: string;\n\n constructor(\n public sanitizer: DomSanitizer,\n private cryptoFunctionService: CryptoFunctionService,\n private stateService: StateService\n ) {}\n\n ngOnInit() {\n if (!this.dynamic) {\n this.generate();\n }\n }\n\n ngOnChanges() {\n if (this.dynamic) {\n this.generate();\n }\n }\n\n private async generate() {\n const enableGravatars = await this.stateService.getEnableGravitars();\n if (enableGravatars && this.email != null) {\n const hashBytes = await this.cryptoFunctionService.hash(\n this.email.toLowerCase().trim(),\n \"md5\"\n );\n const hash = Utils.fromBufferToHex(hashBytes).toLowerCase();\n this.src = \"https://www.gravatar.com/avatar/\" + hash + \"?s=\" + this.size + \"&r=pg&d=retro\";\n } else {\n let chars: string = null;\n const upperData = this.data.toUpperCase();\n\n if (this.charCount > 1) {\n chars = this.getFirstLetters(upperData, this.charCount);\n }\n if (chars == null) {\n chars = this.unicodeSafeSubstring(upperData, this.charCount);\n }\n\n // If the chars contain an emoji, only show it.\n if (chars.match(Utils.regexpEmojiPresentation)) {\n chars = chars.match(Utils.regexpEmojiPresentation)[0];\n }\n\n const charObj = this.getCharText(chars);\n const color = this.stringToColor(upperData);\n const svg = this.getSvg(this.size, color);\n svg.appendChild(charObj);\n const html = window.document.createElement(\"div\").appendChild(svg).outerHTML;\n const svgHtml = window.btoa(unescape(encodeURIComponent(html)));\n this.src = \"data:image/svg+xml;base64,\" + svgHtml;\n }\n }\n\n private stringToColor(str: string): string {\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n // tslint:disable-next-line\n hash = str.charCodeAt(i) + ((hash << 5) - hash);\n }\n let color = \"#\";\n for (let i = 0; i < 3; i++) {\n // tslint:disable-next-line\n const value = (hash >> (i * 8)) & 0xff;\n color += (\"00\" + value.toString(16)).substr(-2);\n }\n return color;\n }\n\n private getFirstLetters(data: string, count: number): string {\n const parts = data.split(\" \");\n if (parts.length > 1) {\n let text = \"\";\n for (let i = 0; i < count; i++) {\n text += this.unicodeSafeSubstring(parts[i], 1);\n }\n return text;\n }\n return null;\n }\n\n private getSvg(size: number, color: string): HTMLElement {\n const svgTag = window.document.createElement(\"svg\");\n svgTag.setAttribute(\"xmlns\", \"http://www.w3.org/2000/svg\");\n svgTag.setAttribute(\"pointer-events\", \"none\");\n svgTag.setAttribute(\"width\", size.toString());\n svgTag.setAttribute(\"height\", size.toString());\n svgTag.style.backgroundColor = color;\n svgTag.style.width = size + \"px\";\n svgTag.style.height = size + \"px\";\n return svgTag;\n }\n\n private getCharText(character: string): HTMLElement {\n const textTag = window.document.createElement(\"text\");\n textTag.setAttribute(\"text-anchor\", \"middle\");\n textTag.setAttribute(\"y\", \"50%\");\n textTag.setAttribute(\"x\", \"50%\");\n textTag.setAttribute(\"dy\", \"0.35em\");\n textTag.setAttribute(\"pointer-events\", \"auto\");\n textTag.setAttribute(\"fill\", this.textColor);\n textTag.setAttribute(\n \"font-family\",\n '\"Open Sans\",\"Helvetica Neue\",Helvetica,Arial,' +\n 'sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\"'\n );\n textTag.textContent = character;\n textTag.style.fontWeight = this.fontWeight.toString();\n textTag.style.fontSize = this.fontSize + \"px\";\n return textTag;\n }\n\n private unicodeSafeSubstring(str: string, count: number) {\n const characters = str.match(/./gu);\n return characters != null ? characters.slice(0, count).join(\"\") : \"\";\n }\n}\n","import { Component, Input, OnInit } from \"@angular/core\";\n\nimport { I18nService } from \"jslib-common/abstractions/i18n.service\";\n\nimport { MasterPasswordPolicyOptions } from \"jslib-common/models/domain/masterPasswordPolicyOptions\";\n\n@Component({\n selector: \"app-callout\",\n templateUrl: \"callout.component.html\",\n})\nexport class CalloutComponent implements OnInit {\n @Input() type = \"info\";\n @Input() icon: string;\n @Input() title: string;\n @Input() clickable: boolean;\n @Input() enforcedPolicyOptions: MasterPasswordPolicyOptions;\n @Input() enforcedPolicyMessage: string;\n @Input() useAlertRole = false;\n\n calloutStyle: string;\n\n constructor(private i18nService: I18nService) {}\n\n ngOnInit() {\n this.calloutStyle = this.type;\n\n if (this.enforcedPolicyMessage === undefined) {\n this.enforcedPolicyMessage = this.i18nService.t(\"masterPasswordPolicyInEffect\");\n }\n\n if (this.type === \"warning\" || this.type === \"danger\") {\n if (this.type === \"danger\") {\n this.calloutStyle = \"danger\";\n }\n if (this.title === undefined) {\n this.title = this.i18nService.t(\"warning\");\n }\n if (this.icon === undefined) {\n this.icon = \"bwi-exclamation-triangle\";\n }\n } else if (this.type === \"error\") {\n this.calloutStyle = \"danger\";\n if (this.title === undefined) {\n this.title = this.i18nService.t(\"error\");\n }\n if (this.icon === undefined) {\n this.icon = \"bwi-error\";\n }\n } else if (this.type === \"tip\") {\n this.calloutStyle = \"success\";\n if (this.title === undefined) {\n this.title = this.i18nService.t(\"tip\");\n }\n if (this.icon === undefined) {\n this.icon = \"bwi-lightbulb\";\n }\n }\n }\n\n getPasswordScoreAlertDisplay() {\n if (this.enforcedPolicyOptions == null) {\n return \"\";\n }\n\n let str: string;\n switch (this.enforcedPolicyOptions.minComplexity) {\n case 4:\n str = this.i18nService.t(\"strong\");\n break;\n case 3:\n str = this.i18nService.t(\"good\");\n break;\n default:\n str = this.i18nService.t(\"weak\");\n break;\n }\n return str + \" (\" + this.enforcedPolicyOptions.minComplexity + \")\";\n }\n}\n","
\n \n {{ title }}\n
\n \n
\n \n \n