{"version":3,"file":"vendor.aurelia.cbeb19fd4566a354b1ce.bundle.js","mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://SpotOnDays.WebClient/./node_modules/aurelia-bootstrapper/dist/native-modules/aurelia-bootstrapper.js","webpack://SpotOnDays.WebClient/./node_modules/aurelia-framework/dist/native-modules/aurelia-framework.js"],"sourcesContent":["import 'aurelia-polyfills';\nimport { PLATFORM, isInitialized } from 'aurelia-pal';\n\nvar bootstrapPromises = [];\r\nvar startResolve;\r\nvar startPromise = new Promise(function (resolve) { return startResolve = resolve; });\r\nvar host = PLATFORM.global;\r\nvar isNodeLike = typeof process !== 'undefined' && !process.browser && process.version;\r\nfunction ready() {\r\n if (!host.document || host.document.readyState === 'complete') {\r\n return Promise.resolve();\r\n }\r\n return new Promise(function (resolve) {\r\n host.document.addEventListener('DOMContentLoaded', completed);\r\n host.addEventListener('load', completed);\r\n function completed() {\r\n host.document.removeEventListener('DOMContentLoaded', completed);\r\n host.removeEventListener('load', completed);\r\n resolve();\r\n }\r\n });\r\n}\r\nfunction createLoader() {\r\n if (PLATFORM.Loader) {\r\n return Promise.resolve(new PLATFORM.Loader());\r\n }\r\n if (typeof AURELIA_WEBPACK_2_0 === 'undefined') {\r\n if (typeof __webpack_require__ !== 'undefined') {\r\n var m = __webpack_require__(require.resolve('aurelia-loader-webpack'));\r\n return Promise.resolve(new m.WebpackLoader());\r\n }\r\n if (host.System && typeof host.System.config === 'function') {\r\n return host.System.normalize('aurelia-bootstrapper').then(function (bsn) {\r\n return host.System.normalize('aurelia-loader-default', bsn);\r\n }).then(function (loaderName) {\r\n return host.System.import(loaderName).then(function (m) { return new m.DefaultLoader(); });\r\n });\r\n }\r\n if (typeof host.require === 'function' && typeof host.define === 'function' && typeof host.define.amd === 'object') {\r\n return new Promise(function (resolve, reject) { return host.require(['aurelia-loader-default'], function (m) { return resolve(new m.DefaultLoader()); }, reject); });\r\n }\r\n if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') {\r\n var m = module.require('aurelia-loader-nodejs');\r\n return Promise.resolve(new m.NodeJsLoader());\r\n }\r\n }\r\n return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.');\r\n}\r\nfunction initializePal(loader) {\r\n if (isInitialized)\r\n return Promise.resolve();\r\n var type;\r\n var isRenderer = isNodeLike && (process.type === 'renderer' || process.versions['node-webkit']);\r\n if (isNodeLike && !isRenderer) {\r\n type = 'nodejs';\r\n }\r\n else if (typeof window !== 'undefined') {\r\n type = 'browser';\r\n }\r\n else if (typeof self !== 'undefined') {\r\n type = 'worker';\r\n }\r\n else {\r\n throw new Error('Could not determine platform implementation to load.');\r\n }\r\n return loader.loadModule('aurelia-pal-' + type)\r\n .then(function (palModule) { return type === 'nodejs' && !isInitialized && palModule.globalize() || palModule.initialize(); });\r\n}\r\nfunction preparePlatform(loader) {\r\n var map = function (moduleId, relativeTo) {\r\n return loader.normalize(moduleId, relativeTo)\r\n .then(function (normalized) {\r\n loader.map(moduleId, normalized);\r\n return normalized;\r\n });\r\n };\r\n return initializePal(loader)\r\n .then(function () { return loader.normalize('aurelia-bootstrapper'); })\r\n .then(function (bootstrapperName) {\r\n var frameworkPromise = map(PLATFORM.moduleName('aurelia-framework', { exports: ['Aurelia'] }), bootstrapperName);\r\n return Promise.all([\r\n frameworkPromise,\r\n frameworkPromise.then(function (frameworkName) { return map('aurelia-dependency-injection', frameworkName); }),\r\n map('aurelia-router', bootstrapperName),\r\n map('aurelia-logging-console', bootstrapperName)\r\n ]);\r\n })\r\n .then(function (_a) {\r\n var frameworkName = _a[0];\r\n return loader.loadModule(frameworkName);\r\n })\r\n .then(function (fx) { return startResolve(function () { return new fx.Aurelia(loader); }); });\r\n}\r\nfunction config(appHost, configModuleId, aurelia) {\r\n aurelia.host = appHost;\r\n aurelia.configModuleId = configModuleId || null;\r\n if (configModuleId) {\r\n return aurelia.loader\r\n .loadModule(configModuleId)\r\n .then(function (customConfig) {\r\n if (!customConfig.configure) {\r\n throw new Error(\"Cannot initialize module '\".concat(configModuleId, \"' without a configure function.\"));\r\n }\r\n return customConfig.configure(aurelia);\r\n });\r\n }\r\n aurelia.use\r\n .standardConfiguration()\r\n .developmentLogging();\r\n return aurelia.start().then(function () { return aurelia.setRoot(); });\r\n}\r\nfunction run() {\r\n return ready()\r\n .then(createLoader)\r\n .then(preparePlatform)\r\n .then(function () {\r\n var appHosts = host.document.querySelectorAll('[aurelia-app],[data-aurelia-app]');\r\n for (var i = 0, ii = appHosts.length; i < ii; ++i) {\r\n var appHost = appHosts[i];\r\n var mainModuleId = appHost.getAttribute('aurelia-app') || appHost.getAttribute('data-aurelia-app');\r\n bootstrap(config.bind(null, appHost, mainModuleId));\r\n }\r\n var toConsole = console.error.bind(console);\r\n var bootstraps = bootstrapPromises.map(function (p) { return p.catch(toConsole); });\r\n bootstrapPromises = null;\r\n return Promise.all(bootstraps);\r\n });\r\n}\r\nfunction bootstrap(configure) {\r\n var p = startPromise.then(function (factory) { return configure(factory()); });\r\n if (bootstrapPromises)\r\n bootstrapPromises.push(p);\r\n return p;\r\n}\r\nvar starting = run();\n\nexport { bootstrap, starting };\n//# sourceMappingURL=aurelia-bootstrapper.js.map\n","import { Container } from 'aurelia-dependency-injection';\nexport * from 'aurelia-dependency-injection';\nexport * from 'aurelia-binding';\nexport * from 'aurelia-metadata';\nimport { HtmlBehaviorResource, ViewEngine, BindingLanguage, TemplatingEngine, CompositionTransaction, ViewSlot, ViewResources } from 'aurelia-templating';\nexport * from 'aurelia-templating';\nimport { Loader } from 'aurelia-loader';\nexport * from 'aurelia-loader';\nexport * from 'aurelia-task-queue';\nimport { join, relativeToFile } from 'aurelia-path';\nexport * from 'aurelia-path';\nimport { DOM, PLATFORM } from 'aurelia-pal';\nexport * from 'aurelia-pal';\nimport * as TheLogManager from 'aurelia-logging';\nexport { TheLogManager as LogManager };\n\nvar logger = TheLogManager.getLogger('aurelia');\r\nvar extPattern = /\\.[^/.]+$/;\r\nfunction runTasks(config, tasks) {\r\n var current;\r\n var next = function () {\r\n current = tasks.shift();\r\n if (current) {\r\n return Promise.resolve(current(config)).then(next);\r\n }\r\n return Promise.resolve();\r\n };\r\n return next();\r\n}\r\nfunction loadPlugin(fwConfig, loader, info) {\r\n logger.debug(\"Loading plugin \".concat(info.moduleId, \".\"));\r\n if (typeof info.moduleId === 'string') {\r\n fwConfig.resourcesRelativeTo = info.resourcesRelativeTo;\r\n var id = info.moduleId;\r\n if (info.resourcesRelativeTo.length > 1) {\r\n return loader.normalize(info.moduleId, info.resourcesRelativeTo[1])\r\n .then(function (normalizedId) { return _loadPlugin(normalizedId); });\r\n }\r\n return _loadPlugin(id);\r\n }\r\n else if (typeof info.configure === 'function') {\r\n if (fwConfig.configuredPlugins.indexOf(info.configure) !== -1) {\r\n return Promise.resolve();\r\n }\r\n fwConfig.configuredPlugins.push(info.configure);\r\n return Promise.resolve(info.configure.call(null, fwConfig, info.config || {}));\r\n }\r\n throw new Error(invalidConfigMsg(info.moduleId || info.configure, 'plugin'));\r\n function _loadPlugin(moduleId) {\r\n return loader.loadModule(moduleId).then(function (m) {\r\n if ('configure' in m) {\r\n if (fwConfig.configuredPlugins.indexOf(m.configure) !== -1) {\r\n return Promise.resolve();\r\n }\r\n return Promise.resolve(m.configure(fwConfig, info.config || {})).then(function () {\r\n fwConfig.configuredPlugins.push(m.configure);\r\n fwConfig.resourcesRelativeTo = null;\r\n logger.debug(\"Configured plugin \".concat(info.moduleId, \".\"));\r\n });\r\n }\r\n fwConfig.resourcesRelativeTo = null;\r\n logger.debug(\"Loaded plugin \".concat(info.moduleId, \".\"));\r\n });\r\n }\r\n}\r\nfunction loadResources(aurelia, resourcesToLoad, appResources) {\r\n if (Object.keys(resourcesToLoad).length === 0) {\r\n return Promise.resolve();\r\n }\r\n var viewEngine = aurelia.container.get(ViewEngine);\r\n return Promise.all(Object.keys(resourcesToLoad).map(function (n) { return _normalize(resourcesToLoad[n]); }))\r\n .then(function (loads) {\r\n var names = [];\r\n var importIds = [];\r\n loads.forEach(function (l) {\r\n names.push(undefined);\r\n importIds.push(l.importId);\r\n });\r\n return viewEngine.importViewResources(importIds, names, appResources);\r\n });\r\n function _normalize(load) {\r\n var moduleId = load.moduleId;\r\n var ext = getExt(moduleId);\r\n if (isOtherResource(moduleId)) {\r\n moduleId = removeExt(moduleId);\r\n }\r\n return aurelia.loader.normalize(moduleId, load.relativeTo)\r\n .then(function (normalized) {\r\n return {\r\n name: load.moduleId,\r\n importId: isOtherResource(load.moduleId) ? addOriginalExt(normalized, ext) : normalized\r\n };\r\n });\r\n }\r\n function isOtherResource(name) {\r\n var ext = getExt(name);\r\n if (!ext)\r\n return false;\r\n if (ext === '')\r\n return false;\r\n if (ext === '.js' || ext === '.ts')\r\n return false;\r\n return true;\r\n }\r\n function removeExt(name) {\r\n return name.replace(extPattern, '');\r\n }\r\n function addOriginalExt(normalized, ext) {\r\n return removeExt(normalized) + '.' + ext;\r\n }\r\n}\r\nfunction getExt(name) {\r\n var match = name.match(extPattern);\r\n if (match && match.length > 0) {\r\n return (match[0].split('.'))[1];\r\n }\r\n}\r\nfunction loadBehaviors(config) {\r\n return Promise.all(config.behaviorsToLoad.map(function (m) { return m.load(config.container, m.target); })).then(function () {\r\n config.behaviorsToLoad = null;\r\n });\r\n}\r\nfunction assertProcessed(plugins) {\r\n if (plugins.processed) {\r\n throw new Error('This config instance has already been applied. To load more plugins or global resources, create a new FrameworkConfiguration instance.');\r\n }\r\n}\r\nfunction invalidConfigMsg(cfg, type) {\r\n return \"Invalid \".concat(type, \" [\").concat(cfg, \"], \").concat(type, \" must be specified as functions or relative module IDs.\");\r\n}\r\nvar FrameworkConfiguration = (function () {\r\n function FrameworkConfiguration(aurelia) {\r\n var _this = this;\r\n this.aurelia = aurelia;\r\n this.container = aurelia.container;\r\n this.info = [];\r\n this.processed = false;\r\n this.preTasks = [];\r\n this.postTasks = [];\r\n this.behaviorsToLoad = [];\r\n this.configuredPlugins = [];\r\n this.resourcesToLoad = {};\r\n this.preTask(function () { return aurelia.loader.normalize('aurelia-bootstrapper', undefined)\r\n .then(function (name) { return _this.bootstrapperName = name; }); });\r\n this.postTask(function () { return loadResources(aurelia, _this.resourcesToLoad, aurelia.resources); });\r\n }\r\n FrameworkConfiguration.prototype.instance = function (type, instance) {\r\n this.container.registerInstance(type, instance);\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.singleton = function (type, implementation) {\r\n this.container.registerSingleton(type, implementation);\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.transient = function (type, implementation) {\r\n this.container.registerTransient(type, implementation);\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.preTask = function (task) {\r\n assertProcessed(this);\r\n this.preTasks.push(task);\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.postTask = function (task) {\r\n assertProcessed(this);\r\n this.postTasks.push(task);\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.feature = function (plugin, config) {\r\n if (config === void 0) { config = {}; }\r\n switch (typeof plugin) {\r\n case 'string':\r\n var hasIndex = /\\/index$/i.test(plugin);\r\n var moduleId = hasIndex || getExt(plugin) ? plugin : plugin + '/index';\r\n var root = hasIndex ? plugin.slice(0, -6) : plugin;\r\n this.info.push({ moduleId: moduleId, resourcesRelativeTo: [root, ''], config: config });\r\n break;\r\n case 'function':\r\n this.info.push({ configure: plugin, config: config || {} });\r\n break;\r\n default:\r\n throw new Error(invalidConfigMsg(plugin, 'feature'));\r\n }\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.globalResources = function (resources) {\r\n var _this = this;\r\n assertProcessed(this);\r\n var toAdd = Array.isArray(resources) ? resources : arguments;\r\n var resource;\r\n var resourcesRelativeTo = this.resourcesRelativeTo || ['', ''];\r\n for (var i = 0, ii = toAdd.length; i < ii; ++i) {\r\n resource = toAdd[i];\r\n switch (typeof resource) {\r\n case 'string':\r\n var parent_1 = resourcesRelativeTo[0];\r\n var grandParent = resourcesRelativeTo[1];\r\n var name_1 = resource;\r\n if ((resource.startsWith('./') || resource.startsWith('../')) && parent_1 !== '') {\r\n name_1 = join(parent_1, resource);\r\n }\r\n this.resourcesToLoad[name_1] = { moduleId: name_1, relativeTo: grandParent };\r\n break;\r\n case 'function':\r\n var meta = this.aurelia.resources.autoRegister(this.container, resource);\r\n if (meta instanceof HtmlBehaviorResource && meta.elementName !== null) {\r\n if (this.behaviorsToLoad.push(meta) === 1) {\r\n this.postTask(function () { return loadBehaviors(_this); });\r\n }\r\n }\r\n break;\r\n default:\r\n throw new Error(invalidConfigMsg(resource, 'resource'));\r\n }\r\n }\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.globalName = function (resourcePath, newName) {\r\n assertProcessed(this);\r\n this.resourcesToLoad[resourcePath] = { moduleId: newName, relativeTo: '' };\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.plugin = function (plugin, pluginConfig) {\r\n assertProcessed(this);\r\n var info;\r\n switch (typeof plugin) {\r\n case 'string':\r\n info = { moduleId: plugin, resourcesRelativeTo: [plugin, ''], config: pluginConfig || {} };\r\n break;\r\n case 'function':\r\n info = { configure: plugin, config: pluginConfig || {} };\r\n break;\r\n default:\r\n throw new Error(invalidConfigMsg(plugin, 'plugin'));\r\n }\r\n this.info.push(info);\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype._addNormalizedPlugin = function (name, config) {\r\n var _this = this;\r\n var plugin = { moduleId: name, resourcesRelativeTo: [name, ''], config: config || {} };\r\n this.info.push(plugin);\r\n this.preTask(function () {\r\n var relativeTo = [name, _this.bootstrapperName];\r\n plugin.moduleId = name;\r\n plugin.resourcesRelativeTo = relativeTo;\r\n return Promise.resolve();\r\n });\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.defaultBindingLanguage = function () {\r\n return this._addNormalizedPlugin('aurelia-templating-binding');\r\n };\r\n FrameworkConfiguration.prototype.router = function () {\r\n return this._addNormalizedPlugin('aurelia-templating-router');\r\n };\r\n FrameworkConfiguration.prototype.history = function () {\r\n return this._addNormalizedPlugin('aurelia-history-browser');\r\n };\r\n FrameworkConfiguration.prototype.defaultResources = function () {\r\n return this._addNormalizedPlugin('aurelia-templating-resources');\r\n };\r\n FrameworkConfiguration.prototype.eventAggregator = function () {\r\n return this._addNormalizedPlugin('aurelia-event-aggregator');\r\n };\r\n FrameworkConfiguration.prototype.basicConfiguration = function () {\r\n return this.defaultBindingLanguage().defaultResources().eventAggregator();\r\n };\r\n FrameworkConfiguration.prototype.standardConfiguration = function () {\r\n return this.basicConfiguration().history().router();\r\n };\r\n FrameworkConfiguration.prototype.developmentLogging = function (level) {\r\n var _this = this;\r\n var logLevel = level ? TheLogManager.logLevel[level] : undefined;\r\n if (logLevel === undefined) {\r\n logLevel = TheLogManager.logLevel.debug;\r\n }\r\n this.preTask(function () {\r\n return _this.aurelia.loader.normalize('aurelia-logging-console', _this.bootstrapperName).then(function (name) {\r\n return _this.aurelia.loader.loadModule(name).then(function (m) {\r\n TheLogManager.addAppender(new m.ConsoleAppender());\r\n TheLogManager.setLevel(logLevel);\r\n });\r\n });\r\n });\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.apply = function () {\r\n var _this = this;\r\n if (this.processed) {\r\n return Promise.resolve();\r\n }\r\n return runTasks(this, this.preTasks).then(function () {\r\n var loader = _this.aurelia.loader;\r\n var info = _this.info;\r\n var current;\r\n var next = function () {\r\n current = info.shift();\r\n if (current) {\r\n return loadPlugin(_this, loader, current).then(next);\r\n }\r\n _this.processed = true;\r\n _this.configuredPlugins = null;\r\n return Promise.resolve();\r\n };\r\n return next().then(function () { return runTasks(_this, _this.postTasks); });\r\n });\r\n };\r\n return FrameworkConfiguration;\r\n}());\n\nfunction preventActionlessFormSubmit() {\r\n DOM.addEventListener('submit', function (evt) {\r\n var target = evt.target;\r\n var action = target.action;\r\n if (target.tagName.toLowerCase() === 'form' && !action) {\r\n evt.preventDefault();\r\n }\r\n }, false);\r\n}\r\nvar Aurelia = (function () {\r\n function Aurelia(loader, container, resources) {\r\n this.loader = loader || new PLATFORM.Loader();\r\n this.container = container || (new Container()).makeGlobal();\r\n this.resources = resources || new ViewResources();\r\n this.use = new FrameworkConfiguration(this);\r\n this.logger = TheLogManager.getLogger('aurelia');\r\n this.hostConfigured = false;\r\n this.host = null;\r\n this.use.instance(Aurelia, this);\r\n this.use.instance(Loader, this.loader);\r\n this.use.instance(ViewResources, this.resources);\r\n }\r\n Aurelia.prototype.start = function () {\r\n var _this = this;\r\n if (this._started) {\r\n return this._started;\r\n }\r\n this.logger.info('Aurelia Starting');\r\n return this._started = this.use.apply().then(function () {\r\n preventActionlessFormSubmit();\r\n if (!_this.container.hasResolver(BindingLanguage)) {\r\n var message = 'You must configure Aurelia with a BindingLanguage implementation.';\r\n _this.logger.error(message);\r\n throw new Error(message);\r\n }\r\n _this.logger.info('Aurelia Started');\r\n var evt = DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true });\r\n DOM.dispatchEvent(evt);\r\n return _this;\r\n });\r\n };\r\n Aurelia.prototype.enhance = function (bindingContext, applicationHost) {\r\n var _this = this;\r\n if (bindingContext === void 0) { bindingContext = {}; }\r\n if (applicationHost === void 0) { applicationHost = null; }\r\n this._configureHost(applicationHost || DOM.querySelectorAll('body')[0]);\r\n return new Promise(function (resolve) {\r\n var engine = _this.container.get(TemplatingEngine);\r\n _this.root = engine.enhance({ container: _this.container, element: _this.host, resources: _this.resources, bindingContext: bindingContext });\r\n _this.root.attached();\r\n _this._onAureliaComposed();\r\n resolve(_this);\r\n });\r\n };\r\n Aurelia.prototype.setRoot = function (root, applicationHost) {\r\n var _this = this;\r\n if (root === void 0) { root = null; }\r\n if (applicationHost === void 0) { applicationHost = null; }\r\n var instruction = {};\r\n if (this.root && this.root.viewModel && this.root.viewModel.router) {\r\n this.root.viewModel.router.deactivate();\r\n this.root.viewModel.router.reset();\r\n }\r\n this._configureHost(applicationHost);\r\n var engine = this.container.get(TemplatingEngine);\r\n var transaction = this.container.get(CompositionTransaction);\r\n delete transaction.initialComposition;\r\n if (!root) {\r\n if (this.configModuleId) {\r\n root = relativeToFile('./app', this.configModuleId);\r\n }\r\n else {\r\n root = 'app';\r\n }\r\n }\r\n instruction.viewModel = root;\r\n instruction.container = instruction.childContainer = this.container;\r\n instruction.viewSlot = this.hostSlot;\r\n instruction.host = this.host;\r\n return engine.compose(instruction).then(function (r) {\r\n _this.root = r;\r\n instruction.viewSlot.attached();\r\n _this._onAureliaComposed();\r\n return _this;\r\n });\r\n };\r\n Aurelia.prototype._configureHost = function (applicationHost) {\r\n if (this.hostConfigured) {\r\n return;\r\n }\r\n applicationHost = applicationHost || this.host;\r\n if (!applicationHost || typeof applicationHost === 'string') {\r\n this.host = DOM.getElementById(applicationHost || 'applicationHost');\r\n }\r\n else {\r\n this.host = applicationHost;\r\n }\r\n if (!this.host) {\r\n throw new Error('No applicationHost was specified.');\r\n }\r\n this.hostConfigured = true;\r\n this.host.aurelia = this;\r\n this.hostSlot = new ViewSlot(this.host, true);\r\n this.hostSlot.transformChildNodesIntoView();\r\n this.container.registerInstance(DOM.boundary, this.host);\r\n };\r\n Aurelia.prototype._onAureliaComposed = function () {\r\n var evt = DOM.createCustomEvent('aurelia-composed', { bubbles: true, cancelable: true });\r\n setTimeout(function () { return DOM.dispatchEvent(evt); }, 1);\r\n };\r\n return Aurelia;\r\n}());\n\nexport { Aurelia, FrameworkConfiguration };\n//# sourceMappingURL=aurelia-framework.js.map\n"],"names":[],"sourceRoot":""}