ember-legacy-class-transform
Version:
The default blueprint for ember-cli addons.
1 lines • 391 kB
Source Map (JSON)
{"version":3,"sources":["license.js","loader.js","container.js","ember-babel.js","ember-console.js","ember-environment.js","ember-metal.js","rsvp.js","bootstrap"],"sourcesContent":["/*!\n * @overview Ember - JavaScript Application Framework\n * @copyright Copyright 2011-2017 Tilde Inc. and contributors\n * Portions Copyright 2006-2011 Strobe Inc.\n * Portions Copyright 2008-2011 Apple Inc. All rights reserved.\n * @license Licensed under MIT license\n * See https://raw.github.com/emberjs/ember.js/master/LICENSE\n * @version 2.15.0\n */\n","var enifed, requireModule, Ember;\nvar mainContext = this; // Used in ember-environment/lib/global.js\n\n(function() {\n var isNode = typeof window === 'undefined' &&\n typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';\n\n if (!isNode) {\n Ember = this.Ember = this.Ember || {};\n }\n\n if (typeof Ember === 'undefined') { Ember = {}; }\n\n if (typeof Ember.__loader === 'undefined') {\n var registry = {};\n var seen = {};\n\n enifed = function(name, deps, callback) {\n var value = { };\n\n if (!callback) {\n value.deps = [];\n value.callback = deps;\n } else {\n value.deps = deps;\n value.callback = callback;\n }\n\n registry[name] = value;\n };\n\n requireModule = function(name) {\n return internalRequire(name, null);\n };\n\n // setup `require` module\n requireModule['default'] = requireModule;\n\n requireModule.has = function registryHas(moduleName) {\n return !!registry[moduleName] || !!registry[moduleName + '/index'];\n };\n\n function missingModule(name, referrerName) {\n if (referrerName) {\n throw new Error('Could not find module ' + name + ' required by: ' + referrerName);\n } else {\n throw new Error('Could not find module ' + name);\n }\n }\n\n function internalRequire(_name, referrerName) {\n var name = _name;\n var mod = registry[name];\n\n if (!mod) {\n name = name + '/index';\n mod = registry[name];\n }\n\n var exports = seen[name];\n\n if (exports !== undefined) {\n return exports;\n }\n\n exports = seen[name] = {};\n\n if (!mod) {\n missingModule(_name, referrerName);\n }\n\n var deps = mod.deps;\n var callback = mod.callback;\n var reified = new Array(deps.length);\n\n for (var i = 0; i < deps.length; i++) {\n if (deps[i] === 'exports') {\n reified[i] = exports;\n } else if (deps[i] === 'require') {\n reified[i] = requireModule;\n } else {\n reified[i] = internalRequire(deps[i], name);\n }\n }\n\n callback.apply(this, reified);\n\n return exports;\n }\n\n requireModule._eak_seen = registry;\n\n Ember.__loader = {\n define: enifed,\n require: requireModule,\n registry: registry\n };\n } else {\n enifed = Ember.__loader.define;\n requireModule = Ember.__loader.require;\n }\n})();\n","enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'ember/features', 'ember-environment'], function (exports, _emberBabel, _emberUtils, _emberDebug, _features) {\n 'use strict';\n\n exports.Container = exports.privatize = exports.Registry = undefined;\n\n\n /* globals Proxy */\n var CONTAINER_OVERRIDE = (0, _emberUtils.symbol)('CONTAINER_OVERRIDE');\n\n /**\n A container used to instantiate and cache objects.\n \n Every `Container` must be associated with a `Registry`, which is referenced\n to determine the factory and options that should be used to instantiate\n objects.\n \n The public API for `Container` is still in flux and should not be considered\n stable.\n \n @private\n @class Container\n */\n function Container(registry) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n this.registry = registry;\n this.owner = options.owner || null;\n this.cache = (0, _emberUtils.dictionary)(options.cache || null);\n this.factoryManagerCache = (0, _emberUtils.dictionary)(options.factoryManagerCache || null);\n this[CONTAINER_OVERRIDE] = undefined;\n this.isDestroyed = false;\n\n if (true) {\n this.validationCache = (0, _emberUtils.dictionary)(options.validationCache || null);\n }\n }\n\n Container.prototype = {\n lookup: function (fullName, options) {\n (true && !(this.registry.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.registry.validateFullName(fullName)));\n\n return lookup(this, this.registry.normalize(fullName), options);\n },\n destroy: function () {\n destroyDestroyables(this);\n this.isDestroyed = true;\n },\n reset: function (fullName) {\n if (fullName !== undefined) {\n resetMember(this, this.registry.normalize(fullName));\n } else {\n resetCache(this);\n }\n },\n ownerInjection: function () {\n var _ref;\n\n return _ref = {}, _ref[_emberUtils.OWNER] = this.owner, _ref;\n },\n _resolverCacheKey: function (name, options) {\n return this.registry.resolverCacheKey(name, options);\n },\n factoryFor: function (fullName) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var normalizedName = this.registry.normalize(fullName);\n\n (true && !(this.registry.validateFullName(normalizedName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.registry.validateFullName(normalizedName)));\n\n\n if (options.source) {\n var expandedFullName = this.registry.expandLocalLookup(fullName, options);\n // if expandLocalLookup returns falsey, we do not support local lookup\n if (_features.EMBER_MODULE_UNIFICATION) {\n if (expandedFullName) {\n // with ember-module-unification, if expandLocalLookup returns something,\n // pass it to the resolve without the source\n normalizedName = expandedFullName;\n options = {};\n }\n } else {\n if (!expandedFullName) {\n return;\n }\n\n normalizedName = expandedFullName;\n }\n }\n\n var cacheKey = this._resolverCacheKey(normalizedName, options);\n var cached = this.factoryManagerCache[cacheKey];\n\n if (cached !== undefined) {\n return cached;\n }\n\n var factory = void 0;\n if (_features.EMBER_MODULE_UNIFICATION) {\n factory = this.registry.resolve(normalizedName, options);\n } else {\n factory = this.registry.resolve(normalizedName);\n }\n\n if (factory === undefined) {\n return;\n }\n\n if (true && factory && typeof factory._onLookup === 'function') {\n factory._onLookup(fullName);\n }\n\n var manager = new FactoryManager(this, factory, fullName, normalizedName);\n\n if (true) {\n manager = wrapManagerInDeprecationProxy(manager);\n }\n\n this.factoryManagerCache[cacheKey] = manager;\n return manager;\n }\n };\n\n /*\n * Wrap a factory manager in a proxy which will not permit properties to be\n * set on the manager.\n */\n function wrapManagerInDeprecationProxy(manager) {\n if (_emberUtils.HAS_NATIVE_PROXY) {\n var validator = {\n set: function (obj, prop, value) {\n throw new Error('You attempted to set \"' + prop + '\" on a factory manager created by container#factoryFor. A factory manager is a read-only construct.');\n }\n };\n\n // Note:\n // We have to proxy access to the manager here so that private property\n // access doesn't cause the above errors to occur.\n var m = manager;\n var proxiedManager = {\n class: m.class,\n create: function (props) {\n return m.create(props);\n }\n };\n\n return new Proxy(proxiedManager, validator);\n }\n\n return manager;\n }\n\n function isSingleton(container, fullName) {\n return container.registry.getOption(fullName, 'singleton') !== false;\n }\n\n function isInstantiatable(container, fullName) {\n return container.registry.getOption(fullName, 'instantiate') !== false;\n }\n\n function lookup(container, fullName) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n if (options.source) {\n var expandedFullName = container.registry.expandLocalLookup(fullName, options);\n\n if (_features.EMBER_MODULE_UNIFICATION) {\n if (expandedFullName) {\n // with ember-module-unification, if expandLocalLookup returns something,\n // pass it to the resolve without the source\n fullName = expandedFullName;\n options = {};\n }\n } else {\n // if expandLocalLookup returns falsey, we do not support local lookup\n if (!expandedFullName) {\n return;\n }\n\n fullName = expandedFullName;\n }\n }\n\n var cacheKey = container._resolverCacheKey(fullName, options);\n var cached = container.cache[cacheKey];\n if (cached !== undefined && options.singleton !== false) {\n return cached;\n }\n\n return instantiateFactory(container, fullName, options);\n }\n\n function isSingletonClass(container, fullName, _ref2) {\n var instantiate = _ref2.instantiate,\n singleton = _ref2.singleton;\n\n return singleton !== false && !instantiate && isSingleton(container, fullName) && !isInstantiatable(container, fullName);\n }\n\n function isSingletonInstance(container, fullName, _ref3) {\n var instantiate = _ref3.instantiate,\n singleton = _ref3.singleton;\n\n return singleton !== false && instantiate !== false && isSingleton(container, fullName) && isInstantiatable(container, fullName);\n }\n\n function isFactoryClass(container, fullname, _ref4) {\n var instantiate = _ref4.instantiate,\n singleton = _ref4.singleton;\n\n return instantiate === false && (singleton === false || !isSingleton(container, fullname)) && !isInstantiatable(container, fullname);\n }\n\n function isFactoryInstance(container, fullName, _ref5) {\n var instantiate = _ref5.instantiate,\n singleton = _ref5.singleton;\n\n return instantiate !== false && (singleton !== false || isSingleton(container, fullName)) && isInstantiatable(container, fullName);\n }\n\n function instantiateFactory(container, fullName, options) {\n\n var factoryManager = void 0;\n if (_features.EMBER_MODULE_UNIFICATION) {\n if (options && options.source) {\n factoryManager = container.factoryFor(fullName, options);\n } else {\n factoryManager = container.factoryFor(fullName);\n }\n } else {\n factoryManager = container.factoryFor(fullName);\n }\n\n if (factoryManager === undefined) {\n return;\n }\n\n var cacheKey = container._resolverCacheKey(fullName, options);\n\n // SomeClass { singleton: true, instantiate: true } | { singleton: true } | { instantiate: true } | {}\n // By default majority of objects fall into this case\n if (isSingletonInstance(container, fullName, options)) {\n return container.cache[cacheKey] = factoryManager.create();\n }\n\n // SomeClass { singleton: false, instantiate: true }\n if (isFactoryInstance(container, fullName, options)) {\n return factoryManager.create();\n }\n\n // SomeClass { singleton: true, instantiate: false } | { instantiate: false } | { singleton: false, instantiation: false }\n if (isSingletonClass(container, fullName, options) || isFactoryClass(container, fullName, options)) {\n return factoryManager.class;\n }\n\n throw new Error('Could not create factory');\n }\n\n function markInjectionsAsDynamic(injections) {\n injections._dynamic = true;\n }\n\n function areInjectionsNotDynamic(injections) {\n return injections._dynamic !== true;\n }\n\n function buildInjections() /* container, ...injections */{\n var hash = {};\n\n if (arguments.length > 1) {\n var container = arguments[0];\n var injections = [];\n var injection = void 0;\n\n for (var i = 1; i < arguments.length; i++) {\n if (arguments[i]) {\n injections = injections.concat(arguments[i]);\n }\n }\n\n if (true) {\n container.registry.validateInjections(injections);\n }\n\n var markAsDynamic = false;\n for (var _i = 0; _i < injections.length; _i++) {\n injection = injections[_i];\n hash[injection.property] = lookup(container, injection.fullName);\n if (!markAsDynamic) {\n markAsDynamic = !isSingleton(container, injection.fullName);\n }\n }\n\n if (markAsDynamic) {\n markInjectionsAsDynamic(hash);\n }\n }\n\n return hash;\n }\n\n function injectionsFor(container, fullName) {\n var registry = container.registry;\n var splitName = fullName.split(':');\n var type = splitName[0];\n\n var injections = buildInjections(container, registry.getTypeInjections(type), registry.getInjections(fullName));\n\n return injections;\n }\n\n function destroyDestroyables(container) {\n var cache = container.cache;\n var keys = Object.keys(cache);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = cache[key];\n\n if (isInstantiatable(container, key) && value.destroy) {\n value.destroy();\n }\n }\n }\n\n function resetCache(container) {\n destroyDestroyables(container);\n container.cache.dict = (0, _emberUtils.dictionary)(null);\n }\n\n function resetMember(container, fullName) {\n var member = container.cache[fullName];\n\n delete container.factoryManagerCache[fullName];\n\n if (member) {\n delete container.cache[fullName];\n\n if (member.destroy) {\n member.destroy();\n }\n }\n }\n\n var FactoryManager = function () {\n function FactoryManager(container, factory, fullName, normalizedName) {\n (0, _emberBabel.classCallCheck)(this, FactoryManager);\n\n this.container = container;\n this.owner = container.owner;\n this.class = factory;\n this.fullName = fullName;\n this.normalizedName = normalizedName;\n this.madeToString = undefined;\n this.injections = undefined;\n }\n\n FactoryManager.prototype.toString = function toString() {\n if (!this.madeToString) {\n this.madeToString = this.container.registry.makeToString(this.class, this.fullName);\n }\n\n return this.madeToString;\n };\n\n FactoryManager.prototype.create = function create() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var injections = this.injections;\n if (injections === undefined) {\n injections = injectionsFor(this.container, this.normalizedName);\n if (areInjectionsNotDynamic(injections)) {\n this.injections = injections;\n }\n }\n var props = (0, _emberUtils.assign)({}, injections, options);\n\n if (true) {\n var lazyInjections = void 0;\n var validationCache = this.container.validationCache;\n // Ensure that all lazy injections are valid at instantiation time\n if (!validationCache[this.fullName] && this.class && typeof this.class._lazyInjections === 'function') {\n lazyInjections = this.class._lazyInjections();\n lazyInjections = this.container.registry.normalizeInjectionsHash(lazyInjections);\n\n this.container.registry.validateInjections(lazyInjections);\n }\n\n validationCache[this.fullName] = true;\n }\n\n if (!this.class.create) {\n throw new Error('Failed to create an instance of \\'' + this.normalizedName + '\\'. Most likely an improperly defined class or' + ' an invalid module export.');\n }\n\n // required to allow access to things like\n // the customized toString, _debugContainerKey,\n // owner, etc. without a double extend and without\n // modifying the objects properties\n if (typeof this.class._initFactory === 'function') {\n this.class._initFactory(this);\n } else {\n // in the non-Ember.Object case we need to still setOwner\n // this is required for supporting glimmer environment and\n // template instantiation which rely heavily on\n // `options[OWNER]` being passed into `create`\n // TODO: clean this up, and remove in future versions\n (0, _emberUtils.setOwner)(props, this.owner);\n }\n\n return this.class.create(props);\n };\n\n return FactoryManager;\n }();\n\n var VALID_FULL_NAME_REGEXP = /^[^:]+:[^:]+$/;\n\n /**\n A registry used to store factory and option information keyed\n by type.\n \n A `Registry` stores the factory and option information needed by a\n `Container` to instantiate and cache objects.\n \n The API for `Registry` is still in flux and should not be considered stable.\n \n @private\n @class Registry\n @since 1.11.0\n */\n function Registry() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n this.fallback = options.fallback || null;\n\n if (options.resolver) {\n this.resolver = options.resolver;\n if (typeof this.resolver === 'function') {\n deprecateResolverFunction(this);\n }\n }\n\n this.registrations = (0, _emberUtils.dictionary)(options.registrations || null);\n\n this._typeInjections = (0, _emberUtils.dictionary)(null);\n this._injections = (0, _emberUtils.dictionary)(null);\n\n this._localLookupCache = Object.create(null);\n this._normalizeCache = (0, _emberUtils.dictionary)(null);\n this._resolveCache = (0, _emberUtils.dictionary)(null);\n this._failCache = (0, _emberUtils.dictionary)(null);\n\n this._options = (0, _emberUtils.dictionary)(null);\n this._typeOptions = (0, _emberUtils.dictionary)(null);\n }\n\n Registry.prototype = {\n /**\n A backup registry for resolving registrations when no matches can be found.\n @private\n @property fallback\n @type Registry\n */\n fallback: null,\n\n /**\n An object that has a `resolve` method that resolves a name.\n @private\n @property resolver\n @type Resolver\n */\n resolver: null,\n\n /**\n @private\n @property registrations\n @type InheritingDict\n */\n registrations: null,\n\n /**\n @private\n @property _typeInjections\n @type InheritingDict\n */\n _typeInjections: null,\n\n /**\n @private\n @property _injections\n @type InheritingDict\n */\n _injections: null,\n\n /**\n @private\n @property _normalizeCache\n @type InheritingDict\n */\n _normalizeCache: null,\n\n /**\n @private\n @property _resolveCache\n @type InheritingDict\n */\n _resolveCache: null,\n\n /**\n @private\n @property _options\n @type InheritingDict\n */\n _options: null,\n\n /**\n @private\n @property _typeOptions\n @type InheritingDict\n */\n _typeOptions: null,\n\n container: function (options) {\n return new Container(this, options);\n },\n register: function (fullName, factory) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName)));\n\n\n if (factory === undefined) {\n throw new TypeError('Attempting to register an unknown factory: \\'' + fullName + '\\'');\n }\n\n var normalizedName = this.normalize(fullName);\n\n if (this._resolveCache[normalizedName]) {\n throw new Error('Cannot re-register: \\'' + fullName + '\\', as it has already been resolved.');\n }\n\n delete this._failCache[normalizedName];\n this.registrations[normalizedName] = factory;\n this._options[normalizedName] = options;\n },\n unregister: function (fullName) {\n (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName)));\n\n\n var normalizedName = this.normalize(fullName);\n\n this._localLookupCache = Object.create(null);\n\n delete this.registrations[normalizedName];\n delete this._resolveCache[normalizedName];\n delete this._failCache[normalizedName];\n delete this._options[normalizedName];\n },\n resolve: function (fullName, options) {\n (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName)));\n\n var factory = resolve(this, this.normalize(fullName), options);\n if (factory === undefined && this.fallback) {\n var _fallback;\n\n factory = (_fallback = this.fallback).resolve.apply(_fallback, arguments);\n }\n return factory;\n },\n describe: function (fullName) {\n if (this.resolver && this.resolver.lookupDescription) {\n return this.resolver.lookupDescription(fullName);\n } else if (this.fallback) {\n return this.fallback.describe(fullName);\n } else {\n return fullName;\n }\n },\n normalizeFullName: function (fullName) {\n if (this.resolver && this.resolver.normalize) {\n return this.resolver.normalize(fullName);\n } else if (this.fallback) {\n return this.fallback.normalizeFullName(fullName);\n } else {\n return fullName;\n }\n },\n normalize: function (fullName) {\n return this._normalizeCache[fullName] || (this._normalizeCache[fullName] = this.normalizeFullName(fullName));\n },\n makeToString: function (factory, fullName) {\n if (this.resolver && this.resolver.makeToString) {\n return this.resolver.makeToString(factory, fullName);\n } else if (this.fallback) {\n return this.fallback.makeToString(factory, fullName);\n } else {\n return factory.toString();\n }\n },\n has: function (fullName, options) {\n if (!this.isValidFullName(fullName)) {\n return false;\n }\n\n var source = options && options.source && this.normalize(options.source);\n\n return has(this, this.normalize(fullName), source);\n },\n optionsForType: function (type, options) {\n this._typeOptions[type] = options;\n },\n getOptionsForType: function (type) {\n var optionsForType = this._typeOptions[type];\n if (optionsForType === undefined && this.fallback) {\n optionsForType = this.fallback.getOptionsForType(type);\n }\n return optionsForType;\n },\n options: function (fullName) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var normalizedName = this.normalize(fullName);\n this._options[normalizedName] = options;\n },\n getOptions: function (fullName) {\n var normalizedName = this.normalize(fullName);\n var options = this._options[normalizedName];\n\n if (options === undefined && this.fallback) {\n options = this.fallback.getOptions(fullName);\n }\n return options;\n },\n getOption: function (fullName, optionName) {\n var options = this._options[fullName];\n\n if (options && options[optionName] !== undefined) {\n return options[optionName];\n }\n\n var type = fullName.split(':')[0];\n options = this._typeOptions[type];\n\n if (options && options[optionName] !== undefined) {\n return options[optionName];\n } else if (this.fallback) {\n return this.fallback.getOption(fullName, optionName);\n }\n },\n typeInjection: function (type, property, fullName) {\n (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName)));\n\n\n var fullNameType = fullName.split(':')[0];\n if (fullNameType === type) {\n throw new Error('Cannot inject a \\'' + fullName + '\\' on other ' + type + '(s).');\n }\n\n var injections = this._typeInjections[type] || (this._typeInjections[type] = []);\n\n injections.push({\n property: property,\n fullName: fullName\n });\n },\n injection: function (fullName, property, injectionName) {\n this.validateFullName(injectionName);\n var normalizedInjectionName = this.normalize(injectionName);\n\n if (fullName.indexOf(':') === -1) {\n return this.typeInjection(fullName, property, normalizedInjectionName);\n }\n\n (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName)));\n\n var normalizedName = this.normalize(fullName);\n\n var injections = this._injections[normalizedName] || (this._injections[normalizedName] = []);\n\n injections.push({\n property: property,\n fullName: normalizedInjectionName\n });\n },\n knownForType: function (type) {\n var fallbackKnown = void 0,\n resolverKnown = void 0;\n\n var localKnown = (0, _emberUtils.dictionary)(null);\n var registeredNames = Object.keys(this.registrations);\n for (var index = 0; index < registeredNames.length; index++) {\n var fullName = registeredNames[index];\n var itemType = fullName.split(':')[0];\n\n if (itemType === type) {\n localKnown[fullName] = true;\n }\n }\n\n if (this.fallback) {\n fallbackKnown = this.fallback.knownForType(type);\n }\n\n if (this.resolver && this.resolver.knownForType) {\n resolverKnown = this.resolver.knownForType(type);\n }\n\n return (0, _emberUtils.assign)({}, fallbackKnown, localKnown, resolverKnown);\n },\n validateFullName: function (fullName) {\n if (!this.isValidFullName(fullName)) {\n throw new TypeError('Invalid Fullname, expected: \\'type:name\\' got: ' + fullName);\n }\n\n return true;\n },\n isValidFullName: function (fullName) {\n return VALID_FULL_NAME_REGEXP.test(fullName);\n },\n normalizeInjectionsHash: function (hash) {\n var injections = [];\n\n for (var key in hash) {\n if (hash.hasOwnProperty(key)) {\n (true && !(this.validateFullName(hash[key])) && (0, _emberDebug.assert)('Expected a proper full name, given \\'' + hash[key] + '\\'', this.validateFullName(hash[key])));\n\n\n injections.push({\n property: key,\n fullName: hash[key]\n });\n }\n }\n\n return injections;\n },\n getInjections: function (fullName) {\n var injections = this._injections[fullName] || [];\n if (this.fallback) {\n injections = injections.concat(this.fallback.getInjections(fullName));\n }\n return injections;\n },\n getTypeInjections: function (type) {\n var injections = this._typeInjections[type] || [];\n if (this.fallback) {\n injections = injections.concat(this.fallback.getTypeInjections(type));\n }\n return injections;\n },\n resolverCacheKey: function (name, options) {\n if (_features.EMBER_MODULE_UNIFICATION) {\n return options && options.source ? options.source + ':' + name : name;\n } else {\n return name;\n }\n }\n };\n\n function deprecateResolverFunction(registry) {\n (true && !(false) && (0, _emberDebug.deprecate)('Passing a `resolver` function into a Registry is deprecated. Please pass in a Resolver object with a `resolve` method.', false, { id: 'ember-application.registry-resolver-as-function', until: '3.0.0', url: 'https://emberjs.com/deprecations/v2.x#toc_registry-resolver-as-function' }));\n\n registry.resolver = {\n resolve: registry.resolver\n };\n }\n\n if (true) {\n Registry.prototype.validateInjections = function (injections) {\n if (!injections) {\n return;\n }\n\n var fullName = void 0;\n\n for (var i = 0; i < injections.length; i++) {\n fullName = injections[i].fullName;\n\n (true && !(this.has(fullName)) && (0, _emberDebug.assert)('Attempting to inject an unknown injection: \\'' + fullName + '\\'', this.has(fullName)));\n }\n };\n }\n\n /**\n Given a fullName and a source fullName returns the fully resolved\n fullName. Used to allow for local lookup.\n \n ```javascript\n let registry = new Registry();\n \n // the twitter factory is added to the module system\n registry.expandLocalLookup('component:post-title', { source: 'template:post' }) // => component:post/post-title\n ```\n \n @private\n @method expandLocalLookup\n @param {String} fullName\n @param {Object} [options]\n @param {String} [options.source] the fullname of the request source (used for local lookups)\n @return {String} fullName\n */\n Registry.prototype.expandLocalLookup = function Registry_expandLocalLookup(fullName, options) {\n if (this.resolver && this.resolver.expandLocalLookup) {\n (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName)));\n (true && !(options && options.source) && (0, _emberDebug.assert)('options.source must be provided to expandLocalLookup', options && options.source));\n (true && !(this.validateFullName(options.source)) && (0, _emberDebug.assert)('options.source must be a proper full name', this.validateFullName(options.source)));\n\n\n var normalizedFullName = this.normalize(fullName);\n var normalizedSource = this.normalize(options.source);\n\n return expandLocalLookup(this, normalizedFullName, normalizedSource);\n } else if (this.fallback) {\n return this.fallback.expandLocalLookup(fullName, options);\n } else {\n return null;\n }\n };\n\n function expandLocalLookup(registry, normalizedName, normalizedSource) {\n var cache = registry._localLookupCache;\n var normalizedNameCache = cache[normalizedName];\n\n if (!normalizedNameCache) {\n normalizedNameCache = cache[normalizedName] = Object.create(null);\n }\n\n var cached = normalizedNameCache[normalizedSource];\n\n if (cached !== undefined) {\n return cached;\n }\n\n var expanded = registry.resolver.expandLocalLookup(normalizedName, normalizedSource);\n\n return normalizedNameCache[normalizedSource] = expanded;\n }\n\n function resolve(registry, normalizedName, options) {\n if (options && options.source) {\n // when `source` is provided expand normalizedName\n // and source into the full normalizedName\n var expandedNormalizedName = registry.expandLocalLookup(normalizedName, options);\n\n if (_features.EMBER_MODULE_UNIFICATION) {\n if (expandedNormalizedName) {\n // with ember-module-unification, if expandLocalLookup returns something,\n // pass it to the resolve without the source\n normalizedName = expandedNormalizedName;\n options = {};\n }\n } else {\n // if expandLocalLookup returns falsey, we do not support local lookup\n if (!expandedNormalizedName) {\n return;\n }\n\n normalizedName = expandedNormalizedName;\n }\n }\n\n var cacheKey = registry.resolverCacheKey(normalizedName, options);\n var cached = registry._resolveCache[cacheKey];\n if (cached !== undefined) {\n return cached;\n }\n if (registry._failCache[cacheKey]) {\n return;\n }\n\n var resolved = void 0;\n\n if (registry.resolver) {\n resolved = registry.resolver.resolve(normalizedName, options && options.source);\n }\n\n if (resolved === undefined) {\n resolved = registry.registrations[normalizedName];\n }\n\n if (resolved === undefined) {\n registry._failCache[cacheKey] = true;\n } else {\n registry._resolveCache[cacheKey] = resolved;\n }\n\n return resolved;\n }\n\n function has(registry, fullName, source) {\n return registry.resolve(fullName, { source: source }) !== undefined;\n }\n\n var privateNames = (0, _emberUtils.dictionary)(null);\n var privateSuffix = ('' + Math.random() + Date.now()).replace('.', '');\n\n function privatize(_ref6) {\n var fullName = _ref6[0];\n\n var name = privateNames[fullName];\n if (name) {\n return name;\n }\n\n var _fullName$split = fullName.split(':'),\n type = _fullName$split[0],\n rawName = _fullName$split[1];\n\n return privateNames[fullName] = (0, _emberUtils.intern)(type + ':' + rawName + '-' + privateSuffix);\n }\n\n /*\n Public API for the container is still in flux.\n The public API, specified on the application namespace should be considered the stable API.\n // @module container\n @private\n */\n\n exports.Registry = Registry;\n exports.privatize = privatize;\n exports.Container = Container;\n});","enifed('ember-babel', ['exports'], function (exports) {\n 'use strict';\n\n exports.classCallCheck = classCallCheck;\n exports.inherits = inherits;\n exports.taggedTemplateLiteralLoose = taggedTemplateLiteralLoose;\n exports.createClass = createClass;\n exports.defaults = defaults;\n function classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function');\n }\n }\n\n function inherits(subClass, superClass) {\n if (typeof superClass !== 'function' && superClass !== null) {\n throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : defaults(subClass, superClass);\n }\n\n function taggedTemplateLiteralLoose(strings, raw) {\n strings.raw = raw;\n return strings;\n }\n\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function createClass(Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n function defaults(obj, defaults) {\n var keys = Object.getOwnPropertyNames(defaults);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = Object.getOwnPropertyDescriptor(defaults, key);\n if (value && value.configurable && obj[key] === undefined) {\n Object.defineProperty(obj, key, value);\n }\n }\n return obj;\n }\n\n var possibleConstructorReturn = exports.possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError('this hasn\\'t been initialized - super() hasn\\'t been called');\n }\n return call && (typeof call === 'object' || typeof call === 'function') ? call : self;\n };\n\n var slice = exports.slice = Array.prototype.slice;\n});","enifed('ember-console', ['exports', 'ember-environment'], function (exports, _emberEnvironment) {\n 'use strict';\n\n function K() {}\n\n function consoleMethod(name) {\n var consoleObj = void 0;\n if (_emberEnvironment.context.imports.console) {\n consoleObj = _emberEnvironment.context.imports.console;\n } else if (typeof console !== 'undefined') {\n // eslint-disable-line no-undef\n consoleObj = console; // eslint-disable-line no-undef\n }\n\n var method = typeof consoleObj === 'object' ? consoleObj[name] : null;\n\n if (typeof method !== 'function') {\n return;\n }\n\n if (typeof method.bind === 'function') {\n return method.bind(consoleObj);\n }\n\n return function () {\n method.apply(consoleObj, arguments);\n };\n }\n\n function assertPolyfill(test, message) {\n if (!test) {\n try {\n // attempt to preserve the stack\n throw new Error('assertion failed: ' + message);\n } catch (error) {\n setTimeout(function () {\n throw error;\n }, 0);\n }\n }\n }\n\n /**\n Inside Ember-Metal, simply uses the methods from `imports.console`.\n Override this to provide more robust logging functionality.\n \n @class Logger\n @namespace Ember\n @public\n */\n var index = {\n /**\n Logs the arguments to the console.\n You can pass as many arguments as you want and they will be joined together with a space.\n ```javascript\n var foo = 1;\n Ember.Logger.log('log value of foo:', foo);\n // \"log value of foo: 1\" will be printed to the console\n ```\n @method log\n @for Ember.Logger\n @param {*} arguments\n @public\n */\n log: consoleMethod('log') || K,\n\n /**\n Prints the arguments to the console with a warning icon.\n You can pass as many arguments as you want and they will be joined together with a space.\n ```javascript\n Ember.Logger.warn('Something happened!');\n // \"Something happened!\" will be printed to the console with a warning icon.\n ```\n @method warn\n @for Ember.Logger\n @param {*} arguments\n @public\n */\n warn: consoleMethod('warn') || K,\n\n /**\n Prints the arguments to the console with an error icon, red text and a stack trace.\n You can pass as many arguments as you want and they will be joined together with a space.\n ```javascript\n Ember.Logger.error('Danger! Danger!');\n // \"Danger! Danger!\" will be printed to the console in red text.\n ```\n @method error\n @for Ember.Logger\n @param {*} arguments\n @public\n */\n error: consoleMethod('error') || K,\n\n /**\n Logs the arguments to the console.\n You can pass as many arguments as you want and they will be joined together with a space.\n ```javascript\n var foo = 1;\n Ember.Logger.info('log value of foo:', foo);\n // \"log value of foo: 1\" will be printed to the console\n ```\n @method info\n @for Ember.Logger\n @param {*} arguments\n @public\n */\n info: consoleMethod('info') || K,\n\n /**\n Logs the arguments to the console in blue text.\n You can pass as many arguments as you want and they will be joined together with a space.\n ```javascript\n var foo = 1;\n Ember.Logger.debug('log value of foo:', foo);\n // \"log value of foo: 1\" will be printed to the console\n ```\n @method debug\n @for Ember.Logger\n @param {*} arguments\n @public\n */\n debug: consoleMethod('debug') || consoleMethod('info') || K,\n\n /**\n If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace.\n ```javascript\n Ember.Logger.assert(true); // undefined\n Ember.Logger.assert(true === false); // Throws an Assertion failed error.\n Ember.Logger.assert(true === false, 'Something invalid'); // Throws an Assertion failed error with message.\n ```\n @method assert\n @for Ember.Logger\n @param {Boolean} bool Value to test\n @param {String} message Assertion message on failed\n @public\n */\n assert: consoleMethod('assert') || assertPolyfill\n };\n\n exports.default = index;\n});","enifed('ember-environment', ['exports'], function (exports) {\n 'use strict';\n\n /* globals global, window, self, mainContext */\n\n // from lodash to catch fake globals\n function checkGlobal(value) {\n return value && value.Object === Object ? value : undefined;\n }\n\n // element ids can ruin global miss checks\n function checkElementIdShadowing(value) {\n return value && value.nodeType === undefined ? value : undefined;\n }\n\n // export real global\n var global$1 = checkGlobal(checkElementIdShadowing(typeof global === 'object' && global)) || checkGlobal(typeof self === 'object' && self) || checkGlobal(typeof window === 'object' && window) || mainContext || // set before strict mode in Ember loader/wrapper\n new Function('return this')(); // eval outside of strict mode\n\n function defaultTrue(v) {\n return v === false ? false : true;\n }\n\n function defaultFalse(v) {\n return v === true ? true : false;\n }\n\n function normalizeExtendPrototypes(obj) {\n if (obj === false) {\n return { String: false, Array: false, Function: false };\n } else if (!obj || obj === true) {\n return { String: true, Array: true, Function: true };\n } else {\n return {\n String: defaultTrue(obj.String),\n Array: defaultTrue(obj.Array),\n Function: defaultTrue(obj.Function)\n };\n }\n }\n\n /* globals module */\n /**\n The hash of environment variables used to control various configuration\n settings. To specify your own or override default settings, add the\n desired properties to a global hash named `EmberENV` (or `ENV` for\n backwards compatibility with earlier versions of Ember). The `EmberENV`\n hash must be created before loading Ember.\n \n @class EmberENV\n @type Object\n @public\n */\n var ENV = typeof global$1.EmberENV === 'object' && global$1.EmberENV || typeof global$1.ENV === 'object' && global$1.ENV || {};\n\n // ENABLE_ALL_FEATURES was documented, but you can't actually enable non optional features.\n if (ENV.ENABLE_ALL_FEATURES) {\n ENV.ENABLE_OPTIONAL_FEATURES = true;\n }\n\n /**\n Determines whether Ember should add to `Array`, `Function`, and `String`\n native object prototypes, a few extra methods in order to provide a more\n friendly API.\n \n We generally recommend leaving this option set to true however, if you need\n to turn it off, you can add the configuration property\n `EXTEND_PROTOTYPES` to `EmberENV` and set it to `false`.\n \n Note, when disabled (the default configuration for Ember Addons), you will\n instead have to access all methods and functions from the Ember\n namespace.\n \n @property EXTEND_PROTOTYPES\n @type Boolean\n @default true\n @for EmberENV\n @public\n */\n ENV.EXTEND_PROTOTYPES = normalizeExtendPrototypes(ENV.EXTEND_PROTOTYPES);\n\n /**\n The `LOG_STACKTRACE_ON_DEPRECATION` property, when true, tells Ember to log\n a full stack trace during deprecation warnings.\n \n @property LOG_STACKTRACE_ON_DEPRECATION\n @type Boolean\n @default true\n @for EmberENV\n @public\n */\n ENV.LOG_STACKTRACE_ON_DEPRECATION = defaultTrue(ENV.LOG_STACKTRACE_ON_DEPRECATION);\n\n /**\n The `LOG_VERSION` property, when true, tells Ember to log versions of all\n dependent libraries in use.\n \n @property LOG_VERSION\n @type Boolean\n @default true\n @for EmberENV\n @public\n */\n ENV.LOG_VERSION = defaultTrue(ENV.LOG_VERSION);\n\n /**\n Debug parameter you can turn on. This will log all bindings that fire to\n the console. This should be disabled in production code. Note that you\n can also enable this from the console or temporarily.\n \n @property LOG_BINDINGS\n @for EmberENV\n @type Boolean\n @default false\n @public\n */\n ENV.LOG_BINDINGS = defaultFalse(ENV.LOG_BINDINGS);\n\n ENV.RAISE_ON_DEPRECATION = defaultFalse(ENV.RAISE_ON_DEPRECATION);\n\n // check if window exists and actually is the global\n var hasDOM = typeof window !== 'undefined' && window === global$1 && window.document && window.document.createElement && !ENV.disableBrowserEnvironment; // is this a public thing?\n\n // legacy imports/exports/lookup stuff (should we keep this??)\n var originalContext = global$1.Ember || {};\n\n var context = {\n // import jQuery\n imports: originalContext.imports || global$1,\n // export Ember\n exports: originalContext.exports || global$1,\n // search for Namespaces\n lookup: originalContext.lookup || global$1\n };\n\n // TODO: cleanup single source of truth issues with this stuff\n var environment = hasDOM ? {\n hasDOM: true,\n isChrome: !!window.chrome && !window.opera,\n isFirefox: typeof InstallTrigger !== 'undefined',\n isPhantom: !!window.callPhantom,\n location: window.location,\n history: window.history,\n userAgent: window.navigator.userAgent,\n window: window\n } : {\n hasDOM: false,\n isChrome: false,\n isFirefox: false,\n isPhantom: false,\n location: null,\n history: null,\n userAgent: 'Lynx (textmode)',\n window: null\n };\n\n exports.ENV = ENV;\n exports.context = context;\n exports.environment = environment;\n});","enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-debug', 'ember-babel', 'ember/features', '@glimmer/reference', 'require', 'ember-console', 'backburner'], function (exports, emberEnvironment, emberUtils, emberDebug, emberBabel, ember_features, _glimmer_reference, require, Logger, Backburner) {\n 'use strict';\n\n require = 'default' in require ? require['default'] : require;\n Logger = 'default' in Logger ? Logger['default'] : Logger;\n Backburner = 'default' in Backburner ? Backburner['default'] : Backburner;\n\n /**\n @module ember\n @submodule ember-metal\n */\n\n /**\n This namespace contains all Ember methods and functions. Future versions of\n Ember may overwrite this namespace and therefore, you should avoid adding any\n new properties.\n \n At the heart of Ember is Ember-Runtime, a set of core functions that provide\n cross-platform compatibility and object property observing. Ember-Runtime is\n small and performance-focused so you can use it alongside other\n cross-platform libraries such as jQuery. For more details, see\n [Ember-Runtime](https://emberjs.com/api/modules/ember-runtime.html).\n \n @class Ember\n @static\n @public\n */\n var Ember = typeof emberEnvironment.context.imports.Ember === 'object' && emberEnvironment.context.imports.Ember || {};\n\n // Make sure these are set whether Ember was already defined or not\n Ember.isNamespace = true;\n Ember.toString = function () {\n return 'Ember';\n };\n\n /*\n When we render a rich template hierarchy, the set of events that\n *might* happen tends to be much larger than the set of events that\n actually happen. This implies that we should make listener creation &\n destruction cheap, even at the cost of making event dispatch more\n expensive.\n \n Thus we store a new listener with a single push and no new\n allocations, without even bothering to do deduplication -- we can\n save that for dispatch time, if an event actually happens.\n */\n\n /* listener flags */\n var ONCE = 1;\n var SUSPENDED = 2;\n\n var protoMethods = {\n addToListeners: function (eventName, target, method, flags) {\n if (this._listeners === undefined) {\n this._listeners = [];\n }\n this._listeners.push(eventName, target, method, flags);\n },\n _finalizeListeners: function () {\n if (this._listenersFinalized) {\n return;\n }\n if (this._listeners === undefined) {\n this._listeners = [];\n }\n var pointer = this.parent;\n while (pointer !== undefined) {\n var listeners = pointer._listeners;\n if (listeners !== undefined) {\n this._listeners = this._listeners.concat(listeners);\n }\n if (pointer._listenersFinalized) {\n break;\n }\n pointer = pointer.parent;\n }\n this._listenersFinalized = true;\n },\n removeFromListeners: function (eventName, target, method, didRemove) {\n var pointer = this;\n while (pointer !== undefined) {\n var listeners = pointer._listeners;\n if (listeners !== undefined) {\n for (var index = listeners.length - 4; index >= 0; index -= 4) {\n if (listeners[index] === eventName && (!method || listeners[index + 1] === target && listeners[index + 2] === method)) {\n if (pointer === this) {\n // we are modifying our own list, so we edit directly\n if (typeof didRemove === 'function') {\n didRemove(eventName, target, listeners[index + 2]);\n }\n listeners.splice(index, 4);\n } else {\n // we are trying to remove an inherited listener, so we do\n // just-in-time copying to detach our own listeners from\n // our inheritance chain.\n this._finalizeListeners();\n return this.removeFromListeners(eventName, target, method);\n }\n }\n }\n }\n if (pointer._listenersFinalized) {\n break;\n }\n pointer = pointer.parent;\n }\n },\n matchingListeners: function (eventName) {\n var pointer = this;\n var result = void 0;\n while (pointer !== undefined) {\n var listeners = pointer._listeners;\n if (listeners !== undefined) {\n for (var index = 0; index < listeners.length; index += 4) {\n if (listener