diff --git a/Gruntfile.js b/Gruntfile.js index 8c942f233..84ed6446e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -102,6 +102,7 @@ module.exports = function (grunt) { "src/extension-pretty-name.js", "src/extension-tree-shaking.js", "src/extension-mjs.js", + "src/extension-forward-metadata.js", "src/trace/trace.js", "src/json/json.js", "src/cache-bust/cache-bust.js", @@ -134,6 +135,7 @@ module.exports = function (grunt) { "src/extension-pretty-name.js", "src/extension-tree-shaking.js", "src/extension-mjs.js", + "src/extension-forward-metadata.js", "src/trace/trace.js", "src/json/json.js", "src/cache-bust/cache-bust.js", @@ -163,6 +165,7 @@ module.exports = function (grunt) { "src/extension-pretty-name.js", "src/extension-tree-shaking.js", "src/extension-mjs.js", + "src/extension-forward-metadata.js", "src/trace/trace.js", "src/json/json.js", "src/cache-bust/cache-bust.js", diff --git a/main.js b/main.js index deac33ebe..88887a018 100644 --- a/main.js +++ b/main.js @@ -692,10 +692,11 @@ addStealExtension(function addMetaDeps(loader) { } loader.transpile = function (load) { + // TODO this needs to change prependDeps(this, load, createImport); var result = superTranspile.apply(this, arguments); return result; - } + }; loader._determineFormat = function (load) { if(load.metadata.format === 'cjs') { @@ -1356,6 +1357,31 @@ addStealExtension(function addMJS(loader){ }; }); +// This extension allows you to define metadata that should appear on +// Any subdependencies. For example we can add the { foo: true } bool +// to a module's metadata, and it will be forwarded to any subdependency. +addStealExtension(function forwardMetadata(loader){ + loader._forwardedMetadata = {}; + loader.setForwardedMetadata = function(prop) { + loader._forwardedMetadata[prop] = true; + }; + + loader.forwardMetadata = function(load, parentName) { + if(parentName) { + var parentLoad = this.getModuleLoad(parentName); + + if(parentLoad) { + // TODO use Object.assign instead? + for(var p in this._forwardedMetadata) { + if(p in parentLoad.metadata) { + load.metadata[p] = parentLoad.metadata[p]; + } + } + } + } + }; +}); + addStealExtension(function applyTraceExtension(loader) { loader._traceData = { loads: {}, @@ -1735,6 +1761,7 @@ addStealExtension(function addCacheBust(loader) { System.ext = Object.create(null); System.logLevel = 0; System.forceES5 = true; + System.transpileAllFormats = true; var cssBundlesNameGlob = "bundles/*.css", jsBundlesNameGlob = "bundles/*"; setIfNotPresent(System.paths,cssBundlesNameGlob, "dist/bundles/*css"); @@ -1988,9 +2015,11 @@ addStealExtension(function addCacheBust(loader) { this.paths["@@babel-code-frame"] = dirname+"/ext/babel-code-frame.js"; setIfNotPresent(this.meta,"traceur",{"exports":"traceur"}); setIfNotPresent(this.meta, "@@babel-code-frame", {"format":"global","exports":"BabelCodeFrame"}); + setIfNotPresent(this.meta, "babel", {"shouldTranspile": false}); // steal-clone is contextual so it can override modules using relative paths this.setContextual('steal-clone', 'steal-clone'); + this.setForwardedMetadata("shouldTranspile"); if(isNode) { if(this.configMain === "@config" && last(parts) === "steal") { diff --git a/src/config.js b/src/config.js index 61f2c2cb5..a029bf684 100644 --- a/src/config.js +++ b/src/config.js @@ -40,6 +40,7 @@ System.ext = Object.create(null); System.logLevel = 0; System.forceES5 = true; + System.transpileAllFormats = true; var cssBundlesNameGlob = "bundles/*.css", jsBundlesNameGlob = "bundles/*"; setIfNotPresent(System.paths,cssBundlesNameGlob, "dist/bundles/*css"); @@ -293,9 +294,11 @@ this.paths["@@babel-code-frame"] = dirname+"/ext/babel-code-frame.js"; setIfNotPresent(this.meta,"traceur",{"exports":"traceur"}); setIfNotPresent(this.meta, "@@babel-code-frame", {"format":"global","exports":"BabelCodeFrame"}); + setIfNotPresent(this.meta, "babel", {"shouldTranspile": false}); // steal-clone is contextual so it can override modules using relative paths this.setContextual('steal-clone', 'steal-clone'); + this.setForwardedMetadata("shouldTranspile"); if(isNode) { if(this.configMain === "@config" && last(parts) === "steal") { diff --git a/src/extension-forward-metadata.js b/src/extension-forward-metadata.js new file mode 100644 index 000000000..4f0645fad --- /dev/null +++ b/src/extension-forward-metadata.js @@ -0,0 +1,24 @@ +// This extension allows you to define metadata that should appear on +// Any subdependencies. For example we can add the { foo: true } bool +// to a module's metadata, and it will be forwarded to any subdependency. +addStealExtension(function forwardMetadata(loader){ + loader._forwardedMetadata = {}; + loader.setForwardedMetadata = function(prop) { + loader._forwardedMetadata[prop] = true; + }; + + loader.forwardMetadata = function(load, parentName) { + if(parentName) { + var parentLoad = this.getModuleLoad(parentName); + + if(parentLoad) { + // TODO use Object.assign instead? + for(var p in this._forwardedMetadata) { + if(p in parentLoad.metadata) { + load.metadata[p] = parentLoad.metadata[p]; + } + } + } + } + }; +}); diff --git a/src/extension-no-main.js b/src/extension-no-main.js index 46a16db2b..efba793e9 100644 --- a/src/extension-no-main.js +++ b/src/extension-no-main.js @@ -17,7 +17,8 @@ addStealExtension(function addNoMainWarn(loader) { "package.json!npm": true, "npm": true, "@empty": true, - "@dev": true + "@dev": true, + "babel": true }; var loaderImport = loader.import; diff --git a/src/loader/lib/loader.js b/src/loader/lib/loader.js index a774f244d..00e497e12 100644 --- a/src/loader/lib/loader.js +++ b/src/loader/lib/loader.js @@ -212,6 +212,8 @@ function logloads(loads) { load = createLoad(name); loader.loads.push(load); + loader.loaderObj.forwardMetadata(load, refererName); + proceedToLocate(loader, load); return load; @@ -245,6 +247,10 @@ function logloads(loads) { ); } + function transpilableFormat(format) { + return format === "cjs" || format === "amd"; + } + var anonCnt = 0; // 15.2.4.5 @@ -300,9 +306,20 @@ function logloads(loads) { }); } else if (typeof instantiateResult == 'object') { - load.depsList = instantiateResult.deps || []; - load.execute = instantiateResult.execute; - load.isDeclarative = false; + function addToLoad() { + load.depsList = instantiateResult.deps || []; + load.execute = instantiateResult.execute; + load.isDeclarative = false; + } + + if(!loader.loaderObj.transpileAllFormats || + load.metadata.shouldTranspile === false || + !transpilableFormat(load.metadata.format)) { + return addToLoad(); + } + + return loader.loaderObj.transpile(load).then(addToLoad); + } else throw TypeError('Invalid instantiate return value'); diff --git a/src/loader/lib/transpiler.js b/src/loader/lib/transpiler.js index f2891975c..0bb933053 100644 --- a/src/loader/lib/transpiler.js +++ b/src/loader/lib/transpiler.js @@ -97,7 +97,8 @@ } catch(e) { // traceur throws an error array - throw e[0]; + var error = e[0] || e.errors[0]; + throw error; } } @@ -217,7 +218,12 @@ var npmPluginNameOrPath = getNpmPluginNameOrPath(name); // import the plugin! - promises.push(this["import"](npmPluginNameOrPath, { name: parent }) + promises.push(this["import"](npmPluginNameOrPath, { + name: parent, + metadata: { + shouldTranspile: false + } + }) .then(function(mod) { var exported = mod.__esModule ? mod["default"] : mod; @@ -298,7 +304,7 @@ function getBabelPresets(current, loader) { var presets = current || []; var forceES5 = loader.forceES5 !== false; - var defaultPresets = forceES5 + var defaultPresets = forceES5 ? [babelES2015Preset, "react", "stage-0"] : ["react"]; @@ -438,7 +444,12 @@ var npmPresetNameOrPath = getNpmPresetNameOrPath(name); // import the preset! - promises.push(this["import"](npmPresetNameOrPath, { name: parent }) + promises.push(this["import"](npmPresetNameOrPath, { + name: parent, + metadata: { + shouldTranspile: false + } + }) .then(function(mod) { var exported = mod.__esModule ? mod["default"] : mod; diff --git a/src/loader/loader-with-promises.js b/src/loader/loader-with-promises.js index da9115150..20f0bc680 100644 --- a/src/loader/loader-with-promises.js +++ b/src/loader/loader-with-promises.js @@ -1522,6 +1522,8 @@ function logloads(loads) { load = createLoad(name); loader.loads.push(load); + loader.loaderObj.forwardMetadata(load, refererName); + proceedToLocate(loader, load); return load; @@ -1555,6 +1557,10 @@ function logloads(loads) { ); } + function transpilableFormat(format) { + return format === "cjs" || format === "amd"; + } + var anonCnt = 0; // 15.2.4.5 @@ -1610,9 +1616,20 @@ function logloads(loads) { }); } else if (typeof instantiateResult == 'object') { - load.depsList = instantiateResult.deps || []; - load.execute = instantiateResult.execute; - load.isDeclarative = false; + function addToLoad() { + load.depsList = instantiateResult.deps || []; + load.execute = instantiateResult.execute; + load.isDeclarative = false; + } + + if(!loader.loaderObj.transpileAllFormats || + load.metadata.shouldTranspile === false || + !transpilableFormat(load.metadata.format)) { + return addToLoad(); + } + + return loader.loaderObj.transpile(load).then(addToLoad); + } else throw TypeError('Invalid instantiate return value'); @@ -2648,7 +2665,8 @@ function logloads(loads) { } catch(e) { // traceur throws an error array - throw e[0]; + var error = e[0] || e.errors[0]; + throw error; } } @@ -2768,7 +2786,12 @@ function logloads(loads) { var npmPluginNameOrPath = getNpmPluginNameOrPath(name); // import the plugin! - promises.push(this["import"](npmPluginNameOrPath, { name: parent }) + promises.push(this["import"](npmPluginNameOrPath, { + name: parent, + metadata: { + shouldTranspile: false + } + }) .then(function(mod) { var exported = mod.__esModule ? mod["default"] : mod; @@ -2849,7 +2872,7 @@ function logloads(loads) { function getBabelPresets(current, loader) { var presets = current || []; var forceES5 = loader.forceES5 !== false; - var defaultPresets = forceES5 + var defaultPresets = forceES5 ? [babelES2015Preset, "react", "stage-0"] : ["react"]; @@ -2989,7 +3012,12 @@ function logloads(loads) { var npmPresetNameOrPath = getNpmPresetNameOrPath(name); // import the preset! - promises.push(this["import"](npmPresetNameOrPath, { name: parent }) + promises.push(this["import"](npmPresetNameOrPath, { + name: parent, + metadata: { + shouldTranspile: false + } + }) .then(function(mod) { var exported = mod.__esModule ? mod["default"] : mod; diff --git a/src/loader/loader.js b/src/loader/loader.js index 48a9376f7..cacffc4ce 100644 --- a/src/loader/loader.js +++ b/src/loader/loader.js @@ -252,6 +252,8 @@ function logloads(loads) { load = createLoad(name); loader.loads.push(load); + loader.loaderObj.forwardMetadata(load, refererName); + proceedToLocate(loader, load); return load; @@ -285,6 +287,10 @@ function logloads(loads) { ); } + function transpilableFormat(format) { + return format === "cjs" || format === "amd"; + } + var anonCnt = 0; // 15.2.4.5 @@ -340,9 +346,20 @@ function logloads(loads) { }); } else if (typeof instantiateResult == 'object') { - load.depsList = instantiateResult.deps || []; - load.execute = instantiateResult.execute; - load.isDeclarative = false; + function addToLoad() { + load.depsList = instantiateResult.deps || []; + load.execute = instantiateResult.execute; + load.isDeclarative = false; + } + + if(!loader.loaderObj.transpileAllFormats || + load.metadata.shouldTranspile === false || + !transpilableFormat(load.metadata.format)) { + return addToLoad(); + } + + return loader.loaderObj.transpile(load).then(addToLoad); + } else throw TypeError('Invalid instantiate return value'); @@ -1378,7 +1395,8 @@ function logloads(loads) { } catch(e) { // traceur throws an error array - throw e[0]; + var error = e[0] || e.errors[0]; + throw error; } } @@ -1498,7 +1516,12 @@ function logloads(loads) { var npmPluginNameOrPath = getNpmPluginNameOrPath(name); // import the plugin! - promises.push(this["import"](npmPluginNameOrPath, { name: parent }) + promises.push(this["import"](npmPluginNameOrPath, { + name: parent, + metadata: { + shouldTranspile: false + } + }) .then(function(mod) { var exported = mod.__esModule ? mod["default"] : mod; @@ -1579,7 +1602,7 @@ function logloads(loads) { function getBabelPresets(current, loader) { var presets = current || []; var forceES5 = loader.forceES5 !== false; - var defaultPresets = forceES5 + var defaultPresets = forceES5 ? [babelES2015Preset, "react", "stage-0"] : ["react"]; @@ -1719,7 +1742,12 @@ function logloads(loads) { var npmPresetNameOrPath = getNpmPresetNameOrPath(name); // import the preset! - promises.push(this["import"](npmPresetNameOrPath, { name: parent }) + promises.push(this["import"](npmPresetNameOrPath, { + name: parent, + metadata: { + shouldTranspile: false + } + }) .then(function(mod) { var exported = mod.__esModule ? mod["default"] : mod; diff --git a/src/system-extension-meta-deps.js b/src/system-extension-meta-deps.js index d8549384d..93fa870ef 100644 --- a/src/system-extension-meta-deps.js +++ b/src/system-extension-meta-deps.js @@ -19,10 +19,11 @@ addStealExtension(function addMetaDeps(loader) { } loader.transpile = function (load) { + // TODO this needs to change prependDeps(this, load, createImport); var result = superTranspile.apply(this, arguments); return result; - } + }; loader._determineFormat = function (load) { if(load.metadata.format === 'cjs') { diff --git a/steal-with-promises.js b/steal-with-promises.js index cc2eda46d..b3df95c19 100644 --- a/steal-with-promises.js +++ b/steal-with-promises.js @@ -1522,6 +1522,8 @@ function logloads(loads) { load = createLoad(name); loader.loads.push(load); + loader.loaderObj.forwardMetadata(load, refererName); + proceedToLocate(loader, load); return load; @@ -1555,6 +1557,10 @@ function logloads(loads) { ); } + function transpilableFormat(format) { + return format === "cjs" || format === "amd"; + } + var anonCnt = 0; // 15.2.4.5 @@ -1610,9 +1616,20 @@ function logloads(loads) { }); } else if (typeof instantiateResult == 'object') { - load.depsList = instantiateResult.deps || []; - load.execute = instantiateResult.execute; - load.isDeclarative = false; + function addToLoad() { + load.depsList = instantiateResult.deps || []; + load.execute = instantiateResult.execute; + load.isDeclarative = false; + } + + if(!loader.loaderObj.transpileAllFormats || + load.metadata.shouldTranspile === false || + !transpilableFormat(load.metadata.format)) { + return addToLoad(); + } + + return loader.loaderObj.transpile(load).then(addToLoad); + } else throw TypeError('Invalid instantiate return value'); @@ -2648,7 +2665,8 @@ function logloads(loads) { } catch(e) { // traceur throws an error array - throw e[0]; + var error = e[0] || e.errors[0]; + throw error; } } @@ -2768,7 +2786,12 @@ function logloads(loads) { var npmPluginNameOrPath = getNpmPluginNameOrPath(name); // import the plugin! - promises.push(this["import"](npmPluginNameOrPath, { name: parent }) + promises.push(this["import"](npmPluginNameOrPath, { + name: parent, + metadata: { + shouldTranspile: false + } + }) .then(function(mod) { var exported = mod.__esModule ? mod["default"] : mod; @@ -2849,7 +2872,7 @@ function logloads(loads) { function getBabelPresets(current, loader) { var presets = current || []; var forceES5 = loader.forceES5 !== false; - var defaultPresets = forceES5 + var defaultPresets = forceES5 ? [babelES2015Preset, "react", "stage-0"] : ["react"]; @@ -2989,7 +3012,12 @@ function logloads(loads) { var npmPresetNameOrPath = getNpmPresetNameOrPath(name); // import the preset! - promises.push(this["import"](npmPresetNameOrPath, { name: parent }) + promises.push(this["import"](npmPresetNameOrPath, { + name: parent, + metadata: { + shouldTranspile: false + } + }) .then(function(mod) { var exported = mod.__esModule ? mod["default"] : mod; @@ -6821,7 +6849,8 @@ addStealExtension(function addNoMainWarn(loader) { "package.json!npm": true, "npm": true, "@empty": true, - "@dev": true + "@dev": true, + "babel": true }; var loaderImport = loader.import; @@ -6865,10 +6894,11 @@ addStealExtension(function addMetaDeps(loader) { } loader.transpile = function (load) { + // TODO this needs to change prependDeps(this, load, createImport); var result = superTranspile.apply(this, arguments); return result; - } + }; loader._determineFormat = function (load) { if(load.metadata.format === 'cjs') { @@ -7529,6 +7559,31 @@ addStealExtension(function addMJS(loader){ }; }); +// This extension allows you to define metadata that should appear on +// Any subdependencies. For example we can add the { foo: true } bool +// to a module's metadata, and it will be forwarded to any subdependency. +addStealExtension(function forwardMetadata(loader){ + loader._forwardedMetadata = {}; + loader.setForwardedMetadata = function(prop) { + loader._forwardedMetadata[prop] = true; + }; + + loader.forwardMetadata = function(load, parentName) { + if(parentName) { + var parentLoad = this.getModuleLoad(parentName); + + if(parentLoad) { + // TODO use Object.assign instead? + for(var p in this._forwardedMetadata) { + if(p in parentLoad.metadata) { + load.metadata[p] = parentLoad.metadata[p]; + } + } + } + } + }; +}); + addStealExtension(function applyTraceExtension(loader) { loader._traceData = { loads: {}, @@ -7908,6 +7963,7 @@ addStealExtension(function addCacheBust(loader) { System.ext = Object.create(null); System.logLevel = 0; System.forceES5 = true; + System.transpileAllFormats = true; var cssBundlesNameGlob = "bundles/*.css", jsBundlesNameGlob = "bundles/*"; setIfNotPresent(System.paths,cssBundlesNameGlob, "dist/bundles/*css"); @@ -8161,9 +8217,11 @@ addStealExtension(function addCacheBust(loader) { this.paths["@@babel-code-frame"] = dirname+"/ext/babel-code-frame.js"; setIfNotPresent(this.meta,"traceur",{"exports":"traceur"}); setIfNotPresent(this.meta, "@@babel-code-frame", {"format":"global","exports":"BabelCodeFrame"}); + setIfNotPresent(this.meta, "babel", {"shouldTranspile": false}); // steal-clone is contextual so it can override modules using relative paths this.setContextual('steal-clone', 'steal-clone'); + this.setForwardedMetadata("shouldTranspile"); if(isNode) { if(this.configMain === "@config" && last(parts) === "steal") { diff --git a/steal-with-promises.production.js b/steal-with-promises.production.js index 699e59d94..9a48b45b6 100644 --- a/steal-with-promises.production.js +++ b/steal-with-promises.production.js @@ -4,4 +4,4 @@ * Copyright (c) 2019 Bitovi; Licensed MIT */ -!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.Promise=e():"undefined"!=typeof global?global.Promise=e():"undefined"!=typeof self&&(self.Promise=e())}(function(){return function e(t,n,r){function a(i,s){if(!n[i]){if(!t[i]){var l="function"==typeof require&&require;if(!s&&l)return l(i,!0);if(o)return o(i,!0);throw new Error("Cannot find module '"+i+"'")}var u=n[i]={exports:{}};t[i][0].call(u.exports,function(e){var n=t[i][1][e];return a(n||e)},u,u.exports,e,t,n,r)}return n[i].exports}for(var o="function"==typeof require&&require,i=0;i=0&&(p.splice(t,1),d("Handled previous rejection ["+e.id+"] "+a.formatObject(e.value)))}function s(e,t){f.push(e,t),null===h&&(h=r(l,0))}function l(){for(h=null;f.length>0;)f.shift()(f.shift())}var u,c=n,d=n;"undefined"!=typeof console&&(u=console,c=void 0!==u.error?function(e){u.error(e)}:function(e){u.log(e)},d=void 0!==u.info?function(e){u.info(e)}:function(e){u.log(e)}),e.onPotentiallyUnhandledRejection=function(e){s(o,e)},e.onPotentiallyUnhandledRejectionHandled=function(e){s(i,e)},e.onFatalRejection=function(e){s(t,e.value)};var f=[],p=[],h=null;return e}})}(function(n){t.exports=n(e)})},{"../env":5,"../format":6}],5:[function(e,t,n){!function(e){"use strict";e(function(e){var t,n="undefined"!=typeof setTimeout&&setTimeout,r=function(e,t){return setTimeout(e,t)},a=function(e){return clearTimeout(e)},o=function(e){return n(e,0)};if("undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))o=function(e){return process.nextTick(e)};else if(t="function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver)o=function(e){var t,n=document.createTextNode("");new e(function(){var e=t;t=void 0,e()}).observe(n,{characterData:!0});var r=0;return function(e){t=e,n.data=r^=1}}(t);else if(!n){var i=e("vertx");r=function(e,t){return i.setTimer(t,e)},a=i.cancelTimer,o=i.runOnLoop||i.runOnContext}return{setTimer:r,clearTimer:a,asap:o}})}(function(n){t.exports=n(e)})},{}],6:[function(e,t,n){!function(e){"use strict";e(function(){function e(e){var n=String(e);return"[object Object]"===n&&"undefined"!=typeof JSON&&(n=t(e,n)),n}function t(e,t){try{return JSON.stringify(e)}catch(e){return t}}return{formatError:function(t){var n="object"==typeof t&&null!==t&&(t.stack||t.message)?t.stack||t.message:e(t);return t instanceof Error?n:n+" (WARNING: non-Error used)"},formatObject:e,tryStringify:t}})}(function(e){t.exports=e()})},{}],7:[function(e,t,n){!function(e){"use strict";e(function(){return function(e){function t(e,t){this._handler=e===m?t:n(e)}function n(e){function t(e){n.reject(e)}var n=new g;try{e(function(e){n.resolve(e)},t,function(e){n.notify(e)})}catch(e){t(e)}return n}function r(e){return L(e)?e:new t(m,new b(f(e)))}function a(e){return new t(m,new b(new _(e)))}function o(){return Q}function i(e,t){return new t(m,new g(e.receiver,e.join().context))}function s(e,n,r){function a(e,t,n){c[e]=t,0==--u&&n.become(new x(c))}for(var o,i="function"==typeof n?function(t,o,i){i.resolved||l(r,a,t,e(n,o,t),i)}:a,s=new g,u=r.length>>>0,c=new Array(u),d=0;d0?t(n,o.value,a):(a.become(o),u(e,n+1,o))}else t(n,r,a)}function u(e,t,n){for(var r=t;r0||"function"!=typeof t&&a<0)return new this.constructor(m,r);var o=this._beget(),i=o._handler;return r.chain(i,r.receiver,e,t,n),o},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype._beget=function(){return i(this._handler,this.constructor)},t.all=function(e){return s(A,null,e)},t.race=function(e){return"object"!=typeof e||null===e?a(new TypeError("non-iterable passed to race()")):0===e.length?o():1===e.length?r(e[0]):d(e)},t._traverse=function(e,t){return s(D,e,t)},t._visitRemaining=u,m.prototype.when=m.prototype.become=m.prototype.notify=m.prototype.fail=m.prototype._unreport=m.prototype._report=z,m.prototype._state=0,m.prototype.state=function(){return this._state},m.prototype.join=function(){for(var e=this;void 0!==e.handler;)e=e.handler;return e},m.prototype.chain=function(e,t,n,r,a){this.when({resolver:e,receiver:t,fulfilled:n,rejected:r,progress:a})},m.prototype.visit=function(e,t,n,r){this.chain(G,e,t,n,r)},m.prototype.fold=function(e,t,n,r){this.when(new k(e,t,n,r))},F(m,v),v.prototype.become=function(e){e.fail()};var G=new v;F(m,g),g.prototype._state=0,g.prototype.resolve=function(e){this.become(f(e))},g.prototype.reject=function(e){this.resolved||this.become(new _(e))},g.prototype.join=function(){if(!this.resolved)return this;for(var e=this;void 0!==e.handler;)if((e=e.handler)===this)return this.handler=S();return e},g.prototype.run=function(){var e=this.consumers,t=this.handler;this.handler=this.handler.join(),this.consumers=void 0;for(var n=0;n",t.isDeclarative=!0,e.loaderObj.transpile(t).then(function(e){var n=__global.System,r=n.register;n.register=function(e,n,r){var a=r,o=n;"string"!=typeof e&&(a=o,o=e),t.declare=a,t.depsList=o},__eval(e,__global,t),n.register=r});if("object"!=typeof n)throw TypeError("Invalid instantiate return value");t.depsList=n.deps||[],t.execute=n.execute,t.isDeclarative=!1}}).then(function(){if("loading"==t.status&&!o()){t.dependencies=[];for(var r=t.depsList,a=[],i=0,s=r.length;i0)){var n=e.startingLoad;if(!1===e.loader.loaderObj.execute){for(var r=[].concat(e.loads),a=0,o=r.length;a=0;i--){for(var s=r[i],l=0;l");r.address=n&&n.address;var a=u(this._loader,r),i=I.resolve(t),s=this._loader,l=a.done.then(function(){return x(s,r)});return o(s,r,i),l},newModule:function(e){if("object"!=typeof e)throw new TypeError("Expected object");var t,n=new P;if(Object.getOwnPropertyNames&&null!=e)t=Object.getOwnPropertyNames(e);else{t=[];for(var r in e)t.push(r)}for(var a=0;a=6?(delete r.optional,delete r.whitelist,delete r.blacklist,r.presets=u(r.presets,n),r.plugins=l(r.plugins)):(r.modules="system",r.blacklist||(r.blacklist=["react"])),r}function p(e){var t=e.types;return{visitor:{Program:function(e,n){e.unshiftContainer("body",[t.exportNamedDeclaration(null,[t.exportSpecifier(t.identifier("true"),t.identifier("__esModule"))])])}}}}function h(e){return e.metadata.importSpecifiers=Object.create(null),e.metadata.importNames=Object.create(null),e.metadata.exportNames=Object.create(null),{visitor:{ImportDeclaration:function(t,n){var r=t.node,a=r.source.value,o=r.source.loc;e.metadata.importSpecifiers[a]=o;var i=e.metadata.importNames[a];i||(i=e.metadata.importNames[a]=[]),i.push.apply(i,(r.specifiers||[]).map(function(e){return"ImportDefaultSpecifier"===e.type?"default":e.imported&&e.imported.name}))},ExportDeclaration:function(t,n){var r=t.node;if(r.source){var a=r.source.value,o=e.metadata.exportNames[a];"ExportNamedDeclaration"===r.type?(o||(o=e.metadata.exportNames[a]=new Map),r.specifiers.forEach(function(e){o.set(e.exported.name,e.local.name)})):"ExportAllDeclaration"===r.type&&(e.metadata.exportNames[a]=1)}}}}}function m(e,t){var n=this,r=t.Babel||t.babel||t,a=d(r),o=f.call(n,e,r);return Promise.all([b.call(this,r,o),x.call(this,r,o)]).then(function(t){a>=6&&(o.plugins=[h.bind(null,e),p].concat(t[0]),o.presets=t[1]);try{return r.transform(e.source,o).code+"\n//# sourceURL="+e.address+"!eval"}catch(t){if(t instanceof SyntaxError){var i=new SyntaxError(t.message),s=new n.StackTrace(t.message,[n.StackTrace.item("",e.address,t.loc.line,t.loc.column)]);return i.stack=s.toString(),Promise.reject(i)}return Promise.reject(t)}})}var v=__global,g="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process);e.prototype.transpiler="babel",e.prototype.transpile=function(e){var n=this;return n.transpilerHasRun||(v.traceur&&!n.has("traceur")&&n.set("traceur",t(n,"traceur")),v.Babel&&!n.has("babel")&&n.set("babel",t(n,"Babel")),n.transpilerHasRun=!0),n.import(n.transpiler).then(function(t){var a=t;return a.__useDefault&&(a=a.default),(a.Compiler?r:m).call(n,e,a)}).then(function(t){return'var __moduleAddress = "'+e.address+'";'+t})},e.prototype.instantiate=function(e){var r=this;return Promise.resolve(r.normalize(r.transpiler)).then(function(a){if(e.name===a)return{deps:[],execute:function(){var a=v.System,o=v.Reflect.Loader;return __eval("(function(require,exports,module){"+e.source+"})();",v,e),v.System=a,v.Reflect.Loader=o,t(r,n(e.name))}}})};var b=function(){function e(e,r){var a=[];return(r||[]).forEach(function(r){var o=i(r);if(!s(r)||t(e,o))a.push(r);else if(!t(e,o)){var l=this.configMain||"package.json!npm",u=n(o);a.push(this.import(u,{name:l}).then(function(e){var t=e.__esModule?e.default:e;return"string"==typeof r?t:[t,r[1]]}))}},this),Promise.all(a)}function t(e,t){var n=/^(?:babel-plugin-)/;return!!(e.availablePlugins||{})[n.test(t)?t.replace("babel-plugin-",""):t]}function n(e){var t=/^(?:babel-plugin-)/;return/\//.test(e)||t.test(e)?e:"babel-plugin-"+e}return function(t,n){var r=o.call(this),a=n.env||{},i=[e.call(this,t,n.plugins)];for(var s in a)if(r===s){var l=a[s].plugins||[];i.push(e.call(this,t,l))}return Promise.all(i).then(function(e){var t=[];return e.forEach(function(e){t=t.concat(e)}),t})}}(),y="es2015-no-commonjs",x=function(){function e(e,r){var a=[];return(r||[]).forEach(function(r){var o=i(r);if(!s(r)||t(e,o))a.push(r);else if(!t(e,o)){var l=this.configMain||"package.json!npm",u=n(o);a.push(this.import(u,{name:l}).then(function(e){var t=e.__esModule?e.default:e;return"string"==typeof r?t:[t,r[1]]}))}},this),Promise.all(a)}function t(e,t){var n=/^(?:babel-preset-)/;return!!(e.availablePresets||{})[n.test(t)?t.replace("babel-preset-",""):t]}function n(e){var t=/^(?:babel-preset-)/;return/\//.test(e)||t.test(e)?e:"babel-preset-"+e}return function(t,n){var r=o.call(this),a=n.env||{},i=[e.call(this,t,n.presets)];for(var s in a)if(r===s){var l=a[s].presets||[];i.push(e.call(this,t,l))}return Promise.all(i).then(function(e){var t=[];return e.forEach(function(e){t=t.concat(e)}),t})}}();e.prototype._getImportSpecifierPositionsPlugin=h}(__global.LoaderPolyfill),function(){function e(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function t(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}function n(n,r){var a=r,i=n;return s.test(r)?"http:"+r:(o&&(a=a.replace(/\\/g,"/")),a=e(a||""),i=e(i||""),a&&i?(a.protocol||i.protocol)+(a.protocol||a.authority?a.authority:i.authority)+t(a.protocol||a.authority||"/"===a.pathname.charAt(0)?a.pathname:a.pathname?(i.authority&&!i.pathname?"/":"")+i.pathname.slice(0,i.pathname.lastIndexOf("/")+1)+a.pathname:i.pathname)+(a.protocol||a.authority||a.pathname?a.search:a.search||i.search)+a.hash:null)}function r(e,t,n){if(void 0===n.getDependants)return i.resolve();var r=n.getDependants(t.name);if(Array.isArray(r)&&r.length){var a=n.StackTrace,o=n.isEnv("production");return i.resolve().then(function(){return o?i.resolve():n.import("@@babel-code-frame")}).then(function(i){var s=n.getModuleLoad(r[0]),l=n.getImportSpecifier(t.name,s)||{line:1,column:0},u="The module ["+n.prettyName(t)+"] couldn't be fetched.\nClicking the link in the stack trace below takes you to the import.\nSee https://stealjs.com/docs/StealJS.error-messages.html#404-not-found for more information.\n",c=e.message+"\n"+u;o||(c+="\n"+i(s.metadata.originalSource||s.source,l.line,l.column)+"\n"),e.message=c;var d=new a(c,[a.item(null,s.address,l.line,l.column)]);e.stack=d.toString()})}return i.resolve()}var a,o="undefined"!=typeof process&&!!process.platform.match(/^win/),i=__global.Promise||require("when/es6-shim/Promise"),s=/^\/\//;if("undefined"!=typeof XMLHttpRequest)a=function(e,t,n){function r(){t(o.responseText)}function a(){var t=o.status,r=t+" "+o.statusText+": "+e+"\n"||"XHR error",a=new Error(r);a.url=e,a.statusCode=t,n(a)}var o=new XMLHttpRequest,i=!0,s=!1;if(!("withCredentials"in o)){var l=/^(\w+:)?\/\/([^\/]+)/.exec(e);l&&(i=l[2]===window.location.host,l[1]&&(i&=l[1]===window.location.protocol))}i||"undefined"==typeof XDomainRequest||((o=new XDomainRequest).onload=r,o.onerror=a,o.ontimeout=a,o.onprogress=function(){},o.timeout=0,s=!0),o.onreadystatechange=function(){4===o.readyState&&(200===o.status||0==o.status&&o.responseText?r():a())},o.open("GET",e,!0),s&&setTimeout(function(){o.send()},0),o.send(null)};else if("undefined"!=typeof require){var l,u,c,d=/ENOENT/;a=function(e,t,n){if("file:"===e.substr(0,5)){l=l||require("fs");var r=e.substr(5);return o&&(r=r.replace(/\//g,"\\")),l.readFile(r,function(r,a){if(r)return d.test(r.message)&&(r.statusCode=404,r.url=e),n(r);t(a+"")})}if("http"===e.substr(0,4)){return("https:"===e.substr(0,6)?c=c||require("https"):u=u||require("http")).get(e,function(e){if(200!==e.statusCode)n(new Error("Request failed. Status: "+e.statusCode));else{var r="";e.setEncoding("utf8"),e.on("data",function(e){r+=e}),e.on("end",function(){t(r)})}})}}}else{if("function"!=typeof fetch)throw new TypeError("No environment fetch API available.");a=function(e,t,n){fetch(e).then(function(e){return e.text()}).then(function(e){t(e)}).then(null,function(e){n(e)})}}var f=new(function(e){function t(t){if(e.call(this,t||{}),"undefined"!=typeof location&&location.href){var n=__global.location.href.split("#")[0].split("?")[0];this.baseURL=n.substring(0,n.lastIndexOf("/")+1)}else{if("undefined"==typeof process||!process.cwd)throw new TypeError("No environment baseURL");this.baseURL="file:"+process.cwd()+"/",o&&(this.baseURL=this.baseURL.replace(/\\/g,"/"))}this.paths={"*":"*.js"}}return t.__proto__=null!==e?e:Function.prototype,t.prototype=$__Object$create(null!==e?e.prototype:null),$__Object$defineProperty(t.prototype,"constructor",{value:t}),$__Object$defineProperty(t.prototype,"global",{get:function(){return isBrowser?window:isWorker?self:__global},enumerable:!1}),$__Object$defineProperty(t.prototype,"strict",{get:function(){return!0},enumerable:!1}),$__Object$defineProperty(t.prototype,"normalize",{value:function(e,t,n){if("string"!=typeof e)throw new TypeError("Module name must be a string");var r=e.split("/");if(0==r.length)throw new TypeError("No module name provided");var a=0,o=!1,i=0;if("."==r[0]){if(++a==r.length)throw new TypeError('Illegal module name "'+e+'"');o=!0}else{for(;".."==r[a];)if(++a==r.length)throw new TypeError('Illegal module name "'+e+'"');a&&(o=!0),i=a}if(!o)return e;var s=[],l=(t||"").split("/");l.length;return s=s.concat(l.splice(0,l.length-1-i)),(s=s.concat(r.splice(a,r.length-a))).join("/")},enumerable:!1,writable:!0}),$__Object$defineProperty(t.prototype,"locate",{value:function(e){var t,r=e.name,a="";for(var o in this.paths){var i=o.split("*");if(i.length>2)throw new TypeError("Only one wildcard in a path is permitted");if(1==i.length){if(r==o&&o.length>a.length){a=o;break}}else r.substr(0,i[0].length)==i[0]&&r.substr(r.length-i[1].length)==i[1]&&(a=o,t=r.substr(i[0].length,r.length-i[1].length-i[0].length))}var s=this.paths[a];return t&&(s=s.replace("*",t)),isBrowser&&(s=s.replace(/#/g,"%23")),n(this.baseURL,s)},enumerable:!1,writable:!0}),$__Object$defineProperty(t.prototype,"fetch",{value:function(e){var t=this;return new i(function(o,i){a(n(t.baseURL,e.address),function(e){o(e)},function(n){var a=i.bind(null,n);r(n,e,t).then(a,a)})})},enumerable:!1,writable:!0}),t}(__global.LoaderPolyfill));"object"==typeof exports&&(module.exports=f),__global.System=f}()}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:global),function(e){e.upgradeSystemLoader=function(){function t(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function r(e,n){var r=e,a=n;return x&&(a=a.replace(/\\/g,"/")),a=t(a||""),r=t(r||""),a&&r?(a.protocol||r.protocol)+(a.protocol||a.authority?a.authority:r.authority)+function(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}(a.protocol||a.authority||"/"===a.pathname.charAt(0)?a.pathname:a.pathname?(r.authority&&!r.pathname?"/":"")+r.pathname.slice(0,r.pathname.lastIndexOf("/")+1)+a.pathname:r.pathname)+(a.protocol||a.authority||a.pathname?a.search:a.search||r.search)+a.hash:null}function a(t){var n={};if(("object"==typeof t||"function"==typeof t)&&t!==e)if(_)for(var r in t)"default"!==r&&o(n,t,r);else i(n,t);return n.default=t,w(n,"__useDefault",{value:!0}),n}function o(e,t,n){try{var r;(r=Object.getOwnPropertyDescriptor(t,n))&&w(e,n,r)}catch(r){return e[n]=t[n],!1}}function i(e,t,n){var r=t&&t.hasOwnProperty;for(var a in t)r&&!t.hasOwnProperty(a)||n&&a in e||(e[a]=t[a]);return e}function s(e){function t(e,t){t._extensions=[];for(var n=0,r=e.length;n=0;o--){for(var i=r[o],s=0;st.index)return!0;return!1}a.lastIndex=o.lastIndex=i.lastIndex=0;var n,r=[],s={},l=[],u=[];if(e.length/e.split("\n").length<200){for(;n=i.exec(e);)l.push([n.index,n.index+n[0].length]);for(;n=o.exec(e);)t(l,n)||u.push([n.index,n.index+n[0].length])}for(;n=a.exec(e);)if(!t(l,n)&&!t(u,n)){var c=n[1].substr(1,n[1].length-2);if(c.match(/"|'/))continue;r.push(c),s[c]=n.index}return{deps:r,info:s}}function n(e,t){var n=this;return function(r){var a=t[r];return n._getLineAndColumnFromPosition(e.source,a)}}e._extensions.push(f),e._determineFormat=Function.prototype;var r=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF.])(exports\s*(\[['"]|\.)|module(\.exports|\['exports'\]|\["exports"\])\s*(\[['"]|[=,\.])|Object.defineProperty\(\s*module\s*,\s*(?:'|")exports(?:'|"))/,a=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF."'])require\s*\(\s*("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')\s*\)/g,o=/(^|[^\\])(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,i=/("[^"\\\n\r]*(\\.[^"\\\n\r]*)*"|'[^'\\\n\r]*(\\.[^'\\\n\r]*)*')/g,s=e.instantiate;e.instantiate=function(o){if(o.metadata.format||(r.lastIndex=0,a.lastIndex=0,(a.exec(o.source)||r.exec(o.source))&&(o.metadata.format="cjs",this._determineFormat(o))),"cjs"==o.metadata.format){var i=t(o.source);o.metadata.deps=o.metadata.deps?o.metadata.deps.concat(i.deps):i.deps,o.metadata.getImportPosition=n.call(this,o,i.info),o.metadata.executingRequire=!0,o.metadata.execute=function(t,n,r){var a=(o.address||"").split("/");a.pop(),a=a.join("/"),b._nodeRequire&&(a=a.substr(5));e.global._g={global:e.global,exports:n,module:r,require:t,__filename:b._nodeRequire?o.address.substr(5):o.address,__dirname:a};var i=e.global.define;e.global.define=void 0;var s={name:o.name,source:"(function() {\n(function(global, exports, module, require, __filename, __dirname){\n"+o.source+"\n}).call(_g.exports, _g.global, _g.exports, _g.module, _g.require, _g.__filename, _g.__dirname);})();",address:o.address};try{e.__exec(s)}catch(t){throw e.StackTrace&&(e.StackTrace.parse(t)||(t.stack=new e.StackTrace(t.message,[e.StackTrace.item("",o.address,1,0)]).toString())),t}e.global.define=i,e.global._g=void 0}}return s.call(this,o)}}function p(e){function t(e,t){var n=[],r=(e.match(f)[1].split(",")[t]||"require").replace(h,""),a=m[r]||(m[r]=new RegExp("/\\*|//|\"|'|`|(?:^|\\breturn\\b|[([=,;:?><&|^*%~+-])\\s*(?=/)|\\b"+r+"(?=\\s*\\()","g"));a.lastIndex=0,v[r]=v.require;for(var o,i,s,l;o=a.exec(e);)if(i=o[0],(s=v[i])||(s=v[i="/regexp/"]),s.lastIndex=a.lastIndex,(l=s.exec(e))&&l.index===a.lastIndex){a.lastIndex=s.lastIndex;var u=o.index-1;u>-1&&"."===e.charAt(u)||s!==v.require||l[2]&&n.push(l[2])}return n}function n(e,t,r,a){var o=this;if("object"==typeof e&&!(e instanceof Array))return n.apply(null,Array.prototype.splice.call(arguments,1,arguments.length-1));if(!(e instanceof Array)){if("string"==typeof e){var i=o.get(e);return i.__useDefault?i.default:i}throw new TypeError("Invalid require")}Promise.all(e.map(function(e){return o.import(e,a)})).then(function(e){t&&t.apply(null,e)},r)}function r(e,t,r){return function(a,o,i){return"string"==typeof a?t(a):n.call(r,a,o,i,{name:e})}}function a(e){function n(n,a,o){var i=n,s=a,l=o,u=!1;"string"!=typeof i&&(l=s,s=i,i=null),s instanceof Array||(l=s,s=["require","exports","module"]),"function"!=typeof l&&(l=function(e){return function(){return e}}(l)),void 0===s[s.length-1]&&s.pop();var c,f,p;if(-1!=(c=y.call(s,"require"))){s.splice(c,1);var h=l.toString();s=s.concat(t(h,c))}-1!=(f=y.call(s,"exports"))&&(s.splice(f,1),h||(h=l.toString(),u=g.test(h))),-1!=(p=y.call(s,"module"))&&s.splice(p,1);var m={deps:s,execute:function(t,n,a){for(var o=[],i=0;i=0;a--)e.source=e.source.substr(0,r[a].start)+r[a].postLocate(t[a])+e.source.substr(r[a].end,e.source.length);return o.call(n,e)})}}),v(function(e){e._contextualModules={},e.setContextual=function(e,t){this._contextualModules[e]=t};var t=e.normalize;e.normalize=function(e,n){var r=this,a=r.pluginLoader||r;if(n){var o=this._contextualModules[e];if(o){var i=e+"/"+n;return r.has(i)?Promise.resolve(i):("string"==typeof o&&(o=a.import(o)),Promise.resolve(o).then(function(e){var t=e;return t.default&&(t=t.default),Promise.resolve(t.call(r,n))}).then(function(e){return r.set(i,r.newModule(e)),i}))}}return t.apply(this,arguments)}}),v(function(e){function t(){document.removeEventListener("DOMContentLoaded",t,!1),window.removeEventListener("load",t,!1),n()}function n(){for(var t=document.getElementsByTagName("script"),n=0;n0)return n;var i=o(t.map(r));if(i.length>0)return i;throw new Error("Unknown stack format: "+e)}function r(e){var t=e.match(l);if(!t)return null;var n=t[1]||"";return{method:n,fnName:n,url:t[2]||"",line:parseInt(t[3])||0,column:parseInt(t[4])||0}}function a(e){var t=e.match(u)||e.match(c);if(!t)return null;var n=t[3].match(d);if(!n)return null;var r=t[2]||"";return t[1]&&(r="eval at "+r),{method:r,fnName:r,url:n[1]||"",line:parseInt(n[2])||0,column:parseInt(n[3])||0}}function o(e){var t=[];return e.forEach(function(e){e&&t.push(e)}),t}function i(e){var t=/at position ([0-9]+)/.exec(e);if(t&&t.length>1)return Number(t[1])}function s(e,t){for(var n=0;nt.index)return!0;return!1}function n(e){for(;a=e.exec(r);)if(!t(i,a)){var n=a[1];o.push(n)}}var r=e.replace(c,"");l.lastIndex=c.lastIndex=u.lastIndex=d.lastIndex=0;var a,o=[],i=[];if(e.length/e.split("\n").length<200)for(;a=d.exec(r);)i.push([a.index,a.index+a[0].length]);return n(l),n(u),o}e._traceData={loads:{},parentMap:{}},e.getDependencies=function(e){var t=this.getModuleLoad(e);return t?t.metadata.dependencies:void 0},e.getDependants=function(e){var n=[];return t(this._traceData.parentMap[e]||{},function(e){n.push(e)}),n},e.getModuleLoad=function(e){return this._traceData.loads[e]},e.getBundles=function(e,n){var r=n||{};r[e]=!0;var a=this,o=a._traceData.parentMap[e];if(!o)return[e];var i=[];return t(o,function(e,t){r[e]||(i=i.concat(a.getBundles(e,r)))}),i},e.getImportSpecifier=function(e,t){for(var n,r=0;r-1||o.indexOf("steal-with-promises.production")>-1&&!n.env)&&this.config({env:s+"-production"}),(this.isEnv("production")||this.loadBundles)&&C.call(this),z.stealPath.set.call(this,i,n)}},devBundle:{order:16,set:function(e,t){var n=!0===e?"dev-bundle":e;n&&(this.devBundle=n)}},depsBundle:{order:17,set:function(e,t){var n=!0===e?"dev-bundle":e;n&&(this.depsBundle=n)}}};r(z,function(e,t){e.order?F.splice(e.order,0,t):F.push(t)}),function(e,t,n){var a=e.config;e.config=function(o){var s=i({},o);r(t,function(t){var r=n[t];if(r.set&&s[t]){var a=r.set.call(e,s[t],o);void 0!==a&&(e[t]=a),delete s[t]}}),a.call(this,s)}}(e,F,z),P.config=function(e){if("string"==typeof e)return this.loader[e];this.loader.config(e)},v(function(e){e.getEnv=function(){return(this.env||"").split("-")[1]||this.env},e.getPlatform=function(){var e=(this.env||"").split("-");return 2===e.length?e[0]:void 0},e.isEnv=function(e){return this.getEnv()===e},e.isPlatform=function(e){return this.getPlatform()===e}});var U=function(e){var t={},r=/Url$/,a=e.split("?"),o=a.shift(),i=a.join("?").split("&"),s=o.split("/");s.pop(),s.join("/");if(i.length&&i[0].length)for(var l,u=0;u1){var d=n(c[0]);t[d=d.replace(r,"URL")]=c.slice(1).join("=")}}return t},B=function(e){var t={},a=/Url$/;t.stealURL=e.src,r(e.attributes,function(e){var r=e.nodeName||e.name,o=n(0===r.indexOf("data-")?r.replace("data-",""):r);o=o.replace(a,"URL"),t[o]=""===e.value||e.value});var o=e.innerHTML;/\S/.test(o)&&(t.mainSource=o);var s=i(U(e.src),t);return s.main&&("boolean"==typeof s.main&&delete s.main,s.loadMainOnStartup=!0),s},W=function(){var e=this;return new Promise(function(t,n){if(!h)return y?(e.script=_||x(),void t(B(e.script))):void t({loadMainOnStartup:!0,stealPath:__dirname});t(i({loadMainOnStartup:!0,stealURL:location.href},U(location.href)))})};return P.startup=function(e){var t,n,r=this,o=this.loader;return g=new Promise(function(e,r){t=e,n=r}),O=W.call(this).then(function(s){function l(e){if(404===e.statusCode&&r.script){var t="This page has "+((o.devBundle?"dev-":"deps-")+"bundle")+" enabled but "+e.url+" could not be retrieved.\nDid you forget to generate the bundle first?\nSee https://stealjs.com/docs/StealJS.development-bundles.html for more information.",n=new Error(t);return n.stack=null,Promise.reject(n)}return Promise.reject(e)}var u;return u="object"==typeof e?i(e,s):s,o.config(u),$.call(o),o.loadBundles?(o.main||!o.isEnv("production")||o.stealBundled||w("Attribute 'main' is required in production environment. Please add it to the script tag."),o.import(o.configMain).then(t,n),g.then(function(e){return $.call(o),o._configLoaded=!0,o.main&&u.loadMainOnStartup?o.import(o.main):e})):(o.import(o.devBundle).then(function(){return o.import(o.configMain)},l).then(function(){return o.import(o.depsBundle).then(null,l)}).then(t,n),(S=g.then(function(){return $.call(o),q.call(o),o._configLoaded=!0,u&&o.config(u),o.import("@dev")})).then(function(){if(!o.main||o.localLoader)return g;if(u.loadMainOnStartup){var e=o.main;return"string"==typeof e&&(e=[e]),Promise.all(a(e,function(e){return o.import(e)}))}o._warnNoMain(r._mainWarnMs||2e3)}))}).then(function(e){return o.mainSource?o.module(o.mainSource):(o.loadScriptModules(),e)})},P.done=function(){return O},P.import=function(){var e=arguments,t=this.System;return g||(t.main||(t.main="@empty"),P.startup()),g.then(function(){var n=[];return r(e,function(e){n.push(t.import(e))}),n.length>1?Promise.all(n):n[0]})},P.setContextual=f.call(e.setContextual,e),P.isEnv=f.call(e.isEnv,e),P.isPlatform=f.call(e.isPlatform,e),P};if(!b||v||g){var M=e.steal;e.steal=P(System),e.steal.startup(M&&"object"==typeof M&&M).then(null,function(e){if("undefined"!=typeof console){var t=console;"function"==typeof e.logError?e.logError(t):t[t.error?"error":"log"](e)}}),e.steal.clone=O}else e.steal=P(System),e.steal.System=System,e.steal.dev=require("./ext/dev.js"),steal.clone=O,module.exports=e.steal}("undefined"==typeof window?"undefined"==typeof global?this:global:window); \ No newline at end of file +!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.Promise=e():"undefined"!=typeof global?global.Promise=e():"undefined"!=typeof self&&(self.Promise=e())}(function(){return function e(t,n,r){function a(i,s){if(!n[i]){if(!t[i]){var l="function"==typeof require&&require;if(!s&&l)return l(i,!0);if(o)return o(i,!0);throw new Error("Cannot find module '"+i+"'")}var u=n[i]={exports:{}};t[i][0].call(u.exports,function(e){var n=t[i][1][e];return a(n||e)},u,u.exports,e,t,n,r)}return n[i].exports}for(var o="function"==typeof require&&require,i=0;i=0&&(p.splice(t,1),d("Handled previous rejection ["+e.id+"] "+a.formatObject(e.value)))}function s(e,t){f.push(e,t),null===h&&(h=r(l,0))}function l(){for(h=null;f.length>0;)f.shift()(f.shift())}var u,c=n,d=n;"undefined"!=typeof console&&(u=console,c=void 0!==u.error?function(e){u.error(e)}:function(e){u.log(e)},d=void 0!==u.info?function(e){u.info(e)}:function(e){u.log(e)}),e.onPotentiallyUnhandledRejection=function(e){s(o,e)},e.onPotentiallyUnhandledRejectionHandled=function(e){s(i,e)},e.onFatalRejection=function(e){s(t,e.value)};var f=[],p=[],h=null;return e}})}(function(n){t.exports=n(e)})},{"../env":5,"../format":6}],5:[function(e,t,n){!function(e){"use strict";e(function(e){var t,n="undefined"!=typeof setTimeout&&setTimeout,r=function(e,t){return setTimeout(e,t)},a=function(e){return clearTimeout(e)},o=function(e){return n(e,0)};if("undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))o=function(e){return process.nextTick(e)};else if(t="function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver)o=function(e){var t,n=document.createTextNode("");new e(function(){var e=t;t=void 0,e()}).observe(n,{characterData:!0});var r=0;return function(e){t=e,n.data=r^=1}}(t);else if(!n){var i=e("vertx");r=function(e,t){return i.setTimer(t,e)},a=i.cancelTimer,o=i.runOnLoop||i.runOnContext}return{setTimer:r,clearTimer:a,asap:o}})}(function(n){t.exports=n(e)})},{}],6:[function(e,t,n){!function(e){"use strict";e(function(){function e(e){var n=String(e);return"[object Object]"===n&&"undefined"!=typeof JSON&&(n=t(e,n)),n}function t(e,t){try{return JSON.stringify(e)}catch(e){return t}}return{formatError:function(t){var n="object"==typeof t&&null!==t&&(t.stack||t.message)?t.stack||t.message:e(t);return t instanceof Error?n:n+" (WARNING: non-Error used)"},formatObject:e,tryStringify:t}})}(function(e){t.exports=e()})},{}],7:[function(e,t,n){!function(e){"use strict";e(function(){return function(e){function t(e,t){this._handler=e===m?t:n(e)}function n(e){function t(e){n.reject(e)}var n=new g;try{e(function(e){n.resolve(e)},t,function(e){n.notify(e)})}catch(e){t(e)}return n}function r(e){return L(e)?e:new t(m,new b(f(e)))}function a(e){return new t(m,new b(new _(e)))}function o(){return Q}function i(e,t){return new t(m,new g(e.receiver,e.join().context))}function s(e,n,r){function a(e,t,n){c[e]=t,0==--u&&n.become(new x(c))}for(var o,i="function"==typeof n?function(t,o,i){i.resolved||l(r,a,t,e(n,o,t),i)}:a,s=new g,u=r.length>>>0,c=new Array(u),d=0;d0?t(n,o.value,a):(a.become(o),u(e,n+1,o))}else t(n,r,a)}function u(e,t,n){for(var r=t;r0||"function"!=typeof t&&a<0)return new this.constructor(m,r);var o=this._beget(),i=o._handler;return r.chain(i,r.receiver,e,t,n),o},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype._beget=function(){return i(this._handler,this.constructor)},t.all=function(e){return s(A,null,e)},t.race=function(e){return"object"!=typeof e||null===e?a(new TypeError("non-iterable passed to race()")):0===e.length?o():1===e.length?r(e[0]):d(e)},t._traverse=function(e,t){return s(D,e,t)},t._visitRemaining=u,m.prototype.when=m.prototype.become=m.prototype.notify=m.prototype.fail=m.prototype._unreport=m.prototype._report=z,m.prototype._state=0,m.prototype.state=function(){return this._state},m.prototype.join=function(){for(var e=this;void 0!==e.handler;)e=e.handler;return e},m.prototype.chain=function(e,t,n,r,a){this.when({resolver:e,receiver:t,fulfilled:n,rejected:r,progress:a})},m.prototype.visit=function(e,t,n,r){this.chain(G,e,t,n,r)},m.prototype.fold=function(e,t,n,r){this.when(new k(e,t,n,r))},q(m,v),v.prototype.become=function(e){e.fail()};var G=new v;q(m,g),g.prototype._state=0,g.prototype.resolve=function(e){this.become(f(e))},g.prototype.reject=function(e){this.resolved||this.become(new _(e))},g.prototype.join=function(){if(!this.resolved)return this;for(var e=this;void 0!==e.handler;)if((e=e.handler)===this)return this.handler=S();return e},g.prototype.run=function(){var e=this.consumers,t=this.handler;this.handler=this.handler.join(),this.consumers=void 0;for(var n=0;n",t.isDeclarative=!0,e.loaderObj.transpile(t).then(function(e){var n=__global.System,r=n.register;n.register=function(e,n,r){var a=r,o=n;"string"!=typeof e&&(a=o,o=e),t.declare=a,t.depsList=o},__eval(e,__global,t),n.register=r});if("object"==typeof n)return e.loaderObj.transpileAllFormats&&!1!==t.metadata.shouldTranspile&&o(t.metadata.format)?e.loaderObj.transpile(t).then(r):r();throw TypeError("Invalid instantiate return value")}}).then(function(){if("loading"==t.status&&!i()){t.dependencies=[];for(var r=t.depsList,a=[],o=0,s=r.length;o0)){var n=e.startingLoad;if(!1===e.loader.loaderObj.execute){for(var r=[].concat(e.loads),a=0,o=r.length;a=0;i--){for(var s=r[i],l=0;l");r.address=n&&n.address;var a=c(this._loader,r),o=T.resolve(t),s=this._loader,l=a.done.then(function(){return _(s,r)});return i(s,r,o),l},newModule:function(e){if("object"!=typeof e)throw new TypeError("Expected object");var t,n=new M;if(Object.getOwnPropertyNames&&null!=e)t=Object.getOwnPropertyNames(e);else{t=[];for(var r in e)t.push(r)}for(var a=0;a=6?(delete r.optional,delete r.whitelist,delete r.blacklist,r.presets=u(r.presets,n),r.plugins=l(r.plugins)):(r.modules="system",r.blacklist||(r.blacklist=["react"])),r}function p(e){var t=e.types;return{visitor:{Program:function(e,n){e.unshiftContainer("body",[t.exportNamedDeclaration(null,[t.exportSpecifier(t.identifier("true"),t.identifier("__esModule"))])])}}}}function h(e){return e.metadata.importSpecifiers=Object.create(null),e.metadata.importNames=Object.create(null),e.metadata.exportNames=Object.create(null),{visitor:{ImportDeclaration:function(t,n){var r=t.node,a=r.source.value,o=r.source.loc;e.metadata.importSpecifiers[a]=o;var i=e.metadata.importNames[a];i||(i=e.metadata.importNames[a]=[]),i.push.apply(i,(r.specifiers||[]).map(function(e){return"ImportDefaultSpecifier"===e.type?"default":e.imported&&e.imported.name}))},ExportDeclaration:function(t,n){var r=t.node;if(r.source){var a=r.source.value,o=e.metadata.exportNames[a];"ExportNamedDeclaration"===r.type?(o||(o=e.metadata.exportNames[a]=new Map),r.specifiers.forEach(function(e){o.set(e.exported.name,e.local.name)})):"ExportAllDeclaration"===r.type&&(e.metadata.exportNames[a]=1)}}}}}function m(e,t){var n=this,r=t.Babel||t.babel||t,a=d(r),o=f.call(n,e,r);return Promise.all([b.call(this,r,o),x.call(this,r,o)]).then(function(t){a>=6&&(o.plugins=[h.bind(null,e),p].concat(t[0]),o.presets=t[1]);try{return r.transform(e.source,o).code+"\n//# sourceURL="+e.address+"!eval"}catch(t){if(t instanceof SyntaxError){var i=new SyntaxError(t.message),s=new n.StackTrace(t.message,[n.StackTrace.item("",e.address,t.loc.line,t.loc.column)]);return i.stack=s.toString(),Promise.reject(i)}return Promise.reject(t)}})}var v=__global,g="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process);e.prototype.transpiler="babel",e.prototype.transpile=function(e){var n=this;return n.transpilerHasRun||(v.traceur&&!n.has("traceur")&&n.set("traceur",t(n,"traceur")),v.Babel&&!n.has("babel")&&n.set("babel",t(n,"Babel")),n.transpilerHasRun=!0),n.import(n.transpiler).then(function(t){var a=t;return a.__useDefault&&(a=a.default),(a.Compiler?r:m).call(n,e,a)}).then(function(t){return'var __moduleAddress = "'+e.address+'";'+t})},e.prototype.instantiate=function(e){var r=this;return Promise.resolve(r.normalize(r.transpiler)).then(function(a){if(e.name===a)return{deps:[],execute:function(){var a=v.System,o=v.Reflect.Loader;return __eval("(function(require,exports,module){"+e.source+"})();",v,e),v.System=a,v.Reflect.Loader=o,t(r,n(e.name))}}})};var b=function(){function e(e,r){var a=[];return(r||[]).forEach(function(r){var o=i(r);if(!s(r)||t(e,o))a.push(r);else if(!t(e,o)){var l=this.configMain||"package.json!npm",u=n(o);a.push(this.import(u,{name:l,metadata:{shouldTranspile:!1}}).then(function(e){var t=e.__esModule?e.default:e;return"string"==typeof r?t:[t,r[1]]}))}},this),Promise.all(a)}function t(e,t){var n=/^(?:babel-plugin-)/;return!!(e.availablePlugins||{})[n.test(t)?t.replace("babel-plugin-",""):t]}function n(e){var t=/^(?:babel-plugin-)/;return/\//.test(e)||t.test(e)?e:"babel-plugin-"+e}return function(t,n){var r=o.call(this),a=n.env||{},i=[e.call(this,t,n.plugins)];for(var s in a)if(r===s){var l=a[s].plugins||[];i.push(e.call(this,t,l))}return Promise.all(i).then(function(e){var t=[];return e.forEach(function(e){t=t.concat(e)}),t})}}(),y="es2015-no-commonjs",x=function(){function e(e,r){var a=[];return(r||[]).forEach(function(r){var o=i(r);if(!s(r)||t(e,o))a.push(r);else if(!t(e,o)){var l=this.configMain||"package.json!npm",u=n(o);a.push(this.import(u,{name:l,metadata:{shouldTranspile:!1}}).then(function(e){var t=e.__esModule?e.default:e;return"string"==typeof r?t:[t,r[1]]}))}},this),Promise.all(a)}function t(e,t){var n=/^(?:babel-preset-)/;return!!(e.availablePresets||{})[n.test(t)?t.replace("babel-preset-",""):t]}function n(e){var t=/^(?:babel-preset-)/;return/\//.test(e)||t.test(e)?e:"babel-preset-"+e}return function(t,n){var r=o.call(this),a=n.env||{},i=[e.call(this,t,n.presets)];for(var s in a)if(r===s){var l=a[s].presets||[];i.push(e.call(this,t,l))}return Promise.all(i).then(function(e){var t=[];return e.forEach(function(e){t=t.concat(e)}),t})}}();e.prototype._getImportSpecifierPositionsPlugin=h}(__global.LoaderPolyfill),function(){function e(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function t(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}function n(n,r){var a=r,i=n;return s.test(r)?"http:"+r:(o&&(a=a.replace(/\\/g,"/")),a=e(a||""),i=e(i||""),a&&i?(a.protocol||i.protocol)+(a.protocol||a.authority?a.authority:i.authority)+t(a.protocol||a.authority||"/"===a.pathname.charAt(0)?a.pathname:a.pathname?(i.authority&&!i.pathname?"/":"")+i.pathname.slice(0,i.pathname.lastIndexOf("/")+1)+a.pathname:i.pathname)+(a.protocol||a.authority||a.pathname?a.search:a.search||i.search)+a.hash:null)}function r(e,t,n){if(void 0===n.getDependants)return i.resolve();var r=n.getDependants(t.name);if(Array.isArray(r)&&r.length){var a=n.StackTrace,o=n.isEnv("production");return i.resolve().then(function(){return o?i.resolve():n.import("@@babel-code-frame")}).then(function(i){var s=n.getModuleLoad(r[0]),l=n.getImportSpecifier(t.name,s)||{line:1,column:0},u="The module ["+n.prettyName(t)+"] couldn't be fetched.\nClicking the link in the stack trace below takes you to the import.\nSee https://stealjs.com/docs/StealJS.error-messages.html#404-not-found for more information.\n",c=e.message+"\n"+u;o||(c+="\n"+i(s.metadata.originalSource||s.source,l.line,l.column)+"\n"),e.message=c;var d=new a(c,[a.item(null,s.address,l.line,l.column)]);e.stack=d.toString()})}return i.resolve()}var a,o="undefined"!=typeof process&&!!process.platform.match(/^win/),i=__global.Promise||require("when/es6-shim/Promise"),s=/^\/\//;if("undefined"!=typeof XMLHttpRequest)a=function(e,t,n){function r(){t(o.responseText)}function a(){var t=o.status,r=t+" "+o.statusText+": "+e+"\n"||"XHR error",a=new Error(r);a.url=e,a.statusCode=t,n(a)}var o=new XMLHttpRequest,i=!0,s=!1;if(!("withCredentials"in o)){var l=/^(\w+:)?\/\/([^\/]+)/.exec(e);l&&(i=l[2]===window.location.host,l[1]&&(i&=l[1]===window.location.protocol))}i||"undefined"==typeof XDomainRequest||((o=new XDomainRequest).onload=r,o.onerror=a,o.ontimeout=a,o.onprogress=function(){},o.timeout=0,s=!0),o.onreadystatechange=function(){4===o.readyState&&(200===o.status||0==o.status&&o.responseText?r():a())},o.open("GET",e,!0),s&&setTimeout(function(){o.send()},0),o.send(null)};else if("undefined"!=typeof require){var l,u,c,d=/ENOENT/;a=function(e,t,n){if("file:"===e.substr(0,5)){l=l||require("fs");var r=e.substr(5);return o&&(r=r.replace(/\//g,"\\")),l.readFile(r,function(r,a){if(r)return d.test(r.message)&&(r.statusCode=404,r.url=e),n(r);t(a+"")})}if("http"===e.substr(0,4)){return("https:"===e.substr(0,6)?c=c||require("https"):u=u||require("http")).get(e,function(e){if(200!==e.statusCode)n(new Error("Request failed. Status: "+e.statusCode));else{var r="";e.setEncoding("utf8"),e.on("data",function(e){r+=e}),e.on("end",function(){t(r)})}})}}}else{if("function"!=typeof fetch)throw new TypeError("No environment fetch API available.");a=function(e,t,n){fetch(e).then(function(e){return e.text()}).then(function(e){t(e)}).then(null,function(e){n(e)})}}var f=new(function(e){function t(t){if(e.call(this,t||{}),"undefined"!=typeof location&&location.href){var n=__global.location.href.split("#")[0].split("?")[0];this.baseURL=n.substring(0,n.lastIndexOf("/")+1)}else{if("undefined"==typeof process||!process.cwd)throw new TypeError("No environment baseURL");this.baseURL="file:"+process.cwd()+"/",o&&(this.baseURL=this.baseURL.replace(/\\/g,"/"))}this.paths={"*":"*.js"}}return t.__proto__=null!==e?e:Function.prototype,t.prototype=$__Object$create(null!==e?e.prototype:null),$__Object$defineProperty(t.prototype,"constructor",{value:t}),$__Object$defineProperty(t.prototype,"global",{get:function(){return isBrowser?window:isWorker?self:__global},enumerable:!1}),$__Object$defineProperty(t.prototype,"strict",{get:function(){return!0},enumerable:!1}),$__Object$defineProperty(t.prototype,"normalize",{value:function(e,t,n){if("string"!=typeof e)throw new TypeError("Module name must be a string");var r=e.split("/");if(0==r.length)throw new TypeError("No module name provided");var a=0,o=!1,i=0;if("."==r[0]){if(++a==r.length)throw new TypeError('Illegal module name "'+e+'"');o=!0}else{for(;".."==r[a];)if(++a==r.length)throw new TypeError('Illegal module name "'+e+'"');a&&(o=!0),i=a}if(!o)return e;var s=[],l=(t||"").split("/");l.length;return s=s.concat(l.splice(0,l.length-1-i)),(s=s.concat(r.splice(a,r.length-a))).join("/")},enumerable:!1,writable:!0}),$__Object$defineProperty(t.prototype,"locate",{value:function(e){var t,r=e.name,a="";for(var o in this.paths){var i=o.split("*");if(i.length>2)throw new TypeError("Only one wildcard in a path is permitted");if(1==i.length){if(r==o&&o.length>a.length){a=o;break}}else r.substr(0,i[0].length)==i[0]&&r.substr(r.length-i[1].length)==i[1]&&(a=o,t=r.substr(i[0].length,r.length-i[1].length-i[0].length))}var s=this.paths[a];return t&&(s=s.replace("*",t)),isBrowser&&(s=s.replace(/#/g,"%23")),n(this.baseURL,s)},enumerable:!1,writable:!0}),$__Object$defineProperty(t.prototype,"fetch",{value:function(e){var t=this;return new i(function(o,i){a(n(t.baseURL,e.address),function(e){o(e)},function(n){var a=i.bind(null,n);r(n,e,t).then(a,a)})})},enumerable:!1,writable:!0}),t}(__global.LoaderPolyfill));"object"==typeof exports&&(module.exports=f),__global.System=f}()}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:global),function(e){e.upgradeSystemLoader=function(){function t(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function r(e,n){var r=e,a=n;return x&&(a=a.replace(/\\/g,"/")),a=t(a||""),r=t(r||""),a&&r?(a.protocol||r.protocol)+(a.protocol||a.authority?a.authority:r.authority)+function(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}(a.protocol||a.authority||"/"===a.pathname.charAt(0)?a.pathname:a.pathname?(r.authority&&!r.pathname?"/":"")+r.pathname.slice(0,r.pathname.lastIndexOf("/")+1)+a.pathname:r.pathname)+(a.protocol||a.authority||a.pathname?a.search:a.search||r.search)+a.hash:null}function a(t){var n={};if(("object"==typeof t||"function"==typeof t)&&t!==e)if(_)for(var r in t)"default"!==r&&o(n,t,r);else i(n,t);return n.default=t,w(n,"__useDefault",{value:!0}),n}function o(e,t,n){try{var r;(r=Object.getOwnPropertyDescriptor(t,n))&&w(e,n,r)}catch(r){return e[n]=t[n],!1}}function i(e,t,n){var r=t&&t.hasOwnProperty;for(var a in t)r&&!t.hasOwnProperty(a)||n&&a in e||(e[a]=t[a]);return e}function s(e){function t(e,t){t._extensions=[];for(var n=0,r=e.length;n=0;o--){for(var i=r[o],s=0;st.index)return!0;return!1}a.lastIndex=o.lastIndex=i.lastIndex=0;var n,r=[],s={},l=[],u=[];if(e.length/e.split("\n").length<200){for(;n=i.exec(e);)l.push([n.index,n.index+n[0].length]);for(;n=o.exec(e);)t(l,n)||u.push([n.index,n.index+n[0].length])}for(;n=a.exec(e);)if(!t(l,n)&&!t(u,n)){var c=n[1].substr(1,n[1].length-2);if(c.match(/"|'/))continue;r.push(c),s[c]=n.index}return{deps:r,info:s}}function n(e,t){var n=this;return function(r){var a=t[r];return n._getLineAndColumnFromPosition(e.source,a)}}e._extensions.push(f),e._determineFormat=Function.prototype;var r=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF.])(exports\s*(\[['"]|\.)|module(\.exports|\['exports'\]|\["exports"\])\s*(\[['"]|[=,\.])|Object.defineProperty\(\s*module\s*,\s*(?:'|")exports(?:'|"))/,a=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF."'])require\s*\(\s*("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')\s*\)/g,o=/(^|[^\\])(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,i=/("[^"\\\n\r]*(\\.[^"\\\n\r]*)*"|'[^'\\\n\r]*(\\.[^'\\\n\r]*)*')/g,s=e.instantiate;e.instantiate=function(o){if(o.metadata.format||(r.lastIndex=0,a.lastIndex=0,(a.exec(o.source)||r.exec(o.source))&&(o.metadata.format="cjs",this._determineFormat(o))),"cjs"==o.metadata.format){var i=t(o.source);o.metadata.deps=o.metadata.deps?o.metadata.deps.concat(i.deps):i.deps,o.metadata.getImportPosition=n.call(this,o,i.info),o.metadata.executingRequire=!0,o.metadata.execute=function(t,n,r){var a=(o.address||"").split("/");a.pop(),a=a.join("/"),b._nodeRequire&&(a=a.substr(5));e.global._g={global:e.global,exports:n,module:r,require:t,__filename:b._nodeRequire?o.address.substr(5):o.address,__dirname:a};var i=e.global.define;e.global.define=void 0;var s={name:o.name,source:"(function() {\n(function(global, exports, module, require, __filename, __dirname){\n"+o.source+"\n}).call(_g.exports, _g.global, _g.exports, _g.module, _g.require, _g.__filename, _g.__dirname);})();",address:o.address};try{e.__exec(s)}catch(t){throw e.StackTrace&&(e.StackTrace.parse(t)||(t.stack=new e.StackTrace(t.message,[e.StackTrace.item("",o.address,1,0)]).toString())),t}e.global.define=i,e.global._g=void 0}}return s.call(this,o)}}function p(e){function t(e,t){var n=[],r=(e.match(f)[1].split(",")[t]||"require").replace(h,""),a=m[r]||(m[r]=new RegExp("/\\*|//|\"|'|`|(?:^|\\breturn\\b|[([=,;:?><&|^*%~+-])\\s*(?=/)|\\b"+r+"(?=\\s*\\()","g"));a.lastIndex=0,v[r]=v.require;for(var o,i,s,l;o=a.exec(e);)if(i=o[0],(s=v[i])||(s=v[i="/regexp/"]),s.lastIndex=a.lastIndex,(l=s.exec(e))&&l.index===a.lastIndex){a.lastIndex=s.lastIndex;var u=o.index-1;u>-1&&"."===e.charAt(u)||s!==v.require||l[2]&&n.push(l[2])}return n}function n(e,t,r,a){var o=this;if("object"==typeof e&&!(e instanceof Array))return n.apply(null,Array.prototype.splice.call(arguments,1,arguments.length-1));if(!(e instanceof Array)){if("string"==typeof e){var i=o.get(e);return i.__useDefault?i.default:i}throw new TypeError("Invalid require")}Promise.all(e.map(function(e){return o.import(e,a)})).then(function(e){t&&t.apply(null,e)},r)}function r(e,t,r){return function(a,o,i){return"string"==typeof a?t(a):n.call(r,a,o,i,{name:e})}}function a(e){function n(n,a,o){var i=n,s=a,l=o,u=!1;"string"!=typeof i&&(l=s,s=i,i=null),s instanceof Array||(l=s,s=["require","exports","module"]),"function"!=typeof l&&(l=function(e){return function(){return e}}(l)),void 0===s[s.length-1]&&s.pop();var c,f,p;if(-1!=(c=y.call(s,"require"))){s.splice(c,1);var h=l.toString();s=s.concat(t(h,c))}-1!=(f=y.call(s,"exports"))&&(s.splice(f,1),h||(h=l.toString(),u=g.test(h))),-1!=(p=y.call(s,"module"))&&s.splice(p,1);var m={deps:s,execute:function(t,n,a){for(var o=[],i=0;i=0;a--)e.source=e.source.substr(0,r[a].start)+r[a].postLocate(t[a])+e.source.substr(r[a].end,e.source.length);return o.call(n,e)})}}),v(function(e){e._contextualModules={},e.setContextual=function(e,t){this._contextualModules[e]=t};var t=e.normalize;e.normalize=function(e,n){var r=this,a=r.pluginLoader||r;if(n){var o=this._contextualModules[e];if(o){var i=e+"/"+n;return r.has(i)?Promise.resolve(i):("string"==typeof o&&(o=a.import(o)),Promise.resolve(o).then(function(e){var t=e;return t.default&&(t=t.default),Promise.resolve(t.call(r,n))}).then(function(e){return r.set(i,r.newModule(e)),i}))}}return t.apply(this,arguments)}}),v(function(e){function t(){document.removeEventListener("DOMContentLoaded",t,!1),window.removeEventListener("load",t,!1),n()}function n(){for(var t=document.getElementsByTagName("script"),n=0;n0)return n;var i=o(t.map(r));if(i.length>0)return i;throw new Error("Unknown stack format: "+e)}function r(e){var t=e.match(l);if(!t)return null;var n=t[1]||"";return{method:n,fnName:n,url:t[2]||"",line:parseInt(t[3])||0,column:parseInt(t[4])||0}}function a(e){var t=e.match(u)||e.match(c);if(!t)return null;var n=t[3].match(d);if(!n)return null;var r=t[2]||"";return t[1]&&(r="eval at "+r),{method:r,fnName:r,url:n[1]||"",line:parseInt(n[2])||0,column:parseInt(n[3])||0}}function o(e){var t=[];return e.forEach(function(e){e&&t.push(e)}),t}function i(e){var t=/at position ([0-9]+)/.exec(e);if(t&&t.length>1)return Number(t[1])}function s(e,t){for(var n=0;nt.index)return!0;return!1}function n(e){for(;a=e.exec(r);)if(!t(i,a)){var n=a[1];o.push(n)}}var r=e.replace(c,"");l.lastIndex=c.lastIndex=u.lastIndex=d.lastIndex=0;var a,o=[],i=[];if(e.length/e.split("\n").length<200)for(;a=d.exec(r);)i.push([a.index,a.index+a[0].length]);return n(l),n(u),o}e._traceData={loads:{},parentMap:{}},e.getDependencies=function(e){var t=this.getModuleLoad(e);return t?t.metadata.dependencies:void 0},e.getDependants=function(e){var n=[];return t(this._traceData.parentMap[e]||{},function(e){n.push(e)}),n},e.getModuleLoad=function(e){return this._traceData.loads[e]},e.getBundles=function(e,n){var r=n||{};r[e]=!0;var a=this,o=a._traceData.parentMap[e];if(!o)return[e];var i=[];return t(o,function(e,t){r[e]||(i=i.concat(a.getBundles(e,r)))}),i},e.getImportSpecifier=function(e,t){for(var n,r=0;r-1||o.indexOf("steal-with-promises.production")>-1&&!n.env)&&this.config({env:s+"-production"}),(this.isEnv("production")||this.loadBundles)&&C.call(this),z.stealPath.set.call(this,i,n)}},devBundle:{order:16,set:function(e,t){var n=!0===e?"dev-bundle":e;n&&(this.devBundle=n)}},depsBundle:{order:17,set:function(e,t){var n=!0===e?"dev-bundle":e;n&&(this.depsBundle=n)}}};r(z,function(e,t){e.order?q.splice(e.order,0,t):q.push(t)}),function(e,t,n){var a=e.config;e.config=function(o){var s=i({},o);r(t,function(t){var r=n[t];if(r.set&&s[t]){var a=r.set.call(e,s[t],o);void 0!==a&&(e[t]=a),delete s[t]}}),a.call(this,s)}}(e,q,z),P.config=function(e){if("string"==typeof e)return this.loader[e];this.loader.config(e)},v(function(e){e.getEnv=function(){return(this.env||"").split("-")[1]||this.env},e.getPlatform=function(){var e=(this.env||"").split("-");return 2===e.length?e[0]:void 0},e.isEnv=function(e){return this.getEnv()===e},e.isPlatform=function(e){return this.getPlatform()===e}});var U=function(e){var t={},r=/Url$/,a=e.split("?"),o=a.shift(),i=a.join("?").split("&"),s=o.split("/");s.pop(),s.join("/");if(i.length&&i[0].length)for(var l,u=0;u1){var d=n(c[0]);t[d=d.replace(r,"URL")]=c.slice(1).join("=")}}return t},B=function(e){var t={},a=/Url$/;t.stealURL=e.src,r(e.attributes,function(e){var r=e.nodeName||e.name,o=n(0===r.indexOf("data-")?r.replace("data-",""):r);o=o.replace(a,"URL"),t[o]=""===e.value||e.value});var o=e.innerHTML;/\S/.test(o)&&(t.mainSource=o);var s=i(U(e.src),t);return s.main&&("boolean"==typeof s.main&&delete s.main,s.loadMainOnStartup=!0),s},W=function(){var e=this;return new Promise(function(t,n){if(!h)return y?(e.script=_||x(),void t(B(e.script))):void t({loadMainOnStartup:!0,stealPath:__dirname});t(i({loadMainOnStartup:!0,stealURL:location.href},U(location.href)))})};return P.startup=function(e){var t,n,r=this,o=this.loader;return g=new Promise(function(e,r){t=e,n=r}),O=W.call(this).then(function(s){function l(e){if(404===e.statusCode&&r.script){var t="This page has "+((o.devBundle?"dev-":"deps-")+"bundle")+" enabled but "+e.url+" could not be retrieved.\nDid you forget to generate the bundle first?\nSee https://stealjs.com/docs/StealJS.development-bundles.html for more information.",n=new Error(t);return n.stack=null,Promise.reject(n)}return Promise.reject(e)}var u;return u="object"==typeof e?i(e,s):s,o.config(u),F.call(o),o.loadBundles?(o.main||!o.isEnv("production")||o.stealBundled||w("Attribute 'main' is required in production environment. Please add it to the script tag."),o.import(o.configMain).then(t,n),g.then(function(e){return F.call(o),o._configLoaded=!0,o.main&&u.loadMainOnStartup?o.import(o.main):e})):(o.import(o.devBundle).then(function(){return o.import(o.configMain)},l).then(function(){return o.import(o.depsBundle).then(null,l)}).then(t,n),(S=g.then(function(){return F.call(o),$.call(o),o._configLoaded=!0,u&&o.config(u),o.import("@dev")})).then(function(){if(!o.main||o.localLoader)return g;if(u.loadMainOnStartup){var e=o.main;return"string"==typeof e&&(e=[e]),Promise.all(a(e,function(e){return o.import(e)}))}o._warnNoMain(r._mainWarnMs||2e3)}))}).then(function(e){return o.mainSource?o.module(o.mainSource):(o.loadScriptModules(),e)})},P.done=function(){return O},P.import=function(){var e=arguments,t=this.System;return g||(t.main||(t.main="@empty"),P.startup()),g.then(function(){var n=[];return r(e,function(e){n.push(t.import(e))}),n.length>1?Promise.all(n):n[0]})},P.setContextual=f.call(e.setContextual,e),P.isEnv=f.call(e.isEnv,e),P.isPlatform=f.call(e.isPlatform,e),P};if(!b||v||g){var M=e.steal;e.steal=P(System),e.steal.startup(M&&"object"==typeof M&&M).then(null,function(e){if("undefined"!=typeof console){var t=console;"function"==typeof e.logError?e.logError(t):t[t.error?"error":"log"](e)}}),e.steal.clone=O}else e.steal=P(System),e.steal.System=System,e.steal.dev=require("./ext/dev.js"),steal.clone=O,module.exports=e.steal}("undefined"==typeof window?"undefined"==typeof global?this:global:window); \ No newline at end of file diff --git a/steal.js b/steal.js index 0d681636b..85977aa33 100644 --- a/steal.js +++ b/steal.js @@ -252,6 +252,8 @@ function logloads(loads) { load = createLoad(name); loader.loads.push(load); + loader.loaderObj.forwardMetadata(load, refererName); + proceedToLocate(loader, load); return load; @@ -285,6 +287,10 @@ function logloads(loads) { ); } + function transpilableFormat(format) { + return format === "cjs" || format === "amd"; + } + var anonCnt = 0; // 15.2.4.5 @@ -340,9 +346,20 @@ function logloads(loads) { }); } else if (typeof instantiateResult == 'object') { - load.depsList = instantiateResult.deps || []; - load.execute = instantiateResult.execute; - load.isDeclarative = false; + function addToLoad() { + load.depsList = instantiateResult.deps || []; + load.execute = instantiateResult.execute; + load.isDeclarative = false; + } + + if(!loader.loaderObj.transpileAllFormats || + load.metadata.shouldTranspile === false || + !transpilableFormat(load.metadata.format)) { + return addToLoad(); + } + + return loader.loaderObj.transpile(load).then(addToLoad); + } else throw TypeError('Invalid instantiate return value'); @@ -1378,7 +1395,8 @@ function logloads(loads) { } catch(e) { // traceur throws an error array - throw e[0]; + var error = e[0] || e.errors[0]; + throw error; } } @@ -1498,7 +1516,12 @@ function logloads(loads) { var npmPluginNameOrPath = getNpmPluginNameOrPath(name); // import the plugin! - promises.push(this["import"](npmPluginNameOrPath, { name: parent }) + promises.push(this["import"](npmPluginNameOrPath, { + name: parent, + metadata: { + shouldTranspile: false + } + }) .then(function(mod) { var exported = mod.__esModule ? mod["default"] : mod; @@ -1579,7 +1602,7 @@ function logloads(loads) { function getBabelPresets(current, loader) { var presets = current || []; var forceES5 = loader.forceES5 !== false; - var defaultPresets = forceES5 + var defaultPresets = forceES5 ? [babelES2015Preset, "react", "stage-0"] : ["react"]; @@ -1719,7 +1742,12 @@ function logloads(loads) { var npmPresetNameOrPath = getNpmPresetNameOrPath(name); // import the preset! - promises.push(this["import"](npmPresetNameOrPath, { name: parent }) + promises.push(this["import"](npmPresetNameOrPath, { + name: parent, + metadata: { + shouldTranspile: false + } + }) .then(function(mod) { var exported = mod.__esModule ? mod["default"] : mod; @@ -5551,7 +5579,8 @@ addStealExtension(function addNoMainWarn(loader) { "package.json!npm": true, "npm": true, "@empty": true, - "@dev": true + "@dev": true, + "babel": true }; var loaderImport = loader.import; @@ -5595,10 +5624,11 @@ addStealExtension(function addMetaDeps(loader) { } loader.transpile = function (load) { + // TODO this needs to change prependDeps(this, load, createImport); var result = superTranspile.apply(this, arguments); return result; - } + }; loader._determineFormat = function (load) { if(load.metadata.format === 'cjs') { @@ -6259,6 +6289,31 @@ addStealExtension(function addMJS(loader){ }; }); +// This extension allows you to define metadata that should appear on +// Any subdependencies. For example we can add the { foo: true } bool +// to a module's metadata, and it will be forwarded to any subdependency. +addStealExtension(function forwardMetadata(loader){ + loader._forwardedMetadata = {}; + loader.setForwardedMetadata = function(prop) { + loader._forwardedMetadata[prop] = true; + }; + + loader.forwardMetadata = function(load, parentName) { + if(parentName) { + var parentLoad = this.getModuleLoad(parentName); + + if(parentLoad) { + // TODO use Object.assign instead? + for(var p in this._forwardedMetadata) { + if(p in parentLoad.metadata) { + load.metadata[p] = parentLoad.metadata[p]; + } + } + } + } + }; +}); + addStealExtension(function applyTraceExtension(loader) { loader._traceData = { loads: {}, @@ -6638,6 +6693,7 @@ addStealExtension(function addCacheBust(loader) { System.ext = Object.create(null); System.logLevel = 0; System.forceES5 = true; + System.transpileAllFormats = true; var cssBundlesNameGlob = "bundles/*.css", jsBundlesNameGlob = "bundles/*"; setIfNotPresent(System.paths,cssBundlesNameGlob, "dist/bundles/*css"); @@ -6891,9 +6947,11 @@ addStealExtension(function addCacheBust(loader) { this.paths["@@babel-code-frame"] = dirname+"/ext/babel-code-frame.js"; setIfNotPresent(this.meta,"traceur",{"exports":"traceur"}); setIfNotPresent(this.meta, "@@babel-code-frame", {"format":"global","exports":"BabelCodeFrame"}); + setIfNotPresent(this.meta, "babel", {"shouldTranspile": false}); // steal-clone is contextual so it can override modules using relative paths this.setContextual('steal-clone', 'steal-clone'); + this.setForwardedMetadata("shouldTranspile"); if(isNode) { if(this.configMain === "@config" && last(parts) === "steal") { diff --git a/steal.production.js b/steal.production.js index 925bc7a1f..f5087d5d1 100644 --- a/steal.production.js +++ b/steal.production.js @@ -4,4 +4,4 @@ * Copyright (c) 2019 Bitovi; Licensed MIT */ -!function(__global){function __eval(__source,__global,__load){try{eval('(function() { var __moduleName = "'+(__load.name||"").replace('"','"')+'"; '+__source+" \n }).call(__global);")}catch(e){throw"SyntaxError"!=e.name&&"TypeError"!=e.name||(e.message="Evaluating "+(__load.name||load.address)+"\n\t"+e.message),e}}var isWorker="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,isBrowser="undefined"!=typeof window&&!isWorker;__global.$__Object$getPrototypeOf=Object.getPrototypeOf||function(e){return e.__proto__};var $__Object$defineProperty;!function(){try{Object.defineProperty({},"a",{})&&($__Object$defineProperty=Object.defineProperty)}catch(e){$__Object$defineProperty=function(e,t,n){try{e[t]=n.value||n.get.call(e)}catch(e){}}}}(),__global.$__Object$create=Object.create||function(e,t){function n(){}if(n.prototype=e,"object"==typeof t)for(prop in t)t.hasOwnProperty(prop)&&(n[prop]=t[prop]);return new n},function(){function e(e){return{status:"loading",name:e,linkSets:[],dependencies:[],metadata:{}}}function t(e,t,n){return new I(l({step:n.address?"fetch":"locate",loader:e,moduleName:t,moduleMetadata:n&&n.metadata||{},moduleSource:n.source,moduleAddress:n.address}))}function n(t,n,a,o){return new I(function(e,r){e(t.loaderObj.normalize(n,a,o))}).then(function(e){return I.resolve(t.loaderObj.notifyLoad(n,e,a)).then(function(){return e})}).then(function(n){var a;if(t.modules[n])return a=e(n),a.status="linked",a.module=t.modules[n],a;for(var o=0,i=t.loads.length;o",t.isDeclarative=!0,e.loaderObj.transpile(t).then(function(e){var n=__global.System,r=n.register;n.register=function(e,n,r){var a=r,o=n;"string"!=typeof e&&(a=o,o=e),t.declare=a,t.depsList=o},__eval(e,__global,t),n.register=r});if("object"!=typeof n)throw TypeError("Invalid instantiate return value");t.depsList=n.deps||[],t.execute=n.execute,t.isDeclarative=!1}}).then(function(){if("loading"==t.status&&!o()){t.dependencies=[];for(var r=t.depsList,a=[],i=0,s=r.length;i0)){var n=e.startingLoad;if(!1===e.loader.loaderObj.execute){for(var r=[].concat(e.loads),a=0,o=r.length;a=0;i--){for(var s=r[i],l=0;l");r.address=n&&n.address;var a=u(this._loader,r),i=I.resolve(t),s=this._loader,l=a.done.then(function(){return x(s,r)});return o(s,r,i),l},newModule:function(e){if("object"!=typeof e)throw new TypeError("Expected object");var t,n=new M;if(Object.getOwnPropertyNames&&null!=e)t=Object.getOwnPropertyNames(e);else{t=[];for(var r in e)t.push(r)}for(var a=0;a=6?(delete r.optional,delete r.whitelist,delete r.blacklist,r.presets=u(r.presets,n),r.plugins=l(r.plugins)):(r.modules="system",r.blacklist||(r.blacklist=["react"])),r}function p(e){var t=e.types;return{visitor:{Program:function(e,n){e.unshiftContainer("body",[t.exportNamedDeclaration(null,[t.exportSpecifier(t.identifier("true"),t.identifier("__esModule"))])])}}}}function m(e){return e.metadata.importSpecifiers=Object.create(null),e.metadata.importNames=Object.create(null),e.metadata.exportNames=Object.create(null),{visitor:{ImportDeclaration:function(t,n){var r=t.node,a=r.source.value,o=r.source.loc;e.metadata.importSpecifiers[a]=o;var i=e.metadata.importNames[a];i||(i=e.metadata.importNames[a]=[]),i.push.apply(i,(r.specifiers||[]).map(function(e){return"ImportDefaultSpecifier"===e.type?"default":e.imported&&e.imported.name}))},ExportDeclaration:function(t,n){var r=t.node;if(r.source){var a=r.source.value,o=e.metadata.exportNames[a];"ExportNamedDeclaration"===r.type?(o||(o=e.metadata.exportNames[a]=new Map),r.specifiers.forEach(function(e){o.set(e.exported.name,e.local.name)})):"ExportAllDeclaration"===r.type&&(e.metadata.exportNames[a]=1)}}}}}function h(e,t){var n=this,r=t.Babel||t.babel||t,a=d(r),o=f.call(n,e,r);return Promise.all([b.call(this,r,o),x.call(this,r,o)]).then(function(t){a>=6&&(o.plugins=[m.bind(null,e),p].concat(t[0]),o.presets=t[1]);try{return r.transform(e.source,o).code+"\n//# sourceURL="+e.address+"!eval"}catch(t){if(t instanceof SyntaxError){var i=new SyntaxError(t.message),s=new n.StackTrace(t.message,[n.StackTrace.item("",e.address,t.loc.line,t.loc.column)]);return i.stack=s.toString(),Promise.reject(i)}return Promise.reject(t)}})}var v=__global,g="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process);e.prototype.transpiler="babel",e.prototype.transpile=function(e){var n=this;return n.transpilerHasRun||(v.traceur&&!n.has("traceur")&&n.set("traceur",t(n,"traceur")),v.Babel&&!n.has("babel")&&n.set("babel",t(n,"Babel")),n.transpilerHasRun=!0),n.import(n.transpiler).then(function(t){var a=t;return a.__useDefault&&(a=a.default),(a.Compiler?r:h).call(n,e,a)}).then(function(t){return'var __moduleAddress = "'+e.address+'";'+t})},e.prototype.instantiate=function(e){var r=this;return Promise.resolve(r.normalize(r.transpiler)).then(function(a){if(e.name===a)return{deps:[],execute:function(){var a=v.System,o=v.Reflect.Loader;return __eval("(function(require,exports,module){"+e.source+"})();",v,e),v.System=a,v.Reflect.Loader=o,t(r,n(e.name))}}})};var b=function(){function e(e,r){var a=[];return(r||[]).forEach(function(r){var o=i(r);if(!s(r)||t(e,o))a.push(r);else if(!t(e,o)){var l=this.configMain||"package.json!npm",u=n(o);a.push(this.import(u,{name:l}).then(function(e){var t=e.__esModule?e.default:e;return"string"==typeof r?t:[t,r[1]]}))}},this),Promise.all(a)}function t(e,t){var n=/^(?:babel-plugin-)/;return!!(e.availablePlugins||{})[n.test(t)?t.replace("babel-plugin-",""):t]}function n(e){var t=/^(?:babel-plugin-)/;return/\//.test(e)||t.test(e)?e:"babel-plugin-"+e}return function(t,n){var r=o.call(this),a=n.env||{},i=[e.call(this,t,n.plugins)];for(var s in a)if(r===s){var l=a[s].plugins||[];i.push(e.call(this,t,l))}return Promise.all(i).then(function(e){var t=[];return e.forEach(function(e){t=t.concat(e)}),t})}}(),y="es2015-no-commonjs",x=function(){function e(e,r){var a=[];return(r||[]).forEach(function(r){var o=i(r);if(!s(r)||t(e,o))a.push(r);else if(!t(e,o)){var l=this.configMain||"package.json!npm",u=n(o);a.push(this.import(u,{name:l}).then(function(e){var t=e.__esModule?e.default:e;return"string"==typeof r?t:[t,r[1]]}))}},this),Promise.all(a)}function t(e,t){var n=/^(?:babel-preset-)/;return!!(e.availablePresets||{})[n.test(t)?t.replace("babel-preset-",""):t]}function n(e){var t=/^(?:babel-preset-)/;return/\//.test(e)||t.test(e)?e:"babel-preset-"+e}return function(t,n){var r=o.call(this),a=n.env||{},i=[e.call(this,t,n.presets)];for(var s in a)if(r===s){var l=a[s].presets||[];i.push(e.call(this,t,l))}return Promise.all(i).then(function(e){var t=[];return e.forEach(function(e){t=t.concat(e)}),t})}}();e.prototype._getImportSpecifierPositionsPlugin=m}(__global.LoaderPolyfill),function(){function e(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function t(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}function n(n,r){var a=r,i=n;return s.test(r)?"http:"+r:(o&&(a=a.replace(/\\/g,"/")),a=e(a||""),i=e(i||""),a&&i?(a.protocol||i.protocol)+(a.protocol||a.authority?a.authority:i.authority)+t(a.protocol||a.authority||"/"===a.pathname.charAt(0)?a.pathname:a.pathname?(i.authority&&!i.pathname?"/":"")+i.pathname.slice(0,i.pathname.lastIndexOf("/")+1)+a.pathname:i.pathname)+(a.protocol||a.authority||a.pathname?a.search:a.search||i.search)+a.hash:null)}function r(e,t,n){if(void 0===n.getDependants)return i.resolve();var r=n.getDependants(t.name);if(Array.isArray(r)&&r.length){var a=n.StackTrace,o=n.isEnv("production");return i.resolve().then(function(){return o?i.resolve():n.import("@@babel-code-frame")}).then(function(i){var s=n.getModuleLoad(r[0]),l=n.getImportSpecifier(t.name,s)||{line:1,column:0},u="The module ["+n.prettyName(t)+"] couldn't be fetched.\nClicking the link in the stack trace below takes you to the import.\nSee https://stealjs.com/docs/StealJS.error-messages.html#404-not-found for more information.\n",c=e.message+"\n"+u;o||(c+="\n"+i(s.metadata.originalSource||s.source,l.line,l.column)+"\n"),e.message=c;var d=new a(c,[a.item(null,s.address,l.line,l.column)]);e.stack=d.toString()})}return i.resolve()}var a,o="undefined"!=typeof process&&!!process.platform.match(/^win/),i=__global.Promise||require("when/es6-shim/Promise"),s=/^\/\//;if("undefined"!=typeof XMLHttpRequest)a=function(e,t,n){function r(){t(o.responseText)}function a(){var t=o.status,r=t+" "+o.statusText+": "+e+"\n"||"XHR error",a=new Error(r);a.url=e,a.statusCode=t,n(a)}var o=new XMLHttpRequest,i=!0,s=!1;if(!("withCredentials"in o)){var l=/^(\w+:)?\/\/([^\/]+)/.exec(e);l&&(i=l[2]===window.location.host,l[1]&&(i&=l[1]===window.location.protocol))}i||"undefined"==typeof XDomainRequest||((o=new XDomainRequest).onload=r,o.onerror=a,o.ontimeout=a,o.onprogress=function(){},o.timeout=0,s=!0),o.onreadystatechange=function(){4===o.readyState&&(200===o.status||0==o.status&&o.responseText?r():a())},o.open("GET",e,!0),s&&setTimeout(function(){o.send()},0),o.send(null)};else if("undefined"!=typeof require){var l,u,c,d=/ENOENT/;a=function(e,t,n){if("file:"===e.substr(0,5)){l=l||require("fs");var r=e.substr(5);return o&&(r=r.replace(/\//g,"\\")),l.readFile(r,function(r,a){if(r)return d.test(r.message)&&(r.statusCode=404,r.url=e),n(r);t(a+"")})}if("http"===e.substr(0,4)){return("https:"===e.substr(0,6)?c=c||require("https"):u=u||require("http")).get(e,function(e){if(200!==e.statusCode)n(new Error("Request failed. Status: "+e.statusCode));else{var r="";e.setEncoding("utf8"),e.on("data",function(e){r+=e}),e.on("end",function(){t(r)})}})}}}else{if("function"!=typeof fetch)throw new TypeError("No environment fetch API available.");a=function(e,t,n){fetch(e).then(function(e){return e.text()}).then(function(e){t(e)}).then(null,function(e){n(e)})}}var f=new(function(e){function t(t){if(e.call(this,t||{}),"undefined"!=typeof location&&location.href){var n=__global.location.href.split("#")[0].split("?")[0];this.baseURL=n.substring(0,n.lastIndexOf("/")+1)}else{if("undefined"==typeof process||!process.cwd)throw new TypeError("No environment baseURL");this.baseURL="file:"+process.cwd()+"/",o&&(this.baseURL=this.baseURL.replace(/\\/g,"/"))}this.paths={"*":"*.js"}}return t.__proto__=null!==e?e:Function.prototype,t.prototype=$__Object$create(null!==e?e.prototype:null),$__Object$defineProperty(t.prototype,"constructor",{value:t}),$__Object$defineProperty(t.prototype,"global",{get:function(){return isBrowser?window:isWorker?self:__global},enumerable:!1}),$__Object$defineProperty(t.prototype,"strict",{get:function(){return!0},enumerable:!1}),$__Object$defineProperty(t.prototype,"normalize",{value:function(e,t,n){if("string"!=typeof e)throw new TypeError("Module name must be a string");var r=e.split("/");if(0==r.length)throw new TypeError("No module name provided");var a=0,o=!1,i=0;if("."==r[0]){if(++a==r.length)throw new TypeError('Illegal module name "'+e+'"');o=!0}else{for(;".."==r[a];)if(++a==r.length)throw new TypeError('Illegal module name "'+e+'"');a&&(o=!0),i=a}if(!o)return e;var s=[],l=(t||"").split("/");l.length;return s=s.concat(l.splice(0,l.length-1-i)),(s=s.concat(r.splice(a,r.length-a))).join("/")},enumerable:!1,writable:!0}),$__Object$defineProperty(t.prototype,"locate",{value:function(e){var t,r=e.name,a="";for(var o in this.paths){var i=o.split("*");if(i.length>2)throw new TypeError("Only one wildcard in a path is permitted");if(1==i.length){if(r==o&&o.length>a.length){a=o;break}}else r.substr(0,i[0].length)==i[0]&&r.substr(r.length-i[1].length)==i[1]&&(a=o,t=r.substr(i[0].length,r.length-i[1].length-i[0].length))}var s=this.paths[a];return t&&(s=s.replace("*",t)),isBrowser&&(s=s.replace(/#/g,"%23")),n(this.baseURL,s)},enumerable:!1,writable:!0}),$__Object$defineProperty(t.prototype,"fetch",{value:function(e){var t=this;return new i(function(o,i){a(n(t.baseURL,e.address),function(e){o(e)},function(n){var a=i.bind(null,n);r(n,e,t).then(a,a)})})},enumerable:!1,writable:!0}),t}(__global.LoaderPolyfill));"object"==typeof exports&&(module.exports=f),__global.System=f}()}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:global),function(e){e.upgradeSystemLoader=function(){function t(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function r(e,n){var r=e,a=n;return x&&(a=a.replace(/\\/g,"/")),a=t(a||""),r=t(r||""),a&&r?(a.protocol||r.protocol)+(a.protocol||a.authority?a.authority:r.authority)+function(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}(a.protocol||a.authority||"/"===a.pathname.charAt(0)?a.pathname:a.pathname?(r.authority&&!r.pathname?"/":"")+r.pathname.slice(0,r.pathname.lastIndexOf("/")+1)+a.pathname:r.pathname)+(a.protocol||a.authority||a.pathname?a.search:a.search||r.search)+a.hash:null}function a(t){var n={};if(("object"==typeof t||"function"==typeof t)&&t!==e)if(_)for(var r in t)"default"!==r&&o(n,t,r);else i(n,t);return n.default=t,w(n,"__useDefault",{value:!0}),n}function o(e,t,n){try{var r;(r=Object.getOwnPropertyDescriptor(t,n))&&w(e,n,r)}catch(r){return e[n]=t[n],!1}}function i(e,t,n){var r=t&&t.hasOwnProperty;for(var a in t)r&&!t.hasOwnProperty(a)||n&&a in e||(e[a]=t[a]);return e}function s(e){function t(e,t){t._extensions=[];for(var n=0,r=e.length;n=0;o--){for(var i=r[o],s=0;st.index)return!0;return!1}a.lastIndex=o.lastIndex=i.lastIndex=0;var n,r=[],s={},l=[],u=[];if(e.length/e.split("\n").length<200){for(;n=i.exec(e);)l.push([n.index,n.index+n[0].length]);for(;n=o.exec(e);)t(l,n)||u.push([n.index,n.index+n[0].length])}for(;n=a.exec(e);)if(!t(l,n)&&!t(u,n)){var c=n[1].substr(1,n[1].length-2);if(c.match(/"|'/))continue;r.push(c),s[c]=n.index}return{deps:r,info:s}}function n(e,t){var n=this;return function(r){var a=t[r];return n._getLineAndColumnFromPosition(e.source,a)}}e._extensions.push(f),e._determineFormat=Function.prototype;var r=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF.])(exports\s*(\[['"]|\.)|module(\.exports|\['exports'\]|\["exports"\])\s*(\[['"]|[=,\.])|Object.defineProperty\(\s*module\s*,\s*(?:'|")exports(?:'|"))/,a=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF."'])require\s*\(\s*("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')\s*\)/g,o=/(^|[^\\])(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,i=/("[^"\\\n\r]*(\\.[^"\\\n\r]*)*"|'[^'\\\n\r]*(\\.[^'\\\n\r]*)*')/g,s=e.instantiate;e.instantiate=function(o){if(o.metadata.format||(r.lastIndex=0,a.lastIndex=0,(a.exec(o.source)||r.exec(o.source))&&(o.metadata.format="cjs",this._determineFormat(o))),"cjs"==o.metadata.format){var i=t(o.source);o.metadata.deps=o.metadata.deps?o.metadata.deps.concat(i.deps):i.deps,o.metadata.getImportPosition=n.call(this,o,i.info),o.metadata.executingRequire=!0,o.metadata.execute=function(t,n,r){var a=(o.address||"").split("/");a.pop(),a=a.join("/"),b._nodeRequire&&(a=a.substr(5));e.global._g={global:e.global,exports:n,module:r,require:t,__filename:b._nodeRequire?o.address.substr(5):o.address,__dirname:a};var i=e.global.define;e.global.define=void 0;var s={name:o.name,source:"(function() {\n(function(global, exports, module, require, __filename, __dirname){\n"+o.source+"\n}).call(_g.exports, _g.global, _g.exports, _g.module, _g.require, _g.__filename, _g.__dirname);})();",address:o.address};try{e.__exec(s)}catch(t){throw e.StackTrace&&(e.StackTrace.parse(t)||(t.stack=new e.StackTrace(t.message,[e.StackTrace.item("",o.address,1,0)]).toString())),t}e.global.define=i,e.global._g=void 0}}return s.call(this,o)}}function p(e){function t(e,t){var n=[],r=(e.match(f)[1].split(",")[t]||"require").replace(m,""),a=h[r]||(h[r]=new RegExp("/\\*|//|\"|'|`|(?:^|\\breturn\\b|[([=,;:?><&|^*%~+-])\\s*(?=/)|\\b"+r+"(?=\\s*\\()","g"));a.lastIndex=0,v[r]=v.require;for(var o,i,s,l;o=a.exec(e);)if(i=o[0],(s=v[i])||(s=v[i="/regexp/"]),s.lastIndex=a.lastIndex,(l=s.exec(e))&&l.index===a.lastIndex){a.lastIndex=s.lastIndex;var u=o.index-1;u>-1&&"."===e.charAt(u)||s!==v.require||l[2]&&n.push(l[2])}return n}function n(e,t,r,a){var o=this;if("object"==typeof e&&!(e instanceof Array))return n.apply(null,Array.prototype.splice.call(arguments,1,arguments.length-1));if(!(e instanceof Array)){if("string"==typeof e){var i=o.get(e);return i.__useDefault?i.default:i}throw new TypeError("Invalid require")}Promise.all(e.map(function(e){return o.import(e,a)})).then(function(e){t&&t.apply(null,e)},r)}function r(e,t,r){return function(a,o,i){return"string"==typeof a?t(a):n.call(r,a,o,i,{name:e})}}function a(e){function n(n,a,o){var i=n,s=a,l=o,u=!1;"string"!=typeof i&&(l=s,s=i,i=null),s instanceof Array||(l=s,s=["require","exports","module"]),"function"!=typeof l&&(l=function(e){return function(){return e}}(l)),void 0===s[s.length-1]&&s.pop();var c,f,p;if(-1!=(c=y.call(s,"require"))){s.splice(c,1);var m=l.toString();s=s.concat(t(m,c))}-1!=(f=y.call(s,"exports"))&&(s.splice(f,1),m||(m=l.toString(),u=g.test(m))),-1!=(p=y.call(s,"module"))&&s.splice(p,1);var h={deps:s,execute:function(t,n,a){for(var o=[],i=0;i=0;a--)e.source=e.source.substr(0,r[a].start)+r[a].postLocate(t[a])+e.source.substr(r[a].end,e.source.length);return o.call(n,e)})}}),v(function(e){e._contextualModules={},e.setContextual=function(e,t){this._contextualModules[e]=t};var t=e.normalize;e.normalize=function(e,n){var r=this,a=r.pluginLoader||r;if(n){var o=this._contextualModules[e];if(o){var i=e+"/"+n;return r.has(i)?Promise.resolve(i):("string"==typeof o&&(o=a.import(o)),Promise.resolve(o).then(function(e){var t=e;return t.default&&(t=t.default),Promise.resolve(t.call(r,n))}).then(function(e){return r.set(i,r.newModule(e)),i}))}}return t.apply(this,arguments)}}),v(function(e){function t(){document.removeEventListener("DOMContentLoaded",t,!1),window.removeEventListener("load",t,!1),n()}function n(){for(var t=document.getElementsByTagName("script"),n=0;n0)return n;var i=o(t.map(r));if(i.length>0)return i;throw new Error("Unknown stack format: "+e)}function r(e){var t=e.match(l);if(!t)return null;var n=t[1]||"";return{method:n,fnName:n,url:t[2]||"",line:parseInt(t[3])||0,column:parseInt(t[4])||0}}function a(e){var t=e.match(u)||e.match(c);if(!t)return null;var n=t[3].match(d);if(!n)return null;var r=t[2]||"";return t[1]&&(r="eval at "+r),{method:r,fnName:r,url:n[1]||"",line:parseInt(n[2])||0,column:parseInt(n[3])||0}}function o(e){var t=[];return e.forEach(function(e){e&&t.push(e)}),t}function i(e){var t=/at position ([0-9]+)/.exec(e);if(t&&t.length>1)return Number(t[1])}function s(e,t){for(var n=0;nt.index)return!0;return!1}function n(e){for(;a=e.exec(r);)if(!t(i,a)){var n=a[1];o.push(n)}}var r=e.replace(c,"");l.lastIndex=c.lastIndex=u.lastIndex=d.lastIndex=0;var a,o=[],i=[];if(e.length/e.split("\n").length<200)for(;a=d.exec(r);)i.push([a.index,a.index+a[0].length]);return n(l),n(u),o}e._traceData={loads:{},parentMap:{}},e.getDependencies=function(e){var t=this.getModuleLoad(e);return t?t.metadata.dependencies:void 0},e.getDependants=function(e){var n=[];return t(this._traceData.parentMap[e]||{},function(e){n.push(e)}),n},e.getModuleLoad=function(e){return this._traceData.loads[e]},e.getBundles=function(e,n){var r=n||{};r[e]=!0;var a=this,o=a._traceData.parentMap[e];if(!o)return[e];var i=[];return t(o,function(e,t){r[e]||(i=i.concat(a.getBundles(e,r)))}),i},e.getImportSpecifier=function(e,t){for(var n,r=0;r-1||o.indexOf("steal-with-promises.production")>-1&&!n.env)&&this.config({env:s+"-production"}),(this.isEnv("production")||this.loadBundles)&&$.call(this),q.stealPath.set.call(this,i,n)}},devBundle:{order:16,set:function(e,t){var n=!0===e?"dev-bundle":e;n&&(this.devBundle=n)}},depsBundle:{order:17,set:function(e,t){var n=!0===e?"dev-bundle":e;n&&(this.depsBundle=n)}}};r(q,function(e,t){e.order?A.splice(e.order,0,t):A.push(t)}),function(e,t,n){var a=e.config;e.config=function(o){var s=i({},o);r(t,function(t){var r=n[t];if(r.set&&s[t]){var a=r.set.call(e,s[t],o);void 0!==a&&(e[t]=a),delete s[t]}}),a.call(this,s)}}(e,A,q),M.config=function(e){if("string"==typeof e)return this.loader[e];this.loader.config(e)},v(function(e){e.getEnv=function(){return(this.env||"").split("-")[1]||this.env},e.getPlatform=function(){var e=(this.env||"").split("-");return 2===e.length?e[0]:void 0},e.isEnv=function(e){return this.getEnv()===e},e.isPlatform=function(e){return this.getPlatform()===e}});var U=function(e){var t={},r=/Url$/,a=e.split("?"),o=a.shift(),i=a.join("?").split("&"),s=o.split("/");s.pop(),s.join("/");if(i.length&&i[0].length)for(var l,u=0;u1){var d=n(c[0]);t[d=d.replace(r,"URL")]=c.slice(1).join("=")}}return t},B=function(e){var t={},a=/Url$/;t.stealURL=e.src,r(e.attributes,function(e){var r=e.nodeName||e.name,o=n(0===r.indexOf("data-")?r.replace("data-",""):r);o=o.replace(a,"URL"),t[o]=""===e.value||e.value});var o=e.innerHTML;/\S/.test(o)&&(t.mainSource=o);var s=i(U(e.src),t);return s.main&&("boolean"==typeof s.main&&delete s.main,s.loadMainOnStartup=!0),s},G=function(){var e=this;return new Promise(function(t,n){if(!m)return y?(e.script=_||x(),void t(B(e.script))):void t({loadMainOnStartup:!0,stealPath:__dirname});t(i({loadMainOnStartup:!0,stealURL:location.href},U(location.href)))})};return M.startup=function(e){var t,n,r=this,o=this.loader;return g=new Promise(function(e,r){t=e,n=r}),O=G.call(this).then(function(s){function l(e){if(404===e.statusCode&&r.script){var t="This page has "+((o.devBundle?"dev-":"deps-")+"bundle")+" enabled but "+e.url+" could not be retrieved.\nDid you forget to generate the bundle first?\nSee https://stealjs.com/docs/StealJS.development-bundles.html for more information.",n=new Error(t);return n.stack=null,Promise.reject(n)}return Promise.reject(e)}var u;return u="object"==typeof e?i(e,s):s,o.config(u),F.call(o),o.loadBundles?(o.main||!o.isEnv("production")||o.stealBundled||w("Attribute 'main' is required in production environment. Please add it to the script tag."),o.import(o.configMain).then(t,n),g.then(function(e){return F.call(o),o._configLoaded=!0,o.main&&u.loadMainOnStartup?o.import(o.main):e})):(o.import(o.devBundle).then(function(){return o.import(o.configMain)},l).then(function(){return o.import(o.depsBundle).then(null,l)}).then(t,n),(j=g.then(function(){return F.call(o),C.call(o),o._configLoaded=!0,u&&o.config(u),o.import("@dev")})).then(function(){if(!o.main||o.localLoader)return g;if(u.loadMainOnStartup){var e=o.main;return"string"==typeof e&&(e=[e]),Promise.all(a(e,function(e){return o.import(e)}))}o._warnNoMain(r._mainWarnMs||2e3)}))}).then(function(e){return o.mainSource?o.module(o.mainSource):(o.loadScriptModules(),e)})},M.done=function(){return O},M.import=function(){var e=arguments,t=this.System;return g||(t.main||(t.main="@empty"),M.startup()),g.then(function(){var n=[];return r(e,function(e){n.push(t.import(e))}),n.length>1?Promise.all(n):n[0]})},M.setContextual=f.call(e.setContextual,e),M.isEnv=f.call(e.isEnv,e),M.isPlatform=f.call(e.isPlatform,e),M};if(!b||v||g){var P=e.steal;e.steal=M(System),e.steal.startup(P&&"object"==typeof P&&P).then(null,function(e){if("undefined"!=typeof console){var t=console;"function"==typeof e.logError?e.logError(t):t[t.error?"error":"log"](e)}}),e.steal.clone=O}else e.steal=M(System),e.steal.System=System,e.steal.dev=require("./ext/dev.js"),steal.clone=O,module.exports=e.steal}("undefined"==typeof window?"undefined"==typeof global?this:global:window); \ No newline at end of file +!function(__global){function __eval(__source,__global,__load){try{eval('(function() { var __moduleName = "'+(__load.name||"").replace('"','"')+'"; '+__source+" \n }).call(__global);")}catch(e){throw"SyntaxError"!=e.name&&"TypeError"!=e.name||(e.message="Evaluating "+(__load.name||load.address)+"\n\t"+e.message),e}}var isWorker="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,isBrowser="undefined"!=typeof window&&!isWorker;__global.$__Object$getPrototypeOf=Object.getPrototypeOf||function(e){return e.__proto__};var $__Object$defineProperty;!function(){try{Object.defineProperty({},"a",{})&&($__Object$defineProperty=Object.defineProperty)}catch(e){$__Object$defineProperty=function(e,t,n){try{e[t]=n.value||n.get.call(e)}catch(e){}}}}(),__global.$__Object$create=Object.create||function(e,t){function n(){}if(n.prototype=e,"object"==typeof t)for(prop in t)t.hasOwnProperty(prop)&&(n[prop]=t[prop]);return new n},function(){function e(e){return{status:"loading",name:e,linkSets:[],dependencies:[],metadata:{}}}function t(e,t,n){return new D(u({step:n.address?"fetch":"locate",loader:e,moduleName:t,moduleMetadata:n&&n.metadata||{},moduleSource:n.source,moduleAddress:n.address}))}function n(t,n,a,o){return new D(function(e,r){e(t.loaderObj.normalize(n,a,o))}).then(function(e){return D.resolve(t.loaderObj.notifyLoad(n,e,a)).then(function(){return e})}).then(function(n){var o;if(t.modules[n])return o=e(n),o.status="linked",o.module=t.modules[n],o;for(var i=0,s=t.loads.length;i",t.isDeclarative=!0,e.loaderObj.transpile(t).then(function(e){var n=__global.System,r=n.register;n.register=function(e,n,r){var a=r,o=n;"string"!=typeof e&&(a=o,o=e),t.declare=a,t.depsList=o},__eval(e,__global,t),n.register=r});if("object"==typeof n)return e.loaderObj.transpileAllFormats&&!1!==t.metadata.shouldTranspile&&o(t.metadata.format)?e.loaderObj.transpile(t).then(r):r();throw TypeError("Invalid instantiate return value")}}).then(function(){if("loading"==t.status&&!i()){t.dependencies=[];for(var r=t.depsList,a=[],o=0,s=r.length;o0)){var n=e.startingLoad;if(!1===e.loader.loaderObj.execute){for(var r=[].concat(e.loads),a=0,o=r.length;a=0;i--){for(var s=r[i],l=0;l");r.address=n&&n.address;var a=d(this._loader,r),o=D.resolve(t),s=this._loader,l=a.done.then(function(){return _(s,r)});return i(s,r,o),l},newModule:function(e){if("object"!=typeof e)throw new TypeError("Expected object");var t,n=new P;if(Object.getOwnPropertyNames&&null!=e)t=Object.getOwnPropertyNames(e);else{t=[];for(var r in e)t.push(r)}for(var a=0;a=6?(delete r.optional,delete r.whitelist,delete r.blacklist,r.presets=u(r.presets,n),r.plugins=l(r.plugins)):(r.modules="system",r.blacklist||(r.blacklist=["react"])),r}function p(e){var t=e.types;return{visitor:{Program:function(e,n){e.unshiftContainer("body",[t.exportNamedDeclaration(null,[t.exportSpecifier(t.identifier("true"),t.identifier("__esModule"))])])}}}}function m(e){return e.metadata.importSpecifiers=Object.create(null),e.metadata.importNames=Object.create(null),e.metadata.exportNames=Object.create(null),{visitor:{ImportDeclaration:function(t,n){var r=t.node,a=r.source.value,o=r.source.loc;e.metadata.importSpecifiers[a]=o;var i=e.metadata.importNames[a];i||(i=e.metadata.importNames[a]=[]),i.push.apply(i,(r.specifiers||[]).map(function(e){return"ImportDefaultSpecifier"===e.type?"default":e.imported&&e.imported.name}))},ExportDeclaration:function(t,n){var r=t.node;if(r.source){var a=r.source.value,o=e.metadata.exportNames[a];"ExportNamedDeclaration"===r.type?(o||(o=e.metadata.exportNames[a]=new Map),r.specifiers.forEach(function(e){o.set(e.exported.name,e.local.name)})):"ExportAllDeclaration"===r.type&&(e.metadata.exportNames[a]=1)}}}}}function h(e,t){var n=this,r=t.Babel||t.babel||t,a=c(r),o=f.call(n,e,r);return Promise.all([b.call(this,r,o),x.call(this,r,o)]).then(function(t){a>=6&&(o.plugins=[m.bind(null,e),p].concat(t[0]),o.presets=t[1]);try{return r.transform(e.source,o).code+"\n//# sourceURL="+e.address+"!eval"}catch(t){if(t instanceof SyntaxError){var i=new SyntaxError(t.message),s=new n.StackTrace(t.message,[n.StackTrace.item("",e.address,t.loc.line,t.loc.column)]);return i.stack=s.toString(),Promise.reject(i)}return Promise.reject(t)}})}var v=__global,g="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process);e.prototype.transpiler="babel",e.prototype.transpile=function(e){var n=this;return n.transpilerHasRun||(v.traceur&&!n.has("traceur")&&n.set("traceur",t(n,"traceur")),v.Babel&&!n.has("babel")&&n.set("babel",t(n,"Babel")),n.transpilerHasRun=!0),n.import(n.transpiler).then(function(t){var a=t;return a.__useDefault&&(a=a.default),(a.Compiler?r:h).call(n,e,a)}).then(function(t){return'var __moduleAddress = "'+e.address+'";'+t})},e.prototype.instantiate=function(e){var r=this;return Promise.resolve(r.normalize(r.transpiler)).then(function(a){if(e.name===a)return{deps:[],execute:function(){var a=v.System,o=v.Reflect.Loader;return __eval("(function(require,exports,module){"+e.source+"})();",v,e),v.System=a,v.Reflect.Loader=o,t(r,n(e.name))}}})};var b=function(){function e(e,r){var a=[];return(r||[]).forEach(function(r){var o=i(r);if(!s(r)||t(e,o))a.push(r);else if(!t(e,o)){var l=this.configMain||"package.json!npm",u=n(o);a.push(this.import(u,{name:l,metadata:{shouldTranspile:!1}}).then(function(e){var t=e.__esModule?e.default:e;return"string"==typeof r?t:[t,r[1]]}))}},this),Promise.all(a)}function t(e,t){var n=/^(?:babel-plugin-)/;return!!(e.availablePlugins||{})[n.test(t)?t.replace("babel-plugin-",""):t]}function n(e){var t=/^(?:babel-plugin-)/;return/\//.test(e)||t.test(e)?e:"babel-plugin-"+e}return function(t,n){var r=o.call(this),a=n.env||{},i=[e.call(this,t,n.plugins)];for(var s in a)if(r===s){var l=a[s].plugins||[];i.push(e.call(this,t,l))}return Promise.all(i).then(function(e){var t=[];return e.forEach(function(e){t=t.concat(e)}),t})}}(),y="es2015-no-commonjs",x=function(){function e(e,r){var a=[];return(r||[]).forEach(function(r){var o=i(r);if(!s(r)||t(e,o))a.push(r);else if(!t(e,o)){var l=this.configMain||"package.json!npm",u=n(o);a.push(this.import(u,{name:l,metadata:{shouldTranspile:!1}}).then(function(e){var t=e.__esModule?e.default:e;return"string"==typeof r?t:[t,r[1]]}))}},this),Promise.all(a)}function t(e,t){var n=/^(?:babel-preset-)/;return!!(e.availablePresets||{})[n.test(t)?t.replace("babel-preset-",""):t]}function n(e){var t=/^(?:babel-preset-)/;return/\//.test(e)||t.test(e)?e:"babel-preset-"+e}return function(t,n){var r=o.call(this),a=n.env||{},i=[e.call(this,t,n.presets)];for(var s in a)if(r===s){var l=a[s].presets||[];i.push(e.call(this,t,l))}return Promise.all(i).then(function(e){var t=[];return e.forEach(function(e){t=t.concat(e)}),t})}}();e.prototype._getImportSpecifierPositionsPlugin=m}(__global.LoaderPolyfill),function(){function e(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function t(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}function n(n,r){var a=r,i=n;return s.test(r)?"http:"+r:(o&&(a=a.replace(/\\/g,"/")),a=e(a||""),i=e(i||""),a&&i?(a.protocol||i.protocol)+(a.protocol||a.authority?a.authority:i.authority)+t(a.protocol||a.authority||"/"===a.pathname.charAt(0)?a.pathname:a.pathname?(i.authority&&!i.pathname?"/":"")+i.pathname.slice(0,i.pathname.lastIndexOf("/")+1)+a.pathname:i.pathname)+(a.protocol||a.authority||a.pathname?a.search:a.search||i.search)+a.hash:null)}function r(e,t,n){if(void 0===n.getDependants)return i.resolve();var r=n.getDependants(t.name);if(Array.isArray(r)&&r.length){var a=n.StackTrace,o=n.isEnv("production");return i.resolve().then(function(){return o?i.resolve():n.import("@@babel-code-frame")}).then(function(i){var s=n.getModuleLoad(r[0]),l=n.getImportSpecifier(t.name,s)||{line:1,column:0},u="The module ["+n.prettyName(t)+"] couldn't be fetched.\nClicking the link in the stack trace below takes you to the import.\nSee https://stealjs.com/docs/StealJS.error-messages.html#404-not-found for more information.\n",d=e.message+"\n"+u;o||(d+="\n"+i(s.metadata.originalSource||s.source,l.line,l.column)+"\n"),e.message=d;var c=new a(d,[a.item(null,s.address,l.line,l.column)]);e.stack=c.toString()})}return i.resolve()}var a,o="undefined"!=typeof process&&!!process.platform.match(/^win/),i=__global.Promise||require("when/es6-shim/Promise"),s=/^\/\//;if("undefined"!=typeof XMLHttpRequest)a=function(e,t,n){function r(){t(o.responseText)}function a(){var t=o.status,r=t+" "+o.statusText+": "+e+"\n"||"XHR error",a=new Error(r);a.url=e,a.statusCode=t,n(a)}var o=new XMLHttpRequest,i=!0,s=!1;if(!("withCredentials"in o)){var l=/^(\w+:)?\/\/([^\/]+)/.exec(e);l&&(i=l[2]===window.location.host,l[1]&&(i&=l[1]===window.location.protocol))}i||"undefined"==typeof XDomainRequest||((o=new XDomainRequest).onload=r,o.onerror=a,o.ontimeout=a,o.onprogress=function(){},o.timeout=0,s=!0),o.onreadystatechange=function(){4===o.readyState&&(200===o.status||0==o.status&&o.responseText?r():a())},o.open("GET",e,!0),s&&setTimeout(function(){o.send()},0),o.send(null)};else if("undefined"!=typeof require){var l,u,d,c=/ENOENT/;a=function(e,t,n){if("file:"===e.substr(0,5)){l=l||require("fs");var r=e.substr(5);return o&&(r=r.replace(/\//g,"\\")),l.readFile(r,function(r,a){if(r)return c.test(r.message)&&(r.statusCode=404,r.url=e),n(r);t(a+"")})}if("http"===e.substr(0,4)){return("https:"===e.substr(0,6)?d=d||require("https"):u=u||require("http")).get(e,function(e){if(200!==e.statusCode)n(new Error("Request failed. Status: "+e.statusCode));else{var r="";e.setEncoding("utf8"),e.on("data",function(e){r+=e}),e.on("end",function(){t(r)})}})}}}else{if("function"!=typeof fetch)throw new TypeError("No environment fetch API available.");a=function(e,t,n){fetch(e).then(function(e){return e.text()}).then(function(e){t(e)}).then(null,function(e){n(e)})}}var f=new(function(e){function t(t){if(e.call(this,t||{}),"undefined"!=typeof location&&location.href){var n=__global.location.href.split("#")[0].split("?")[0];this.baseURL=n.substring(0,n.lastIndexOf("/")+1)}else{if("undefined"==typeof process||!process.cwd)throw new TypeError("No environment baseURL");this.baseURL="file:"+process.cwd()+"/",o&&(this.baseURL=this.baseURL.replace(/\\/g,"/"))}this.paths={"*":"*.js"}}return t.__proto__=null!==e?e:Function.prototype,t.prototype=$__Object$create(null!==e?e.prototype:null),$__Object$defineProperty(t.prototype,"constructor",{value:t}),$__Object$defineProperty(t.prototype,"global",{get:function(){return isBrowser?window:isWorker?self:__global},enumerable:!1}),$__Object$defineProperty(t.prototype,"strict",{get:function(){return!0},enumerable:!1}),$__Object$defineProperty(t.prototype,"normalize",{value:function(e,t,n){if("string"!=typeof e)throw new TypeError("Module name must be a string");var r=e.split("/");if(0==r.length)throw new TypeError("No module name provided");var a=0,o=!1,i=0;if("."==r[0]){if(++a==r.length)throw new TypeError('Illegal module name "'+e+'"');o=!0}else{for(;".."==r[a];)if(++a==r.length)throw new TypeError('Illegal module name "'+e+'"');a&&(o=!0),i=a}if(!o)return e;var s=[],l=(t||"").split("/");l.length;return s=s.concat(l.splice(0,l.length-1-i)),(s=s.concat(r.splice(a,r.length-a))).join("/")},enumerable:!1,writable:!0}),$__Object$defineProperty(t.prototype,"locate",{value:function(e){var t,r=e.name,a="";for(var o in this.paths){var i=o.split("*");if(i.length>2)throw new TypeError("Only one wildcard in a path is permitted");if(1==i.length){if(r==o&&o.length>a.length){a=o;break}}else r.substr(0,i[0].length)==i[0]&&r.substr(r.length-i[1].length)==i[1]&&(a=o,t=r.substr(i[0].length,r.length-i[1].length-i[0].length))}var s=this.paths[a];return t&&(s=s.replace("*",t)),isBrowser&&(s=s.replace(/#/g,"%23")),n(this.baseURL,s)},enumerable:!1,writable:!0}),$__Object$defineProperty(t.prototype,"fetch",{value:function(e){var t=this;return new i(function(o,i){a(n(t.baseURL,e.address),function(e){o(e)},function(n){var a=i.bind(null,n);r(n,e,t).then(a,a)})})},enumerable:!1,writable:!0}),t}(__global.LoaderPolyfill));"object"==typeof exports&&(module.exports=f),__global.System=f}()}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:global),function(e){e.upgradeSystemLoader=function(){function t(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function r(e,n){var r=e,a=n;return x&&(a=a.replace(/\\/g,"/")),a=t(a||""),r=t(r||""),a&&r?(a.protocol||r.protocol)+(a.protocol||a.authority?a.authority:r.authority)+function(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}(a.protocol||a.authority||"/"===a.pathname.charAt(0)?a.pathname:a.pathname?(r.authority&&!r.pathname?"/":"")+r.pathname.slice(0,r.pathname.lastIndexOf("/")+1)+a.pathname:r.pathname)+(a.protocol||a.authority||a.pathname?a.search:a.search||r.search)+a.hash:null}function a(t){var n={};if(("object"==typeof t||"function"==typeof t)&&t!==e)if(_)for(var r in t)"default"!==r&&o(n,t,r);else i(n,t);return n.default=t,w(n,"__useDefault",{value:!0}),n}function o(e,t,n){try{var r;(r=Object.getOwnPropertyDescriptor(t,n))&&w(e,n,r)}catch(r){return e[n]=t[n],!1}}function i(e,t,n){var r=t&&t.hasOwnProperty;for(var a in t)r&&!t.hasOwnProperty(a)||n&&a in e||(e[a]=t[a]);return e}function s(e){function t(e,t){t._extensions=[];for(var n=0,r=e.length;n=0;o--){for(var i=r[o],s=0;st.index)return!0;return!1}a.lastIndex=o.lastIndex=i.lastIndex=0;var n,r=[],s={},l=[],u=[];if(e.length/e.split("\n").length<200){for(;n=i.exec(e);)l.push([n.index,n.index+n[0].length]);for(;n=o.exec(e);)t(l,n)||u.push([n.index,n.index+n[0].length])}for(;n=a.exec(e);)if(!t(l,n)&&!t(u,n)){var d=n[1].substr(1,n[1].length-2);if(d.match(/"|'/))continue;r.push(d),s[d]=n.index}return{deps:r,info:s}}function n(e,t){var n=this;return function(r){var a=t[r];return n._getLineAndColumnFromPosition(e.source,a)}}e._extensions.push(f),e._determineFormat=Function.prototype;var r=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF.])(exports\s*(\[['"]|\.)|module(\.exports|\['exports'\]|\["exports"\])\s*(\[['"]|[=,\.])|Object.defineProperty\(\s*module\s*,\s*(?:'|")exports(?:'|"))/,a=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF."'])require\s*\(\s*("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')\s*\)/g,o=/(^|[^\\])(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,i=/("[^"\\\n\r]*(\\.[^"\\\n\r]*)*"|'[^'\\\n\r]*(\\.[^'\\\n\r]*)*')/g,s=e.instantiate;e.instantiate=function(o){if(o.metadata.format||(r.lastIndex=0,a.lastIndex=0,(a.exec(o.source)||r.exec(o.source))&&(o.metadata.format="cjs",this._determineFormat(o))),"cjs"==o.metadata.format){var i=t(o.source);o.metadata.deps=o.metadata.deps?o.metadata.deps.concat(i.deps):i.deps,o.metadata.getImportPosition=n.call(this,o,i.info),o.metadata.executingRequire=!0,o.metadata.execute=function(t,n,r){var a=(o.address||"").split("/");a.pop(),a=a.join("/"),b._nodeRequire&&(a=a.substr(5));e.global._g={global:e.global,exports:n,module:r,require:t,__filename:b._nodeRequire?o.address.substr(5):o.address,__dirname:a};var i=e.global.define;e.global.define=void 0;var s={name:o.name,source:"(function() {\n(function(global, exports, module, require, __filename, __dirname){\n"+o.source+"\n}).call(_g.exports, _g.global, _g.exports, _g.module, _g.require, _g.__filename, _g.__dirname);})();",address:o.address};try{e.__exec(s)}catch(t){throw e.StackTrace&&(e.StackTrace.parse(t)||(t.stack=new e.StackTrace(t.message,[e.StackTrace.item("",o.address,1,0)]).toString())),t}e.global.define=i,e.global._g=void 0}}return s.call(this,o)}}function p(e){function t(e,t){var n=[],r=(e.match(f)[1].split(",")[t]||"require").replace(m,""),a=h[r]||(h[r]=new RegExp("/\\*|//|\"|'|`|(?:^|\\breturn\\b|[([=,;:?><&|^*%~+-])\\s*(?=/)|\\b"+r+"(?=\\s*\\()","g"));a.lastIndex=0,v[r]=v.require;for(var o,i,s,l;o=a.exec(e);)if(i=o[0],(s=v[i])||(s=v[i="/regexp/"]),s.lastIndex=a.lastIndex,(l=s.exec(e))&&l.index===a.lastIndex){a.lastIndex=s.lastIndex;var u=o.index-1;u>-1&&"."===e.charAt(u)||s!==v.require||l[2]&&n.push(l[2])}return n}function n(e,t,r,a){var o=this;if("object"==typeof e&&!(e instanceof Array))return n.apply(null,Array.prototype.splice.call(arguments,1,arguments.length-1));if(!(e instanceof Array)){if("string"==typeof e){var i=o.get(e);return i.__useDefault?i.default:i}throw new TypeError("Invalid require")}Promise.all(e.map(function(e){return o.import(e,a)})).then(function(e){t&&t.apply(null,e)},r)}function r(e,t,r){return function(a,o,i){return"string"==typeof a?t(a):n.call(r,a,o,i,{name:e})}}function a(e){function n(n,a,o){var i=n,s=a,l=o,u=!1;"string"!=typeof i&&(l=s,s=i,i=null),s instanceof Array||(l=s,s=["require","exports","module"]),"function"!=typeof l&&(l=function(e){return function(){return e}}(l)),void 0===s[s.length-1]&&s.pop();var d,f,p;if(-1!=(d=y.call(s,"require"))){s.splice(d,1);var m=l.toString();s=s.concat(t(m,d))}-1!=(f=y.call(s,"exports"))&&(s.splice(f,1),m||(m=l.toString(),u=g.test(m))),-1!=(p=y.call(s,"module"))&&s.splice(p,1);var h={deps:s,execute:function(t,n,a){for(var o=[],i=0;i=0;a--)e.source=e.source.substr(0,r[a].start)+r[a].postLocate(t[a])+e.source.substr(r[a].end,e.source.length);return o.call(n,e)})}}),v(function(e){e._contextualModules={},e.setContextual=function(e,t){this._contextualModules[e]=t};var t=e.normalize;e.normalize=function(e,n){var r=this,a=r.pluginLoader||r;if(n){var o=this._contextualModules[e];if(o){var i=e+"/"+n;return r.has(i)?Promise.resolve(i):("string"==typeof o&&(o=a.import(o)),Promise.resolve(o).then(function(e){var t=e;return t.default&&(t=t.default),Promise.resolve(t.call(r,n))}).then(function(e){return r.set(i,r.newModule(e)),i}))}}return t.apply(this,arguments)}}),v(function(e){function t(){document.removeEventListener("DOMContentLoaded",t,!1),window.removeEventListener("load",t,!1),n()}function n(){for(var t=document.getElementsByTagName("script"),n=0;n0)return n;var i=o(t.map(r));if(i.length>0)return i;throw new Error("Unknown stack format: "+e)}function r(e){var t=e.match(l);if(!t)return null;var n=t[1]||"";return{method:n,fnName:n,url:t[2]||"",line:parseInt(t[3])||0,column:parseInt(t[4])||0}}function a(e){var t=e.match(u)||e.match(d);if(!t)return null;var n=t[3].match(c);if(!n)return null;var r=t[2]||"";return t[1]&&(r="eval at "+r),{method:r,fnName:r,url:n[1]||"",line:parseInt(n[2])||0,column:parseInt(n[3])||0}}function o(e){var t=[];return e.forEach(function(e){e&&t.push(e)}),t}function i(e){var t=/at position ([0-9]+)/.exec(e);if(t&&t.length>1)return Number(t[1])}function s(e,t){for(var n=0;nt.index)return!0;return!1}function n(e){for(;a=e.exec(r);)if(!t(i,a)){var n=a[1];o.push(n)}}var r=e.replace(d,"");l.lastIndex=d.lastIndex=u.lastIndex=c.lastIndex=0;var a,o=[],i=[];if(e.length/e.split("\n").length<200)for(;a=c.exec(r);)i.push([a.index,a.index+a[0].length]);return n(l),n(u),o}e._traceData={loads:{},parentMap:{}},e.getDependencies=function(e){var t=this.getModuleLoad(e);return t?t.metadata.dependencies:void 0},e.getDependants=function(e){var n=[];return t(this._traceData.parentMap[e]||{},function(e){n.push(e)}),n},e.getModuleLoad=function(e){return this._traceData.loads[e]},e.getBundles=function(e,n){var r=n||{};r[e]=!0;var a=this,o=a._traceData.parentMap[e];if(!o)return[e];var i=[];return t(o,function(e,t){r[e]||(i=i.concat(a.getBundles(e,r)))}),i},e.getImportSpecifier=function(e,t){for(var n,r=0;r-1||o.indexOf("steal-with-promises.production")>-1&&!n.env)&&this.config({env:s+"-production"}),(this.isEnv("production")||this.loadBundles)&&$.call(this),q.stealPath.set.call(this,i,n)}},devBundle:{order:16,set:function(e,t){var n=!0===e?"dev-bundle":e;n&&(this.devBundle=n)}},depsBundle:{order:17,set:function(e,t){var n=!0===e?"dev-bundle":e;n&&(this.depsBundle=n)}}};r(q,function(e,t){e.order?A.splice(e.order,0,t):A.push(t)}),function(e,t,n){var a=e.config;e.config=function(o){var s=i({},o);r(t,function(t){var r=n[t];if(r.set&&s[t]){var a=r.set.call(e,s[t],o);void 0!==a&&(e[t]=a),delete s[t]}}),a.call(this,s)}}(e,A,q),M.config=function(e){if("string"==typeof e)return this.loader[e];this.loader.config(e)},v(function(e){e.getEnv=function(){return(this.env||"").split("-")[1]||this.env},e.getPlatform=function(){var e=(this.env||"").split("-");return 2===e.length?e[0]:void 0},e.isEnv=function(e){return this.getEnv()===e},e.isPlatform=function(e){return this.getPlatform()===e}});var U=function(e){var t={},r=/Url$/,a=e.split("?"),o=a.shift(),i=a.join("?").split("&"),s=o.split("/");s.pop(),s.join("/");if(i.length&&i[0].length)for(var l,u=0;u1){var c=n(d[0]);t[c=c.replace(r,"URL")]=d.slice(1).join("=")}}return t},B=function(e){var t={},a=/Url$/;t.stealURL=e.src,r(e.attributes,function(e){var r=e.nodeName||e.name,o=n(0===r.indexOf("data-")?r.replace("data-",""):r);o=o.replace(a,"URL"),t[o]=""===e.value||e.value});var o=e.innerHTML;/\S/.test(o)&&(t.mainSource=o);var s=i(U(e.src),t);return s.main&&("boolean"==typeof s.main&&delete s.main,s.loadMainOnStartup=!0),s},G=function(){var e=this;return new Promise(function(t,n){if(!m)return y?(e.script=_||x(),void t(B(e.script))):void t({loadMainOnStartup:!0,stealPath:__dirname});t(i({loadMainOnStartup:!0,stealURL:location.href},U(location.href)))})};return M.startup=function(e){var t,n,r=this,o=this.loader;return g=new Promise(function(e,r){t=e,n=r}),O=G.call(this).then(function(s){function l(e){if(404===e.statusCode&&r.script){var t="This page has "+((o.devBundle?"dev-":"deps-")+"bundle")+" enabled but "+e.url+" could not be retrieved.\nDid you forget to generate the bundle first?\nSee https://stealjs.com/docs/StealJS.development-bundles.html for more information.",n=new Error(t);return n.stack=null,Promise.reject(n)}return Promise.reject(e)}var u;return u="object"==typeof e?i(e,s):s,o.config(u),F.call(o),o.loadBundles?(o.main||!o.isEnv("production")||o.stealBundled||w("Attribute 'main' is required in production environment. Please add it to the script tag."),o.import(o.configMain).then(t,n),g.then(function(e){return F.call(o),o._configLoaded=!0,o.main&&u.loadMainOnStartup?o.import(o.main):e})):(o.import(o.devBundle).then(function(){return o.import(o.configMain)},l).then(function(){return o.import(o.depsBundle).then(null,l)}).then(t,n),(j=g.then(function(){return F.call(o),C.call(o),o._configLoaded=!0,u&&o.config(u),o.import("@dev")})).then(function(){if(!o.main||o.localLoader)return g;if(u.loadMainOnStartup){var e=o.main;return"string"==typeof e&&(e=[e]),Promise.all(a(e,function(e){return o.import(e)}))}o._warnNoMain(r._mainWarnMs||2e3)}))}).then(function(e){return o.mainSource?o.module(o.mainSource):(o.loadScriptModules(),e)})},M.done=function(){return O},M.import=function(){var e=arguments,t=this.System;return g||(t.main||(t.main="@empty"),M.startup()),g.then(function(){var n=[];return r(e,function(e){n.push(t.import(e))}),n.length>1?Promise.all(n):n[0]})},M.setContextual=f.call(e.setContextual,e),M.isEnv=f.call(e.isEnv,e),M.isPlatform=f.call(e.isPlatform,e),M};if(!b||v||g){var P=e.steal;e.steal=M(System),e.steal.startup(P&&"object"==typeof P&&P).then(null,function(e){if("undefined"!=typeof console){var t=console;"function"==typeof e.logError?e.logError(t):t[t.error?"error":"log"](e)}}),e.steal.clone=O}else e.steal=M(System),e.steal.System=System,e.steal.dev=require("./ext/dev.js"),steal.clone=O,module.exports=e.steal}("undefined"==typeof window?"undefined"==typeof global?this:global:window); \ No newline at end of file diff --git a/test/ext-steal-clone/relative-import/main.js b/test/ext-steal-clone/relative-import/main.js index 7529e507d..188ac406b 100644 --- a/test/ext-steal-clone/relative-import/main.js +++ b/test/ext-steal-clone/relative-import/main.js @@ -1,6 +1,6 @@ var stealClone = require('steal-clone'); -return stealClone() +stealClone() .import('ext-steal-clone/relative-import/moduleA') .then(function(moduleA) { if (typeof window !== "undefined" && window.assert) { diff --git a/test/ext-steal-clone/relative-override/main.js b/test/ext-steal-clone/relative-override/main.js index 68c8d1b18..09e58dfca 100644 --- a/test/ext-steal-clone/relative-override/main.js +++ b/test/ext-steal-clone/relative-override/main.js @@ -1,6 +1,6 @@ var stealClone = require('steal-clone'); -return stealClone({ +stealClone({ './moduleB': { getName: function() { return 'mockModuleB'; diff --git a/test/load-bundles/dev.js b/test/load-bundles/dev.js index 44b0dad9f..9ca102d24 100644 --- a/test/load-bundles/dev.js +++ b/test/load-bundles/dev.js @@ -4,7 +4,6 @@ module.exports = {}; if(typeof window !== "undefined" && window.assert) { assert.ok(true, "Dev loaded fine"); done(); - return {}; } else { console.log("works!"); } diff --git a/test/main-warn/test.html b/test/main-warn/test.html index 713eaf394..960a84b50 100644 --- a/test/main-warn/test.html +++ b/test/main-warn/test.html @@ -40,6 +40,9 @@ newEl.textContent = warnings.length ? warnings.join("\n") : "Success!"; iframe.contentWindow.document.body.appendChild(newEl); if(window.assert) { + if(!success) { + debugger; + } window.assert.ok(success, title + " did what it should"); if(remaining === 0) { diff --git a/test/parse_errors/dev.html b/test/parse_errors/dev.html index 3f74daa04..ea347c278 100644 --- a/test/parse_errors/dev.html +++ b/test/parse_errors/dev.html @@ -8,6 +8,10 @@