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

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import { ApplicationRef } from '@angular/core';
import { enableDebugTools } from '@angular/platform-browser';

if (environment.production) {
    enableProdMode();
}
preInitApp(environment).then(() => {
    platformBrowserDynamic().bootstrapModule(AppModule)
        .then(moduleRef => {
            const applicationRef = moduleRef.injector.get(ApplicationRef);
            const componentRef = applicationRef.components[0];
            enableDebugTools(componentRef);
        })
        .catch(err => console.log(err));
});
