/**
 * This module exports the controls under the original/core/controls namespace.
 * It is used by the weebly and wix integrations.
 */

var define = function(require, module) {
  if (module)
    return function(_, __, m) {
      m.exports = require(module);
    };
  else
    return function(_, __, m) {
      m.exports = require;
    };
};

function defineAll(r, prefix) {
  var nameRegex = /^\.\/(.+)\.(pug|coffee)$/;
  r.keys().forEach(function(key) {
    var moduleName = nameRegex.exec(key)[1];
    if (prefix) moduleName = prefix + moduleName;
    window.require.define({ [moduleName]: define(r, key) });
  });
}
defineAll(require.context('../', true, /\.pug$/), 'original/');
defineAll(
  require.context('../core/controls', true, /^((?!browser).)*\.coffee$/),
  'original/core/controls/'
);
