import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

import * as animationsModule from '@angular/animations';
import * as commonModule from '@angular/common';
import * as commonHttpModule from '@angular/common/http';
import * as compilerModule from '@angular/compiler';
import * as coreModule from '@angular/core';
import * as formsModule from '@angular/forms';
import * as platformBrowserModule from '@angular/platform-browser';
import * as platformBrowserDynamicModule from '@angular/platform-browser-dynamic';
import * as routerModule from '@angular/router';
import * as rxjsModule from 'rxjs';
import * as rxjsOperatorsModule from 'rxjs/operators';
import * as dateFnsModule from 'date-fns';
import * as ngZorroAntdModule from 'ng-zorro-antd';
import * as NzModalModule from 'ng-zorro-antd/modal';
import * as NzCheckboxModule from 'ng-zorro-antd/checkbox';
import * as ngCortexCoreModule from '@ng-cortex/core';

declare const SystemJS;
SystemJS.set('@angular/animations', SystemJS.newModule(animationsModule));
SystemJS.set('@angular/common', SystemJS.newModule(commonModule));
SystemJS.set('@angular/common/http', SystemJS.newModule(commonHttpModule));
SystemJS.set('@angular/compiler', SystemJS.newModule(compilerModule));
SystemJS.set('@angular/core', SystemJS.newModule(coreModule));
SystemJS.set('@angular/forms', SystemJS.newModule(formsModule));
SystemJS.set('@angular/platform-browser', SystemJS.newModule(platformBrowserModule));
SystemJS.set('@angular/platform-browser-dynamic', SystemJS.newModule(platformBrowserDynamicModule));
SystemJS.set('@angular/router', SystemJS.newModule(routerModule));
SystemJS.set('rxjs', SystemJS.newModule(rxjsModule));
SystemJS.set('rxjs/operators', SystemJS.newModule(rxjsOperatorsModule));
SystemJS.set('date-fns', SystemJS.newModule(dateFnsModule));
SystemJS.set('ng-zorro-antd', SystemJS.newModule(ngZorroAntdModule));
SystemJS.set('ng-zorro-antd/modal', SystemJS.newModule(NzModalModule));
SystemJS.set('ng-zorro-antd/checkbox', SystemJS.newModule(NzCheckboxModule));
SystemJS.set('@ng-cortex/core', SystemJS.newModule(ngCortexCoreModule));

if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
  .catch(err => console.error(err));
