define('my-weather-forecast/initializers/export-application-global', ['exports', 'ember', 'my-weather-forecast/config/environment'], function (exports, _ember, _myWeatherForecastConfigEnvironment) {
  exports.initialize = initialize;

  function initialize() {
    var application = arguments[1] || arguments[0];
    if (_myWeatherForecastConfigEnvironment['default'].exportApplicationGlobal !== false) {
      var value = _myWeatherForecastConfigEnvironment['default'].exportApplicationGlobal;
      var globalName;

      if (typeof value === 'string') {
        globalName = value;
      } else {
        globalName = _ember['default'].String.classify(_myWeatherForecastConfigEnvironment['default'].modulePrefix);
      }

      if (!window[globalName]) {
        window[globalName] = application;

        application.reopen({
          willDestroy: function willDestroy() {
            this._super.apply(this, arguments);
            delete window[globalName];
          }
        });
      }
    }
  }

  exports['default'] = {
    name: 'export-application-global',

    initialize: initialize
  };
});