import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {BrowserModule} from "@angular/platform-browser";
import {FormsModule} from "@angular/forms";
import {NgbModule} from "@ng-bootstrap/ng-bootstrap";
import {OverlayContainer, ToastNoAnimationModule} from "ngx-toastr";
import {AgGridModule} from "ag-grid-angular";
import {AppRoutingModule} from "../app/app-routing.module";
import {
  AppConfigService,
  AppVersionService,
  BpmnModule,
  ComponentsModule,
  CoreModule, ProgressIndicationService
} from "@webbpm/base-package";
import {AppModule} from "../app/app.module";
import {MfeWebbpmRoutingModule} from "./mfe-webbpm-routing.module";
import {ErrorHandler, NgModule} from "@angular/core";
import {MfeWrapperComponent} from "./component/mfe-wrapper.component";
import {MfeWebbpmComponent} from "./component/mfe-webbpm.component";
import {AccessDeniedComponent} from "../app/component/access-denied.component";
import {MfeAppVersionService} from "./service/mfe-app-version.service";
import {MfeAppConfigService} from "./service/mfe-app-config.service";
import {GlobalErrorHandler} from "../webbpm/handler/global-error.handler.prod";
import {MfeProgressIndicationService} from "./service/mfe-progress-indication.service";
import {MfeRolesGuard} from "./guard/MfeRolesGuard";
import {RolesGuard} from "../app/guard/RolesGuard";
import {TokenProvider} from "../app/provider/token.provider";
import {MfeTokenProvider} from "./provider/mfe-token.provider";
import {DEFAULT_HTTP_INTERCEPTOR_PROVIDERS} from "./interceptor/mfe-default-interceptors.prod";
import {MfeOverlayContainer} from "./overlay/mfe-overlay-container.service";


let IMPORTS = [
  BrowserAnimationsModule,
  BrowserModule,
  FormsModule,
  NgbModule,
  ToastNoAnimationModule.forRoot(),
  AgGridModule,
  AppRoutingModule,
  BpmnModule,
  CoreModule,
  ComponentsModule,
  AppModule,
  MfeWebbpmRoutingModule
];

@NgModule({
            imports: IMPORTS,
            declarations: [
              MfeWrapperComponent,
              MfeWebbpmComponent,
              AccessDeniedComponent
            ],
            exports: [],
            providers: [
              {provide: AppVersionService, useClass: MfeAppVersionService},
              {provide: AppConfigService, useClass: MfeAppConfigService},
              {provide: ErrorHandler, useClass: GlobalErrorHandler},
              {provide: ProgressIndicationService, useClass: MfeProgressIndicationService},
              {provide: RolesGuard, useClass: MfeRolesGuard},
              {provide: TokenProvider, useClass: MfeTokenProvider},
              {provide: OverlayContainer, useClass: MfeOverlayContainer},
              DEFAULT_HTTP_INTERCEPTOR_PROVIDERS
            ],
            bootstrap: [
              MfeWrapperComponent
            ]
          })
export class MfeWebbpmModule {
}
