import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClientModule } from '@angular/common/http';


import { AppConfigModule } from 'app/app-config/app-config.module';
import { AuthenticationModule } from 'app/authentication/authentication.module';
import {
  GENERAL_ENVIRONMENT_CONFIG
  , WEB_SERVICE_CONFIG
  , AUTHENTICATION_CONFIG
  , ARCGISJSAPI_CONFIG
} from 'app/core/provider-name-token';
import { environment } from 'environments/environment';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';

// config ng-zorro-antd i18n
import { NZ_I18N, th_TH, NZ_DATE_LOCALE } from 'ng-zorro-antd/i18n';
import { th } from 'date-fns/locale';


@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule
    , BrowserAnimationsModule // For support ng-zorro-antd animation.
    , HttpClientModule

    , AppConfigModule // Register here, for every lazy load module.
    , AuthenticationModule // Register here, for every lazy load module.
    , AppRoutingModule
  ],
  providers: [
    { provide: GENERAL_ENVIRONMENT_CONFIG, useValue: environment }
    , { provide: WEB_SERVICE_CONFIG, useValue: environment }
    , { provide: AUTHENTICATION_CONFIG, useValue: environment }
    , { provide: ARCGISJSAPI_CONFIG, useValue: environment }
    , { provide: NZ_I18N, useValue: th_TH }
    , { provide: NZ_DATE_LOCALE, useValue: th }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
