import { NgIf, AsyncPipe } from '@angular/common';
import * as i0 from '@angular/core';
import { Injectable, Inject, INJECTOR, Component, ChangeDetectionStrategy, inject } from '@angular/core';
import * as i1 from '@angular/forms';
import { Validators, ReactiveFormsModule } from '@angular/forms';
import * as i5 from '@angular/material/button';
import { MatButtonModule } from '@angular/material/button';
import { ErrorStateMatcher, ShowOnDirtyErrorStateMatcher } from '@angular/material/core';
import * as i3$1 from '@angular/material/form-field';
import { MatFormFieldModule } from '@angular/material/form-field';
import * as i2$1 from '@angular/material/icon';
import { MatIconModule } from '@angular/material/icon';
import * as i4 from '@angular/material/input';
import { MatInputModule } from '@angular/material/input';
import * as i6 from '@angular/material/progress-bar';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import * as i3 from '@angular/material/snack-bar';
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
import { UseFormControl, RxapFormControl, ControlValidator, ControlSetValue, RxapForm, RXAP_FORM_DEFINITION_BUILDER, RxapFormBuilder, RXAP_FORM_DEFINITION, RXAP_FORM_SUBMIT_METHOD, FormDirective, FormControlMarkDirtyDirective, FormSubmitFailedDirective, FormSubmittingDirective, RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD } from '@rxap/forms';
import { ControlErrorDirective } from '@rxap/material-form-system';
import { trigger, state, style, transition, animate } from '@angular/animations';
import { __decorate, __metadata } from 'tslib';
import * as i2 from '@angular/router';
import { ActivatedRoute, Router, RouterOutlet } from '@angular/router';
import { firstValueFrom } from 'rxjs';
import { take, map, switchMap, tap, filter } from 'rxjs/operators';
import * as i6$1 from '@angular/material/checkbox';
import { MatCheckboxModule } from '@angular/material/checkbox';
import * as i8 from '@angular/material/progress-spinner';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import * as i7 from '@angular/material/tooltip';
import { MatTooltipModule } from '@angular/material/tooltip';
import * as i10 from '@rxap/authentication';
import { RxapAuthenticationService, RxapAuthenticationGuard } from '@rxap/authentication';
import { ToggleSubject } from '@rxap/rxjs';
import * as i1$1 from '@rxap/config';
import { ConfigService } from '@rxap/config';

// the fade-in/fade-out animation.
const fadeAnimation = trigger('fadeAnimation', [
    // the "in" style determines the "resting" state of the element when it is visible.
    state('in', style({ opacity: 1 })),
    // fade in when created. this could also be written as transition('void => *')
    transition(':enter', [
        style({ opacity: 0 }),
        animate(300),
    ]),
    // fade out when destroyed. this could also be written as transition('void => *')
    transition(':leave', animate(300, style({ opacity: 0 }))),
]);

class SetNewPasswordWithResetTokenMethod {
    call(parameters) {
        throw new Error('Method not implemented.');
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: SetNewPasswordWithResetTokenMethod, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: SetNewPasswordWithResetTokenMethod, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: SetNewPasswordWithResetTokenMethod, decorators: [{
            type: Injectable,
            args: [{ providedIn: 'root' }]
        }] });

const RXAP_RESET_PASSWORD_FORM = 'rxap-reset-password';
class ResetPasswordFormSubmitMethod {
    constructor(route, setNewPasswordWithResetTokenMethod, snackBar, router) {
        this.route = route;
        this.setNewPasswordWithResetTokenMethod = setNewPasswordWithResetTokenMethod;
        this.snackBar = snackBar;
        this.router = router;
    }
    call(value) {
        return firstValueFrom(this.route.params
            .pipe(take(1), map((params) => params['token']), switchMap((token) => this.setNewPasswordWithResetTokenMethod.call({
            password: value.password,
            token,
        })), tap({
            error: () => {
                this.snackBar.open('Password reset failed.', undefined, {
                    duration: 3500,
                });
            },
            next: () => {
                this.snackBar.open('Password reset was successful.', undefined, {
                    duration: 3500,
                });
                return this.router.navigate(['/']);
            },
        }), map(() => true)));
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ResetPasswordFormSubmitMethod, deps: [{ token: ActivatedRoute }, { token: SetNewPasswordWithResetTokenMethod }, { token: MatSnackBar }, { token: Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ResetPasswordFormSubmitMethod }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ResetPasswordFormSubmitMethod, decorators: [{
            type: Injectable
        }], ctorParameters: () => [{ type: i2.ActivatedRoute, decorators: [{
                    type: Inject,
                    args: [ActivatedRoute]
                }] }, { type: SetNewPasswordWithResetTokenMethod }, { type: i3.MatSnackBar, decorators: [{
                    type: Inject,
                    args: [MatSnackBar]
                }] }, { type: i2.Router, decorators: [{
                    type: Inject,
                    args: [Router]
                }] }] });
let ResetPasswordForm = class ResetPasswordForm {
    passwordEqual(control) {
        if (this.password.value === null || control.value === null) {
            return null;
        }
        if (this.password.value !== control.value) {
            return { equal: 'passwords are not equal' };
        }
        return null;
    }
    resetRepeat() {
        this.passwordRepeat.reset();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ResetPasswordForm, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ResetPasswordForm }); }
};
__decorate([
    UseFormControl({
        validators: [Validators.required],
    }),
    __metadata("design:type", RxapFormControl)
], ResetPasswordForm.prototype, "password", void 0);
__decorate([
    UseFormControl({
        validators: [Validators.required],
    }),
    __metadata("design:type", RxapFormControl)
], ResetPasswordForm.prototype, "passwordRepeat", void 0);
__decorate([
    ControlValidator('passwordRepeat'),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [RxapFormControl]),
    __metadata("design:returntype", void 0)
], ResetPasswordForm.prototype, "passwordEqual", null);
__decorate([
    ControlSetValue('password'),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", []),
    __metadata("design:returntype", void 0)
], ResetPasswordForm.prototype, "resetRepeat", null);
ResetPasswordForm = __decorate([
    RxapForm({
        id: RXAP_RESET_PASSWORD_FORM,
    })
], ResetPasswordForm);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ResetPasswordForm, decorators: [{
            type: Injectable
        }], propDecorators: { password: [], passwordRepeat: [], passwordEqual: [], resetRepeat: [] } });
const ResetPasswordFormProviders = [
    ResetPasswordForm,
    {
        provide: RXAP_FORM_DEFINITION_BUILDER,
        useFactory: (injector) => new RxapFormBuilder(ResetPasswordForm, injector),
        deps: [INJECTOR],
    },
    {
        provide: RXAP_FORM_DEFINITION,
        useFactory: (builder) => builder.build(),
        deps: [RXAP_FORM_DEFINITION_BUILDER],
    },
    {
        provide: RXAP_FORM_SUBMIT_METHOD,
        useClass: ResetPasswordFormSubmitMethod,
    },
];

class ResetPasswordComponent {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ResetPasswordComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.16", type: ResetPasswordComponent, isStandalone: true, selector: "rxap-reset-password", providers: [
            ResetPasswordFormProviders,
            {
                provide: ErrorStateMatcher,
                useClass: ShowOnDirtyErrorStateMatcher,
            },
        ], ngImport: i0, template: "<form #form=\"rxapForm\" [@fadeAnimation]=\"'in'\"\n      class=\"inner mat-elevation-z5 flex flex-col items-center justify-center gap-4\"\n      novalidate\n      rxapForm>\n\n  <div class=\"header grow-0 flex flex-col items-center justify-center\">\n\n    <mat-icon class=\"avatar-icon grow-0\" color=\"primary\">vpn_key</mat-icon>\n\n  </div>\n\n  <div class=\"content flex flex-col gap-4\">\n\n    <div class=\"flex flex-col\">\n\n      <mat-form-field class=\"password-input\">\n        <mat-icon inline matPrefix>vpn_key</mat-icon>\n        <mat-label i18n>New password</mat-label>\n        <input #passwordInput\n               formControlName=\"password\"\n               i18n-placeholder\n               matInput\n               placeholder=\"Enter your new password\"\n               type=\"password\">\n        <mat-error *rxapControlError=\"let error key 'required'\">\n          Password is <strong>required</strong>\n        </mat-error>\n        <button (click)=\"passwordInput.type = 'text'\" *ngIf=\"passwordInput.type === 'password'\" mat-icon-button\n                matSuffix tabIndex=\"-1\"\n                type=\"button\">\n          <mat-icon>visibility</mat-icon>\n        </button>\n        <button (click)=\"passwordInput.type = 'password'\" *ngIf=\"passwordInput.type === 'text'\" mat-icon-button\n                matSuffix tabIndex=\"-1\"\n                type=\"button\">\n          <mat-icon>visibility_off</mat-icon>\n        </button>\n      </mat-form-field>\n\n      <mat-form-field class=\"password-input\">\n        <mat-icon inline matPrefix>vpn_key</mat-icon>\n        <mat-label i18n>Repeat password</mat-label>\n        <input #passwordRepeatInput\n               formControlName=\"passwordRepeat\"\n               i18n-placeholder\n               matInput\n               placeholder=\"Enter your new password again\"\n               type=\"password\">\n        <mat-error *rxapControlError=\"let error key 'required'\">\n          Password is <strong>required</strong>\n        </mat-error>\n        <mat-error *rxapControlError=\"let error key 'equal'\">\n          Entered password are <strong>not equal</strong>\n        </mat-error>\n        <button (click)=\"passwordRepeatInput.type = 'text'\"\n                *ngIf=\"passwordRepeatInput.type === 'password'\"\n                mat-icon-button\n                matSuffix\n                tabIndex=\"-1\"\n                type=\"button\">\n          <mat-icon>visibility</mat-icon>\n        </button>\n        <button (click)=\"passwordRepeatInput.type = 'password'\"\n                *ngIf=\"passwordRepeatInput.type === 'text'\"\n                mat-icon-button\n                matSuffix\n                tabIndex=\"-1\"\n                type=\"button\">\n          <mat-icon>visibility_off</mat-icon>\n        </button>\n      </mat-form-field>\n\n    </div>\n\n    <div class=\"grow-0 flex flex-row justify-center items-center\">\n\n      <div class=\"grow-0\">\n        <button color=\"primary\" mat-raised-button rxapFormControlMarkDirty type=\"submit\">\n          <ng-container i18n>Reset password</ng-container>\n        </button>\n      </div>\n\n    </div>\n\n  </div>\n\n  <div *rxapFormSubmitFailed=\"let error\" class=\"flex flex-row items-center justify-center\">\n    <mat-error>{{ error.message }}</mat-error>\n  </div>\n\n  <mat-progress-bar *rxapFormSubmitting class=\"loading-bar\" mode=\"indeterminate\"></mat-progress-bar>\n\n</form>\n", styles: [".inner{padding:48px;position:relative;margin:16px 0;background-color:var(--background-color)}.inner ::ng-deep .mat-mdc-form-field-icon-prefix,.inner ::ng-deep .mat-mdc-form-field-icon-suffix{color:var(--hint-text-color, gray)}.inner .header .avatar-icon{width:100px;height:100px;font-size:100px}.inner .content{width:304px;max-width:calc(100vw - 112px)}.inner .content .password-input{width:100%}.inner .content .password-input .prefix-icon{width:24px;height:24px;display:flex;justify-content:center;align-items:center}.inner .content .password-input ::ng-deep .mat-form-field-prefix{align-self:flex-end;margin:4px}.inner .content [type=submit]{width:256px;text-transform:uppercase}.inner .loading-bar{position:absolute;inset:auto 0 0}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: FormDirective, selector: "form[rxapForm]:not([formGroup]):not([ngForm]),rxap-form,form[rxapForm]", inputs: ["initial", "context", "rxapForm", "submitMethod", "loadMethod", "loadFailedMethod", "loadSuccessfulMethod", "submitFailedMethod", "submitSuccessfulMethod"], outputs: ["ngSubmit", "initialChange", "contextChange", "rxapSubmit", "invalidSubmit", "submitSuccessful"], exportAs: ["rxapForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl],      input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatButton, selector: "    button[mat-button], button[mat-raised-button], button[mat-flat-button],    button[mat-stroked-button]  ", exportAs: ["matButton"] }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: FormControlMarkDirtyDirective, selector: "[rxapFormControlMarkDirty]" }, { kind: "directive", type: FormSubmitFailedDirective, selector: "[rxapFormSubmitFailed]" }, { kind: "directive", type: FormSubmittingDirective, selector: "[rxapFormSubmitting]" }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i6.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatSnackBarModule }, { kind: "directive", type: ControlErrorDirective, selector: "[rxapControlError]", inputs: ["rxapControlErrorKey"] }], animations: [
            fadeAnimation,
        ], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ResetPasswordComponent, decorators: [{
            type: Component,
            args: [{ selector: 'rxap-reset-password', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                        ResetPasswordFormProviders,
                        {
                            provide: ErrorStateMatcher,
                            useClass: ShowOnDirtyErrorStateMatcher,
                        },
                    ], animations: [
                        fadeAnimation,
                    ], imports: [
                        ReactiveFormsModule,
                        FormDirective,
                        MatIconModule,
                        MatFormFieldModule,
                        MatInputModule,
                        NgIf,
                        MatButtonModule,
                        FormControlMarkDirtyDirective,
                        FormSubmitFailedDirective,
                        FormSubmittingDirective,
                        MatProgressBarModule,
                        MatSnackBarModule,
                        ControlErrorDirective,
                    ], template: "<form #form=\"rxapForm\" [@fadeAnimation]=\"'in'\"\n      class=\"inner mat-elevation-z5 flex flex-col items-center justify-center gap-4\"\n      novalidate\n      rxapForm>\n\n  <div class=\"header grow-0 flex flex-col items-center justify-center\">\n\n    <mat-icon class=\"avatar-icon grow-0\" color=\"primary\">vpn_key</mat-icon>\n\n  </div>\n\n  <div class=\"content flex flex-col gap-4\">\n\n    <div class=\"flex flex-col\">\n\n      <mat-form-field class=\"password-input\">\n        <mat-icon inline matPrefix>vpn_key</mat-icon>\n        <mat-label i18n>New password</mat-label>\n        <input #passwordInput\n               formControlName=\"password\"\n               i18n-placeholder\n               matInput\n               placeholder=\"Enter your new password\"\n               type=\"password\">\n        <mat-error *rxapControlError=\"let error key 'required'\">\n          Password is <strong>required</strong>\n        </mat-error>\n        <button (click)=\"passwordInput.type = 'text'\" *ngIf=\"passwordInput.type === 'password'\" mat-icon-button\n                matSuffix tabIndex=\"-1\"\n                type=\"button\">\n          <mat-icon>visibility</mat-icon>\n        </button>\n        <button (click)=\"passwordInput.type = 'password'\" *ngIf=\"passwordInput.type === 'text'\" mat-icon-button\n                matSuffix tabIndex=\"-1\"\n                type=\"button\">\n          <mat-icon>visibility_off</mat-icon>\n        </button>\n      </mat-form-field>\n\n      <mat-form-field class=\"password-input\">\n        <mat-icon inline matPrefix>vpn_key</mat-icon>\n        <mat-label i18n>Repeat password</mat-label>\n        <input #passwordRepeatInput\n               formControlName=\"passwordRepeat\"\n               i18n-placeholder\n               matInput\n               placeholder=\"Enter your new password again\"\n               type=\"password\">\n        <mat-error *rxapControlError=\"let error key 'required'\">\n          Password is <strong>required</strong>\n        </mat-error>\n        <mat-error *rxapControlError=\"let error key 'equal'\">\n          Entered password are <strong>not equal</strong>\n        </mat-error>\n        <button (click)=\"passwordRepeatInput.type = 'text'\"\n                *ngIf=\"passwordRepeatInput.type === 'password'\"\n                mat-icon-button\n                matSuffix\n                tabIndex=\"-1\"\n                type=\"button\">\n          <mat-icon>visibility</mat-icon>\n        </button>\n        <button (click)=\"passwordRepeatInput.type = 'password'\"\n                *ngIf=\"passwordRepeatInput.type === 'text'\"\n                mat-icon-button\n                matSuffix\n                tabIndex=\"-1\"\n                type=\"button\">\n          <mat-icon>visibility_off</mat-icon>\n        </button>\n      </mat-form-field>\n\n    </div>\n\n    <div class=\"grow-0 flex flex-row justify-center items-center\">\n\n      <div class=\"grow-0\">\n        <button color=\"primary\" mat-raised-button rxapFormControlMarkDirty type=\"submit\">\n          <ng-container i18n>Reset password</ng-container>\n        </button>\n      </div>\n\n    </div>\n\n  </div>\n\n  <div *rxapFormSubmitFailed=\"let error\" class=\"flex flex-row items-center justify-center\">\n    <mat-error>{{ error.message }}</mat-error>\n  </div>\n\n  <mat-progress-bar *rxapFormSubmitting class=\"loading-bar\" mode=\"indeterminate\"></mat-progress-bar>\n\n</form>\n", styles: [".inner{padding:48px;position:relative;margin:16px 0;background-color:var(--background-color)}.inner ::ng-deep .mat-mdc-form-field-icon-prefix,.inner ::ng-deep .mat-mdc-form-field-icon-suffix{color:var(--hint-text-color, gray)}.inner .header .avatar-icon{width:100px;height:100px;font-size:100px}.inner .content{width:304px;max-width:calc(100vw - 112px)}.inner .content .password-input{width:100%}.inner .content .password-input .prefix-icon{width:24px;height:24px;display:flex;justify-content:center;align-items:center}.inner .content .password-input ::ng-deep .mat-form-field-prefix{align-self:flex-end;margin:4px}.inner .content [type=submit]{width:256px;text-transform:uppercase}.inner .loading-bar{position:absolute;inset:auto 0 0}\n"] }]
        }] });

class SignInWithEmailAndPasswordMethod {
    call(parameters) {
        throw new Error('Method not implemented.');
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: SignInWithEmailAndPasswordMethod, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: SignInWithEmailAndPasswordMethod, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: SignInWithEmailAndPasswordMethod, decorators: [{
            type: Injectable,
            args: [{ providedIn: 'root' }]
        }] });

let LoginForm = class LoginForm {
    constructor(config) {
        this.config = config;
        this.loading = true;
        this.loginFailed = false;
    }
    rxapOnInit() {
        const email = this.config.get('authentication.default.email');
        if (email) {
            this.email.setValue(email);
        }
        const password = this.config.get('authentication.default.password');
        if (password) {
            this.password.setValue(password);
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: LoginForm, deps: [{ token: i1$1.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: LoginForm }); }
};
__decorate([
    UseFormControl({
        validators: [Validators.required, Validators.email],
    }),
    __metadata("design:type", RxapFormControl)
], LoginForm.prototype, "email", void 0);
__decorate([
    UseFormControl({
        validators: [Validators.required],
    }),
    __metadata("design:type", RxapFormControl)
], LoginForm.prototype, "password", void 0);
__decorate([
    UseFormControl({
        state: true,
    }),
    __metadata("design:type", RxapFormControl)
], LoginForm.prototype, "remember", void 0);
LoginForm = __decorate([
    RxapForm({
        id: 'rxap-login',
    }),
    __metadata("design:paramtypes", [ConfigService])
], LoginForm);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: LoginForm, decorators: [{
            type: Injectable
        }], ctorParameters: () => [{ type: i1$1.ConfigService }], propDecorators: { email: [], password: [], remember: [] } });
class LoginFormSubmitMethod {
    constructor(signInWithEmailAndPasswordMethod) {
        this.signInWithEmailAndPasswordMethod = signInWithEmailAndPasswordMethod;
    }
    call(value) {
        return this.signInWithEmailAndPasswordMethod.call({
            email: value.email,
            password: value.password,
            remember: value.remember,
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: LoginFormSubmitMethod, deps: [{ token: SignInWithEmailAndPasswordMethod }], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: LoginFormSubmitMethod }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: LoginFormSubmitMethod, decorators: [{
            type: Injectable
        }], ctorParameters: () => [{ type: SignInWithEmailAndPasswordMethod }] });
class LoginFormSubmitSuccessful {
    constructor(router) {
        this.router = router;
    }
    call() {
        console.debug('Login was successful. Navigate to application root');
        return this.router.navigate(['/']);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: LoginFormSubmitSuccessful, deps: [{ token: Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: LoginFormSubmitSuccessful }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: LoginFormSubmitSuccessful, decorators: [{
            type: Injectable
        }], ctorParameters: () => [{ type: i2.Router, decorators: [{
                    type: Inject,
                    args: [Router]
                }] }] });
const LoginFormProviders = [
    LoginForm,
    {
        provide: RXAP_FORM_DEFINITION_BUILDER,
        useFactory: (injector) => new RxapFormBuilder(LoginForm, injector),
        deps: [INJECTOR],
    },
    {
        provide: RXAP_FORM_DEFINITION,
        useFactory: (builder) => builder.build(),
        deps: [RXAP_FORM_DEFINITION_BUILDER],
    },
    {
        provide: RXAP_FORM_SUBMIT_METHOD,
        useClass: LoginFormSubmitMethod,
    },
    {
        provide: RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD,
        useClass: LoginFormSubmitSuccessful,
    },
];

class RequestResetPasswordMethod {
    call(parameters) {
        throw new Error('Method not implemented.');
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: RequestResetPasswordMethod, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: RequestResetPasswordMethod, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: RequestResetPasswordMethod, decorators: [{
            type: Injectable,
            args: [{ providedIn: 'root' }]
        }] });

class LoginComponent {
    constructor(authentication, snackBar) {
        this.authentication = authentication;
        this.snackBar = snackBar;
        this.requestingPasswordReset$ = new ToggleSubject();
        this.requestPasswordResetMethod = inject(RequestResetPasswordMethod);
    }
    async requestPasswordReset(email) {
        this.requestingPasswordReset$.enable();
        try {
            const result = await this.requestPasswordResetMethod.call({ email });
            if (!result) {
                this.snackBar.open('The password reset request result is falsy', undefined, {
                    duration: 5000,
                    panelClass: 'error',
                });
            }
            else {
                this.snackBar.open('The password reset request was successful', undefined, {
                    duration: 3000,
                });
            }
        }
        catch (e) {
            this.snackBar.open(e.message, undefined, {
                duration: 3000,
                panelClass: 'error',
            });
        }
        finally {
            this.requestingPasswordReset$.disable();
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: LoginComponent, deps: [{ token: RxapAuthenticationService }, { token: MatSnackBar }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.16", type: LoginComponent, isStandalone: true, selector: "rxap-login", providers: [
            LoginFormProviders,
            {
                provide: ErrorStateMatcher,
                useClass: ShowOnDirtyErrorStateMatcher,
            },
        ], ngImport: i0, template: "<form #form=\"rxapForm\" [@fadeAnimation]=\"'in'\"\n      class=\"inner mat-elevation-z5 flex flex-col justify-center items-center gap-4\"\n      novalidate\n      rxapForm>\n\n  <div class=\"header flex flex-col items-center justify-center grow-0\">\n\n    <mat-icon class=\"avatar-icon grow-0\" color=\"primary\">account_circle</mat-icon>\n\n  </div>\n\n  <div class=\"content flex flex-col gap-8\">\n\n    <div class=\"flex flex-col\">\n\n      <mat-form-field class=\"email-input\">\n        <mat-icon inline matPrefix>email</mat-icon>\n        <mat-label i18n>Email</mat-label>\n        <input formControlName=\"email\"\n               i18n-placeholder\n               matInput\n               name=\"email\"\n               placeholder=\"Enter your email address\"\n               type=\"email\">\n        <mat-error *rxapControlError=\"let error key 'required'\">\n          Email is <strong>required</strong>\n        </mat-error>\n        <mat-error *rxapControlError=\"let error key 'email'\">\n          Please enter a valid email address\n        </mat-error>\n      </mat-form-field>\n\n      <mat-form-field class=\"password-input\">\n        <mat-icon inline matPrefix>vpn_key</mat-icon>\n        <mat-label i18n>Password</mat-label>\n        <input #passwordInput\n               formControlName=\"password\"\n               i18n-placeholder\n               matInput\n               name=\"password\"\n               placeholder=\"Enter your password\"\n               type=\"password\">\n        <mat-error *rxapControlError=\"let error key 'required'\">\n          Password is <strong>required</strong>\n        </mat-error>\n        <button (click)=\"passwordInput.type = 'test'\" *ngIf=\"passwordInput.type === 'password'\" mat-icon-button\n                matSuffix tabIndex=\"-1\"\n                type=\"button\">\n          <mat-icon>visibility</mat-icon>\n        </button>\n        <button (click)=\"passwordInput.type = 'password'\" *ngIf=\"passwordInput.type === 'text'\" mat-icon-button\n                matSuffix tabIndex=\"-1\"\n                type=\"button\">\n          <mat-icon>visibility_off</mat-icon>\n        </button>\n      </mat-form-field>\n\n    </div>\n\n    <div class=\"sub-controls flex flex-row flex-wrap justify-between items-center gap-4\">\n\n      <mat-checkbox class=\"remember-input grow-0\" formControlName=\"remember\">Remember me</mat-checkbox>\n\n      <div [matTooltipDisabled]=\"form.control.controls['email'].valid\"\n           class=\"grow-0\"\n           matTooltip=\"Please enter a valid email address\"\n           matTooltipPosition=\"above\">\n        <button (click)=\"requestPasswordReset(form.value.email)\"\n                [disabled]=\"!form.value.email || form.control.controls['email'].hasError('email')\"\n                color=\"accent\"\n                mat-button\n                type=\"button\">\n            <span class=\"flex flex-row justify-between items-center gap-2\">\n              <mat-progress-spinner *ngIf=\"requestingPasswordReset$ | async\" [diameter]=\"15\"\n                                    mode=\"indeterminate\"></mat-progress-spinner>\n              <span class=\"grow-0\">Password forgotten</span>\n            </span>\n        </button>\n      </div>\n\n    </div>\n\n    <div class=\"grow-0 flex flex-row justify-center items-center\">\n\n      <div class=\"grow-0\">\n        <button color=\"primary\" mat-raised-button rxapFormControlMarkDirty type=\"submit\">Login</button>\n      </div>\n\n    </div>\n\n  </div>\n\n  <div *rxapFormSubmitFailed=\"let error\" class=\"flex flex-row justify-center items-center\">\n    <mat-error>{{ error.message }}</mat-error>\n  </div>\n\n  <mat-progress-bar *rxapFormSubmitting class=\"loading-bar\" mode=\"indeterminate\"></mat-progress-bar>\n\n</form>\n", styles: ["::ng-deep .mat-mdc-snack-bar-container.error{background-color:var(--warn-500);color:var(--foreground-color)}.inner{padding:48px;position:relative;margin:16px 0;background-color:var(--background-color)}.inner ::ng-deep .mat-mdc-form-field-icon-prefix,.inner ::ng-deep .mat-mdc-form-field-icon-suffix{color:var(--hint-text-color, gray)}.inner .header .avatar-icon{width:100px;height:100px;font-size:100px}.inner .content{width:304px;max-width:calc(100vw - 112px)}.inner .content .email-input,.inner .content .password-input{width:100%}.inner .content .email-input .prefix-icon,.inner .content .password-input .prefix-icon{width:24px;height:24px;display:flex;justify-content:center;align-items:center}.inner .content .email-input ::ng-deep .mat-form-field-prefix,.inner .content .password-input ::ng-deep .mat-form-field-prefix{align-self:flex-end;margin:4px}.inner .content [type=submit]{width:128px;text-transform:uppercase}.inner .sub-controls>*{margin-bottom:8px}.inner .loading-bar{position:absolute;inset:auto 0 0}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: FormDirective, selector: "form[rxapForm]:not([formGroup]):not([ngForm]),rxap-form,form[rxapForm]", inputs: ["initial", "context", "rxapForm", "submitMethod", "loadMethod", "loadFailedMethod", "loadSuccessfulMethod", "submitFailedMethod", "submitSuccessfulMethod"], outputs: ["ngSubmit", "initialChange", "contextChange", "rxapSubmit", "invalidSubmit", "submitSuccessful"], exportAs: ["rxapForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl],      input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatButton, selector: "    button[mat-button], button[mat-raised-button], button[mat-flat-button],    button[mat-stroked-button]  ", exportAs: ["matButton"] }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i6$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i8.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: FormControlMarkDirtyDirective, selector: "[rxapFormControlMarkDirty]" }, { kind: "directive", type: FormSubmitFailedDirective, selector: "[rxapFormSubmitFailed]" }, { kind: "directive", type: FormSubmittingDirective, selector: "[rxapFormSubmitting]" }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i6.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatSnackBarModule }, { kind: "directive", type: ControlErrorDirective, selector: "[rxapControlError]", inputs: ["rxapControlErrorKey"] }], animations: [
            fadeAnimation,
        ], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: LoginComponent, decorators: [{
            type: Component,
            args: [{ selector: 'rxap-login', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                        LoginFormProviders,
                        {
                            provide: ErrorStateMatcher,
                            useClass: ShowOnDirtyErrorStateMatcher,
                        },
                    ], animations: [
                        fadeAnimation,
                    ], imports: [
                        ReactiveFormsModule,
                        FormDirective,
                        MatIconModule,
                        MatFormFieldModule,
                        MatInputModule,
                        NgIf,
                        MatButtonModule,
                        MatCheckboxModule,
                        MatTooltipModule,
                        MatProgressSpinnerModule,
                        FormControlMarkDirtyDirective,
                        FormSubmitFailedDirective,
                        FormSubmittingDirective,
                        MatProgressBarModule,
                        AsyncPipe,
                        MatSnackBarModule,
                        ControlErrorDirective,
                    ], template: "<form #form=\"rxapForm\" [@fadeAnimation]=\"'in'\"\n      class=\"inner mat-elevation-z5 flex flex-col justify-center items-center gap-4\"\n      novalidate\n      rxapForm>\n\n  <div class=\"header flex flex-col items-center justify-center grow-0\">\n\n    <mat-icon class=\"avatar-icon grow-0\" color=\"primary\">account_circle</mat-icon>\n\n  </div>\n\n  <div class=\"content flex flex-col gap-8\">\n\n    <div class=\"flex flex-col\">\n\n      <mat-form-field class=\"email-input\">\n        <mat-icon inline matPrefix>email</mat-icon>\n        <mat-label i18n>Email</mat-label>\n        <input formControlName=\"email\"\n               i18n-placeholder\n               matInput\n               name=\"email\"\n               placeholder=\"Enter your email address\"\n               type=\"email\">\n        <mat-error *rxapControlError=\"let error key 'required'\">\n          Email is <strong>required</strong>\n        </mat-error>\n        <mat-error *rxapControlError=\"let error key 'email'\">\n          Please enter a valid email address\n        </mat-error>\n      </mat-form-field>\n\n      <mat-form-field class=\"password-input\">\n        <mat-icon inline matPrefix>vpn_key</mat-icon>\n        <mat-label i18n>Password</mat-label>\n        <input #passwordInput\n               formControlName=\"password\"\n               i18n-placeholder\n               matInput\n               name=\"password\"\n               placeholder=\"Enter your password\"\n               type=\"password\">\n        <mat-error *rxapControlError=\"let error key 'required'\">\n          Password is <strong>required</strong>\n        </mat-error>\n        <button (click)=\"passwordInput.type = 'test'\" *ngIf=\"passwordInput.type === 'password'\" mat-icon-button\n                matSuffix tabIndex=\"-1\"\n                type=\"button\">\n          <mat-icon>visibility</mat-icon>\n        </button>\n        <button (click)=\"passwordInput.type = 'password'\" *ngIf=\"passwordInput.type === 'text'\" mat-icon-button\n                matSuffix tabIndex=\"-1\"\n                type=\"button\">\n          <mat-icon>visibility_off</mat-icon>\n        </button>\n      </mat-form-field>\n\n    </div>\n\n    <div class=\"sub-controls flex flex-row flex-wrap justify-between items-center gap-4\">\n\n      <mat-checkbox class=\"remember-input grow-0\" formControlName=\"remember\">Remember me</mat-checkbox>\n\n      <div [matTooltipDisabled]=\"form.control.controls['email'].valid\"\n           class=\"grow-0\"\n           matTooltip=\"Please enter a valid email address\"\n           matTooltipPosition=\"above\">\n        <button (click)=\"requestPasswordReset(form.value.email)\"\n                [disabled]=\"!form.value.email || form.control.controls['email'].hasError('email')\"\n                color=\"accent\"\n                mat-button\n                type=\"button\">\n            <span class=\"flex flex-row justify-between items-center gap-2\">\n              <mat-progress-spinner *ngIf=\"requestingPasswordReset$ | async\" [diameter]=\"15\"\n                                    mode=\"indeterminate\"></mat-progress-spinner>\n              <span class=\"grow-0\">Password forgotten</span>\n            </span>\n        </button>\n      </div>\n\n    </div>\n\n    <div class=\"grow-0 flex flex-row justify-center items-center\">\n\n      <div class=\"grow-0\">\n        <button color=\"primary\" mat-raised-button rxapFormControlMarkDirty type=\"submit\">Login</button>\n      </div>\n\n    </div>\n\n  </div>\n\n  <div *rxapFormSubmitFailed=\"let error\" class=\"flex flex-row justify-center items-center\">\n    <mat-error>{{ error.message }}</mat-error>\n  </div>\n\n  <mat-progress-bar *rxapFormSubmitting class=\"loading-bar\" mode=\"indeterminate\"></mat-progress-bar>\n\n</form>\n", styles: ["::ng-deep .mat-mdc-snack-bar-container.error{background-color:var(--warn-500);color:var(--foreground-color)}.inner{padding:48px;position:relative;margin:16px 0;background-color:var(--background-color)}.inner ::ng-deep .mat-mdc-form-field-icon-prefix,.inner ::ng-deep .mat-mdc-form-field-icon-suffix{color:var(--hint-text-color, gray)}.inner .header .avatar-icon{width:100px;height:100px;font-size:100px}.inner .content{width:304px;max-width:calc(100vw - 112px)}.inner .content .email-input,.inner .content .password-input{width:100%}.inner .content .email-input .prefix-icon,.inner .content .password-input .prefix-icon{width:24px;height:24px;display:flex;justify-content:center;align-items:center}.inner .content .email-input ::ng-deep .mat-form-field-prefix,.inner .content .password-input ::ng-deep .mat-form-field-prefix{align-self:flex-end;margin:4px}.inner .content [type=submit]{width:128px;text-transform:uppercase}.inner .sub-controls>*{margin-bottom:8px}.inner .loading-bar{position:absolute;inset:auto 0 0}\n"] }]
        }], ctorParameters: () => [{ type: i10.RxapAuthenticationService, decorators: [{
                    type: Inject,
                    args: [RxapAuthenticationService]
                }] }, { type: i3.MatSnackBar, decorators: [{
                    type: Inject,
                    args: [MatSnackBar]
                }] }] });

class LoadingComponent {
    constructor(authentication, router) {
        this.authentication = authentication;
        this.router = router;
    }
    ngOnInit() {
        // TODO : remove the concept of isAuthenticated$
        if (this.authentication.isAuthenticated$) {
            this.subscription = this.authentication.isAuthenticated$
                .pipe(filter((isAuthenticated) => isAuthenticated !== null), tap(() => this.router.navigate(['/', 'authentication', 'login'])))
                .subscribe();
        }
    }
    ngOnDestroy() {
        this.subscription?.unsubscribe();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: LoadingComponent, deps: [{ token: RxapAuthenticationService }, { token: Router }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.16", type: LoadingComponent, isStandalone: true, selector: "rxap-auth-loading", ngImport: i0, template: "<mat-progress-bar class=\"loading-bar\" mode=\"indeterminate\"></mat-progress-bar>\n", styles: [".loading-bar{position:absolute;bottom:65vh;left:0;right:0;top:auto}\n"], dependencies: [{ kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i6.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: LoadingComponent, decorators: [{
            type: Component,
            args: [{ selector: 'rxap-auth-loading', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatProgressBarModule], template: "<mat-progress-bar class=\"loading-bar\" mode=\"indeterminate\"></mat-progress-bar>\n", styles: [".loading-bar{position:absolute;bottom:65vh;left:0;right:0;top:auto}\n"] }]
        }], ctorParameters: () => [{ type: i10.RxapAuthenticationService, decorators: [{
                    type: Inject,
                    args: [RxapAuthenticationService]
                }] }, { type: i2.Router, decorators: [{
                    type: Inject,
                    args: [Router]
                }] }] });

class AuthenticationContainerComponent {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: AuthenticationContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.16", type: AuthenticationContainerComponent, isStandalone: true, selector: "rxap-authentication-container", ngImport: i0, template: "<div class=\"content\">\n\n  <div class=\"split mat-elevation-z3\"></div>\n\n  <router-outlet></router-outlet>\n  <ng-content></ng-content>\n\n</div>\n", styles: [".content{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center;overflow-x:hidden}.content .split{position:absolute;top:0;left:0;right:0;bottom:65vh;z-index:-10;background-color:var(--accent-500, #3ee73e)}\n"], dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: AuthenticationContainerComponent, decorators: [{
            type: Component,
            args: [{ selector: 'rxap-authentication-container', imports: [
                        RouterOutlet,
                    ], template: "<div class=\"content\">\n\n  <div class=\"split mat-elevation-z3\"></div>\n\n  <router-outlet></router-outlet>\n  <ng-content></ng-content>\n\n</div>\n", styles: [".content{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center;overflow-x:hidden}.content .split{position:absolute;top:0;left:0;right:0;bottom:65vh;z-index:-10;background-color:var(--accent-500, #3ee73e)}\n"] }]
        }] });

const AUTHENTICATION_ROUTE = [
    {
        path: '',
        component: AuthenticationContainerComponent,
        children: [
            {
                canActivate: [RxapAuthenticationGuard],
                path: 'login',
                component: LoginComponent,
            },
            {
                canActivate: [RxapAuthenticationGuard],
                path: 'reset-password/:token',
                component: ResetPasswordComponent,
            },
            {
                path: 'loading',
                component: LoadingComponent,
            },
            {
                path: '**',
                redirectTo: 'login',
            },
        ],
    },
    {
        path: '**',
        redirectTo: '',
    },
];

// region reset-password
// endregion

/**
 * Generated bundle index. Do not edit.
 */

export { AUTHENTICATION_ROUTE, AuthenticationContainerComponent, LoadingComponent, LoginComponent, LoginForm, LoginFormProviders, LoginFormSubmitMethod, LoginFormSubmitSuccessful, RXAP_RESET_PASSWORD_FORM, RequestResetPasswordMethod, ResetPasswordComponent, ResetPasswordForm, ResetPasswordFormProviders, ResetPasswordFormSubmitMethod, SetNewPasswordWithResetTokenMethod, SignInWithEmailAndPasswordMethod, fadeAnimation };
//# sourceMappingURL=rxap-ngx-material-authentication.mjs.map
