import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { NgModule } from "@angular/core";
import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { HttpClientModule, HTTP_INTERCEPTORS } from "@angular/common/http";
import { registerLocaleData, DatePipe } from "@angular/common";
import { RouterModule } from "@angular/router";
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";

// Internationalization i18n
import localeEs from "@angular/common/locales/es";
import localeEsExtra from "@angular/common/locales/extra/es";
registerLocaleData(localeEs, "es-Es", localeEsExtra);

// used to create fake backend
//import { fakeBackendProvider } from './helpers';
//import { JwtInterceptor, ErrorInterceptor } from './helpers';

import { SharedModule } from "./components/shared/shared.module";

import { AdminComponent } from "./layouts/admin/admin.component";
import { AngularMyDatePickerModule } from "angular-mydatepicker";

import { PluginsModule } from "./components/plugins/plugins.module";
import { LoginComponent } from "./components/login/login.component";

import { TokenInterceptor } from "@app/services/token.interceptor";
import { MatPasswordStrengthModule } from "@angular-material-extensions/password-strength";

@NgModule({
  declarations: [AppComponent, AdminComponent, LoginComponent],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    SharedModule,
    RouterModule,
    AppRoutingModule,
    PluginsModule,
    AngularMyDatePickerModule,
    FontAwesomeModule,
    MatPasswordStrengthModule.forRoot()
  ],
  providers: [
    { provide: HTTP_INTERCEPTORS, useClass: TokenInterceptor, multi: true },
    [DatePipe]

    //{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
    //AuthenticationService,
    // provider used to create fake backend
    //fakeBackendProvider
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}
