import isBrowser from './utils/is-browser';
import { global } from './utils/globals';
import log from './utils/log'; // Version detection using babel plugin

/* global __VERSION__ */

var VERSION = typeof "5.3.0-alpha.2" !== 'undefined' ? "5.3.0-alpha.2" : 'untranspiled source';
var STARTUP_MESSAGE = 'set luma.log.priority=1 (or higher) to trace rendering'; // Assign luma.log.priority in console to control logging: \
// 0: none, 1: minimal, 2: verbose, 3: attribute/uniforms, 4: gl logs
// luma.log.break[], set to gl funcs, luma.log.profile[] set to model names`;

if (global.luma && global.luma.VERSION !== VERSION) {
  throw new Error("luma.gl - multiple VERSIONs detected: ".concat(global.luma.VERSION, " vs ").concat(VERSION));
}

if (!global.luma) {
  if (isBrowser) {
    log.log(0, "luma.gl ".concat(VERSION, " - ").concat(STARTUP_MESSAGE))();
  }

  global.luma = global.luma || {
    VERSION: VERSION,
    version: VERSION,
    log: log,
    // A global stats object that various components can add information to
    // E.g. see webgl/resource.js
    stats: {},
    // Keep some luma globals in a sub-object
    // This allows us to dynamically detect if certain modules have been
    // included (such as IO and headless) and enable related functionality,
    // without unconditionally requiring and thus bundling big dependencies
    // into the app.
    globals: {
      modules: {},
      nodeIO: {}
    }
  };
}

export { global };
export default global.luma;
//# sourceMappingURL=init.js.map