********************
modules/module/react.js
********************
182320
function ReactRegister(module, events) {
        "use strict";
    
        // jsx register functions that creates the React elements
        // this is done this way because React.createElement cannot be called until
        // React is loaded by requirejs
        var registeredFunctions = {};
    
        var React, ReactDOM;
    
        var items = {};
        Object.defineProperty(this, 'items', {
            'get': function () {
                return items;
            }
        });
    
        var ready;
        var loading;
        Object.defineProperty(this, 'loading', {
            'get': function () {
                return loading;
            }
        });
    
        var loadDependencies = function () {
    
            require(['react', 'react-dom'], function (_React, _ReactDOM) {
    
                React = _React;
                ReactDOM = _ReactDOM;
    
                module.React = React;
                module.ReactDOM = ReactDOM;
    
                for (var key in registeredFunctions) {
                    items[key] = registeredFunctions[key]();
                }
    
                loading = false;
                ready = true;
    
                for (var i in callbacks) {
                    callbacks[i]();
                }
                callbacks = [];
    
                events.trigger('react:ready');
    
            });
    
        };
    
        var checkDependencies = function () {
    
            if (ready || loading) {
                return;
            }
    
            loading = true;
    
            // the timeout is to avoid MISMATCHED ANONYMOUS DEFINE (requirejs)
            setTimeout(loadDependencies, 0);
    
        };
    
        this.register = function (key, createElementFnc) {
    
            checkDependencies();
    
            if (!ready) {
                registeredFunctions[key] = createElementFnc;
                return;
            }
    
            items[key] = createElementFnc();
    
        };
    
        var callbacks = [];
        this.done = function (callback) {
    
            if (ready) {
                callback();
                return;
            }
    
            callbacks.push(callback);
    
        };
    
        this.createControl = function (specs) {
            "use strict";
    
            if (!React) {
                console.error('Wait for React to be ready');
                return;
            }
    
            if (!specs || typeof specs.render !== 'function') {
                console.warn('Invalid control specification');
            }
    
            return React.createClass({
    
                'getInitialState': function () {
    
                    if (typeof this.props.sna !== 'object') {
                        console.warn('sna is invalid or not set');
                        return null;
                    }
    
                    this.sna = this.props.sna;
                    this.extended = this.props.extended;
    
                    if (typeof this.sna.actions !== 'object') {
                        console.warn('sna actions are invalid or not defined');
                    }
                    else {
                        this.actions = this.sna.actions;
                    }
    
                    if (typeof this.sna.state !== 'object') {
                        console.warn('sna state is invalid or not defined');
                        return null;
                    }
    
                    return this.sna.state;
    
                },
                '_onChange': function () {
    
                    if (typeof this.sna.state !== 'object') {
                        console.warn('sna state is invalid or not defined');
                        return null;
                    }
    
                    if (typeof this.sna.actions !== 'object') {
                        console.warn('sna actions are invalid or not defined');
                    }
                    else {
                        this.actions = this.sna.actions;
                    }
    
                    this.setState(this.sna.state);
    
                },
                'componentDidMount': function () {
    
                    if (!this.sna || !this.sna.bind) return;
                    this.sna.bind('change', this._onChange);
    
                    if (!specs || !specs.componentDidMount) return null;
                    return specs.componentDidMount.call(this, specs);
    
                },
                'componentWillUnmount': function () {
    
                    if (!this.sna || !this.sna.unbind) return;
                    this.sna.unbind('change', this._onChange);
    
                    if (!specs || !specs.componentWillUnmount) return null;
                    return specs.componentWillUnmount.call(this, specs);
    
                },
                'componentWillUpdate': function () {
    
                    if (!specs || !specs.componentWillUpdate) return null;
                    return specs.componentWillUpdate.call(this, specs);
    
                },
                'componentDidUpdate': function () {
    
                    if (!specs || !specs.componentDidUpdate) return null;
                    return specs.componentDidUpdate.call(this, specs);
    
                },
                'render': function () {
    
                    if (!specs || !specs.render) return null;
    
                    specs.extended = this.props.extended;
                    return specs.render.call(specs, this.state, this.actions, this);
    
                }
    
            });
    
        }
    
    }
646155
function (allMods) {
            var self = this,
                comboUrls,
                timeout = Config.timeout;

            comboUrls = self.getComboUrls(allMods);

            // load css first to avoid page blink
            if (comboUrls.css) {
                loadScripts(comboUrls.css, function (success, error) {
                    if ('@DEBUG@') {
                        debugRemoteModules(success);
                    }

                    each(success, function (one) {
                        each(one.mods, function (mod) {
                            addModule(mod.name, Utils.noop);
                            // notify all loader instance
                            mod.flush();
                        });
                    });

                    each(error, function (one) {
                        each(one.mods, function (mod) {
                            var msg = mod.name + ' is not loaded! can not find module in url: ' + one.url;
                            S.log(msg, 'error');
                            mod.status = ERROR;
                            // notify all loader instance
                            mod.flush();
                        });
                    });
                }, timeout);
            }

            // jss css download in parallel
            if (comboUrls.js) {
                loadScripts(comboUrls.js, function (success) {
                    if ('@DEBUG@') {
                        debugRemoteModules(success);
                    }

                    each(comboUrls.js, function (one) {
                        each(one.mods, function (mod) {
                            // fix #111
                            // https://github.com/kissyteam/kissy/issues/111
                            if (!mod.factory) {
                                var msg = mod.name +
                                    ' is not loaded! can not find module in url: ' +
                                    one.url;
                                S.log(msg, 'error');
                                mod.status = ERROR;
                            }
                            // notify all loader instance
                            mod.flush();
                        });
                    });
                }, timeout);
            }
        }
678777
function library(argv, config, args) {
  if (!isValidPackageName(args.name)) {
    return Promise.reject(
      args.name + ' is not a valid name for a project. Please use a valid ' +
      'identifier name (alphanumeric).'
    );
  }

  const root = process.cwd();
  const libraries = path.resolve(root, 'Libraries');
  const libraryDest = path.resolve(libraries, args.name);
  const source = path.resolve('node_modules', 'react-native', 'Libraries', 'Sample');

  if (!fs.existsSync(libraries)) {
    fs.mkdir(libraries);
  }

  if (fs.existsSync(libraryDest)) {
    return Promise.reject(`Library already exists in ${libraryDest}`);
  }

  walk(source).forEach(f => {
    if (f.indexOf('project.xcworkspace') !== -1 ||
        f.indexOf('.xcodeproj/xcuserdata') !== -1) {
      return;
    }

    const dest = f.replace(/Sample/g, args.name).replace(/^_/, '.');
    copyAndReplace(
      path.resolve(source, f),
      path.resolve(libraryDest, dest),
      {'Sample': args.name}
    );
  });

  console.log('Created library in', libraryDest);
  console.log('Next Steps:');
  console.log('   Link your library in Xcode:');
  console.log(
    '   https://facebook.github.io/react-native/docs/' +
    'linking-libraries-ios.html#content\n'
  );
}
11270
function hotCreateModule(moduleId) {
/******/ 		var hot = {
/******/ 			// private stuff
/******/ 			_acceptedDependencies: {},
/******/ 			_declinedDependencies: {},
/******/ 			_selfAccepted: false,
/******/ 			_selfDeclined: false,
/******/ 			_disposeHandlers: [],
/******/ 			_main: hotCurrentChildModule !== moduleId,
/******/
/******/ 			// Module API
/******/ 			active: true,
/******/ 			accept: function(dep, callback) {
/******/ 				if (dep === undefined) hot._selfAccepted = true;
/******/ 				else if (typeof dep === "function") hot._selfAccepted = dep;
/******/ 				else if (typeof dep === "object")
/******/ 					for (var i = 0; i < dep.length; i++)
/******/ 						hot._acceptedDependencies[dep[i]] = callback || function() {};
/******/ 				else hot._acceptedDependencies[dep] = callback || function() {};
/******/ 			},
/******/ 			decline: function(dep) {
/******/ 				if (dep === undefined) hot._selfDeclined = true;
/******/ 				else if (typeof dep === "object")
/******/ 					for (var i = 0; i < dep.length; i++)
/******/ 						hot._declinedDependencies[dep[i]] = true;
/******/ 				else hot._declinedDependencies[dep] = true;
/******/ 			},
/******/ 			dispose: function(callback) {
/******/ 				hot._disposeHandlers.push(callback);
/******/ 			},
/******/ 			addDisposeHandler: function(callback) {
/******/ 				hot._disposeHandlers.push(callback);
/******/ 			},
/******/ 			removeDisposeHandler: function(callback) {
/******/ 				var idx = hot._disposeHandlers.indexOf(callback);
/******/ 				if (idx >= 0) hot._disposeHandlers.splice(idx, 1);
/******/ 			},
/******/
/******/ 			// Management API
/******/ 			check: hotCheck,
/******/ 			apply: hotApply,
/******/ 			status: function(l) {
/******/ 				if (!l) return hotStatus;
/******/ 				hotStatusHandlers.push(l);
/******/ 			},
/******/ 			addStatusHandler: function(l) {
/******/ 				hotStatusHandlers.push(l);
/******/ 			},
/******/ 			removeStatusHandler: function(l) {
/******/ 				var idx = hotStatusHandlers.indexOf(l);
/******/ 				if (idx >= 0) hotStatusHandlers.splice(idx, 1);
/******/ 			},
/******/
/******/ 			//inherit from previous dispose call
/******/ 			data: hotCurrentModuleData[moduleId]
/******/ 		};
/******/ 		hotCurrentChildModule = undefined;
/******/ 		return hot;
/******/ 	}
752295
async function compileModel (projectPath, model) {
  await copyExternalScripts(projectPath, model)
  deInlineScripts(projectPath, model)

  const lookup = resolveScriptPaths(projectPath, model)

  let imports = ''
  for (let moduleName in lookup) {
    let p = path.isAbsolute(lookup[moduleName]) ? lookup[moduleName] : `./${path.normalize(lookup[moduleName])}`
    imports += `import ${moduleName} from '${p}'\n`
  }

  const pre = JSON.stringify(model, null, 2)

  let post = pre
  for (let moduleName in lookup)
    post = replaceAll(post, moduleName)

  return `import substrate from 'substrate'

// imports generated by the compiler
${imports}

const dom = document.createElement('div')
dom.id = 'myapp'
document.body.appendChild(dom)

const model = ${post}

const app = substrate({ dom, node: model.rootNode, registry: model.registry })`
}
1072474
function bundler(loader, options, modules) {
  var stack    = modules.slice(0);
  var mods     = [];
  var finished = {};

  function processModule(mod) {
    if (finished.hasOwnProperty(mod.id)) {
      return;
    }

    mod = loader.getModule(mod.id);

    // browser pack chunk
    var browserpack = {
      id     : mod.id,
      source : mod.source,
      deps   : {}
    };

    // Gather up all dependencies
    var i, length, dep;
    for (i = 0, length = mod.deps.length; i < length; i++) {
      dep = mod.deps[i];
      stack.push(dep);
      browserpack.deps[dep.id] = dep.id;
    }

    finished[mod.id] = browserpack;
    mods.unshift(browserpack);
  }

  // Process all modules
  while (stack.length) {
    processModule(stack.pop());
  }

  var stream = browserPack(options).setEncoding("utf8");
  var promise = pstream(stream);

  stream.end(JSON.stringify(mods));
  return promise;
}
1111390
function linkModules (pkg, target, cb) {
  log.silly(pkg.modules, "linkModules")
  log.verbose(target, "linkModules")
  if (target === npm.root
      && !target.match(/node_modules$/)
      && -1 === require.paths.indexOf(target)) {
    log.warn("modules installing to "+target+", outside NODE_PATH")
  }
  if (!pkg.modules) pkg.modules = {}
  var mod = pkg.modules

  // FIXME: remove in 0.3.0, and uncomment this functionality in
  // lib/utils/read-json.js
  if (pkg.main) {
    mod["index.js"] = pkg.main
    delete pkg.main
  }

  var versionDir = path.join(npm.dir, pkg.name, pkg.version)
    , pkgDir = path.join(versionDir, "package")

  asyncMap(Object.keys(mod), function (key, cb) {
    writeShim
      ( path.join(pkgDir, mod[key])
      , path.join(target, key.replace(/\.js$/, '')+".js")
      , path.join(versionDir, "node_modules")
      , cb
      )
  }, function (er) {
    if (er) return cb(er)
    mkdir(target, function (er) {
      if (er) return cb(er)
      pkg._npmConfig = npm.config.get()
      pkg._env = {}
      Object.keys(process.env).forEach(function (e) {
        if (!e.match(/^npm_/i)) return
        pkg._env[e] = process.env[e]
      })
      pkg._npmPaths = { root : npm.root
                      , dir : npm.dir
                      , cache : npm.cache
                      , tmp : npm.tmp
                      , package : pkgDir
                      , modules : target
                      , dependencies : path.join(versionDir, "node_modules")
                      }
      var pkgCode = "module.exports = "
                  + JSON.stringify(pkg, null, 2)
                  + "\n"
      delete pkg._npmConfig
      delete pkg._npmPaths
      fs.writeFile(path.join(target,"package.json.js"), pkgCode, "utf8", cb)
    })
  })
}
578844
function importScript(src) {
  // Scan all search paths in order, trying to find the file.
  //var relPath = path.join(path.dirname(process.argv[1]) + '/', src);
  var filePath = src;//path.relative(process.cwd(), relPath);
  for (var n = 0; n < SEARCH_PATHS.length; n++) {
    var searchPath = path.join(process.cwd(), SEARCH_PATHS[n]);
    var searchFilePath = path.join(searchPath, filePath);
    if (fileExistsSync(searchFilePath)) {
      var sourceCode = fs.readFileSync(searchFilePath, 'utf8');
      try {
        vm.runInThisContext(sourceCode, searchFilePath);
      } catch (e) {
        console.log('Error running script ' + src);
        throw e;
      }
      return true;
    }
  }

  // File not found.
  console.log('ERROR: could not find ' + src);
  return false;
}
997852
function useModule(name, moduleClass) {
    if (arguments.length === 1) {
        moduleClass = name;
        name = null;
    }

    // create module
    var module = new moduleClass(),
        bootResponse = void 0;

    // Wrapper methods
    function boot() {
        var initialResponse = typeof module.boot === "function" ? module.boot() : null;

        if (initialResponse === false) {
            return false;
        }

        return initialResponse instanceof _es6Promise.Promise ? initialResponse.then(function (response) {
            bootResponse = response;
            return module;
        }) : module;
    }

    function ready() {
        if (typeof module.ready === "function") {
            return module.ready(bootResponse);
        }
    }

    return typeof name === "string" ? (0, _packages.define)(name, boot).then(ready) : (0, _packages.define)(boot).then(ready);
}
939246
function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();var _react=__webpack_require__(0);var _react2=_interopRequireDefault(_react);var _propTypes=__webpack_require__(1);var _propTypes2=_interopRequireDefault(_propTypes);var _Component2=__webpack_require__(5);var _Component3=_interopRequireDefault(_Component2);var _Css=__webpack_require__(2);var _Css2=_interopRequireDefault(_Css);var _Icon=__webpack_require__(10);var _Icon2=_interopRequireDefault(_Icon);var _Spinner=__webpack_require__(15);var _Spinner2=_interopRequireDefault(_Spinner);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&((typeof call==='undefined'?'undefined':_typeof2(call))==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+(typeof superClass==='undefined'?'undefined':_typeof2(superClass)));}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var Button=function(_Component){_inherits(Button,_Component);function Button(props){_classCallCheck(this,Button);var _this=_possibleConstructorReturn(this,(Button.__proto__||Object.getPrototypeOf(Button)).call(this,props));_this.handleMouseOver=_this.handleMouseOver.bind(_this);_this.handleMouseOut=_this.handleMouseOut.bind(_this);return _this;}_createClass(Button,[{key:'handleMouseOver',value:function handleMouseOver(e){var onMouseOver=this.props.onMouseOver;if(onMouseOver){onMouseOver(e);}this.setState({isHovered:true});}},{key:'handleMouseOut',value:function handleMouseOut(e){var onMouseOut=this.props.onMouseOut;if(onMouseOut){onMouseOut(e);}this.setState({isHovered:false});}},{key:'render',value:function render(){var _props=this.props,buttonRef=_props.buttonRef,children=_props.children,className=_props.className,cssMap=_props.cssMap,defaultValue=_props.defaultValue,forceHover=_props.forceHover,iconPosition=_props.iconPosition,iconType=_props.iconType,isDisabled=_props.isDisabled,isReadOnly=_props.isReadOnly,isLoading=_props.isLoading,label=_props.label,onClick=_props.onClick,role=_props.role,type=_props.type,value=_props.value;var _state=this.state,id=_state.id,isHovered=_state.isHovered;var iconMarkup=void 0;if(iconType&&iconType!=='none'){iconMarkup=_react2.default.createElement('div',{className:cssMap.iconContainer},_react2.default.createElement(_Icon2.default,{className:cssMap.icon,type:iconType,theme:role==='control'?role:'button',variant:'stroke',forceHover:isHovered,isDisabled:isDisabled}));}var content=_react2.default.createElement('div',{className:cssMap.content},iconMarkup,_react2.default.createElement('div',{className:cssMap.label},children||label));return _react2.default.createElement(_Css2.default,{cssMap:cssMap,cssProps:{role:role,iconPosition:iconPosition,loading:isLoading&&!isDisabled,disabled:isDisabled,fakeHovered:forceHover}},_react2.default.createElement('button',{ref:buttonRef,type:type,className:className,id:id,defaultValue:defaultValue,value:value,disabled:isDisabled||isLoading||isReadOnly,onClick:onClick,onMouseEnter:this.handleMouseOver,onMouseLeave:this.handleMouseOut},content,isLoading&&!isDisabled&&_react2.default.createElement('div',{className:cssMap.loadingOverlay},_react2.default.createElement(_Spinner2.default,{className:cssMap.spinner}))));}}]);return Button;}(_Component3.default);Button.propTypes={/**
    *  Label text
    */label:_propTypes2.default.string,/**
    *  HTML type attribute
    */type:_propTypes2.default.oneOf(['button','reset','submit']),/**
    *  Button role/style
    */role:_propTypes2.default.oneOf(['default','subtle','promoted','critical','control']),/**
    *  Icon type to display (overrides customIcon)
    */iconType:_propTypes2.default.oneOf(['add','alert','approved','calendar','close','declined','delete','down','download','duplicate','edit','ended','error','info','inspect','left','link','pending','preview','reset','right','search','up','upload','validation','none']),/*
     *  Icon position relative to Button text
     */iconPosition:_propTypes2.default.oneOf(['left','right']),/**
    *  Display as disabled
    */isDisabled:_propTypes2.default.bool,/**
    *  Display as read-only
    */isReadOnly:_propTypes2.default.bool,/**
    *  Display loading state
    */isLoading:_propTypes2.default.bool,/**
    *  Initial HTML value attribute
    */defaultValue:_propTypes2.default.string,/**
    *  HTML value attribute
    */value:_propTypes2.default.string,/**
     * HTML id attribute (overwrite default)
     */id:_propTypes2.default.string,/**
     *  Button click callback function: ( e ) => { ... }
     */onClick:_propTypes2.default.func,/**
     *  Mouse over callback function: ( e ) => { ... }
     */onMouseOver:_propTypes2.default.func,/**
     *  Mouse out callback function: ( e ) => { ... }
     */onMouseOut:_propTypes2.default.func,/**
     * Display as hover when required from another component
     */forceHover:_propTypes2.default.bool,/**
     * Callback that receives the native <button>: ( ref ) => { ... }
     */buttonRef:_propTypes2.default.func};Button.defaultProps={type:'button',role:'default',iconType:'none',iconPosition:'left',isLoading:false,isDisabled:false,isReadOnly:false,forceHover:false,cssMap:__webpack_require__(111)};exports.default=Button;/***/}
473998
function (ID, events) {
        "use strict";
    
        Object.defineProperty(this, 'ID', {
            'get': function () {
                return ID;
            }
        });
    
        var library;
        (function (ID) {
    
            ID = ID.split('/');
            if (ID[0] === 'libraries') {
                library = beyond.libraries.get(ID[1]);
            }
    
        })(ID);
        Object.defineProperty(this, 'library', {
            'get': function () {
                return library;
            }
        });
    
        var path = ID;
        if (library && path === library.path) {
            path = path + '/main';
        }
    
        path = path.split('/');
        if (library) {
            // Remove /libraries/library
            path.splice(0, 2);
        }
        else {
            // Remove /application
            path.splice(0, 1);
        }
    
        path = path.join('/');
    
        Object.defineProperty(this, 'path', {
            'get': function () {
                return path;
            }
        });
    
        var host;
        if (library) {
            host = beyond.hosts.libraries[library.name].js;
        }
        else {
            host = beyond.hosts.application.js;
        }
        host += path;
        Object.defineProperty(this, 'host', {
            'get': function () {
                return host;
            }
        });
    
        var plugins = new Plugins(this);
        Object.defineProperty(this, 'plugins', {
            'get': function () {
                return plugins;
            }
        });
    
        var texts = new Texts(this);
        Object.defineProperty(this, 'texts', {
            'get': function () {
                return texts;
            }
        });
    
        this.react = new ReactRegister(this, events);
    
        this.control = new Control(this);
    
        var dependencies = new Dependencies(this);
        this.dependencies = dependencies;
    
        this.Action = Action(this, events);
    
        this.invalidateCache = function (actionPath, params) {
    
            var request = new Request(this, actionPath, params);
            var cache = new Cache();
    
            return cache.invalidate(request);
    
        };
    
        this.execute = function () {
    
            var args = [].slice.call(arguments);
    
            // options must be after callback
            var actionPath, params, callback, options;
    
            for (var i in args) {
    
                var arg = args[i];
                switch (typeof arg) {
                    case 'string':
                        actionPath = arg;
                        break;
                    case 'function':
                        callback = arg;
                        break;
                    case 'object':
                        if (callback) options = arg;
                        else params = arg;
                }
    
            }
    
            if (typeof params === 'function' && typeof callback === 'undefined') {
                callback = params;
                params = undefined;
            }
    
            var action = new this.Action(actionPath, params);
            action.onResponse = function (response) {
                if (callback) callback(response);
            };
            action.onError = function (error) {
                if (callback) callback(undefined, error);
            };
            action.execute();
    
        };
    
        var styles = new ModuleStyles(this);
        Object.defineProperty(this, 'styles', {
            'get': function () {
                return styles;
            }
        });
    
        Object.defineProperty(this, 'css', {
            'get': function () {
                return styles;
            }
        });
    
        var templates = new ModuleTemplates(this);
        Object.defineProperty(this, 'templates', {
            'get': function () {
                return templates;
            }
        });
    
        this.render = function (path, params) {
            return templates.render(path, params);
        };
    
        Object.defineProperty(this, 'custom', {
            'get': function () {
    
                if (!library) {
                    return;
                }
    
                var custom = 'application/custom/' + library.name + '/' + this.path;
                return custom;
    
            }
        });
    
        this.socket = function (callback) {
    
            if (this.ID.substr(0, 10) === 'libraries/') {
    
                if (!library.socket) {
                    console.error('library does not support server communication', library.name);
                    return;
                }
                library.socket(function (socket) {
                    callback(socket);
                });
    
            }
            else {
    
                beyond.socket(function (socket) {
                    callback(socket);
                });
    
            }
    
        };
    
        var ready;
        Object.defineProperty(this, 'ready', {
            'get': function () {
                return !!ready;
            }
        });
    
        var callbacks = [];
        this.done = function (callback) {
    
            if (ready) {
                callback(dependencies.modules);
                return;
            }
    
            callbacks.push(callback);
    
        };
    
        this.dependencies.done(function () {
    
            ready = true;
    
            for (var i in callbacks) {
                callbacks[i](dependencies.modules);
            }
            callbacks = undefined;
    
        });
    
    }
112361
function () {
/*Line 29 - 'AtomUIComponent.js' */                if (this._localScope === undefined) {
/*Line 30 - 'AtomUIComponent.js' */                    var ap = this.get_atomParent(this._element._logicalParent || this._element.parentNode);
/*Line 31 - 'AtomUIComponent.js' */                    if (ap) {
/*Line 32 - 'AtomUIComponent.js' */                        return ap.get_localScope();
/*Line 33 - 'AtomUIComponent.js' */                    } else {
/*Line 34 - 'AtomUIComponent.js' */                        throw new Error("Local Scope does not exist");
/*Line 35 - 'AtomUIComponent.js' */                    }
/*Line 36 - 'AtomUIComponent.js' */                }
/*Line 37 - 'AtomUIComponent.js' */                return this._localScope;
/*Line 38 - 'AtomUIComponent.js' */            }
1097876
function scripts (src, dest, watch) {
  var bundleOpts = _.extend({}, watchify.args)
  if (watch) bundleOpts.debug = true

  var bundle = browserify(src, bundleOpts)

  if (watch) {
    bundle = watchify(bundle)

    bundle.on('update', function () { compileBundle(bundle, dest) }) // when a dependency changes, recompile
    bundle.on('log', gutil.log) // output build logs to terminal
  } else {
    bundle.transform({ global: true }, 'uglifyify')
  }

  return compileBundle(bundle, dest)
}
905894
async function compile(exitOnError = true) {
  config = config || (await asyncConfig());
  const startMessage = chalk.blue('Compiling Static Site...');
  const startTime = timer.start();
  let spinner;
  if (config.verbosity > 2) {
    console.log(startMessage);
  } else {
    spinner = ora(startMessage).start();
  }

  const pages = await getPages(config.srcDir);

  const renderPages = pages.map(async page => {
    const site = await getSiteData(pages);

    const layout = page.meta.layout ? page.meta.layout : 'default';
    const { ok, html, message } = await render(`@bolt/${layout}.twig`, {
      page,
      site,
    });

    if (!ok) {
      if (exitOnError) {
        log.errorAndExit(message);
      } else {
        log.error(message);
      }
    }

    const htmlFilePath = path.join(config.wwwDir, page.url);
    await mkdirp(path.dirname(htmlFilePath));
    await writeFile(htmlFilePath, html);
    if (config.verbosity > 3) {
      log.dim(`Wrote: ${htmlFilePath}`);
    }

    return true;
  });

  Promise.all(renderPages)
    .then(() => {
      const endMessage = chalk.green(
        `Compiled Static Site in ${timer.end(startTime)}`,
      );
      if (config.verbosity > 2) {
        console.log(endMessage);
      } else {
        spinner.succeed(endMessage);
      }
    })
    .catch(error => {
      console.log(error);
      const endMessage = chalk.red(
        `Compiling Static Site failed in ${timer.end(startTime)}`,
      );
      spinner.fail(endMessage);
    });
}
659094
function(module, exports, __webpack_require__) {

	/* WEBPACK VAR INJECTION */(function(Vue) {'use strict';
	
	__webpack_require__(/*! module/common */ 2);
	
	var _foo = __webpack_require__(/*! module/hello/foo */ 3);
	
	var _foo2 = _interopRequireDefault(_foo);
	
	var _hello = __webpack_require__(/*! module/hello/hello */ 10);
	
	var _hello2 = _interopRequireDefault(_hello);
	
	var _classStyle = __webpack_require__(/*! module/hello/class-style */ 13);
	
	var _classStyle2 = _interopRequireDefault(_classStyle);
	
	var _ifShowElse = __webpack_require__(/*! module/hello/if-show-else */ 16);
	
	var _ifShowElse2 = _interopRequireDefault(_ifShowElse);
	
	var _event = __webpack_require__(/*! module/hello/event */ 19);
	
	var _event2 = _interopRequireDefault(_event);
	
	var _form = __webpack_require__(/*! module/hello/form */ 22);
	
	var _form2 = _interopRequireDefault(_form);
	
	var _myComponent = __webpack_require__(/*! component/my-component */ 25);
	
	var _myComponent2 = _interopRequireDefault(_myComponent);
	
	var _counter = __webpack_require__(/*! component/counter */ 28);
	
	var _counter2 = _interopRequireDefault(_counter);
	
	var _anchoredHeading = __webpack_require__(/*! component/anchored-heading */ 31);
	
	var _anchoredHeading2 = _interopRequireDefault(_anchoredHeading);
	
	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
	
	window.vm = new Vue({
	  render: function render(h) {
	    return h(
	      'div',
	      null,
	      [h(
	        _foo2['default'],
	        null,
	        []
	      ), h(
	        _hello2['default'],
	        null,
	        []
	      ), h(
	        _classStyle2['default'],
	        null,
	        []
	      ), h(
	        _ifShowElse2['default'],
	        null,
	        []
	      ), h(
	        _event2['default'],
	        null,
	        []
	      ), h(
	        _form2['default'],
	        null,
	        []
	      ), h(
	        _myComponent2['default'],
	        null,
	        []
	      ), h(
	        _counter2['default'],
	        null,
	        []
	      ), h(
	        _counter2['default'],
	        null,
	        []
	      ), h(
	        _counter2['default'],
	        null,
	        []
	      ), h(
	        'hr',
	        null,
	        []
	      ), h(
	        _anchoredHeading2['default'],
	        {
	          attrs: { level: 3 }
	        },
	        ['Hello world!']
	      )]
	    );
	  }
	}).$mount('#app');
	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! vue */ 1)))

/***/ }
48570
function script(source, options) {
  var tokens

  /* Make sure the require to the main module
   * is showed as if it was a require from
   * `./node_modules`.
   *
   * For example, when the example file
   * (`test/example.js`) requires the main file (as
   * listed in `test/package.json`, `main: "module.js"`)
   * as `./module`, it is replaced with `test`. */
  source = source.replace(EXPRESSION_REQUIRE, replace)

  /* Transform comments into markdown: */
  tokens = []

  source.split('\n').forEach(each)

  return tokens

  function replace($0, $1, $2, $3) {
    var filepath = resolveFrom.silent(
      path.dirname(options.example),
      unquote($2)
    )
    var quote

    if (options.main === filepath && options.name) {
      /* Honour quote style. */
      quote = $2.charAt(0)

      return $1 + quote + options.name + quote + $3
    }

    return $0
  }

  function each(line) {
    var match = line.match(EXPRESSION_COMMENT)

    tokens.push({
      type: match ? 'markdown' : 'javascript',
      value: match ? match[4] : line
    })
  }
}
807413
function bundleApp(codeList, ns, domload, compile, before, npmTree, o) {
  var l = []
    , usedBuiltIns = npmTree._builtIns
    , len = 0;
  delete npmTree._builtIns;

  // 1. construct the global namespace object
  l.push("window." + ns + " = {data:{}, path:{}};");

  // 2. attach path code to the namespace object so that require.js can efficiently resolve paths
  l.push('\n// include npm::path');
  var pathCode = read(join(builtInDir, 'path.posix.js'));
  l.push('(function (exports) {\n ' + pathCode + '\n}(window.' + ns + '.path));');

  // 3. pull in serialized data
  Object.keys(o.data).forEach(function (name) {
    return l.push(ns + ".data." + name + " = " + o.data[name] + ";");
  });

  // 4. attach require code
  var config = {
    namespace : ns
  , domains   : Object.keys(o.domains) // TODO: remove npm from here
  , arbiters  : o.arbiters
  , logging   : o.logLevel
  , npmTree   : npmTree
  , builtIns  : builtIns
  , slash     : '/' //TODO: figure out if different types can coexist, if so, determine in resolver, and on client
  };

  l.push(anonWrap(read(join(dir, 'require.js'))
    .replace(/VERSION/, JSON.parse(read(join(dir, '..', 'package.json'))).version)
    .replace(/REQUIRECONFIG/, JSON.stringify(config))
  ));

  // 5. include CommonJS compatible code in the order they have to be defined
  var defineWrap = function (exportName, domain, code) {
    return ns + ".define('" + exportName + "','" + domain + "',function (require, module, exports) {\n" + code + "\n});";
  };

  // 6. harvest function splits code into app and non-app code and defineWraps
  var harvest = function (onlyMain) {
    codeList.forEach(function (pair) {
      var dom = pair[0]
        , file = pair[1]
        , basename = file.split('.')[0];
      if ((dom === 'app') !== onlyMain) {
        return;
      }
      var code = before(compile(join(o.domains[dom], file)));
      l.push(defineWrap(basename, dom, code));
    });
  };

  // 7.a) include required builtIns
  l.push("\n// node builtins\n");
  len = l.length;
  usedBuiltIns.forEach(function (b) {
    if (b === 'path') { // already included
      return;
    }
    l.push(defineWrap(b, 'npm', read(join(builtInDir, b + '.js'))));
  });
  if (l.length === len) {
    l.pop();
  }

  // 7.b) include modules not on the app domain
  l.push("\n// shared code\n");
  len = l.length;
  harvest(false);
  if (l.length === len) {
    l.pop();
  }

  // 7.c) include modules on the app domain, and wait for domloader if set
  l.push("\n// app code - safety wrapped\n\n");
  domload(harvest(true));

  // 8. use a closure to encapsulate the private internal data and APIs
  return anonWrap(l.join('\n'));
}