define(["exports", "core/pubsubhub"], function (exports, _pubsubhub) {
  "use strict";

  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.name = undefined;
  var name = exports.name = "core/include-config"; // Module core/include-config
  // Inject's the document's configuration into the head as JSON.


  var userConfig = {};
  var amendConfig = function amendConfig(newValues) {
    return Object.assign(userConfig, newValues);
  };

  (0, _pubsubhub.sub)("start-all", amendConfig);
  (0, _pubsubhub.sub)("amend-user-config", amendConfig);
  (0, _pubsubhub.sub)("end-all", function () {
    var script = document.createElement("script");
    script.id = "initialUserConfig";
    script.type = "application/json";
    script.innerHTML = JSON.stringify(userConfig, null, 2);
    document.head.appendChild(script);
  });
});
//# sourceMappingURL=include-config.js.map