import { Directive , EventEmitter , OnDestroy , Output } from '@angular/core' ; import { BehaviorSubject , Observable , Subscription } from 'rxjs' ; import { map } from 'rxjs/operators' ; import { MultiFactorAuthService , MultiFactorPanel , } from '../../services/multi-factor-auth-service' ; /**
 * Abstract class for MFA input forms.
 */ @ Directive ( ) export abstract class AbstractMFAFormComponent implements OnDestroy { /**
     * The code a user enters
     */ code : string = '' ; @ Output ( 'onVerify' ) onVerify : EventEmitter < any > = new EventEmitter ( ) ; @ Output ( 'onDismiss' ) onDismiss : EventEmitter < any > = new EventEmitter ( ) ; returns { BehaviorSubject < boolean > } get inProgress$ ( ) : BehaviorSubject < boolean > { return this . service . inProgress$ ; } returns { BehaviorSubject < MultiFactorPanel > } get activePanel$ ( ) : BehaviorSubject < MultiFactorPanel > { return this . service . activePanel$ ; } constructor ( public service ) { } ngOnDestroy ( ) { this . inProgress$ . next ( false ) ; } returns { void } public onVerifyClick ( ) { throw new Error ( 'MFA forms must provide onVerifyClick() function' ) ; } }