import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { registerLocaleData } from '@angular/common';
import fr from '@angular/common/locales/fr';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {AntMaterialModule} from './ant-material/ant-material.module'
import { NZ_I18N, fr_FR } from 'ng-zorro-antd/i18n';
import { LoginComponent } from './pages/login/login.component';
import { ButtonComponent } from './components/button/button.component';
import { HomeComponent } from './layout/home/home.component';
import { DashboardComponent } from './pages/dashboard/dashboard.component';
import { DemandeSignatureComponent } from './pages/demande-signature/demande-signature.component';
import { SignerComponent } from './pages/signer/signer.component';
import { SuiviSignatureComponent } from './pages/suivi-signature/suivi-signature.component';
import { StatutButtonComponent } from './components/statut-button/statut-button.component';
import { SearchFormComponent } from './components/search-form/search-form.component';
import {DragDropModule} from '@angular/cdk/drag-drop';
import { NgxEchartsModule } from 'ngx-echarts';
import { PdfViewerModule } from 'ng2-pdf-viewer';
import { EditDocumentComponent } from './components/edit-document/edit-document.component';
import { ResizableModule } from 'angular-resizable-element';
import { SignatureComponent } from './layout/signature/signature.component';
import { SignerDocumentComponent } from './pages/signer-document/signer-document.component';
import { CanvasComponent } from './components/canvas/Canvas';
import { ProfilComponent } from './pages/profil/profil.component';
import { WorkflowComponent } from './pages/workflow/workflow.component';
import { SignataireComponent } from './pages/signataire/signataire.component';
import { SearchFormProfilComponent } from './components/search-form-profil/search-form-profil.component';
import {MatChipsModule} from '@angular/material/chips';
import { DocumentComponent } from './pages/document/document.component';
import { GlobaleComponent } from './pages/globale/globale.component';
import { HistoriqueComponent } from './pages/historique/historique.component';
import { OnlineSignatureComponent } from './layout/online-signature/online-signature.component';
import { NgxSpinnerModule } from 'ngx-spinner';
import { TestComponent } from './pages/test/test.component';
import { TestDrawingComponent } from './pages/test-drawing/test-drawing.component';
import { EnvServiceFactory } from './services/env.service.provider';
import { EnvService } from './services/env.service';

registerLocaleData(fr);

@NgModule({
  declarations: [
    AppComponent,
    LoginComponent,
    ButtonComponent,
    HomeComponent,
    DashboardComponent,
    DemandeSignatureComponent,
    SignerComponent,
    SuiviSignatureComponent,
    StatutButtonComponent,
    SearchFormComponent,
    EditDocumentComponent,
    SignatureComponent,
    SignerDocumentComponent,
    CanvasComponent,
    ProfilComponent,
    WorkflowComponent,
    SignataireComponent,
    SearchFormProfilComponent,
    DocumentComponent,
    GlobaleComponent,
    HistoriqueComponent,
    OnlineSignatureComponent,
    TestComponent,
    TestDrawingComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    HttpClientModule,
    BrowserAnimationsModule,
    AntMaterialModule,
    DragDropModule,
    ResizableModule,
    PdfViewerModule,
    ReactiveFormsModule,
    NgxEchartsModule.forRoot({
      echarts: () => import('echarts')
    }),
    MatChipsModule,
    NgxSpinnerModule
  ],
  providers: [
    { provide: NZ_I18N, useValue: fr_FR },
    {
      provide: EnvService,
      useFactory: EnvServiceFactory,
      deps: [],
    },
  ],
  bootstrap: [AppComponent],
  schemas: [
    CUSTOM_ELEMENTS_SCHEMA
  ],
})
export class AppModule { }
