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

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

declare const cordova;

/* import 'hammerjs'; */

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

// cordova wrap
if (window["cordova"]) {
  let onDeviceReady = () => {
    platformBrowserDynamic()
      .bootstrapModule(AppModule)
      .catch((err) => console.error(err));
  };

  document.addEventListener("deviceready", onDeviceReady, false);
  
} else {
  platformBrowserDynamic()
    .bootstrapModule(AppModule)
    .catch((err) => console.error(err));
}
